@redneckz/wildless-cms-uni-blocks 0.14.696 → 0.14.698
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/bin/migrate.js +2 -5
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +28 -18
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/RollupItem/getIconName.d.ts +1 -1
- package/bundle/icons/IconName.d.ts +218 -218
- package/bundle/model/LinkProps.d.ts +3 -3
- package/bundle/ui-kit/Input/getValidStyle.d.ts +1 -0
- package/bundle/utils/safeJsonParse.d.ts +1 -0
- package/cosmos-static/icons/sprites.svg +101 -101
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +2 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/dist/components/CreditCardForm/CreditCardForm.js +1 -2
- package/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/dist/components/CreditCardForm/CreditCardFormStatusTracker.js +1 -1
- package/dist/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
- package/dist/components/CreditForm/CreditForm.js +1 -2
- package/dist/components/CreditForm/CreditForm.js.map +1 -1
- package/dist/components/CreditForm/CreditFormStatusTracker.js +1 -1
- package/dist/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
- package/dist/components/RollupItem/getIconName.d.ts +1 -1
- package/dist/components/StepsBlock/renderStep.js +1 -1
- package/dist/components/StepsBlock/renderStep.js.map +1 -1
- package/dist/components/StepsBlock/renderStepMobile.js +1 -1
- package/dist/components/StepsBlock/renderStepMobile.js.map +1 -1
- package/dist/components/StickyBottomMenu/StickyBottomMenuDialog.js +1 -1
- package/dist/components/StickyBottomMenu/StickyBottomMenuDialog.js.map +1 -1
- package/dist/components/TextBlock/TextBlock.js +2 -2
- package/dist/components/TextBlock/TextBlock.js.map +1 -1
- package/dist/content-page-repository/ContentPageRepository.js +2 -3
- package/dist/content-page-repository/ContentPageRepository.js.map +1 -1
- package/dist/hooks/useLocalStorage.js +2 -1
- package/dist/hooks/useLocalStorage.js.map +1 -1
- package/dist/icons/IconName.d.ts +218 -218
- package/dist/icons/IconName.js +217 -217
- package/dist/icons/IconName.js.map +1 -1
- package/dist/model/LinkProps.d.ts +3 -3
- package/dist/ui-kit/Calculator/CalculatorStyle.js +1 -1
- package/dist/ui-kit/Calculator/CalculatorStyle.js.map +1 -1
- package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
- package/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
- package/dist/ui-kit/DialogManager/Dialog.js +1 -1
- package/dist/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +1 -1
- package/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/CreditCalcField.js +1 -1
- package/dist/ui-kit/FormField/Fields/CreditCalcField.js.map +1 -1
- package/dist/ui-kit/Input/Input.js +2 -3
- package/dist/ui-kit/Input/Input.js.map +1 -1
- package/dist/ui-kit/Input/getValidStyle.d.ts +1 -0
- package/dist/ui-kit/Input/getValidStyle.js +6 -0
- package/dist/ui-kit/Input/getValidStyle.js.map +1 -0
- package/dist/ui-kit/VerifyPhoneDialog/InputCode.js +2 -1
- package/dist/ui-kit/VerifyPhoneDialog/InputCode.js.map +1 -1
- package/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js +1 -1
- package/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/dist/utils/safeJsonParse.d.ts +1 -0
- package/dist/utils/safeJsonParse.js +12 -0
- package/dist/utils/safeJsonParse.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/ApplicationLeadForm/ApplicationLeadForm.fixture.mobile.d.ts +1 -0
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +2 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/components/CreditCardForm/CreditCardForm.fixture.mobile.d.ts +5 -0
- package/lib/components/CreditCardForm/CreditCardForm.js +1 -2
- package/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/lib/components/CreditCardForm/CreditCardFormStatusTracker.js +1 -1
- package/lib/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
- package/lib/components/CreditForm/CreditForm.fixture.mobile.d.ts +5 -0
- package/lib/components/CreditForm/CreditForm.js +1 -2
- package/lib/components/CreditForm/CreditForm.js.map +1 -1
- package/lib/components/CreditForm/CreditFormStatusTracker.js +1 -1
- package/lib/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
- package/lib/components/RollupItem/getIconName.d.ts +1 -1
- package/lib/components/StepsBlock/renderStep.js +1 -1
- package/lib/components/StepsBlock/renderStep.js.map +1 -1
- package/lib/components/StepsBlock/renderStepMobile.js +1 -1
- package/lib/components/StepsBlock/renderStepMobile.js.map +1 -1
- package/lib/components/StickyBottomMenu/StickyBottomMenuDialog.js +1 -1
- package/lib/components/StickyBottomMenu/StickyBottomMenuDialog.js.map +1 -1
- package/lib/components/TextBlock/TextBlock.js +2 -2
- package/lib/components/TextBlock/TextBlock.js.map +1 -1
- package/lib/content-page-repository/ContentPageRepository.js +2 -3
- package/lib/content-page-repository/ContentPageRepository.js.map +1 -1
- package/lib/hooks/useLocalStorage.js +2 -1
- package/lib/hooks/useLocalStorage.js.map +1 -1
- package/lib/icons/IconName.d.ts +218 -218
- package/lib/icons/IconName.js +217 -217
- package/lib/icons/IconName.js.map +1 -1
- package/lib/model/LinkProps.d.ts +3 -3
- package/lib/ui-kit/Calculator/CalculatorStyle.js +1 -1
- package/lib/ui-kit/Calculator/CalculatorStyle.js.map +1 -1
- package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
- package/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
- package/lib/ui-kit/DialogManager/Dialog.js +1 -1
- package/lib/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +1 -1
- package/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/CreditCalcField.js +1 -1
- package/lib/ui-kit/FormField/Fields/CreditCalcField.js.map +1 -1
- package/lib/ui-kit/Input/Input.js +1 -2
- package/lib/ui-kit/Input/Input.js.map +1 -1
- package/lib/ui-kit/Input/getValidStyle.d.ts +1 -0
- package/lib/ui-kit/Input/getValidStyle.js +3 -0
- package/lib/ui-kit/Input/getValidStyle.js.map +1 -0
- package/lib/ui-kit/VerifyPhoneDialog/InputCode.js +2 -1
- package/lib/ui-kit/VerifyPhoneDialog/InputCode.js.map +1 -1
- package/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js +1 -1
- package/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/lib/utils/safeJsonParse.d.ts +1 -0
- package/lib/utils/safeJsonParse.js +9 -0
- package/lib/utils/safeJsonParse.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +29 -19
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/RollupItem/getIconName.d.ts +1 -1
- package/mobile/bundle/icons/IconName.d.ts +218 -218
- package/mobile/bundle/model/LinkProps.d.ts +3 -3
- package/mobile/bundle/ui-kit/Input/getValidStyle.d.ts +1 -0
- package/mobile/bundle/utils/safeJsonParse.d.ts +1 -0
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +2 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/CreditCardForm.js +1 -2
- package/mobile/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/CreditCardFormStatusTracker.js +1 -1
- package/mobile/dist/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditForm.js +1 -2
- package/mobile/dist/components/CreditForm/CreditForm.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditFormStatusTracker.js +1 -1
- package/mobile/dist/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
- package/mobile/dist/components/RollupItem/getIconName.d.ts +1 -1
- package/mobile/dist/components/StepsBlock/renderStep.js +1 -1
- package/mobile/dist/components/StepsBlock/renderStep.js.map +1 -1
- package/mobile/dist/components/StepsBlock/renderStepMobile.js +1 -1
- package/mobile/dist/components/StepsBlock/renderStepMobile.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuDialog.js +1 -1
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuDialog.js.map +1 -1
- package/mobile/dist/components/TextBlock/TextBlock.js +2 -2
- package/mobile/dist/components/TextBlock/TextBlock.js.map +1 -1
- package/mobile/dist/content-page-repository/ContentPageRepository.js +2 -3
- package/mobile/dist/content-page-repository/ContentPageRepository.js.map +1 -1
- package/mobile/dist/hooks/useLocalStorage.js +2 -1
- package/mobile/dist/hooks/useLocalStorage.js.map +1 -1
- package/mobile/dist/icons/IconName.d.ts +218 -218
- package/mobile/dist/icons/IconName.js +217 -217
- package/mobile/dist/icons/IconName.js.map +1 -1
- package/mobile/dist/model/LinkProps.d.ts +3 -3
- package/mobile/dist/ui-kit/Calculator/CalculatorStyle.js +1 -1
- package/mobile/dist/ui-kit/Calculator/CalculatorStyle.js.map +1 -1
- package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
- package/mobile/dist/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
- package/mobile/dist/ui-kit/DialogManager/Dialog.js +1 -1
- package/mobile/dist/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/mobile/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +1 -1
- package/mobile/dist/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/CreditCalcField.js +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/CreditCalcField.js.map +1 -1
- package/mobile/dist/ui-kit/Input/Input.js +2 -3
- package/mobile/dist/ui-kit/Input/Input.js.map +1 -1
- package/mobile/dist/ui-kit/Input/getValidStyle.d.ts +1 -0
- package/mobile/dist/ui-kit/Input/getValidStyle.js +6 -0
- package/mobile/dist/ui-kit/Input/getValidStyle.js.map +1 -0
- package/mobile/dist/ui-kit/VerifyPhoneDialog/InputCode.js +2 -1
- package/mobile/dist/ui-kit/VerifyPhoneDialog/InputCode.js.map +1 -1
- package/mobile/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js +1 -1
- package/mobile/dist/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/mobile/dist/utils/safeJsonParse.d.ts +1 -0
- package/mobile/dist/utils/safeJsonParse.js +12 -0
- package/mobile/dist/utils/safeJsonParse.js.map +1 -0
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +2 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardForm.js +1 -2
- package/mobile/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardFormStatusTracker.js +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditForm.js +1 -2
- package/mobile/lib/components/CreditForm/CreditForm.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditFormStatusTracker.js +1 -1
- package/mobile/lib/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
- package/mobile/lib/components/RollupItem/getIconName.d.ts +1 -1
- package/mobile/lib/components/StepsBlock/renderStep.js +1 -1
- package/mobile/lib/components/StepsBlock/renderStep.js.map +1 -1
- package/mobile/lib/components/StepsBlock/renderStepMobile.js +1 -1
- package/mobile/lib/components/StepsBlock/renderStepMobile.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuDialog.js +1 -1
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuDialog.js.map +1 -1
- package/mobile/lib/components/TextBlock/TextBlock.js +2 -2
- package/mobile/lib/components/TextBlock/TextBlock.js.map +1 -1
- package/mobile/lib/content-page-repository/ContentPageRepository.js +2 -3
- package/mobile/lib/content-page-repository/ContentPageRepository.js.map +1 -1
- package/mobile/lib/hooks/useLocalStorage.js +2 -1
- package/mobile/lib/hooks/useLocalStorage.js.map +1 -1
- package/mobile/lib/icons/IconName.d.ts +218 -218
- package/mobile/lib/icons/IconName.js +217 -217
- package/mobile/lib/icons/IconName.js.map +1 -1
- package/mobile/lib/model/LinkProps.d.ts +3 -3
- package/mobile/lib/ui-kit/Calculator/CalculatorStyle.js +1 -1
- package/mobile/lib/ui-kit/Calculator/CalculatorStyle.js.map +1 -1
- package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js +1 -1
- package/mobile/lib/ui-kit/ConsentBkiDialog/ConsentBkiDialog.js.map +1 -1
- package/mobile/lib/ui-kit/DialogManager/Dialog.js +1 -1
- package/mobile/lib/ui-kit/DialogManager/Dialog.js.map +1 -1
- package/mobile/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js +1 -1
- package/mobile/lib/ui-kit/EsiaLoginDialog/EsiaLoginDialog.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/CreditCalcField.js +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/CreditCalcField.js.map +1 -1
- package/mobile/lib/ui-kit/Input/Input.js +1 -2
- package/mobile/lib/ui-kit/Input/Input.js.map +1 -1
- package/mobile/lib/ui-kit/Input/getValidStyle.d.ts +1 -0
- package/mobile/lib/ui-kit/Input/getValidStyle.js +3 -0
- package/mobile/lib/ui-kit/Input/getValidStyle.js.map +1 -0
- package/mobile/lib/ui-kit/VerifyPhoneDialog/InputCode.js +2 -1
- package/mobile/lib/ui-kit/VerifyPhoneDialog/InputCode.js.map +1 -1
- package/mobile/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js +1 -1
- package/mobile/lib/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.js.map +1 -1
- package/mobile/lib/utils/safeJsonParse.d.ts +1 -0
- package/mobile/lib/utils/safeJsonParse.js +9 -0
- package/mobile/lib/utils/safeJsonParse.js.map +1 -0
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +4 -1
- package/mobile/src/components/CreditCardForm/CreditCardForm.tsx +1 -2
- package/mobile/src/components/CreditCardForm/CreditCardFormStatusTracker.tsx +1 -1
- package/mobile/src/components/CreditForm/CreditForm.tsx +1 -2
- package/mobile/src/components/CreditForm/CreditFormStatusTracker.tsx +1 -1
- package/mobile/src/components/StepsBlock/renderStep.tsx +1 -5
- package/mobile/src/components/StepsBlock/renderStepMobile.tsx +1 -5
- package/mobile/src/components/StickyBottomMenu/StickyBottomMenuDialog.tsx +1 -1
- package/mobile/src/components/TextBlock/TextBlock.tsx +2 -7
- package/mobile/src/content-page-repository/ContentPageRepository.ts +2 -3
- package/mobile/src/hooks/useLocalStorage.ts +2 -1
- package/mobile/src/icons/IconName.ts +5 -5
- package/mobile/src/model/LinkProps.ts +3 -3
- package/mobile/src/ui-kit/Calculator/CalculatorStyle.tsx +1 -1
- package/mobile/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.tsx +1 -1
- package/mobile/src/ui-kit/DialogManager/Dialog.tsx +1 -5
- package/mobile/src/ui-kit/EsiaLoginDialog/EsiaLoginDialog.tsx +2 -2
- package/mobile/src/ui-kit/FormField/Fields/CreditCalcField.tsx +1 -0
- package/mobile/src/ui-kit/Input/Input.tsx +1 -3
- package/mobile/src/ui-kit/Input/getValidStyle.tsx +3 -0
- package/mobile/src/ui-kit/VerifyPhoneDialog/InputCode.tsx +4 -3
- package/mobile/src/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.tsx +1 -1
- package/mobile/src/utils/safeJsonParse.ts +7 -0
- package/package.json +5 -6
- package/src/components/ApplicationLeadForm/ApplicationLeadForm.fixture.mobile.tsx +15 -23
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +4 -1
- package/src/components/CreditCardForm/CreditCardForm.fixture.mobile.tsx +25 -0
- package/src/components/CreditCardForm/CreditCardForm.tsx +1 -2
- package/src/components/CreditCardForm/CreditCardFormStatusTracker.tsx +1 -1
- package/src/components/CreditForm/CreditForm.fixture.mobile.tsx +30 -0
- package/src/components/CreditForm/CreditForm.tsx +1 -2
- package/src/components/CreditForm/CreditFormStatusTracker.tsx +1 -1
- package/src/components/StepsBlock/renderStep.tsx +1 -5
- package/src/components/StepsBlock/renderStepMobile.tsx +1 -5
- package/src/components/StickyBottomMenu/StickyBottomMenuDialog.tsx +1 -1
- package/src/components/TextBlock/TextBlock.tsx +2 -7
- package/src/content-page-repository/ContentPageRepository.ts +2 -3
- package/src/hooks/useLocalStorage.ts +2 -1
- package/src/icons/IconName.ts +5 -5
- package/src/model/LinkProps.ts +3 -3
- package/src/ui-kit/Calculator/CalculatorStyle.tsx +1 -1
- package/src/ui-kit/ConsentBkiDialog/ConsentBkiDialog.tsx +1 -1
- package/src/ui-kit/DialogManager/Dialog.tsx +1 -5
- package/src/ui-kit/EsiaLoginDialog/EsiaLoginDialog.tsx +2 -2
- package/src/ui-kit/FormField/Fields/CreditCalcField.tsx +1 -0
- package/src/ui-kit/Input/Input.tsx +1 -3
- package/src/ui-kit/Input/getValidStyle.tsx +3 -0
- package/src/ui-kit/VerifyPhoneDialog/InputCode.tsx +4 -3
- package/src/ui-kit/VerifyPhoneDialog/VerifyPhoneDialog.tsx +1 -1
- package/src/utils/safeJsonParse.ts +7 -0
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"),l=n("useCallback"),r=n("useMemo"),s=n("useRef"),o=(...e)=>globalThis._uni._jsx(...e),c=(...e)=>globalThis._uni._jsxs(...e),d=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:m(e)),t._tmpl},m=e=>{function t(t,n){const{children:a,...i}=t||{},l=n?.slots?.default,r=a||l&&l();return e(Object.assign(i,r&&{children:r}),n)}return t.inheritAttrs=!1,t},u=(...e)=>e.map((e=>h(e)?Object.entries(e).filter((([,e])=>e)).map((([e])=>e)):e)).flatMap((e=>e)).filter(Boolean).join(" "),h=e=>Boolean(e&&"object"==typeof e&&!Array.isArray(e)),p={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white",gray:"bg-main-divider text-primary-text",transparent:"bg-transparent text-primary-text","":""},g=d((({className:e,version:t="primary",isTheme:n=!0,defaultPadding:a="p-xl",padding:i,block:l,tag:r="section",role:s,children:c,style:d})=>{const m=t&&n;return o(r,{className:u("@container font-sans",{group:m},p[t],i||a,e),...m?{"data-ver":t}:{},...l?.anchor?{id:l.anchor}:{},role:s,style:d,children:c})})),f=d((({className:e,size:t})=>o("figure",{className:u("m-0 mt-xl min-w-[80%]",e),children:x(t)}))),x=(e=3)=>b(100,e).map((e=>Math.floor(e))).map(y),y=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),b=(e,t)=>[e].concat(t>0?b(e/1.618,t-1):[]),v={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:l="text-center",as:r,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-pre-wrap",l),...h?.title,as:r||h?.title.as,title:a}):null,i?o(w,{size:h.descriptionSize,font:h.descriptionWeight,align:l,...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:l=k,blocksRegistry:r={},ancestors:s=I}=t,{type:c}=e;c&&c in r||console.warn(`No block with "${c}" is registered`);const d=c&&r[c];return l({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:l})=>{const{content:r}=n;return d?o(d,{className:l,block:e,options:t,...r,...a},i):null}},i)}const B=[],P=(e,{key:t,ancestors:n=B,slotName:a=null,extraProps:i,renderProps:l=T,...r})=>{const s=i?(e,t)=>T(e,t,i):l;return(e||[]).map(((e,i)=>s(e,{...r,key:`${t||e.type}-${i}`,ancestors:r.parent?[...n||B,[r.parent,a]]:n},i)))};function R({block:e,options:t,children:n,extraProps:a,renderProps:i}){return n||(e&&t?P(e.blocks,{...t,parent:e,extraProps:a,renderProps:i}):null)}function D(){return D._impl()}D._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),D.setup=e=>{D._impl=e};const M=["CDN","BASE_PATH"],A=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return M.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),_=e=>Boolean(e?.includes(":")),E=(e,t)=>Boolean(e&&!_(e)&&(!t||"_self"===t)),z=e=>Boolean(e?.startsWith("#")),F=e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),O=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),V=(e,t)=>!(!e||!t)&&(!!e.startsWith(t)&&["/"===t,e===t,"/"===e[t.length]].some(Boolean));var L=Object.freeze({__proto__:null,isURL:_,isLocalURL:E,isHash:z,withoutQuery:F,joinPath:O,hasPrefix:V});const $="/api/",q=`${$}v1/storage`,j=e=>(t,n)=>{if([!t,_(t),z(t),[A.CDN,$].some((e=>V(t,e)))].some(Boolean))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`${q}/${t}/attachment`;const a=t?.startsWith("/");return O(V(t,n)?"":n,a?"/":(i=e.pathname,i?.split("/").slice(0,-1).join("/")),t);var i},U={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},W=d((({className:e="",imageClassName:t="",name:n="",alt:a=`Иконка ${n}`,title:i=a,iconVersion:l="color",width:r,height:s})=>{const d=D(),m="normal"===l?`${n}.svg`:`sprites.svg#${n}`,h=j(d)(O(A.CDN,"/icons/",m));return"normal"===l?o("img",{className:e,src:h,alt:a,title:i,"aria-hidden":"true",width:r,height:s,style:H(e,s)}):o(K,{className:e,children:c("svg",{className:u(Y(r),U[l],{invert:"white"===l},t),width:r,height:s,"aria-hidden":"true",children:[i?o("title",{children:i}):null,a?o("desc",{children:a}):null,o("use",{href:h,xlinkHref:h})]})})})),H=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},Y=e=>e?"":"w-full h-full",K=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),G=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function X(e=""){try{return new URL(e).pathname}catch(e){return""}}const J=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":X(G.SITE_URL);return t&&!_(t)?j(e)(t,n):t},Z=(e,t)=>e?.media&&t?.media?e.media-t.media:0,Q=d((({className:e="",image:t,imageClassName:n=""})=>{const a=D();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(Z).map((({src:e,format:n,media:i},l)=>o("source",{srcSet:J(a)(e),type:te(n),media:i?`(max-width: ${i}px)`:"",width:t?.size?.width,height:t?.size?.height},`${l}_${e}`))):null,t?.src?ee({...t,src:J(a)(t.src)},n):null]})})),ee=(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}),te=e=>e?`image/${String(e)}`:void 0,ne=d((({className:e="",image:t,imageClassName:n="",...a})=>t?.src||t?.icon?t.icon?o(W,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...a}):o(Q,{className:e,imageClassName:n,image:t}):null)),ae={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","":""},ie="bg-main-divider text-main-disabled",le={primary:ie,secondary:ie,white:ie,link:"",transparent:"",gray:ie,"":""},re="text-center font-sans select-none",se={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","":""},oe=({className:e,rounded:t,version:n})=>[re,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",n?ae[n]:"",t?"rounded-full":"rounded-md",e].join(" "),ce=e=>ce._impl(e);function de(e,t){const n=s({});return r((()=>new Proxy({},{get:(a,i)=>(n.current||={},n.current[i]||=n=>e.fire(t,{...n??{},type:i}),n.current[i])})),[e,t])}ce._impl=e=>e,ce.setup=e=>{ce._impl=e};class me{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 ue=new me,he=()=>de(ue.emitter,"dialog");function pe(){const e=X(G.SITE_URL),t=D(),{closeAll:n}=he();return e=>{const n=j(t)(e.href);return{...e,href:n,"aria-label":e.text,onClick:ce(a({...e,href:n}))}};function a({href:a,target:i,onClick:l}){return r=>{l?.(r),ge(a,i,e)||(n(),r?.preventDefault(),t.push(((e,t="")=>e?.replace(t,"")||"/")(a,e)))}}}const ge=(e,t,n)=>{if(!E(e,t))return!0;const a=G.SUB_PORTALS?.split(",");return!!a?.some((t=>V(e,t)))||!V(e,n||"/")},fe=e=>{if(!Array.isArray(e)||!e.length)return{};try{return{"data-aspects":JSON.stringify(e)}}catch(e){return{}}},xe=d((e=>{const{text:t,aboveText:n,appendLeft:a,appendRight:i,version:l="primary"}=e,r=be(e)&&"hidden lg:block";return c("div",{className:u(ye(e),"flex gap-xs"),children:[a?o("div",{className:u(r,se[l]),children:a}):null,be(e)?c("div",{className:"whitespace-pre",children:[n?o("div",{className:"text-xs font-light text-left",children:n}):null,o("div",{className:"text-left "+(n?"text-s -mt-3xs":"text-l"),children:t})]}):null,i?o("div",{className:u(r,se[l]),children:i}):null]})})),ye=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",be(e)?i:"h-12 w-12 m-auto",{"rounded-full":a})},be=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),ve=({className:e,rounded:t,version:n})=>["inline-block",re,n?le[n]:"",t?"rounded-full":"rounded-md",e].join(" "),Ne=d((({disabled:e,children:t,method:n="LINK",href:a,...i})=>{const r=(({method:e,href:t})=>l((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:a,pathname:i,searchParams:l}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[a,i].join(""));for(const[e,t]of l.entries()){const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),r.appendChild(n)}document.body.appendChild(r),r.submit()}),[]))({method:n,href:a}),s=pe()({onClick:r,href:a,...i}),c=t??o(xe,{...s});return o(e?Ce:we,{...s,children:c})})),we=d((({className:e="",href:t,rel:n,target:a,ariaLabel:i,version:l,rounded:r,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:oe({className:e,version:l,rounded:r}),href:t,rel:n,target:a,"aria-label":i||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...fe(d),children:m}))),Ce=d((({className:e,ariaLabel:t,version:n,rounded:a,children:i})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:ve({className:e,rounded:a,version:n}),children:i})));function Se({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:a=!1}){if(!n)return null;const i="primary"===e?"white":"black",l="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(a?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:u(oe({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",rounded:!0}),l),onClick:t,children:o(ne,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:i}})}),o(Ne,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const ke=()=>{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},Ie={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Te=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&Ie[n],t),children:e}):null,Be=d((({className:e,version:t="primary",defaultPadding:n,padding:a="",title:i,buttons:r,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:x,...y})=>{const b=ke(),v=D(),N=l((()=>v.back()),[]),w=y.options?.page?.common?.backwardButton,C=f&&!b;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",a||n,e),children:[C&&Se({version:t,handleClick:N,text:w}),i?o("div",{className:"relative h-full",children:i}):null,c("div",{className:u("grow relative flex flex-col @xl:flex-row gap-3xl w-full",{"self-start @xl:w-auto":s}),children:[Te(s,{imageAlign:m,className:"mx-auto"}),c("div",{className:u("grid gap-3xl items-center md:items-stretch",{"@xl:grid-cols-2 auto-cols-fr":d,grow:!s},"h-full","auto-rows-[max-content_1fr]"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[h,x]}),Re(R({...y,extraProps:{className:"@container-normal"}})),Te(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Pe(p)]:r,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),r?o("div",{className:"self-end",children:r}):null]})]})]})})),Pe=e=>u(e?"row-span-2":"@xl:row-span-2"),Re=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,De=(e,t="normal")=>e?.icon||e?.src?o("div",{className:u("sm:w-12 sm:h-12 sm:min-w-12 w-11 h-11 min-w-11 box-border flex items-center justify-center rounded-icon","normal"===t?"bg-secondary-light text-primary-main":"bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black"),children:o(ne,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,Me=d((e=>{const{__html:t="",richVersion:n="",itemSize:a="list-m",isDotted:i=!0}=e,l=i?"":"without-dots";return t&&"<p><br></p>"!==t.replace(/<\/?[^>]+\/?>/g,"").trim()?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(n,a,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",l),dangerouslySetInnerHTML:{__html:t}})}):null})),Ae=(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,_e=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),Ee=(e,t)=>e?o(_e,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,ze=(e,t)=>["label"in e?Ee(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Ae(e.description,t)},String(t)):null,"__html"in e?o(Me,{...e},`rte-${t}`):null],Fe=d((({className:e,benefitsVersion:t,...n})=>c("div",{className:u("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in n?De(n.icon,t):null,o("div",{children:ze(n)})]}))),Oe=d((({className:e,benefitsVersion:t="normal",benefits:n})=>n?.length?o("div",{className:u("flex gap-x-m gap-y-s flex-col",e),role:"list",children:n.map(((e,n)=>o(Fe,{benefitsVersion:t,...e},String(n))))}):null)),Ve=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(ze)}):null)),Le=d((({isTabularBenefits:e,...t})=>o(e?Ve:Oe,{...t}))),$e=e=>Boolean(e?.src||e?.icon),qe=(e,{className:t,buttonClassName:n,isVertical:a}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",a?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m w-full @lg:w-auto",t),role:"group",children:e.map(je(n))}):null,je=(e="")=>(t,n)=>{const{text:a,icon:i,iconRight:l,version:r,...s}=t||{},c=Ue(i,r),d=Ue(l,r);return a||i?.icon?o(Ne,{className:u("basis-full @lg:basis-auto",e),appendLeft:We({...i,iconVersion:c}),appendRight:We({...l,iconVersion:d}),version:r,text:a,...s},n?String(n):""):null},Ue=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},We=e=>$e(e)&&o(ne,{image:e,width:String(e?.size?.width||24),height:String(24)}),He=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),Ye=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(Ke)}):null)),Ke=({label:e,amount:t,unit:n},a)=>c("div",{className:"basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg sm:rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(_e,{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:[He(2)(t)," ",n||"₽"]}):null]},String(a)),Ge=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(Xe)}):null)),Xe=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(_e,{size:"text-m",font:"font-light",children:e})},String(t)),Je={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},Ze=d((({className:e,padding:t,defaultPadding:n,title:a,description:i,headlineVersion:l="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:d,isDotted:m=!0,benefits:u,__html:h,richVersion:p,isFullWidthTitle:g,priceList:f=[],tags:x=[],buttons:y,image:b,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:C=!1}={},backwardButton:k,children:I,...T})=>{const B=b?.src?o(ne,{image:b}):null,P=o(S,{title:a,description:i,headlineVersion:l,align:r,isEmbedded:!0}),R=u?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Be,{className:e,padding:t,defaultPadding:n,...g?{title:P}:{insetTitle:P},...Qe(B,N),isImageSecondary:C,imageAlign:v,isImageAlwaysOnRight:w,buttons:qe(y),backwardButton:k,...T,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[R?.length?o(Le,{benefitsVersion:s,isTabularBenefits:d,benefits:R}):null,h?o(Me,{richVersion:p,__html:h,isDotted:m,itemSize:Je[l]}):null,I,f?.length?o(Ye,{priceList:f}):null,et(x)]})})})),Qe=(e,t)=>t?{rightImage:e}:{leftImage:e},et=e=>e?.length?o(Ge,{tags:e}):null;class tt{_;constructor(e){this._=e}of(e){return new this.constructor(e instanceof tt?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 nt=()=>!0,at=(e,t)=>(...n)=>e(...n)&&t(...n),it=(...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 lt=e=>Boolean(e&&Array.isArray(e)),rt=e=>Boolean(e&&"object"==typeof e&&!lt(e)),st=e=>e;function ot(e){return e instanceof tt?e._:e}class ct extends tt{from(e){return this.of(e.map(((e=st)=>([,t])=>e(t))(ot)))}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(lt(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 dt extends tt{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 mt extends tt{from(e){return this.of(Object.fromEntries(e.map((([e,t])=>[e,ot(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 ut extends tt{proto=it([e=>lt(this._)||"number"==typeof e,()=>ct.prototype],[e=>rt(this._)||"string"==typeof e,()=>mt.prototype],[nt,()=>dt.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 ht=e=>e instanceof tt?e:new ut(e),pt=e=>{const t=(t,...n)=>ot(e(ht(t),...n));return t.fn=e,t},gt=[],ft=e=>e instanceof Function?e:t=>e===t,xt=e=>(t,n,a=gt)=>ht(t).entries().reduce(((t,[n,i])=>xt(e)(i,t,a.concat(n))),e(n,[a,ht(t)])),yt=pt(((e,[t,n])=>{const[a,...i]=t;return e.set(a,i.length?yt(e.get(a),[i,n]):n)})),bt=pt(((e,t)=>t.reduce(yt.fn,e))),vt=e=>xt(((e,[t,n])=>Nt(n)?[...e,[t,ot(n)]]:e))(e,[]),Nt=e=>0===e.size();pt(((e,t=gt)=>t.reduce(((e,t)=>e.get(t)),e)));const wt=pt(((e,[t,...n])=>n.length?e.set(t,wt(e.get(t),n)):e.filter((([e])=>e!==t)))),Ct=(St=["$ref"]).map(((e,t)=>n=>ft(e)(n[t+n.length-St.length]))).reduceRight(at,nt);var St;const kt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(It,e),It=it([lt,(e,t)=>e[parseInt(t,10)]],[rt,(e,t)=>e[t]],[nt,st]),Tt=(e,t)=>((e,t={})=>n=>bt(t,vt(n).map((t=>e(t)))))((([e,n])=>{return Ct(e)?[(a=e,a.slice(0,-1)),kt(t(n),n)]:[e,n];var a}))(e),Bt=e=>vt(e).filter(((e=st)=>([t])=>e(t))(Ct)),Pt=e=>{return t=Bt(e).map((([,e])=>e)),[...new Set(t)];var t};async function Rt(e,t){try{return e?await Dt(e,t):null}catch(e){console.error(e)}return null}const Dt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),Mt=e=>[...new Set(e)],At={},_t=["/portal-resources"],Et=(e,t)=>Tt(e,(e=>t?.[e])),zt=(e,t)=>{const n=Pt(e),[l,r]=a({});return i((()=>{Ft(n).then(r)}),[n.join()]),n.length?Et(e,{...t,...l}):e},Ft=async(e,t={})=>{if(e.length){const n=await(async e=>Object.fromEntries((await Promise.allSettled(Mt(e).filter((e=>!_t.some((t=>e.startsWith(t))))).map((async e=>[e,At[e]||=await Dt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(e),a={...t,...n},i=Object.entries(n).flatMap((([,e])=>Pt(e)));return i.length?Ft(i,a):a}return t};function Ot(e,t={}){const n=d((t=>{const n=zt((({block:e,options:t,className:n,defaultPadding:a,padding:i,isTheme:l,version:r,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const Vt=Ot((({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(Ze,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...a})})),{childrenTypes:["UnitBlock"]}),Lt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>$t(0,t?.length)),[t]),a=t?.[n];return a?o(Vt,{suppressHydrationWarning:!0,...a,...e}):o(g,{...e,children:o(f,{})})})),$t=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),qt=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),a=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getFullYear());return t?`${i}-${a}-${n}`:`${n}.${a}.${i}`}},jt=e=>e?.replace(/[^+\d]/g,""),Ut="/api/v1";const Wt=e=>e?{phone:jt(e)}:{},Ht=(e,t="birthday")=>e?{[t]:qt(e)}:{},Yt=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),Kt=(e,t=!0)=>({[t?"email":"mail"]:e}),Gt=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:jt(e)}:{},Xt=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:a,params:i}of e)t[a??""]?.(n,i)};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 Zt="rshb-query-params";function Qt(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(Zt)||"";return e&&globalThis.sessionStorage?.setItem(Zt,e),e}const en=e=>{const t=e.target?.closest("a"),n=Jt();if(_(t?.href)&&!t?.href?.startsWith(n.origin)){e.preventDefault(),e.stopPropagation();const a=(e=>{const t=Qt();if(!_(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()}tn._impl=()=>({forwardQuery:en}),tn.setup=e=>{tn._impl=e};const nn=e=>e,an=(e,{resetOnSubmit:t,onSubmit:n,normalize:r}={})=>{const[s,o]=a(e),c=l(r?e=>o(e instanceof Function?t=>{const n=r(e(t));return ln(t,n)?t:n}:r(e)):o,[r]);i((()=>{r&&o(r)}),[r]);const[d,m]=a(!1),[u,h]=a({}),p=l(((e,t)=>{const{parse:n=nn,format:a=nn}=t||{};return{value:a(s[e]),isDirty:d||u[e],onChange:t=>{c((a=>({...a,[e]:n(t)}))),h((t=>({...t,[e]:!0})))}}}),[c,d,u]),g=l((e=>{c(e),h(e)}),[]),f=l((()=>{c(e),m(!1),h({})}),[e]),x=l((e=>(e.preventDefault(),t?f():m(!0),n&&n(s,e),s)),[n,s]);return[s,{isDirty:d||Object.values(u).some(Boolean),field:p,update:g,reset:f,onSubmit:x}]},ln=(e,t)=>e&&t&&Object.keys({...e,...t}).every((n=>e[n]===t[n])),rn=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 max-w-[978px] space-y-lg",children:[n?o(N,{headingType:"h3",title:n,className:"@xl:text-center"}):null,a]})})}));function sn(e,t={}){const{open:n,close:a,...i}=he();return{open:l(((i,l={})=>n({dialog:o(e,{...t,...i,onClose:()=>{a(),i.onClose?.()}}),...l})),[e,n,a]),close:a,...i}}function on(e=!1){const[t,n]=a(e),i=l((()=>n(!0)),[]),r=l((()=>n(!1)),[]),s=l((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:i,setFalse:r,toggle:s}]}function cn(e,t,n,a){i((()=>{if(e&&n)return e.addEventListener(t,n,a),()=>{e.removeEventListener(t,n,a)}}),[e,t,n])}function dn(e){const t=s(null),n=l((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return cn(globalThis.document,"click",n),t}const mn=({label:e,errors:t})=>e&&t?`${e}*`:e,un=()=>{},hn="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",pn=e=>e?o(_e,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,gn=d((({key:e,className:t="",id:n,name:a,type:r="text",label:d,placeholder:m,value:h="",valid:p=!0,children:g,onChange:f,onFocus:x,onBlur:y,pattern:b,autoFocus:v=!1,isTextarea:N=!1,disabled:w=!1})=>{const C=s(null),S=l((e=>{const t=(e.target?.value||"").trimStart();f&&f(t)}),[f]);i((()=>{v&&C.current?.focus()}),[v,C]);const k=g?"pr-3xl":"",I=fn(p);return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[pn(d),N?o("textarea",{className:u("block resize-y min-h-24",xn,I),id:u("textarea",n),name:a||n,placeholder:m,value:h,onChange:S,onFocus:x,onBlur:y,disabled:w},e):o("input",{type:r,className:u("h-14",xn,k,I),ref:C,id:n,name:a||n,placeholder:m,value:h,onChange:S,onFocus:x,onBlur:y,pattern:b,disabled:w},e)]}),g]})})),fn=e=>e?hn:"border-error",xn="w-full border rounded-md text-primary-text outline-none p-m",yn=e=>o("div",{className:"h-6",children:e?o(_e,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),bn=e=>e?.value||"",vn={url:"suggest/address"},Nn={name:{url:"suggest/fio",requestData:{parts:["NAME"],gender:"UNKNOWN"}},surname:{url:"suggest/fio",requestData:{parts:["SURNAME"],gender:"UNKNOWN"}},middleName:{url:"suggest/fio",requestData:{parts:["PATRONYMIC"],gender:"UNKNOWN"}},email:{url:"suggest/email"},dulSubdivisionCode:{url:"suggest/fms_unit",responseItemHandler:e=>e?.data?.code?.replace("-","")||""},dulIssuedBy:{url:"suggest/fms_unit"},organizationName:{url:"suggest/party"},inn:{url:"suggest/party",responseItemHandler:e=>e?.data?.inn||""},addressRegistration:vn,addressFact:vn,organizationAddress:vn,addressCourier:vn},wn=()=>de(ue.emitter,"popup"),Cn=d((({options:e,onChange:t})=>o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",children:e?.map(((e,n)=>o("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem",onMouseDown:()=>t(e),children:o("span",{className:"min-h-6",children:e.processedValue})},n.toString())))})));function Sn({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=a([]),f=wn(),x=Nn[n],y=l((()=>{h.current=t,f.close()}),[t]),b=l((e=>{y(),h.current=e.processedValue,c&&c(e.processedValue),d&&d(e)}),[y,c]),v=s(null),N=r((()=>async e=>{if(!x)return;const t=await(e=>{const{url:t,query:n,queryPrefix:a,requestData:i={},responseItemHandler:l=bn}=e,r=(s=l,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${a?`${a}, `:""}${n}`;return fetch(`${Ut}/suggestions/${t}`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:10,...i,query:o})}).then((e=>e.json())).then(r)})({url:x.url,responseItemHandler:x.responseItemHandler,requestData:{...x?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=r((()=>((e,t=600)=>{let n;const a=(...i)=>{a.dispose(),n=setTimeout((()=>{e(...i)}),t)};return a.dispose=()=>{n&&clearTimeout(n)},a})(N,300)),[N]);return i((()=>{if(!e||!v.current||h.current===t)return void y();const n=v.current,{top:a,left:i,width:l,height:r}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.open({popup:o(Cn,{options:p,value:t,onChange:b}),top:a+globalThis.scrollY+r,left:i,width:l})}),[e,p,t,b]),v}const kn=d((({className:e,label:t,value:n="",placeholder:a,error:r,errors:s,onChange:d=un,onDaDataChange:m,onBlur:h,isTextarea:p,type:g,name:f="",daDataQueryPrefix:x,isInteger:y=!1,maxLength:b,dadata:v=!1,disabled:N=!1})=>{const[w,{setFalse:C,setTrue:S}]=on(),k=dn(C),I=l((e=>{v&&!w&&S(),b?e.length<=b&&d(e):d(e)}),[v,w,d]);i((()=>{y&&n&&d(In(n))}),[n]);const T=Sn({isOpen:w&&v,name:f,value:n,daDataQueryPrefix:x,onChange:d,onDaDataChange:m});return c("div",{className:u("shrink-0 w-full",e),ref:k,onBlur:C,onFocus:S,children:[o("div",{ref:T,children:o(gn,{disabled:N,type:g||"text","aria-label":t,label:mn({label:t,errors:s}),valid:Boolean(!r),value:n,onChange:I,onBlur:h,isTextarea:p,placeholder:Tn(a,s,t)})}),yn(r)]})})),In=(e="")=>e.replace(/[^\d]+/g,""),Tn=(e,t,n)=>t&&!n?`${e}*`:e,Bn=e=>e?.text||e?.key||"",Pn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Rn=d((({popupRef:e,options:t,value:n,query:a,onChange:i,iconVersion:l})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",ref:e,children:Pn(t,a).map((e=>c("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem","aria-selected":e.key===n?.key,onClick:t=>{t.stopPropagation(),i&&i(e)},children:[o("span",{className:"min-h-6",children:Bn(e)}),o(W,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:l,className:u("absolute right-4 pt-3xs",{hidden:e.key!==n?.key})})]},e.key)))}):null));const Dn=d((({className:e,label:t,options:n=[],value:r,valid:d=!0,isBorder:m=!0,placeholder:h="",isSearch:p=!1,iconVersion:g="black",onChange:f,disabled:x=!1})=>{const[y,{setFalse:b,setTrue:v}]=on(),[N,w]=a(""),C=_n(x,n.length),S=y&&!C,k=l((()=>{C||v()}),[C]),I=l((()=>{w(""),b()}),[]),T=function({isOpen:e,options:t,value:n,query:a,onChange:r,onClose:c,iconVersion:d}){const m=wn(),u=l((()=>{m.close(),c&&c()}),[c]),h=l((e=>{u(),r&&r(e)}),[u,r]),p=s(null),g=dn(u);return i((()=>{if(!e||!p.current)return;const i=p.current,{top:l,left:r,width:s,height:c}=i.getBoundingClientRect();m.open({popup:o(Rn,{popupRef:g,options:t,value:n,query:a,onChange:h,iconVersion:d}),top:l+window.scrollY+c,left:r,width:s})}),[e,t,n,a,h]),p}({isOpen:y,options:n,value:r,query:N,onChange:f,onClose:I,iconVersion:g});return c("div",{className:u("space-y-xs",e),children:[pn(t),c("div",{className:u("relative",S?"z-20":"z-10"),ref:T,children:[c("div",{className:u("h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden",An(m,d,C)),onClick:S?I:k,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:Bn(r)||h}),Mn(S,g)]}),p&&S?o("div",{className:u("absolute top-0 w-full z-20"),children:o(gn,{type:"text",autoFocus:!0,value:N,onChange:w,disabled:C})}):null]})]})})),Mn=(e,t)=>o(W,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),An=(e,t,n)=>u(e?"border rounded-md ":"",e&&!n?"hover:border-primary-hover":"",n?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),_n=(e,t)=>e||0===t,En=d((({className:e="",label:t,error:n,errors:a,...i})=>c("div",{className:e,children:[o(Dn,{...i,valid:!n,label:mn({label:t,errors:a})}),yn(n)]}))),zn=e=>!e?.length,Fn=e=>t=>n=>e(n)?[]:[t],On=Fn((e=>null!=e&&""!==e)),Vn="Некорректно заполненное поле",Ln="Укажите регион, город/населенный пункт, улицу, дом",$n=e=>On(e??Vn),qn=e=>Fn((e=>e?.key&&""!==e?.key))(e??Vn),jn=e=>Fn((e=>"string"==typeof e&&e.length>0&&e.length<=2))(e??Vn),Un=e=>Fn((e=>"string"==typeof e&&e.length>1&&Qn(e)))(e??Vn),Wn=(e,t)=>Fn((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??Vn),Hn=e=>Fn((e=>"string"==typeof e&&6===e.length))(e),Yn=e=>{return(t=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,Fn((e=>"string"==typeof e&&t.test(e))))(e);var t},Kn=Fn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),Gn=e=>{const t=String(e).replace(/[^0-9]+/g,"");if(11===t.length){let e=0;for(let n=0;n<9;n++)e+=parseInt(t.charAt(n))*(9-n);return e>101&&(e%=101),100!==e&&101!==e||(e=0),e===parseInt(t.substr(9))}return!1},Xn=e=>Boolean(e.region&&e.city&&e.house),Jn=()=>Fn(Xn)(Ln),Zn=/^[\u0400-\u04FF\d]+$/u,Qn=(e="")=>Zn.test(e),ea=e=>{const t=new Date,n=new Date(t.getFullYear()-23,t.getMonth(),t.getDate()),a=new Date(t.getFullYear()-75,t.getMonth(),t.getDate());return!(!e||e>n||e<a)},ta={typeForm:$n(),surname:Un("Укажите свою фамилию"),name:Un("Укажите своё имя"),middleName:Un("Укажите своё отчество"),region:qn(),addressBranch:qn(),phone:Yn("Укажите номер телефона"),secondaryPhone:Yn("Укажите номер телефона"),organizationPhone:Yn("Укажите номер телефона"),birthday:$n("Укажите дату рождения"),limitedBirthday:Fn(ea)("Допустимый возраст заёмщика - от 23 до 75 лет"),birthPlace:$n("Укажите место рождения"),education:$n("Выберите ваше образование"),housing:$n("Выберите тип жилья"),employment:$n("Выберите информацию о трудоустройстве"),organization:$n("Выберите тип организации"),amountWorkers:$n("Выберите информацию о количестве сотрудников"),employerActivities:$n("Выберите вид деятельности организации"),employerOrganization:$n("Выберите вид организации"),positionOrganization:$n("Выберите вашу должность"),dulSerie:(na="Укажите серию паспорта",Fn((e=>"string"==typeof e&&4===e.length))(na)),dulNumber:Hn("Укажите номер паспорта"),dulIssueDateField:$n("Укажите дату выдачи паспорта"),dulSubdivisionCode:Hn("Укажите код подразделения"),dulIssuedBy:$n("Укажите организацию, выдавшую паспорт"),email:(e=>Fn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(e))("Укажите электронную почту"),fullName:Un(),inn:(e=>Fn((e=>"string"==typeof e&&(10===e.length||12===e.length)))(e))("Укажите ИНН"),legalForm:$n("Укажите ОПФ"),organizationName:$n("Укажите наименование организации"),generalSeniority:jn("Укажите количество лет стажа"),lastJobExperience:jn("Укажите стаж на последнем месте работы"),experience5Years:jn("Укажите общий стаж за последние 5 лет"),jobsNumber:jn("Укажите количество мест работы за последние 5 лет"),beginDate:$n("Укажите дату заключения трудового договора"),addressFact:Jn(),partnerComments:$n(),collectionCount:$n(),comment:$n(),acquiringType:qn(),feedbackMethod:qn(),serviceType:qn(),serviceDirection:qn(),regionRetail:qn("Выберите регион"),meetingDay:$n(),product:$n(),localities:$n(),consentDataProcessing:Kn,annualRevenue:$n(),consentToReceiveMaterials:Kn,processPersonalDataFlg:Kn,consentProviderFlg:Kn,consentPfrFlg:Kn,consentOthersFlg:Kn,consentInformFlg:Kn,familyStatus:$n("Выберите семейное положение"),children:Wn(2,"Укажите количество детей"),familyMembers:Wn(2,"Укажите количество членов семьи"),dependents:Wn(2,"Укажите количество иждивенцев"),totalIncome:Wn(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:Wn(10,"Укажите сумму обязательных выплат"),snils:(e=>Fn(Gn)(e))("Некорректный номер СНИЛС"),conscription:$n(),armyIdFlg:Kn,sex:$n("Укажите свой пол"),addressRegistration:Jn(),organizationAddress:Fn((e=>Boolean(e.fiasCode&&e.city&&e.house)))(Ln),participantDateRegistration:$n("Укажите дату регистрации"),retirementIncome:$n(),otherIncome:$n(),wages:$n(),mandatoryPayments:$n(),disablePeopleFlg:$n(),bankruptcyFlg:$n(),shareholderFlg:$n(),legalEntityName:$n(),bankEmployeeCode:$n(),partInBusiness:$n(),addressRetail:qn("Выберите адрес банка"),addressMatch:$n(),codeWord:(e=>Fn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&Qn(e)))(e??Vn))("Необходимо ввести кодовое слово"),confirmationIncome:$n(),deliveryDate:$n("Укажите дату доставки"),addressCourier:Jn(),cardCategory:$n("Укажите категорию карты"),paymentSystem:$n("Укажите тип платежной системы"),currency:$n("Укажите валюту")};var na;const aa=e=>{const t=(e=>Object.values(e.filter((e=>e)))?.map((e=>e.name)))(e.filter((e=>Boolean(e?.required))));return Object.fromEntries(t.map((e=>[e,ta?.[e||""]])).filter((([,e])=>e)))},ia=(e,t)=>{const{value:n,isDirty:a}=e,i=a?t(n):[];return{...e,errors:i,error:i[0]}},la=(e,t,n=!1)=>n&&t?ia(e,t):e,ra=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],sa=d((({field:e,input:t})=>o(En,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:ra,...la(e("acquiringType"),ta.acquiringType,t?.required)}))),oa=(e="")=>Boolean("trade"===e||"all"===e),ca=e=>null!=e,da=new Map,ma=(e,t=da)=>n=>{const a=ha(n),i=t.get(a);if(a&&ca(i))return i;const l=e(...n);return a&&ca(l)&&t.set(a,Promise.resolve(l)),l},ua=e=>Boolean(e?.every((e=>Array.isArray(e)?ua(e):!e||"string"==typeof e))),ha=e=>ua(e)?e.toString():"",pa=e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]);function ga(e,t,{fallback:n,cache:l}={}){const s=r((()=>fa(e)),[e]),[o,c]=a(void 0),[d,m]=a(void 0);i((()=>{if(!s.some(ca))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await ma(t,l)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,l,s]);const u=n&&pa(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function fa(e){return Array.isArray(e)?e:e instanceof Function?fa(e()):[e]}const xa=`${Ut}/branches`,ya=[];const ba=async e=>await Rt(e,{method:"GET"})||ya;function va(e=!1){const{data:t}=ga(`${Ut}${e?"/premiumBranchesByRegions":"/branchesByRegions"}`,Dt);return Array.isArray(t)?t:[]}const Na=d((({field:e,input:t,isPremium:n=!1})=>{const a=e("region"),l=a?.value?.key,r=a?.value?.text,s=n?va(n)?.find((e=>e?.region===r))?.branches:function(e){const{data:t}=ga(e?`${xa}?regionCode=${e}`:null,ba);return t||ya}(l)?.filter((e=>e?.address));return i((()=>{""!==a?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[a?.value]),o(En,{label:"Отделение",placeholder:"Выберите отделение",options:(s||[]).map((({address:e=""})=>({key:e,text:e}))),...la(e("addressBranch"),ta.addressBranch,t?.required),isSearch:!0})})),wa=d((({field:e,input:t})=>{const n="addressFact",a=e(n).value,{value:r}=e("addressMatch");i((()=>{r&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[r,e("addressRegistration").value]);const s=l((t=>{e?.(n)?.onChange?.({apartment:t?.data?.flat,city:t?.data?.city,district:t?.data?.area_with_type,fullAddress:t?.value,fiasCode:t?.data?.fias_id,house:t?.data?.house,locality:t?.data?.settlement_with_type,okatoRegionCode:t?.data?.okato,postcode:t?.data?.postal_code,region:t?.data?.region,regionCode:t?.data?.region_kladr_id?t?.data?.region_kladr_id.substring(0,2):"",street:t?.data?.house,qc:t?.data?.qc,qcComplete:t?.data?.qc_complete,qcHouse:t?.data?.qc_house})}),[]),c=l((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(kn,{label:"Адрес",disabled:r,...la(e(n),ta[n],t?.required),value:a.fullAddress,onChange:c,...t,onDaDataChange:s})})),Ca=(e,t)=>Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t).value,Sa=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",a=e(n).value,i=l((t=>{e?.(n)?.onChange?.(ka(t))}),[]),r=l((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(kn,{disabled:t?.filledByEsia&&Ca(e,n),label:"Адрес",...la(e(n),ta[n],t?.required),value:a.fullAddress,onChange:r,...t,onDaDataChange:i})})),ka=e=>({apartment:e?.data?.flat,city:e?.data?.city,district:e?.data?.area_with_type,fullAddress:e?.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?.house,qc:e?.data?.qc,qcComplete:e?.data?.qc_complete,qcHouse:e?.data?.qc_house}),Ia=d((({className:e,viewBox:t,fill:n="none",width:a,height:i,paths:l,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:a,height:i,children:l.map((({d:e,fill:t,...n},a)=>{const i={...r,...n};return o("path",{d:e,fill:t||"currentColor",stroke:i.stroke,strokeLinecap:i.strokeLinecap,strokeLinejoin:i.strokeLinejoin,strokeWidth:i.strokeWidth,strokeMiterlimit:i.strokeMiterlimit},a)}))}))),Ta="appearance-none w-5 h-5 border-solid flex-none",Ba=[{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"}],Pa=d((({className:e,value:t,text:n,disabled:a,isRadio:i,onChange:r})=>{const s=l((e=>{a||(e.preventDefault(),r&&r(!t))}),[r,a,t]),d=i?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(Ia,{paths:Ba,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",Da(a)),onClick:s,children:[o("div",{className:u(Ta,"m-0",i?"rounded-full border-2":Aa(t),!a&&t?"border-primary-main":"border-gray",a?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:Ma(i),"aria-checked":Boolean(t),"aria-disabled":Boolean(a),"aria-label":n}),t?d:null,Ra(n)]})})})),Ra=e=>e?o("div",{className:"ml-s",children:o(_e,{size:"text-l",font:"font-light",children:e})}):null,Da=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",Ma=(e=!1)=>e?"radio":"checkbox",Aa=(e=!1)=>u("rounded border",{"bg-primary-main":e}),_a=d((({className:e,text:t,value:n,key:a,disabled:i,error:l,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(Pa,{text:t,value:n,disabled:i,onChange:r},a),yn(l)]}))),Ea=d((({field:e,input:t})=>o(_a,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...la(e("addressMatch"),ta.addressMatch,t?.required)}))),za=d((({color:e="text-primary-main",position:t="absolute",blur:n=!0})=>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 h-28 w-28","animate-spin rounded-full","border-8 border-solid border-current","border-r-transparent",e),role:"status"})}))),Fa="/icons/MapMarkerClusterIcon.svg",Oa="/icons/MapMarkerClusterYellowIcon.svg";function Va({yandexMaps:e,map:t,points:n,isLoad:a}){if(a||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const i=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),l=La("offices",e,i);if(n.length&&n.every((e=>"type"in e))){const a=La("workplaces",e,i),r=$a(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=$a(n.filter((e=>"offices"===e.type)),"offices",e);l.add(s),a.add(r),t.geoObjects.add(a),t.geoObjects.add(l)}else{const a=$a(n,"offices",e);l.add(a),t.geoObjects.add(l)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const La=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?Fa:Oa,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),$a=(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?Fa:Oa,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),qa={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},ja={...qa,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},Ua=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(ja).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(W,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),Wa=e=>globalThis[e],Ha=(e,t)=>{const n=document.getElementById(t);if(n){const t=Wa(e);return t?Promise.resolve(t):new Promise((t=>{n.addEventListener("load",(()=>{t(Wa(e))}))}))}return new Promise(((n,a)=>{const i=document.createElement("script");i.src=t,i.async=!0,i.id=t,i.addEventListener("load",(()=>{n(Wa(e))})),i.addEventListener("error",(e=>{a(e)})),document.head.appendChild(i)}))};const Ya=()=>function(e,t,n=!0){const[l,r]=a(void 0);return i((()=>{let a=!0;return Ha(e,t).then((e=>{a&&r(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(a=!1,n){const e=document.getElementById(t);e&&document.head.removeChild(e),r(void 0)}}}),[e,t,n]),l}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${A.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1),Ka={...qa,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},Ga=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(Ka).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(W,{name:n,width:"20",height:"16"})})})),Xa=[55.753995,37.614069],Ja=d((({points:e,className:t="",zoom:n=5,isLoad:a,selectedAddress:l})=>{const r=s(null),d=s(null),m=Ya();if(i((()=>{r.current?Va({yandexMaps:m,map:r.current,points:e,isLoad:a}):m?.ready((()=>{r.current||(r.current=new m.Map(d.current,{center:Za(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),Va({yandexMaps:m,map:r.current,points:e,isLoad:a})})),r.current&&l&&m?.geocode(l).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();r.current.setCenter(t),r.current.setZoom(18)}))}),[m,e,n,a,l]),!m)return null;const h="z-10";return c("div",{ref:d,className:u("relative","w-full",t),children:[a?o(za,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(Ga,{yandexMaps:r}),o(Ga,{yandexMaps:r,direction:"out"})]}),Ua(r,m,u("right-2 top-80",h))]})})),Za=e=>{const t=[ei(Qa(e,0)),ei(Qa(e,1))];return t.every((e=>e))?t:Xa},Qa=(e,t)=>e.map((e=>e.coords?.[t])),ei=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,ti=async(e,t,n)=>{try{return(await ni(e,t,n)).json()}catch(e){return console.error(e),null}};async function ni(e,t,n){return globalThis?.fetch?.(`${Ut}${e}`,{method:t,headers:{"Content-Type":"application/json",...ai()},credentials:"include",body:n?JSON.stringify(n):null})}const ai=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},ii=e=>Number(e.toString().replace(",",".")),li=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:n=!1,renderFoldableSection:i,renderFoldButton:r})=>{const[s,o]=a(n),d=l((()=>{o((e=>!e))}),[]),m=i({isUnfolded:s,onToggle:d}),u=r?r({isUnfolded:s,onToggle:d}):null;return c("div",t?{className:e,role:"group",children:[u,m]}:{className:e,role:"group",children:[m,u]})}));const ri=d((({className:e="",isUnfolded:t,children:n})=>{const a=s(null),l=function(e,t){const n=s(null);return i((()=>{const t=n?.current;if(!t)return;const a=new ResizeObserver((n=>{e(t,n[0])}));return a.observe(t),()=>{a.disconnect()}}),[e,...t]),n}((e=>{a.current&&(a.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:a,className:`transition-max-h duration-300 overflow-hidden ${a.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:l,children:n})})})),si=d((({value:e,subText:t,children:n,isPhone:a,...i})=>{const l=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[l.length,n,t].every((e=>!e))?null:oi({textItems:l,subText:t,children:n,isPhone:a,...i})})),oi=({label:e,labelSize:t="text-m",textItems:n,subColor:a,subText:i,className:l,children:r,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",l),children:[e?o(_e,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||ci(n,s),i?o(_e,{color:a,size:"text-m",children:i}):null]}),ci=(e,t)=>e.filter(Boolean).map(((e,n)=>o(_e,{size:"text-l",children:t?o("a",{href:`tel:${di(e)}`,children:e.trim()}):e.trim()},String(n)))),di=e=>e.replace(/\D/g,""),mi=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}))),ui=e=>{const t=pi(e);return o(si,{label:"Режим работы",value:t,className:"max-w-none"})},hi=({workTime:e="",lunchHour:t="",daysOff:n=""},a=!1)=>e?[`${a?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",pi=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[hi({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":a}),hi({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:a},!0)].filter(Boolean)},gi=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],fi=e=>gi.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??"")}}))),xi=e=>{if(!e)return null;const t=yi(e);return c(mi,{className:"border-none",children:[o(si,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(bi)})}),o(si,{label:"Режим работы",className:"max-w-none",children:o(_e,{children:e})})]})},yi=e=>{const t=gi.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},bi=({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(_e,{size:"text-xs",children:e})},String(n)),vi=({currency:e,buyExchangeRate:t,saleExchangeRate:n},a)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(si,{label:"Валюта",value:e.currency}):null,t?o(si,{label:"Купить",value:String(t)}):null,n?o(si,{label:"Продать",value:String(n)}):null]},String(a)),Ni={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"}},wi=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",Ni[n].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ne,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(_e,{size:"text-m",color:Ni[n].text,children:t})]}))),Ci=(new Date).getDay(),Si=e=>{const[t]=e?.slice(Ci-1)??[];if(!t)return null;const{lunchHour:n,status:a,workTime:i,hasLunch:l}=t;return a?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[i?o(wi,{color:"green",children:i}):null,n&&l?o(wi,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(wi,{color:"red",children:"Выходной"})},ki=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Ii=({title:e,status:t,workTime:n,lunchHour:a,hasLunch:i},l)=>o(si,{label:e,value:t&&n?n:"",subText:ki({lunchHour:a,hasLunch:i,status:t}),subColor:!t||i?"text-error":"text-green-dark"},String(l)),Ti=["ArrowDownIcon","ArrowUpIcon"],Bi=["Подробнее","Скрыть"],Pi=({isUnfolded:e,onToggle:t})=>c("button",{className:"w-full py-2xl cursor-pointer text-primary-main flex items-center border-b border-solid border-main-divider",onClick:t,type:"button",children:[o("div",{className:"pr-m",children:Bi[Number(e)]}),o(W,{className:"text-primary-text",name:Ti[Number(e)],width:"16",height:"16"})]}),Ri=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,Di=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,Mi=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,Ai=({name:e,address:t,phone:n,fax:a,phoneBusiness:i,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},u)=>{if(!d)return null;const h=fi(d);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(_e,{size:"text-h4",children:e}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(_e,{size:"text-l",children:t})]}):null]}),Si(h)]}),o("div",{className:"hidden sm:block",children:_i({phone:n,fax:a,phoneBusiness:i,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(li,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ri,{isUnfolded:e,children:_i({phone:n,fax:a,phoneBusiness:i,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Pi({isUnfolded:e,onToggle:t})})]},String(u))},_i=({phone:e,fax:t,phoneBusiness:n,phoneNatural:a,phoneCallCentre:i,phoneCurrencyControl:l,workSchedule:r,exchangeRate:s})=>{const d=fi(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(mi,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(si,{label:"Факс",value:t,isPhone:!0}),o(si,{label:"Телефон филиала",value:e,isPhone:!0}),o(si,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(si,{label:"Обслуживание физических лиц",value:a,isPhone:!0}),o(si,{label:"Для консультаций по валютному контролю",value:l,isPhone:!0}),o(si,{label:"Контакт-центр",value:i,isPhone:!0})]}),r?.isMatchesPattern?o(mi,{children:o(si,{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(Ii)})})}):c(mi,{children:[o(si,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(bi)})}),ui(d)]}),r?.businessScheduleVisibleTag?xi(r?.businessScheduleDescription):null,s?.currencies?.length?o(mi,{className:"flex-wrap",children:s?.currencies?.map(vi)}):null]})},Ei=({name:e="",address:t="",workSchedule:n})=>{const a=(i=e)?`${i?.charAt(0)?.toUpperCase()}${i?.slice(1)}`:"";var i;const l=`${t} ${(e=>{const t=fi(e),n=e?pi(t):"",a=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?Ri(n):Mi(n,a):Di(n):""})(n)}`;return{header:a,body:l}},zi={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},Fi={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},Oi={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)},Vi=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>Oi[t](e)))))},Li=()=>{},$i=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:a=Li,getBalloonRemoteWorkplaces:i=Li})=>{const[l,s,o,c]=r((()=>{const l=Vi(e,n),r=Vi(t,n),s=[...l.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a(e)}))),...r.map((e=>({type:"workplaces",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:i({address:e.address,workScheduleDescription:e.workScheduleDescription})})))].filter((e=>e.coords&&2===e.coords.length));return[l,s,r,l.length+r?.length]}),[e,t,n,a,i]);return{filteredItems:l,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},qi=e=>{const{data:t,error:n}=ga(`/api/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,ji);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},ji=async e=>await Rt(e,{method:"POST"})||[],Ui=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),Wi=d((({children:e})=>Ui?e:null)),Hi=d((({field:e,input:t})=>{const[n,l]=a([]),{data:r}=qi("REGION_RF"),s=e("regionRetail")?.value||{},d=e("addressRetail");i((()=>{(async()=>{const e=await(async e=>{const t=await ti("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0});return t?.offices?.map((e=>({...e,gpsLatitude:ii(e.latitude??Xa[0]),gpsLongitude:ii(e.longitude??Xa[1])})))||[]})(s?.key??"");l(e)})(),s?.key&&e?.("addressRetail")?.onChange?.("")}),[s.key]);const{points:m}=$i({data:n,filtrationState:{},getBalloon:Ei}),u=Boolean(s?.key);return c("div",{children:[o(En,{label:"Адрес отделения",placeholder:"Выберите отделение",options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...la(e("addressRetail"),ta.addressRetail,t?.required&&u),isSearch:!0}),o("div",{className:"h-[600px]",children:o(Wi,{children:o(Ja,{points:m,isLoad:!r,className:"h-full",selectedAddress:d?.value?.text})})})]})})),Yi=(e,{normalize:t,format:n})=>{const{value:i,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=a(!1),m=l((e=>{d(!0),r&&r(e)}),[]),u=l((()=>{d(!1),o&&o(t(i)),s&&s()}),[o,i]);return{value:c||!n?i:n(i),onFocus:m,onBlur:u}},Ki=(e,t,n)=>Math.max(t,Math.min(e,n));function Gi(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function Xi({list:e=[],min:t,max:n,step:a,value:i=e[0]||t,disabled:l,onChange:r}){const s=e.length?e.indexOf(i):i,d={backgroundSize:`${(100*(s>t?s-t:0)/(n-t)).toFixed(2)}% 100%`};return c("div",{children:[e.length?o("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>o("div",{className:u("w-2 h-2 rounded-full",s<=t||l?"bg-gray":"bg-primary-main")},String(t))))}):null,o("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:o("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:d,type:"range",min:t,max:n,step:a,value:s,disabled:l,onChange:t=>{const n=Gi(t.target?.value),a=e.length?e[n]:n;r&&r(a||0)}})})]})}const Ji=1,Zi=100,Qi=d((e=>{const{className:t,title:n,items:a=[],list:i=[],min:r=(i.length?0:Ji),max:s=(i.length?i.length-1:Zi),step:d=1,value:m=i[0]||r,disabled:h=!1,onChange:p}=e,g=Yi(e,{normalize:(e=0)=>i.length?el(i)(e):Ki(e,r,s),format:He()}),f=l((e=>{p&&p(Gi(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(_e,{size:"text-m",font:"font-light",color:"text-primary-text",children:n}):null,o("input",{className:u("text-h3 w-full h-14","pl-m mt-xs box-border","text-primary-text",hn,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),Xi({list:i,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),tl(a)]})})),el=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),tl=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(_e,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),nl=["От 1 000 ₽","До 1 000 000 000 ₽"],al=d((({field:e})=>o(Qi,{title:"Сумма, ₽",items:nl,min:1e3,max:1e9,...e("amount")}))),il=Ot((({field:e,source:t,fieldName:n,input:a,placeholder:i="Выберите из списка",options:l,...r})=>{const s=t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(En,{placeholder:i,options:s,...la(e(n),ta[n],a?.required),...r})})),ll=d((({field:e,input:t})=>{const{data:n}=qi("EMPLOYEES_NUMBER");return o(il,{field:e,source:n,label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),rl=d((({field:e,input:t})=>o(kn,{label:"Годовая выручка, ₽",...la(e("annualRevenue"),ta.annualRevenue,t?.required)}))),sl=d((({field:e,input:t})=>o(_a,{text:"Наличие военного билета",...la(e("armyIdFlg"),ta.armyIdFlg,t?.required)}))),ol=d((({field:e,input:t})=>o(kn,{label:"Код представителя Банка",placeholder:"Введите код",isInteger:!0,...la(e("bankEmployeeCode"),ta.bankEmployeeCode,t?.required),...t}))),cl=d((({field:e})=>o(kn,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e("bankEmpolee")}))),dl=d((({field:e,input:t})=>o(_a,{text:"В отношении меня ведётся производство по делу о банкротстве",...la(e("bankruptcyFlg"),ta.bankruptcyFlg,t?.required)}))),ml=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:a,currentYear:i,min:l,max:r,onDateClick:s})=>{const c=[];let d=1;for(let m=0;m<6;m++){const u=[];for(let c=0;c<7;c++)if(0===m&&c<t)u.push(o("td",{},`empty-${c}`));else if(d>n)u.push(o("td",{},`empty-${c}`));else{const t=new Date(i,a,d),n=ul(t,e),c=hl(t,l,r);u.push(o("td",{children:o("div",{className:pl(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},ul=(e,t)=>t&&e.toDateString()===t.toDateString(),hl=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),pl=(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"),gl=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],fl=d((({today:e,currentMonth:t,currentYear:n,min:a,max:i,onDateSelect:s=un,setValue:d=un})=>{const m=l((e=>{s(e),d(!1)}),[]),{firstDayOfWeek:u,totalDays:h}=r((()=>({firstDayOfWeek:new Date(n,t,1).getDay()-1,totalDays:new Date(n,t+1,0).getDate()})),[n,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:gl.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:ml({firstDayOfWeek:u,today:e,totalDays:h,currentYear:n,currentMonth:t,min:a,max:i,onDateClick:m})})]})})),xl=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function yl(e,t){const n=e.replace(/\D/g,"");if(""===n||e?.length===t.length)return e;const a=[...t],i=a.findIndex(bl),l=a.map(((e,t)=>Nl(e)?a.slice(0,t).filter(Nl).length:-1)),r=a.map(((e,t)=>vl(e)?e:n.charAt(l[t])||e)),s=l.indexOf(n.length-1)+1;return r.slice(0,Math.max(i,s)).join("")}const bl=e=>"_"===e,vl=e=>/\d/.test(e),Nl=e=>bl(e)||vl(e),wl=1940,Cl={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Sl=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:l,disabled:r,onChange:d,onClick:m})=>{const h=s(null),[p,g]=a(l||"");return i((()=>{g(l||"")}),[l]),c("div",{onClick:()=>{null!==h.current&&h.current.focus(),m?.()},className:u("relative",n),children:[o("input",{ref:h,className:"h-full w-full px-m text-l text-black focus-visible:outline-none",value:p,type:"text",onChange:e=>{const t=e.target?.value;"string"==typeof t&&t?.length<11&&g(yl(t,"__.__.____"))},onBlur:()=>{if(kl(p)){const[n,a,i]=p.split(".");d?.(new Date(Number(i),Number(a)-1,Number(n))),e(Number(a)-1),t(Number(i))}else g(l||"")},disabled:r}),r?null:o(W,{className:"mr-s",...Cl})]})})),kl=e=>{const[t,n,a]=e.split(".");if((e=>Number(e)>=wl&&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++;if(Number(t)>0&&Number(t)<=i)return!0}return!1},Il=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:a,setSelectedMonth:i,setSelectedYear:l,disabled:r=!1})=>o(Sl,{onChange:a,disabled:r,onClick:e,value:t&&qt(t),setSelectedMonth:i,setSelectedYear:l,className:u("flex justify-between items-center h-14 border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",n?"border-gray":"border-error")}),Tl=xl.map((e=>({key:e}))),Bl=Array.from({length:(new Date).getFullYear()-wl+1},((e,t)=>wl+t)).reverse().map((e=>({key:String(e)}))),Pl=(e,t)=>{const n=new Date(e,t,1);let a=0;for(;n.getMonth()===t;)a++,n.setDate(n.getDate()+1);return a},Rl=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:a,onChange:i})=>{a&&i?.(new Date(t,n,Math.min(e,a.getDate())))},Dl={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Ml={className:"min-w-32",iconVersion:"black",isBorder:!1},Al=d((({className:e="",label:t="",value:n,valid:r=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g}]=on(!1),[f,x]=a(n?.getMonth()||(new Date).getMonth()),[y,b]=a(n?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:v,handleNextMonth:N,handleSelectMonth:w,handleSelectYear:C,monthsOptions:S,yearsOptions:k,handleChangeVisibleCalendar:I,ref:T}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:a,onYearSelect:i,selectedYear:r,onChange:s,value:o})=>{const c=dn(l((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:l((()=>e(!t)),[t]),handleNextMonth:l((()=>{n+1<=11?a(n+1):(a(0),i(r+1))}),[n]),handlePrevMonth:l((()=>{n-1>=0?a(n-1):(a(11),i(r-1))}),[n]),handleSelectMonth:l((({key:e})=>{a(xl.indexOf(e));const t=Pl(r,xl.indexOf(e));Rl({maxDateOfMonth:t,selectedYear:r,selectedMonth:xl.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:l((({key:e})=>{i(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:Tl,yearsOptions:Bl,ref:c}})({onYearSelect:b,onMonthSelect:x,onShowCalendar:g,selectedYear:y,selectedMonth:f,showCalendar:p,onChange:h,value:n}),B=((e,t)=>{const[n,l]=a(!1);return i((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();l(n>t)}};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e]),n})(T,370);return c("div",{className:u("space-y-xs",e),ref:T,children:[pn(t),c("div",{className:"relative",children:[Il({handleChangeVisibleCalendar:I,value:n,valid:r,onChange:h,disabled:m,setSelectedMonth:x,setSelectedYear:b}),p&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":B}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:v,children:o(W,{...Dl,className:"-rotate-90 cursor-pointer"})}),o(Dn,{onChange:w,value:{key:xl[f]},options:S,...Ml}),o(Dn,{onChange:C,value:{key:String(y)},options:k,...Ml}),o("div",{className:"my-auto",onClick:N,children:o(W,{...Dl,className:"rotate-90 cursor-pointer"})})]}),o(fl,{today:n,currentMonth:f,currentYear:y,onDateSelect:h,min:s,max:d,setValue:g})]}):null]})]})})),_l=d((({className:e,label:t,error:n,errors:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Al,{label:mn({label:t,errors:a}),valid:Boolean(!n),...i}),yn(n)]}))),El=d((({field:e,input:t})=>o(_l,{label:"Дата начала работы на текущем месте",...la(e("beginDate"),ta.beginDate,t?.required),...t}))),zl=d((({field:e,input:t})=>o(_l,{label:"Дата рождения",...la(e("birthday"),ta.birthday,t?.required)}))),Fl=d((({field:e,input:t})=>o(kn,{label:"Место рождения",...la(e("birthPlace"),ta.birthPlace,t?.required),...t,disabled:t?.filledByEsia&&Ca(e,"birthPlace")})));function Ol(e){const t=globalThis.localStorage?.getItem(e),[n,i]=a(t?JSON.parse(t):null);return[n,l((t=>{i((n=>{const a=t instanceof Function?t(n):t;return globalThis.localStorage?.setItem(e,JSON.stringify(a)),a}))}),[e])]}const Vl=d((({field:e,input:t})=>{const[n,l]=a([]),[r]=Ol("programId"),{value:s,onChange:c}=e("cardCategory"),d=e("paymentSystem").value;return i((()=>{d&&r&&(async()=>{const e=await(async(e,t)=>{const n=await ti("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemTypeCd:e,creditProgramId:t}});return Array.isArray(n)?n:[]})(d,r);l(e),Ll(e,s)||c&&c(null)})()}),[d]),o(il,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t})})),Ll=(e,t)=>e.some((e=>e.key===t?.key)),$l=d((({field:e,input:t})=>o(kn,{label:"Количество детей до 18 лет",placeholder:"Введите значение",isInteger:!0,...la(e("children"),ta.children,t?.required),...t}))),ql=d((({field:e,input:t})=>o(kn,{label:"Кодовое слово",...la(e("codeWord"),ta.codeWord,t?.required),...t}))),jl=d((({field:e,input:t})=>o(kn,{label:"Количество объектов инкассации",isInteger:!0,...la(e("collectionCount"),ta.collectionCount,t?.required)}))),Ul=d((({field:e,input:t})=>o(kn,{className:"col-span-2",...la(e("comment"),ta.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),Wl=d((({field:e,input:t})=>{const{data:n}=qi("INCOME_CERT_UNITED");return o(il,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),Hl=d((({field:e,input:t})=>{const{data:n}=qi("MILITARY_STATUS");return o(il,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),Yl={processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3},consentToReceiveMaterials:{text:"Согласен на получение информационных и аналитических материалов по электронной почте"}};function Kl({disabled:e,onClick:t}){return n=>{!e&&t&&t(n)}}const Gl={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"},Xl={primary:u("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("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")},Jl=d((({children:e,...t})=>{const n=e=>({...e,onClick:ce(Kl(e))}),{className:a,version:i="primary",active:l,disabled:r,type:s="button",rounded:c=!0,role:d,onClick:m}=n(t);return o("button",{className:u("font-sans px-9 py-4","flex justify-center items-center gap-xs",{"text-white bg-primary-active":l,"bg-main-gray text-main-disabled cursor-not-allowed":r,"rounded-md":c},l||r?"":u(Gl[i],Xl[i]),a),type:s,role:d,onClick:m,children:e})})),Zl=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(W,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),Ql=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>c("div",{className:u("relative min-h-full bg-white pt-0 p-lg",e),role:"dialog",onClick:i,children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(Zl,{className:"absolute top-0 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]}))),er=d((({src:e,convertToPng:t,onClose:n})=>c(Ql,{className:"my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0",onClose:n,children:[t?o("img",{src:e}):o("iframe",{src:`${e}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"}),o(Jl,{className:"mx-auto mt-m",type:"button",onClick:n,children:"Ознакомиться"})]}))),tr=e=>{const{open:t}=sn(er),n=ke();return l((async()=>{if(e){const a=URL.createObjectURL(await(async(e,t=!1)=>{const n=await ni(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return n?await n.blob():new Blob})(e,n));t({src:a})}}),[t,e,n])},nr=d((({className:e,error:t,docId:n,...a})=>{const i=tr(n);return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(Pa,{...a}),n?o(Ne,{className:"text-primary-main",onClick:i,children:o(_e,{children:"Ознакомиться"})}):null]}),yn(t)]})})),ar=d((({field:e,input:t})=>t&&t.name?o(nr,{text:Yl[t.name]?.text,docId:Yl[t.name]?.docId,...la(e(t.name),ta[t.name],t?.required)}):null)),ir=Math.round(29.5),lr=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]}))),rr="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",sr="flex flex-col lg:max-w-80 lg:w-1/2 gap-2xl",or="flex flex-col gap-y-xl min-w-52",cr=d((({value:e,fractionDigits:t,fixed:n,prefix:a,postfix:i})=>o(_e,{size:"text-h3",children:"number"==typeof e?[a,He(t,{fixed:n})(e),i].filter(Boolean).join(" "):e}))),dr=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(_e,{size:"text-l",font:"font-light",color:a,children:t}):null,n?o(cr,{value:n,...i}):o(_e,{size:"text-h3",children:"-"})]}))),mr=(e=[],t=!1)=>ur([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),ur=(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]},hr=(e,t=0)=>e?.sum?e.sum:t,pr=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,gr=(e,t)=>e?o(w,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,fr=({min:e=0,max:t=0,availableMonths:n,...a})=>o(Qi,{items:[`От ${xr(e)}`,`До ${xr(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...a}),xr=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,yr={horizontal:"@lg:flex-row",vertical:""},br=d((({label:e,items:t,value:n,className:a,onChange:i,disabled:l=!1,orientation:r="horizontal"})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(_e,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",yr[r],a),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(Pa,{isRadio:!0,text:t,value:n===e,onChange:()=>i&&i(e),disabled:l},String(e))))})]}))),vr=({items:e,title:t,mobileTitle:n=t,orientation:a="horizontal",value:i,onChange:l,...r})=>c("div",{className:"grid gap-s whitespace-nowrap",children:[t?o("div",{className:"hidden @5xl:block",role:"radiogroup","aria-label":t,children:o(_e,{color:"text-secondary-text",font:"font-light",children:t})}):null,n?o("div",{className:"@5xl:hidden",role:"radiogroup","aria-label":n,children:o(_e,{color:"text-secondary-text",font:"font-light",children:n})}):null,o(br,{orientation:a,items:e,value:e[i?0:1].id,onChange:t=>l&&l(t===e[0].id),...r})]}),Nr=e=>vr({...e,className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),wr=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...a})=>o(Qi,{items:e?[`От ${He(1)(a.min||0)} ${n}`,`До ${He(1)(a.max||0)} ${n}`]:[],step:t,...a}),Cr=({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?.(Ki(t?.[i],n.minMonths,n.maxMonths))},Sr=(e,t)=>{const{isAnnuity:n,moneyValue:a,monthsValue:i,moneyExtra:l}=t;if(0===e)return 0;if(n){const t=e/1200;return l?(a+l)*(t+t/(Math.pow(1+t,i)-1)):a*(t+t/(Math.pow(1+t,i)-1))}return Math.round(a/i)+a*(e/1200)},kr=e=>e,Ir=(e=kr)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),Tr=Ir(),Br=(e=kr)=>Ir((t=>-e(t))),Pr=Br(),Rr=([e,t],n,a=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:Dr([e,t],a),Dr=([e,t],n=[])=>({[e]:n.length?Pr(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?Tr(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),Mr=(e,[t,n],a)=>e>=a[t]&&e<=a[n],Ar={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},_r=e=>Er({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Er({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&Er({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&Er({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Er=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],zr=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,l=t?.rateRows||[Ar],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>_r({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Rr(["minSum","maxSum"],r,l),{minMonths:c,maxMonths:d}=Rr(["minMonths","maxMonths"],r,l),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i})=>e?.find((e=>_r({row:e,userInputParams:t,paramsViewSettings:n})&&Mr(a,["minSum","maxSum"],e)&&Mr(i,["minMonths","maxMonths"],e)))||Ar)({rateRows:l,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i}),{rate:u}=m,h=Sr(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:a,monthsValue:i,monthlyPayment:h}},Fr=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),Or={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},Vr=Ot((({className:e,title:t,calcSource:n,buttons:a,footnote:l,paramsViewSettings:r,defaultParams:s,onChange:d,...m})=>{const h=(p=n?.rateRows,ur([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],p));var p;const[g,{field:f,isDirty:x}]=an({moneyValue:hr(s,2e5),monthsValue:pr(s,ir),isAnnuity:Boolean(s?.isAnnuity),isInsurance:Boolean(s?.isEnableInsurance),isSalaryClient:Boolean(s?.isEnableSalaryClient),isPensionClient:Boolean(s?.isEnablePensionClient),isStateEmployee:Boolean(s?.isEnableStateEmployee)});i((()=>{x&&d?.(g)}),[g,x]);const y=zr(g,n,r),b=Nr({title:"Тип платежа",orientation:"vertical",...f("isAnnuity")}),{onChange:v}=f("moneyValue"),{onChange:N}=f("monthsValue");return i((()=>{v&&v(Ki(g.moneyValue,y.minSum,y.maxSum))}),[y.minSum,y.maxSum]),i((()=>{N&&N(Ki(g.monthsValue,y.minMonths,y.maxMonths))}),[y.minMonths,y.maxMonths]),i((()=>{!Fr(s)&&h&&Cr({field:f,defParams:h,calcParams:y,map:Or,monthsValue:"minMonths"})}),[n,s]),o(lr,{className:e,title:t,...m,children:c("section",{className:u(rr,e),children:[c("div",{className:sr,children:[wr({title:"Сумма кредита, ₽",step:500,min:y.minSum,max:y.maxSum,...f("moneyValue"),value:y.moneyValue}),fr({title:"Срок кредита, месяцев",min:y.minMonths,max:y.maxMonths,...f("monthsValue"),value:y.monthsValue}),Lr({...y,...r},f),o("div",{className:"sm:hidden",children:b})]}),c("div",{className:u(or,"@4xl:w-1/2"),children:[o(dr,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(dr,{title:"Ставка",value:y?.rate,fractionDigits:2,postfix:"%"}),o(dr,{title:"Ежемесячный платёж",value:y.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:b}),qe(a,{isVertical:!0}),gr(l)]})]})})})),Lr=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(Pa,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(Pa,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(Pa,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(Pa,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),$r={moneyValue:"sum",monthsValue:"period",isInsurance:"isEnableInsurance",isPensionClient:"isEnablePensionClient",isStateEmployee:"isEnableStateEmployee",isSalaryClient:"isEnableSalaryClient",isAnnuity:"isAnnuity"},qr=(e,t=!1)=>{const n=t?jr($r):$r;return Object.fromEntries(Object.entries(e??{}).map((([e,t])=>[n[e],t])))},jr=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[t,e]))),Ur="calculator",Wr=d((({field:e,params:t})=>{const n=l((t=>{e(Ur).onChange?.(t)}),[]);return o(Vr,{...t?.calcData,defaultParams:qr(e(Ur).value),onChange:n})})),Hr=d((({field:e,input:t})=>{const{data:n}=qi("CREDIT_IN_RSHB");return o(il,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /\n вкладчиком с долей участия более 20% уставного капитала руководителем,\n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t,disabled:!e?.("shareholderFlg")?.value})})),Yr=d((({className:e,label:t,onChange:n,error:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(br,{label:mn({label:t,errors:i?.errors}),onChange:e=>n&&n(e),...i}),yn(a)]}))),Kr=[{id:"810",text:"Рубли"}],Gr=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("currency"),{data:i}=qi("CURRENCY"),l=i?.map((e=>({id:e.key,text:e.value})))??Kr;return o(Yr,{label:"Валюта",orientation:"horizontal",items:l,value:n,onChange:e=>a?.(e),...la(e("currency"),ta.currency,t?.required)})})),Xr=d((({field:e,input:t})=>o(_l,{label:"Дата доставки",...la(e("deliveryDate"),ta.deliveryDate,t?.required)}))),Jr=d((({field:e,input:t})=>o(kn,{label:"Количество иждивенцев",placeholder:"За исключение детей до 18 лет",isInteger:!0,maxLength:2,...la(e("dependents"),ta.dependents,t?.required),...t}))),Zr=d((({field:e,input:t})=>o(_l,{label:"Желаемая дата встречи",...la(e("desiredMeetingDate"),ta.meetingDay,t?.required)}))),Qr=d((({field:e,input:t})=>o(_a,{text:"Являюсь инвалидом",...la(e("disablePeopleFlg"),ta.disablePeopleFlg,t?.required)}))),es="dulIssueDateField",ts=d((({field:e,input:t})=>o(_l,{label:"Дата выдачи",...la(e(es),ta.dulIssueDateField,t?.required),disabled:t?.filledByEsia&&Ca(e,es)}))),ns="dulIssuedBy",as=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("dulSubdivisionCode"),i=l((e=>{a?.(e?.data?.code?.replace("-",""))}),[]);return o(kn,{disabled:t?.filledByEsia&&Ca(e,ns),label:"Кем выдан",...t,...la(e(ns),ta.dulIssuedBy,t?.required),onDaDataChange:i,daDataQueryPrefix:n})})),is=d((({field:e,input:t})=>o(kn,{disabled:t?.filledByEsia&&Ca(e,"dulNumber"),label:"Номер документа",isInteger:!0,maxLength:6,...la(e("dulNumber"),ta.dulNumber,t?.required)}))),ls=d((({field:e,input:t})=>o(kn,{disabled:t?.filledByEsia&&Ca(e,"dulSerie"),label:"Серия документа",isInteger:!0,maxLength:4,...la(e("dulSerie"),ta.dulSerie,t?.required)}))),rs="dulSubdivisionCode",ss=d((({field:e,input:t})=>{const n=l((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(kn,{disabled:t?.filledByEsia&&Ca(e,rs),label:"Код подразделения",isInteger:!0,maxLength:6,...t,...la(e(rs),ta.dulSubdivisionCode,t?.required),onDaDataChange:n})})),os=d((({field:e,input:t})=>{const{data:n}=qi("EDUCATION_LEVEL");return o(il,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),cs=d((({field:e,input:t})=>{const{required:n,...a}=t;return o(kn,{label:"Электронная почта",...la(e("email"),ta.email,n),...a})})),ds=d((({field:e,input:t})=>{const{data:n}=qi("ORGANIZATION_ACTIVITY_TYPE");return o(il,{field:e,source:n,label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),ms=d((({field:e,input:t})=>{const{data:n}=qi("ORGANIZATION_KIND");return o(il,{field:e,source:n,label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),us=d((({field:e,input:t})=>{const{data:n}=qi("EMPLOYMENT_INFO_UNITED");return o(il,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),hs=d((({field:e,input:t})=>o(kn,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",isInteger:!0,...la(e("expenses"),ta.expenses,t?.required),...t}))),ps=d((({field:e,input:t})=>o(kn,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",maxLength:2,...la(e("experience5Years"),ta.experience5Years,t?.required),...t}))),gs=d((({field:e})=>{const{value:t,onChange:n}=e("familyMembers"),a=e("familyStatus")?.value?.key,l="MARRIED"===a?2:1,r=Number(e("children")?.value),s=Number(e("dependents")?.value),c=l+r+s;return i((()=>{e?.("familyMembers")?.onChange?.(c)}),[a,r,s]),o(kn,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:t,onChange:e=>n?.(e)})})),fs=d((({field:e,input:t})=>{const{data:n}=qi("MARITAL_STATUS");return o(il,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),xs=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],ys=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],bs=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],vs=d((({field:e,input:t})=>o(En,{label:"Способ получения ответа",options:bs,...la(e("feedbackMethod"),ta.feedbackMethod,t?.required)}))),Ns=d((({field:e,input:t})=>o(kn,{label:"ФИО",...la(e("fullName"),ta.fullName,t?.required),...t}))),ws=d((({field:e,input:t})=>o(kn,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...la(e("generalSeniority"),ta.generalSeniority,t?.required),...t}))),Cs=d((({field:e,input:t})=>{const{data:n}=qi("HOUSE_TYPE");return o(il,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Ss=d((({field:e,input:t})=>{const n=l((t=>{e?.("organizationAddress")?.onChange?.(ka(t.data?.address)),e?.("organizationName")?.onChange?.(t.data?.name?.short_with_opf),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(kn,{label:"ИНН",isInteger:!0,maxLength:12,...t,...la(e("inn"),ta.inn,t?.required),onDaDataChange:n})})),ks=d((({field:e})=>o(_a,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),Is=d((({field:e,input:t})=>o(kn,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",isInteger:!0,maxLength:2,...la(e("jobsNumber"),ta.jobsNumber,t?.required),...t}))),Ts=d((({field:e,input:t})=>o(kn,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...la(e("lastJobExperience"),ta.lastJobExperience,t?.required),...t}))),Bs=d((({field:e,input:t})=>o(kn,{label:"Наименование юридического лица",...t,...la(e("legalEntityName"),ta.legalEntityName,t?.required),disabled:!e?.("shareholderFlg")?.value}))),Ps=d((({field:e,input:t})=>o(kn,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...la(e("legalForm"),ta.legalForm,t?.required),...t}))),Rs="limitedBirthday",Ds=d((({field:e,input:t})=>o(_l,{label:"Дата рождения",...la(e(Rs),ta.limitedBirthday,t?.required),disabled:t?.filledByEsia&&Ca(e,Rs)}))),Ms=`${Ut}/outservice`,As=[];async function _s(){const e=await Rt(`${Ms}/outserviceregions`);return e&&Array.isArray(e)?e:As}const Es=d((({field:e,input:t})=>{const n=e("region"),a=n?.value?.key,{data:l}=ga("outServiceRegions",_s),r=l?.find((e=>e.code===a))?.localities?.map((e=>({key:e,text:e})));return i((()=>{""!==a&&e?.("localities")?.onChange?.("")}),[a]),o(En,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:r,...la(e("localities"),ta.localities,t?.required),isSearch:!0})})),zs=d((({field:e,input:t})=>o(kn,{label:"Обязательные выплаты",placeholder:"Введите значение",isInteger:!0,...la(e("mandatoryPayments"),ta.mandatoryPayments,t?.required),...t}))),Fs=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],Os=d((({field:e,input:t})=>o(Yr,{orientation:"horizontal",items:Fs,...la(e("methodObtain"),ta.methodObtain,t?.required)}))),Vs="middleName",Ls=d((({field:e,input:t})=>o(kn,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&Ca(e,Vs),...la(e(Vs),ta.middleName,t?.required),...t}))),$s=d((({field:e,input:t})=>o(kn,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&Ca(e,t.name??""),...la(e("name"),ta.name,t?.required),...t}))),qs=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(_e,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),js=d((({field:e})=>oa(e("acquiringType")?.value?.key)?o(qs,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),Us=d((({field:e,input:t})=>{const{data:n}=qi("ORGANIZATION_TYPE");return o(il,{field:e,source:n,label:"Тип организации",fieldName:"organization",input:t})})),Ws=d((({field:e,input:t})=>{const n=l((t=>{e?.("inn")?.onChange?.(t.data?.inn),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(kn,{label:"Наименование организации",...t,...la(e("organizationName"),ta.organizationName,t?.required),onDaDataChange:n})})),Hs=d((({field:e,input:t})=>o(kn,{label:"Иные доходы",placeholder:"Введите значение",isInteger:!0,...la(e("otherIncome"),ta.otherIncome,t?.required),...t}))),Ys=d((({field:e,input:t})=>o(_l,{label:"Дата регистрации по месту жительства",...la(e("participantDateRegistration"),ta.participantDateRegistration,t?.required)}))),Ks="partInBusiness",Gs=d((({field:e,input:t})=>{const n=l((t=>{e(Ks)?.onChange?.(String(Number(t)>100?100:Number(t)||""))}),[]);return o(kn,{label:"Доля участия в бизнесе",placeholder:"в %",isInteger:!0,maxLength:3,...la(e(Ks),ta.partInBusiness,t?.required),...t,onChange:n})})),Xs=d((({field:e,input:t})=>{const{required:n,...a}=t;return o(kn,{...la(e("partnerComments"),ta.partnerComments,n),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...a})})),Js=d((({field:e,input:t})=>{const{value:n,onChange:l}=e("paymentSystem"),[r]=Ol("programId"),[s,c]=a([]);return i((()=>{r&&(async()=>{const e=await(async e=>{const t=await ti("/public-data/creditProgramConditions","POST",{creditProgramId:e});return t?.paymentSystems?.map((e=>({id:e.type,text:e.name})))??[]})(r);c(e||[])})()}),[]),o(Yr,{label:"Платежная система",orientation:"horizontal",items:s,value:n,onChange:e=>l?.(e),...la(e("paymentSystem"),ta.paymentSystem,t?.required)})})),Zs=e=>"_"===e,Qs=e=>/\d/.test(e),eo=e=>Zs(e)||Qs(e),to=[..."+7 (___) ___-__-__"],no=to.findIndex(Zs),ao=to.map(((e,t)=>eo(e)?to.slice(0,t).filter(eo).length:-1));function io(e){const t=e.replace(/\D/g,""),n=to.map(((e,n)=>Qs(e)?e:t.charAt(ao[n])||e)),a=ao.indexOf(t.length-1)+1;return(a?n.slice(0,Math.max(no,a)):n).join("")}const lo=d((({children:e,onChange:t,...n})=>{const a=l((e=>t&&t(io(e))),[t]),i=l((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})})),ro=d((({className:e,label:t,error:n,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(lo,{"aria-label":t,label:mn({label:t,errors:a?.errors}),valid:Boolean(!n),placeholder:"+7 (___) ___-__-__",...a}),yn(n)]}))),so=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(ro,{label:"Телефон",...la(e(n),ta.phone,t?.required),disabled:t?.filledByEsia&&Ca(e,n),...t})})),oo=d((({field:e,input:t})=>{const{data:n}=qi("POSITION");return o(il,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),co=d((({field:e})=>oa(e("acquiringType")?.value?.key)?o(qs,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),mo=d((({field:e,source:t})=>o(En,{placeholder:"Выберите продукт",label:"Продукт",options:uo(t?.productList),...ia(e("product"),ta.product)}))),uo=e=>(e??[]).map((e=>({key:e,value:e}))),ho=`${Ut}/outservice/outserviceregions`,po=`${Ut}/regions`,go=[];function fo(e=po){const{data:t}=ga(e,Dt);return Array.isArray(t)?t:go}const xo=d((({field:e,input:t,params:n})=>{var a;const i=fo((a=n?.typeForm,"OUTSERVICE"===a?ho:void 0));return o(En,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...la(e("region"),ta.region,t?.required)})})),yo=d((({field:e,input:t})=>{const n=va(!0),a=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(En,{label:"Регион",placeholder:"Выберите регион",options:a,...la(e("region"),ta.region,t?.required)})})),bo=d((({field:e,input:t})=>{const{data:n}=qi("REGION_RF"),a=n?.map((({key:e,value:t})=>({key:e,text:t})));return o(En,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:a,...la(e("regionRetail"),ta.regionRetail,t?.required)})})),vo=d((({field:e,input:t})=>{const n=e("wages")?.value,a=l((t=>{const a=Number(t)+Number(n||0);e("retirementIncome")?.onChange?.(t),e("incomeAverage")?.onChange?.(String(a))}),[n]);return o(kn,{label:"Пенсионные доходы",placeholder:"Введите значение",isInteger:!0,...la(e("retirementIncome"),ta.retirementIncome,t?.required),...t,onChange:a})})),No=d((({field:e})=>{const t=e("secondaryPhone");return o(ro,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?ia(t,ta.secondaryPhone):t})})),wo=d((({field:e,input:t})=>o(En,{label:"Направление обслуживания",placeholder:"Выберите направление",options:ys,...la(e("serviceDirection"),ta.serviceDirection,t?.required)}))),Co=["male","female"],So=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],ko=d((({field:e,input:t})=>{const n=e("name")?.value,{value:a,onChange:l}=e("sex");return i((()=>{n&&!a&&(async()=>{const e=await(async e=>{const t=await ti("/suggestions/suggest/fio","POST",{query:e,count:1,parts:["NAME"]}),n=t?.suggestions[0]?.data?.gender?.toLowerCase()||"";return Co.includes(n)?n:""})(n);e&&l?.(e)})()}),[]),o(Yr,{label:"Пол",orientation:"horizontal",items:So,...la(e("sex"),ta.sex,t?.required)})})),Io=d((({field:e,input:t})=>o(_a,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...la(e("shareholderFlg"),ta.shareholderFlg,t?.required)}))),To=d((({children:e,onChange:t,...n})=>{const a=l((e=>t&&t(yl(e,"___-___-___ __"))),[t]),i=l((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(gn,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>i(e?.target?.value||""),children:e})})),Bo=d((({className:e,label:t,value:n,error:a,onChange:i,onBlur:l,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(To,{"aria-label":t,label:mn({label:t,errors:r?.errors}),valid:Boolean(!a),value:n,onChange:i,onBlur:l,placeholder:"___-___-___ __"}),yn(a)]}))),Po=d((({field:e,input:t})=>o(Bo,{label:"СНИЛС",...la(e("snils"),ta.snils,t?.required),...t}))),Ro=d((({field:e,input:t})=>o(kn,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&Ca(e,"surname"),...la(e("surname"),ta.surname,t?.required),...t}))),Do=["От 1 мес","До 15 лет"],Mo=d((({field:e})=>o(Qi,{title:"Срок, месяцев",items:Do,min:1,max:180,...e("term")}))),Ao=d((({field:e,input:t})=>o(kn,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...la(e("totalIncome"),ta.totalIncome,t?.required),...t}))),_o=d((({field:e,input:t})=>o(En,{label:"Тип обслуживания",options:xs,...la(e("serviceType"),ta.serviceType,t?.required)}))),Eo=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],zo=d((({field:e})=>{const{value:t,onChange:n}=e("vedTypes");return i((()=>{"currencyControl"!==t&&(e?.("inn")?.onChange?.(""),e?.("region")?.onChange?.(""))}),[t]),o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(br,{className:"whitespace-normal",orientation:"horizontal",items:Eo,value:t,onChange:e=>n&&n(e)})})})),Fo=d((({field:e,input:t})=>{const n=e("retirementIncome")?.value,a=l((t=>{const a=Number(t)+Number(n||0);e("wages")?.onChange?.(t),e("incomeAverage")?.onChange?.(String(a))}),[n]);return o(kn,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...la(e("wages"),ta.wages,t?.required),...t,onChange:a})}));const Oo={$ref:"/wcms-resources/outservice-productlist.json"},Vo=(e,t)=>(n,a)=>{const i="ULTRASERVICE"===t?.typeForm||"PREMIUMSERVICE"===t?.typeForm,l={surname:o(Ro,{field:e,input:n}),name:o($s,{field:e,input:n}),middleName:o(Ls,{field:e,input:n}),phone:o(so,{field:e,input:n}),organizationPhone:o(so,{field:e,input:n}),email:o(cs,{field:e,input:n}),fullName:o(Ns,{field:e,input:n}),inn:o(Ss,{field:e,input:n}),legalForm:o(Ps,{field:e,input:n}),organizationName:o(Ws,{field:e,input:n}),generalSeniority:o(ws,{field:e,input:n}),lastJobExperience:o(Ts,{field:e,input:n}),experience5Years:o(ps,{field:e,input:n}),jobsNumber:o(Is,{field:e,input:n}),beginDate:o(El,{field:e,input:n}),addressFact:o(wa,{field:e,input:n}),organizationAddress:o(Sa,{field:e,input:n}),comment:o(Ul,{field:e,input:n}),addressBranch:o(Na,{field:e,input:n,isPremium:i}),sex:o(ko,{field:e,input:n}),birthday:o(zl,{field:e,input:n}),limitedBirthday:o(Ds,{field:e,input:n}),birthPlace:o(Fl,{field:e,input:n}),desiredMeetingDate:o(Zr,{field:e,input:n}),product:o(mo,{field:e,source:Oo}),localities:o(Es,{field:e,input:n}),isClient:o(ks,{field:e}),partnerComments:o(Xs,{field:e,input:n}),collectionCount:o(jl,{field:e,input:n}),acquiringType:o(sa,{field:e,input:n}),onlineCheckout:o(js,{field:e}),posTerminal:o(co,{field:e}),serviceType:o(_o,{field:e,input:n}),term:o(Mo,{field:e}),amount:o(al,{field:e}),annualRevenue:o(rl,{field:e,input:n}),vedTypes:o(zo,{field:e}),feedbackMethod:o(vs,{field:e,input:n}),serviceDirection:o(wo,{field:e,input:n}),bankEmpolee:o(cl,{field:e}),secondaryPhone:o(No,{field:e}),consentToReceiveMaterials:o(ar,{field:e,input:n}),processPersonalDataFlg:o(ar,{field:e,input:n}),consentProviderFlg:o(ar,{field:e,input:n}),consentOthersFlg:o(ar,{field:e,input:n}),consentInformFlg:o(ar,{field:e,input:n}),consentPfrFlg:o(ar,{field:e,input:n}),applicationDate:o(kn,{label:"Дата и время обращения в Банк",...e("applicationDate")}),region:i?o(yo,{field:e}):o(xo,{field:e,input:n,params:t}),education:o(os,{field:e,input:n}),housing:o(Cs,{field:e,input:n}),employment:o(us,{field:e,input:n}),organization:o(Us,{field:e,input:n}),amountWorkers:o(ll,{field:e,input:n}),employerActivities:o(ds,{field:e,input:n}),employerOrganization:o(ms,{field:e,input:n}),positionOrganization:o(oo,{field:e,input:n}),familyStatus:o(fs,{field:e,input:n}),children:o($l,{field:e,input:n}),familyMembers:o(gs,{field:e,input:n}),dependents:o(Jr,{field:e,input:n}),totalIncome:o(Ao,{field:e,input:n}),expenses:o(hs,{field:e,input:n}),snils:o(Po,{field:e,input:n}),conscription:o(Hl,{field:e,input:n}),armyIdFlg:o(sl,{field:e,input:n}),dulSerie:o(ls,{field:e,input:n}),dulNumber:o(is,{field:e,input:n}),dulIssueDateField:o(ts,{field:e,input:n}),dulSubdivisionCode:o(ss,{field:e,input:n}),dulIssuedBy:o(as,{field:e,input:n}),addressRegistration:o(Sa,{field:e,input:n}),addressCourier:o(Sa,{field:e,input:n}),participantDateRegistration:o(Ys,{field:e,input:n}),retirementIncome:o(vo,{field:e,input:n}),otherIncome:o(Hs,{field:e,input:n}),wages:o(Fo,{field:e,input:n}),mandatoryPayments:o(zs,{field:e,input:n}),disablePeopleFlg:o(Qr,{field:e,input:n}),bankruptcyFlg:o(dl,{field:e,input:n}),shareholderFlg:o(Io,{field:e,input:n}),legalEntityName:o(Bs,{field:e,input:n}),creditInRshbCd:o(Hr,{field:e,input:n}),bankEmployeeCode:o(ol,{field:e,input:n}),partInBusiness:o(Gs,{field:e,input:n}),regionRetail:o(bo,{field:e,input:n}),addressRetail:o(Hi,{field:e,input:n}),addressMatch:o(Ea,{field:e,input:n}),paymentSystem:o(Js,{field:e,input:n}),currency:o(Gr,{field:e,input:n}),cardCategory:o(Vl,{field:e,input:n}),codeWord:o(ql,{field:e,input:n}),confirmationIncome:o(Wl,{field:e,input:n}),methodObtain:o(Os,{field:e,input:n}),deliveryDate:o(Xr,{field:e,input:n}),calculator:o(Wr,{field:e,params:t})};return function({input:e,field:t}){const{condition:n}=e,{value:a}=t(n?.name||"");return!n||n?.values?.find((e=>e===(a?.key??a)))}({input:n,field:e})?o("div",{children:l[n?.name||""]},String(a)):null},Lo=e=>2===e?"@xl:grid-cols-2":"",$o=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(_e,{size:"text-h6",children:e})}):null,qo=d((({responseType:e,typeForm:t,onClose:n})=>{const a="OK"===e,i="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(Ql,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto",onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ne,{image:{icon:a?"ResponseOKIcon":"ResponseFailIcon",iconVersion:"normal"},width:"136",height:"136"}),o(S,{className:"w-full",title:a?"Ваша заявка отправлена":"Не удалось отправить заявку",description:a?i:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(Jl,{type:"button",onClick:n,children:"Хорошо"})]})})})),jo=e=>t=>t&&Object.entries(e).flatMap((([e,n])=>n(t[e])))||[],Uo=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:a,amount:i,term:l,annualRevenue:r,serviceType:s,vedTypes:o,region:c,...d}=e,m=t||r?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:a=!1,term:i,amount:l,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${oa(t?.key)?`/Онлайн касса=${n}/POS-терминал=${a}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${l}/Срок=${i}/Выручка=${r}`})(e):null,u={...d,...Ho(o),...Wo(c),...m?{partnerComments:m}:{},...s?{typeForm:s}:{}};return Object.fromEntries(Object.entries(u)?.map((([e,t])=>[e,t?.key||t])))},Wo=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},Ho=e=>e?{vedTypes:Object.fromEntries(Eo.map((({id:t})=>[t,t===e])))}:{},Yo={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:ra[0],serviceType:xs[0],feedbackMethod:bs[0],serviceDirection:ys[0],vedTypes:Eo[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},Ko=d((({text:e,link:t})=>c(w,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(_e,{children:e}):null,t?o(Ne,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"!text-left text-primary-main",children:o(_e,{children:t.text})}):null]}))),Go=(e,t)=>o(Jl,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Xo=(e,t,n)=>c("div",{className:"flex col-span-2 gap-xs flex-col w-full items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3 items-center",children:[o(Pa,{...e}),o(Ko,{link:t})]}),yn(ia(e,Kn).error)]}):o(Ko,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),Go(n)]}),Jo={send:async function(e,t=!1){const{typeForm:n,region:a,phone:i="",email:l,birthday:r,desiredMeetingDate:s,inn:o,addressBranch:c,secondaryPhone:d="",bankEmpolee:m,applicationDate:u,serviceDirection:h,...p}=e,g=t&&"Юридическое лицо / ИП"!==h,f=`${Ut}${g?"/lead":"/sendcorporatelead"}`,x={typeForm:n,...Yt(a,g),...Kt(l,g),...Wt(i),...Ht(s,"desiredMeetingDate"),...g?Ht(r):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...Gt(d)},...p};try{const e=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(x)});return e?.ok?await e.json():null}catch(e){return null}}},Zo=d((({className:e,title:t,typeForm:n="",sections:r=[],button:s,link:d,endpoint:m,additionalParams:h,isContacts:p,data:g,...f})=>{const x=r?.flatMap((e=>e?.inputs))||[],y=((e,t="")=>{const n=Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||Yo[e.name||""]])));return n?.serviceType&&"PREMIUMSERVICE"===t&&(n.serviceType=xs[1]),{...n,typeForm:{key:t,text:""}}})(x,n),[b,v]=a(""),w=sn(qo),C=l((async(e,t)=>{const a=Qo(x,e),i=jo(aa(a));if(!zn(i(e)))return console.warn("validation fail");const l=Uo({...e,...h}),r=await Jo.send(l,"lead"===m)?"OK":"Fail";if(v(r),r&&w.open({typeForm:n,responseType:r}),"OK"===r&&g){const e=tn();Xt({aspectsAttributes:g,aspects:e,ev:t})}return r}),[n]),[,{field:S,onSubmit:k,reset:I}]=an(y,{onSubmit:C}),T=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(x)?.name;return i((()=>{"OK"===b&&(v(""),I())}),[b]),c(rn,{className:u("container space-y-m",e),title:t,...f,children:[c("form",{onSubmit:k,children:[r.map(((e,t)=>c("div",{className:u(Lo(e.columns),"grid gap-x-m"),children:[$o(e.title),(e?.inputs||[])?.map(Vo(S,{typeForm:n}))]},`section-${t}`))),Xo(T?S("consentDataProcessing"):void 0,d,s)]}),p?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(ne,{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(ne,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),Qo=(e,t)=>e.filter((e=>"secondaryPhone"===e?.name?Boolean(t.secondaryPhone):e)).filter((e=>!e?.condition||e?.condition.values.find((n=>{const a=t?.[e?.condition?.name??""];return n===(a?.key??a)})))),ec=d((({inputs:e=[],typeForm:t="",field:n,key:a})=>{const i=e.every((e=>Boolean(n(e.name).value))),l=r((()=>e?.filter((e=>e.required))?.some((e=>Boolean(ia(n(e?.name),ta[e?.name]).error)))),[e]);return o("div",{className:"w-fit",children:o(li,{isFoldButtonOnTop:!0,unfoldedByDefault:!0,renderFoldableSection:({isUnfolded:a})=>o(ri,{isUnfolded:a,className:"flex flex-col pl-2xl",children:e.map(Vo(n,{typeForm:t}))}),renderFoldButton:tc(c("div",{children:[o(Pa,{value:i,onChange:t=>{for(const a of e){const e=n(a.name);e?.onChange&&e.onChange(t)}},text:"Согласие на все документы"},a),yn(l?"Отметьте все обязательные соглашения":"")]}))})})})),tc=e=>t=>c("div",{className:"flex items-start",children:[e,o("button",{onClick:t.onToggle,className:"px-m py-2xs",type:"button",children:o(W,{className:"text-primary-text",name:t.isUnfolded?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})})]}),nc=({field:e,typeForm:t="",inputs:n})=>{const{consentInputs:a,restInputs:i}=ac(n||[]);return a.length>2?c("div",{children:[i.map(Vo(e,{typeForm:t})),o(ec,{inputs:a,field:e})]}):(n||[])?.map(Vo(e,{typeForm:t}))},ac=e=>({consentInputs:e?.filter((e=>Object.keys(Yl).includes(e.name||"")))||[],restInputs:e?.filter((e=>!Object.keys(Yl).includes(e.name||"")))||[]}),ic=[{columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0},{fieldType:"common",name:"name",required:!0,dadata:!0},{fieldType:"common",name:"middleName",dadata:!0},{fieldType:"common",name:"limitedBirthday",required:!0},{fieldType:"common",name:"phone",required:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{inputs:[{fieldType:"common",name:"processPersonalDataFlg",required:!0},{fieldType:"common",name:"consentProviderFlg",required:!0},{fieldType:"common",name:"consentOthersFlg",required:!0},{fieldType:"common",name:"consentInformFlg"},{fieldType:"common",name:"consentPfrFlg"}]}],lc={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",organizationPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:ra[0],serviceType:xs[0],feedbackMethod:bs[0],serviceDirection:ys[0],vedTypes:Eo[0],birthday:void 0,limitedBirthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,addressRegistration:"",participantDateRegistration:void 0,currency:"",paymentSystem:"",cardCategory:{key:"",text:""},codeWord:"",addressRetail:{key:"",text:""}},rc=(e,t,n="")=>{if(t){const e={...t};return e.limitedBirthday=new Date(e?.limitedBirthday||0),e}return{...Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||lc[e.name||""]]))),typeForm:{key:n,text:""}}},sc=(e,t)=>o(Jl,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),oc=e=>ni("/user-data/updateUserProfile","PUT",e),cc=e=>ni("/user-data/updateUserTask","PUT",e),dc=(e,t)=>Boolean(e)&&"string"!=typeof e&&Boolean(e?.errorMessage.startsWith(`Too many request for phoneNumber [${t}]`)),mc={width:"118",height:"24"},uc={"bg-white":"color",transparent:"white"},hc={"bg-white":"text-primary-main",transparent:"text-white"},pc=(e,t,n)=>o(ne,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:uc[e]},className:hc[e],width:n?.width,height:n?.height}),gc={"bg-white":"text-primary-text",transparent:"text-white"},fc=d((({className:e,href:t="/",logo:n,children:a,targetBlank:i,bgColor:l="bg-white",showTitle:r=!0,data:s})=>c("a",{className:u("inline-flex items-center font-sans no-underline",e),href:n?.href??t,target:i?"_blank":"_self","aria-label":n?.title??"Россельхозбанк",...fe(s),children:[pc(l,n?.image,mc),r?a??o("div",{className:"ml-s",children:o(_e,{font:"font-medium",color:gc[l],size:"",children:n?.title??"Россельхозбанк"})}):null]}))),xc=d((({phoneNumber:e,sendCode:t,onClose:n})=>{const[r,s]=a(""),[d,m]=a(""),[u,h]=a(!1),p=l((async()=>{const e=await(a={captchaText:d},ni("/sms/checkCaptcha","POST",a).then((e=>e.text())).then((e=>"ERROR"!==e)));var a;e?(t?.(),n?.()):h(e)}),[d,t]),g=l((()=>{(async()=>{s(URL.createObjectURL(await(e=>ni(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?await e.blob():new Blob)))(e)))})()}),[]);return i(g,[]),o(Ql,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",head:o(fc,{}),onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex h-36 w-72",children:[o("img",{className:"grow",src:r}),o("div",{onClick:g,className:"flex w-8 items-center justify-center cursor-pointer",children:o(W,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(gn,{className:"w-[300px]",onChange:m,value:d,placeholder:"Введите код с картинки"}),u?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-[310px] justify-between",children:[o(Jl,{onClick:close,version:"secondary",children:"Вернуться"}),o(Jl,{type:"submit",disabled:!d,onClick:p,version:"secondary",children:"Отправить"})]})]})})})),yc=d((({time:e,setTime:t,className:n})=>(i((()=>{const n=setInterval((()=>{t(e-1)}),1e3);return 0===e&&clearInterval(n),()=>{clearInterval(n)}}),[e]),o("span",{className:n,children:bc(e)})))),bc=e=>`${`${Math.floor(e/60)}`.padStart(2,"0")}:${(""+e%60).padStart(2,"0")}`,vc=d((({values:e,setValues:t,hasError:n,errorText:r})=>{const[d,m]=a(0),u=s([]);i((()=>{u.current?.[d]?.focus()}),[d]);const h=l((n=>a=>{const{value:i}=a.currentTarget,l=i.slice(0,1);t(e.map(((e,t)=>t===n?l:e))),m(n+1)}),[e]),p=l((n=>a=>{const{key:i}=a;if("Backspace"===i&&!e[n]){const a=n>0?n-1:e.length-1,i=e.map(((e,t)=>t===a?"":e));t(i),m(a)}}),[e]),g=l((n=>{n.preventDefault();const a=n.clipboardData.getData("text"),i=e.map(((e,t)=>t<a.length?a[t]:e));t(i),m(i.length-1)}),[e]);return c("div",{className:"flex flex-col gap-2 text-center",children:[o("div",{children:e.map(((t,a)=>o("input",{type:"number",maxLength:1,value:t,onChange:h(a),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[a]=e},onFocus:e=>e.target.select(),onKeyDown:p(a),className:Nc(a,e,n)},a)))}),n?o("div",{className:"text-error",children:r}):null]})})),Nc=(e,t,n=!1)=>{const a=!t[e];return`w-20 h-24 text-5xl text-center p-lg m-2 border ${n&&a?"border-error":"border-gray"} rounded-md caret-transparent outline-none`},wc=d((({isDisabled:e,onClick:t,text:n})=>o(Jl,{type:"button",onClick:t,disabled:e,children:o(_e,{font:"font-normal",children:n})}))),Cc=e=>{e&&(globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token))},Sc=({values:e,onSuccess:t})=>{const[n,r]=a(""),[s,o]=a(!1),[c,d]=a(0),[m,u]=a(!1),[h,p]=a(0),g=l((()=>r("")),[]),f=Boolean(0===c&&m),x=h>2||f||!e.every(Boolean),y=l((async()=>{try{u(!1),d(0),p((e=>e+1)),o(!0),await(async e=>ti("/sms/checkCode","POST",e).then(Cc))({smsText:e.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),g(),t?.(e.join(""))}catch{r(h>1?"Исчерпан лимит ввода смс-кода":"Неверный код")}finally{o(!1)}}),[e,h]);return i((()=>{r(f?"Код просрочен":"")}),[f]),{handleSubmit:y,hasError:Boolean(n),errorText:n,isLoading:s,timeNextReq:c,isSubmitButtonDisabled:x,setTimeNextReq:d,setIsTimerStarted:u,setAttempts:p}},kc=d((({title:e,description:t,__html:n,code:r=!0,codeLength:s=4,textButton:d="Далее",phoneNumber:m="+79999999999",onSuccess:u=un,onClose:h=un})=>{const[p,g]=a(Array(s).fill("")),{handleSubmit:f,hasError:x,errorText:y,isLoading:b,timeNextReq:v,isSubmitButtonDisabled:N,setTimeNextReq:w,setIsTimerStarted:C,setAttempts:k}=Sc({values:p,onSuccess:u}),I=sn(xc),T=l((async()=>{var e;await(e={phoneNumber:m,smsCodesSetName:{key:"AUTHENTICATION"}},ti("/sms/sendCode","POST",e).then((t=>!dc(t,e.phoneNumber))))?(k(0),w(180),C(!0)):I.open({phoneNumber:m,sendCode:T,onClose:h})}),[m,h]);return i((()=>{T()}),[]),o(Ql,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl px-5xl py-0",onClose:h,children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[o(S,{className:"w-full",title:e,description:t,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),r?o(vc,{values:p,setValues:g,errorText:y,hasError:x}):null,Tc(v,w,T),o(Me,{itemSize:"list-s",__html:n}),Ic(d,N,f),b?o(za,{blur:!1}):null]})})})),Ic=(e,t,n)=>e?o(wc,{isDisabled:t,onClick:n,text:e}):null,Tc=(e,t,n)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(yc,{className:"text-base ml-1",time:e,setTime:t})]}):o(Ne,{onClick:n,className:"text-primary-main",children:"Получить новый код"}),Bc={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},Pc={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},Rc=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],Dc=d((({onSubmit:e=un,onClose:t=un})=>{const[n,i]=a(""),[r,s]=a(!1),d=tr(2),m=l((()=>{e(n)}),[e,n]),u=l((e=>{i(e),"REFUSE"===e&&s(!0)}),[]),h=r?Pc:Bc;return o(Ql,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",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(br,{className:"whitespace-normal",orientation:"horizontal",items:Rc,value:n,onChange:u}),o(Jl,{disabled:!n,type:"button",onClick:m,children:"Далее"})]})})})),Mc=e=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:jt(e),textButton:"Далее",__html:"<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>\n <ul><li>согласие на запрос информации в БКИ</li></ul>"}),Ac=d((({onClose:e})=>{const t=Jt(),[n,a]=Ol("leadForm"),i=l((async()=>{const e=await(n={redirectUri:t.href},ti("/esia/getLink","POST",n));var n;e?.link&&t.assign(e.link)}),[]),r=l((()=>{if(null!==n){const e={...n};Reflect.deleteProperty(e,"esiaAccountTypeCd"),a(e)}e?.()}),[]);return o(Ql,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",onClose:r,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex items-center justify-around w-full",children:[c("ul",{className:"list-disc",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ne,{image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"70"})]}),c("div",{className:"flex items-center justify-between w-full m-0",children:[o(Jl,{type:"button",onClick:i,children:"Заполнить через Госуслуги"}),o(Jl,{type:"button",version:"secondary",onClick:r,children:"Пропустить"})]})]})})})),_c={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},Ec={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK"},zc={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},Fc=e=>Object.entries(e).reduce(((e,[t,n])=>t in _c?[...e,{contactTypeCd:{key:_c[t]},value:n}]:e),[]),Oc=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in Ec){const a=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:Ec[t]},...a}]}return e}),[]),Vc=e=>Object.entries(e).reduce(((e,[t,n])=>t in zc?[...e,{incomeTypeCd:{key:zc[t]},value:Number(n||0)}]:e),[]),Lc=({inputs:e,programId:t,nextStepLink:n,saveForm:i})=>{const[r,s]=a(""),[,o]=Ol("taskId"),[,c]=Ol("profileId"),[,d]=Ol("participantId"),[,m]=Ol("programId"),u=(e=>{const{open:t}=sn(Ac),n=Jt();return l((()=>{t({onClose:()=>n.assign(e)})}),[t,e])})(n),h=(e=>{const{open:t}=sn(Dc),n=sn(kc),a=t=>async n=>{try{t&&await oc({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()}catch(e){console.log(e)}},i=(t,i)=>async l=>{"SIGNED"===l&&t?n.open({...Mc(t),onSuccess:a(i)}):e()};return{open:(n,a)=>t({onSubmit:i(n,a),onClose:e})}})(u),p=sn(kc),g=l((({participantId:e,taskId:t,profileId:n,programId:a})=>{d(e),o(t),c(n),m(a)}),[]);return{handleSubmit:l((async n=>{const a=jo(aa(e));var l;if(zn(a(n)))try{const e=await(l={profile:{phone:jt(n.phone)}},ti("/public-data/createUserProfile","POST",l).then((e=>e?.profile?.id||null)));if(e&&n?.phone){const a=async()=>{try{await $c({programId:t,profileId:e,formData:n,saveUserData:g,saveForm:i}),p.close(),h.open(n.phone,e)}catch{s("Fail")}},l=Object.keys(Yl).filter((e=>n[e])).map((e=>Yl[e]?.text));p.open({...qc(n?.phone,l),onSuccess:a})}}catch{s("Fail")}}),[]),responseStatus:r}},$c=async({programId:e,profileId:t,formData:n,saveUserData:a,saveForm:i})=>{const l=Uc(n);await oc(((e,t)=>{const{name:n="",surname:a="",middleName:i="",limitedBirthday:l="",phone:r="",email:s="",processPersonalDataFlg:o,consentProviderFlg:c,consentPfrFlg:d,consentPhotoFlg:m,consentAssignmentClaimsFlg:u,consentCollectionFlg:h,consentInformFlg:p}=t;return{profile:{id:e,name:n,surname:a,midname:i,birthDate:l&&qt(l,!0),email:s,phone:jt(r),processPersonalDataFlg:Boolean(o),consentProviderFlg:Boolean(c),consentPfrFlg:Boolean(d),consentPhotoFlg:Boolean(m),consentAssignmentClaimsFlg:Boolean(u),consentCollectionFlg:Boolean(h),consentInformFlg:Boolean(p)}}})(t,l));const{taskId:r,participantId:s}=await(async e=>await ti("/user-data/createDraftTask","POST",e)||{})({profileId:t,programId:e});try{await cc((({participantId:e,taskId:t,profileId:n,formData:a})=>{const{name:i,surname:l,middleName:r,limitedBirthday:s,phone:o,email:c}=a;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:Jt().origin,id:t,participants:[{birthDate:s&&qt(s,!0),id:e,midname:r,name:i,surname:l,profile:{id:n},participantContacts:Fc({phone:o&&jt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}]}}})({participantId:s,taskId:r,profileId:t,formData:l}))}catch(e){console.log(e)}a({participantId:s,taskId:r,profileId:t,programId:e}),i(n)},qc=(e,t)=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:jt(e),textButton:"Далее",__html:`<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>${jc(t)}`}),jc=e=>`<ul>${e?.map((e=>"<li>"+e+"</li>")).join("")}</ul>`,Uc=e=>{const{consentOthersFlg:t,...n}=e;return{...n,consentCollectionFlg:t,consentAssignmentClaimsFlg:t,consentPhotoFlg:t}},Wc=e=>{const{profile:t,addInfo:n,document:a,addressRegistration:i,addressFact:l}=e;return{name:t?.name,surname:t?.surname,middleName:t?.midname,limitedBirthday:t?.birthDate,phone:io(t?.phone),email:t?.email,dulIssueDateField:a?.dulIssueDate,dulIssuedBy:a?.dulIssuedBy,dulNumber:a?.dulNumber,dulSerie:a?.dulSerie,dulSubdivisionCode:a?.dulSubdivisionCode,snils:n?.snils,birthPlace:n?.birthPlace,addressRegistration:Hc(i),addressFact:Hc(l),esiaAccountTypeCd:t?.esiaAccountType}},Hc=e=>{const{postcode:t,region:n,regionCode:a,locality:i,city:l,street:r,house:s,building:o,block:c,apartment:d}=e,m=[t,n,i||l,r?`ул ${r}`:void 0,s?`д ${s}`:void 0,c?`к ${c}`:void 0,o?`стр ${o}`:void 0,d?`кв ${d}`:void 0].reduce(((e,t)=>t?e?`${e}, ${t}`:t:e),"");return{...e,regionCode:a?.key,fullAddress:m}},Yc=e=>{const t=Jt(),[n,{setTrue:a,setFalse:r}]=on(!1),[,s]=Ol("leadForm"),o=l((async(n,i,l)=>{a();try{const a=await(o={profileId:n,code:i,state:l,redirectUri:globalThis.location?.href},ti("/esia/updateProfileEsia","POST",o));a&&s((e=>({...e,...Wc(a)}))),t.assign(e)}finally{r()}var o}),[e]);return i((()=>{const e=JSON.parse(globalThis.localStorage?.getItem("profileId")??"null"),t=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),n=t.get("code"),a=t.get("state");e&&n&&a?o(e,n,a):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),{isLoading:n}},Kc=d((({className:e,title:t,programId:n="",nextStepLink:a="/credit-lead",button:l,...r})=>{const s=ic?.flatMap((e=>e?.inputs))||[],{isLoading:d}=Yc(a),[m,h]=Ol("leadForm"),p=rc(s,m),{handleSubmit:g,responseStatus:f}=Lc({inputs:s,programId:n,nextStepLink:a,saveForm:h}),[,{field:x,onSubmit:y}]=an(p,{onSubmit:g}),b=sn(qo);return i((()=>{f&&b.open({responseType:f})}),[f]),o(rn,{className:u("container space-y-m",e),title:t,...r,children:c("form",{onSubmit:y,className:"space-y-m relative",children:[d?o(za,{blur:!1}):null,ic.map(((e,t)=>c("div",{className:u(Lo(e.columns),"grid gap-x-m"),children:[$o(e.title),nc({field:x,inputs:e?.inputs})]},`section-${t}`))),sc(l)]})})})),Gc=d((({title:e,description:t})=>{const n=ke();return c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ne,{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"})]})})),Xc=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",Jc=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`}),Zc=10;function Qc(e,{sensitivity:t,rootRef:n}={}){const a=s(null),l=r((()=>({threshold:ed(t),root:n?.current})),[t,n?.current]);return i((()=>{if(!a.current)return;const t=new IntersectionObserver(e,l);return t.observe(a.current),()=>{t.disconnect()}}),[e,l]),a}function ed(e=0){const t=Math.round(e*Zc);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const td=d((({className:e,style:t,idx:n,activeIndex:a,observerOptions:i,children:r,onIntersection:s})=>{const c=Qc(l((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:r})})),nd=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],ad=d((({className:e,itemClassName:t,containerRef:n,activeIndex:a,visibleItemCount:i=0,gap:r=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:p,onVisibleItemsChange:g,onVisibleIndicesChange:f})=>{const x={sensitivity:1,rootRef:n},y=s([]),b=l(((e,t)=>{const n=[...y.current||[]];n[e]=t,y.current=n,g&&g(n),f&&f(ld(n))}),[g,f]),v=i>0?r*Number(i)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?id(c,v):{},...N?Jc(h):{},gap:`${r}px`};return o("div",{className:u("box-border overflow-auto no-scrollbar",d,e),style:C,ref:n,role:"list",children:(S=(e,n)=>o(td,{className:u(m,i?nd[i-1]:"",{"h-full":N},t),style:w?id(c/4):{},activeIndex:a,idx:n,observerOptions:x,onIntersection:b,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(S):S(e,0))(p)});var S})),id=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),ld=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),rd={"horizontal-list":"w-6","vertical-list":"h-6"},sd=({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?rd[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(i)},String(i)),od=({activeIndex:e,onClick:t})=>(n,a)=>{const i=a===e,l=i?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=i?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=i?"text-l":"text-m group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(a),"aria-label":n?.title,className:u("max-h-28 mt-xs ml-xs relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50 whitespace-nowrap",l),children:[o("div",{className:r,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(a))},cd=e=>t=>e.scrollWidth/t,dd=e=>(t,n)=>{e.scrollBy({left:n*cd(e)(t),behavior:"smooth"})},md=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[i,r]=a([]),o=l((e=>{r((t=>{return(n=t)===(a=e)||Boolean(n&&a&&n?.length===a?.length&&n.every(((e,t)=>e===a[t])))?t:e;var n,a})),t&&t(e)}),[t]),[c,d]=i.length?[Br()(i),Ir()(i)]:[-1,-1],m=c>0,u=d<e-1,h=l((()=>{var t;n.current&&(m?dd(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=l((()=>{n.current&&(u?dd(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=l(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{n?.current&&n.current.children[e]?.scrollIntoView(t)}),[n]);return[n,{scrollLeft:h,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:u,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},ud={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},hd=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:a="horizontal-list",version:r,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=ke(),[h,p]=md({itemCount:s.length}),g=pd(Boolean(s?.length));i((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=l((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(ad,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(od({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",ud[a],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(sd({activeIndex:t,onClick:f,listType:a}))}):null})),pd=(e=!1)=>({behavior:e?"auto":"smooth"}),gd=d((({className:e,disabled:t,...n})=>o(Ne,{rounded:!0,className:u("group/btn w-12 h-12 min-h-12 max-h-12 flex items-center justify-center shadow-main-black",t?"bg-secondary-light text-secondary-text":"bg-white text-primary-text hover:text-primary-main",e),disabled:t,...n,children:o(ne,{className:"w-4 h-4 min-w-4 min-h-4 rounded-full box-border",image:{icon:"ArrowLeftIcon",iconVersion:"black"},imageClassName:"group-hover/btn:text-primary-main",width:"16",height:"16"})}))),fd=d((e=>o(gd,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),xd=d((e=>o(gd,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),yd="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",bd=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:a,isBottom:i})=>{const{canScrollLeft:l,canScrollRight:r,scrollLeft:s,scrollRight:d}=t,m=a&&!i;return c("div",{className:e,children:[n?vd(t):null,l?o(fd,{className:u(Nd(i),m?"left-1":"left-0"),onClick:s}):null,r?o(xd,{className:u(Nd(i),m?"right-1":"right-0"),onClick:d}):null]})})),vd=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(yd,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(yd,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),Nd=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),wd=d((({className:e,version:t,gap:n=14,padding:a=16,visibleItemCount:i=1,listType:l="horizontal-list",snapAlign:r,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:x})=>{const y=Array.isArray(g)?g.length:0,[b,v]=md({itemCount:y,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===l?"relative h-full":""),children:[o(ad,{containerRef:b,activeIndex:N,visibleItemCount:i,gap:n,padding:a,listType:l,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(bd,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(hd,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:y,listType:l,version:t,navButtons:x,containerRef:b,containerScroll:v})]})})),Cd=({blocksToRender:e,...t})=>o(wd,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:P(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",Xc(!0)),children:T(e,t)},String(n))})}),Sd=e=>e%2!=0,kd=d((({textNode:e,iconNode:t,tag:n,onClick:a,justifyContent:i="between",className:l,role:r,...s})=>c(n,{tag:n,className:u("flex items-center w-full gap-1","between"===i?"justify-between":"justify-center",l),onClick:a,role:r,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),Id=d((({className:e="",label:t,icon:n,dataTheme:a="pc",disabled:i=!1,onClick:l})=>o(kd,{tag:"button",onClick:l,disabled:i,"data-theme":a,justifyContent:"center",role:"button",className:u("py-4 border border-transparent outline-none focus:border-primary-text space-x-s",i?"bg-main-divider text-main-disabled hover:bg-main-divider":"bg-primary-main text-white hover:bg-primary-hove",e),textNode:o(_e,{size:"text-h4",children:t}),iconNode:n?o(ne,{image:{icon:n,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),Td=({isUnfolded:e,onToggle:t})=>o(Id,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Bd=["ArrowDownIcon","ArrowUpIcon"],Pd="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",Rd=({topItemsCount:e=0,label:t="",block:n,blocksToRender:a=[],...i})=>{const[l,r]=e>0?[a.slice(0,e),a.slice(e)]:[a,[]];return c("div",{className:u("space-y-2xs",{hidden:!a.length}),children:[c("div",{className:u(Pd),children:[P(l,{...i.options,parent:n}),Sd(l.length)?o(Lt,{className:"col-span-6",...i}):null]}),o(li,{renderFoldableSection:({isUnfolded:e})=>c(ri,{className:u(Pd),isUnfolded:e,children:[P(r,{...i.options,parent:n}),Sd(r.length)?o(Lt,{className:"col-span-6",...i}):null]}),renderFoldButton:({isUnfolded:n,onToggle:a})=>o(Id,{className:u({hidden:e<1}),disabled:!r?.length,label:t,icon:Bd[Number(n)],dataTheme:i.options?.page?.colorPalette,onClick:a})})]})},Dd=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...a})=>{switch(e?.view){case"grid":return c("div",{children:[Md(n,t),Rd({...e,...a,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[Md(n,t),Cd({...a,blocksToRender:t})]});default:return null}})),Md=(e,t)=>e&&!t.length?o(Gc,{...e}):null,Ad=e=>t=>t.reduce(((t,n,a)=>t.length?t.concat({...e,key:`sep-${a}`},n):[n]),[]),_d=d((({value:e,onChange:t,items:n=[],multiple:a})=>n.map((n=>o(qs,{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))))),Ed=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,Ad(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(zd(a)).filter(Boolean))]}),n?o("div",{children:o(Jl,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:i,children:n?.text})}):null]}))),zd=e=>([t,n])=>{const a=n?.type;return"array"===a?Fd(t,e)(n):null},Fd=(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(_e,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(_d,{items:a,multiple:!n?.single,...t(e)})]},e)};function Od(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const Vd=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,Ld=(e,t)=>Object.entries(e).map((([n,a])=>"number"==typeof a?Array.isArray(t[n])?((e,t)=>n=>Vd(t[e])||Vd(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>Vd(t[e])||Vd(n[e])||$d(t[e])<=$d(n[e]))(n,e):"object"==typeof a&&"min"in a&&"max"in a?((e,t)=>n=>Vd(t[e])||Vd(n[e])||$d(t[e]?.min)>=$d(n[e]?.min)&&$d(t[e]?.min)<=$d(n[e]?.max))(n,e):Array.isArray(a)?((e,t)=>n=>Vd(t[e])||Vd(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>Vd(t[e])||Vd(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),$d=e=>Number(e||0),qd=(e,{block:t,page:n,normalize:a=nn})=>{const i=t?.blocks||[],[l,{field:s,reset:o,update:c}]=an(e),d=r((()=>Od(i,i.map((e=>Et(e.content,n?.fallback))))),[i,n?.fallback]),m=l===e?i:((e,t)=>(n=nn)=>e?.filter((([,e])=>Ld(t,n(e)||{}))).map((([e])=>e)))(d,l)(a);return[l,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},jd={},Ud={},Wd=Ot((({className:e,filtrationSchema:t=jd,consumerField:n={},resetButton:a,...i})=>{const[,{blocksToRender:l},{field:r,reset:s}]=qd(Ud,{block:i.block,page:i.options?.page}),d=o(Dn,{className:"w-64",label:n?.title,options:Hd(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>Hd(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...i,children:[o(Ed,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(Jl,{type:"reset",className:"mt-lg w-64",onClick:s,version:a?.version,children:a?.text})})]})}),o(Dd,{blocksToRender:l,...i})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),Hd=e=>Od(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),Yd=(e=!1)=>e?"text-left":"text-center",Kd={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},Gd=d((({className:e,defaultIconSize:t=44,iconBgVersion:n="primary",size:a,icon:i,...l})=>{const r=String(a?.width||t);return i?o("div",{style:{width:`${r}px`,height:`${r}px`},className:u("rounded-icon object-fit flex justify-center items-center",Kd[n],e),children:o(W,{...l,width:"54%",height:"54%",name:i})}):null})),Xd=d((({className:e="",title:t,benefitList:n,...a})=>{const i=ke();return c(g,{className:e,defaultPadding:"p-6xl",...a,children:[t?o(N,{headingType:"h3",as:"h2",className:Yd(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(Jd)}):null]})})),Jd=({label:e,description:t,__html:n,icon:a,isDotted:i=!1,iconBgVersion:l},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[a?.icon?o(Gd,{className:"shrink-0",iconBgVersion:l,...a}):null,a?.src?o(ne,{className:"shrink-0",image:a}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(N,{headingType:"h6",children:e}),o(_e,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(Me,{__html:n,isDotted:i,itemSize:"list-s"}):null]}):null]},String(r)),Zd=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(_e,{size:"text-h6",font:"font-normal",align:e,children:n}):null,t?o(ne,{image:t,height:"180",className:"w-auto mx-auto"}):null,a?o(_e,{size:"text-h6",font:"font-normal",align:e,children:a}):null]},String(i)),Qd=(e,t,n)=>o("div",{className:`grid gap-2xs ${em(t)}`,children:e.map(Zd(n))}),em=e=>{switch(e){case"3":return"grid-cols-3";case"4":return"grid-cols-4";default:return"grid-cols-5"}},tm=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:a="4",subtitle:i,title:l,...r})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...r,children:[o(S,{defaultPadding:"",title:l,description:i,headlineVersion:"M"}),e?.length?Qd(e,a,t):null]}))),nm={start:"justify-start",center:"justify-center",end:"justify-end"},am=d((({buttons:e,className:t="",align:n,...a})=>{const i=n&&u("flex",nm[n]);return o(g,{className:u("!bg-transparent",i,t),defaultPadding:"p-0",...a,children:qe(e)})})),im=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:a=2,depositeName:i,isShowDepositeName:l,color:r="text-secondary-text"})=>c("div",{children:[o(_e,{size:"text-l",font:"font-light",color:r,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children:He(a,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),i&&l?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:i}):null]})]}))),lm=d((({title:e="Ставка"})=>c("div",{className:"space-y-s min-w-96",children:[o(_e,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(W,{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:"Процентная ставка не найдена, выберите другие параметры"})})]}))),rm=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:a=2,color:i="text-secondary-text",children:l,...r})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(im,{title:e,rate:t,unit:n,fractionDigits:a,color:i,...r})}),o(dr,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:a,fixed:!0,color:i,...r}),l]}):o(lm,{title:e,...r}),sm={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},om={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},cm=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:a}=e,[i,l]=((e,t,n)=>{const{maxBonus:a=5e3,prefMonthsNum:i=sm.prefMonthsNum,prefTravelBonusRate:l=sm.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(l*t)+Math.round(r*n),a);return[c,c*i+Math.min(Math.round(s*t)+Math.round(o*n),a)*(12-i)]})(t||om,n,a);return{...t,...e,monthBonus:i,yearBonus:l}},dm=Ot((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,...l})=>{const[r,{field:s}]=an({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=cm(r,n);return o(lr,{className:e,title:t,...l,children:c("section",{className:u(rr,e),children:[c("div",{className:sr,children:[wr({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),wr({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?rm({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:or,children:[f>=0?o(dr,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,qe(a,{isVertical:!0}),gr(i)]})]})})})),mm=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,um=e=>vr({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),hm=" (c капитализацией)",pm=({income:e,finalSum:t,postfix:n="₽",buttons:a=[],footnotes:i=[],isCapitalization:l=!1})=>c("div",{className:or,children:[o(dr,{title:`Доход в конце срока${l?hm:""}`,value:e,postfix:n,prefix:"+"}),o(dr,{title:`Сумма в конце срока${l?hm:""}`,value:t,postfix:n}),qe(a,{isVertical:!0}),i?.map(gr)]}),gm={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const fm={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},xm=(e,t)=>{const{daysValue:n,moneyValue:a,isPartialWithdrawal:i,isReplenished:l,isMonthlyInterestPayment:r}=e,s=l||i,o=n<90||n>730,c=function(e){const t=e?.rateType?gm[e?.rateType]:"",{data:n}=ga(t?`${Ut}/depositrates/${t}`:null,Dt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&ym(s,e)&&Mr(a,["minSum","maxSum"],e)&&Mr(n,["minDays","maxDays"],e)))||fm,{rate:m}=d,u=bm(m,e),h=a+u,p=c||[fm];return{...d,...Dr(["minSum","maxSum"],p),...Dr(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},ym=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,bm=(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)},vm=Ot((({className:e="",title:t,buttons:n,footnote:a,bottomFootnote:i,isShowDepositeName:l,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=an({moneyValue:hr(r,1e5),daysValue:pr(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=xm(m,s),{income:g,finalSum:f,rate:x,depositeName:y}=p;return o(lr,{className:e,title:t,...d,children:c("section",{className:u(rr,e),children:[c("div",{className:sr,children:[wr({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(b={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(Qi,{items:[`От ${mm(b.min||0)}`,`До ${mm(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[Nm(p,h),um({title:"Выплата процентов",orientation:"vertical",...h("isMonthlyInterestPayment"),className:"sm:flex-col"})]})]}),rm({rate:x,depositeName:y,isShowDepositeName:l}),pm({income:g,finalSum:f,buttons:n,footnotes:[a,i]})]})});var b})),Nm=(e,t)=>c("div",{className:"space-y-s",children:[o(_e,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(Pa,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(Pa,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),wm=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,a]=t[n-1],[i,l]=t[n];a>=i?t.splice(n-1,2,[e,Math.max(a,l)]):n++}return t},Cm={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},Sm=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,l=t?.[0]?Tm(t[0].minMonths,t[0].maxMonths):0,r=!n?.isShowMonthlyInterestPayment,s=!n?.isShowRemoteRegistration,o=!n?.isShowReplenish,c=!n?.isShowWithdrawn,d=!n?.isShowNewClient,m=t?.find((t=>[Im({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),Im({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),Im({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),Im({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,Mr(a,["minSum","maxSum"],t),Mr(i||l,["minMonths","maxMonths"],t)].every(Boolean)))||Cm,{rate:u}=m,h=km(u,e),p=a+h,g=t||[Cm];return{...m,...Dr(["minSum","maxSum"],g),...Dr(["minMonths","maxMonths"],g),availableMonths:wm(g.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((a,i)=>t>=e?e+i*n:e-i*n)))(e,t))),...e,defaultMonth:l,income:h,finalSum:p}},km=(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)},Im=({row:e,userInputParams:t,paramKey:n,isExclude:a})=>a||t[n]===e[n],Tm=(e,t)=>e+Math.round((t-e)/2),Bm=(e="rub")=>"rub"===e,Pm=(e,t)=>{const{minMonths:n,maxMonths:a}=Dr(["minMonths","maxMonths"],Am(t,e?.currency)),i=e.monthsValue||Math.round((n+a)/2);return{monthsValue:Ki(i,n,a)}},Rm=(e,t)=>{const{minSum:n,maxSum:a}=Dr(["minSum","maxSum"],Am(t,e?.currency)),i=e.moneyValue||n;return{moneyValue:Ki(i,n,a)}},Dm=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),Mm=e=>{const t=Bm(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},Am=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},_m=(e,t)=>{const n="rub"!==e?.currency?.key;return c("div",{className:"grid gap-lg",children:[c("div",{className:"flex gap-lg",children:[e.isShowReplenish?vr({title:"Пополнение",...t("isReplenish"),value:e.isReplenish,orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,e.isShowWithdrawn?vr({title:"Снятие",...t("isWithdrawn"),value:e.isWithdrawn,orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null]}),Em(e.isShowReplenish||e.isShowWithdrawn),c("div",{className:"flex gap-lg",children:[e.isShowMonthlyInterestPayment?um({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment,orientation:"vertical"}):null,e.isShowRemoteRegistration?(a={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration,orientation:"vertical"},vr({...a,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]}),Em(e.isShowNewClient),e.isShowNewClient?o(Pa,{text:"Новый вкладчик",...t("isNewClient")}):null]});var a},Em=(e=!1)=>e?o("div",{className:"border-b border-main-divider w-full"}):null,zm={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum"},Fm={text:"₽",key:"rub"},Om=Ot((({className:e,title:t,calcSource:n,buttons:a=[],footnote:r="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[Fm],g=l((e=>t=>e?{...t,...Mm(t),...Rm(t,e),...Pm(t,e),...Dm(t,e)}:t)(h),[h]),[f,{field:x}]=an({moneyValue:hr(d,2e4),monthsValue:pr(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:Fm},{normalize:g}),y=x?.("currency")?.value??Fm,b=x?.("isNewClient")?.value,v=Am(h,y),N=Sm(f,v,s),{rate:w,income:C,finalSum:S,type:k=""}=N,I=l((()=>{Cr({field:x,defParams:mr(v,b),calcParams:N,monthsValue:"minMonths",map:zm})}),[x,h]);i((()=>{!Fr(d)&&v&&I()}),[d,h]);const T=w===mr(v,b)?.rate;return o(lr,{className:e,title:t,...m,children:c("section",{className:u(rr,e),children:[c("div",{className:sr,children:[c("div",{className:"flex gap-m",children:[wr({className:"w-full",title:`Сумма, ${y?.text}`,min:N.minSum,max:N.maxSum,...x("moneyValue"),value:N.moneyValue,postfix:y?.text,step:Vm(y?.key)}),h&&h?.length>1?o(En,{label:"Валюта",options:p,...x("currency")}):null]}),fr({title:"Срок, месяцев",min:N.minMonths,max:N.maxMonths,availableMonths:N.availableMonths,...x("monthsValue"),value:N.monthsValue}),_m({...N,...s},x)]}),rm({rate:w,children:$m(I,T)}),pm({income:C,finalSum:S,buttons:[...a,Lm(n?.buttons,k)],footnotes:[r],postfix:y?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),Vm=(e="")=>Bm(e)?1e3:100,Lm=(e=[],t="")=>{const{type:n,...a}=e.find((e=>e.type===t))??{};return a},$m=(e,t=!1)=>t?null:o(Jl,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),qm=e=>jm({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&jm({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),jm=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],Um={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},Wm=(e,t,n)=>{const{moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r}=e,s=t?.rateRows||[Um],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>qm({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Rr(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Rr(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r})=>e?.find((e=>qm({row:e,userInputParams:t,paramsViewSettings:n})&&Mr(a+r,["minSum","maxSum"],e)&&Mr(l,["minSumOld","maxSumOld"],e)&&Mr(r,["minSumExtra","maxSumExtra"],e)&&Mr(i,["minMonths","maxMonths"],e)))||Um)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r}),{rate:p}=h,g=Sr(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r,monthlyPayment:g,benefit:f}},Hm=Ot((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,paramsViewSettings:l,...r})=>{const[s,{field:d}]=an({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),m=Wm(s,n,l),h=Nr({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")});return o(lr,{className:e,title:t,...r,children:c("section",{className:u(rr,e),children:[c("div",{className:sr,children:[wr({title:"Остаток долга в других банках, ₽ ",step:500,min:m.minSum,max:m.maxSum-m.maxSumExtra,...d("moneyValue"),value:m.moneyValue}),wr({title:"Ежемесячный платёж в других банках, ₽",step:500,min:m.minSumOld,max:m.maxSumOld,...d("oldMonthlyPayment"),value:m.oldMonthlyPayment}),fr({title:"Новый срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),Ym({...m,...l},d),m.isExtraMoney?wr({title:"Дополнительная сумма, ₽ ",step:500,min:m.minSumExtra,max:m.maxSumExtra,...d("moneyExtra"),value:m.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:h})]}),c("div",{className:u(or,"@4xl:w-1/2"),children:[o(dr,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(dr,{title:"Ставка",value:m?.rate,fractionDigits:2,postfix:"%"}),o(dr,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),m.benefit>0?o(dr,{title:"Выгода в месяц",value:m.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:h}),qe(a,{isVertical:!0}),gr(i)]})]})})})),Ym=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(Pa,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(Pa,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(Pa,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),Km=d((e=>{const{onChange:t,min:n,max:a,defaultValue:i="0",fractionDigits:r=0,...s}=e,c=Yi(e,{normalize:(e=i)=>n&&a?String(Ki(Number(Gm(e)),n,a)):Gm(e),format:He(r)}),d=l((e=>t&&t(Gm(e))),[t]);return o(gn,{onChange:d,...s,...c})})),Gm=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Xm=d((e=>o(Km,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(_e,{size:"text-xl",font:"font-light",children:"₽"})})}))),Jm={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},Zm={amount:1500},Qm=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:l,formType:r="private",...s})=>{const[{amount:d},{field:m}]=an(Zm),[h,p]=a(!1);return i((()=>{p(d<=0)}),[d]),c(g,{className:u("flex flex-col items-center",e),defaultPadding:"p-6xl",...s,children:[t?o(N,{className:"pb-lg xl:pb-4xl self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-[468px]",method:"POST",action:Jm[r],children:[o(Xm,{valid:!h,label:n,max:3e5,min:1,...m("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:d}),l?.text?o(Jl,{className:"w-full mt-lg",type:"submit",disabled:h,children:l.text}):null]})]})})),eu=({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(W,{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})]}),tu="relative h-full",nu={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},au=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...a})=>{const{blocks:i}=a.block||{},l=i?.some(ru),r=n?{defaultPadding:"p-6xl pb-m"}:{};return R({...a,renderProps:(n,a,i)=>c("div",{className:iu(n,{someCardsHighlighted:l}),children:[T(n,a,{className:lu(n,{someCardsHighlighted:l,showBorder:!e,cardSize:t}),...r,blockIndex:i}),ru(n)?eu({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},iu=(e,{someCardsHighlighted:t})=>u(tu,t&&(ru(e)?"pt-3xl":"pt-3xl sm:pt-16")),lu=(e,{someCardsHighlighted:t,showBorder:n,cardSize:a="normal"})=>u(tu,"min-w-80",nu[a],t&&(ru(e)?"pt-3xl sm:pt-16":"pt-3xl"),Xc(n),n&&"h-full"),ru=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,su=Ot((({className:e,visibleItemCount:t=1,noCardBorder:n,arrowsPadded:a=!0,isGap:i=!0,cardSize:l="normal",isNavButtons:r=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(wd,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:i?16:0,padding:0,arrowsPadded:a,navButtons:r?ou(s?.block?.blocks):[],hasBlur:!0,children:au({noCardBorder:n,cardSize:l,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),ou=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],cu="z-10 border border-solid w-full h-full",du=u(cu,"absolute hidden @xl:block border-transparent"),mu=d((({className:e,title:t,description:n,button:a,...i})=>o(g,{className:u("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...i,children:c("div",{className:"relative h-full",children:[o("div",{className:u(du,"top-9 right-12 bg-green-dark")}),o("div",{className:u(du,"top-6 right-8 bg-green")}),o("div",{className:u(du,"top-3 right-4 bg-green-light")}),c("div",{className:u(cu,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(S,{title:t,description:n,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),qe([a],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),uu={black:"bg-black",white:"bg-white"},hu=d((({className:e="",title:t,description:n,image:a,price:i,button:l,colors:r=[],align:s="text-left",padding:d,...m})=>o(g,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Be,{className:"h-full",padding:d,title:o(S,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:a?.src?o(ne,{className:"flex justify-center align-center mb-xl",image:a}):null,buttons:qe([l],{buttonClassName:"w-full self-end"}),children:[r?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(_e,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(pu)]}):null,i?c(_e,{size:"text-h3",align:"text-left",children:[i," ₽"]}):null]})}))),pu=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${uu[e]}`},String(t)),gu=d((({icon:e,...t})=>{const n=pe(),{text:a,href:i,target:l,onClick:r}=n(t);return a?o("div",{className:u("p-3 rounded-lg bg-white text-secondary-text flex justify-center"),children:o("a",{role:"link",href:i,target:l,onClick:r,children:c("div",{className:"flex flex-col items-center gap-3 break-words max-w-[150px]",children:[e?o(ne,{className:"w-7 h-7 md:w-12 md:h-12",image:{...e,iconVersion:e?.iconVersion},alt:a}):null,o("div",{className:"font-light md:font-normal text-primary-text text-center text-xs md:text-sm whitespace-wrap",children:a})]})})}):null})),fu=d((({className:e,additionalDescription:t,description:n,links:a,title:i,...l})=>o(g,{defaultPadding:"p-5xl",className:u("overflow-hidden",e),...l,children:c("div",{className:"flex flex-col lg:flex-row gap-5 justify-between",children:[c("div",{className:"flex-1",children:[o(S,{isEmbedded:!0,title:i,description:n,as:"h1",align:"text-left",headlineVersion:"XL"}),o(S,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),a?.length?xu(a):null]})}))),xu=e=>o("div",{className:u("lg:grid-cols-9 lg:[&>*]:col-span-2 lg:[&>*:nth-child(14n+2)]:col-span-3 lg:[&>*:nth-child(7n+5)]:col-span-3","lg:[&>*:nth-child(7n+6)]:col-span-3 lg:[&>*:nth-child(7n+7)]:col-span-3 lg:[&>*:nth-child(14n+10)]:col-span-3 lg:w-3/6","grid-cols-3 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+3)]:col-span-2 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+4)]:col-span-2","grid gap-3 lg:gap-5"),children:e.map(((e,t)=>o(gu,{...e},String(t))))}),yu=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"mindboxEvent"===e?{...n,eventJson:t}:n}))),bu=d((({className:e="",href:t,target:n,onClick:a,data:i,children:l})=>{const r=pe()({href:t,target:n,onClick:a});return o(t?"a":"div",{className:u("block",e),...t?r:{},role:t?"link":"none",...fe(i),children:l})})),vu=[{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"}}],Nu=d((({className:e="",media:t,showButtonText:n,stretched:i,version:l="white",children:r})=>{if(!t?.length)return null;const[s,d]=a(),m=t?.map((e=>{const{href:t,icon:a,text:i}=e,{iconMapped:r}=(e=>vu.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=$e(a)?a:r,c=n?{text:i}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&i&&d(!0),{...e,...c,icon:{...o,iconVersion:m},version:e?.version??l}})),h=u("border border-solid hover:border-transparent border-main-divider","group-data-primary:border-main-divider group-data-gray:border-green group/media",{"basis-auto":!n&&!s},wu(i));return c("div",{className:u("flex flex-col gap-m xl:gap-xs",e),"aria-label":"Социальные сети",children:[o("div",{className:"flex gap-xs",children:qe(m,{className:Cu(s??!1,i??!1,n),buttonClassName:h})}),r?o(_e,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),wu=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",Cu=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),Su=d((({className:e,padding:t,description:n,additionalDescription:a,href:i,icon:l,isDotted:r,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:x=!0,isImageAlwaysOnRight:y=true,isImageSecondary:b=!1}={},data:v,...N})=>o(g,{className:u("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...N,children:o(bu,{href:i,target:m,className:"h-full",data:yu(v),children:c(Be,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(S,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...Qe($e(l)?o(ne,{image:l}):null,x),buttons:d.length?o(Nu,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:y,isImageSecondary:b,imageAlign:"center",children:[o(Le,{benefits:f}),s?o(Me,{__html:s,isDotted:r,itemSize:"list-s"}):null,ku(a,p)]})})}))),ku=(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,Iu=(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(_e,{size:"text-m",color:"text-secondary-text",children:n})}):null,a?o("div",{className:"mt-2xs",children:o(_e,{size:"text-xl",color:"text-primary-text",children:a})}):null,i?.length?o("div",{className:"text-primary-main",children:qe(i)}):null]},String(t))},Tu=d((({className:e="",title:t,align:n="text-center",icon:l,button:r,visibleCellsCount:s=1,cardCells:d=[],options:m,data:h,...p})=>{const f=d.map(Iu),[x,y]=s>0?[f.slice(0,s),f.slice(s)]:[f,[]],[b,v]=a(!1);return i((()=>ue.subscribe("fold",(e=>{e&&void 0!==m?.parent&&e.parent===m?.parent&&v(e.isUnfolded)}))),[m?.parent]),c(g,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...p,children:[$e(l)?o("div",{className:"self-center",children:o(ne,{image:l})}):null,t?o(N,{className:u("pt-xs",n),headingType:"h5",title:t}):null,r?.text?o(Ne,{className:"w-full mt-m mb-lg",...r}):null,y.length?o(li,{renderFoldableSection:()=>c("div",{children:[x,o(ri,{isUnfolded:b,children:y})]}),renderFoldButton:d.length>=s?Bu(m?.parent,h,b):null}):o("div",{children:x})]})})),Bu=(e,t,n=!1)=>()=>c("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:()=>{void 0!==e&&ue.fire("fold",{type:"fold",isUnfolded:!n,parent:e})},type:"button",...n?fe(t):{},children:[o("div",{children:n?"Скрыть":"Подробнее о тарифе"}),o(W,{className:"text-primary-text",name:n?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),Pu=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?Ru(n):null,t?.length?Ru(t):null]}))),Ru=e=>o("div",{className:"flex gap-5xl grow basis-0",children:e.map(((e,t)=>Du({column:e,i:t})))}),Du=({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:qe([a])})]},String(i))))},`col-${String(t)}`):null,Mu=()=>{const e=globalThis.sessionStorage?.getItem("refreshToken"),t=globalThis.sessionStorage?.getItem("accessToken"),n=globalThis.localStorage.getItem("taskId"),a=Jt();if(!t||!e||!n)return a.assign("/"),()=>{};const i=async()=>{const n=await ni("/auth/refresh","POST",{refresh_token:e,access_token:t});if(401==n?.status&&a.assign("/"),n?.ok){const e=await n.json();globalThis.sessionStorage.setItem("refreshToken",e.refresh_token),globalThis.sessionStorage.setItem("accessToken",e.access_token)}};i();const l=setInterval(i,24e4);return()=>clearInterval(l)},Au=d((({step:e=10,description:t,showPercentage:n=!0})=>c("div",{children:[o("div",{className:"h-4 w-full bg-gray relative",children:o("div",{className:"h-4 bg-green",style:{width:`${e}%`}})}),c("div",{className:"relative",children:[n?c("div",{className:"absolute left-2/4 text-green",children:[e,"%"]}):null,t?o("div",{className:"text-right mr-4 text-gray",children:t}):null]})]}))),_u=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const a=r((()=>(e+1)/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e+1," из ",t,"."]}),n[e]||null,o(Au,{step:a,showPercentage:!1})]})})}));var Eu;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.rework="REVISION"}(Eu||(Eu={}));const zu=e=>ti("/user-data/getTaskStatus","POST",e),Fu=e=>ni("/user-data/sendSignalToProcess","POST",e),Ou=(e,t)=>{const n=s(null),a=l((()=>n.current&&clearInterval(n.current)),[]);return i((()=>(n.current=setInterval((()=>e(a)),t),a)),[e,t]),a},Vu=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black",link: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:o(W,{name:t,width:"24",height:"24",iconVersion:n})}),c("div",{className:"",children:[o(Me,{__html:e}),a?.text?o(Ne,{className:"text-primary-main",children:a.text}):null]})]}))),Lu=d((({interval:e=0,intervalExpireAction:t=(()=>null),title:n,__html:i})=>{const[l,r]=a(e),s=100-(e-l)/e*100;return c("div",{children:[n?o(S,{title:n,headlineVersion:"S"}):null,c("div",{className:"flex justify-center items-center flex-col",children:[c("div",{className:u("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) ${s}%, rgb(125, 126, 127) 0deg)`}}),o("div",{className:"z-10 flex items-center justify-center px-4 py-2 rounded-full w-20 h-20 bg-white text-primary-text text-m",children:o(yc,{interval:e,time:l,setTime:e=>{0===e&&t(),r(e)}})})]}),i?o(Me,{__html:i}):null]})]})})),$u=d((({title:e,description:t,infoCard:n,sectionInfoTitle:a,sectionInfo:i,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,intervalExpireAction:m=(()=>{}),...u})=>c(g,{...u,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"}),d?o(Lu,{interval:d,intervalExpireAction:m}):null]}),o(qu,{title:a,items:i}),o(qu,{title:l,items:r,countColumns:!0}),n?.__html?o(Vu,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(Ne,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),qu=({title:e,items:t,countColumns:n=!1})=>{const a=ke();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(_e,{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",Lo(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:ju(e)},t)))}):null]})]}):null},ju=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(_e,{color:"text-secondary-text",size:"text-l",children:e}),o(_e,{color:"text-primary-text",size:"text-xl",children:t})]}),Uu=d((()=>o($u,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Wu=d((({handleExpireTimer:e})=>{const[t]=Ol("leadForm");return o($u,{interval:300,intervalExpireAction:e,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:t?.cardCategory?.text}]})})),Hu=d((()=>{const[e]=Ol("leadForm");return o($u,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Yu=d((()=>{const[e]=Ol("leadForm");return o($u,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),Ku=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Gu=d((()=>{const[e,t]=a(Eu.process),[n]=Ol("taskId");i((()=>{(async()=>{for(const e of Ku)await Fu({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const a=await zu({taskId:n});a&&a?.statusCd!==Eu.process&&(e(),t(a.statusCd))}),[n]);Ou(r,3e4);return Xu(e,(()=>t(Eu.rework)))})),Xu=(e,t)=>({IN_PROCESS:o(Wu,{handleExpireTimer:t}),CANCELLED:o(Uu,{}),APPROVED:o(Yu,{}),REVISION:o(Hu,{})}[e]||null),Ju=[{paymentSystem:"",currency:"810",codeWord:""},{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0,methodObtain:"office",addressCourier:{fullAddress:"",fiasCode:""}},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:"",addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:"office",deliveryDate:void 0}],Zu=e=>{if(e)try{return new Date(e)}catch(e){return}},Qu=e=>(t,n)=>t.filter((e=>e)).map((t=>[eh(n,e),th(t,e),lh(t,e),nh(t,e),ah(t,e),ih(t,e)].some(Boolean)?{...t,required:!1}:t)),eh=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,th=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,nh=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,ah=({name:e},t)=>"addressFact"===e&&t("addressMatch"),ih=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),lh=({name:e},t)=>"snils"===e&&rh(t),rh=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,sh=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(Vu,{__html:e},`${t}_${n}`))):null},oh=({field:e,inputs:t,params:n})=>t.map(Vo(e,n)),ch=({sections:e,field:t,step:n,params:a})=>e?.map((({inputs:e=[],columns:i,title:l},r)=>{const s=Qu(dh(t))(e,n),o=s.filter((e=>!ih(e,dh(t))));return c("div",{className:u(Lo(i),"grid gap-x-m"),children:[sh(o),$o(l),oh({field:t,inputs:s,params:a})]},`section-${r}`)})),dh=e=>t=>e(t)?.value,mh=d((({step:e,onPrevStep:t})=>{const n=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Jl,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(Jl,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),uh=e=>{const{currency:t,paymentSystem:n,cardCategory:a,codeWord:i}=e;return{currencyCode:t?{key:t}:void 0,paymentSystemTypeCd:n,classCard:a,codeWord:i}},hh=e=>{const{methodObtain:t,deliveryDate:n=""}=e,a="courier"===t;return a?{courierDeliveryFlg:a,deliveryDate:(i=n,i?new Date(i).toISOString().split(".")[0]:""),deliveryTimeCd:{value:"TIME_2"}}:{};var i},ph=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{office:{id:t.key}}:{}},gh=(e,t)=>{switch(e){case 0:default:return{};case 1:return(e=>{const{name:t,surname:n,middleName:a,limitedBirthday:i="",phone:l="",email:r,sex:s,birthPlace:o,dulIssueDateField:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:y}=e;return{birthDate:qt(i,!0),midname:a,name:t,surname:n,birthPlace:o,dulIssueDate:qt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:qt(g,!0),houseTypeCd:f,participantContacts:Fc({phone:jt(l),email:r}),participantAddresses:Oc({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{beginDate:t,employment:n,organizationName:a,inn:i,legalForm:l,organization:r,amountWorkers:s,employerActivities:o,employerOrganization:c,generalSeniority:d,lastJobExperience:m,experience5Years:u,jobsNumber:h,organizationPhone:p,organizationAddress:g,positionOrganization:f}=e;return{employmentContractDate:qt(t||"",!0),employmentTypeCd:n,organizationName:a,organizationInn:i,organizationActivityTypeCd:o,organizationTypeCd:r,organizationKindCd:c,employeesNumberCd:s,opf:l,seniority:d,generalSeniority:u,jobsNumber:h,lastWorkDuration:m,payrollCardRshbFlg:!0,positionCd:f,participantContacts:Fc({organizationPhone:p&&jt(p)}),participantAddresses:Oc({organizationAddress:g})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:a,children:i,wages:l,mandatoryPayments:r,incomeAverage:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u,snils:h,armyIdFlg:p,conscription:g}=e;return{maritalStatusCd:t,childrenDependents:i,totalDependents:a,otherDependents:n,militaryStatusCd:g,participantIncomes:Vc({wages:l,mandatoryPayments:r,incomeAverage:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u}),snils:h?.replaceAll(" ","").replaceAll("-",""),armyIdFlg:p}})(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:Oc({addressCourier:t})}:{}})(t)}},fh=({step:e,inputs:t,onNextStep:n,saveStep:a,finishForm:i})=>{const r=5===e,[s]=Ol("taskId"),[o]=Ol("profileId"),[c]=Ol("participantId"),d=l((async l=>{const d=jo(aa(Qu(yh(l))(t,e)));if(!zn(d(l)))return console.warn("validation fail");a(l);try{if(s&&o&&c){const t=await cc((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:Jt().origin,id:t,...ph(a),authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...gh(i,a)}],...uh(a),...hh(a)}}))({participantId:c,taskId:s,profileId:o,step:e,formData:l}));xh(r,t)}}catch(e){return"Fail"}return n(),r&&i?.(!0),"OK"}),[]);return{handleSubmit:d}},xh=(e,t)=>{e&&t.ok&&globalThis.localStorage.removeItem("leadForm")},yh=e=>t=>e[t],bh=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,isFormFinished:i,finishForm:l})=>{const[r,s]=Ol("leadForm"),d=((e,t)=>({...Ju[e],...t,limitedBirthday:Zu(t?.limitedBirthday),dulIssueDateField:Zu(t?.dulIssueDateField),participantDateRegistration:Zu(t?.participantDateRegistration),beginDate:Zu(t?.beginDate),deliveryDate:Zu(t?.deliveryDate)}))(e,r),m=t?.flatMap((e=>e?.inputs))||[],{handleSubmit:u}=fh({step:e,inputs:m,onNextStep:a,saveStep:s,finishForm:l}),[,{field:h,onSubmit:p}]=an(d,{onSubmit:u});return i?o(Gu,{}):c("form",{onSubmit:p,className:"space-y-m",children:[ch({sections:t,field:h,step:e}),o(mh,{step:e,onPrevStep:n})]})})),vh=[[{title:"Параметры карты",inputs:[]},{inputs:[{fieldType:"common",name:"currency",required:!0},{fieldType:"common",name:"paymentSystem",required:!0},{fieldType:"common",name:"cardCategory",required:!0},{fieldType:"common",name:"codeWord",required:!0}]}],[{title:"Персональные данные",columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"name",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"middleName",dadata:!0,filledByEsia:!0},{fieldType:"common",name:"sex",required:!0},{fieldType:"common",name:"limitedBirthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0,filledByEsia:!0},{fieldType:"common",name:"phone",required:!0,filledByEsia:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{fieldType:"common",name:"dulSerie",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulNumber",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulIssueDateField",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{fieldType:"common",name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"addressMatch"}]},{columns:2,inputs:[{fieldType:"common",name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{fieldType:"common",name:"housing",required:!0}]},{inputs:[{fieldType:"common",name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{fieldType:"info",text:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{fieldType:"common",name:"employment",required:!0},{fieldType:"common",name:"organizationName",required:!0,dadata:!0}]},{columns:2,inputs:[{fieldType:"common",name:"inn",required:!0,dadata:!0},{fieldType:"common",name:"legalForm",required:!0}]},{inputs:[{fieldType:"common",name:"organization",required:!0},{fieldType:"common",name:"amountWorkers",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!0},{fieldType:"common",name:"employerOrganization",required:!0},{fieldType:"common",name:"generalSeniority",required:!0},{fieldType:"common",name:"lastJobExperience",required:!0},{fieldType:"common",name:"experience5Years",required:!0},{fieldType:"common",name:"jobsNumber",required:!0}]},{inputs:[{fieldType:"common",name:"organizationPhone",label:"Телефон работодателя",required:!0},{fieldType:"common",name:"beginDate",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"positionOrganization",required:!0},{fieldType:"common",name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{fieldType:"common",name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{fieldType:"common",name:"familyStatus",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"dependents",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"familyMembers"},{fieldType:"common",name:"children",required:!0}]},{title:"Совокупный доход"},{inputs:[{fieldType:"info",text:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{fieldType:"common",name:"confirmationIncome",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"wages",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"snils",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"conscription",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"disablePeopleFlg"}]},{inputs:[{fieldType:"common",name:"bankruptcyFlg"}]},{inputs:[{fieldType:"common",name:"shareholderFlg"}]},{inputs:[{fieldType:"common",name:"legalEntityName"}]},{inputs:[{fieldType:"common",name:"creditInRshbCd"}]}],[{title:"Способ получения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"methodObtain"}]},{title:"Адрес",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0,condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]},{inputs:[{fieldType:"info",text:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код",condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"bankEmployeeCode",condition:{name:"methodObtain",values:["office"]}}]}]],Nh=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],wh=d((({className:e,...t})=>{const[n,d]=a(0),m=s(null),h=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);i(Mu,[]);const p=l((()=>{d((e=>Math.min(e+1,6))),h()}),[]),f=l((()=>{d((e=>Math.max(e-1,0))),h()}),[]),x=r((()=>vh[n]),[n]),[y,b]=a(!1);return o(g,{className:u("bg-transparent",e),defaultPadding:"p-0",...t,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[y?null:o(_u,{stepsTitles:Nh,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(bh,{step:n,sections:x,onNextStep:p,onPrevStep:f,isFormFinished:y,finishForm:b},String(n))})]})})})),Ch=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const a=r((()=>e/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e," из ",t,"."]}),n[e]||null,o(Au,{step:a,showPercentage:!1})]})})})),Sh=d((({title:e,description:t,infoCard:n,sectionInfoTitle:a,sectionInfo:i,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,intervalExpireAction:m=(()=>{}),...u})=>c(g,{...u,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"}),d?o(Lu,{interval:d,intervalExpireAction:m}):null]}),o(kh,{title:a,items:i}),o(kh,{title:l,items:r,countColumns:!0}),n?.__html?o(Vu,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(Ne,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),kh=({title:e,items:t,countColumns:n=!1})=>{const a=ke();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(_e,{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",Lo(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:Ih(e)},t)))}):null]})]}):null},Ih=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(_e,{color:"text-secondary-text",size:"text-l",children:e}),o(_e,{color:"text-primary-text",size:"text-xl",children:t})]}),Th=d((()=>o(Sh,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Bh=d((({handleExpireTimer:e})=>{const[t]=Ol("leadForm");return o(Sh,{interval:300,intervalExpireAction:e,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?"Аннуитетный":"Дифференцированный"}]})})),Ph=d((()=>{const[e]=Ol("leadForm");return o(Sh,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Rh=d((()=>{const[e]=Ol("leadForm");return o(Sh,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),Dh=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Mh=d((()=>{const[e,t]=a(Eu.process),[n]=Ol("taskId");i((()=>{(async()=>{for(const e of Dh)await Fu({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const a=await zu({taskId:n});a&&a?.statusCd!==Eu.process&&(e(),t(a.statusCd))}),[n]);Ou(r,3e4);return Ah(e,(()=>t(Eu.rework)))})),Ah=(e,t)=>({IN_PROCESS:o(Bh,{handleExpireTimer:t}),CANCELLED:o(Th,{}),APPROVED:o(Rh,{}),REVISION:o(Ph,{})}[e]||null),_h=[{calculator:{moneyValue:0,monthsValue:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1}},{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:"",addressRetail:void 0,bankEmployeeCode:void 0}],Eh=e=>{if(e)try{return new Date(e)}catch(e){return}},zh=e=>(t,n)=>t.filter((e=>e)).map((t=>[Fh(n,e),Oh(t,e),qh(t,e),Vh(t,e),Lh(t,e),$h(t,e)].some(Boolean)?{...t,required:!1}:t)),Fh=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Oh=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Vh=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Lh=({name:e},t)=>"addressFact"===e&&t("addressMatch"),$h=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),qh=({name:e},t)=>"snils"===e&&jh(t),jh=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,Uh=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(Vu,{__html:e},`${t}_${n}`))):null},Wh=({field:e,inputs:t,params:n})=>t.map(Vo(e,n)),Hh=({sections:e,field:t,step:n,params:a})=>e?.map((({inputs:e=[],columns:i,title:l},r)=>{const s=zh(Yh(t))(e,n);return c("div",{className:u(Lo(i),"grid gap-x-m"),children:[Uh(s),$o(l),Wh({field:t,inputs:s,params:a})]},`section-${r}`)})),Yh=e=>t=>e(t)?.value,Kh=d((({step:e,onPrevStep:t})=>{const n=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Jl,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(Jl,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),Gh={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},Xh=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:a}=e?.calculator??{};return{loanAmount:t,creditPeriod:n,paymentTypeCd:Gh[a?"annuity":"differential"]}},Jh=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},Zh=(e,t)=>{switch(e){case 0:return(e=>{const{isInsurance:t,isSalaryClient:n}=e?.calculator??{};return{payrollCardRshbFlg:t,consentInsuranceFlg:n}})(t);case 1:return(e=>{const{name:t,surname:n,middleName:a,limitedBirthday:i="",phone:l="",email:r,sex:s,birthPlace:o,dulIssueDateField:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:y}=e;return{birthDate:qt(i,!0),midname:a,name:t,surname:n,birthPlace:o,dulIssueDate:qt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:qt(g,!0),houseTypeCd:f,participantContacts:Fc({phone:jt(l),email:r}),participantAddresses:Oc({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{beginDate:t,employment:n,organizationName:a,inn:i,legalForm:l,organization:r,amountWorkers:s,employerActivities:o,employerOrganization:c,generalSeniority:d,lastJobExperience:m,experience5Years:u,jobsNumber:h,organizationPhone:p,organizationAddress:g,positionOrganization:f}=e;return{employmentContractDate:qt(t||"",!0),employmentTypeCd:n,organizationName:a,organizationInn:i,organizationActivityTypeCd:o,organizationTypeCd:r,organizationKindCd:c,employeesNumberCd:s,opf:l,seniority:d,generalSeniority:u,jobsNumber:h,lastWorkDuration:m,positionCd:f,participantContacts:Fc({organizationPhone:p&&jt(p)}),participantAddresses:Oc({organizationAddress:g})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:a,children:i,confirmationIncome:l,wages:r,mandatoryPayments:s,incomeAverage:o,additionalIncome:c,otherIncome:d,otherPayments:m,rentalIncome:u,retirementIncome:h,snils:p,armyIdFlg:g,conscription:f}=e;return{maritalStatusCd:t,totalDependents:a,incomeCertificateCd:l,otherDependents:n,childrenDependents:i,militaryStatusCd:f,participantIncomes:Vc({wages:r,mandatoryPayments:s,incomeAverage:o,additionalIncome:c,otherIncome:d,otherPayments:m,rentalIncome:u,retirementIncome:h}),snils:p?.replaceAll(" ","").replaceAll("-",""),armyIdFlg:g}})(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);default:return{}}},Qh=({step:e,inputs:t,onNextStep:n,saveStep:a,finishForm:i})=>{const r=5===e,[s]=Ol("taskId"),[o]=Ol("profileId"),[c]=Ol("participantId"),d=l((async l=>{const d=jo(aa(zh(tp(l))(t,e)));if(!zn(d(l)))return console.warn("validation fail");a(l);try{if(s&&o&&c){const t=await cc((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:Jt().origin,id:t,authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Zh(i,a)}],...Xh(a),...Jh(a),esiaAccountTypeCd:{key:a?.esiaAccountTypeCd?.key}}}))({participantId:c,taskId:s,profileId:o,step:e,formData:l}));ep(r,t)}}catch(e){return"Fail"}return n(),r&&i?.(!0),"OK"}),[]);return{handleSubmit:d}},ep=(e,t)=>{e&&t.ok&&globalThis.localStorage.removeItem("leadForm")},tp=e=>t=>e[t],np=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,isFormFinished:i,finishForm:l,programsSource:r})=>{const[s,d]=Ol("leadForm"),[m]=Ol("programId"),u=r?.[m??""],h=((e,t)=>({..._h[e],...t,limitedBirthday:Eh(t?.limitedBirthday),dulIssueDateField:Eh(t?.dulIssueDateField),participantDateRegistration:Eh(t?.participantDateRegistration),beginDate:Eh(t?.beginDate),deliveryDate:Eh(t?.deliveryDate)}))(e,s),p=t?.flatMap((e=>e?.inputs))||[],{handleSubmit:g}=Qh({step:e,inputs:p,onNextStep:a,saveStep:d,finishForm:l}),[,{field:f,onSubmit:x}]=an(h,{onSubmit:g});return i?o(Mh,{}):c("form",{onSubmit:x,className:"space-y-m",children:[Hh({sections:t,field:f,step:e,params:{calcData:u}}),o(Kh,{step:e,onPrevStep:n})]})})),ap=[[{columns:1,inputs:[{fieldType:"common",name:"calculator"}]}],[{title:"Персональные данные",columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"name",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"middleName",dadata:!0,filledByEsia:!0},{fieldType:"common",name:"sex",required:!0},{fieldType:"common",name:"limitedBirthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0,filledByEsia:!0},{fieldType:"common",name:"phone",required:!0,filledByEsia:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{fieldType:"common",name:"dulSerie",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulNumber",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulIssueDateField",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{fieldType:"common",name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"addressMatch"}]},{columns:2,inputs:[{fieldType:"common",name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{fieldType:"common",name:"housing",required:!0}]},{inputs:[{fieldType:"common",name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{fieldType:"info",text:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{fieldType:"common",name:"employment",required:!0},{fieldType:"common",name:"organizationName",required:!0,dadata:!0}]},{columns:2,inputs:[{fieldType:"common",name:"inn",required:!0,dadata:!0},{fieldType:"common",name:"legalForm",required:!0}]},{inputs:[{fieldType:"common",name:"organization",required:!0},{fieldType:"common",name:"amountWorkers",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!0},{fieldType:"common",name:"employerOrganization",required:!0},{fieldType:"common",name:"generalSeniority",required:!0},{fieldType:"common",name:"lastJobExperience",required:!0},{fieldType:"common",name:"experience5Years",required:!0},{fieldType:"common",name:"jobsNumber",required:!0}]},{inputs:[{fieldType:"common",name:"organizationPhone",label:"Телефон работодателя",required:!0},{fieldType:"common",name:"beginDate",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"positionOrganization",required:!0},{fieldType:"common",name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{fieldType:"common",name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{fieldType:"common",name:"familyStatus",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"dependents",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"familyMembers"},{fieldType:"common",name:"children",required:!0}]},{title:"Совокупный доход"},{inputs:[{fieldType:"info",text:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{fieldType:"common",name:"confirmationIncome",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"wages",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"snils",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"conscription",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"disablePeopleFlg"}]},{inputs:[{fieldType:"common",name:"bankruptcyFlg"}]},{inputs:[{fieldType:"common",name:"shareholderFlg"}]},{inputs:[{fieldType:"common",name:"legalEntityName"}]},{inputs:[{fieldType:"common",name:"creditInRshbCd"}]}],[{title:"Отделение Банка",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0}]},{inputs:[{fieldType:"common",name:"addressRetail",required:!0}]},{title:"Код представителя Банка",columns:1,inputs:[]},{inputs:[{fieldType:"info",text:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{inputs:[{fieldType:"common",name:"bankEmployeeCode"}]}]],ip=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Отделение Банка"],lp=Ot((({className:e,programsSource:t,...n})=>{const[d,m]=a(0),h=s(null),p=l((()=>h?.current?.scrollIntoView({behavior:"smooth"})),[h]);i(Mu,[]);const f=l((()=>{m((e=>Math.min(e+1,5))),p()}),[]),x=l((()=>{m((e=>Math.max(e-1,0))),p()}),[]),y=r((()=>ap[d]),[d]),b=0===d,[v,N]=a(!1);return o(g,{className:u("bg-transparent",e),defaultPadding:"p-0",...n,children:c("div",{ref:h,className:"container grid grid-cols-12",children:[b||v?null:o(Ch,{stepsTitles:ip,step:d,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(np,{step:d,sections:y,onNextStep:f,onPrevStep:x,isFormFinished:v,finishForm:N,programsSource:t},String(d))})]})})})),rp=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,sp=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),op=1e9,cp={sum:{min:1e4,max:op},period:3},dp=Ot((({className:e,filtrationSchema:t={},resetButton:n,sumInput:a,periodInput:i,...l})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=qd(cp,{block:l.block,page:l.options?.page,normalize:e=>({...e,period:mp(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=up(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...l,children:[o(Ed,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(Xm,{label:a?.title,min:500,max:op,...d("sum",{parse:e=>({min:Number(e),max:op}),format:({min:e})=>String(e)})}),o(Qi,{title:i?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(Dd,{blocksToRender:r,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),mp=e=>Mt((e?.paramsSource?.rateRows||[]).filter(rp).flatMap((e=>sp(e.minMonths,e.maxMonths)))),up=e=>Mt(e.flatMap((e=>e||[])).filter(rp).flatMap((e=>sp(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],hp=[{key:"10"},{key:"50"},{key:"100"}],pp=({itemCount:e,onItemCountChange:t})=>{const n=l((({key:e})=>t(Number(e))),[]);return c("div",{className:"mt-2 @lg:mt-0 items-center gap-s hidden @lg:flex",children:[o("span",{children:"Показать по"}),o(Dn,{className:"min-w-20",onChange:n,value:{key:String(e)},options:hp,iconVersion:"black"})]})},gp="py-m @lg:px-lg px-m rounded-md cursor-pointer text-center min-w-10 @lg:min-w-0 hover:bg-primary-hover hover:text-white",fp=(e,t)=>{const{currentPage:n,onPageChange:a,totalPages:i}=e,l=t+1;return l===n?o("div",{"aria-current":"true",className:"py-m @lg:px-lg px-m bg-primary-main text-center min-w-10 @lg:min-w-0 text-white rounded-md",children:l},String(t)):1!==l&&l!==i&&((e,t,n)=>e<t&&e>=t-1||e<=t+1&&e>t||((e,t,n)=>t<=2&&e<=t+2||t>=n-1&&e>=n-3)(e,t,n))(l,n,i)?o("div",{onClick:()=>a(l),className:gp,"aria-label":`Страница ${l}`,children:l},String(t)):null},xp={width:"24",height:"24"},yp=({currentPage:e,onPageChange:t,totalPages:n})=>{const a=r((()=>Array.from({length:n}).fill({currentPage:e,onPageChange:t,totalPages:n})),[n,e]),i=l((()=>{e>1&&t(e-1)}),[e]),s=l((()=>{e<n&&t(e+1)}),[e,n]),d=l((()=>t(1)),[]),m=l((()=>t(n)),[n]);return c("div",{className:"flex gap-m items-center",children:[o("div",{onClick:i,children:o(W,{name:"ArrowLeftIcon",iconVersion:"black",imageClassName:bp(1===e),...xp})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:gp,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,a.map(fp),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:gp,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(W,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:bp(e===n),...xp})})]})},bp=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",vp=({currentPage:e,onPageChange:t,totalPages:n,itemCount:a,onItemCountChange:i})=>c("div",{className:"mt-3xl flex justify-between flex-col @lg:flex-row items-center select-none",role:"navigation","aria-label":"Пагинация",children:[o(yp,{currentPage:e,onPageChange:t,totalPages:n}),a&&i?o(pp,{itemCount:a,onItemCountChange:i}):null]}),Np=d((({className:e,value:t,autoFocus:n,onChange:a,onFocus:i,placeholder:r="Поиск по сайту"})=>{const s=l((e=>{a&&a(e.target?.value||"")}),[a]);return c("div",{className:u("relative",e),role:"form",children:[o("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:o(ne,{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",hn),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:n,onChange:s,onFocus:i})]})})),wp=d((({field:e,onClearFilter:t,filtrationState:n})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(Np,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(Al,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(Al,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период до",minDate:n.startDate,...e("endDate")}),o("div",{className:"col-span-12 @lg:col-span-2 mt-8 @lg:mt-auto",children:o(Jl,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),Cp=d((({title:e,timestamp:t,publicId:n})=>{const a=pe(),{href:i}=a({href:`${Ut}/depository/${n}/file`});return c("div",{className:"flex gap-3 items-center py-lg border-gray border-opacity-50 border-b",children:[null,c("div",{className:"flex flex-col gap-x-6xl lg:flex-row lg:items-center",children:[t?o(_e,{size:"text-m","font-weight":"font-light",children:qt(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:i,download:!0,"aria-label":"Скачать",children:e})]})]},n)})),Sp=`${Ut}/depository`,kp={startDate:void 0,endDate:void 0,query:""},Ip=Ot((({className:e,...t})=>{const[n,i]=a(0),[r,s]=a(10),[d,{field:m,reset:h}]=an(kp),{totalPages:p=0,items:f=[]}=(({size:e,page:t,query:n,startDate:a,endDate:i})=>{const l=a?qt(a,!0):"",r=i?qt(i,!0):"",s=new URLSearchParams(Sp);s.set("page",String(t)),s.set("size",String(e)),s.set("query",n),s.set("timestampStart",l),s.set("timestampEnd",r);const o=`?${s.toString()}`,{data:c}=ga(Sp+o,Dt);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:n,...d}),x=l((e=>i(e-1)),[]),y=l((e=>{r!==e?(s(e),i(0)):s(e)}),[]);return c(g,{className:u(e,"container p-6xl"),...t,children:[o(wp,{filtrationState:d,field:m,onClearFilter:h}),c("div",{className:"flex flex-col",children:[c("div",{className:"grid grid-cols-12 pb-lg border-gray border-opacity-50 border-b",children:[o("div",{className:"col-span-4 @lg:col-span-2 hidden @lg:block",children:o(_e,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(_e,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),f.length?f.map((e=>o(Cp,{...e},String(e.publicId)))):o(Gc,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(vp,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:y})]})]})})),Tp=e=>"Image"===e?.contentType&&e?.image?o(ne,{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,Bp=d((({className:e="",title:t,description:n,error:a,button:i,...l})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...l,children:[o("div",{className:"flex justify-center",children:Tp(a)}),o(S,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),i?.text?o(Ne,{version:i?.version,text:i?.text,...i}):null]})));function Pp(e,t){for(const[n,a]of e.entries())null!=a?t.setItem(n,a):t.removeItem(n)}const Rp={};function Dp(e,t=Rp){const n=s(null),o=function(){const[,e]=a(0);return l((()=>e((e=>(e+1)%65536))),[])}();return i((()=>e.bus.watch((e=>{n.current?.has(String(e.type))&&o()}))),[e,o]),r((()=>new Proxy(t,{get:(t,a)=>(n.current||=new Set,n.current.add(a),e.getItem(a)),has:(t,a)=>(n.current||=new Set,n.current.add(a),e.hasItem(a)),set:(t,n,a)=>(e.setItem(n,a),!0),deleteProperty:(t,n)=>(e.removeItem(n),!0)})),[e])}const Mp=new class{bus;store=new Map;get size(){return this.store.size}constructor(e=new me){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)}};var Ap,_p;function Ep(e){return Dp(Mp,e)}Ap=Mp,_p=new class{storage;bus;get size(){return this.storage?.length??0}constructor(e,t=new me){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)}}(globalThis?.localStorage),Pp(Ap,_p),Pp(_p,Ap),Ap.bus.watch((({type:e,event:t})=>{null!=t?_p.setItem(e,t):_p.removeItem(e)}));const zp=`${Ut}/region`;function Fp(e="Москва"){return Ep().location??{name:e}}function Op(e="Москва"){const t=Ep(),n=l((async()=>{if(!t.location){const n=await Rt(zp);t.location=n??{name:e}}}),[t,e]);return ga(zp,n),t}var Vp;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(Vp||(Vp={}));const Lp=new Intl.NumberFormat("ru",{style:"currency",currency:Vp.RUB}),$p=e=>e?Lp.format(e):"",qp="text-m font-light text-secondary-text ",jp=`${qp} text-left`,Up=`${qp} pl-5xl text-center`,Wp=`${qp} pl-5xl text-right`,Hp={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},Yp=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:jp,children:o(_e,{size:"text-m",children:"Валюта"})}),o("th",{className:Up,children:o(_e,{size:"text-m",children:"Купить"})}),o("th",{className:Wp,children:o(_e,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(Kp)})]}))),Kp=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(ne,{image:{icon:Hp[t]},width:"24",height:"24"}):null,o(_e,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(_e,{size:"text-h6",children:$p(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(_e,{size:"text-h6",children:$p(e?.buyExchangeRate)})})]},t)},Gp={icon:"GpsIcon"},Xp=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(Gd,{...Gp,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:"Курс указан для заданного офиса"})]})]}))),Jp=(e,t,n)=>{const a=Number(Zp(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)},Zp=e=>e.replace(/[^\d.,]/g,"").replace(",",".");function Qp(e){if(!e)throw new Error("Value should be fulfilled");return e}const eg=e=>t=>{const[,n]=Qp(e.find((([e])=>e(t))));return n(t)},tg=e=>eg(e.map((([e,t])=>[e,()=>t])));tg.if=e=>new ng(void 0,e);class ng{parent;predicate;unit;get entry(){return[Qp(this.predicate),Qp(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new ng(this,e)}then(e){return new ng(this.parent,this.predicate,e)}else(e){return eg([...ag(this),[()=>!0,e]])}}const ag=e=>[...e?.parent?ag(e.parent):[],e.entry],ig=e=>tg([[e=>e.value!==Vp.RUB&&e.oppositeValue!==Vp.RUB,()=>e.handleConvert(e.value,Vp.RUB)],[e=>e.value===Vp.RUB&&e.oppositeValue===Vp.RUB,()=>e.handleConvert(e.value,Vp.USD)],[e=>e.value===Vp.RUB&&e.oppositeValue===Vp.RUB,()=>e.handleConvert(e.value,Vp.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function lg(e){const{placeholder:t,rates:n,selected:a,value:i,setValue:l,setSelected:r}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:a,text:a};return c("div",{className:"relative flex",children:[o(gn,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:i,onChange:l}),s.length?o(Dn,{className:"absolute right-0",isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const rg=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:i})=>{const[r,s]=a({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||Vp.RUB,selectBuy:n?.[0]?.currency?.currency||Vp.USD}),d=l((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[t&&n?c("div",{className:"grid gap-m",children:[lg({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:sg(r,d,n),value:r.inputSell,setValue:e=>cg(d,n)(e,r.selectSell,r.selectBuy)}),lg({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:og(r,d,t),value:r.inputBuy,setValue:e=>dg(d,t)(e,r.selectBuy,r.selectSell)})]}):null,i?.text?o(Ne,{text:i.text,version:i?.version,...i}):null]})})),sg=(e,t,n)=>a=>{t({selectSell:a}),ig({value:a,oppositeValue:e.selectBuy,handleConvert:(a=e.selectSell,i=e.selectBuy)=>{cg(t,n)(e.inputSell,a,i)}})},og=(e,t,n)=>a=>{t({selectBuy:a}),ig({value:a,oppositeValue:e.selectSell,handleConvert:(a=e.selectBuy,i=e.selectSell)=>dg(t,n)(e.inputBuy,a,i)})},cg=(e,t)=>(n,a,i)=>{e({inputSell:Zp(n),selectBuy:i});const l=t.find((e=>e.currency?.currency===i))?.buyExchangeRate||t.find((e=>e.currency?.currency===a))?.buyExchangeRate;l&&e({inputBuy:String(Jp(n,l,a===Vp.RUB)||"")})},dg=(e,t)=>(n,a,i)=>{e({inputBuy:Zp(n),selectSell:i});const l=t.find((e=>e.currency?.currency===i))?.saleExchangeRate||t.find((e=>e.currency?.currency===a))?.saleExchangeRate;l&&e({inputSell:String(Jp(n,l,a===Vp.RUB)||"")})},mg=`${Ut}/exchangerates`;const ug=d((({className:e="",title:t="Курсы обмена валют",button:n,...a})=>{const i=function(e){const t=e?.code||"000",{data:n}=ga(mg+`?regionCode=${t}`,Dt);return n||{}}(Fp()),l=hg(i?.exchangeRate?.currencies),r=l.filter((e=>e.buyExchangeRate));r.unshift({currency:{currency:Vp.RUB}});const s=l.filter((e=>e.saleExchangeRate));return s.push({currency:{currency:Vp.RUB}}),o(g,{className:u("box-border min-h-80",e),...a,children:o(Be,{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(Yp,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(Xp,{address:i?.address})]}),o(rg,{className:"grow w-1/2",currencyRatesBuy:r,currencyRatesSell:s,button:n})]})})})})),hg=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],pg=d((({className:e="",items:t})=>{const n=pe();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(gg(n))})})),gg=e=>({dataFooter:t,...n},a)=>{const{text:i,href:l,target:r,onClick:s}=e(n);return i?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:l,target:r||"_self",onClick:s,...fe(t),children:i||null})},String(a)):null},fg=e=>t=>!t.displayArea||e.includes(t.displayArea.toLowerCase()),xg=["all","footer"],yg=d((({className:e,navigationItems:t})=>{const n=pe();return o("div",{role:"menu",className:u("w-full flex items-start justify-between flex-col md:flex-row gap-y-m lg:order-2",e),children:t?.filter(fg(xg)).map(n).map(bg)})})),bg=(e,t)=>{const{text:n,items:a=[],href:i,target:l="_self",onClick:r,dataFooter:s}=e,d=a.filter(fg(xg));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:l,onClick:r,...fe(s),children:n}),d?o(pg,{items:d}):null]},String(t))},vg=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(Ng)}):null)),Ng=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(_e,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(wg)})]},String(t)),wg=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Cg(e.type,e.text)}),o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Cg=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Sg(t)}`,children:o(_e,{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})}},Sg=e=>e.replaceAll(/\D/g,""),kg=d((({className:e="",index:t,text:n,...a})=>{const i=pe(),{href:l,target:r,onClick:s}=i(a);return o("a",{className:u("text-secondary-text",e),href:l,target:r,onClick:s,children:n||`Документ ${t}`})})),Ig=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(_e,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(kg,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),Tg="w-full lg:w-52";function Bg(e,t,n=300){i((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}const Pg=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:a,s2Matches:i}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),a=Array.from({length:e.length}),i=Array.from({length:t.length});let l=0;for(let r=0;r<e.length;r++){const s=Math.max(0,r-n),o=Math.min(r+n,t.length-1);for(let n=s;n<=o;n++)a[r]||i[n]||e[r]!==t[n]||(l++,a[r]=!0,i[n]=!0)}return{m:l,s1Matches:a,s2Matches:i}}(e,t);if(0===n)return 0;const l=function(e,t,{s1Matches:n,s2Matches:a}){let i=0;for(let l=0,r=0;l<e.length;l++){if(!n[l])continue;let s=r;for(;s<t.length;s++)if(a[s]){r=s+1;break}e[l]!==t[s]&&i++}return i}(e,t,{s1Matches:a,s2Matches:i}),r=(n/e.length+n/t.length+(n-l/2)/n)/3,s=r>.7?.1*function(e,t){let n=0;for(;e[n]===t[n]&&n<4;)n++;return n}(e,t):0;return r+s*(1-r)};const Rg=(e,t)=>(n,a)=>{for(const[i,l]of a)n.set(i,e(n.get(i)||t,l));return n},Dg=(e=[])=>e.reduce(((e,t)=>e+t),0),Mg=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),Ag=e=>t=>e.map((([e,n])=>[Pg(t)(e),n])).filter((([e])=>e>=.8)).map((([e,t])=>Eg(t,e))).reduce(Rg(Math.max,0),new Map),_g=e=>t=>{return Od(t,t.map((({title:e})=>e)).map((e=>t=>{const n=Mg(t||"");return n.length?Dg(e.map((e=>Tr(n.map(Pg(e)))))):0})(e))).sort((e=>(t,n)=>-e(t,n))((n=([,e])=>e,(e,t)=>n(e)-n(t)))).map((([e])=>e));var n},Eg=(e,t)=>new Map(e.map((e=>[e,t]))),zg=({basePathList:e,initialQuery:t=""})=>{const[n,l]=a(t||"");i((()=>{null!=t&&l(t)}),[t]);const{data:r}=ga(e?.length?e:null,Fg),[s,o]=a(null);return Bg((()=>{r&&o(r.map((e=>t=>{const{corpus:n,dictionary:a}=t||{};if(!(e&&n?.length&&a&&Object.keys(a).length))return[];const i=Mg(e);if(!i.length)return[];const l=Object.entries(a),r=[...i.map(Ag(l)).reduce(Rg(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*i.length)).map((([e])=>n[e]));return _g(i)(r)})(n)))}),[r,n]),[s,{value:n,onChange:l}]},Fg=async(...e)=>(await Promise.allSettled(e.map((e=>Rt(O(e,"/","search.index.json")))))).map((e=>"fulfilled"===e.status?e.value:{})),Og=d((({initialQuery:e,navigationItems:t,onClose:n})=>{const a=r((()=>t?.map((e=>e.href||"/"))),[t]),[i,l]=zg({basePathList:a,initialQuery:e}),s=r((()=>Vg(t)(i)),[t,i]);return o(Ql,{head:o(Np,{autoFocus:!0,...l}),onClose:n,children:o(yg,{navigationItems:s})})})),Vg=e=>t=>e?.length&&t?.length?Od(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:O("/",t)})))}))):[],Lg=d((({className:e,search:t,...n})=>{const[i,r]=a(""),s=l((()=>r("")),[]),d=sn(Og,n),m=l((e=>{r(e),$g(e)&&d.open({initialQuery:e,onClose:s})}),[s,d]);return c("div",{className:u("relative",e),role:"search",children:[o(Np,{value:i,placeholder:t?.placeholder,onChange:m}),o(Zl,{className:"absolute top-0 right-0 sm:hidden",onClose:s})]})})),$g=e=>e&&e.length>=3,qg=(e,t)=>{const{logo:n}=e??{},{dataHeader:a,dataFooter:i,...l}=n??{};return c("div",{className:"flex items-stretch gap-3xl",children:[o(fc,{className:Tg,logo:l,data:i,showTitle:!1}),o(Lg,{className:"grow",navigationItems:t,...e})]})},jg=d((({className:e="",index:t,...n})=>{const a=pe(),{href:i,target:l,text:r,onClick:s}=a(n);return o("a",{className:u("text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px]",e),href:i,target:l,onClick:s,children:r||`Документ ${t}`})})),Ug=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(_e,{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(jg,{index:t,...e},String(t))))}):null]}))),Wg=Ot((({className:e,footer:t,...n})=>{const{navigationItems:a}=n.options?.page?.navigation??{},i=n.options?.page?.common??{},{documents:l,relatedEnterprises:r,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:[qg(i,a),c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(yg,{navigationItems:a}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u(Tg,"flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(vg,{items:s}),h?o(Ne,{className:"w-full",version:"primary",...h}):null,d.map(((e,t)=>o(Nu,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),f.map(((e,t)=>o(Ne,{className:"!text-left text-s font-light",version:"link",...e,children:e?.text},String(t))))]})]}),o(Ig,{title:m,links:r}),o(Ug,{links:l,license:p})]})})),Hg=d((({className:e="",title:t,description:n,calendar:a,...i})=>c(g,{className:u("space-y-m",e),defaultPadding:"p-6xl",...i,children:[o(S,{title:t,description:n,headlineVersion:"M",isEmbedded:!0}),a?Yg(a):null]}))),Yg=e=>{const t=100/(e.reduce(((e,t)=>t?.month?.length?e+t.month.length:e),0)||1),n=e.filter((e=>e?.month?.length)).map((e=>({...e,flexBasis:`${e?.month?.length?e.month.length*t:""}%`})));return c("div",{className:"w-full flex flex-col justify-center gap-s",children:[o("div",{className:"flex w-full text-h6 text-center",children:n.map((e=>Kg(e,t)))}),o("div",{className:"flex gap-s w-full",children:n.map(((e,t)=>c("div",{className:"border-r border-main-divider last:border-r-0 space-y-s",style:{flexBasis:e.flexBasis},children:[o("div",{className:"flex gap-s",children:Gg(e)}),c("div",{className:"text-s",children:[o(_e,{size:"text-s",font:"font-light",color:"text-primary-text",children:e.text})," ",o(_e,{size:"text-s",font:"font-light",color:"text-primary-main",children:e.greenText})]})]},`monthItem-${t}`)))})]})},Kg=(e,t)=>e.month?.map(((e,n)=>o("div",{style:{flexBasis:`${t}%`},children:e.text},`monthName-${n}`))),Gg=e=>e.month?.map((e=>e.image?.src?o("div",{className:"h-52 border-r pr-s border-main-divider last:border-r-0",children:o(ne,{image:e.image,className:"flex"})},`monthImage-${e.image.src}`):null)),Xg=Ot((({className:e,title:t,button:n,regionSource:i,data:l,...r})=>{const[s,d]=a({key:""}),m=i?.regions??[],h=oe({className:"text-white",version:n?.version||"primary"}),p=m?.find((e=>e.name===s.key))?.href,f=n?.text?n.text:"Перейти";return o(g,{className:e,defaultPadding:"p-6xl",...r,children:c("div",{className:"container max-w-[978px] space-y-m",children:[t?o(N,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(En,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,p?o("div",{className:"text-center",children:o(Ne,{href:p,target:"_blank",className:u("p-m w-full @xl:w-auto",h),data:yu(l,s?.key),children:f})}):null]})})}));function Jg(e=[]){const t=D(),n=Array.from(e.entries()).filter((([,e])=>Zg(t)(e)));return n.find((([,e])=>Zg(t,!0)(e)))??n[n.length-1]??[]}const Zg=(e,t=!1)=>({href:n})=>{if(!n)return!1;const a=F(Qg(e)(n));return t?a===F(n):a.startsWith(F(n))},Qg=e=>t=>{const n=X(G.SITE_URL);return _(t)?e.href:O(n,e.pathname)},ef=d((({className:e="",items:t,activeItem:n,ariaLabel:a="Меню"})=>{const[r,{setFalse:d,toggle:m}]=on(!1),h=dn(d),p=s(null),g=l((({isOpened:e,buttonRef:t,menuRef:n})=>{if(e&&t.current&&n.current){const e=n.current.getBoundingClientRect(),a=t.current.getBoundingClientRect(),i=globalThis.innerWidth-e.width;e.right>=globalThis.innerWidth?n.current.style.left=`${i}px`:a.left>e.left&&(i>a.left?n.current.style.left="":n.current.style.left=`${i}px`)}}),[r]);return cn(globalThis,"resize",(()=>g({isOpened:r,buttonRef:h,menuRef:p}))),i((()=>{g({isOpened:r,buttonRef:h,menuRef:p})}),[r]),c("div",{className:u(r?"rounded-md shadow-blue-gray":"",e),ref:h,role:"navigation",children:[o("button",{type:"button",className:"group/btn flex justify-between items-center h-6","aria-label":a,onClick:m,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))))}),o("div",{ref:p,className:u("absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56 z-40",{hidden:!r}),"aria-hidden":!r,children:nf(t,n)})]})})),tf=d((({isActive:e,...t})=>{const n=pe(),{text:a,href:i,target:l,onClick:r}=n(t);return o("a",{className:u("text-l font-light pb-m hover:text-primary-main",{"text-primary-main":e}),href:i,target:l,onClick:r,role:"link",...fe(t?.data),children:a})})),nf=(e,t)=>e?.map(((e,n)=>o(tf,{isActive:e===t,...e},e?.text??String(n)))),af={default:"w-6 h-6",large:"w-12 h-12"},lf=d((({className:e,isRounded:t,buttonSize:n="default",isGrayBg:a=!1,disabled:i,ariaLabel:l="Меню второго уровня",image:r,data:s,onClick:c,version:d})=>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":`${af[n]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:i,"aria-label":l,onClick:c,...fe(s),children:o(ne,{image:r,className:u("h-full",{"bg-main-divider/20 rounded-full":t}),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),rf="chatbot",sf="text-page__btn-chat",of={personal:"//chat.mes.rshb.ru/assets/js/webchat_rshb",business:""},cf=d((({chat:e="personal",iconVersion:t,className:n,ariaLabel:a="Чат",version:l})=>{const r=(e=>{i((()=>globalThis.localStorage?.setItem("webchat-keep-open",String(Date.now()))),[]);const t=of[e??""];return n=>{if(t)if("personal"!==e)Ha(rf,t);else{const e=n.target;e?.classList.contains(sf)||e?.classList.add(sf),document.getElementById("webchat-js-container:webchat_rshb")||Ha(rf,t)}}})(e);return o(lf,{className:n,image:{icon:"HeadphonesIcon",iconVersion:t},ariaLabel:a,onClick:r,buttonSize:"large",isGrayBg:!0,version:l})})),df=d((({className:e="",active:t,dataItemName:n,children:a,data:i,...l})=>{const r=pe(),{href:s,target:d,text:m,onClick:h}=r(l);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,...fe(i),children:[o("span",{className:mf(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]})})),mf=(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"),uf=d((({observerOptions:e,onVisibilityChange:t,children:n,className:a,...i})=>{const r=Qc(l((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e);return o("span",{ref:r,className:a,role:"menuitem",children:o(df,{...i,children:n})})})),hf={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"},pf=d((({version:e,text:t,mobileText:n,...a})=>{const i=ke()?n:t;return i?o(Ne,{className:u("py-s px-lg font-light whitespace-nowrap",hf["transparent"===e?"transparent":"default"]),...a,children:i}):null})),gf=d((({subItems:e=[],version:t,internetBankButton:n,dropdownMenuAriaLabel:i,chatBotAriaLabel:l})=>{const d="transparent"===t?"white":"black",[,m]=Jg(e),[u,h]=a(e.length),p=e.slice(u),g=s(null),f={rootRef:g},x=r((()=>e.map(((e,t)=>e=>{h(e?ff(t):xf(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(uf,{className:u-1<t?"invisible":"",active:e===m,observerOptions:f,onVisibilityChange:x[t],data:e.dataHeader,...e},String(t))))}),p.length?o(ef,{items:p,activeItem:m,ariaLabel:i}):null,A.CHAT_BOT?o(cf,{version:t,iconVersion:d,chat:A.CHAT_BOT,ariaLabel:l}):null,o(pf,{version:t,...n})]})})),ff=e=>t=>Math.max(t,e+1),xf=e=>t=>Math.min(t,e),yf=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(_e,{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(bf,{...e},String(t))))})]}):null,bf=d((({icon:e,...t})=>{const n=pe(),{text:a,target:i,href:l,onClick:r}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ne,{image:e}):null,a?o("a",{className:"hover:text-primary-hover",href:l,target:i,onClick:r,children:o(_e,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})}):null]})})),vf=(e,t)=>n=>n.name?o(bu,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:yu(e,n.name),children:o(_e,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,Nf=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(hn,"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"})]}))),wf=d((({defaultLocation:e})=>{const t=Fp(e),n=pe(),{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(bu,{href:a,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),Cf=d((({foreignOffices:e,branches:t,onClose:n})=>{const i=Op(t?.default),[s,d]=a(""),m=fo(),u=r((()=>kf(m).sort(((e,t)=>e.name.localeCompare(t.name)))),[m]),h=r((()=>((e,t)=>{const n=new Map;for(const a of e){const e=t(a),i=n.get(e)||[];n.set(e,[...i,a])}return n})(u,Sf)),[u]),p=l((e=>{i.location=e,n?.()}),[i,n]);return c(Ql,{className:"pb-20",head:c("div",{children:[o(_e,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(wf,{defaultLocation:t?.default}),o(Nf,{onSearch:d,searchTerm:s})]}),onClose:n,children:[s&&s.length>=3?o("div",{children:u.filter((({name:e})=>e&&Pg(e.toLowerCase())(s.toLowerCase())>=.8)).map(vf(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(_e,{size:"text-h6",children:e})}),t.map(vf(f,g))]},e)))}),yf(e)]});var g,f})),Sf=e=>e.name?.charAt(0)??"",kf=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),If=d((({className:e="",active:t,flat:n,children:a,data:i,...l})=>{const r=pe(),{href:s,target:c,text:d,onClick:m}=r(l);return o("a",{className:u(Tf(t,n),e),href:s,target:c,onClick:m,rel:"noopener noreferrer","aria-label":`Ссылка на ${d}`,...fe(i),children:o("span",{suppressHydrationWarning:!0,className:Bf(t,n),children:d||a})})})),Tf=(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}),Bf=(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"),Pf=d((({className:e,version:t,...n})=>{const a="transparent"===t?"white":"black",i=Fp(n?.branches?.default),r=sn(Og,n),s=sn(Cf,n),d=l((()=>r.open({})),[r]),m=l((()=>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:[n?.branches?.visible?o(If,{className:"whitespace-nowrap text-ellipsis overflow-hidden",flat:!0,href:"#",text:i?.name,data:yu(n?.branches?.dataClick,i?.name??""),onClick:m}):null,n?.officesAtms?.href?o(If,{className:"whitespace-nowrap",flat:!0,...n.officesAtms}):null,o(lf,{image:{icon:"LoupeIcon",iconVersion:a},ariaLabel:n?.search?.ariaLabel??"Поиск",onClick:d,data:n?.search?.data})]})})),Rf=d((({observerOptions:e,onVisibilityChange:t,children:n,className:a,...i})=>{const r=Qc(l((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e);return o("span",{ref:r,className:a,role:"menuitem",children:o(If,{...i,children:n})})})),Df=d((({navigationItems:e=[],activeTopItem:t,dropdownMenuAriaLabel:n,version:i,headerData:l,search:d,bgColor:m,logo:u})=>{const[h,p]=a(e.length),g=e.slice(h),f=s(null),x={rootRef:f},y=r((()=>e.map(((e,t)=>e=>{p(e?Mf(t):Af(t))}))),[e]),{dataFooter:b,dataHeader:v,...N}=u??{};return c("div",{className:"flex items-center justify-between",children:[o(fc,{className:"mr-3xl",bgColor:m,logo:N,data:v,showTitle:!1}),o("div",{ref:f,className:"overflow-hidden min-w-[160px] pb-xs mt-xs",role:"menu",children:e.map(((e,n)=>o(Rf,{className:h-1<n?"invisible":"",active:e===t,observerOptions:x,onVisibilityChange:y[n],data:e.dataHeader,...e},String(n))))}),g.length?o(ef,{className:"mx-xs",items:g,activeItem:t,ariaLabel:n}):null,o(Pf,{version:i,className:"ml-auto",search:d,navigationItems:e,...l})]})})),Mf=e=>t=>Math.max(t,e+1),Af=e=>t=>Math.min(t,e),_f={"bg-white":"primary",transparent:"transparent"},Ef=["all","header"],zf=Ot((({className:e,bgColor:t="bg-white",logo:n={},version:a=_f[t],portal:i,header:l={},...r})=>{const{common:s,navigation:d}=Of(r?.options?.page),{navigationItems:m}=d,{logo:h={}}=s,[,p]=Jg(m),{internetBankButton:f}=i||{},x=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,...r,children:c("div",{className:"container",children:[o("div",{className:"whitespace-nowrap",children:o(Df,{activeTopItem:p,navigationItems:m?.filter(fg(Ef)),version:a,headerData:{...l,...d},search:s.search,bgColor:t,logo:x})}),o("div",{className:u("mt-s h-px bg-main-divider",Ff(a))}),p?.items?.length&&o(gf,{subItems:p?.items?.filter(fg(Ef)),version:a,internetBankButton:f})]})})})),Ff=e=>"transparent"===e?"opacity-30":"",Of=e=>({navigation:e?.navigation??{},common:e?.common??{}}),Vf=(e=!1)=>e?{}:{padding:"p-0"},Lf={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},$f=Ot((({className:e="",padding:t="p-0",gap:n="XS",isInnerPadding:a=!0,version:i="transparent",isTheme:l=!1,isCardBorder:r,...s})=>o(g,{className:u("relative","grid grid-cols-12",Lf[n],e),padding:t,version:i,isTheme:l,...s,children:R({...s,extraProps:{...Vf(a),className:Xc(r)}})})),{childrenTypes:{exclude:["HorizontalLayout"]}}),qf=d((e=>{const{className:t,align:n,image:a,...i}=e,l=n?u("flex",nm[n]):"";return o(g,{className:u(l,t),defaultPadding:"p-0",...i,children:o(ne,{image:a})})})),jf=(e,t=0)=>{const{itemCount:n,visibleItemCount:i}=e,[r,s]=a(t),o=l((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=l((()=>s((e=>Math.max(e-1,0)))),[n]),d=i?n>i&&r<n-i:r<n-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]};function Uf({dec:e,inc:t,canDec:n,canInc:a,btnClass:i,className:l=""}){return n||a?c("div",{children:[n?o(gd,{className:u("absolute z-40",i[0],l),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!n}):null,a?o(gd,{className:u("absolute z-40 rotate-180",i[1],l),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!a}):null]}):null}const Wf=d((({className:e="",cards:t=[],button:n})=>{const[i,r]=a(0),s=l((e=>r(e)),[]),d=t.length,[m,u]=jf({itemCount:d,visibleItemCount:2}),{canDec:h,canInc:p}=u,g=t[m]?.href;return c("section",{role:"listitem",className:`min-w-full text-center ${e}`,children:[c("div",{className:"relative overflow-hidden","aria-label":"Страховые программы",children:[d?Hf({activeIndex:m,cards:t,selectedCardIndex:i,onClick:s}):null,Uf({...u,btnClass:["left-12","right-12"],className:"top-16"}),h?o("div",{className:"absolute top-0 left-0 h-full w-32 bg-opacity-from-white"}):null,p?o("div",{className:"absolute top-0 right-0 h-full w-32 bg-opacity-to-white"}):null]}),o(Ne,{className:"w-60 text-center",version:"primary",...n,href:g})]})}));function Hf({activeIndex:e,cards:t,selectedCardIndex:n,onClick:a}){const i=460*e,l=t.length>2?"justify-start":"justify-center";return o("div",{style:{transform:`translateX(-${i}px)`},className:"duration-1000 px-6xl",children:o("div",{className:`w-full flex flex-nowrap gap-s pb-6xl ${l}`,children:t.map(((e,t)=>function({slide:e,i:t,isActive:n,onClick:a}){return c("button",{type:"button",onClick:a,className:"p-3xl min-w-fit flex items-center gap-2xl bg-white border-solid border relative "+(n?"shadow-dark-blue border-primary-main":"ease-in duration-300 border-gray"),children:[e?.icon?o(ne,{className:"p-lg rounded-full bg-secondary-light",image:e.icon,width:"108",height:"108"}):null,c("div",{className:"flex gap-s",children:[e?.sum?Yf("страховая сумма",e.sum):null,e?.fee?Yf("страховой взнос",e.fee):null]}),Kf(n)]},String(t))}({slide:e,i:t,isActive:Boolean(t===n),onClick:()=>a(t)})))})})}function Yf(e,t){return c("div",{className:"flex flex-col text-left whitespace-pre",children:[c(_e,{size:"text-h6",children:[He(2)(t)," ₽"]}),o("div",{className:"mt-2xs",children:o(_e,{size:"text-l",color:"text-secondary-text",children:e})})]})}function Kf(e){return e?o(ne,{className:"h-6 w-6 min-w-6 min-h-6 absolute right-4 top-4",image:{icon:"DoneIcon"},width:"24",height:"24"}):null}const Gf=d((({className:e="",title:t,insuranceTabs:n=[],button:i,...r})=>{const[s,d]=a(0),m=l((e=>d(e)),[]);return c(g,{className:u("box-border overflow-hidden relative px-0 space-y-2xl",e),defaultPadding:"p-6xl",...r,children:[t?o(N,{className:"text-center",title:t,headingType:"h3"}):null,n?.length>1?o("div",{className:"p-xs bg-secondary-light w-fit mx-auto rounded-md",children:n.map(((e,t)=>function({title:e,i:t,isActive:n,onClick:a}){return o("button",{type:"button",onClick:a,"aria-label":`Кнопка ${e}`,className:"box-border px-m py-s text-m font-light "+(n?"bg-primary-main text-white rounded-md":"text-secondary-text"),children:e},String(t))}({title:e?.title,i:t,isActive:Boolean(t===s),onClick:()=>m(t)})))}):null,o("div",{className:"flex",style:{transform:`translateX(-${s}00%)`},role:"list",children:Xf({insuranceTabs:n,button:i})})]})})),Xf=({insuranceTabs:e,button:t})=>{const n=e?.map((e=>e.cards));return n?.length?n.map(((e,n)=>o(Wf,{button:t,cards:e},String(n)))):null};const Jf={yellow:"bg-yellow",green:"bg-green","green-light":"bg-green-light","green-dark":"bg-green-dark"},Zf={XS:"h-10",S:"h-16",M:"h-24",L:"h-32",XL:"h-52"},Qf=d((e=>{const{className:t="",__html:n,isDotted:a,investmentZeroColumn:i,investmentColumns:l,...r}=e,s=l?[...l]:[];return i&&s.unshift(i),o(g,{className:t,defaultPadding:"p-4xl",...r,children:c("div",{className:"container text-m font-light space-y-4xl",children:[s?.length?c("div",{children:[c("div",{className:"flex items-end relative pl-3xl pr-lg text-white",children:[Ad(o("div",{className:"w-px h-4 bg-gray"}))(s.map(ex)),o("div",{className:"absolute right-3xl w-px h-4 bg-gray"})]}),o("div",{className:"border-t border-gray -mt-xs mx-3xl"}),o("div",{className:"flex justify-between text-primary-text mt-s -mx-5xl",children:s.map(ax)})]}):null,n?o("div",{className:"max-w-2xl font-light text-base",children:o(Me,{__html:n,isDotted:a,itemSize:"list-s"})}):null]})})})),ex=(e,t,n)=>{const a=1===t,i=t===n.length-1,l=e.cells?.reverse()||[];return o("div",{className:`${tx(a,i,e.cells)}`,children:l.length?o("div",{className:"w-full "+(i?"border-4 border-green-more-dark p-1.5 min-w-72":""),children:l.map(nx)}):null},`column_${t}`)},tx=(e,t,n=[])=>[n.length?"flex-1":"flex-0",!n.length||e||t?"":"pl-s",n.length&&!t?"pr-s pb-3xl":"pb-xl"].join(" "),nx=(e,t)=>{const n=e.cellSize||"XS",a=e.cellColor||"green";return e.text?o("div",{className:`flex-1 flex items-center justify-center relative py-xs ${Zf[n]} ${Jf[a]} ${"XS"===n?"px-s":"px-5xl"}`,children:o(_e,{align:"text-center",children:e.text})},`cell_${t}`):null},ax=(e,t)=>e?.title?o("div",{className:"flex-1 max-w-44 text-center px-xs last:pr-4xl last:max-w-52",children:e.title},`title_${t}`):null,ix=["байт","Кб","Мб","Гб","Тб","Пб"],lx=d((({icon:e,text:t,href:n,target:a,fileFormat:i,data:l,fileSize:r})=>{const s=r&&i?",":"",d=r??"",m=i?String(i):"";return c("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",href:n,target:a,...fe(l),children:[e,t?c(_e,{size:"text-l",font:"font-light",children:[t," ",rx(d,m),o(_e,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),rx=(e,t)=>e||t?o("span",{children:", "}):"",sx=(e,t)=>(n,a)=>{const i=j(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),l="Attachment"===n?.docType?((e,t=2)=>{if(0===e)return"";const n=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,n)).toFixed(t))} ${ix[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?cx(i):n?.fileFormat;return c("div",{role:"listitem",children:[o(lx,{text:n?.text,target:n?.target,href:i,fileFormat:r,fileSize:l,icon:ox(t),data:n?.data}),o(Me,{__html:n?.__html})]},String(a))},ox=e=>e?o(ne,{className:"min-w-6 min-h-6",image:e,width:"24",height:"24"}):null,cx=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),a=-1!==t?e.substring(t+1):"";return a.includes("/")?a.replace(n,""):a},dx=d((({href:e,__html:t,target:n,onClose:a})=>{const i=D(),l=j(i)(e);return c(Ql,{className:"my-6xl min-h-fit w-fit mx-auto",onClose:a,children:[t?o(Me,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(Ne,{text:"Я согласен",version:"primary",target:n,href:l,onClick:a}),o(Jl,{type:"button",version:"secondary",onClick:a,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]})})),mx=d((({text:e,href:t,target:n,__html:a,icon:i})=>{const{open:r}=sn(dx),s=l((()=>r({__html:a,href:t,target:n})),[a,t,n]);return e?c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[ox(i),o(_e,{font:"font-light",children:e})]}):null})),ux={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},hx=Ot((({className:e="",title:t,description:n,align:a="text-center",documents:i,icon:l={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=D();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(S,{title:t,description:n,align:a,headlineVersion:"M",as:"h2",isEmbedded:!0}),i?.length?o("div",{className:u("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",ux[r]),role:"list",children:i.map(px(d,l))}):null]})})),px=(e,t)=>(n,a)=>{const i=n?.docType;return""===i?null:"reportSource"in n&&n?.reportSource?.__html?gx(t)(n,a):sx(e,t)(n,a)},gx=e=>(t,n)=>{const a={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(mx,{...a,icon:e,href:fx(t)?t?.href:t?.attachment?.src}),o(Me,{__html:t?.__html})]},String(n)):null},fx=e=>"href"in e,xx=Ot((({className:e,padding:t,align:n="text-left",buttons:a=[],description:i,image:l,__html:r,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const x="secondary"===p?"p-m min-w-32":"min-w-24",y=l?.src?o(ne,{className:"hidden lg:block",image:l}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:p,...f,children:c(Be,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(N,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:y,buttons:qe(a,{className:"flex-wrap"}),children:[i?o(_e,{size:"text-xl","font-weight":"font-light",children:i}):null,c("div",{className:u("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[r?o(Me,{__html:r,itemSize:"list-m"}):null,o(_e,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),d?.src?o("div",{className:u("flex justify-center bg-white rounded-md @xl:-order-1",x),children:o(ne,{className:"w-fit",image:d})}):null,l?.src?o(ne,{className:"lg:hidden",image:l}):null]})]})})})),yx=(e,t)=>e&&"underlined"!==t?"primary":"secondary",bx=(e=[],t={})=>e.filter((({content:e={}})=>Ld(t,e))).length,vx=(e,t)=>e===t;const Nx=(e=>(t,n)=>t===n||Boolean(t&&n&&Object.keys(t).length===Object.keys(n).length&&Object.entries(t).every((([t,a])=>e(a,n[t])))))(function(...e){return(t,n)=>e.some((e=>e(t,n)))}(vx,((e=vx)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,a)=>e(t,n[a])))))())),wx=[],Cx={},Sx={primary:"bg-white/30",secondary:"bg-main-divider"},kx={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},Ix=d((({count:e,version:t="secondary"})=>{const n=ke(),a=n?"bg-main-divider":Sx[t],i=kx[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",a),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(_e,{size:"text-xs",color:i,children:e})})})),Tx=({text:e,description:t,icon:n,isActive:a,type:i})=>{const l=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white"),text:e?"mb-xs text-xl":"mb-2xs text-l text-primary-text",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal",oldText:"text-m text-center",oldDesc:"text-m-light"}))(a);return c("div",{className:u("cursor-pointer text-left border-b-0 flex gap-2xs"),"aria-label":e,"aria-labelledby":`${e}-label`,children:[n?o(ne,{className:u("h-6 w-6 min-w-6 min-h-6",l.icon),image:{...n,iconVersion:n?.iconVersion??l.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===i?l.text:l.oldText,children:e}),o("div",{className:"animated"===i?l.desc:l.oldDesc,children:t})]})]})},Bx={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},Px={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},Rx={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},Dx={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},Mx=d((({tag:e="div",item:t={},isActive:n=!1,type:a="default",onClick:i})=>{const l=e,{text:r,description:s,icon:d,count:m,tabName:h,...p}=t;return o(l,{className:u("h-12","block flex-1","cursor-pointer",Bx[a],n?Dx[a]:Rx[a]),role:"tablist","aria-label":"Список табов",onClick:i,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?Px[a]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[Tx({text:r,description:s,icon:d,isActive:n,type:a}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(Ix,{count:m,version:yx(n,a)})}):null]})})})),Ax=d((e=>o(e?.item?.href?_x:Ex,{...e}))),_x=d((e=>{const t=pe(),n=l((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:a,...i}=t({...e.item,onClick:n});return o(Mx,{...e,tag:"a",item:i,onClick:a})})),Ex=d((({item:e={},onClick:t,...n})=>{const a=l((()=>{t&&t(e)}),[t,e]);return o(Mx,{item:e,onClick:a,...n})})),zx=(e,t,n)=>(a,i)=>o(Ax,{isActive:a===e,onClick:t,type:n,item:a},String(i)),Fx=d((({className:e,tabsType:t="default",items:n=[],activeItem:a,onChange:i})=>o("div",{className:u("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tabpanel","aria-label":"Панель управления табами",children:n.map(zx(a,i,t))}))),Ox={categories:[],extraOptions:[],propertyType:[],stage:[]},Vx=Ot((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:a,...i})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=qd(Ox,{block:i.block,page:i.options?.page}),f=l(((e=Ox)=>p(e)),[]),x=(({hotFilters:e=wx,filtrationState:t=Cx,blocks:n=wx,onFiltrationStateChange:a})=>{const i=r((()=>Math.max(0,e.findIndex((e=>Nx(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:bx(n,t.filter),version:yx(t===e[i])})))),[e,n,i]),o=l((t=>{a(e[s.indexOf(t)].filter)}),[e,s]);return{activeItem:s[i],items:s,onChange:o}})({hotFilters:t,filtrationState:s,blocks:i.block?.blocks,onFiltrationStateChange:f});return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...i,children:[o(Fx,{...x}),o(Ed,{filtrationSchema:n,resetButton:a,field:m,reset:h}),o(Dd,{blocksToRender:d,...i})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),Lx=(e,t,n)=>{const a=yx("all"===t),i=yx("business"===t),l=(e,t,a)=>{const i=e.currentTarget===e.target&&"business"===t?r(a):a;return n(t),i},r=e=>e.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription));return c("div",{className:"flex gap-lg flex-col sm:flex-row pb-lg",children:[o(Jl,{"data-id":"all",onClick:t=>l(t,"all",e),version:a,children:"Для физических лиц"}),o(Jl,{"data-id":"business",onClick:t=>l(t,"business",e),version:i,children:"Для юридических лиц"})]})},$x=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o(Me,{__html:e,richVersion:n})}):null,t?.length?o("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl",children:t.map(((e,t)=>c("div",{className:"flex gap-xs items-center",children:[e?.image?o(ne,{image:e.image}):null,e?.text?o(_e,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,qx="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",jx=({filters:e,field:{field:t,reset:n},onlyOffice:a,labels:i})=>{const l=a?5:6,r=(e||[]).map((e=>o(Pa,{text:i[e],...t(e)},e))),[s,d]=l>0?[r.slice(0,l),r.slice(l)]:[r,[]];return o("div",{children:e?.length?o("div",{children:o(li,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:qx,children:s}),o(ri,{className:qx,isUnfolded:e,children:d})]}),renderFoldButton:Ux(n,a)})}):null})},Ux=(e,t=!1)=>({isUnfolded:n,onToggle:a})=>c("div",{className:"flex space-x-lg",children:[t?o(Ne,{version:"transparent",className:"text-secondary-text [&>*]:p-0",appendRight:o(W,{name:["ArrowDownIcon","ArrowUpIcon"][Number(n)],width:"16",height:"16"}),text:["Больше фильтров","Меньше фильтров"][Number(n)],onClick:a}):null,o(Ne,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:e,children:Wx()})]}),Wx=()=>c("div",{className:"flex items-center",children:["Очистить фильтр",o(W,{name:"CloseIcon",width:"16",height:"16",className:"ml-2xs"})]}),Hx=(e,t)=>o("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:c(N,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(_e,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),Yx=()=>{},Kx=e=>"all"===e?"block":"hidden",Gx=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:i=[],renderCard:l=Yx,renderRemoteWorkplaceCard:r=Yx,getBalloon:s=Yx,getBalloonRemoteWorkplaces:d=Yx,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=an(zi),{filteredItems:y,points:b,filteredRemoteWorkplaces:v,lengthItems:N}=$i({data:t,remoteWorkplaces:i,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=a("all"),S={filters:Xx([...t,...i]),field:{field:f,reset:x},onlyOffice:p,labels:Fi};return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[Hx(h,N),m?$x(m):null,p&&Lx(t,w,C),o("div",{className:u("pb-3xl",Kx(w)),children:jx(S)})]}),o("div",{className:"h-[600px]",children:o(Wi,{children:o(Ja,{points:b,isLoad:n,className:"h-full"})})})]}),c(Wi,{children:[y.map(l),v.map(r)]})]})})),Xx=e=>Object.keys(zi).filter((t=>e.filter((e=>Oi[t](e))).length)),Jx=({location:e,address:t,billAcceptorType:n,terminalType:a,billAcceptorEnable:i,atmCode:l="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:ey(a)},{label:"Модуль приема наличных",value:i?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:l}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(_e,{size:"text-h4",children:ey(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(_e,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(wi,{color:"green",children:ey(s)})})]}),o("div",{className:"hidden sm:block",children:o(mi,{className:"flex-wrap",children:m?.map(Qx)})}),o(li,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ri,{isUnfolded:e,children:o(mi,{className:"flex-wrap",children:m?.map(Qx)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Pi({isUnfolded:e,onToggle:t})})]},String(d))},Zx=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${ey(t)} №${n}`,body:e.toUpperCase()}),Qx=(e,t)=>o(si,{...e},String(t)),ey=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",ty=[];const ny=async e=>{const t=await Rt(e,{method:"GET"});return Array.isArray(t)?t:ty},ay={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},iy={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},ly=d((({descriptionData:e,className:t})=>{const n=Fp(),a=n?.code??"000",{data:i,isLoad:l}=function(e){const{data:t,error:n}=ga(`${Ut}/atms?regionCode=${e}`,ny);return{data:t||ty,isLoad:!t&&!n}}(a);return o(Gx,{className:t,filterItems:ry,data:i,isLoad:l,initFilterState:ay,renderCard:Jx,getBalloon:Zx,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),ry=(e,t)=>{const n=Object.keys(t).filter((e=>t[e])),a=n.filter((e=>e.startsWith("terminalType"))),i=n.filter((e=>!a.includes(e)));return e.filter((e=>{const t=i.every((t=>iy[t](e))),n=!a.length||a.some((t=>iy[t](e)));return t&&n}))},sy=({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(_e,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(_e,{size:"text-l",children:e})]}):null]})}),o("div",{className:"hidden sm:block",children:oy({workScheduleDescription:t})}),o(li,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ri,{isUnfolded:e,children:oy({workScheduleDescription:t})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Pi({isUnfolded:e,onToggle:t})})]},String(n)):null,oy=({workScheduleDescription:e})=>c("div",{children:[c(mi,{className:"flex",children:[o(si,{label:"Операции для физических лиц",children:o(_e,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(si,{label:"Операции для физических лиц",children:o(_e,{children:"Оформление и обслуживание банковских карт"})}),o(si,{label:"Операции для физических лиц",children:o(_e,{children:"Инвестиционное и накопительное страхование"})}),o(si,{label:"Операции для физических лиц",children:o(_e,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(si,{label:"Режим работы",className:"max-w-none",children:o(_e,{children:e})})]}),cy=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),dy={branches:[],remoteWorkplaces:[]};const my=async e=>await Rt(e,{method:"GET"})||dy,uy=d((({className:e})=>{const t=Fp(),n=t?.code??"000",{data:a,isLoad:i}=function(e="000"){const{data:t,error:n}=ga(`${Ut}/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,my);return{data:t||dy,isLoad:!t&&!n}}(n);return o(Gx,{className:e,data:a?.branches,isLoad:i,remoteWorkplaces:a?.remoteWorkplaces,renderCard:Ai,renderRemoteWorkplaceCard:sy,getBalloon:Ei,getBalloonRemoteWorkplaces:cy,title:`Офисы филиала ${t?.name}`})})),hy=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(uy,{}):o(ly,{descriptionData:e})})})),py=d((({className:e,title:t,description:n="Блок в разработке...",...a})=>c(g,{className:u("box-border",e),...a,children:[o(S,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(f,{})]}))),gy="hidden sm:flex absolute z-40 top-10",fy=Ot((({className:e="",padding:t,slides:n=[],...i})=>{const[l,r]=a(0),[s,d]=md({itemCount:n?.length||0});return c(g,{className:u("box-border overflow-hidden",e),defaultPadding:"pt-6xl",padding:t,...i,children:[o("div",{className:"flex duration-1000",style:{transform:`translateX(-${100*l}%)`},role:"list",children:n.map((({productBlock:e},t)=>o("div",{className:"box-border grow-0 shrink-0 basis-full",role:"listitem",children:o(Ze,{className:"pl-6xl h-full",headlineVersion:"M",isFullWidthTitle:!1,...e,...i})},String(t))))}),c("div",{className:"relative pr-xs mt-m -mb-m flex gap-xs box-border",children:[o(ad,{containerRef:s,snapAlign:"snap-start",onVisibleIndicesChange:d.handleVisibleIndicesChange,itemClassName:"h-40 flex items-stretch w-screen",gap:8,children:n.map(xy({activeSlideIndex:l,onClick:r}))}),d.canScrollLeft?o(fd,{className:u("left-6",gy),onClick:d.scrollLeft}):null,d.canScrollRight?o(xd,{className:u("right-6",gy),onClick:d.scrollRight}):null]})]})})),xy=({activeSlideIndex:e,onClick:t})=>({nav:n},a)=>{const i=a===e,l=i?"min-w-[370px] mt-s h-28 bg-white shadow-dark-blue border-none p-6":"min-w-72 mt-lg h-24 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=i?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=i?"text-secondary-text text-l font-light":"text-secondary-text text-m font-light group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(a),"aria-label":n?.title,className:u("relative overflow-hidden grow","ml-xs px-xl","box-border basis-0 border","border-gray group-data-secondary:border-white/50","text-left whitespace-nowrap",l),children:[o("div",{className:r,children:n?.title}),o("div",{className:s,children:n?.description})]},String(a))},yy=d((({address:e,email:t,telephone:n,button:a,className:i="",__html:l,richVersion:r,icon:s,title:d,version:m="primary",...h})=>c(g,{className:u("box-border text-left space-y-s",i),version:m,...h,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[$e(s)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ne,{image:s})}):null,d?o(N,{headingType:"h3",as:"h3",title:d}):null]}),c("div",{className:"w-full space-y-m",children:[l?by({__html:l,richVersion:r}):null,vy({label:"Адрес",data:e,iconName:"GeolocationIcon"}),vy({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),vy({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),a?.text?qe([a]):null]})]}))),by=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(Me,{...e,itemSize:"list-s"})}),vy=({label:e,data:t,iconName:n,dataColor:a=""})=>t?c("div",{className:"flex gap-s",children:[o(W,{iconVersion:"black",name:n,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(_e,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(_e,{size:"text-xl",color:a,children:t})]})]}):null,Ny=d((e=>{const{__html:t,richVersion:n="",...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(Me,{__html:t,richVersion:n})})})),wy=d((({label:e,labelIconBgVersion:t,icon:n,onToggle:a,labelIcon:i})=>o(kd,{tag:"button",className:u("border-none bg-transparent items-center group/button",i?.icon?"py-xs":"py-lg"),onClick:a,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[null,e?o(_e,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:n?o(W,{name:n,iconVersion:"color",width:"24",height:"24"}):null}))),Cy=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",Sy=(e=!1)=>e?"MinusIcon":"PlusIcon",ky=(e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon",Iy=Ot((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,label:a="Развернуть",labelIcon:i,labelIconBgVersion:l,foldButtonVersion:r="default",version:s,role:c,...d})=>{const m=ke();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:c,...d,children:o(li,{isFoldButtonOnTop:n,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(ri,{className:u("gap-lg",Cy(m)),isUnfolded:e,children:R({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Ty({foldButtonVersion:r,label:a,labelIcon:i,labelIconBgVersion:l,isUnfolded:e,onToggle:t,isMobile:m})})})}),{childrenTypes:{exclude:["RollupItem"]}}),Ty=({foldButtonVersion:e,label:t,labelIcon:n,labelIconBgVersion:a,isUnfolded:i,onToggle:l,isMobile:r=!1})=>{const s=t||(i?"Скрыть":"Развернуть"),c=((e=!1,t=!1)=>t?ky(e):Sy(e))(i,r);return"accordion"===e?o(wy,{label:s,labelIcon:n,labelIconBgVersion:a,icon:c,onToggle:l}):o(Id,{label:s,icon:i?"ArrowUpIcon":"ArrowDownIcon",onClick:l})},By=d((({name:e,text:t,value:n,checked:a,onChange:i,className:l})=>o("div",{className:l,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:u(hn.split(" ").filter((e=>"rounded"!==e)),Ta,"flex justify-center items-center after:block after:w-2.5 after:h-2.5 after:rounded-full rounded-full","checked:border-2 checked:!border-primary-main focus:checked:border-primary-main checked:after:bg-primary-main"),type:"radio",value:n,name:e,checked:a,onChange:e=>i?.(e.target.value),role:"radio"}),t?o(_e,{color:"text-primary-text",children:t}):null]})}))),Py=d((({className:e=""})=>{const[t,n]=a("option2"),i=l((e=>n(e)),[]);return c("div",{className:u("order-4",e),role:"radiogroup",children:[o(By,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:i}),o(By,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:i})]})})),Ry=d((({data:e,fieldLabel:t,fieldValue:n,selected:a,placeholder:i="",setSelected:l,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[n||t],text:e?.[t]}))),c=s.find((e=>e.key===a));return o(Dn,{options:s,label:r,placeholder:i||a,onChange:e=>l(e.key),value:c})})),Dy=d((({regions:e=[],selectedRegion:t,onSelectedRegion:n,branches:a=[],selectedBranch:i,onSelectedBranch:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Ry,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(Ry,{data:a,fieldValue:"branchCode",fieldLabel:"address",selected:i,setSelected:l,label:"Отделение",placeholder:"Выберите отделение"})})]}))),My=["От 1 дня","До 365 дней"],Ay=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(_e,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(Qi,{min:1,max:365,value:e,items:My,onChange:t})]}))),_y=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:n,safeBoxCases:a=[],selectedBoxSize:i,onSelectedBoxSize:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Ry,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(Ry,{data:a,fieldLabel:"safeBoxCasesSize",selected:i,setSelected:l,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),Ey=d((({regions:e,selectedRegion:t,branches:n,selectedBranch:a,days:i,selectedCaseVolume:l,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:u})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(Dy,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:a,onSelectedBranch:zy(m)}),o(Ay,{days:i,setDays:e=>m({days:e})}),o(_y,{caseVolumes:d,selectedCaseVolume:l,onSelectedCaseVolume:Fy(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(_e,{size:"text-l",font:"font-light",color:"text-secondary-text",children:"Тип договора"})}),c("div",{className:"contents @md:flex justify-between items-center gap-m",children:[o(Py,{}),o(Ne,{text:"Офисы на карте",version:"primary",onClick:u,className:"order-6"})]})]}))),zy=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},Fy=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},Oy=d((({days:e,tariffs:t=[]})=>{const n=Ly(e,t),a="На рисунке изображена пачка листов\nформата А4";return c("div",{className:"contents @xl:flex flex-col justify-between gap-xl order-2",children:[c("div",{className:"flex flex-col @xl:flex-row gap-x-6xl gap-y-2xl order-5 @xl:order-none py-2xl @xl:py-0 border-t border-main-divider @xl:border-none",children:[Vy("Аренда за",e),Vy("Цена",n+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:a})}),c("div",{className:"flex flex-col items-center gap-s order-3 @xl:order-none mb-xl @xl:mb-0 bg-primary-main py-s @xl:p-3xl text-center",children:[o(ne,{image:{icon:"PackA4Icon"},className:"@xl:h-60"}),o("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:o(w,{size:"text-s",font:"font-light",color:"text-white",children:a})})]})]})})),Vy=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(_e,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o("span",{className:"text-l @xl:text-h3 text-primary-text",children:t})]}),Ly=(e,t)=>{const n=$y(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},$y=e=>{let t=1;switch(!0){case e>30&&e<=90:t=2;break;case e>90&&e<=180:t=3;break;case e>180&&e<=365:t=4}return t},qy=(e,t)=>e.find((e=>e.branchCode===t)),jy=d((e=>{const{regions:t,data:n,branches:a,onChange:l,onClick:r}=e;i((()=>{l({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,l]);const s=qy(a,n.selectedBranch),d=Uy(s?.safeBoxCaseVolumes),m=Wy(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=Hy(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(Ey,{...n,regions:t,onClick:r,branches:a,caseVolumes:d,safeBoxCases:m,onChange:l}),o(Oy,{days:n.days,tariffs:u})]})})),Uy=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Wy=(e,t)=>e?.find((e=>e.volume===t)),Hy=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Yy=`${Ut}/safeboxes`,Ky=[];const Gy=async e=>await Rt(e,{method:"GET"})||Ky,Xy=d((({title:e,footnote:t,className:n="",...i})=>{const[r,s]=a(!1),d=l((()=>s((e=>!e))),[]),[m,u]=a({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),h=fo(),p=Jy(m.selectedRegion,h),f=function(e){const{data:t}=ga(e?`${Yy}?regionCode=${e}`:null,Gy);return t||Ky}(p),x=l((e=>u((t=>({...t,...e})))),[u]),y=(b=qy(f,m.selectedBranch)||f,Array.isArray(b)?b.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)].filter(Boolean),content:void 0}))).filter((e=>e.coords&&2===e.coords.length)):b?.gpsLatitude&&b?.gpsLongitude?[{coords:[b.gpsLatitude,b.gpsLongitude]}]:[]);var b;return c(g,{className:n,defaultPadding:"",...i,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(N,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(jy,{regions:h,branches:f,data:{...m,selectedRegion:p},onClick:d,onChange:x}),t?o(w,{size:"text-s",font:"font-light",children:t}):null]}),y.length&&r?o(Ja,{points:y,className:"h-[640px]"}):null]})})),Jy=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,Zy=e=>e<4?"w-72":"w-52",Qy={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"},eb=d((({buttons:e,className:t="",description:n,showLines:a=!0,steps:i=[],stepVersion:l="gray",title:r,version:s="primary",...d})=>{const m=i.length>3,h=Qy,p=(e=>e?"":"opacity-0")(a),f=ke();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:r,description:n,isEmbedded:!0,className:"w-full",align:Yd(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:Ad(o("div",{className:u("h-0.5 w-full bg-secondary-light flex-1",p)}))(i.map(tb(h,m,l)))}),o("div",{className:u("flex justify-between",m?"gap-x-s":"gap-x-20"),children:i.map((x={styleMap:h,version:s},(e,t,n)=>{const{styleMap:a,version:i}=x,{label:l,description:r,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",Zy(n.length)),children:[c("div",{className:"space-y-xs",children:[l?o(_e,{size:"text-h6",align:"text-center",children:l}):null,c("div",{className:"flex flex-col items-center gap-3xs",children:[r?o("div",{className:a.description,children:r}):null,o(Me,{__html:e.__html,itemSize:"list-s",isDotted:d})]})]}),s?.text?o(Ne,{className:"box-border py-s w-full max-w-60 mt-auto",version:i,...s,children:s?.text}):null]},String(t))}))})]}):null,qe(e)]});var x})),tb=(e,t,n)=>({icon:a},i)=>{const l="secondary"===n?"white":"color";return o(g,{defaultPadding:"",className:`${nb(t)} flex justify-center items-center text-center rounded-full box-border z-10`,version:n,children:$e(a)?o(ne,{image:{...a,iconVersion:a?.iconVersion||l},width:"48",height:"48"}):o("span",{className:u("text-h4","transparent"===n?e.iconText:(r=n,"secondary"===r?"group-data-primary:text-white":"text-secondary-text")),children:i+1})},String(i));var r},nb=e=>e?"h-16 w-16":"h-24 w-24",ab=d((()=>o("div",{className:"hidden",role:"none"}))),ib="hidden sm:flex absolute z-40",lb={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},rb=d((({className:e,items:t=[],activeItem:n,onChange:a,tabsType:l="default"})=>{const[r,s]=md({itemCount:t?.length||0});return i((()=>sb(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(ad,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:lb[l].item,gap:lb[l].gap,children:t.map(zx(n,a,l))}),s.canScrollLeft?o(fd,{className:u("left-6",ib,lb[l].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(xd,{className:u("right-6",ib,lb[l].buttonTop),onClick:s.scrollRight}):null]})})),sb=(e,t,n)=>{const a=t.findIndex((e=>e===n));e&&a>0&&e.scrollTo({left:e?.children[a]?.offsetLeft,behavior:"smooth"})},ob={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},cb=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(ob[t].wrapper,e),children:o(rb,{className:ob[t].component,tabsType:t,...n})}):null,db=Ot((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=mb(n??{}),p=D(),f=t.every((e=>"link"===e?.type)),x=s?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,{isReady:y}=p,[b,v]=a(pb(x,((e="")=>{const t=globalThis?.location?.href;return t?new URL(t).searchParams.get(e):null})(h))),N=x[b],w=x.findIndex((e=>Boolean(e.selected)));i((()=>{const e=p.query[h]?x.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===p.query[h])):w;v(-1===e?0:e)}),[y,w,h]);const C=hb(x[b],b),S=l((e=>{const t=x.indexOf(e),n=x[t];v(t),"group"===n.type&&((e,t)=>{const n=new URLSearchParams(p.query);e.text?n.set(h,e?.tabName??String(t)):n.delete(h),p.replace(`${p.pathname}?${n}`,"",{scroll:!1})})(e,t)}),[x]);return c(g,{className:u({"sticky top-1 z-20":d&&f},e),defaultPadding:"p-0",block:n,...m,children:[cb({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:ub(t,x),activeItem:N,tabsType:r,onChange:S}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:Object.entries(n?.slots??{}).map((([e,t])=>P(t,{...m?.options,slotName:C,parent:n,extraProps:{className:e===C?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(hb)?.filter(Boolean)||[]}),mb=({__id:e,anchor:t})=>t??e??"tabs",ub=(e,t)=>t?.length?t:e,hb=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",pb=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),gb={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},fb=d((({children:e,activeIndex:t,columnWidth:n,version:a="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:gb[a],style:{transform:`translateX(-${t*n}px)`},children:e})}))),xb=d((({className:e="",isOpen:t,onClick:n})=>o(Ne,{className:e,appendRight:o(ne,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"24",height:"24"}),text:t?"Скрыть":"Показать",version:"gray",onClick:n}))),yb={Buttons:({buttons:e})=>qe(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ne,{image:e}):null,RichText:({__html:e,isDotted:t=!0})=>o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(Me,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(_e,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(_e,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:a,isOpen:i})=>e?o(xb,{className:"w-fit",isOpen:i,onClick:()=>{t({tableSource:n,pdfUrl:a})}}):null},bb=d((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:l,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=a(!0);i((()=>{l===o&&s||m(!0)}),[s,o]);return vb({cell:e,cellProps:{rowIdx:n,cellIdx:l,fieldIdx:t,displayTable:e=>{m(!1),c(l),r(e)},isVisible:d}})})),vb=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...a}=e;if(!n||!(n in yb))return null;return o(yb[n],{...t,...a})},Nb=d((({cells:e,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:i,openTableInnerIdx:l,setOpenTableInnerIdx:r})=>o("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>o(bb,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:i,openTableInnerIdx:l,setOpenTableInnerIdx:r},String(s)))):null}))),wb=(e,t)=>140*Dg(e.slice(0,t).map((e=>e?.cols?.length??1))),Cb=(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(_e,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,Sb=d((({rows:e})=>{const t=e?.[0]?.length??0,[n,a]=jf({itemCount:t,visibleItemCount:5});return c("div",{children:[e?.map((i=n,(e,t)=>{if(!e?.length)return null;const[n,...a]=e,l=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 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(_e,{size:"text-xl",font:"font-light",children:n.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:l,style:{transform:`translateX(-${wb(a,i)}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(_e,{size:"text-xl",children:e.data}):null,e?.cols?Cb(e.cols,i):null]},`row${t}`)))})})]},String(t))})),Uf({...a,btnClass:["left-3 top-20","right-3 top-20"],className:""})]});var i})),kb=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const a=`activeTabIdx:${e}-tableIdx:${n}`;return c("div",{className:"w-full @container",children:[o("div",{className:"flex py-m sm:px-m bg-white @4xl:bg-gray relative",children:o(_e,{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(Sb,{rows:t.rowsData})})})]},a)}))}))),Ib=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Tb=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(_e,{size:"text-xl",font:"font-light",color:Ib(t===n),children:e||t+1})},e)))}):null,t?o(Ne,{className:"text-primary-main",href:t,version:"secondary",target:"_blank",appendLeft:o(W,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),Bb=Ot((({tableSource:e,pdfUrl:t,onClick:n})=>{const i=e?.tableData,[r,s]=a(0),d=l((e=>s(e)),[]),m=i?.[r]?.items??[],u=i?.map((e=>e.currency??""));return c("div",i?{className:"bg-white z-10",children:[o(Tb,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(kb,{activeTabIndex:r,items:m}),o(xb,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(_e,{size:"text-h6",children:"Данных нет"}),o(xb,{onClick:n,isOpen:!0})]})})),Pb=d((({children:e,tableInner:t,onHideContentClick:n})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:u("@4xl:border-main-divider @4xl:border-b","flex flex-col @4xl:flex-row gap-y-xs gap-x-5xl pb-lg @4xl:pt-lg"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(Bb,{...t,onClick:n})}):null]}))),Rb=d((({row:{header:e,data:t},activeIndex:n,rowIdx:i,...r})=>{const[s,d]=a(void 0),m=l((e=>d(e)),[]),[h,p]=a(void 0),g=l((e=>p(e)),[]);return c(Pb,{onHideContentClick:()=>d(void 0),tableInner:s,...r,children:[o("div",{className:u("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(ne,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(_e,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(fb,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(Nb,{cells:e,rowIdx:i,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})})),Db=d((({children:e,controls:t})=>{const{isScrollAvailable:n}=t;return c("div",{role:"table",className:"overflow-x-auto w-auto grid md:block",children:[c("div",{className:"relative space-y-xs",children:[e,Uf({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),n?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),Mb=d((({className:e="",title:t,description:n,rowHeaders:a,tariffsColumns:i,hiddenRowsNum:l=0,...r})=>{const s=i?.map((({data:e})=>e))||[],d=a?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=s.length,[h,p]=jf({itemCount:m,visibleItemCount:2}),f=(d||[]).map(((e,t)=>o(Rb,{row:e,activeIndex:h,rowIdx:t,...r},String(t)))),[x,y]=l>0?[f.slice(0,-l),f.slice(-l)]:[f,[]];return c(g,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...r,children:[o(S,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:l>0?o(li,{renderFoldableSection:({isUnfolded:e})=>c(Db,{controls:p,children:[x,o(ri,{isUnfolded:e,children:y})]}),renderFoldButton:Td}):o(Db,{controls:p,children:f})})]})})),Ab=d((({className:e="",title:t,description:n,iconVersion:a,__html:i,richVersion:l,...r})=>c(g,{className:u("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...r,children:["small"===a?_b():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(_e,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?Eb(n):null,i?o(Me,{richVersion:l,__html:i}):null]})]}))),_b=()=>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"}),Eb=e=>o(w,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),zb=d((({prefix:e,unit:t,suffix:n})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(_e,{size:"text-h2",children:e})}):null,t?o("div",{className:"-mb-6 @xl:-mb-4",children:o("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,n?o("div",{className:"gradient-color-text",children:o(_e,{size:"text-h2",children:n})}):null]}))),Fb=d((e=>{const{prefix:t,unit:n,suffix:a,...i}=e;return o(g,{defaultPadding:"p-0",...i,children:o(zb,{prefix:t,unit:n,suffix:a})})})),Ob=Ot((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:a=!0,version:i="transparent",isTheme:l=!1,isCardBorder:r=!1,image:s,...c})=>{const d=D();return o(g,{className:u("relative flex flex-col",Lf[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${J(d)(s?.src)})`}}:{},padding:t,version:i,isTheme:l,...c,children:R({...c,extraProps:{className:u("w-full",Xc(r)),...Vf(a)}})})}),{childrenTypes:[]}),Vb=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",Lb=d((({className:e,title:t,url:n,previewImg:a,...i})=>{const l=D();return c(g,{className:e,defaultPadding:Vb(e),...i,children:[o(S,{title:t,headlineVersion:"M"}),n?o("video",{className:"m-auto w-full object-fill",preload:"metadata",poster:j(l)(a?.src),style:{maxHeight:524},controls:!0,children:o("source",{src:j(l)(n)})}):null]})})),$b={AdTile:Lt,ApplicationForm:Zo,ApplicationLeadForm:Kc,BankAccountFiltration:Wd,BenefitsBlock:Xd,BonusBenefitsBlock:tm,ButtonsBlock:am,CalculatorBonus:dm,CalculatorBusinessDeposit:vm,CalculatorCredit:Vr,CalculatorDeposit:Om,CalculatorRefinancing:Hm,CardTransfer:Qm,Carousel:su,CarouselCard:mu,CarouselCatalogCard:hu,CarouselLinks:fu,CarouselRecommendationCard:Su,CarouselTariffsCard:Tu,ContactsBlock:Pu,CreditCardForm:wh,CreditForm:lp,DepositFiltration:dp,Depository:Ip,ErrorBlock:Bp,ExchangeRateTile:ug,Footer:Wg,GracePeriod:Hg,GrantSupport:Xg,Header:zf,Headline:S,HorizontalLayout:$f,ImgBlock:qf,InsuranceAmountBlock:Gf,InvestmentInfo:Qf,LinkDocs:hx,MobileAppTile:xx,MortgageFiltration:Vx,OfficesAtmsMap:hy,Placeholder:py,ProductBlock:Vt,ProductGallery:fy,RepresentativeOfficeInfo:yy,RichTextBlock:Ny,RollupItem:Iy,SafeDepositRental:Xy,StepsBlock:eb,StickyBottomMenu:ab,TabsLayout:db,TariffsTable:Mb,TextBlock:Ab,UnitBlock:Fb,VerticalLayout:Ob,Video:Lb},qb=ce((()=>{i((()=>{Qt()}),[]);const e=tn();cn(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const a=JSON.parse(n?.dataset?.aspects??"[]");Xt({aspectsAttributes:a,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))})),jb="cookie",Ub=d((({__html:e})=>{const[t,{setTrue:n,setFalse:a}]=on();Bg((()=>{globalThis.localStorage?.getItem(jb)||n()}),[],3e3);const i=l((()=>{globalThis.localStorage?.setItem(jb,"true"),a()}),[]);return t&&e?o("div",{className:"container fixed left-0 right-0 bottom-0 z-50",role:"dialog",children:c("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[o("div",{className:"sm:flex-1",children:o(Me,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(Zl,{className:"bg-main-gray rounded-md w-11 h-11",onClose:i})})]})}):null}));function Wb(e){const t=l((({key:t})=>{"Escape"===t&&e()}),[e]);cn(globalThis.document,"keydown",t)}function Hb(e,t,n){i((()=>e.subscribe(t,(e=>{const t=e?.type;if(t&&"string"==typeof t){const a=n[t];a&&a(e)}}))),[e,t,...Object.values(n)])}const Yb=()=>{const[e,{push:t,pop:n,clear:i}]=function(e=[]){const[t,n]=a(e),i=l((e=>n((t=>[...t,e]))),[]),r=l((()=>n((e=>e.slice(0,-1)))),[]),s=l((e=>n((t=>t.filter((t=>t!==e))))),[]),o=l((()=>n([])),[]);return[t,{setList:n,push:i,pop:r,remove:s,clear:o}]}();return Hb(ue.observable,"dialog",{open:t,close:n,closeAll:i}),[e,{close:n,closeAll:i}]},Kb=d((()=>{const[e,{close:t}]=Yb(),n=Boolean(e.length);return Wb(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",role:"dialog",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})),Gb=d((()=>{const[e,t]=a(null),n=l((()=>{t(null)}),[]);return Hb(ue.observable,"popup",{open:t,close:n}),Wb(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",children:e.popup}):null})),Xb="header",Jb="footer",Zb="sticky-footer",Qb={},ev=d((({className:e,data:t=Qb,blocksRegistry:n,blockDecorator:a})=>{const{slots:i,blocks:l,fallback:r,...s}=t,d=zt(s,r);qb(),Op();const m={key:"",page:{slots:i,blocks:l,fallback:r,...d},blocksRegistry:n,blockDecorator:a,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:u("@container relative",t.style,e),children:[i?.[Xb]?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:P(i?.[Xb],{...m,slotName:Xb})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[R({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),P(i?.[Jb],{...m,slotName:Jb})]})]}),i?.[Zb]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:P(i?.[Zb],{...m,slotName:Zb})}):null,o(Kb,{}),o(Gb,{}),o(Ub,{__html:d?.cookieContent?.__html})]})}));Object.assign(ev,{childrenTypes:[],slots:()=>[Xb,Jb,Zb]});e.Blocks=$b,e.ContentPage=ev,e.handlerDecorator=ce,e.joinList=Ad,e.locationNavigator=Jt,e.packageVersion="0.14.695",e.projectSettings=A,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=L,e.useRouter=D,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniBlocks={})}(this,(function(e){"use strict";let t;const n=e=>(...n)=>t[e](...n),i=n("useState"),a=n("useEffect"),l=n("useCallback"),r=n("useMemo"),s=n("useRef"),o=(...e)=>globalThis._uni._jsx(...e),c=(...e)=>globalThis._uni._jsxs(...e),d=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:m(e)),t._tmpl},m=e=>{function t(t,n){const{children:i,...a}=t||{},l=n?.slots?.default,r=i||l&&l();return e(Object.assign(a,r&&{children:r}),n)}return t.inheritAttrs=!1,t},u=(...e)=>e.map((e=>h(e)?Object.entries(e).filter((([,e])=>e)).map((([e])=>e)):e)).flatMap((e=>e)).filter(Boolean).join(" "),h=e=>Boolean(e&&"object"==typeof e&&!Array.isArray(e)),p={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white",gray:"bg-main-divider text-primary-text",transparent:"bg-transparent text-primary-text","":""},g=d((({className:e,version:t="primary",isTheme:n=!0,defaultPadding:i="p-xl",padding:a,block:l,tag:r="section",role:s,children:c,style:d})=>{const m=t&&n;return o(r,{className:u("@container font-sans",{group:m},p[t],a||i,e),...m?{"data-ver":t}:{},...l?.anchor?{id:l.anchor}:{},role:s,style:d,children:c})})),f=d((({className:e,size:t})=>o("figure",{className:u("m-0 mt-xl min-w-[80%]",e),children:x(t)}))),x=(e=3)=>b(100,e).map((e=>Math.floor(e))).map(y),y=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),b=(e,t)=>[e].concat(t>0?b(e/1.618,t-1):[]),v={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:i,children:a})=>o(n,{role:"heading",className:u("font-sans m-0",v[t],e),children:i||a}))),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:i,description:a,align:l="text-center",as:r,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:[i?o(N,{className:u("whitespace-pre-wrap",l),...h?.title,as:r||h?.title.as,title:i}):null,a?o(w,{size:h.descriptionSize,font:h.descriptionWeight,align:l,...p,children:a}):null]})})),k=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),I=[];function T(e,t,{className:n,...i}={}){const{key:a,blockDecorator:l=k,blocksRegistry:r={},ancestors:s=I}=t,{type:c}=e;c&&c in r||console.warn(`No block with "${c}" is registered`);const d=c&&r[c];return l({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:l})=>{const{content:r}=n;return d?o(d,{className:l,block:e,options:t,...r,...i},a):null}},a)}const B=[],P=(e,{key:t,ancestors:n=B,slotName:i=null,extraProps:a,renderProps:l=T,...r})=>{const s=a?(e,t)=>T(e,t,a):l;return(e||[]).map(((e,a)=>s(e,{...r,key:`${t||e.type}-${a}`,ancestors:r.parent?[...n||B,[r.parent,i]]:n},a)))};function R({block:e,options:t,children:n,extraProps:i,renderProps:a}){return n||(e&&t?P(e.blocks,{...t,parent:e,extraProps:i,renderProps:a}):null)}function D(){return D._impl()}D._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),D.setup=e=>{D._impl=e};const M=["CDN","BASE_PATH"],A=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return M.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),_=e=>Boolean(e?.includes(":")),E=(e,t)=>Boolean(e&&!_(e)&&(!t||"_self"===t)),z=e=>Boolean(e?.startsWith("#")),F=e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),O=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),V=(e,t)=>!(!e||!t)&&(!!e.startsWith(t)&&["/"===t,e===t,"/"===e[t.length]].some(Boolean));var L=Object.freeze({__proto__:null,isURL:_,isLocalURL:E,isHash:z,withoutQuery:F,joinPath:O,hasPrefix:V});const $="/api/",q=`${$}v1/storage`,j=e=>(t,n)=>{if([!t,_(t),z(t),[A.CDN,$].some((e=>V(t,e)))].some(Boolean))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`${q}/${t}/attachment`;const i=t?.startsWith("/");return O(V(t,n)?"":n,i?"/":(a=e.pathname,a?.split("/").slice(0,-1).join("/")),t);var a},U={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},W=d((({className:e="",imageClassName:t="",name:n="",alt:i=`Иконка ${n}`,title:a=i,iconVersion:l="color",width:r,height:s})=>{const d=D(),m="normal"===l?`${n}.svg`:`sprites.svg#${n}`,h=j(d)(O(A.CDN,"/icons/",m));return"normal"===l?o("img",{className:e,src:h,alt:i,title:a,"aria-hidden":"true",width:r,height:s,style:H(e,s)}):o(K,{className:e,children:c("svg",{className:u(Y(r),U[l],{invert:"white"===l},t),width:r,height:s,"aria-hidden":"true",children:[a?o("title",{children:a}):null,i?o("desc",{children:i}):null,o("use",{href:h,xlinkHref:h})]})})})),H=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},Y=e=>e?"":"w-full h-full",K=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),G=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function X(e=""){try{return new URL(e).pathname}catch(e){return""}}const J=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":X(G.SITE_URL);return t&&!_(t)?j(e)(t,n):t},Z=(e,t)=>e?.media&&t?.media?e.media-t.media:0,Q=d((({className:e="",image:t,imageClassName:n=""})=>{const i=D();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(Z).map((({src:e,format:n,media:a},l)=>o("source",{srcSet:J(i)(e),type:te(n),media:a?`(max-width: ${a}px)`:"",width:t?.size?.width,height:t?.size?.height},`${l}_${e}`))):null,t?.src?ee({...t,src:J(i)(t.src)},n):null]})})),ee=(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}),te=e=>e?`image/${String(e)}`:void 0,ne=d((({className:e="",image:t,imageClassName:n="",...i})=>t?.src||t?.icon?t.icon?o(W,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...i}):o(Q,{className:e,imageClassName:n,image:t}):null)),ie={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","":""},ae="bg-main-divider text-main-disabled",le={primary:ae,secondary:ae,white:ae,link:"",transparent:"",gray:ae,"":""},re="text-center font-sans select-none",se={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","":""},oe=({className:e,rounded:t,version:n})=>[re,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",n?ie[n]:"",t?"rounded-full":"rounded-md",e].join(" "),ce=e=>ce._impl(e);function de(e,t){const n=s({});return r((()=>new Proxy({},{get:(i,a)=>(n.current||={},n.current[a]||=n=>e.fire(t,{...n??{},type:a}),n.current[a])})),[e,t])}ce._impl=e=>e,ce.setup=e=>{ce._impl=e};class me{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 ue=new me,he=()=>de(ue.emitter,"dialog");function pe(){const e=X(G.SITE_URL),t=D(),{closeAll:n}=he();return e=>{const n=j(t)(e.href);return{...e,href:n,"aria-label":e.text,onClick:ce(i({...e,href:n}))}};function i({href:i,target:a,onClick:l}){return r=>{l?.(r),ge(i,a,e)||(n(),r?.preventDefault(),t.push(((e,t="")=>e?.replace(t,"")||"/")(i,e)))}}}const ge=(e,t,n)=>{if(!E(e,t))return!0;const i=G.SUB_PORTALS?.split(",");return!!i?.some((t=>V(e,t)))||!V(e,n||"/")},fe=e=>{if(!Array.isArray(e)||!e.length)return{};try{return{"data-aspects":JSON.stringify(e)}}catch(e){return{}}},xe=d((e=>{const{text:t,aboveText:n,appendLeft:i,appendRight:a,version:l="primary"}=e,r=be(e)&&"hidden lg:block";return c("div",{className:u(ye(e),"flex gap-xs"),children:[i?o("div",{className:u(r,se[l]),children:i}):null,be(e)?c("div",{className:"whitespace-pre",children:[n?o("div",{className:"text-xs font-light text-left",children:n}):null,o("div",{className:"text-left "+(n?"text-s -mt-3xs":"text-l"),children:t})]}):null,a?o("div",{className:u(r,se[l]),children:a}):null]})})),ye=e=>{const{version:t,aboveText:n,rounded:i}=e;if("link"===t)return"";const a=""+(n?"py-2.5 px-9":"py-4 px-9");return u("group/btn items-center justify-center",be(e)?a:"h-12 w-12 m-auto",{"rounded-full":i})},be=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),ve=({className:e,rounded:t,version:n})=>["inline-block",re,n?le[n]:"",t?"rounded-full":"rounded-md",e].join(" "),Ne=d((({disabled:e,children:t,method:n="LINK",href:i,...a})=>{const r=(({method:e,href:t})=>l((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:i,pathname:a,searchParams:l}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[i,a].join(""));for(const[e,t]of l.entries()){const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),r.appendChild(n)}document.body.appendChild(r),r.submit()}),[]))({method:n,href:i}),s=pe()({onClick:r,href:i,...a}),c=t??o(xe,{...s});return o(e?Ce:we,{...s,children:c})})),we=d((({className:e="",href:t,rel:n,target:i,ariaLabel:a,version:l,rounded:r,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:oe({className:e,version:l,rounded:r}),href:t,rel:n,target:i,"aria-label":a||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...fe(d),children:m}))),Ce=d((({className:e,ariaLabel:t,version:n,rounded:i,children:a})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:ve({className:e,rounded:i,version:n}),children:a})));function Se({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:i=!1}){if(!n)return null;const a="primary"===e?"white":"black",l="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(i?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:u(oe({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",rounded:!0}),l),onClick:t,children:o(ne,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:a}})}),o(Ne,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const ke=()=>{const[e,t]=i(false);return a((()=>{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},Ie={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Te=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&Ie[n],t),children:e}):null,Be=d((({className:e,version:t="primary",defaultPadding:n,padding:i="",title:a,buttons:r,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:x,...y})=>{const b=ke(),v=D(),N=l((()=>v.back()),[]),w=y.options?.page?.common?.backwardButton,C=f&&!b;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",i||n,e),children:[C&&Se({version:t,handleClick:N,text:w}),a?o("div",{className:"relative h-full",children:a}):null,c("div",{className:u("grow relative flex flex-col @xl:flex-row gap-3xl w-full",{"self-start @xl:w-auto":s}),children:[Te(s,{imageAlign:m,className:"mx-auto"}),c("div",{className:u("grid gap-3xl items-center md:items-stretch",{"@xl:grid-cols-2 auto-cols-fr":d,grow:!s},"h-full","auto-rows-[max-content_1fr]"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[h,x]}),Re(R({...y,extraProps:{className:"@container-normal"}})),Te(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Pe(p)]:r,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),r?o("div",{className:"self-end",children:r}):null]})]})]})})),Pe=e=>u(e?"row-span-2":"@xl:row-span-2"),Re=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,De=(e,t="normal")=>e?.icon||e?.src?o("div",{className:u("sm:w-12 sm:h-12 sm:min-w-12 w-11 h-11 min-w-11 box-border flex items-center justify-center rounded-icon","normal"===t?"bg-secondary-light text-primary-main":"bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black"),children:o(ne,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,Me=d((e=>{const{__html:t="",richVersion:n="",itemSize:i="list-m",isDotted:a=!0}=e,l=a?"":"without-dots";return t&&"<p><br></p>"!==t.replace(/<\/?[^>]+\/?>/g,"").trim()?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(n,i,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",l),dangerouslySetInnerHTML:{__html:t}})}):null})),Ae=(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,_e=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),Ee=(e,t)=>e?o(_e,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,ze=(e,t)=>["label"in e?Ee(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Ae(e.description,t)},String(t)):null,"__html"in e?o(Me,{...e},`rte-${t}`):null],Fe=d((({className:e,benefitsVersion:t,...n})=>c("div",{className:u("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in n?De(n.icon,t):null,o("div",{children:ze(n)})]}))),Oe=d((({className:e,benefitsVersion:t="normal",benefits:n})=>n?.length?o("div",{className:u("flex gap-x-m gap-y-s flex-col",e),role:"list",children:n.map(((e,n)=>o(Fe,{benefitsVersion:t,...e},String(n))))}):null)),Ve=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(ze)}):null)),Le=d((({isTabularBenefits:e,...t})=>o(e?Ve:Oe,{...t}))),$e=e=>Boolean(e?.src||e?.icon),qe=(e,{className:t,buttonClassName:n,isVertical:i}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",i?"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(je(n))}):null,je=(e="")=>(t,n)=>{const{text:i,icon:a,iconRight:l,version:r,...s}=t||{},c=Ue(a,r),d=Ue(l,r);return i||a?.icon?o(Ne,{className:u("basis-full @lg:basis-auto",e),appendLeft:We({...a,iconVersion:c}),appendRight:We({...l,iconVersion:d}),version:r,text:i,...s},n?String(n):""):null},Ue=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},We=e=>$e(e)&&o(ne,{image:e,width:String(e?.size?.width||24),height:String(24)}),He=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),Ye=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(Ke)}):null)),Ke=({label:e,amount:t,unit:n},i)=>c("div",{className:"basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg sm:rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(_e,{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:[He(2)(t)," ",n||"₽"]}):null]},String(i)),Ge=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(Xe)}):null)),Xe=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(_e,{size:"text-m",font:"font-light",children:e})},String(t)),Je={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},Ze=d((({className:e,padding:t,defaultPadding:n,title:i,description:a,headlineVersion:l="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:d,isDotted:m=!0,benefits:u,__html:h,richVersion:p,isFullWidthTitle:g,priceList:f=[],tags:x=[],buttons:y,image:b,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:C=!1}={},backwardButton:k,children:I,...T})=>{const B=b?.src?o(ne,{image:b}):null,P=o(S,{title:i,description:a,headlineVersion:l,align:r,isEmbedded:!0}),R=u?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Be,{className:e,padding:t,defaultPadding:n,...g?{title:P}:{insetTitle:P},...Qe(B,N),isImageSecondary:C,imageAlign:v,isImageAlwaysOnRight:w,buttons:qe(y),backwardButton:k,...T,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[R?.length?o(Le,{benefitsVersion:s,isTabularBenefits:d,benefits:R}):null,h?o(Me,{richVersion:p,__html:h,isDotted:m,itemSize:Je[l]}):null,I,f?.length?o(Ye,{priceList:f}):null,et(x)]})})})),Qe=(e,t)=>t?{rightImage:e}:{leftImage:e},et=e=>e?.length?o(Ge,{tags:e}):null;class tt{_;constructor(e){this._=e}of(e){return new this.constructor(e instanceof tt?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 nt=()=>!0,it=(e,t)=>(...n)=>e(...n)&&t(...n),at=(...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 lt=e=>Boolean(e&&Array.isArray(e)),rt=e=>Boolean(e&&"object"==typeof e&&!lt(e)),st=e=>e;function ot(e){return e instanceof tt?e._:e}class ct extends tt{from(e){return this.of(e.map(((e=st)=>([,t])=>e(t))(ot)))}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(lt(this._)?Array.from({length:Math.max(this._.length,Number(e)+1)},((n,i)=>i===e?t:this._[i])):Array.from({length:Number(e)+1},((n,i)=>i===e?t:void 0)))}}class dt extends tt{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 mt extends tt{from(e){return this.of(Object.fromEntries(e.map((([e,t])=>[e,ot(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 ut extends tt{proto=at([e=>lt(this._)||"number"==typeof e,()=>ct.prototype],[e=>rt(this._)||"string"==typeof e,()=>mt.prototype],[nt,()=>dt.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 ht=e=>e instanceof tt?e:new ut(e),pt=e=>{const t=(t,...n)=>ot(e(ht(t),...n));return t.fn=e,t},gt=[],ft=e=>e instanceof Function?e:t=>e===t,xt=e=>(t,n,i=gt)=>ht(t).entries().reduce(((t,[n,a])=>xt(e)(a,t,i.concat(n))),e(n,[i,ht(t)])),yt=pt(((e,[t,n])=>{const[i,...a]=t;return e.set(i,a.length?yt(e.get(i),[a,n]):n)})),bt=pt(((e,t)=>t.reduce(yt.fn,e))),vt=e=>xt(((e,[t,n])=>Nt(n)?[...e,[t,ot(n)]]:e))(e,[]),Nt=e=>0===e.size();pt(((e,t=gt)=>t.reduce(((e,t)=>e.get(t)),e)));const wt=pt(((e,[t,...n])=>n.length?e.set(t,wt(e.get(t),n)):e.filter((([e])=>e!==t)))),Ct=(St=["$ref"]).map(((e,t)=>n=>ft(e)(n[t+n.length-St.length]))).reduceRight(it,nt);var St;const kt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(It,e),It=at([lt,(e,t)=>e[parseInt(t,10)]],[rt,(e,t)=>e[t]],[nt,st]),Tt=(e,t)=>((e,t={})=>n=>bt(t,vt(n).map((t=>e(t)))))((([e,n])=>{return Ct(e)?[(i=e,i.slice(0,-1)),kt(t(n),n)]:[e,n];var i}))(e),Bt=e=>vt(e).filter(((e=st)=>([t])=>e(t))(Ct)),Pt=e=>{return t=Bt(e).map((([,e])=>e)),[...new Set(t)];var t};async function Rt(e,t){try{return e?await Dt(e,t):null}catch(e){console.error(e)}return null}const Dt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),Mt=e=>[...new Set(e)],At={},_t=["/portal-resources"],Et=(e,t)=>Tt(e,(e=>t?.[e])),zt=(e,t)=>{const n=Pt(e),[l,r]=i({});return a((()=>{Ft(n).then(r)}),[n.join()]),n.length?Et(e,{...t,...l}):e},Ft=async(e,t={})=>{if(e.length){const n=await(async e=>Object.fromEntries((await Promise.allSettled(Mt(e).filter((e=>!_t.some((t=>e.startsWith(t))))).map((async e=>[e,At[e]||=await Dt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(e),i={...t,...n},a=Object.entries(n).flatMap((([,e])=>Pt(e)));return a.length?Ft(a,i):i}return t};function Ot(e,t={}){const n=d((t=>{const n=zt((({block:e,options:t,className:n,defaultPadding:i,padding:a,isTheme:l,version:r,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const Vt=Ot((({className:e,padding:t,defaultPadding:n,...i})=>o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...i,children:o(Ze,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...i})})),{childrenTypes:["UnitBlock"]}),Lt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>$t(0,t?.length)),[t]),i=t?.[n];return i?o(Vt,{suppressHydrationWarning:!0,...i,...e}):o(g,{...e,children:o(f,{})})})),$t=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),qt=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),i=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getFullYear());return t?`${a}-${i}-${n}`:`${n}.${i}.${a}`}},jt=e=>e?.replace(/[^+\d]/g,""),Ut="/api/v1";const Wt=e=>e?{phone:jt(e)}:{},Ht=(e,t="birthday")=>e?{[t]:qt(e)}:{},Yt=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),Kt=(e,t=!0)=>({[t?"email":"mail"]:e}),Gt=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:jt(e)}:{},Xt=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:i,params:a}of e)t[i??""]?.(n,a)};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 Zt="rshb-query-params";function Qt(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(Zt)||"";return e&&globalThis.sessionStorage?.setItem(Zt,e),e}const en=e=>{const t=e.target?.closest("a"),n=Jt();if(_(t?.href)&&!t?.href?.startsWith(n.origin)){e.preventDefault(),e.stopPropagation();const i=(e=>{const t=Qt();if(!_(e)||!t)return e;const n=new URL(e);for(const[e,i]of new URLSearchParams(t))n.searchParams.set(e,i);return n.toString()})(t?.href)||t?.href;i&&n.assign(i,t?.target)}};function tn(){return tn._impl()}tn._impl=()=>({forwardQuery:en}),tn.setup=e=>{tn._impl=e};const nn=e=>e,an=(e,{resetOnSubmit:t,onSubmit:n,normalize:r}={})=>{const[s,o]=i(e),c=l(r?e=>o(e instanceof Function?t=>{const n=r(e(t));return ln(t,n)?t:n}:r(e)):o,[r]);a((()=>{r&&o(r)}),[r]);const[d,m]=i(!1),[u,h]=i({}),p=l(((e,t)=>{const{parse:n=nn,format:i=nn}=t||{};return{value:i(s[e]),isDirty:d||u[e],onChange:t=>{c((i=>({...i,[e]:n(t)}))),h((t=>({...t,[e]:!0})))}}}),[c,d,u]),g=l((e=>{c(e),h(e)}),[]),f=l((()=>{c(e),m(!1),h({})}),[e]),x=l((e=>(e.preventDefault(),t?f():m(!0),n&&n(s,e),s)),[n,s]);return[s,{isDirty:d||Object.values(u).some(Boolean),field:p,update:g,reset:f,onSubmit:x}]},ln=(e,t)=>e&&t&&Object.keys({...e,...t}).every((n=>e[n]===t[n])),rn=d((e=>{const{className:t,title:n,children:i,...a}=e;return o(g,{className:t,defaultPadding:"p-6xl",...a,children:c("div",{className:"container max-w-[978px] space-y-lg",children:[n?o(N,{headingType:"h3",title:n,className:"@xl:text-center"}):null,i]})})}));function sn(e,t={}){const{open:n,close:i,...a}=he();return{open:l(((a,l={})=>n({dialog:o(e,{...t,...a,onClose:()=>{i(),a.onClose?.()}}),...l})),[e,n,i]),close:i,...a}}function on(e=!1){const[t,n]=i(e),a=l((()=>n(!0)),[]),r=l((()=>n(!1)),[]),s=l((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:a,setFalse:r,toggle:s}]}function cn(e,t,n,i){a((()=>{if(e&&n)return e.addEventListener(t,n,i),()=>{e.removeEventListener(t,n,i)}}),[e,t,n])}function dn(e){const t=s(null),n=l((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return cn(globalThis.document,"click",n),t}const mn=({label:e,errors:t})=>e&&t?`${e}*`:e,un=()=>{},hn="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",pn=e=>e?hn:"border-error",gn=e=>e?o(_e,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,fn=d((({key:e,className:t="",id:n,name:i,type:r="text",label:d,placeholder:m,value:h="",valid:p=!0,children:g,onChange:f,onFocus:x,onBlur:y,pattern:b,autoFocus:v=!1,isTextarea:N=!1,disabled:w=!1})=>{const C=s(null),S=l((e=>{const t=(e.target?.value||"").trimStart();f&&f(t)}),[f]);a((()=>{v&&C.current?.focus()}),[v,C]);const k=g?"pr-3xl":"",I=pn(p);return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[gn(d),N?o("textarea",{className:u("block resize-y min-h-24",xn,I),id:u("textarea",n),name:i||n,placeholder:m,value:h,onChange:S,onFocus:x,onBlur:y,disabled:w},e):o("input",{type:r,className:u("h-14",xn,k,I),ref:C,id:n,name:i||n,placeholder:m,value:h,onChange:S,onFocus:x,onBlur:y,pattern:b,disabled:w},e)]}),g]})})),xn="w-full border rounded-md text-primary-text outline-none p-m",yn=e=>o("div",{className:"h-6",children:e?o(_e,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),bn=e=>e?.value||"",vn={url:"suggest/address"},Nn={name:{url:"suggest/fio",requestData:{parts:["NAME"],gender:"UNKNOWN"}},surname:{url:"suggest/fio",requestData:{parts:["SURNAME"],gender:"UNKNOWN"}},middleName:{url:"suggest/fio",requestData:{parts:["PATRONYMIC"],gender:"UNKNOWN"}},email:{url:"suggest/email"},dulSubdivisionCode:{url:"suggest/fms_unit",responseItemHandler:e=>e?.data?.code?.replace("-","")||""},dulIssuedBy:{url:"suggest/fms_unit"},organizationName:{url:"suggest/party"},inn:{url:"suggest/party",responseItemHandler:e=>e?.data?.inn||""},addressRegistration:vn,addressFact:vn,organizationAddress:vn,addressCourier:vn},wn=()=>de(ue.emitter,"popup"),Cn=d((({options:e,onChange:t})=>o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",children:e?.map(((e,n)=>o("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem",onMouseDown:()=>t(e),children:o("span",{className:"min-h-6",children:e.processedValue})},n.toString())))})));function Sn({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=i([]),f=wn(),x=Nn[n],y=l((()=>{h.current=t,f.close()}),[t]),b=l((e=>{y(),h.current=e.processedValue,c&&c(e.processedValue),d&&d(e)}),[y,c]),v=s(null),N=r((()=>async e=>{if(!x)return;const t=await(e=>{const{url:t,query:n,queryPrefix:i,requestData:a={},responseItemHandler:l=bn}=e,r=(s=l,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${i?`${i}, `:""}${n}`;return fetch(`${Ut}/suggestions/${t}`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:10,...a,query:o})}).then((e=>e.json())).then(r)})({url:x.url,responseItemHandler:x.responseItemHandler,requestData:{...x?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=r((()=>((e,t=600)=>{let n;const i=(...a)=>{i.dispose(),n=setTimeout((()=>{e(...a)}),t)};return i.dispose=()=>{n&&clearTimeout(n)},i})(N,300)),[N]);return a((()=>{if(!e||!v.current||h.current===t)return void y();const n=v.current,{top:i,left:a,width:l,height:r}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.open({popup:o(Cn,{options:p,value:t,onChange:b}),top:i+globalThis.scrollY+r,left:a,width:l})}),[e,p,t,b]),v}const kn=d((({className:e,label:t,value:n="",placeholder:i,error:r,errors:s,onChange:d=un,onDaDataChange:m,onBlur:h,isTextarea:p,type:g,name:f="",daDataQueryPrefix:x,isInteger:y=!1,maxLength:b,dadata:v=!1,disabled:N=!1})=>{const[w,{setFalse:C,setTrue:S}]=on(),k=dn(C),I=l((e=>{v&&!w&&S(),b?e.length<=b&&d(e):d(e)}),[v,w,d]);a((()=>{y&&n&&d(In(n))}),[n]);const T=Sn({isOpen:w&&v,name:f,value:n,daDataQueryPrefix:x,onChange:d,onDaDataChange:m});return c("div",{className:u("shrink-0 w-full",e),ref:k,onBlur:C,onFocus:S,children:[o("div",{ref:T,children:o(fn,{disabled:N,type:g||"text","aria-label":t,label:mn({label:t,errors:s}),valid:Boolean(!r),value:n,onChange:I,onBlur:h,isTextarea:p,placeholder:Tn(i,s,t)})}),yn(r)]})})),In=(e="")=>e.replace(/[^\d]+/g,""),Tn=(e,t,n)=>t&&!n?`${e}*`:e,Bn=e=>e?.text||e?.key||"",Pn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Rn=d((({popupRef:e,options:t,value:n,query:i,onChange:a,iconVersion:l})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",ref:e,children:Pn(t,i).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(),a&&a(e)},children:[o("span",{className:"min-h-6",children:Bn(e)}),o(W,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:l,className:u("absolute right-4 pt-3xs",{hidden:e.key!==n?.key})})]},e.key)))}):null));const Dn=d((({className:e,label:t,options:n=[],value:r,valid:d=!0,isBorder:m=!0,placeholder:h="",isSearch:p=!1,iconVersion:g="black",onChange:f,disabled:x=!1})=>{const[y,{setFalse:b,setTrue:v}]=on(),[N,w]=i(""),C=_n(x,n.length),S=y&&!C,k=l((()=>{C||v()}),[C]),I=l((()=>{w(""),b()}),[]),T=function({isOpen:e,options:t,value:n,query:i,onChange:r,onClose:c,iconVersion:d}){const m=wn(),u=l((()=>{m.close(),c&&c()}),[c]),h=l((e=>{u(),r&&r(e)}),[u,r]),p=s(null),g=dn(u);return a((()=>{if(!e||!p.current)return;const a=p.current,{top:l,left:r,width:s,height:c}=a.getBoundingClientRect();m.open({popup:o(Rn,{popupRef:g,options:t,value:n,query:i,onChange:h,iconVersion:d}),top:l+window.scrollY+c,left:r,width:s})}),[e,t,n,i,h]),p}({isOpen:y,options:n,value:r,query:N,onChange:f,onClose:I,iconVersion:g});return c("div",{className:u("space-y-xs",e),children:[gn(t),c("div",{className:u("relative",S?"z-20":"z-10"),ref:T,children:[c("div",{className:u("h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden",An(m,d,C)),onClick:S?I:k,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:Bn(r)||h}),Mn(S,g)]}),p&&S?o("div",{className:u("absolute top-0 w-full z-20"),children:o(fn,{type:"text",autoFocus:!0,value:N,onChange:w,disabled:C})}):null]})]})})),Mn=(e,t)=>o(W,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),An=(e,t,n)=>u(e?"border rounded-md ":"",e&&!n?"hover:border-primary-hover":"",n?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),_n=(e,t)=>e||0===t,En=d((({className:e="",label:t,error:n,errors:i,...a})=>c("div",{className:e,children:[o(Dn,{...a,valid:!n,label:mn({label:t,errors:i})}),yn(n)]}))),zn=e=>!e?.length,Fn=e=>t=>n=>e(n)?[]:[t],On=Fn((e=>null!=e&&""!==e)),Vn="Некорректно заполненное поле",Ln="Укажите регион, город/населенный пункт, улицу, дом",$n=e=>On(e??Vn),qn=e=>Fn((e=>e?.key&&""!==e?.key))(e??Vn),jn=e=>Fn((e=>"string"==typeof e&&e.length>0&&e.length<=2))(e??Vn),Un=e=>Fn((e=>"string"==typeof e&&e.length>1&&Qn(e)))(e??Vn),Wn=(e,t)=>Fn((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??Vn),Hn=e=>Fn((e=>"string"==typeof e&&6===e.length))(e),Yn=e=>{return(t=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,Fn((e=>"string"==typeof e&&t.test(e))))(e);var t},Kn=Fn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),Gn=e=>{const t=String(e).replace(/[^0-9]+/g,"");if(11===t.length){let e=0;for(let n=0;n<9;n++)e+=parseInt(t.charAt(n))*(9-n);return e>101&&(e%=101),100!==e&&101!==e||(e=0),e===parseInt(t.substr(9))}return!1},Xn=e=>Boolean(e.region&&e.city&&e.house),Jn=()=>Fn(Xn)(Ln),Zn=/^[\u0400-\u04FF\d]+$/u,Qn=(e="")=>Zn.test(e),ei=e=>{const t=new Date,n=new Date(t.getFullYear()-23,t.getMonth(),t.getDate()),i=new Date(t.getFullYear()-75,t.getMonth(),t.getDate());return!(!e||e>n||e<i)},ti={typeForm:$n(),surname:Un("Укажите свою фамилию"),name:Un("Укажите своё имя"),middleName:Un("Укажите своё отчество"),region:qn(),addressBranch:qn(),phone:Yn("Укажите номер телефона"),secondaryPhone:Yn("Укажите номер телефона"),organizationPhone:Yn("Укажите номер телефона"),birthday:$n("Укажите дату рождения"),limitedBirthday:Fn(ei)("Допустимый возраст заёмщика - от 23 до 75 лет"),birthPlace:$n("Укажите место рождения"),education:$n("Выберите ваше образование"),housing:$n("Выберите тип жилья"),employment:$n("Выберите информацию о трудоустройстве"),organization:$n("Выберите тип организации"),amountWorkers:$n("Выберите информацию о количестве сотрудников"),employerActivities:$n("Выберите вид деятельности организации"),employerOrganization:$n("Выберите вид организации"),positionOrganization:$n("Выберите вашу должность"),dulSerie:(ni="Укажите серию паспорта",Fn((e=>"string"==typeof e&&4===e.length))(ni)),dulNumber:Hn("Укажите номер паспорта"),dulIssueDateField:$n("Укажите дату выдачи паспорта"),dulSubdivisionCode:Hn("Укажите код подразделения"),dulIssuedBy:$n("Укажите организацию, выдавшую паспорт"),email:(e=>Fn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(e))("Укажите электронную почту"),fullName:Un(),inn:(e=>Fn((e=>"string"==typeof e&&(10===e.length||12===e.length)))(e))("Укажите ИНН"),legalForm:$n("Укажите ОПФ"),organizationName:$n("Укажите наименование организации"),generalSeniority:jn("Укажите количество лет стажа"),lastJobExperience:jn("Укажите стаж на последнем месте работы"),experience5Years:jn("Укажите общий стаж за последние 5 лет"),jobsNumber:jn("Укажите количество мест работы за последние 5 лет"),beginDate:$n("Укажите дату заключения трудового договора"),addressFact:Jn(),partnerComments:$n(),collectionCount:$n(),comment:$n(),acquiringType:qn(),feedbackMethod:qn(),serviceType:qn(),serviceDirection:qn(),regionRetail:qn("Выберите регион"),meetingDay:$n(),product:$n(),localities:$n(),consentDataProcessing:Kn,annualRevenue:$n(),consentToReceiveMaterials:Kn,processPersonalDataFlg:Kn,consentProviderFlg:Kn,consentPfrFlg:Kn,consentOthersFlg:Kn,consentInformFlg:Kn,familyStatus:$n("Выберите семейное положение"),children:Wn(2,"Укажите количество детей"),familyMembers:Wn(2,"Укажите количество членов семьи"),dependents:Wn(2,"Укажите количество иждивенцев"),totalIncome:Wn(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:Wn(10,"Укажите сумму обязательных выплат"),snils:(e=>Fn(Gn)(e))("Некорректный номер СНИЛС"),conscription:$n(),armyIdFlg:Kn,sex:$n("Укажите свой пол"),addressRegistration:Jn(),organizationAddress:Fn((e=>Boolean(e.fiasCode&&e.city&&e.house)))(Ln),participantDateRegistration:$n("Укажите дату регистрации"),retirementIncome:$n(),otherIncome:$n(),wages:$n(),mandatoryPayments:$n(),disablePeopleFlg:$n(),bankruptcyFlg:$n(),shareholderFlg:$n(),legalEntityName:$n(),bankEmployeeCode:$n(),partInBusiness:$n(),addressRetail:qn("Выберите адрес банка"),addressMatch:$n(),codeWord:(e=>Fn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&Qn(e)))(e??Vn))("Необходимо ввести кодовое слово"),confirmationIncome:$n(),deliveryDate:$n("Укажите дату доставки"),addressCourier:Jn(),cardCategory:$n("Укажите категорию карты"),paymentSystem:$n("Укажите тип платежной системы"),currency:$n("Укажите валюту")};var ni;const ii=e=>{const t=(e=>Object.values(e.filter((e=>e)))?.map((e=>e.name)))(e.filter((e=>Boolean(e?.required))));return Object.fromEntries(t.map((e=>[e,ti?.[e||""]])).filter((([,e])=>e)))},ai=(e,t)=>{const{value:n,isDirty:i}=e,a=i?t(n):[];return{...e,errors:a,error:a[0]}},li=(e,t,n=!1)=>n&&t?ai(e,t):e,ri=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],si=d((({field:e,input:t})=>o(En,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:ri,...li(e("acquiringType"),ti.acquiringType,t?.required)}))),oi=(e="")=>Boolean("trade"===e||"all"===e),ci=e=>null!=e,di=new Map,mi=(e,t=di)=>n=>{const i=hi(n),a=t.get(i);if(i&&ci(a))return a;const l=e(...n);return i&&ci(l)&&t.set(i,Promise.resolve(l)),l},ui=e=>Boolean(e?.every((e=>Array.isArray(e)?ui(e):!e||"string"==typeof e))),hi=e=>ui(e)?e.toString():"",pi=e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]);function gi(e,t,{fallback:n,cache:l}={}){const s=r((()=>fi(e)),[e]),[o,c]=i(void 0),[d,m]=i(void 0);a((()=>{if(!s.some(ci))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await mi(t,l)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,l,s]);const u=n&&pi(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function fi(e){return Array.isArray(e)?e:e instanceof Function?fi(e()):[e]}const xi=`${Ut}/branches`,yi=[];const bi=async e=>await Rt(e,{method:"GET"})||yi;function vi(e=!1){const{data:t}=gi(`${Ut}${e?"/premiumBranchesByRegions":"/branchesByRegions"}`,Dt);return Array.isArray(t)?t:[]}const Ni=d((({field:e,input:t,isPremium:n=!1})=>{const i=e("region"),l=i?.value?.key,r=i?.value?.text,s=n?vi(n)?.find((e=>e?.region===r))?.branches:function(e){const{data:t}=gi(e?`${xi}?regionCode=${e}`:null,bi);return t||yi}(l)?.filter((e=>e?.address));return a((()=>{""!==i?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[i?.value]),o(En,{label:"Отделение",placeholder:"Выберите отделение",options:(s||[]).map((({address:e=""})=>({key:e,text:e}))),...li(e("addressBranch"),ti.addressBranch,t?.required),isSearch:!0})})),wi=d((({field:e,input:t})=>{const n="addressFact",i=e(n).value,{value:r}=e("addressMatch");a((()=>{r&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[r,e("addressRegistration").value]);const s=l((t=>{e?.(n)?.onChange?.({apartment:t?.data?.flat,city:t?.data?.city,district:t?.data?.area_with_type,fullAddress:t?.value,fiasCode:t?.data?.fias_id,house:t?.data?.house,locality:t?.data?.settlement_with_type,okatoRegionCode:t?.data?.okato,postcode:t?.data?.postal_code,region:t?.data?.region,regionCode:t?.data?.region_kladr_id?t?.data?.region_kladr_id.substring(0,2):"",street:t?.data?.house,qc:t?.data?.qc,qcComplete:t?.data?.qc_complete,qcHouse:t?.data?.qc_house})}),[]),c=l((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(kn,{label:"Адрес",disabled:r,...li(e(n),ti[n],t?.required),value:i.fullAddress,onChange:c,...t,onDaDataChange:s})})),Ci=(e,t)=>Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t).value,Si=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",i=e(n).value,a=l((t=>{e?.(n)?.onChange?.(ki(t))}),[]),r=l((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(kn,{disabled:t?.filledByEsia&&Ci(e,n),label:"Адрес",...li(e(n),ti[n],t?.required),value:i.fullAddress,onChange:r,...t,onDaDataChange:a})})),ki=e=>({apartment:e?.data?.flat,city:e?.data?.city,district:e?.data?.area_with_type,fullAddress:e?.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?.house,qc:e?.data?.qc,qcComplete:e?.data?.qc_complete,qcHouse:e?.data?.qc_house}),Ii=d((({className:e,viewBox:t,fill:n="none",width:i,height:a,paths:l,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:i,height:a,children:l.map((({d:e,fill:t,...n},i)=>{const a={...r,...n};return o("path",{d:e,fill:t||"currentColor",stroke:a.stroke,strokeLinecap:a.strokeLinecap,strokeLinejoin:a.strokeLinejoin,strokeWidth:a.strokeWidth,strokeMiterlimit:a.strokeMiterlimit},i)}))}))),Ti="appearance-none w-5 h-5 border-solid flex-none",Bi=[{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"}],Pi=d((({className:e,value:t,text:n,disabled:i,isRadio:a,onChange:r})=>{const s=l((e=>{i||(e.preventDefault(),r&&r(!t))}),[r,i,t]),d=a?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(Ii,{paths:Bi,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",Di(i)),onClick:s,children:[o("div",{className:u(Ti,"m-0",a?"rounded-full border-2":Ai(t),!i&&t?"border-primary-main":"border-gray",i?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:Mi(a),"aria-checked":Boolean(t),"aria-disabled":Boolean(i),"aria-label":n}),t?d:null,Ri(n)]})})})),Ri=e=>e?o("div",{className:"ml-s",children:o(_e,{size:"text-l",font:"font-light",children:e})}):null,Di=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",Mi=(e=!1)=>e?"radio":"checkbox",Ai=(e=!1)=>u("rounded border",{"bg-primary-main":e}),_i=d((({className:e,text:t,value:n,key:i,disabled:a,error:l,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(Pi,{text:t,value:n,disabled:a,onChange:r},i),yn(l)]}))),Ei=d((({field:e,input:t})=>o(_i,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...li(e("addressMatch"),ti.addressMatch,t?.required)}))),zi=d((({color:e="text-primary-main",position:t="absolute",blur:n=!0})=>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 h-28 w-28","animate-spin rounded-full","border-8 border-solid border-current","border-r-transparent",e),role:"status"})}))),Fi="/icons/MapMarkerClusterIcon.svg",Oi="/icons/MapMarkerClusterYellowIcon.svg";function Vi({yandexMaps:e,map:t,points:n,isLoad:i}){if(i||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const a=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),l=Li("offices",e,a);if(n.length&&n.every((e=>"type"in e))){const i=Li("workplaces",e,a),r=$i(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=$i(n.filter((e=>"offices"===e.type)),"offices",e);l.add(s),i.add(r),t.geoObjects.add(i),t.geoObjects.add(l)}else{const i=$i(n,"offices",e);l.add(i),t.geoObjects.add(l)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const Li=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?Fi:Oi,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),$i=(e,t,n)=>e.map((({coords:e,content:i})=>new n.Placemark(e,{balloonContentHeader:i?.header,balloonContentBody:i?.body,balloonContentFooter:i?.footer,hintContent:i?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?Fi:Oi,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),qi={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},ji={...qi,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},Ui=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(ji).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(W,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),Wi=e=>globalThis[e],Hi=(e,t)=>{const n=document.getElementById(t);if(n){const t=Wi(e);return t?Promise.resolve(t):new Promise((t=>{n.addEventListener("load",(()=>{t(Wi(e))}))}))}return new Promise(((n,i)=>{const a=document.createElement("script");a.src=t,a.async=!0,a.id=t,a.addEventListener("load",(()=>{n(Wi(e))})),a.addEventListener("error",(e=>{i(e)})),document.head.appendChild(a)}))};const Yi=()=>function(e,t,n=!0){const[l,r]=i(void 0);return a((()=>{let i=!0;return Hi(e,t).then((e=>{i&&r(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(i=!1,n){const e=document.getElementById(t);e&&document.head.removeChild(e),r(void 0)}}}),[e,t,n]),l}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${A.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1),Ki={...qi,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},Gi=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),i="in"===t?n+1:n-1;e.current.setZoom(i,{checkZoomRange:!0})},className:`${Object.values(Ki).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(W,{name:n,width:"20",height:"16"})})})),Xi=[55.753995,37.614069],Ji=d((({points:e,className:t="",zoom:n=5,isLoad:i,selectedAddress:l})=>{const r=s(null),d=s(null),m=Yi();if(a((()=>{r.current?Vi({yandexMaps:m,map:r.current,points:e,isLoad:i}):m?.ready((()=>{r.current||(r.current=new m.Map(d.current,{center:Zi(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),Vi({yandexMaps:m,map:r.current,points:e,isLoad:i})})),r.current&&l&&m?.geocode(l).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();r.current.setCenter(t),r.current.setZoom(18)}))}),[m,e,n,i,l]),!m)return null;const h="z-10";return c("div",{ref:d,className:u("relative","w-full",t),children:[i?o(zi,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(Gi,{yandexMaps:r}),o(Gi,{yandexMaps:r,direction:"out"})]}),Ui(r,m,u("right-2 top-80",h))]})})),Zi=e=>{const t=[ea(Qi(e,0)),ea(Qi(e,1))];return t.every((e=>e))?t:Xi},Qi=(e,t)=>e.map((e=>e.coords?.[t])),ea=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,ta=async(e,t,n)=>{try{return(await na(e,t,n)).json()}catch(e){return console.error(e),null}};async function na(e,t,n){return globalThis?.fetch?.(`${Ut}${e}`,{method:t,headers:{"Content-Type":"application/json",...ia()},credentials:"include",body:n?JSON.stringify(n):null})}const ia=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},aa=e=>Number(e.toString().replace(",",".")),la=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:n=!1,renderFoldableSection:a,renderFoldButton:r})=>{const[s,o]=i(n),d=l((()=>{o((e=>!e))}),[]),m=a({isUnfolded:s,onToggle:d}),u=r?r({isUnfolded:s,onToggle:d}):null;return c("div",t?{className:e,role:"group",children:[u,m]}:{className:e,role:"group",children:[m,u]})}));const ra=d((({className:e="",isUnfolded:t,children:n})=>{const i=s(null),l=function(e,t){const n=s(null);return a((()=>{const t=n?.current;if(!t)return;const i=new ResizeObserver((n=>{e(t,n[0])}));return i.observe(t),()=>{i.disconnect()}}),[e,...t]),n}((e=>{i.current&&(i.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:i,className:`transition-max-h duration-300 overflow-hidden ${i.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:l,children:n})})})),sa=d((({value:e,subText:t,children:n,isPhone:i,...a})=>{const l=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[l.length,n,t].every((e=>!e))?null:oa({textItems:l,subText:t,children:n,isPhone:i,...a})})),oa=({label:e,labelSize:t="text-m",textItems:n,subColor:i,subText:a,className:l,children:r,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",l),children:[e?o(_e,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||ca(n,s),a?o(_e,{color:i,size:"text-m",children:a}):null]}),ca=(e,t)=>e.filter(Boolean).map(((e,n)=>o(_e,{size:"text-l",children:t?o("a",{href:`tel:${da(e)}`,children:e.trim()}):e.trim()},String(n)))),da=e=>e.replace(/\D/g,""),ma=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}))),ua=e=>{const t=pa(e);return o(sa,{label:"Режим работы",value:t,className:"max-w-none"})},ha=({workTime:e="",lunchHour:t="",daysOff:n=""},i=!1)=>e?[`${i?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",pa=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))),i=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[ha({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":i}),ha({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:i},!0)].filter(Boolean)},ga=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],fa=e=>ga.map((([t,n,i])=>({key:t,title:i,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??"")}}))),xa=e=>{if(!e)return null;const t=ya(e);return c(ma,{className:"border-none",children:[o(sa,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(ba)})}),o(sa,{label:"Режим работы",className:"max-w-none",children:o(_e,{children:e})})]})},ya=e=>{const t=ga.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],i=n[n.length-1]?.toLowerCase();return i?.includes("выходной")?t.map((e=>({...e,status:!i?.includes(e.short.toLowerCase())}))):t},ba=({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(_e,{size:"text-xs",children:e})},String(n)),va=({currency:e,buyExchangeRate:t,saleExchangeRate:n},i)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(sa,{label:"Валюта",value:e.currency}):null,t?o(sa,{label:"Купить",value:String(t)}):null,n?o(sa,{label:"Продать",value:String(n)}):null]},String(i)),Na={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"}},wa=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",Na[n].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ne,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(_e,{size:"text-m",color:Na[n].text,children:t})]}))),Ca=(new Date).getDay(),Sa=e=>{const[t]=e?.slice(Ca-1)??[];if(!t)return null;const{lunchHour:n,status:i,workTime:a,hasLunch:l}=t;return i?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[a?o(wa,{color:"green",children:a}):null,n&&l?o(wa,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(wa,{color:"red",children:"Выходной"})},ka=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Ia=({title:e,status:t,workTime:n,lunchHour:i,hasLunch:a},l)=>o(sa,{label:e,value:t&&n?n:"",subText:ka({lunchHour:i,hasLunch:a,status:t}),subColor:!t||a?"text-error":"text-green-dark"},String(l)),Ta=["ArrowDownIcon","ArrowUpIcon"],Ba=["Подробнее","Скрыть"],Pa=({isUnfolded:e,onToggle:t})=>c("button",{className:"w-full py-2xl cursor-pointer text-primary-main flex items-center border-b border-solid border-main-divider",onClick:t,type:"button",children:[o("div",{className:"pr-m",children:Ba[Number(e)]}),o(W,{className:"text-primary-text",name:Ta[Number(e)],width:"16",height:"16"})]}),Ra=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,Da=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,Ma=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,Aa=({name:e,address:t,phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},u)=>{if(!d)return null;const h=fa(d);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(_e,{size:"text-h4",children:e}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(_e,{size:"text-l",children:t})]}):null]}),Sa(h)]}),o("div",{className:"hidden sm:block",children:_a({phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(la,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ra,{isUnfolded:e,children:_a({phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Pa({isUnfolded:e,onToggle:t})})]},String(u))},_a=({phone:e,fax:t,phoneBusiness:n,phoneNatural:i,phoneCallCentre:a,phoneCurrencyControl:l,workSchedule:r,exchangeRate:s})=>{const d=fa(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(ma,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(sa,{label:"Факс",value:t,isPhone:!0}),o(sa,{label:"Телефон филиала",value:e,isPhone:!0}),o(sa,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(sa,{label:"Обслуживание физических лиц",value:i,isPhone:!0}),o(sa,{label:"Для консультаций по валютному контролю",value:l,isPhone:!0}),o(sa,{label:"Контакт-центр",value:a,isPhone:!0})]}),r?.isMatchesPattern?o(ma,{children:o(sa,{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(Ia)})})}):c(ma,{children:[o(sa,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(ba)})}),ua(d)]}),r?.businessScheduleVisibleTag?xa(r?.businessScheduleDescription):null,s?.currencies?.length?o(ma,{className:"flex-wrap",children:s?.currencies?.map(va)}):null]})},Ea=({name:e="",address:t="",workSchedule:n})=>{const i=(a=e)?`${a?.charAt(0)?.toUpperCase()}${a?.slice(1)}`:"";var a;const l=`${t} ${(e=>{const t=fa(e),n=e?pa(t):"",i=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?Ra(n):Ma(n,i):Da(n):""})(n)}`;return{header:i,body:l}},za={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},Fa={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},Oa={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)},Va=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>Oa[t](e)))))},La=()=>{},$a=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:i=La,getBalloonRemoteWorkplaces:a=La})=>{const[l,s,o,c]=r((()=>{const l=Va(e,n),r=Va(t,n),s=[...l.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:i(e)}))),...r.map((e=>({type:"workplaces",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a({address:e.address,workScheduleDescription:e.workScheduleDescription})})))].filter((e=>e.coords&&2===e.coords.length));return[l,s,r,l.length+r?.length]}),[e,t,n,i,a]);return{filteredItems:l,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},qa=e=>{const{data:t,error:n}=gi(`/api/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,ja);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},ja=async e=>await Rt(e,{method:"POST"})||[],Ua=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),Wa=d((({children:e})=>Ua?e:null)),Ha=d((({field:e,input:t})=>{const[n,l]=i([]),{data:r}=qa("REGION_RF"),s=e("regionRetail")?.value||{},d=e("addressRetail");a((()=>{(async()=>{const e=await(async e=>{const t=await ta("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0});return t?.offices?.map((e=>({...e,gpsLatitude:aa(e.latitude??Xi[0]),gpsLongitude:aa(e.longitude??Xi[1])})))||[]})(s?.key??"");l(e)})(),s?.key&&e?.("addressRetail")?.onChange?.("")}),[s.key]);const{points:m}=$a({data:n,filtrationState:{},getBalloon:Ea}),u=Boolean(s?.key);return c("div",{children:[o(En,{label:"Адрес отделения",placeholder:"Выберите отделение",options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...li(e("addressRetail"),ti.addressRetail,t?.required&&u),isSearch:!0}),o("div",{className:"h-[600px]",children:o(Wa,{children:o(Ji,{points:m,isLoad:!r,className:"h-full",selectedAddress:d?.value?.text})})})]})})),Ya=(e,{normalize:t,format:n})=>{const{value:a,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=i(!1),m=l((e=>{d(!0),r&&r(e)}),[]),u=l((()=>{d(!1),o&&o(t(a)),s&&s()}),[o,a]);return{value:c||!n?a:n(a),onFocus:m,onBlur:u}},Ka=(e,t,n)=>Math.max(t,Math.min(e,n));function Ga(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function Xa({list:e=[],min:t,max:n,step:i,value:a=e[0]||t,disabled:l,onChange:r}){const s=e.length?e.indexOf(a):a,d={backgroundSize:`${(100*(s>t?s-t:0)/(n-t)).toFixed(2)}% 100%`};return c("div",{children:[e.length?o("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>o("div",{className:u("w-2 h-2 rounded-full",s<=t||l?"bg-gray":"bg-primary-main")},String(t))))}):null,o("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:o("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:d,type:"range",min:t,max:n,step:i,value:s,disabled:l,onChange:t=>{const n=Ga(t.target?.value),i=e.length?e[n]:n;r&&r(i||0)}})})]})}const Ja=1,Za=100,Qa=d((e=>{const{className:t,title:n,items:i=[],list:a=[],min:r=(a.length?0:Ja),max:s=(a.length?a.length-1:Za),step:d=1,value:m=a[0]||r,disabled:h=!1,onChange:p}=e,g=Ya(e,{normalize:(e=0)=>a.length?el(a)(e):Ka(e,r,s),format:He()}),f=l((e=>{p&&p(Ga(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(_e,{size:"text-m",font:"font-light",color:"text-primary-text",children:n}):null,o("input",{className:u("text-h3 w-full h-14","pl-m mt-xs box-border","text-primary-text",hn,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),Xa({list:a,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),tl(i)]})})),el=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),tl=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(_e,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),nl=["От 1 000 ₽","До 1 000 000 000 ₽"],il=d((({field:e})=>o(Qa,{title:"Сумма, ₽",items:nl,min:1e3,max:1e9,...e("amount")}))),al=Ot((({field:e,source:t,fieldName:n,input:i,placeholder:a="Выберите из списка",options:l,...r})=>{const s=t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(En,{placeholder:a,options:s,...li(e(n),ti[n],i?.required),...r})})),ll=d((({field:e,input:t})=>{const{data:n}=qa("EMPLOYEES_NUMBER");return o(al,{field:e,source:n,label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),rl=d((({field:e,input:t})=>o(kn,{label:"Годовая выручка, ₽",...li(e("annualRevenue"),ti.annualRevenue,t?.required)}))),sl=d((({field:e,input:t})=>o(_i,{text:"Наличие военного билета",...li(e("armyIdFlg"),ti.armyIdFlg,t?.required)}))),ol=d((({field:e,input:t})=>o(kn,{label:"Код представителя Банка",placeholder:"Введите код",isInteger:!0,...li(e("bankEmployeeCode"),ti.bankEmployeeCode,t?.required),...t}))),cl=d((({field:e})=>o(kn,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e("bankEmpolee")}))),dl=d((({field:e,input:t})=>o(_i,{text:"В отношении меня ведётся производство по делу о банкротстве",...li(e("bankruptcyFlg"),ti.bankruptcyFlg,t?.required)}))),ml=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:i,currentYear:a,min:l,max:r,onDateClick:s})=>{const c=[];let d=1;for(let m=0;m<6;m++){const u=[];for(let c=0;c<7;c++)if(0===m&&c<t)u.push(o("td",{},`empty-${c}`));else if(d>n)u.push(o("td",{},`empty-${c}`));else{const t=new Date(a,i,d),n=ul(t,e),c=hl(t,l,r);u.push(o("td",{children:o("div",{className:pl(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},ul=(e,t)=>t&&e.toDateString()===t.toDateString(),hl=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),pl=(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"),gl=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],fl=d((({today:e,currentMonth:t,currentYear:n,min:i,max:a,onDateSelect:s=un,setValue:d=un})=>{const m=l((e=>{s(e),d(!1)}),[]),{firstDayOfWeek:u,totalDays:h}=r((()=>({firstDayOfWeek:new Date(n,t,1).getDay()-1,totalDays:new Date(n,t+1,0).getDate()})),[n,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:gl.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:ml({firstDayOfWeek:u,today:e,totalDays:h,currentYear:n,currentMonth:t,min:i,max:a,onDateClick:m})})]})})),xl=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function yl(e,t){const n=e.replace(/\D/g,"");if(""===n||e?.length===t.length)return e;const i=[...t],a=i.findIndex(bl),l=i.map(((e,t)=>Nl(e)?i.slice(0,t).filter(Nl).length:-1)),r=i.map(((e,t)=>vl(e)?e:n.charAt(l[t])||e)),s=l.indexOf(n.length-1)+1;return r.slice(0,Math.max(a,s)).join("")}const bl=e=>"_"===e,vl=e=>/\d/.test(e),Nl=e=>bl(e)||vl(e),wl=1940,Cl={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Sl=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:l,disabled:r,onChange:d,onClick:m})=>{const h=s(null),[p,g]=i(l||"");return a((()=>{g(l||"")}),[l]),c("div",{onClick:()=>{null!==h.current&&h.current.focus(),m?.()},className:u("relative",n),children:[o("input",{ref:h,className:"h-full w-full px-m text-l text-black focus-visible:outline-none",value:p,type:"text",onChange:e=>{const t=e.target?.value;"string"==typeof t&&t?.length<11&&g(yl(t,"__.__.____"))},onBlur:()=>{if(kl(p)){const[n,i,a]=p.split(".");d?.(new Date(Number(a),Number(i)-1,Number(n))),e(Number(i)-1),t(Number(a))}else g(l||"")},disabled:r}),r?null:o(W,{className:"mr-s",...Cl})]})})),kl=e=>{const[t,n,i]=e.split(".");if((e=>Number(e)>=wl&&Number(e)<=(new Date).getFullYear())(i)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(i),Number(n)-1,1);let a=0;for(;e.getMonth()===Number(n)-1;)e.setDate(e.getDate()+1),a++;if(Number(t)>0&&Number(t)<=a)return!0}return!1},Il=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:i,setSelectedMonth:a,setSelectedYear:l,disabled:r=!1})=>o(Sl,{onChange:i,disabled:r,onClick:e,value:t&&qt(t),setSelectedMonth:a,setSelectedYear:l,className:u("flex justify-between items-center h-14 border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",n?"border-gray":"border-error")}),Tl=xl.map((e=>({key:e}))),Bl=Array.from({length:(new Date).getFullYear()-wl+1},((e,t)=>wl+t)).reverse().map((e=>({key:String(e)}))),Pl=(e,t)=>{const n=new Date(e,t,1);let i=0;for(;n.getMonth()===t;)i++,n.setDate(n.getDate()+1);return i},Rl=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:i,onChange:a})=>{i&&a?.(new Date(t,n,Math.min(e,i.getDate())))},Dl={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Ml={className:"min-w-32",iconVersion:"black",isBorder:!1},Al=d((({className:e="",label:t="",value:n,valid:r=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g}]=on(!1),[f,x]=i(n?.getMonth()||(new Date).getMonth()),[y,b]=i(n?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:v,handleNextMonth:N,handleSelectMonth:w,handleSelectYear:C,monthsOptions:S,yearsOptions:k,handleChangeVisibleCalendar:I,ref:T}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:i,onYearSelect:a,selectedYear:r,onChange:s,value:o})=>{const c=dn(l((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:l((()=>e(!t)),[t]),handleNextMonth:l((()=>{n+1<=11?i(n+1):(i(0),a(r+1))}),[n]),handlePrevMonth:l((()=>{n-1>=0?i(n-1):(i(11),a(r-1))}),[n]),handleSelectMonth:l((({key:e})=>{i(xl.indexOf(e));const t=Pl(r,xl.indexOf(e));Rl({maxDateOfMonth:t,selectedYear:r,selectedMonth:xl.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:l((({key:e})=>{a(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:Tl,yearsOptions:Bl,ref:c}})({onYearSelect:b,onMonthSelect:x,onShowCalendar:g,selectedYear:y,selectedMonth:f,showCalendar:p,onChange:h,value:n}),B=((e,t)=>{const[n,l]=i(!1);return a((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();l(n>t)}};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e]),n})(T,370);return c("div",{className:u("space-y-xs",e),ref:T,children:[gn(t),c("div",{className:"relative",children:[Il({handleChangeVisibleCalendar:I,value:n,valid:r,onChange:h,disabled:m,setSelectedMonth:x,setSelectedYear:b}),p&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":B}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:v,children:o(W,{...Dl,className:"-rotate-90 cursor-pointer"})}),o(Dn,{onChange:w,value:{key:xl[f]},options:S,...Ml}),o(Dn,{onChange:C,value:{key:String(y)},options:k,...Ml}),o("div",{className:"my-auto",onClick:N,children:o(W,{...Dl,className:"rotate-90 cursor-pointer"})})]}),o(fl,{today:n,currentMonth:f,currentYear:y,onDateSelect:h,min:s,max:d,setValue:g})]}):null]})]})})),_l=d((({className:e,label:t,error:n,errors:i,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Al,{label:mn({label:t,errors:i}),valid:Boolean(!n),...a}),yn(n)]}))),El=d((({field:e,input:t})=>o(_l,{label:"Дата начала работы на текущем месте",...li(e("beginDate"),ti.beginDate,t?.required),...t}))),zl=d((({field:e,input:t})=>o(_l,{label:"Дата рождения",...li(e("birthday"),ti.birthday,t?.required)}))),Fl=d((({field:e,input:t})=>o(kn,{label:"Место рождения",...li(e("birthPlace"),ti.birthPlace,t?.required),...t,disabled:t?.filledByEsia&&Ci(e,"birthPlace")}))),Ol=e=>{try{return JSON.parse(String(e))}catch(e){return null}};function Vl(e){const t=globalThis.localStorage?.getItem(e),[n,a]=i(t?Ol(t):null);return[n,l((t=>{a((n=>{const i=t instanceof Function?t(n):t;return globalThis.localStorage?.setItem(e,JSON.stringify(i)),i}))}),[e])]}const Ll=d((({field:e,input:t})=>{const[n,l]=i([]),[r]=Vl("programId"),{value:s,onChange:c}=e("cardCategory"),d=e("paymentSystem").value;return a((()=>{d&&r&&(async()=>{const e=await(async(e,t)=>{const n=await ta("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemTypeCd:e,creditProgramId:t}});return Array.isArray(n)?n:[]})(d,r);l(e),$l(e,s)||c&&c(null)})()}),[d]),o(al,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t})})),$l=(e,t)=>e.some((e=>e.key===t?.key)),ql=d((({field:e,input:t})=>o(kn,{label:"Количество детей до 18 лет",placeholder:"Введите значение",isInteger:!0,...li(e("children"),ti.children,t?.required),...t}))),jl=d((({field:e,input:t})=>o(kn,{label:"Кодовое слово",...li(e("codeWord"),ti.codeWord,t?.required),...t}))),Ul=d((({field:e,input:t})=>o(kn,{label:"Количество объектов инкассации",isInteger:!0,...li(e("collectionCount"),ti.collectionCount,t?.required)}))),Wl=d((({field:e,input:t})=>o(kn,{className:"col-span-2",...li(e("comment"),ti.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),Hl=d((({field:e,input:t})=>{const{data:n}=qa("INCOME_CERT_UNITED");return o(al,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),Yl=d((({field:e,input:t})=>{const{data:n}=qa("MILITARY_STATUS");return o(al,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),Kl={processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3},consentToReceiveMaterials:{text:"Согласен на получение информационных и аналитических материалов по электронной почте"}};function Gl({disabled:e,onClick:t}){return n=>{!e&&t&&t(n)}}const Xl={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"},Jl={primary:u("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("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")},Zl=d((({children:e,...t})=>{const n=e=>({...e,onClick:ce(Gl(e))}),{className:i,version:a="primary",active:l,disabled:r,type:s="button",rounded:c=!0,role:d,onClick:m}=n(t);return o("button",{className:u("font-sans px-9 py-4","flex justify-center items-center gap-xs",{"text-white bg-primary-active":l,"bg-main-gray text-main-disabled cursor-not-allowed":r,"rounded-md":c},l||r?"":u(Xl[a],Jl[a]),i),type:s,role:d,onClick:m,children:e})})),Ql=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(W,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),er=d((({className:e,head:t,children:n,onClose:i,onClick:a})=>c("div",{className:u("relative bg-white pt-0 p-lg",e),role:"dialog",onClick:a,children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(Ql,{className:"absolute top-0 right-0",onClose:i}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]}))),tr=d((({src:e,convertToPng:t,onClose:n})=>c(er,{className:"my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0",onClose:n,children:[t?o("img",{src:e}):o("iframe",{src:`${e}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"}),o(Zl,{className:"mx-auto mt-m",type:"button",onClick:n,children:"Ознакомиться"})]}))),nr=e=>{const{open:t}=sn(tr),n=ke();return l((async()=>{if(e){const i=URL.createObjectURL(await(async(e,t=!1)=>{const n=await na(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return n?await n.blob():new Blob})(e,n));t({src:i})}}),[t,e,n])},ir=d((({className:e,error:t,docId:n,...i})=>{const a=nr(n);return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(Pi,{...i}),n?o(Ne,{className:"text-primary-main",onClick:a,children:o(_e,{children:"Ознакомиться"})}):null]}),yn(t)]})})),ar=d((({field:e,input:t})=>t&&t.name?o(ir,{text:Kl[t.name]?.text,docId:Kl[t.name]?.docId,...li(e(t.name),ti[t.name],t?.required)}):null)),lr=Math.round(29.5),rr=d((({className:e,title:t,children:n,...i})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...i,children:[t?o(N,{className:"text-center",title:t}):null,n]}))),sr="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",or="flex flex-col lg:w-1/2 gap-2xl",cr="flex flex-col gap-y-xl min-w-52",dr=d((({value:e,fractionDigits:t,fixed:n,prefix:i,postfix:a})=>o(_e,{size:"text-h3",children:"number"==typeof e?[i,He(t,{fixed:n})(e),a].filter(Boolean).join(" "):e}))),mr=d((({className:e,title:t,value:n,color:i="text-secondary-text",...a})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(_e,{size:"text-l",font:"font-light",color:i,children:t}):null,n?o(dr,{value:n,...a}):o(_e,{size:"text-h3",children:"-"})]}))),ur=(e=[],t=!1)=>hr([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),hr=(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]},pr=(e,t=0)=>e?.sum?e.sum:t,gr=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,fr=(e,t)=>e?o(w,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,xr=({min:e=0,max:t=0,availableMonths:n,...i})=>o(Qa,{items:[`От ${yr(e)}`,`До ${yr(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...i}),yr=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,br={horizontal:"@lg:flex-row",vertical:""},vr=d((({label:e,items:t,value:n,className:i,onChange:a,disabled:l=!1,orientation:r="horizontal"})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(_e,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",br[r],i),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(Pi,{isRadio:!0,text:t,value:n===e,onChange:()=>a&&a(e),disabled:l},String(e))))})]}))),Nr=({items:e,title:t,mobileTitle:n=t,orientation:i="horizontal",value:a,onChange:l,...r})=>c("div",{className:"grid gap-s whitespace-nowrap",children:[t?o("div",{className:"hidden @5xl:block",role:"radiogroup","aria-label":t,children:o(_e,{color:"text-secondary-text",font:"font-light",children:t})}):null,n?o("div",{className:"@5xl:hidden",role:"radiogroup","aria-label":n,children:o(_e,{color:"text-secondary-text",font:"font-light",children:n})}):null,o(vr,{orientation:i,items:e,value:e[a?0:1].id,onChange:t=>l&&l(t===e[0].id),...r})]}),wr=e=>Nr({...e,className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Cr=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...i})=>o(Qa,{items:e?[`От ${He(1)(i.min||0)} ${n}`,`До ${He(1)(i.max||0)} ${n}`]:[],step:t,...i}),Sr=({field:e,defParams:t,calcParams:n,map:i,monthsValue:a="maxMonths"})=>{Object.entries(i).forEach((([n,i])=>{e?.(n)?.onChange?.(t?.[i])})),e?.("monthsValue")?.onChange?.(Ka(t?.[a],n.minMonths,n.maxMonths))},kr=(e,t)=>{const{isAnnuity:n,moneyValue:i,monthsValue:a,moneyExtra:l}=t;if(0===e)return 0;if(n){const t=e/1200;return l?(i+l)*(t+t/(Math.pow(1+t,a)-1)):i*(t+t/(Math.pow(1+t,a)-1))}return Math.round(i/a)+i*(e/1200)},Ir=e=>e,Tr=(e=Ir)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),Br=Tr(),Pr=(e=Ir)=>Tr((t=>-e(t))),Rr=Pr(),Dr=([e,t],n,i=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:Mr([e,t],i),Mr=([e,t],n=[])=>({[e]:n.length?Rr(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?Br(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),Ar=(e,[t,n],i)=>e>=i[t]&&e<=i[n],_r={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Er=e=>zr({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&zr({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&zr({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&zr({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),zr=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:i,viewSettingFieldKey:a})=>!!n&&!n[a]||t[i]===e[i],Fr=(e,t,n)=>{const{moneyValue:i,monthsValue:a}=e,l=t?.rateRows||[_r],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Er({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Dr(["minSum","maxSum"],r,l),{minMonths:c,maxMonths:d}=Dr(["minMonths","maxMonths"],r,l),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:i,monthsValue:a})=>e?.find((e=>Er({row:e,userInputParams:t,paramsViewSettings:n})&&Ar(i,["minSum","maxSum"],e)&&Ar(a,["minMonths","maxMonths"],e)))||_r)({rateRows:l,userInputParams:e,paramsViewSettings:n,moneyValue:i,monthsValue:a}),{rate:u}=m,h=kr(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:i,monthsValue:a,monthlyPayment:h}},Or=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),Vr={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},Lr=Ot((({className:e,title:t,calcSource:n,buttons:i,footnote:l,paramsViewSettings:r,defaultParams:s,onChange:d,...m})=>{const h=(p=n?.rateRows,hr([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],p));var p;const[g,{field:f,isDirty:x}]=an({moneyValue:pr(s,2e5),monthsValue:gr(s,lr),isAnnuity:Boolean(s?.isAnnuity),isInsurance:Boolean(s?.isEnableInsurance),isSalaryClient:Boolean(s?.isEnableSalaryClient),isPensionClient:Boolean(s?.isEnablePensionClient),isStateEmployee:Boolean(s?.isEnableStateEmployee)});a((()=>{x&&d?.(g)}),[g,x]);const y=Fr(g,n,r),b=wr({title:"Тип платежа",orientation:"vertical",...f("isAnnuity")}),{onChange:v}=f("moneyValue"),{onChange:N}=f("monthsValue");return a((()=>{v&&v(Ka(g.moneyValue,y.minSum,y.maxSum))}),[y.minSum,y.maxSum]),a((()=>{N&&N(Ka(g.monthsValue,y.minMonths,y.maxMonths))}),[y.minMonths,y.maxMonths]),a((()=>{!Or(s)&&h&&Sr({field:f,defParams:h,calcParams:y,map:Vr,monthsValue:"minMonths"})}),[n,s]),o(rr,{className:e,title:t,...m,children:c("section",{className:u(sr,e),children:[c("div",{className:or,children:[Cr({title:"Сумма кредита, ₽",step:500,min:y.minSum,max:y.maxSum,...f("moneyValue"),value:y.moneyValue}),xr({title:"Срок кредита, месяцев",min:y.minMonths,max:y.maxMonths,...f("monthsValue"),value:y.monthsValue}),$r({...y,...r},f),o("div",{className:"sm:hidden",children:b})]}),c("div",{className:u(cr,"@4xl:w-1/2"),children:[o(mr,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(mr,{title:"Ставка",value:y?.rate,fractionDigits:2,postfix:"%"}),o(mr,{title:"Ежемесячный платёж",value:y.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:b}),qe(i,{isVertical:!0}),fr(l)]})]})})})),$r=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(Pi,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(Pi,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(Pi,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(Pi,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),qr={moneyValue:"sum",monthsValue:"period",isInsurance:"isEnableInsurance",isPensionClient:"isEnablePensionClient",isStateEmployee:"isEnableStateEmployee",isSalaryClient:"isEnableSalaryClient",isAnnuity:"isAnnuity"},jr=(e,t=!1)=>{const n=t?Ur(qr):qr;return Object.fromEntries(Object.entries(e??{}).map((([e,t])=>[n[e],t])))},Ur=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[t,e]))),Wr="calculator",Hr=d((({field:e,params:t})=>{const n=l((t=>{e(Wr).onChange?.(t)}),[]);return o(Lr,{...t?.calcData,padding:"p-0",defaultParams:jr(e(Wr).value),onChange:n})})),Yr=d((({field:e,input:t})=>{const{data:n}=qa("CREDIT_IN_RSHB");return o(al,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /\n вкладчиком с долей участия более 20% уставного капитала руководителем,\n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t,disabled:!e?.("shareholderFlg")?.value})})),Kr=d((({className:e,label:t,onChange:n,error:i,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(vr,{label:mn({label:t,errors:a?.errors}),onChange:e=>n&&n(e),...a}),yn(i)]}))),Gr=[{id:"810",text:"Рубли"}],Xr=d((({field:e,input:t})=>{const{value:n,onChange:i}=e("currency"),{data:a}=qa("CURRENCY"),l=a?.map((e=>({id:e.key,text:e.value})))??Gr;return o(Kr,{label:"Валюта",orientation:"horizontal",items:l,value:n,onChange:e=>i?.(e),...li(e("currency"),ti.currency,t?.required)})})),Jr=d((({field:e,input:t})=>o(_l,{label:"Дата доставки",...li(e("deliveryDate"),ti.deliveryDate,t?.required)}))),Zr=d((({field:e,input:t})=>o(kn,{label:"Количество иждивенцев",placeholder:"За исключение детей до 18 лет",isInteger:!0,maxLength:2,...li(e("dependents"),ti.dependents,t?.required),...t}))),Qr=d((({field:e,input:t})=>o(_l,{label:"Желаемая дата встречи",...li(e("desiredMeetingDate"),ti.meetingDay,t?.required)}))),es=d((({field:e,input:t})=>o(_i,{text:"Являюсь инвалидом",...li(e("disablePeopleFlg"),ti.disablePeopleFlg,t?.required)}))),ts="dulIssueDateField",ns=d((({field:e,input:t})=>o(_l,{label:"Дата выдачи",...li(e(ts),ti.dulIssueDateField,t?.required),disabled:t?.filledByEsia&&Ci(e,ts)}))),is="dulIssuedBy",as=d((({field:e,input:t})=>{const{value:n,onChange:i}=e("dulSubdivisionCode"),a=l((e=>{i?.(e?.data?.code?.replace("-",""))}),[]);return o(kn,{disabled:t?.filledByEsia&&Ci(e,is),label:"Кем выдан",...t,...li(e(is),ti.dulIssuedBy,t?.required),onDaDataChange:a,daDataQueryPrefix:n})})),ls=d((({field:e,input:t})=>o(kn,{disabled:t?.filledByEsia&&Ci(e,"dulNumber"),label:"Номер документа",isInteger:!0,maxLength:6,...li(e("dulNumber"),ti.dulNumber,t?.required)}))),rs=d((({field:e,input:t})=>o(kn,{disabled:t?.filledByEsia&&Ci(e,"dulSerie"),label:"Серия документа",isInteger:!0,maxLength:4,...li(e("dulSerie"),ti.dulSerie,t?.required)}))),ss="dulSubdivisionCode",os=d((({field:e,input:t})=>{const n=l((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(kn,{disabled:t?.filledByEsia&&Ci(e,ss),label:"Код подразделения",isInteger:!0,maxLength:6,...t,...li(e(ss),ti.dulSubdivisionCode,t?.required),onDaDataChange:n})})),cs=d((({field:e,input:t})=>{const{data:n}=qa("EDUCATION_LEVEL");return o(al,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),ds=d((({field:e,input:t})=>{const{required:n,...i}=t;return o(kn,{label:"Электронная почта",...li(e("email"),ti.email,n),...i})})),ms=d((({field:e,input:t})=>{const{data:n}=qa("ORGANIZATION_ACTIVITY_TYPE");return o(al,{field:e,source:n,label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),us=d((({field:e,input:t})=>{const{data:n}=qa("ORGANIZATION_KIND");return o(al,{field:e,source:n,label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),hs=d((({field:e,input:t})=>{const{data:n}=qa("EMPLOYMENT_INFO_UNITED");return o(al,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),ps=d((({field:e,input:t})=>o(kn,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",isInteger:!0,...li(e("expenses"),ti.expenses,t?.required),...t}))),gs=d((({field:e,input:t})=>o(kn,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",maxLength:2,...li(e("experience5Years"),ti.experience5Years,t?.required),...t}))),fs=d((({field:e})=>{const{value:t,onChange:n}=e("familyMembers"),i=e("familyStatus")?.value?.key,l="MARRIED"===i?2:1,r=Number(e("children")?.value),s=Number(e("dependents")?.value),c=l+r+s;return a((()=>{e?.("familyMembers")?.onChange?.(c)}),[i,r,s]),o(kn,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:t,onChange:e=>n?.(e)})})),xs=d((({field:e,input:t})=>{const{data:n}=qa("MARITAL_STATUS");return o(al,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),ys=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],bs=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],vs=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],Ns=d((({field:e,input:t})=>o(En,{label:"Способ получения ответа",options:vs,...li(e("feedbackMethod"),ti.feedbackMethod,t?.required)}))),ws=d((({field:e,input:t})=>o(kn,{label:"ФИО",...li(e("fullName"),ti.fullName,t?.required),...t}))),Cs=d((({field:e,input:t})=>o(kn,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...li(e("generalSeniority"),ti.generalSeniority,t?.required),...t}))),Ss=d((({field:e,input:t})=>{const{data:n}=qa("HOUSE_TYPE");return o(al,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),ks=d((({field:e,input:t})=>{const n=l((t=>{e?.("organizationAddress")?.onChange?.(ki(t.data?.address)),e?.("organizationName")?.onChange?.(t.data?.name?.short_with_opf),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(kn,{label:"ИНН",isInteger:!0,maxLength:12,...t,...li(e("inn"),ti.inn,t?.required),onDaDataChange:n})})),Is=d((({field:e})=>o(_i,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),Ts=d((({field:e,input:t})=>o(kn,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",isInteger:!0,maxLength:2,...li(e("jobsNumber"),ti.jobsNumber,t?.required),...t}))),Bs=d((({field:e,input:t})=>o(kn,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...li(e("lastJobExperience"),ti.lastJobExperience,t?.required),...t}))),Ps=d((({field:e,input:t})=>o(kn,{label:"Наименование юридического лица",...t,...li(e("legalEntityName"),ti.legalEntityName,t?.required),disabled:!e?.("shareholderFlg")?.value}))),Rs=d((({field:e,input:t})=>o(kn,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...li(e("legalForm"),ti.legalForm,t?.required),...t}))),Ds="limitedBirthday",Ms=d((({field:e,input:t})=>o(_l,{label:"Дата рождения",...li(e(Ds),ti.limitedBirthday,t?.required),disabled:t?.filledByEsia&&Ci(e,Ds)}))),As=`${Ut}/outservice`,_s=[];async function Es(){const e=await Rt(`${As}/outserviceregions`);return e&&Array.isArray(e)?e:_s}const zs=d((({field:e,input:t})=>{const n=e("region"),i=n?.value?.key,{data:l}=gi("outServiceRegions",Es),r=l?.find((e=>e.code===i))?.localities?.map((e=>({key:e,text:e})));return a((()=>{""!==i&&e?.("localities")?.onChange?.("")}),[i]),o(En,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:r,...li(e("localities"),ti.localities,t?.required),isSearch:!0})})),Fs=d((({field:e,input:t})=>o(kn,{label:"Обязательные выплаты",placeholder:"Введите значение",isInteger:!0,...li(e("mandatoryPayments"),ti.mandatoryPayments,t?.required),...t}))),Os=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],Vs=d((({field:e,input:t})=>o(Kr,{orientation:"horizontal",items:Os,...li(e("methodObtain"),ti.methodObtain,t?.required)}))),Ls="middleName",$s=d((({field:e,input:t})=>o(kn,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&Ci(e,Ls),...li(e(Ls),ti.middleName,t?.required),...t}))),qs=d((({field:e,input:t})=>o(kn,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&Ci(e,t.name??""),...li(e("name"),ti.name,t?.required),...t}))),js=d((({value:e=!1,text:t,type:n="checkbox",onChange:i})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>i&&i(!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(_e,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),Us=d((({field:e})=>oi(e("acquiringType")?.value?.key)?o(js,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),Ws=d((({field:e,input:t})=>{const{data:n}=qa("ORGANIZATION_TYPE");return o(al,{field:e,source:n,label:"Тип организации",fieldName:"organization",input:t})})),Hs=d((({field:e,input:t})=>{const n=l((t=>{e?.("inn")?.onChange?.(t.data?.inn),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(kn,{label:"Наименование организации",...t,...li(e("organizationName"),ti.organizationName,t?.required),onDaDataChange:n})})),Ys=d((({field:e,input:t})=>o(kn,{label:"Иные доходы",placeholder:"Введите значение",isInteger:!0,...li(e("otherIncome"),ti.otherIncome,t?.required),...t}))),Ks=d((({field:e,input:t})=>o(_l,{label:"Дата регистрации по месту жительства",...li(e("participantDateRegistration"),ti.participantDateRegistration,t?.required)}))),Gs="partInBusiness",Xs=d((({field:e,input:t})=>{const n=l((t=>{e(Gs)?.onChange?.(String(Number(t)>100?100:Number(t)||""))}),[]);return o(kn,{label:"Доля участия в бизнесе",placeholder:"в %",isInteger:!0,maxLength:3,...li(e(Gs),ti.partInBusiness,t?.required),...t,onChange:n})})),Js=d((({field:e,input:t})=>{const{required:n,...i}=t;return o(kn,{...li(e("partnerComments"),ti.partnerComments,n),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...i})})),Zs=d((({field:e,input:t})=>{const{value:n,onChange:l}=e("paymentSystem"),[r]=Vl("programId"),[s,c]=i([]);return a((()=>{r&&(async()=>{const e=await(async e=>{const t=await ta("/public-data/creditProgramConditions","POST",{creditProgramId:e});return t?.paymentSystems?.map((e=>({id:e.type,text:e.name})))??[]})(r);c(e||[])})()}),[]),o(Kr,{label:"Платежная система",orientation:"horizontal",items:s,value:n,onChange:e=>l?.(e),...li(e("paymentSystem"),ti.paymentSystem,t?.required)})})),Qs=e=>"_"===e,eo=e=>/\d/.test(e),to=e=>Qs(e)||eo(e),no=[..."+7 (___) ___-__-__"],io=no.findIndex(Qs),ao=no.map(((e,t)=>to(e)?no.slice(0,t).filter(to).length:-1));function lo(e){const t=e.replace(/\D/g,""),n=no.map(((e,n)=>eo(e)?e:t.charAt(ao[n])||e)),i=ao.indexOf(t.length-1)+1;return(i?n.slice(0,Math.max(io,i)):n).join("")}const ro=d((({children:e,onChange:t,...n})=>{const i=l((e=>t&&t(lo(e))),[t]),a=l((e=>{"+7 ("===e&&t&&t("")}),[]);return o(fn,{...n,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>a(e?.target?.value||""),children:e})})),so=d((({className:e,label:t,error:n,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ro,{"aria-label":t,label:mn({label:t,errors:i?.errors}),valid:Boolean(!n),placeholder:"+7 (___) ___-__-__",...i}),yn(n)]}))),oo=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(so,{label:"Телефон",...li(e(n),ti.phone,t?.required),disabled:t?.filledByEsia&&Ci(e,n),...t})})),co=d((({field:e,input:t})=>{const{data:n}=qa("POSITION");return o(al,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),mo=d((({field:e})=>oi(e("acquiringType")?.value?.key)?o(js,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),uo=d((({field:e,source:t})=>o(En,{placeholder:"Выберите продукт",label:"Продукт",options:ho(t?.productList),...ai(e("product"),ti.product)}))),ho=e=>(e??[]).map((e=>({key:e,value:e}))),po=`${Ut}/outservice/outserviceregions`,go=`${Ut}/regions`,fo=[];function xo(e=go){const{data:t}=gi(e,Dt);return Array.isArray(t)?t:fo}const yo=d((({field:e,input:t,params:n})=>{var i;const a=xo((i=n?.typeForm,"OUTSERVICE"===i?po:void 0));return o(En,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>a?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[a]),...li(e("region"),ti.region,t?.required)})})),bo=d((({field:e,input:t})=>{const n=vi(!0),i=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(En,{label:"Регион",placeholder:"Выберите регион",options:i,...li(e("region"),ti.region,t?.required)})})),vo=d((({field:e,input:t})=>{const{data:n}=qa("REGION_RF"),i=n?.map((({key:e,value:t})=>({key:e,text:t})));return o(En,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:i,...li(e("regionRetail"),ti.regionRetail,t?.required)})})),No=d((({field:e,input:t})=>{const n=e("wages")?.value,i=l((t=>{const i=Number(t)+Number(n||0);e("retirementIncome")?.onChange?.(t),e("incomeAverage")?.onChange?.(String(i))}),[n]);return o(kn,{label:"Пенсионные доходы",placeholder:"Введите значение",isInteger:!0,...li(e("retirementIncome"),ti.retirementIncome,t?.required),...t,onChange:i})})),wo=d((({field:e})=>{const t=e("secondaryPhone");return o(so,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?ai(t,ti.secondaryPhone):t})})),Co=d((({field:e,input:t})=>o(En,{label:"Направление обслуживания",placeholder:"Выберите направление",options:bs,...li(e("serviceDirection"),ti.serviceDirection,t?.required)}))),So=["male","female"],ko=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],Io=d((({field:e,input:t})=>{const n=e("name")?.value,{value:i,onChange:l}=e("sex");return a((()=>{n&&!i&&(async()=>{const e=await(async e=>{const t=await ta("/suggestions/suggest/fio","POST",{query:e,count:1,parts:["NAME"]}),n=t?.suggestions[0]?.data?.gender?.toLowerCase()||"";return So.includes(n)?n:""})(n);e&&l?.(e)})()}),[]),o(Kr,{label:"Пол",orientation:"horizontal",items:ko,...li(e("sex"),ti.sex,t?.required)})})),To=d((({field:e,input:t})=>o(_i,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...li(e("shareholderFlg"),ti.shareholderFlg,t?.required)}))),Bo=d((({children:e,onChange:t,...n})=>{const i=l((e=>t&&t(yl(e,"___-___-___ __"))),[t]),a=l((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(fn,{...n,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>a(e?.target?.value||""),children:e})})),Po=d((({className:e,label:t,value:n,error:i,onChange:a,onBlur:l,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Bo,{"aria-label":t,label:mn({label:t,errors:r?.errors}),valid:Boolean(!i),value:n,onChange:a,onBlur:l,placeholder:"___-___-___ __"}),yn(i)]}))),Ro=d((({field:e,input:t})=>o(Po,{label:"СНИЛС",...li(e("snils"),ti.snils,t?.required),...t}))),Do=d((({field:e,input:t})=>o(kn,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&Ci(e,"surname"),...li(e("surname"),ti.surname,t?.required),...t}))),Mo=["От 1 мес","До 15 лет"],Ao=d((({field:e})=>o(Qa,{title:"Срок, месяцев",items:Mo,min:1,max:180,...e("term")}))),_o=d((({field:e,input:t})=>o(kn,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...li(e("totalIncome"),ti.totalIncome,t?.required),...t}))),Eo=d((({field:e,input:t})=>o(En,{label:"Тип обслуживания",options:ys,...li(e("serviceType"),ti.serviceType,t?.required)}))),zo=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],Fo=d((({field:e})=>{const{value:t,onChange:n}=e("vedTypes");return a((()=>{"currencyControl"!==t&&(e?.("inn")?.onChange?.(""),e?.("region")?.onChange?.(""))}),[t]),o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(vr,{className:"whitespace-normal",orientation:"horizontal",items:zo,value:t,onChange:e=>n&&n(e)})})})),Oo=d((({field:e,input:t})=>{const n=e("retirementIncome")?.value,i=l((t=>{const i=Number(t)+Number(n||0);e("wages")?.onChange?.(t),e("incomeAverage")?.onChange?.(String(i))}),[n]);return o(kn,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...li(e("wages"),ti.wages,t?.required),...t,onChange:i})}));const Vo={$ref:"/wcms-resources/outservice-productlist.json"},Lo=(e,t)=>(n,i)=>{const a="ULTRASERVICE"===t?.typeForm||"PREMIUMSERVICE"===t?.typeForm,l={surname:o(Do,{field:e,input:n}),name:o(qs,{field:e,input:n}),middleName:o($s,{field:e,input:n}),phone:o(oo,{field:e,input:n}),organizationPhone:o(oo,{field:e,input:n}),email:o(ds,{field:e,input:n}),fullName:o(ws,{field:e,input:n}),inn:o(ks,{field:e,input:n}),legalForm:o(Rs,{field:e,input:n}),organizationName:o(Hs,{field:e,input:n}),generalSeniority:o(Cs,{field:e,input:n}),lastJobExperience:o(Bs,{field:e,input:n}),experience5Years:o(gs,{field:e,input:n}),jobsNumber:o(Ts,{field:e,input:n}),beginDate:o(El,{field:e,input:n}),addressFact:o(wi,{field:e,input:n}),organizationAddress:o(Si,{field:e,input:n}),comment:o(Wl,{field:e,input:n}),addressBranch:o(Ni,{field:e,input:n,isPremium:a}),sex:o(Io,{field:e,input:n}),birthday:o(zl,{field:e,input:n}),limitedBirthday:o(Ms,{field:e,input:n}),birthPlace:o(Fl,{field:e,input:n}),desiredMeetingDate:o(Qr,{field:e,input:n}),product:o(uo,{field:e,source:Vo}),localities:o(zs,{field:e,input:n}),isClient:o(Is,{field:e}),partnerComments:o(Js,{field:e,input:n}),collectionCount:o(Ul,{field:e,input:n}),acquiringType:o(si,{field:e,input:n}),onlineCheckout:o(Us,{field:e}),posTerminal:o(mo,{field:e}),serviceType:o(Eo,{field:e,input:n}),term:o(Ao,{field:e}),amount:o(il,{field:e}),annualRevenue:o(rl,{field:e,input:n}),vedTypes:o(Fo,{field:e}),feedbackMethod:o(Ns,{field:e,input:n}),serviceDirection:o(Co,{field:e,input:n}),bankEmpolee:o(cl,{field:e}),secondaryPhone:o(wo,{field:e}),consentToReceiveMaterials:o(ar,{field:e,input:n}),processPersonalDataFlg:o(ar,{field:e,input:n}),consentProviderFlg:o(ar,{field:e,input:n}),consentOthersFlg:o(ar,{field:e,input:n}),consentInformFlg:o(ar,{field:e,input:n}),consentPfrFlg:o(ar,{field:e,input:n}),applicationDate:o(kn,{label:"Дата и время обращения в Банк",...e("applicationDate")}),region:a?o(bo,{field:e}):o(yo,{field:e,input:n,params:t}),education:o(cs,{field:e,input:n}),housing:o(Ss,{field:e,input:n}),employment:o(hs,{field:e,input:n}),organization:o(Ws,{field:e,input:n}),amountWorkers:o(ll,{field:e,input:n}),employerActivities:o(ms,{field:e,input:n}),employerOrganization:o(us,{field:e,input:n}),positionOrganization:o(co,{field:e,input:n}),familyStatus:o(xs,{field:e,input:n}),children:o(ql,{field:e,input:n}),familyMembers:o(fs,{field:e,input:n}),dependents:o(Zr,{field:e,input:n}),totalIncome:o(_o,{field:e,input:n}),expenses:o(ps,{field:e,input:n}),snils:o(Ro,{field:e,input:n}),conscription:o(Yl,{field:e,input:n}),armyIdFlg:o(sl,{field:e,input:n}),dulSerie:o(rs,{field:e,input:n}),dulNumber:o(ls,{field:e,input:n}),dulIssueDateField:o(ns,{field:e,input:n}),dulSubdivisionCode:o(os,{field:e,input:n}),dulIssuedBy:o(as,{field:e,input:n}),addressRegistration:o(Si,{field:e,input:n}),addressCourier:o(Si,{field:e,input:n}),participantDateRegistration:o(Ks,{field:e,input:n}),retirementIncome:o(No,{field:e,input:n}),otherIncome:o(Ys,{field:e,input:n}),wages:o(Oo,{field:e,input:n}),mandatoryPayments:o(Fs,{field:e,input:n}),disablePeopleFlg:o(es,{field:e,input:n}),bankruptcyFlg:o(dl,{field:e,input:n}),shareholderFlg:o(To,{field:e,input:n}),legalEntityName:o(Ps,{field:e,input:n}),creditInRshbCd:o(Yr,{field:e,input:n}),bankEmployeeCode:o(ol,{field:e,input:n}),partInBusiness:o(Xs,{field:e,input:n}),regionRetail:o(vo,{field:e,input:n}),addressRetail:o(Ha,{field:e,input:n}),addressMatch:o(Ei,{field:e,input:n}),paymentSystem:o(Zs,{field:e,input:n}),currency:o(Xr,{field:e,input:n}),cardCategory:o(Ll,{field:e,input:n}),codeWord:o(jl,{field:e,input:n}),confirmationIncome:o(Hl,{field:e,input:n}),methodObtain:o(Vs,{field:e,input:n}),deliveryDate:o(Jr,{field:e,input:n}),calculator:o(Hr,{field:e,params:t})};return function({input:e,field:t}){const{condition:n}=e,{value:i}=t(n?.name||"");return!n||n?.values?.find((e=>e===(i?.key??i)))}({input:n,field:e})?o("div",{children:l[n?.name||""]},String(i)):null},$o=e=>2===e?"@xl:grid-cols-2":"",qo=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(_e,{size:"text-h6",children:e})}):null,jo=d((({responseType:e,typeForm:t,onClose:n})=>{const i="OK"===e,a="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(er,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto",onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ne,{image:{icon:i?"ResponseOKIcon":"ResponseFailIcon",iconVersion:"normal"},width:"136",height:"136"}),o(S,{className:"w-full",title:i?"Ваша заявка отправлена":"Не удалось отправить заявку",description:i?a:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(Zl,{type:"button",onClick:n,children:"Хорошо"})]})})})),Uo=e=>t=>t&&Object.entries(e).flatMap((([e,n])=>n(t[e])))||[],Wo=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:i,amount:a,term:l,annualRevenue:r,serviceType:s,vedTypes:o,region:c,...d}=e,m=t||r?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:i=!1,term:a,amount:l,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${oi(t?.key)?`/Онлайн касса=${n}/POS-терминал=${i}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${l}/Срок=${a}/Выручка=${r}`})(e):null,u={...d,...Yo(o),...Ho(c),...m?{partnerComments:m}:{},...s?{typeForm:s}:{}};return Object.fromEntries(Object.entries(u)?.map((([e,t])=>[e,t?.key||t])))},Ho=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},Yo=e=>e?{vedTypes:Object.fromEntries(zo.map((({id:t})=>[t,t===e])))}:{},Ko={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:ri[0],serviceType:ys[0],feedbackMethod:vs[0],serviceDirection:bs[0],vedTypes:zo[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},Go=d((({text:e,link:t})=>c(w,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(_e,{children:e}):null,t?o(Ne,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"!text-left text-primary-main",children:o(_e,{children:t.text})}):null]}))),Xo=(e,t)=>o(Zl,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Jo=(e,t,n)=>c("div",{className:"flex col-span-2 gap-xs flex-col w-full items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3 items-center",children:[o(Pi,{...e}),o(Go,{link:t})]}),yn(ai(e,Kn).error)]}):o(Go,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),Xo(n)]}),Zo={send:async function(e,t=!1){const{typeForm:n,region:i,phone:a="",email:l,birthday:r,desiredMeetingDate:s,inn:o,addressBranch:c,secondaryPhone:d="",bankEmpolee:m,applicationDate:u,serviceDirection:h,...p}=e,g=t&&"Юридическое лицо / ИП"!==h,f=`${Ut}${g?"/lead":"/sendcorporatelead"}`,x={typeForm:n,...Yt(i,g),...Kt(l,g),...Wt(a),...Ht(s,"desiredMeetingDate"),...g?Ht(r):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...Gt(d)},...p};try{const e=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(x)});return e?.ok?await e.json():null}catch(e){return null}}},Qo=d((({className:e,title:t,typeForm:n="",sections:r=[],button:s,link:d,endpoint:m,additionalParams:h,isContacts:p,data:g,...f})=>{const x=r?.flatMap((e=>e?.inputs))||[],y=((e,t="")=>{const n=Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||Ko[e.name||""]])));return n?.serviceType&&"PREMIUMSERVICE"===t&&(n.serviceType=ys[1]),{...n,typeForm:{key:t,text:""}}})(x,n),[b,v]=i(""),w=sn(jo),C=l((async(e,t)=>{const i=ec(x,e),a=Uo(ii(i));if(!zn(a(e)))return console.warn("validation fail");const l=Wo({...e,...h}),r=await Zo.send(l,"lead"===m)?"OK":"Fail";if(v(r),r&&w.open({typeForm:n,responseType:r}),"OK"===r&&g){const e=tn();Xt({aspectsAttributes:g,aspects:e,ev:t})}return r}),[n]),[,{field:S,onSubmit:k,reset:I}]=an(y,{onSubmit:C}),T=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(x)?.name;return a((()=>{"OK"===b&&(v(""),I())}),[b]),c(rn,{className:u("container space-y-m",e),title:t,...f,children:[c("form",{onSubmit:k,children:[r.map(((e,t)=>c("div",{className:u($o(e.columns),"grid gap-x-m"),children:[qo(e.title),(e?.inputs||[])?.map(Lo(S,{typeForm:n}))]},`section-${t}`))),Jo(T?S("consentDataProcessing"):void 0,d,s)]}),p?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(ne,{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(ne,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),ec=(e,t)=>e.filter((e=>"secondaryPhone"===e?.name?Boolean(t.secondaryPhone):e)).filter((e=>!e?.condition||e?.condition.values.find((n=>{const i=t?.[e?.condition?.name??""];return n===(i?.key??i)})))),tc=d((({inputs:e=[],typeForm:t="",field:n,key:i})=>{const a=e.every((e=>Boolean(n(e.name).value))),l=r((()=>e?.filter((e=>e.required))?.some((e=>Boolean(ai(n(e?.name),ti[e?.name]).error)))),[e]);return o("div",{className:"w-fit",children:o(la,{isFoldButtonOnTop:!0,unfoldedByDefault:!0,renderFoldableSection:({isUnfolded:i})=>o(ra,{isUnfolded:i,className:"flex flex-col pl-2xl",children:e.map(Lo(n,{typeForm:t}))}),renderFoldButton:nc(c("div",{children:[o(Pi,{value:a,onChange:t=>{for(const i of e){const e=n(i.name);e?.onChange&&e.onChange(t)}},text:"Согласие на все документы"},i),yn(l?"Отметьте все обязательные соглашения":"")]}))})})})),nc=e=>t=>c("div",{className:"flex items-start",children:[e,o("button",{onClick:t.onToggle,className:"px-m py-2xs",type:"button",children:o(W,{className:"text-primary-text",name:t.isUnfolded?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})})]}),ic=({field:e,typeForm:t="",inputs:n})=>{const{consentInputs:i,restInputs:a}=ac(n||[]);return i.length>2?c("div",{children:[a.map(Lo(e,{typeForm:t})),o(tc,{inputs:i,field:e})]}):(n||[])?.map(Lo(e,{typeForm:t}))},ac=e=>({consentInputs:e?.filter((e=>Object.keys(Kl).includes(e.name||"")))||[],restInputs:e?.filter((e=>!Object.keys(Kl).includes(e.name||"")))||[]}),lc=[{columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0},{fieldType:"common",name:"name",required:!0,dadata:!0},{fieldType:"common",name:"middleName",dadata:!0},{fieldType:"common",name:"limitedBirthday",required:!0},{fieldType:"common",name:"phone",required:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{inputs:[{fieldType:"common",name:"processPersonalDataFlg",required:!0},{fieldType:"common",name:"consentProviderFlg",required:!0},{fieldType:"common",name:"consentOthersFlg",required:!0},{fieldType:"common",name:"consentInformFlg"},{fieldType:"common",name:"consentPfrFlg"}]}],rc={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",organizationPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:ri[0],serviceType:ys[0],feedbackMethod:vs[0],serviceDirection:bs[0],vedTypes:zo[0],birthday:void 0,limitedBirthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,addressRegistration:"",participantDateRegistration:void 0,currency:"",paymentSystem:"",cardCategory:{key:"",text:""},codeWord:"",addressRetail:{key:"",text:""}},sc=(e,t,n="")=>{if(t){const e={...t};return e.limitedBirthday=new Date(e?.limitedBirthday||0),e}return{...Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||rc[e.name||""]]))),typeForm:{key:n,text:""}}},oc=(e,t)=>o(Zl,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),cc=e=>na("/user-data/updateUserProfile","PUT",e),dc=e=>na("/user-data/updateUserTask","PUT",e),mc=(e,t)=>Boolean(e)&&"string"!=typeof e&&Boolean(e?.errorMessage.startsWith(`Too many request for phoneNumber [${t}]`)),uc={width:"118",height:"24"},hc={"bg-white":"color",transparent:"white"},pc={"bg-white":"text-primary-main",transparent:"text-white"},gc=(e,t,n)=>o(ne,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:hc[e]},className:pc[e],width:n?.width,height:n?.height}),fc={"bg-white":"text-primary-text",transparent:"text-white"},xc=d((({className:e,href:t="/",logo:n,children:i,targetBlank:a,bgColor:l="bg-white",showTitle:r=!0,data:s})=>c("a",{className:u("inline-flex items-center font-sans no-underline",e),href:n?.href??t,target:a?"_blank":"_self","aria-label":n?.title??"Россельхозбанк",...fe(s),children:[gc(l,n?.image,uc),r?i??o("div",{className:"ml-s",children:o(_e,{font:"font-medium",color:fc[l],size:"",children:n?.title??"Россельхозбанк"})}):null]}))),yc=d((({phoneNumber:e,sendCode:t,onClose:n})=>{const[r,s]=i(""),[d,m]=i(""),[u,h]=i(!1),p=l((async()=>{const e=await(i={captchaText:d},na("/sms/checkCaptcha","POST",i).then((e=>e.text())).then((e=>"ERROR"!==e)));var i;e?(t?.(),n?.()):h(e)}),[d,t]),g=l((()=>{(async()=>{s(URL.createObjectURL(await(e=>na(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?await e.blob():new Blob)))(e)))})()}),[]);return a(g,[]),o(er,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",head:o(xc,{}),onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex h-36 w-72",children:[o("img",{className:"grow",src:r}),o("div",{onClick:g,className:"flex w-8 items-center justify-center cursor-pointer",children:o(W,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(fn,{className:"w-[300px]",onChange:m,value:d,placeholder:"Введите код с картинки"}),u?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-[310px] justify-between",children:[o(Zl,{onClick:close,version:"secondary",children:"Вернуться"}),o(Zl,{type:"submit",disabled:!d,onClick:p,version:"secondary",children:"Отправить"})]})]})})})),bc=d((({time:e,setTime:t,className:n})=>(a((()=>{const n=setInterval((()=>{t(e-1)}),1e3);return 0===e&&clearInterval(n),()=>{clearInterval(n)}}),[e]),o("span",{className:n,children:vc(e)})))),vc=e=>`${`${Math.floor(e/60)}`.padStart(2,"0")}:${(""+e%60).padStart(2,"0")}`,Nc=d((({values:e,setValues:t,hasError:n,errorText:r})=>{const[d,m]=i(0),u=s([]);a((()=>{u.current?.[d]?.focus()}),[d]);const h=l((n=>i=>{const{value:a}=i.currentTarget,l=a.slice(0,1);t(e.map(((e,t)=>t===n?l:e))),m(n+1)}),[e]),p=l((n=>i=>{const{key:a}=i;if("Backspace"===a&&!e[n]){const i=n>0?n-1:e.length-1,a=e.map(((e,t)=>t===i?"":e));t(a),m(i)}}),[e]),g=l((n=>{n.preventDefault();const i=n.clipboardData.getData("text"),a=e.map(((e,t)=>t<i.length?i[t]:e));t(a),m(a.length-1)}),[e]);return c("div",{className:"flex flex-col gap-2 text-center",children:[o("div",{children:e.map(((t,i)=>o("input",{type:"number",maxLength:1,value:t,onChange:h(i),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[i]=e},onFocus:e=>e.target.select(),onKeyDown:p(i),className:wc(i,e,n)},i)))}),n?o("div",{className:"text-error",children:r}):null]})})),wc=(e,t,n=!1)=>{const i=!t[e];return`w-16 sm:w-20 h-24 text-5xl text-center p-md m-2 border ${pn(!n||!i)} rounded-md caret-transparent outline-none`},Cc=d((({isDisabled:e,onClick:t,text:n})=>o(Zl,{type:"button",onClick:t,disabled:e,children:o(_e,{font:"font-normal",children:n})}))),Sc=e=>{e&&(globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token))},kc=({values:e,onSuccess:t})=>{const[n,r]=i(""),[s,o]=i(!1),[c,d]=i(0),[m,u]=i(!1),[h,p]=i(0),g=l((()=>r("")),[]),f=Boolean(0===c&&m),x=h>2||f||!e.every(Boolean),y=l((async()=>{try{u(!1),d(0),p((e=>e+1)),o(!0),await(async e=>ta("/sms/checkCode","POST",e).then(Sc))({smsText:e.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),g(),t?.(e.join(""))}catch{r(h>1?"Исчерпан лимит ввода смс-кода":"Неверный код")}finally{o(!1)}}),[e,h]);return a((()=>{r(f?"Код просрочен":"")}),[f]),{handleSubmit:y,hasError:Boolean(n),errorText:n,isLoading:s,timeNextReq:c,isSubmitButtonDisabled:x,setTimeNextReq:d,setIsTimerStarted:u,setAttempts:p}},Ic=d((({title:e,description:t,__html:n,code:r=!0,codeLength:s=4,textButton:d="Далее",phoneNumber:m="+79999999999",onSuccess:u=un,onClose:h=un})=>{const[p,g]=i(Array(s).fill("")),{handleSubmit:f,hasError:x,errorText:y,isLoading:b,timeNextReq:v,isSubmitButtonDisabled:N,setTimeNextReq:w,setIsTimerStarted:C,setAttempts:k}=kc({values:p,onSuccess:u}),I=sn(yc),T=l((async()=>{var e;await(e={phoneNumber:m,smsCodesSetName:{key:"AUTHENTICATION"}},ta("/sms/sendCode","POST",e).then((t=>!mc(t,e.phoneNumber))))?(k(0),w(180),C(!0)):I.open({phoneNumber:m,sendCode:T,onClose:h})}),[m,h]);return a((()=>{T()}),[]),o(er,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl p-m",onClose:h,children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[o(S,{className:"w-full",title:e,description:t,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),r?o(Nc,{values:p,setValues:g,errorText:y,hasError:x}):null,Bc(v,w,T),o(Me,{itemSize:"list-s",__html:n}),Tc(d,N,f),b?o(zi,{blur:!1}):null]})})})),Tc=(e,t,n)=>e?o(Cc,{isDisabled:t,onClick:n,text:e}):null,Bc=(e,t,n)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(bc,{className:"text-base ml-1",time:e,setTime:t})]}):o(Ne,{onClick:n,className:"text-primary-main",children:"Получить новый код"}),Pc={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},Rc={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},Dc=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],Mc=d((({onSubmit:e=un,onClose:t=un})=>{const[n,a]=i(""),[r,s]=i(!1),d=nr(2),m=l((()=>{e(n)}),[e,n]),u=l((e=>{a(e),"REFUSE"===e&&s(!0)}),[]),h=r?Rc:Pc;return o(er,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg px-5xl",onClose:t,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o("div",{role:"button",onClick:d,children:o(N,{className:"text-center text-balance",headingType:"h2",title:h.title})}),o(w,{align:"text-center",children:h.description}),o(vr,{className:"whitespace-normal",orientation:"horizontal",items:Dc,value:n,onChange:u}),o(Zl,{disabled:!n,type:"button",onClick:m,children:"Далее"})]})})})),Ac=e=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:jt(e),textButton:"Далее",__html:"<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>\n <ul><li>согласие на запрос информации в БКИ</li></ul>"}),_c=d((({onClose:e})=>{const t=Jt(),[n,i]=Vl("leadForm"),a=l((async()=>{const e=await(n={redirectUri:t.href},ta("/esia/getLink","POST",n));var n;e?.link&&t.assign(e.link)}),[]),r=l((()=>{if(null!==n){const e={...n};Reflect.deleteProperty(e,"esiaAccountTypeCd"),i(e)}e?.()}),[]);return o(er,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",onClose:r,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex items-center justify-around w-full px-m",children:[c("ul",{className:"list-disc",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ne,{image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"70"})]}),c("div",{className:"flex flex-wrap gap-lg w-full",children:[o(Zl,{type:"button",onClick:a,children:"Заполнить через Госуслуги"}),o(Zl,{type:"button",version:"secondary",onClick:r,children:"Пропустить"})]})]})})})),Ec={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},zc={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK"},Fc={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},Oc=e=>Object.entries(e).reduce(((e,[t,n])=>t in Ec?[...e,{contactTypeCd:{key:Ec[t]},value:n}]:e),[]),Vc=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in zc){const i=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:zc[t]},...i}]}return e}),[]),Lc=e=>Object.entries(e).reduce(((e,[t,n])=>t in Fc?[...e,{incomeTypeCd:{key:Fc[t]},value:Number(n||0)}]:e),[]),$c=({inputs:e,programId:t,nextStepLink:n,saveForm:a})=>{const[r,s]=i(""),[,o]=Vl("taskId"),[,c]=Vl("profileId"),[,d]=Vl("participantId"),[,m]=Vl("programId"),u=(e=>{const{open:t}=sn(_c),n=Jt();return l((()=>{t({onClose:()=>n.assign(e)})}),[t,e])})(n),h=(e=>{const{open:t}=sn(Mc),n=sn(Ic),i=t=>async n=>{try{t&&await cc({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()}catch(e){console.log(e)}},a=(t,a)=>async l=>{"SIGNED"===l&&t?n.open({...Ac(t),onSuccess:i(a)}):e()};return{open:(n,i)=>t({onSubmit:a(n,i),onClose:e})}})(u),p=sn(Ic),g=l((({participantId:e,taskId:t,profileId:n,programId:i})=>{d(e),o(t),c(n),m(i)}),[]);return{handleSubmit:l((async n=>{const i=Uo(ii(e));var l;if(zn(i(n)))try{const e=await(l={profile:{phone:jt(n.phone)}},ta("/public-data/createUserProfile","POST",l).then((e=>e?.profile?.id||null)));if(e&&n?.phone){const i=async()=>{try{await qc({programId:t,profileId:e,formData:n,saveUserData:g,saveForm:a}),p.close(),h.open(n.phone,e)}catch{s("Fail")}},l=Object.keys(Kl).filter((e=>n[e])).map((e=>Kl[e]?.text));p.open({...jc(n?.phone,l),onSuccess:i})}}catch{s("Fail")}}),[]),responseStatus:r}},qc=async({programId:e,profileId:t,formData:n,saveUserData:i,saveForm:a})=>{const l=Wc(n);await cc(((e,t)=>{const{name:n="",surname:i="",middleName:a="",limitedBirthday:l="",phone:r="",email:s="",processPersonalDataFlg:o,consentProviderFlg:c,consentPfrFlg:d,consentPhotoFlg:m,consentAssignmentClaimsFlg:u,consentCollectionFlg:h,consentInformFlg:p}=t;return{profile:{id:e,name:n,surname:i,midname:a,birthDate:l&&qt(l,!0),email:s,phone:jt(r),processPersonalDataFlg:Boolean(o),consentProviderFlg:Boolean(c),consentPfrFlg:Boolean(d),consentPhotoFlg:Boolean(m),consentAssignmentClaimsFlg:Boolean(u),consentCollectionFlg:Boolean(h),consentInformFlg:Boolean(p)}}})(t,l));const{taskId:r,participantId:s}=await(async e=>await ta("/user-data/createDraftTask","POST",e)||{})({profileId:t,programId:e});try{await dc((({participantId:e,taskId:t,profileId:n,formData:i})=>{const{name:a,surname:l,middleName:r,limitedBirthday:s,phone:o,email:c}=i;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:Jt().origin,id:t,participants:[{birthDate:s&&qt(s,!0),id:e,midname:r,name:a,surname:l,profile:{id:n},participantContacts:Oc({phone:o&&jt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}]}}})({participantId:s,taskId:r,profileId:t,formData:l}))}catch(e){console.log(e)}i({participantId:s,taskId:r,profileId:t,programId:e}),a(n)},jc=(e,t)=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:jt(e),textButton:"Далее",__html:`<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>${Uc(t)}`}),Uc=e=>`<ul>${e?.map((e=>"<li>"+e+"</li>")).join("")}</ul>`,Wc=e=>{const{consentOthersFlg:t,...n}=e;return{...n,consentCollectionFlg:t,consentAssignmentClaimsFlg:t,consentPhotoFlg:t}},Hc=e=>{const{profile:t,addInfo:n,document:i,addressRegistration:a,addressFact:l}=e;return{name:t?.name,surname:t?.surname,middleName:t?.midname,limitedBirthday:t?.birthDate,phone:lo(t?.phone),email:t?.email,dulIssueDateField:i?.dulIssueDate,dulIssuedBy:i?.dulIssuedBy,dulNumber:i?.dulNumber,dulSerie:i?.dulSerie,dulSubdivisionCode:i?.dulSubdivisionCode,snils:n?.snils,birthPlace:n?.birthPlace,addressRegistration:Yc(a),addressFact:Yc(l),esiaAccountTypeCd:t?.esiaAccountType}},Yc=e=>{const{postcode:t,region:n,regionCode:i,locality:a,city:l,street:r,house:s,building:o,block:c,apartment:d}=e,m=[t,n,a||l,r?`ул ${r}`:void 0,s?`д ${s}`:void 0,c?`к ${c}`:void 0,o?`стр ${o}`:void 0,d?`кв ${d}`:void 0].reduce(((e,t)=>t?e?`${e}, ${t}`:t:e),"");return{...e,regionCode:i?.key,fullAddress:m}},Kc=e=>{const t=Jt(),[n,{setTrue:i,setFalse:r}]=on(!1),[,s]=Vl("leadForm"),o=l((async(n,a,l)=>{i();try{const i=await(o={profileId:n,code:a,state:l,redirectUri:globalThis.location?.href},ta("/esia/updateProfileEsia","POST",o));i&&s((e=>({...e,...Hc(i)}))),t.assign(e)}finally{r()}var o}),[e]);return a((()=>{const e=Ol(globalThis.localStorage?.getItem("profileId")??""),t=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),n=t.get("code"),i=t.get("state");e&&n&&i?o(e,n,i):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),{isLoading:n}},Gc=d((({className:e,title:t,programId:n="",nextStepLink:i="/credit-lead",button:l,...r})=>{const s=lc?.flatMap((e=>e?.inputs))||[],{isLoading:d}=Kc(i),[m,h]=Vl("leadForm"),p=sc(s,m),{handleSubmit:g,responseStatus:f}=$c({inputs:s,programId:n,nextStepLink:i,saveForm:h}),[,{field:x,onSubmit:y}]=an(p,{onSubmit:g}),b=sn(jo);return a((()=>{f&&b.open({responseType:f})}),[f]),o(rn,{className:u("container space-y-m",e),title:t,...r,children:c("form",{onSubmit:y,className:"space-y-m relative",children:[d?o(zi,{blur:!1}):null,lc.map(((e,t)=>c("div",{className:u($o(e.columns),"grid gap-x-m"),children:[qo(e.title),ic({field:x,inputs:e?.inputs})]},`section-${t}`))),oc(l)]})})})),Xc=d((({title:e,description:t})=>{const n=ke();return c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ne,{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"})]})})),Jc=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",Zc=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`}),Qc=10;function ed(e,{sensitivity:t,rootRef:n}={}){const i=s(null),l=r((()=>({threshold:td(t),root:n?.current})),[t,n?.current]);return a((()=>{if(!i.current)return;const t=new IntersectionObserver(e,l);return t.observe(i.current),()=>{t.disconnect()}}),[e,l]),i}function td(e=0){const t=Math.round(e*Qc);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const nd=d((({className:e,style:t,idx:n,activeIndex:i,observerOptions:a,children:r,onIntersection:s})=>{const c=ed(l((e=>{e.length&&s&&s(n||0,e[e.length-1])}),[s,n]),a);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===i),ref:c,role:"listitem",children:r})})),id=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],ad=d((({className:e,itemClassName:t,containerRef:n,activeIndex:i,visibleItemCount:a=0,gap:r=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:p,onVisibleItemsChange:g,onVisibleIndicesChange:f})=>{const x={sensitivity:1,rootRef:n},y=s([]),b=l(((e,t)=>{const n=[...y.current||[]];n[e]=t,y.current=n,g&&g(n),f&&f(rd(n))}),[g,f]),v=a>0?r*Number(a)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?ld(c,v):{},...N?Zc(h):{},gap:`${r}px`};return o("div",{className:u("box-border overflow-auto no-scrollbar",d,e),style:C,ref:n,role:"list",children:(S=(e,n)=>o(nd,{className:u(m,a?id[a-1]:"",{"h-full":N},t),style:w?ld(c/4):{},activeIndex:i,idx:n,observerOptions:x,onIntersection:b,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(S):S(e,0))(p)});var S})),ld=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),rd=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),sd={"horizontal-list":"w-6","vertical-list":"h-6"},od=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(i,a)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",a===e?sd[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(a)},String(a)),cd=({activeIndex:e,onClick:t})=>(n,i)=>{const a=i===e,l=a?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=a?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=a?"text-l":"text-m group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(i),"aria-label":n?.title,className:u("max-h-28 mt-xs ml-xs relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50 whitespace-nowrap",l),children:[o("div",{className:r,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(i))},dd=e=>t=>e.scrollWidth/t,md=e=>(t,n)=>{e.scrollBy({left:n*dd(e)(t),behavior:"smooth"})},ud=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[a,r]=i([]),o=l((e=>{r((t=>{return(n=t)===(i=e)||Boolean(n&&i&&n?.length===i?.length&&n.every(((e,t)=>e===i[t])))?t:e;var n,i})),t&&t(e)}),[t]),[c,d]=a.length?[Pr()(a),Tr()(a)]:[-1,-1],m=c>0,u=d<e-1,h=l((()=>{var t;n.current&&(m?md(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=l((()=>{n.current&&(u?md(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=l(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{n?.current&&n.current.children[e]?.scrollIntoView(t)}),[n]);return[n,{scrollLeft:h,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:u,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},hd={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},pd=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:i="horizontal-list",version:r,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=ke(),[h,p]=ud({itemCount:s.length}),g=gd(Boolean(s?.length));a((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=l((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(ad,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(cd({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",hd[i],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(od({activeIndex:t,onClick:f,listType:i}))}):null})),gd=(e=!1)=>({behavior:e?"auto":"smooth"}),fd=d((({className:e,disabled:t,...n})=>o(Ne,{rounded:!0,className:u("group/btn w-12 h-12 min-h-12 max-h-12 flex items-center justify-center shadow-main-black",t?"bg-secondary-light text-secondary-text":"bg-white text-primary-text hover:text-primary-main",e),disabled:t,...n,children:o(ne,{className:"w-4 h-4 min-w-4 min-h-4 rounded-full box-border",image:{icon:"ArrowLeftIcon",iconVersion:"black"},imageClassName:"group-hover/btn:text-primary-main",width:"16",height:"16"})}))),xd=d((e=>o(fd,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),yd=d((e=>o(fd,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),bd="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",vd=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:i,isBottom:a})=>{const{canScrollLeft:l,canScrollRight:r,scrollLeft:s,scrollRight:d}=t,m=i&&!a;return c("div",{className:e,children:[n?Nd(t):null,l?o(xd,{className:u(wd(a),m?"left-1":"left-0"),onClick:s}):null,r?o(yd,{className:u(wd(a),m?"right-1":"right-0"),onClick:d}):null]})})),Nd=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(bd,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(bd,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),wd=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),Cd=d((({className:e,version:t,gap:n=14,padding:i=16,visibleItemCount:a=1,listType:l="horizontal-list",snapAlign:r,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:x})=>{const y=Array.isArray(g)?g.length:0,[b,v]=ud({itemCount:y,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===l?"relative h-full":""),children:[o(ad,{containerRef:b,activeIndex:N,visibleItemCount:a,gap:n,padding:i,listType:l,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(vd,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(pd,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:y,listType:l,version:t,navButtons:x,containerRef:b,containerScroll:v})]})})),Sd=({blocksToRender:e,...t})=>o(Cd,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:P(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",Jc(!0)),children:T(e,t)},String(n))})}),kd=e=>e%2!=0,Id=d((({textNode:e,iconNode:t,tag:n,onClick:i,justifyContent:a="between",className:l,role:r,...s})=>c(n,{tag:n,className:u("flex items-center w-full gap-1","between"===a?"justify-between":"justify-center",l),onClick:i,role:r,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),Td=d((({className:e="",label:t,icon:n,dataTheme:i="pc",disabled:a=!1,onClick:l})=>o(Id,{tag:"button",onClick:l,disabled:a,"data-theme":i,justifyContent:"center",role:"button",className:u("py-4 border border-transparent outline-none focus:border-primary-text space-x-s",a?"bg-main-divider text-main-disabled hover:bg-main-divider":"bg-primary-main text-white hover:bg-primary-hove",e),textNode:o(_e,{size:"text-h4",children:t}),iconNode:n?o(ne,{image:{icon:n,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),Bd=({isUnfolded:e,onToggle:t})=>o(Td,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Pd=["ArrowDownIcon","ArrowUpIcon"],Rd="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",Dd=({topItemsCount:e=0,label:t="",block:n,blocksToRender:i=[],...a})=>{const[l,r]=e>0?[i.slice(0,e),i.slice(e)]:[i,[]];return c("div",{className:u("space-y-2xs",{hidden:!i.length}),children:[c("div",{className:u(Rd),children:[P(l,{...a.options,parent:n}),kd(l.length)?o(Lt,{className:"col-span-6",...a}):null]}),o(la,{renderFoldableSection:({isUnfolded:e})=>c(ra,{className:u(Rd),isUnfolded:e,children:[P(r,{...a.options,parent:n}),kd(r.length)?o(Lt,{className:"col-span-6",...a}):null]}),renderFoldButton:({isUnfolded:n,onToggle:i})=>o(Td,{className:u({hidden:e<1}),disabled:!r?.length,label:t,icon:Pd[Number(n)],dataTheme:a.options?.page?.colorPalette,onClick:i})})]})},Md=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...i})=>{switch(e?.view){case"grid":return c("div",{children:[Ad(n,t),Dd({...e,...i,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[Ad(n,t),Sd({...i,blocksToRender:t})]});default:return null}})),Ad=(e,t)=>e&&!t.length?o(Xc,{...e}):null,_d=e=>t=>t.reduce(((t,n,i)=>t.length?t.concat({...e,key:`sep-${i}`},n):[n]),[]),Ed=d((({value:e,onChange:t,items:n=[],multiple:i})=>n.map((n=>o(js,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const a=e?.includes(n);t(i?a?(e||[]).filter((e=>e!==n)):[...e||[],n]:a?[]:[n])})(n.value),type:i?"checkbox":"radio"},n.value))))),zd=d((({children:e,filtrationSchema:t,resetButton:n,field:i,reset:a})=>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,_d(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(Fd(i)).filter(Boolean))]}),n?o("div",{children:o(Zl,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:a,children:n?.text})}):null]}))),Fd=e=>([t,n])=>{const i=n?.type;return"array"===i?Od(t,e)(n):null},Od=(e,t)=>n=>{const i=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(_e,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(Ed,{items:i,multiple:!n?.single,...t(e)})]},e)};function Vd(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const Ld=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,$d=(e,t)=>Object.entries(e).map((([n,i])=>"number"==typeof i?Array.isArray(t[n])?((e,t)=>n=>Ld(t[e])||Ld(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>Ld(t[e])||Ld(n[e])||qd(t[e])<=qd(n[e]))(n,e):"object"==typeof i&&"min"in i&&"max"in i?((e,t)=>n=>Ld(t[e])||Ld(n[e])||qd(t[e]?.min)>=qd(n[e]?.min)&&qd(t[e]?.min)<=qd(n[e]?.max))(n,e):Array.isArray(i)?((e,t)=>n=>Ld(t[e])||Ld(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>Ld(t[e])||Ld(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),qd=e=>Number(e||0),jd=(e,{block:t,page:n,normalize:i=nn})=>{const a=t?.blocks||[],[l,{field:s,reset:o,update:c}]=an(e),d=r((()=>Vd(a,a.map((e=>Et(e.content,n?.fallback))))),[a,n?.fallback]),m=l===e?a:((e,t)=>(n=nn)=>e?.filter((([,e])=>$d(t,n(e)||{}))).map((([e])=>e)))(d,l)(i);return[l,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},Ud={},Wd={},Hd=Ot((({className:e,filtrationSchema:t=Ud,consumerField:n={},resetButton:i,...a})=>{const[,{blocksToRender:l},{field:r,reset:s}]=jd(Wd,{block:a.block,page:a.options?.page}),d=o(Dn,{className:"w-64",label:n?.title,options:Yd(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>Yd(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...a,children:[o(zd,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(Zl,{type:"reset",className:"mt-lg w-64",onClick:s,version:i?.version,children:i?.text})})]})}),o(Md,{blocksToRender:l,...a})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),Yd=e=>Vd(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),Kd=(e=!1)=>e?"text-left":"text-center",Gd={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},Xd=d((({className:e,defaultIconSize:t=44,iconBgVersion:n="primary",size:i,icon:a,...l})=>{const r=String(i?.width||t);return a?o("div",{style:{width:`${r}px`,height:`${r}px`},className:u("rounded-icon object-fit flex justify-center items-center",Gd[n],e),children:o(W,{...l,width:"54%",height:"54%",name:a})}):null})),Jd=d((({className:e="",title:t,benefitList:n,...i})=>{const a=ke();return c(g,{className:e,defaultPadding:"p-6xl",...i,children:[t?o(N,{headingType:"h3",as:"h2",className:Kd(a),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(Zd)}):null]})})),Zd=({label:e,description:t,__html:n,icon:i,isDotted:a=!1,iconBgVersion:l},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[i?.icon?o(Xd,{className:"shrink-0",iconBgVersion:l,...i}):null,i?.src?o(ne,{className:"shrink-0",image:i}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(N,{headingType:"h6",children:e}),o(_e,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(Me,{__html:n,isDotted:a,itemSize:"list-s"}):null]}):null]},String(r)),Qd=e=>({icon:t,title:n,description:i},a)=>c("div",{className:u("flex flex-col gap-1","items-center",{"justify-center":!i&&!n}),children:[n?o(_e,{size:"text-h6",font:"font-normal",align:e,children:n}):null,t?o(ne,{image:t,height:"180",className:"w-auto mx-auto"}):null,i?o(_e,{size:"text-h6",font:"font-normal",align:e,children:i}):null]},String(a)),em=(e,t,n)=>o("div",{className:`grid gap-2xs ${tm(t)}`,children:e.map(Qd(n))}),tm=e=>{switch(e){case"3":return"grid-cols-3";case"4":return"grid-cols-4";default:return"grid-cols-5"}},nm=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:i="4",subtitle:a,title:l,...r})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...r,children:[o(S,{defaultPadding:"",title:l,description:a,headlineVersion:"M"}),e?.length?em(e,i,t):null]}))),im={start:"justify-start",center:"justify-center",end:"justify-end"},am=d((({buttons:e,className:t="",align:n,...i})=>{const a=n&&u("flex",im[n]);return o(g,{className:u("!bg-transparent",a,t),defaultPadding:"p-0",...i,children:qe(e)})})),lm=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:i=2,depositeName:a,isShowDepositeName:l,color:r="text-secondary-text"})=>c("div",{children:[o(_e,{size:"text-l",font:"font-light",color:r,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children:He(i,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),a&&l?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:a}):null]})]}))),rm=d((({title:e="Ставка"})=>c("div",{className:"space-y-s min-w-96",children:[o(_e,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(W,{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:"Процентная ставка не найдена, выберите другие параметры"})})]}))),sm=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:i=2,color:a="text-secondary-text",children:l,...r})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(lm,{title:e,rate:t,unit:n,fractionDigits:i,color:a,...r})}),o(mr,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:i,fixed:!0,color:a,...r}),l]}):o(rm,{title:e,...r}),om={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},cm={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},dm=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:i}=e,[a,l]=((e,t,n)=>{const{maxBonus:i=5e3,prefMonthsNum:a=om.prefMonthsNum,prefTravelBonusRate:l=om.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(l*t)+Math.round(r*n),i);return[c,c*a+Math.min(Math.round(s*t)+Math.round(o*n),i)*(12-a)]})(t||cm,n,i);return{...t,...e,monthBonus:a,yearBonus:l}},mm=Ot((({className:e="",title:t,calcSource:n,buttons:i,footnote:a,...l})=>{const[r,{field:s}]=an({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=dm(r,n);return o(rr,{className:e,title:t,...l,children:c("section",{className:u(sr,e),children:[c("div",{className:or,children:[Cr({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),Cr({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?sm({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:cr,children:[f>=0?o(mr,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,qe(i,{isVertical:!0}),fr(a)]})]})})})),um=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,hm=e=>Nr({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),pm=" (c капитализацией)",gm=({income:e,finalSum:t,postfix:n="₽",buttons:i=[],footnotes:a=[],isCapitalization:l=!1})=>c("div",{className:cr,children:[o(mr,{title:`Доход в конце срока${l?pm:""}`,value:e,postfix:n,prefix:"+"}),o(mr,{title:`Сумма в конце срока${l?pm:""}`,value:t,postfix:n}),qe(i,{isVertical:!0}),a?.map(fr)]}),fm={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const xm={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},ym=(e,t)=>{const{daysValue:n,moneyValue:i,isPartialWithdrawal:a,isReplenished:l,isMonthlyInterestPayment:r}=e,s=l||a,o=n<90||n>730,c=function(e){const t=e?.rateType?fm[e?.rateType]:"",{data:n}=gi(t?`${Ut}/depositrates/${t}`:null,Dt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&bm(s,e)&&Ar(i,["minSum","maxSum"],e)&&Ar(n,["minDays","maxDays"],e)))||xm,{rate:m}=d,u=vm(m,e),h=i+u,p=c||[xm];return{...d,...Mr(["minSum","maxSum"],p),...Mr(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},bm=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,vm=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:i,daysValue:a}=t;return n?Math.round(i*Math.pow((1200+e)/1200,a/30)-i):Math.round(i*e*a/365/100)},Nm=Ot((({className:e="",title:t,buttons:n,footnote:i,bottomFootnote:a,isShowDepositeName:l,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=an({moneyValue:pr(r,1e5),daysValue:gr(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=ym(m,s),{income:g,finalSum:f,rate:x,depositeName:y}=p;return o(rr,{className:e,title:t,...d,children:c("section",{className:u(sr,e),children:[c("div",{className:or,children:[Cr({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(b={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(Qa,{items:[`От ${um(b.min||0)}`,`До ${um(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[wm(p,h),hm({title:"Выплата процентов",orientation:"vertical",...h("isMonthlyInterestPayment"),className:"sm:flex-col"})]})]}),sm({rate:x,depositeName:y,isShowDepositeName:l}),gm({income:g,finalSum:f,buttons:n,footnotes:[i,a]})]})});var b})),wm=(e,t)=>c("div",{className:"space-y-s",children:[o(_e,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(Pi,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(Pi,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),Cm=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,i]=t[n-1],[a,l]=t[n];i>=a?t.splice(n-1,2,[e,Math.max(i,l)]):n++}return t},Sm={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},km=(e,t,n)=>{const{moneyValue:i,monthsValue:a}=e,l=t?.[0]?Bm(t[0].minMonths,t[0].maxMonths):0,r=!n?.isShowMonthlyInterestPayment,s=!n?.isShowRemoteRegistration,o=!n?.isShowReplenish,c=!n?.isShowWithdrawn,d=!n?.isShowNewClient,m=t?.find((t=>[Tm({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),Tm({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),Tm({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),Tm({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,Ar(i,["minSum","maxSum"],t),Ar(a||l,["minMonths","maxMonths"],t)].every(Boolean)))||Sm,{rate:u}=m,h=Im(u,e),p=i+h,g=t||[Sm];return{...m,...Mr(["minSum","maxSum"],g),...Mr(["minMonths","maxMonths"],g),availableMonths:Cm(g.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((i,a)=>t>=e?e+a*n:e-a*n)))(e,t))),...e,defaultMonth:l,income:h,finalSum:p}},Im=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:i,monthsValue:a}=t;return n?Math.round(i*Math.pow((1200+e)/1200,a)-i):Math.round(i*e*30*a/365/100)},Tm=({row:e,userInputParams:t,paramKey:n,isExclude:i})=>i||t[n]===e[n],Bm=(e,t)=>e+Math.round((t-e)/2),Pm=(e="rub")=>"rub"===e,Rm=(e,t)=>{const{minMonths:n,maxMonths:i}=Mr(["minMonths","maxMonths"],_m(t,e?.currency)),a=e.monthsValue||Math.round((n+i)/2);return{monthsValue:Ka(a,n,i)}},Dm=(e,t)=>{const{minSum:n,maxSum:i}=Mr(["minSum","maxSum"],_m(t,e?.currency)),a=e.moneyValue||n;return{moneyValue:Ka(a,n,i)}},Mm=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),Am=e=>{const t=Pm(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},_m=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},Em=(e,t)=>{const n="rub"!==e?.currency?.key;return c("div",{className:"grid gap-lg",children:[c("div",{className:"flex gap-lg",children:[e.isShowReplenish?Nr({title:"Пополнение",...t("isReplenish"),value:e.isReplenish,orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,e.isShowWithdrawn?Nr({title:"Снятие",...t("isWithdrawn"),value:e.isWithdrawn,orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null]}),zm(e.isShowReplenish||e.isShowWithdrawn),c("div",{className:"flex gap-lg",children:[e.isShowMonthlyInterestPayment?hm({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment,orientation:"vertical"}):null,e.isShowRemoteRegistration?(i={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration,orientation:"vertical"},Nr({...i,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]}),zm(e.isShowNewClient),e.isShowNewClient?o(Pi,{text:"Новый вкладчик",...t("isNewClient")}):null]});var i},zm=(e=!1)=>e?o("div",{className:"border-b border-main-divider w-full"}):null,Fm={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum"},Om={text:"₽",key:"rub"},Vm=Ot((({className:e,title:t,calcSource:n,buttons:i=[],footnote:r="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[Om],g=l((e=>t=>e?{...t,...Am(t),...Dm(t,e),...Rm(t,e),...Mm(t,e)}:t)(h),[h]),[f,{field:x}]=an({moneyValue:pr(d,2e4),monthsValue:gr(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:Om},{normalize:g}),y=x?.("currency")?.value??Om,b=x?.("isNewClient")?.value,v=_m(h,y),N=km(f,v,s),{rate:w,income:C,finalSum:S,type:k=""}=N,I=l((()=>{Sr({field:x,defParams:ur(v,b),calcParams:N,monthsValue:"minMonths",map:Fm})}),[x,h]);a((()=>{!Or(d)&&v&&I()}),[d,h]);const T=w===ur(v,b)?.rate;return o(rr,{className:e,title:t,...m,children:c("section",{className:u(sr,e),children:[c("div",{className:or,children:[c("div",{className:"flex gap-m",children:[Cr({className:"w-full",title:`Сумма, ${y?.text}`,min:N.minSum,max:N.maxSum,...x("moneyValue"),value:N.moneyValue,postfix:y?.text,step:Lm(y?.key)}),h&&h?.length>1?o(En,{label:"Валюта",options:p,...x("currency")}):null]}),xr({title:"Срок, месяцев",min:N.minMonths,max:N.maxMonths,availableMonths:N.availableMonths,...x("monthsValue"),value:N.monthsValue}),Em({...N,...s},x)]}),sm({rate:w,children:qm(I,T)}),gm({income:C,finalSum:S,buttons:[...i,$m(n?.buttons,k)],footnotes:[r],postfix:y?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),Lm=(e="")=>Pm(e)?1e3:100,$m=(e=[],t="")=>{const{type:n,...i}=e.find((e=>e.type===t))??{};return i},qm=(e,t=!1)=>t?null:o(Zl,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),jm=e=>Um({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Um({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Um=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:i,viewSettingFieldKey:a})=>!!n&&!n[a]||t[i]===e[i],Wm={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},Hm=(e,t,n)=>{const{moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r}=e,s=t?.rateRows||[Wm],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>jm({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Dr(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Dr(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r})=>e?.find((e=>jm({row:e,userInputParams:t,paramsViewSettings:n})&&Ar(i+r,["minSum","maxSum"],e)&&Ar(l,["minSumOld","maxSumOld"],e)&&Ar(r,["minSumExtra","maxSumExtra"],e)&&Ar(a,["minMonths","maxMonths"],e)))||Wm)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r}),{rate:p}=h,g=kr(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r,monthlyPayment:g,benefit:f}},Ym=Ot((({className:e="",title:t,calcSource:n,buttons:i,footnote:a,paramsViewSettings:l,...r})=>{const[s,{field:d}]=an({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),m=Hm(s,n,l),h=wr({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")});return o(rr,{className:e,title:t,...r,children:c("section",{className:u(sr,e),children:[c("div",{className:or,children:[Cr({title:"Остаток долга в других банках, ₽ ",step:500,min:m.minSum,max:m.maxSum-m.maxSumExtra,...d("moneyValue"),value:m.moneyValue}),Cr({title:"Ежемесячный платёж в других банках, ₽",step:500,min:m.minSumOld,max:m.maxSumOld,...d("oldMonthlyPayment"),value:m.oldMonthlyPayment}),xr({title:"Новый срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),Km({...m,...l},d),m.isExtraMoney?Cr({title:"Дополнительная сумма, ₽ ",step:500,min:m.minSumExtra,max:m.maxSumExtra,...d("moneyExtra"),value:m.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:h})]}),c("div",{className:u(cr,"@4xl:w-1/2"),children:[o(mr,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(mr,{title:"Ставка",value:m?.rate,fractionDigits:2,postfix:"%"}),o(mr,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),m.benefit>0?o(mr,{title:"Выгода в месяц",value:m.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:h}),qe(i,{isVertical:!0}),fr(a)]})]})})})),Km=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(Pi,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(Pi,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(Pi,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),Gm=d((e=>{const{onChange:t,min:n,max:i,defaultValue:a="0",fractionDigits:r=0,...s}=e,c=Ya(e,{normalize:(e=a)=>n&&i?String(Ka(Number(Xm(e)),n,i)):Xm(e),format:He(r)}),d=l((e=>t&&t(Xm(e))),[t]);return o(fn,{onChange:d,...s,...c})})),Xm=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Jm=d((e=>o(Gm,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(_e,{size:"text-xl",font:"font-light",children:"₽"})})}))),Zm={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},Qm={amount:1500},eu=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:l,formType:r="private",...s})=>{const[{amount:d},{field:m}]=an(Qm),[h,p]=i(!1);return a((()=>{p(d<=0)}),[d]),c(g,{className:u("flex flex-col items-center",e),defaultPadding:"p-6xl",...s,children:[t?o(N,{className:"pb-lg xl:pb-4xl self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-[468px]",method:"POST",action:Zm[r],children:[o(Jm,{valid:!h,label:n,max:3e5,min:1,...m("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:d}),l?.text?o(Zl,{className:"w-full mt-lg",type:"submit",disabled:h,children:l.text}):null]})]})})),tu=({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(W,{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})]}),nu="relative h-full",iu={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},au=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...i})=>{const{blocks:a}=i.block||{},l=a?.some(su),r=n?{defaultPadding:"p-6xl pb-m"}:{};return R({...i,renderProps:(n,i,a)=>c("div",{className:lu(n,{someCardsHighlighted:l}),children:[T(n,i,{className:ru(n,{someCardsHighlighted:l,showBorder:!e,cardSize:t}),...r,blockIndex:a}),su(n)?tu({className:"absolute top-0 -right-4 z-40"}):null]},String(a))})},lu=(e,{someCardsHighlighted:t})=>u(nu,t&&(su(e)?"pt-3xl":"pt-3xl sm:pt-16")),ru=(e,{someCardsHighlighted:t,showBorder:n,cardSize:i="normal"})=>u(nu,"min-w-80",iu[i],t&&(su(e)?"pt-3xl sm:pt-16":"pt-3xl"),Jc(n),n&&"h-full"),su=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,ou=Ot((({className:e,visibleItemCount:t=1,noCardBorder:n,arrowsPadded:i=!0,isGap:a=!0,cardSize:l="normal",isNavButtons:r=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(Cd,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:a?16:0,padding:0,arrowsPadded:i,navButtons:r?cu(s?.block?.blocks):[],hasBlur:!0,children:au({noCardBorder:n,cardSize:l,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),cu=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],du="z-10 border border-solid w-full h-full",mu=u(du,"absolute hidden @xl:block border-transparent"),uu=d((({className:e,title:t,description:n,button:i,...a})=>o(g,{className:u("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...a,children:c("div",{className:"relative h-full",children:[o("div",{className:u(mu,"top-9 right-12 bg-green-dark")}),o("div",{className:u(mu,"top-6 right-8 bg-green")}),o("div",{className:u(mu,"top-3 right-4 bg-green-light")}),c("div",{className:u(du,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(S,{title:t,description:n,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),qe([i],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),hu={black:"bg-black",white:"bg-white"},pu=d((({className:e="",title:t,description:n,image:i,price:a,button:l,colors:r=[],align:s="text-left",padding:d,...m})=>o(g,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Be,{className:"h-full",padding:d,title:o(S,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:i?.src?o(ne,{className:"flex justify-center align-center mb-xl",image:i}):null,buttons:qe([l],{buttonClassName:"w-full self-end"}),children:[r?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(_e,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(gu)]}):null,a?c(_e,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),gu=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${hu[e]}`},String(t)),fu=d((({icon:e,...t})=>{const n=pe(),{text:i,href:a,target:l,onClick:r}=n(t);return i?o("div",{className:u("p-3 rounded-lg bg-white text-secondary-text flex justify-center"),children:o("a",{role:"link",href:a,target:l,onClick:r,children:c("div",{className:"flex flex-col items-center gap-3 break-words max-w-[150px]",children:[e?o(ne,{className:"w-7 h-7 md:w-12 md:h-12",image:{...e,iconVersion:e?.iconVersion},alt:i}):null,o("div",{className:"font-light md:font-normal text-primary-text text-center text-xs md:text-sm whitespace-wrap",children:i})]})})}):null})),xu=d((({className:e,additionalDescription:t,description:n,links:i,title:a,...l})=>o(g,{defaultPadding:"p-5xl",className:u("overflow-hidden",e),...l,children:c("div",{className:"flex flex-col lg:flex-row gap-5 justify-between",children:[c("div",{className:"flex-1",children:[o(S,{isEmbedded:!0,title:a,description:n,as:"h1",align:"text-left",headlineVersion:"XL"}),o(S,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),i?.length?yu(i):null]})}))),yu=e=>o("div",{className:u("lg:grid-cols-9 lg:[&>*]:col-span-2 lg:[&>*:nth-child(14n+2)]:col-span-3 lg:[&>*:nth-child(7n+5)]:col-span-3","lg:[&>*:nth-child(7n+6)]:col-span-3 lg:[&>*:nth-child(7n+7)]:col-span-3 lg:[&>*:nth-child(14n+10)]:col-span-3 lg:w-3/6","grid-cols-3 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+3)]:col-span-2 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+4)]:col-span-2","grid gap-3 lg:gap-5"),children:e.map(((e,t)=>o(fu,{...e},String(t))))}),bu=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"mindboxEvent"===e?{...n,eventJson:t}:n}))),vu=d((({className:e="",href:t,target:n,onClick:i,data:a,children:l})=>{const r=pe()({href:t,target:n,onClick:i});return o(t?"a":"div",{className:u("block",e),...t?r:{},role:t?"link":"none",...fe(a),children:l})})),Nu=[{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"}}],wu=d((({className:e="",media:t,showButtonText:n,stretched:a,version:l="white",children:r})=>{if(!t?.length)return null;const[s,d]=i(),m=t?.map((e=>{const{href:t,icon:i,text:a}=e,{iconMapped:r}=(e=>Nu.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=$e(i)?i:r,c=n?{text:a}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&a&&d(!0),{...e,...c,icon:{...o,iconVersion:m},version:e?.version??l}})),h=u("border border-solid hover:border-transparent border-main-divider","group-data-primary:border-main-divider group-data-gray:border-green group/media",{"basis-auto":!n&&!s},Cu(a));return c("div",{className:u("flex flex-col gap-m xl:gap-xs",e),"aria-label":"Социальные сети",children:[o("div",{className:"flex gap-xs",children:qe(m,{className:Su(s??!1,a??!1,n),buttonClassName:h})}),r?o(_e,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),Cu=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",Su=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),ku=d((({className:e,padding:t,description:n,additionalDescription:i,href:a,icon:l,isDotted:r,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:x=!0,isImageAlwaysOnRight:y=true,isImageSecondary:b=!1}={},data:v,...N})=>o(g,{className:u("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...N,children:o(vu,{href:a,target:m,className:"h-full",data:bu(v),children:c(Be,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(S,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...Qe($e(l)?o(ne,{image:l}):null,x),buttons:d.length?o(wu,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:y,isImageSecondary:b,imageAlign:"center",children:[o(Le,{benefits:f}),s?o(Me,{__html:s,isDotted:r,itemSize:"list-s"}):null,Iu(i,p)]})})}))),Iu=(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,Tu=(e,t)=>{const{title:n,description:i,buttons:a}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(_e,{size:"text-m",color:"text-secondary-text",children:n})}):null,i?o("div",{className:"mt-2xs",children:o(_e,{size:"text-xl",color:"text-primary-text",children:i})}):null,a?.length?o("div",{className:"text-primary-main",children:qe(a)}):null]},String(t))},Bu=d((({className:e="",title:t,align:n="text-center",icon:l,button:r,visibleCellsCount:s=1,cardCells:d=[],options:m,data:h,...p})=>{const f=d.map(Tu),[x,y]=s>0?[f.slice(0,s),f.slice(s)]:[f,[]],[b,v]=i(!1);return a((()=>ue.subscribe("fold",(e=>{e&&void 0!==m?.parent&&e.parent===m?.parent&&v(e.isUnfolded)}))),[m?.parent]),c(g,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...p,children:[$e(l)?o("div",{className:"self-center",children:o(ne,{image:l})}):null,t?o(N,{className:u("pt-xs",n),headingType:"h5",title:t}):null,r?.text?o(Ne,{className:"w-full mt-m mb-lg",...r}):null,y.length?o(la,{renderFoldableSection:()=>c("div",{children:[x,o(ra,{isUnfolded:b,children:y})]}),renderFoldButton:d.length>=s?Pu(m?.parent,h,b):null}):o("div",{children:x})]})})),Pu=(e,t,n=!1)=>()=>c("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:()=>{void 0!==e&&ue.fire("fold",{type:"fold",isUnfolded:!n,parent:e})},type:"button",...n?fe(t):{},children:[o("div",{children:n?"Скрыть":"Подробнее о тарифе"}),o(W,{className:"text-primary-text",name:n?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),Ru=d((({className:e,contacts:t,info:n,version:i="secondary",...a})=>c(g,{className:u("flex",e),defaultPadding:"p-6xl",version:i,...a,children:[n?.length?Du(n):null,t?.length?Du(t):null]}))),Du=e=>o("div",{className:"flex gap-5xl grow basis-0",children:e.map(((e,t)=>Mu({column:e,i:t})))}),Mu=({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:i},a)=>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(i?.text)}),children:qe([i])})]},String(a))))},`col-${String(t)}`):null,Au=()=>{const e=globalThis.sessionStorage?.getItem("refreshToken"),t=globalThis.sessionStorage?.getItem("accessToken"),n=globalThis.localStorage.getItem("taskId"),i=Jt();if(!t||!e||!n)return i.assign("/"),()=>{};const a=async()=>{const n=await na("/auth/refresh","POST",{refresh_token:e,access_token:t});if(401==n?.status&&i.assign("/"),n?.ok){const e=await n.json();globalThis.sessionStorage.setItem("refreshToken",e.refresh_token),globalThis.sessionStorage.setItem("accessToken",e.access_token)}};a();const l=setInterval(a,24e4);return()=>clearInterval(l)},_u=d((({step:e=10,description:t,showPercentage:n=!0})=>c("div",{children:[o("div",{className:"h-4 w-full bg-gray relative",children:o("div",{className:"h-4 bg-green",style:{width:`${e}%`}})}),c("div",{className:"relative",children:[n?c("div",{className:"absolute left-2/4 text-green",children:[e,"%"]}):null,t?o("div",{className:"text-right mr-4 text-gray",children:t}):null]})]}))),Eu=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const i=r((()=>(e+1)/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e+1," из ",t,"."]}),n[e]||null,o(_u,{step:i,showPercentage:!1})]})})}));var zu;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.rework="REVISION"}(zu||(zu={}));const Fu=e=>ta("/user-data/getTaskStatus","POST",e),Ou=e=>na("/user-data/sendSignalToProcess","POST",e),Vu=(e,t)=>{const n=s(null),i=l((()=>n.current&&clearInterval(n.current)),[]);return a((()=>(n.current=setInterval((()=>e(i)),t),i)),[e,t]),i},Lu=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black",link:i})=>c("div",{className:"flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m",children:[o("div",{className:"rounded-full bg-white p-xs",children:o(W,{name:t,width:"24",height:"24",iconVersion:n})}),c("div",{className:"",children:[o(Me,{__html:e}),i?.text?o(Ne,{className:"text-primary-main",children:i.text}):null]})]}))),$u=d((({interval:e=0,intervalExpireAction:t=(()=>null),title:n,__html:a})=>{const[l,r]=i(e),s=100-(e-l)/e*100;return c("div",{children:[n?o(S,{title:n,headlineVersion:"S"}):null,c("div",{className:"flex justify-center items-center flex-col",children:[c("div",{className:u("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) ${s}%, rgb(125, 126, 127) 0deg)`}}),o("div",{className:"z-10 flex items-center justify-center px-4 py-2 rounded-full w-20 h-20 bg-white text-primary-text text-m",children:o(bc,{interval:e,time:l,setTime:e=>{0===e&&t(),r(e)}})})]}),a?o(Me,{__html:a}):null]})]})})),qu=d((({title:e,description:t,infoCard:n,sectionInfoTitle:i,sectionInfo:a,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,intervalExpireAction:m=(()=>{}),...u})=>c(g,{...u,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"}),d?o($u,{interval:d,intervalExpireAction:m}):null]}),o(ju,{title:i,items:a}),o(ju,{title:l,items:r,countColumns:!0}),n?.__html?o(Lu,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(Ne,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),ju=({title:e,items:t,countColumns:n=!1})=>{const i=ke();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(_e,{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",$o(n||i?1:2)),children:t.map(((e,t)=>o("div",{children:Uu(e)},t)))}):null]})]}):null},Uu=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(_e,{color:"text-secondary-text",size:"text-l",children:e}),o(_e,{color:"text-primary-text",size:"text-xl",children:t})]}),Wu=d((()=>o(qu,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Hu=d((({handleExpireTimer:e})=>{const[t]=Vl("leadForm");return o(qu,{interval:300,intervalExpireAction:e,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:t?.cardCategory?.text}]})})),Yu=d((()=>{const[e]=Vl("leadForm");return o(qu,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Ku=d((()=>{const[e]=Vl("leadForm");return o(qu,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),Gu=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Xu=d((()=>{const[e,t]=i(zu.process),[n]=Vl("taskId");a((()=>{(async()=>{for(const e of Gu)await Ou({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const i=await Fu({taskId:n});i&&i?.statusCd!==zu.process&&(e(),t(i.statusCd))}),[n]);Vu(r,3e4);return Ju(e,(()=>t(zu.rework)))})),Ju=(e,t)=>({IN_PROCESS:o(Hu,{handleExpireTimer:t}),CANCELLED:o(Wu,{}),APPROVED:o(Ku,{}),REVISION:o(Yu,{})}[e]||o(Yu,{})),Zu=[{paymentSystem:"",currency:"810",codeWord:""},{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0,methodObtain:"office",addressCourier:{fullAddress:"",fiasCode:""}},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:"",addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:"office",deliveryDate:void 0}],Qu=e=>{if(e)try{return new Date(e)}catch(e){return}},eh=e=>(t,n)=>t.filter((e=>e)).map((t=>[th(n,e),nh(t,e),rh(t,e),ih(t,e),ah(t,e),lh(t,e)].some(Boolean)?{...t,required:!1}:t)),th=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,nh=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,ih=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,ah=({name:e},t)=>"addressFact"===e&&t("addressMatch"),lh=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const i=t(e?.name);return n!==(i?.key??i)})),rh=({name:e},t)=>"snils"===e&&sh(t),sh=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,oh=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(Lu,{__html:e},`${t}_${n}`))):null},ch=({field:e,inputs:t,params:n})=>t.map(Lo(e,n)),dh=({sections:e,field:t,step:n,params:i})=>e?.map((({inputs:e=[],columns:a,title:l},r)=>{const s=eh(mh(t))(e,n),o=s.filter((e=>!lh(e,mh(t))));return c("div",{className:u($o(a),"grid gap-x-m"),children:[oh(o),qo(l),ch({field:t,inputs:s,params:i})]},`section-${r}`)})),mh=e=>t=>e(t)?.value,uh=d((({step:e,onPrevStep:t})=>{const n=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Zl,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(Zl,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),hh=e=>{const{currency:t,paymentSystem:n,cardCategory:i,codeWord:a}=e;return{currencyCode:t?{key:t}:void 0,paymentSystemTypeCd:n,classCard:i,codeWord:a}},ph=e=>{const{methodObtain:t,deliveryDate:n=""}=e,i="courier"===t;return i?{courierDeliveryFlg:i,deliveryDate:(a=n,a?new Date(a).toISOString().split(".")[0]:""),deliveryTimeCd:{value:"TIME_2"}}:{};var a},gh=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{office:{id:t.key}}:{}},fh=(e,t)=>{switch(e){case 0:default:return{};case 1:return(e=>{const{name:t,surname:n,middleName:i,limitedBirthday:a="",phone:l="",email:r,sex:s,birthPlace:o,dulIssueDateField:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:y}=e;return{birthDate:qt(a,!0),midname:i,name:t,surname:n,birthPlace:o,dulIssueDate:qt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:qt(g,!0),houseTypeCd:f,participantContacts:Oc({phone:jt(l),email:r}),participantAddresses:Vc({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{beginDate:t,employment:n,organizationName:i,inn:a,legalForm:l,organization:r,amountWorkers:s,employerActivities:o,employerOrganization:c,generalSeniority:d,lastJobExperience:m,experience5Years:u,jobsNumber:h,organizationPhone:p,organizationAddress:g,positionOrganization:f}=e;return{employmentContractDate:qt(t||"",!0),employmentTypeCd:n,organizationName:i,organizationInn:a,organizationActivityTypeCd:o,organizationTypeCd:r,organizationKindCd:c,employeesNumberCd:s,opf:l,seniority:d,generalSeniority:u,jobsNumber:h,lastWorkDuration:m,payrollCardRshbFlg:!0,positionCd:f,participantContacts:Oc({organizationPhone:p&&jt(p)}),participantAddresses:Vc({organizationAddress:g})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:i,children:a,wages:l,mandatoryPayments:r,incomeAverage:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u,snils:h,armyIdFlg:p,conscription:g}=e;return{maritalStatusCd:t,childrenDependents:a,totalDependents:i,otherDependents:n,militaryStatusCd:g,participantIncomes:Lc({wages:l,mandatoryPayments:r,incomeAverage:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u}),snils:h?.replaceAll(" ","").replaceAll("-",""),armyIdFlg:p}})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:i,creditInRshbCd:a}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:i,creditInRshbCd:a}})(t);case 5:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:Vc({addressCourier:t})}:{}})(t)}},xh=({step:e,inputs:t,onNextStep:n,saveStep:i,finishForm:a})=>{const r=5===e,[s]=Vl("taskId"),[o]=Vl("profileId"),[c]=Vl("participantId"),d=l((async l=>{const d=Uo(ii(eh(bh(l))(t,e)));if(!zn(d(l)))return console.warn("validation fail");i(l);try{if(s&&o&&c){const t=await dc((({participantId:e,taskId:t,profileId:n,formData:i,step:a=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:Jt().origin,id:t,...gh(i),authorizedAgentId:i?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...fh(a,i)}],...hh(i),...ph(i)}}))({participantId:c,taskId:s,profileId:o,step:e,formData:l}));yh(r,t)}}catch(e){return"Fail"}return n(),r&&a?.(!0),"OK"}),[]);return{handleSubmit:d}},yh=(e,t)=>{e&&t.ok&&globalThis.localStorage.removeItem("leadForm")},bh=e=>t=>e[t],vh=d((({step:e,sections:t,onPrevStep:n,onNextStep:i,isFormFinished:a,finishForm:l})=>{const[r,s]=Vl("leadForm"),d=((e,t)=>({...Zu[e],...t,limitedBirthday:Qu(t?.limitedBirthday),dulIssueDateField:Qu(t?.dulIssueDateField),participantDateRegistration:Qu(t?.participantDateRegistration),beginDate:Qu(t?.beginDate),deliveryDate:Qu(t?.deliveryDate)}))(e,r),m=t?.flatMap((e=>e?.inputs))||[],{handleSubmit:u}=xh({step:e,inputs:m,onNextStep:i,saveStep:s,finishForm:l}),[,{field:h,onSubmit:p}]=an(d,{onSubmit:u});return a?o(Xu,{}):c("form",{onSubmit:p,className:"space-y-m",children:[dh({sections:t,field:h,step:e}),o(uh,{step:e,onPrevStep:n})]})})),Nh=[[{title:"Параметры карты",inputs:[]},{inputs:[{fieldType:"common",name:"currency",required:!0},{fieldType:"common",name:"paymentSystem",required:!0},{fieldType:"common",name:"cardCategory",required:!0},{fieldType:"common",name:"codeWord",required:!0}]}],[{title:"Персональные данные",columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"name",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"middleName",dadata:!0,filledByEsia:!0},{fieldType:"common",name:"sex",required:!0},{fieldType:"common",name:"limitedBirthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0,filledByEsia:!0},{fieldType:"common",name:"phone",required:!0,filledByEsia:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{fieldType:"common",name:"dulSerie",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulNumber",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulIssueDateField",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{fieldType:"common",name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"addressMatch"}]},{columns:2,inputs:[{fieldType:"common",name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{fieldType:"common",name:"housing",required:!0}]},{inputs:[{fieldType:"common",name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{fieldType:"info",text:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{fieldType:"common",name:"employment",required:!0},{fieldType:"common",name:"organizationName",required:!0,dadata:!0}]},{columns:2,inputs:[{fieldType:"common",name:"inn",required:!0,dadata:!0},{fieldType:"common",name:"legalForm",required:!0}]},{inputs:[{fieldType:"common",name:"organization",required:!0},{fieldType:"common",name:"amountWorkers",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!0},{fieldType:"common",name:"employerOrganization",required:!0},{fieldType:"common",name:"generalSeniority",required:!0},{fieldType:"common",name:"lastJobExperience",required:!0},{fieldType:"common",name:"experience5Years",required:!0},{fieldType:"common",name:"jobsNumber",required:!0}]},{inputs:[{fieldType:"common",name:"organizationPhone",label:"Телефон работодателя",required:!0},{fieldType:"common",name:"beginDate",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"positionOrganization",required:!0},{fieldType:"common",name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{fieldType:"common",name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{fieldType:"common",name:"familyStatus",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"dependents",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"familyMembers"},{fieldType:"common",name:"children",required:!0}]},{title:"Совокупный доход"},{inputs:[{fieldType:"info",text:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{fieldType:"common",name:"confirmationIncome",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"wages",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"snils",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"conscription",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"disablePeopleFlg"}]},{inputs:[{fieldType:"common",name:"bankruptcyFlg"}]},{inputs:[{fieldType:"common",name:"shareholderFlg"}]},{inputs:[{fieldType:"common",name:"legalEntityName"}]},{inputs:[{fieldType:"common",name:"creditInRshbCd"}]}],[{title:"Способ получения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"methodObtain"}]},{title:"Адрес",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0,condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]},{inputs:[{fieldType:"info",text:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код",condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"bankEmployeeCode",condition:{name:"methodObtain",values:["office"]}}]}]],wh=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],Ch=d((({className:e,...t})=>{const[n,d]=i(0),m=s(null),u=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);a(Au,[]);const h=l((()=>{d((e=>Math.min(e+1,6))),u()}),[]),p=l((()=>{d((e=>Math.max(e-1,0))),u()}),[]),f=r((()=>Nh[n]),[n]),[x,y]=i(!1);return o(g,{className:e,...t,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[x?null:o(Eu,{stepsTitles:wh,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(vh,{step:n,sections:f,onNextStep:h,onPrevStep:p,isFormFinished:x,finishForm:y},String(n))})]})})})),Sh=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const i=r((()=>e/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e," из ",t,"."]}),n[e]||null,o(_u,{step:i,showPercentage:!1})]})})})),kh=d((({title:e,description:t,infoCard:n,sectionInfoTitle:i,sectionInfo:a,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,intervalExpireAction:m=(()=>{}),...u})=>c(g,{...u,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"}),d?o($u,{interval:d,intervalExpireAction:m}):null]}),o(Ih,{title:i,items:a}),o(Ih,{title:l,items:r,countColumns:!0}),n?.__html?o(Lu,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(Ne,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),Ih=({title:e,items:t,countColumns:n=!1})=>{const i=ke();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(_e,{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",$o(n||i?1:2)),children:t.map(((e,t)=>o("div",{children:Th(e)},t)))}):null]})]}):null},Th=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(_e,{color:"text-secondary-text",size:"text-l",children:e}),o(_e,{color:"text-primary-text",size:"text-xl",children:t})]}),Bh=d((()=>o(kh,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Ph=d((({handleExpireTimer:e})=>{const[t]=Vl("leadForm");return o(kh,{interval:300,intervalExpireAction:e,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?"Аннуитетный":"Дифференцированный"}]})})),Rh=d((()=>{const[e]=Vl("leadForm");return o(kh,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Dh=d((()=>{const[e]=Vl("leadForm");return o(kh,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),Mh=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Ah=d((()=>{const[e,t]=i(zu.process),[n]=Vl("taskId");a((()=>{(async()=>{for(const e of Mh)await Ou({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const i=await Fu({taskId:n});i&&i?.statusCd!==zu.process&&(e(),t(i.statusCd))}),[n]);Vu(r,3e4);return _h(e,(()=>t(zu.rework)))})),_h=(e,t)=>({IN_PROCESS:o(Ph,{handleExpireTimer:t}),CANCELLED:o(Bh,{}),APPROVED:o(Dh,{}),REVISION:o(Rh,{})}[e]||o(Rh,{})),Eh=[{calculator:{moneyValue:0,monthsValue:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1}},{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:"",addressRetail:void 0,bankEmployeeCode:void 0}],zh=e=>{if(e)try{return new Date(e)}catch(e){return}},Fh=e=>(t,n)=>t.filter((e=>e)).map((t=>[Oh(n,e),Vh(t,e),jh(t,e),Lh(t,e),$h(t,e),qh(t,e)].some(Boolean)?{...t,required:!1}:t)),Oh=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Vh=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Lh=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,$h=({name:e},t)=>"addressFact"===e&&t("addressMatch"),qh=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const i=t(e?.name);return n!==(i?.key??i)})),jh=({name:e},t)=>"snils"===e&&Uh(t),Uh=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,Wh=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(Lu,{__html:e},`${t}_${n}`))):null},Hh=({field:e,inputs:t,params:n})=>t.map(Lo(e,n)),Yh=({sections:e,field:t,step:n,params:i})=>e?.map((({inputs:e=[],columns:a,title:l},r)=>{const s=Fh(Kh(t))(e,n);return c("div",{className:u($o(a),"grid gap-x-m"),children:[Wh(s),qo(l),Hh({field:t,inputs:s,params:i})]},`section-${r}`)})),Kh=e=>t=>e(t)?.value,Gh=d((({step:e,onPrevStep:t})=>{const n=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Zl,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(Zl,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),Xh={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},Jh=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:i}=e?.calculator??{};return{loanAmount:t,creditPeriod:n,paymentTypeCd:Xh[i?"annuity":"differential"]}},Zh=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},Qh=(e,t)=>{switch(e){case 0:return(e=>{const{isInsurance:t,isSalaryClient:n}=e?.calculator??{};return{payrollCardRshbFlg:t,consentInsuranceFlg:n}})(t);case 1:return(e=>{const{name:t,surname:n,middleName:i,limitedBirthday:a="",phone:l="",email:r,sex:s,birthPlace:o,dulIssueDateField:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:y}=e;return{birthDate:qt(a,!0),midname:i,name:t,surname:n,birthPlace:o,dulIssueDate:qt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:qt(g,!0),houseTypeCd:f,participantContacts:Oc({phone:jt(l),email:r}),participantAddresses:Vc({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{beginDate:t,employment:n,organizationName:i,inn:a,legalForm:l,organization:r,amountWorkers:s,employerActivities:o,employerOrganization:c,generalSeniority:d,lastJobExperience:m,experience5Years:u,jobsNumber:h,organizationPhone:p,organizationAddress:g,positionOrganization:f}=e;return{employmentContractDate:qt(t||"",!0),employmentTypeCd:n,organizationName:i,organizationInn:a,organizationActivityTypeCd:o,organizationTypeCd:r,organizationKindCd:c,employeesNumberCd:s,opf:l,seniority:d,generalSeniority:u,jobsNumber:h,lastWorkDuration:m,positionCd:f,participantContacts:Oc({organizationPhone:p&&jt(p)}),participantAddresses:Vc({organizationAddress:g})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:i,children:a,confirmationIncome:l,wages:r,mandatoryPayments:s,incomeAverage:o,additionalIncome:c,otherIncome:d,otherPayments:m,rentalIncome:u,retirementIncome:h,snils:p,armyIdFlg:g,conscription:f}=e;return{maritalStatusCd:t,totalDependents:i,incomeCertificateCd:l,otherDependents:n,childrenDependents:a,militaryStatusCd:f,participantIncomes:Lc({wages:r,mandatoryPayments:s,incomeAverage:o,additionalIncome:c,otherIncome:d,otherPayments:m,rentalIncome:u,retirementIncome:h}),snils:p?.replaceAll(" ","").replaceAll("-",""),armyIdFlg:g}})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:i,creditInRshbCd:a}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:i,creditInRshbCd:a}})(t);default:return{}}},ep=({step:e,inputs:t,onNextStep:n,saveStep:i,finishForm:a})=>{const r=5===e,[s]=Vl("taskId"),[o]=Vl("profileId"),[c]=Vl("participantId"),d=l((async l=>{const d=Uo(ii(Fh(np(l))(t,e)));if(!zn(d(l)))return console.warn("validation fail");i(l);try{if(s&&o&&c){const t=await dc((({participantId:e,taskId:t,profileId:n,formData:i,step:a=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:Jt().origin,id:t,authorizedAgentId:i?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Qh(a,i)}],...Jh(i),...Zh(i),esiaAccountTypeCd:{key:i?.esiaAccountTypeCd?.key}}}))({participantId:c,taskId:s,profileId:o,step:e,formData:l}));tp(r,t)}}catch(e){return"Fail"}return n(),r&&a?.(!0),"OK"}),[]);return{handleSubmit:d}},tp=(e,t)=>{e&&t.ok&&globalThis.localStorage.removeItem("leadForm")},np=e=>t=>e[t],ip=d((({step:e,sections:t,onPrevStep:n,onNextStep:i,isFormFinished:a,finishForm:l,programsSource:r})=>{const[s,d]=Vl("leadForm"),[m]=Vl("programId"),u=r?.[m??""],h=((e,t)=>({...Eh[e],...t,limitedBirthday:zh(t?.limitedBirthday),dulIssueDateField:zh(t?.dulIssueDateField),participantDateRegistration:zh(t?.participantDateRegistration),beginDate:zh(t?.beginDate),deliveryDate:zh(t?.deliveryDate)}))(e,s),p=t?.flatMap((e=>e?.inputs))||[],{handleSubmit:g}=ep({step:e,inputs:p,onNextStep:i,saveStep:d,finishForm:l}),[,{field:f,onSubmit:x}]=an(h,{onSubmit:g});return a?o(Ah,{}):c("form",{onSubmit:x,className:"space-y-m",children:[Yh({sections:t,field:f,step:e,params:{calcData:u}}),o(Gh,{step:e,onPrevStep:n})]})})),ap=[[{columns:1,inputs:[{fieldType:"common",name:"calculator"}]}],[{title:"Персональные данные",columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"name",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"middleName",dadata:!0,filledByEsia:!0},{fieldType:"common",name:"sex",required:!0},{fieldType:"common",name:"limitedBirthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0,filledByEsia:!0},{fieldType:"common",name:"phone",required:!0,filledByEsia:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{fieldType:"common",name:"dulSerie",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulNumber",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulIssueDateField",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{fieldType:"common",name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"addressMatch"}]},{columns:2,inputs:[{fieldType:"common",name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{fieldType:"common",name:"housing",required:!0}]},{inputs:[{fieldType:"common",name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{fieldType:"info",text:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{fieldType:"common",name:"employment",required:!0},{fieldType:"common",name:"organizationName",required:!0,dadata:!0}]},{columns:2,inputs:[{fieldType:"common",name:"inn",required:!0,dadata:!0},{fieldType:"common",name:"legalForm",required:!0}]},{inputs:[{fieldType:"common",name:"organization",required:!0},{fieldType:"common",name:"amountWorkers",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!0},{fieldType:"common",name:"employerOrganization",required:!0},{fieldType:"common",name:"generalSeniority",required:!0},{fieldType:"common",name:"lastJobExperience",required:!0},{fieldType:"common",name:"experience5Years",required:!0},{fieldType:"common",name:"jobsNumber",required:!0}]},{inputs:[{fieldType:"common",name:"organizationPhone",label:"Телефон работодателя",required:!0},{fieldType:"common",name:"beginDate",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"positionOrganization",required:!0},{fieldType:"common",name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{fieldType:"common",name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{fieldType:"common",name:"familyStatus",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"dependents",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"familyMembers"},{fieldType:"common",name:"children",required:!0}]},{title:"Совокупный доход"},{inputs:[{fieldType:"info",text:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{fieldType:"common",name:"confirmationIncome",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"wages",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"snils",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"conscription",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"disablePeopleFlg"}]},{inputs:[{fieldType:"common",name:"bankruptcyFlg"}]},{inputs:[{fieldType:"common",name:"shareholderFlg"}]},{inputs:[{fieldType:"common",name:"legalEntityName"}]},{inputs:[{fieldType:"common",name:"creditInRshbCd"}]}],[{title:"Отделение Банка",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0}]},{inputs:[{fieldType:"common",name:"addressRetail",required:!0}]},{title:"Код представителя Банка",columns:1,inputs:[]},{inputs:[{fieldType:"info",text:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{inputs:[{fieldType:"common",name:"bankEmployeeCode"}]}]],lp=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Отделение Банка"],rp=Ot((({className:e,programsSource:t,...n})=>{const[d,m]=i(0),u=s(null),h=l((()=>u?.current?.scrollIntoView({behavior:"smooth"})),[u]);a(Au,[]);const p=l((()=>{m((e=>Math.min(e+1,5))),h()}),[]),f=l((()=>{m((e=>Math.max(e-1,0))),h()}),[]),x=r((()=>ap[d]),[d]),y=0===d,[b,v]=i(!1);return o(g,{className:e,...n,children:c("div",{ref:u,className:"container grid grid-cols-12",children:[y||b?null:o(Sh,{stepsTitles:lp,step:d,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(ip,{step:d,sections:x,onNextStep:p,onPrevStep:f,isFormFinished:b,finishForm:v,programsSource:t},String(d))})]})})})),sp=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,op=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),cp=1e9,dp={sum:{min:1e4,max:cp},period:3},mp=Ot((({className:e,filtrationSchema:t={},resetButton:n,sumInput:i,periodInput:a,...l})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=jd(dp,{block:l.block,page:l.options?.page,normalize:e=>({...e,period:up(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=hp(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...l,children:[o(zd,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(Jm,{label:i?.title,min:500,max:cp,...d("sum",{parse:e=>({min:Number(e),max:cp}),format:({min:e})=>String(e)})}),o(Qa,{title:a?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(Md,{blocksToRender:r,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),up=e=>Mt((e?.paramsSource?.rateRows||[]).filter(sp).flatMap((e=>op(e.minMonths,e.maxMonths)))),hp=e=>Mt(e.flatMap((e=>e||[])).filter(sp).flatMap((e=>op(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],pp=[{key:"10"},{key:"50"},{key:"100"}],gp=({itemCount:e,onItemCountChange:t})=>{const n=l((({key:e})=>t(Number(e))),[]);return c("div",{className:"mt-2 @lg:mt-0 items-center gap-s hidden @lg:flex",children:[o("span",{children:"Показать по"}),o(Dn,{className:"min-w-20",onChange:n,value:{key:String(e)},options:pp,iconVersion:"black"})]})},fp="py-m @lg:px-lg px-m rounded-md cursor-pointer text-center min-w-10 @lg:min-w-0 hover:bg-primary-hover hover:text-white",xp=(e,t)=>{const{currentPage:n,onPageChange:i,totalPages:a}=e,l=t+1;return l===n?o("div",{"aria-current":"true",className:"py-m @lg:px-lg px-m bg-primary-main text-center min-w-10 @lg:min-w-0 text-white rounded-md",children:l},String(t)):1!==l&&l!==a&&((e,t,n)=>e<t&&e>=t-1||e<=t+1&&e>t||((e,t,n)=>t<=2&&e<=t+2||t>=n-1&&e>=n-3)(e,t,n))(l,n,a)?o("div",{onClick:()=>i(l),className:fp,"aria-label":`Страница ${l}`,children:l},String(t)):null},yp={width:"24",height:"24"},bp=({currentPage:e,onPageChange:t,totalPages:n})=>{const i=r((()=>Array.from({length:n}).fill({currentPage:e,onPageChange:t,totalPages:n})),[n,e]),a=l((()=>{e>1&&t(e-1)}),[e]),s=l((()=>{e<n&&t(e+1)}),[e,n]),d=l((()=>t(1)),[]),m=l((()=>t(n)),[n]);return c("div",{className:"flex gap-m items-center",children:[o("div",{onClick:a,children:o(W,{name:"ArrowLeftIcon",iconVersion:"black",imageClassName:vp(1===e),...yp})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:fp,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,i.map(xp),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:fp,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(W,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:vp(e===n),...yp})})]})},vp=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",Np=({currentPage:e,onPageChange:t,totalPages:n,itemCount:i,onItemCountChange:a})=>c("div",{className:"mt-3xl flex justify-between flex-col @lg:flex-row items-center select-none",role:"navigation","aria-label":"Пагинация",children:[o(bp,{currentPage:e,onPageChange:t,totalPages:n}),i&&a?o(gp,{itemCount:i,onItemCountChange:a}):null]}),wp=d((({className:e,value:t,autoFocus:n,onChange:i,onFocus:a,placeholder:r="Поиск по сайту"})=>{const s=l((e=>{i&&i(e.target?.value||"")}),[i]);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(ne,{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",hn),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:n,onChange:s,onFocus:a})]})})),Cp=d((({field:e,onClearFilter:t,filtrationState:n})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(wp,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(Al,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(Al,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период до",minDate:n.startDate,...e("endDate")}),o("div",{className:"col-span-12 @lg:col-span-2 mt-8 @lg:mt-auto",children:o(Zl,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),Sp=d((({title:e,timestamp:t,publicId:n})=>{const i=pe(),{href:a}=i({href:`${Ut}/depository/${n}/file`});return c("div",{className:"flex gap-3 items-center py-lg border-gray border-opacity-50 border-b",children:[null,c("div",{className:"flex flex-col gap-x-6xl lg:flex-row lg:items-center",children:[t?o(_e,{size:"text-m","font-weight":"font-light",children:qt(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:a,download:!0,"aria-label":"Скачать",children:e})]})]},n)})),kp=`${Ut}/depository`,Ip={startDate:void 0,endDate:void 0,query:""},Tp=Ot((({className:e,...t})=>{const[n,a]=i(0),[r,s]=i(10),[d,{field:m,reset:h}]=an(Ip),{totalPages:p=0,items:f=[]}=(({size:e,page:t,query:n,startDate:i,endDate:a})=>{const l=i?qt(i,!0):"",r=a?qt(a,!0):"",s=new URLSearchParams(kp);s.set("page",String(t)),s.set("size",String(e)),s.set("query",n),s.set("timestampStart",l),s.set("timestampEnd",r);const o=`?${s.toString()}`,{data:c}=gi(kp+o,Dt);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:n,...d}),x=l((e=>a(e-1)),[]),y=l((e=>{r!==e?(s(e),a(0)):s(e)}),[]);return c(g,{className:u(e,"container p-6xl"),...t,children:[o(Cp,{filtrationState:d,field:m,onClearFilter:h}),c("div",{className:"flex flex-col",children:[c("div",{className:"grid grid-cols-12 pb-lg border-gray border-opacity-50 border-b",children:[o("div",{className:"col-span-4 @lg:col-span-2 hidden @lg:block",children:o(_e,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(_e,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),f.length?f.map((e=>o(Sp,{...e},String(e.publicId)))):o(Xc,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(Np,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:y})]})]})})),Bp=e=>"Image"===e?.contentType&&e?.image?o(ne,{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,Pp=d((({className:e="",title:t,description:n,error:i,button:a,...l})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...l,children:[o("div",{className:"flex justify-center",children:Bp(i)}),o(S,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),a?.text?o(Ne,{version:a?.version,text:a?.text,...a}):null]})));function Rp(e,t){for(const[n,i]of e.entries())null!=i?t.setItem(n,i):t.removeItem(n)}const Dp={};function Mp(e,t=Dp){const n=s(null),o=function(){const[,e]=i(0);return l((()=>e((e=>(e+1)%65536))),[])}();return a((()=>e.bus.watch((e=>{n.current?.has(String(e.type))&&o()}))),[e,o]),r((()=>new Proxy(t,{get:(t,i)=>(n.current||=new Set,n.current.add(i),e.getItem(i)),has:(t,i)=>(n.current||=new Set,n.current.add(i),e.hasItem(i)),set:(t,n,i)=>(e.setItem(n,i),!0),deleteProperty:(t,n)=>(e.removeItem(n),!0)})),[e])}const Ap=new class{bus;store=new Map;get size(){return this.store.size}constructor(e=new me){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)}};var _p,Ep;function zp(e){return Mp(Ap,e)}_p=Ap,Ep=new class{storage;bus;get size(){return this.storage?.length??0}constructor(e,t=new me){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)}}(globalThis?.localStorage),Rp(_p,Ep),Rp(Ep,_p),_p.bus.watch((({type:e,event:t})=>{null!=t?Ep.setItem(e,t):Ep.removeItem(e)}));const Fp=`${Ut}/region`;function Op(e="Москва"){return zp().location??{name:e}}function Vp(e="Москва"){const t=zp(),n=l((async()=>{if(!t.location){const n=await Rt(Fp);t.location=n??{name:e}}}),[t,e]);return gi(Fp,n),t}var Lp;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(Lp||(Lp={}));const $p=new Intl.NumberFormat("ru",{style:"currency",currency:Lp.RUB}),qp=e=>e?$p.format(e):"",jp="text-m font-light text-secondary-text ",Up=`${jp} text-left`,Wp=`${jp} pl-5xl text-center`,Hp=`${jp} pl-5xl text-right`,Yp={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},Kp=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:Up,children:o(_e,{size:"text-m",children:"Валюта"})}),o("th",{className:Wp,children:o(_e,{size:"text-m",children:"Купить"})}),o("th",{className:Hp,children:o(_e,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(Gp)})]}))),Gp=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(ne,{image:{icon:Yp[t]},width:"24",height:"24"}):null,o(_e,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(_e,{size:"text-h6",children:qp(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(_e,{size:"text-h6",children:qp(e?.buyExchangeRate)})})]},t)},Xp={icon:"GpsIcon"},Jp=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(Xd,{...Xp,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:"Курс указан для заданного офиса"})]})]}))),Zp=(e,t,n)=>{const i=Number(Qp(e))*Math.pow(t,n?-1:1);return Number.isInteger(i)?i:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(i)},Qp=e=>e.replace(/[^\d.,]/g,"").replace(",",".");function eg(e){if(!e)throw new Error("Value should be fulfilled");return e}const tg=e=>t=>{const[,n]=eg(e.find((([e])=>e(t))));return n(t)},ng=e=>tg(e.map((([e,t])=>[e,()=>t])));ng.if=e=>new ig(void 0,e);class ig{parent;predicate;unit;get entry(){return[eg(this.predicate),eg(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new ig(this,e)}then(e){return new ig(this.parent,this.predicate,e)}else(e){return tg([...ag(this),[()=>!0,e]])}}const ag=e=>[...e?.parent?ag(e.parent):[],e.entry],lg=e=>ng([[e=>e.value!==Lp.RUB&&e.oppositeValue!==Lp.RUB,()=>e.handleConvert(e.value,Lp.RUB)],[e=>e.value===Lp.RUB&&e.oppositeValue===Lp.RUB,()=>e.handleConvert(e.value,Lp.USD)],[e=>e.value===Lp.RUB&&e.oppositeValue===Lp.RUB,()=>e.handleConvert(e.value,Lp.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function rg(e){const{placeholder:t,rates:n,selected:i,value:a,setValue:l,setSelected:r}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:i,text:i};return c("div",{className:"relative flex",children:[o(fn,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:a,onChange:l}),s.length?o(Dn,{className:"absolute right-0",isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const sg=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:a})=>{const[r,s]=i({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||Lp.RUB,selectBuy:n?.[0]?.currency?.currency||Lp.USD}),d=l((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[t&&n?c("div",{className:"grid gap-m",children:[rg({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:og(r,d,n),value:r.inputSell,setValue:e=>dg(d,n)(e,r.selectSell,r.selectBuy)}),rg({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:cg(r,d,t),value:r.inputBuy,setValue:e=>mg(d,t)(e,r.selectBuy,r.selectSell)})]}):null,a?.text?o(Ne,{text:a.text,version:a?.version,...a}):null]})})),og=(e,t,n)=>i=>{t({selectSell:i}),lg({value:i,oppositeValue:e.selectBuy,handleConvert:(i=e.selectSell,a=e.selectBuy)=>{dg(t,n)(e.inputSell,i,a)}})},cg=(e,t,n)=>i=>{t({selectBuy:i}),lg({value:i,oppositeValue:e.selectSell,handleConvert:(i=e.selectBuy,a=e.selectSell)=>mg(t,n)(e.inputBuy,i,a)})},dg=(e,t)=>(n,i,a)=>{e({inputSell:Qp(n),selectBuy:a});const l=t.find((e=>e.currency?.currency===a))?.buyExchangeRate||t.find((e=>e.currency?.currency===i))?.buyExchangeRate;l&&e({inputBuy:String(Zp(n,l,i===Lp.RUB)||"")})},mg=(e,t)=>(n,i,a)=>{e({inputBuy:Qp(n),selectSell:a});const l=t.find((e=>e.currency?.currency===a))?.saleExchangeRate||t.find((e=>e.currency?.currency===i))?.saleExchangeRate;l&&e({inputSell:String(Zp(n,l,i===Lp.RUB)||"")})},ug=`${Ut}/exchangerates`;const hg=d((({className:e="",title:t="Курсы обмена валют",button:n,...i})=>{const a=function(e){const t=e?.code||"000",{data:n}=gi(ug+`?regionCode=${t}`,Dt);return n||{}}(Op()),l=pg(a?.exchangeRate?.currencies),r=l.filter((e=>e.buyExchangeRate));r.unshift({currency:{currency:Lp.RUB}});const s=l.filter((e=>e.saleExchangeRate));return s.push({currency:{currency:Lp.RUB}}),o(g,{className:u("box-border min-h-80",e),...i,children:o(Be,{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(Kp,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(Jp,{address:a?.address})]}),o(sg,{className:"grow w-1/2",currencyRatesBuy:r,currencyRatesSell:s,button:n})]})})})})),pg=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],gg=d((({className:e="",items:t})=>{const n=pe();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(fg(n))})})),fg=e=>({dataFooter:t,...n},i)=>{const{text:a,href:l,target:r,onClick:s}=e(n);return a?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:l,target:r||"_self",onClick:s,...fe(t),children:a||null})},String(i)):null},xg=e=>t=>!t.displayArea||e.includes(t.displayArea.toLowerCase()),yg=["all","footer"],bg=d((({className:e,navigationItems:t})=>{const n=pe();return o("div",{role:"menu",className:u("w-full flex items-start justify-between flex-col md:flex-row gap-y-m lg:order-2",e),children:t?.filter(xg(yg)).map(n).map(vg)})})),vg=(e,t)=>{const{text:n,items:i=[],href:a,target:l="_self",onClick:r,dataFooter:s}=e,d=i.filter(xg(yg));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:a,target:l,onClick:r,...fe(s),children:n}),d?o(gg,{items:d}):null]},String(t))},Ng=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(wg)}):null)),wg=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(_e,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(Cg)})]},String(t)),Cg=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Sg(e.type,e.text)}),o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Sg=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${kg(t)}`,children:o(_e,{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})}},kg=e=>e.replaceAll(/\D/g,""),Ig=d((({className:e="",index:t,text:n,...i})=>{const a=pe(),{href:l,target:r,onClick:s}=a(i);return o("a",{className:u("text-secondary-text",e),href:l,target:r,onClick:s,children:n||`Документ ${t}`})})),Tg=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(_e,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(Ig,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),Bg="w-full lg:w-52";function Pg(e,t,n=300){a((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}const Rg=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:i,s2Matches:a}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),i=Array.from({length:e.length}),a=Array.from({length:t.length});let l=0;for(let r=0;r<e.length;r++){const s=Math.max(0,r-n),o=Math.min(r+n,t.length-1);for(let n=s;n<=o;n++)i[r]||a[n]||e[r]!==t[n]||(l++,i[r]=!0,a[n]=!0)}return{m:l,s1Matches:i,s2Matches:a}}(e,t);if(0===n)return 0;const l=function(e,t,{s1Matches:n,s2Matches:i}){let a=0;for(let l=0,r=0;l<e.length;l++){if(!n[l])continue;let s=r;for(;s<t.length;s++)if(i[s]){r=s+1;break}e[l]!==t[s]&&a++}return a}(e,t,{s1Matches:i,s2Matches:a}),r=(n/e.length+n/t.length+(n-l/2)/n)/3,s=r>.7?.1*function(e,t){let n=0;for(;e[n]===t[n]&&n<4;)n++;return n}(e,t):0;return r+s*(1-r)};const Dg=(e,t)=>(n,i)=>{for(const[a,l]of i)n.set(a,e(n.get(a)||t,l));return n},Mg=(e=[])=>e.reduce(((e,t)=>e+t),0),Ag=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),_g=e=>t=>e.map((([e,n])=>[Rg(t)(e),n])).filter((([e])=>e>=.8)).map((([e,t])=>zg(t,e))).reduce(Dg(Math.max,0),new Map),Eg=e=>t=>{return Vd(t,t.map((({title:e})=>e)).map((e=>t=>{const n=Ag(t||"");return n.length?Mg(e.map((e=>Br(n.map(Rg(e)))))):0})(e))).sort((e=>(t,n)=>-e(t,n))((n=([,e])=>e,(e,t)=>n(e)-n(t)))).map((([e])=>e));var n},zg=(e,t)=>new Map(e.map((e=>[e,t]))),Fg=({basePathList:e,initialQuery:t=""})=>{const[n,l]=i(t||"");a((()=>{null!=t&&l(t)}),[t]);const{data:r}=gi(e?.length?e:null,Og),[s,o]=i(null);return Pg((()=>{r&&o(r.map((e=>t=>{const{corpus:n,dictionary:i}=t||{};if(!(e&&n?.length&&i&&Object.keys(i).length))return[];const a=Ag(e);if(!a.length)return[];const l=Object.entries(i),r=[...a.map(_g(l)).reduce(Dg(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*a.length)).map((([e])=>n[e]));return Eg(a)(r)})(n)))}),[r,n]),[s,{value:n,onChange:l}]},Og=async(...e)=>(await Promise.allSettled(e.map((e=>Rt(O(e,"/","search.index.json")))))).map((e=>"fulfilled"===e.status?e.value:{})),Vg=d((({initialQuery:e,navigationItems:t,onClose:n})=>{const i=r((()=>t?.map((e=>e.href||"/"))),[t]),[a,l]=Fg({basePathList:i,initialQuery:e}),s=r((()=>Lg(t)(a)),[t,a]);return o(er,{head:o(wp,{autoFocus:!0,...l}),onClose:n,children:o(bg,{navigationItems:s})})})),Lg=e=>t=>e?.length&&t?.length?Vd(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:O("/",t)})))}))):[],$g=d((({className:e,search:t,...n})=>{const[a,r]=i(""),s=l((()=>r("")),[]),d=sn(Vg,n),m=l((e=>{r(e),qg(e)&&d.open({initialQuery:e,onClose:s})}),[s,d]);return c("div",{className:u("relative",e),role:"search",children:[o(wp,{value:a,placeholder:t?.placeholder,onChange:m}),o(Ql,{className:"absolute top-0 right-0 sm:hidden",onClose:s})]})})),qg=e=>e&&e.length>=3,jg=(e,t)=>{const{logo:n}=e??{},{dataHeader:i,dataFooter:a,...l}=n??{};return c("div",{className:"flex items-stretch gap-3xl",children:[o(xc,{className:Bg,logo:l,data:a,showTitle:!1}),o($g,{className:"grow",navigationItems:t,...e})]})},Ug=d((({className:e="",index:t,...n})=>{const i=pe(),{href:a,target:l,text:r,onClick:s}=i(n);return o("a",{className:u("text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px]",e),href:a,target:l,onClick:s,children:r||`Документ ${t}`})})),Wg=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(_e,{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(Ug,{index:t,...e},String(t))))}):null]}))),Hg=Ot((({className:e,footer:t,...n})=>{const{navigationItems:i}=n.options?.page?.navigation??{},a=n.options?.page?.common??{},{documents:l,relatedEnterprises:r,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:[jg(a,i),c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(bg,{navigationItems:i}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u(Bg,"flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(Ng,{items:s}),h?o(Ne,{className:"w-full",version:"primary",...h}):null,d.map(((e,t)=>o(wu,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),f.map(((e,t)=>o(Ne,{className:"!text-left text-s font-light",version:"link",...e,children:e?.text},String(t))))]})]}),o(Tg,{title:m,links:r}),o(Wg,{links:l,license:p})]})})),Yg=d((({className:e="",title:t,description:n,calendar:i,...a})=>c(g,{className:u("space-y-m",e),defaultPadding:"p-6xl",...a,children:[o(S,{title:t,description:n,headlineVersion:"M",isEmbedded:!0}),i?Kg(i):null]}))),Kg=e=>{const t=100/(e.reduce(((e,t)=>t?.month?.length?e+t.month.length:e),0)||1),n=e.filter((e=>e?.month?.length)).map((e=>({...e,flexBasis:`${e?.month?.length?e.month.length*t:""}%`})));return c("div",{className:"w-full flex flex-col justify-center gap-s",children:[o("div",{className:"flex w-full text-h6 text-center",children:n.map((e=>Gg(e,t)))}),o("div",{className:"flex gap-s w-full",children:n.map(((e,t)=>c("div",{className:"border-r border-main-divider last:border-r-0 space-y-s",style:{flexBasis:e.flexBasis},children:[o("div",{className:"flex gap-s",children:Xg(e)}),c("div",{className:"text-s",children:[o(_e,{size:"text-s",font:"font-light",color:"text-primary-text",children:e.text})," ",o(_e,{size:"text-s",font:"font-light",color:"text-primary-main",children:e.greenText})]})]},`monthItem-${t}`)))})]})},Gg=(e,t)=>e.month?.map(((e,n)=>o("div",{style:{flexBasis:`${t}%`},children:e.text},`monthName-${n}`))),Xg=e=>e.month?.map((e=>e.image?.src?o("div",{className:"h-52 border-r pr-s border-main-divider last:border-r-0",children:o(ne,{image:e.image,className:"flex"})},`monthImage-${e.image.src}`):null)),Jg=Ot((({className:e,title:t,button:n,regionSource:a,data:l,...r})=>{const[s,d]=i({key:""}),m=a?.regions??[],h=oe({className:"text-white",version:n?.version||"primary"}),p=m?.find((e=>e.name===s.key))?.href,f=n?.text?n.text:"Перейти";return o(g,{className:e,defaultPadding:"p-6xl",...r,children:c("div",{className:"container max-w-[978px] space-y-m",children:[t?o(N,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(En,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,p?o("div",{className:"text-center",children:o(Ne,{href:p,target:"_blank",className:u("p-m w-full @xl:w-auto",h),data:bu(l,s?.key),children:f})}):null]})})}));function Zg(e=[]){const t=D(),n=Array.from(e.entries()).filter((([,e])=>Qg(t)(e)));return n.find((([,e])=>Qg(t,!0)(e)))??n[n.length-1]??[]}const Qg=(e,t=!1)=>({href:n})=>{if(!n)return!1;const i=F(ef(e)(n));return t?i===F(n):i.startsWith(F(n))},ef=e=>t=>{const n=X(G.SITE_URL);return _(t)?e.href:O(n,e.pathname)},tf=d((({className:e="",items:t,activeItem:n,ariaLabel:i="Меню"})=>{const[r,{setFalse:d,toggle:m}]=on(!1),h=dn(d),p=s(null),g=l((({isOpened:e,buttonRef:t,menuRef:n})=>{if(e&&t.current&&n.current){const e=n.current.getBoundingClientRect(),i=t.current.getBoundingClientRect(),a=globalThis.innerWidth-e.width;e.right>=globalThis.innerWidth?n.current.style.left=`${a}px`:i.left>e.left&&(a>i.left?n.current.style.left="":n.current.style.left=`${a}px`)}}),[r]);return cn(globalThis,"resize",(()=>g({isOpened:r,buttonRef:h,menuRef:p}))),a((()=>{g({isOpened:r,buttonRef:h,menuRef:p})}),[r]),c("div",{className:u(r?"rounded-md shadow-blue-gray":"",e),ref:h,role:"navigation",children:[o("button",{type:"button",className:"group/btn flex justify-between items-center h-6","aria-label":i,onClick:m,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))))}),o("div",{ref:p,className:u("absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56 z-40",{hidden:!r}),"aria-hidden":!r,children:af(t,n)})]})})),nf=d((({isActive:e,...t})=>{const n=pe(),{text:i,href:a,target:l,onClick:r}=n(t);return o("a",{className:u("text-l font-light pb-m hover:text-primary-main",{"text-primary-main":e}),href:a,target:l,onClick:r,role:"link",...fe(t?.data),children:i})})),af=(e,t)=>e?.map(((e,n)=>o(nf,{isActive:e===t,...e},e?.text??String(n)))),lf={default:"w-6 h-6",large:"w-12 h-12"},rf=d((({className:e,isRounded:t,buttonSize:n="default",isGrayBg:i=!1,disabled:a,ariaLabel:l="Меню второго уровня",image:r,data:s,onClick:c,version:d})=>o("button",{className:u("group/btn border-0 flex shrink-0 items-center",i?"p-s rounded-full":"p-0 bg-inherit","transparent"===d?"backdrop-opacity-30 bg-white/30":i&&!t?"bg-main-divider":"",t?"w-8 h-8 text-secondary-light hover:text-secondary-hove":`${lf[n]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:a,"aria-label":l,onClick:c,...fe(s),children:o(ne,{image:r,className:u("h-full",{"bg-main-divider/20 rounded-full":t}),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),sf="chatbot",of="text-page__btn-chat",cf={personal:"//chat.mes.rshb.ru/assets/js/webchat_rshb",business:""},df=d((({chat:e="personal",iconVersion:t,className:n,ariaLabel:i="Чат",version:l})=>{const r=(e=>{a((()=>globalThis.localStorage?.setItem("webchat-keep-open",String(Date.now()))),[]);const t=cf[e??""];return n=>{if(t)if("personal"!==e)Hi(sf,t);else{const e=n.target;e?.classList.contains(of)||e?.classList.add(of),document.getElementById("webchat-js-container:webchat_rshb")||Hi(sf,t)}}})(e);return o(rf,{className:n,image:{icon:"HeadphonesIcon",iconVersion:t},ariaLabel:i,onClick:r,buttonSize:"large",isGrayBg:!0,version:l})})),mf=d((({className:e="",active:t,dataItemName:n,children:i,data:a,...l})=>{const r=pe(),{href:s,target:d,text:m,onClick:h}=r(l);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,...fe(a),children:[o("span",{className:uf(t),children:m||i}),t?o("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-white"}):null]})})),uf=(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"),hf=d((({observerOptions:e,onVisibilityChange:t,children:n,className:i,...a})=>{const r=ed(l((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e);return o("span",{ref:r,className:i,role:"menuitem",children:o(mf,{...a,children:n})})})),pf={default:"bg-main-divider text-primary-main rounded hover:text-primary-main",transparent:"backdrop-opacity-30 bg-white/30 hover:text-primary-hover text-white"},gf=d((({version:e,text:t,mobileText:n,...i})=>{const a=ke()?n:t;return a?o(Ne,{className:u("py-s px-lg font-light whitespace-nowrap",pf["transparent"===e?"transparent":"default"]),...i,children:a}):null})),ff=d((({subItems:e=[],version:t,internetBankButton:n,dropdownMenuAriaLabel:a,chatBotAriaLabel:l})=>{const d="transparent"===t?"white":"black",[,m]=Zg(e),[u,h]=i(e.length),p=e.slice(u),g=s(null),f={rootRef:g},x=r((()=>e.map(((e,t)=>e=>{h(e?xf(t):yf(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(hf,{className:u-1<t?"invisible":"",active:e===m,observerOptions:f,onVisibilityChange:x[t],data:e.dataHeader,...e},String(t))))}),p.length?o(tf,{items:p,activeItem:m,ariaLabel:a}):null,A.CHAT_BOT?o(df,{version:t,iconVersion:d,chat:A.CHAT_BOT,ariaLabel:l}):null,o(gf,{version:t,...n})]})})),xf=e=>t=>Math.max(t,e+1),yf=e=>t=>Math.min(t,e),bf=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(_e,{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(vf,{...e},String(t))))})]}):null,vf=d((({icon:e,...t})=>{const n=pe(),{text:i,target:a,href:l,onClick:r}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ne,{image:e}):null,i?o("a",{className:"hover:text-primary-hover",href:l,target:a,onClick:r,children:o(_e,{size:"text-l",font:"font-light",color:"text-primary-text",children:i})}):null]})})),Nf=(e,t)=>n=>n.name?o(vu,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:bu(e,n.name),children:o(_e,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,wf=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(hn,"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"})]}))),Cf=d((({defaultLocation:e})=>{const t=Op(e),n=pe(),{href:i}=n({href:`/branches/${t.slug}`});return t?o("div",{className:"mb-s",children:c(w,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(vu,{href:i,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),Sf=d((({foreignOffices:e,branches:t,onClose:n})=>{const a=Vp(t?.default),[s,d]=i(""),m=xo(),u=r((()=>If(m).sort(((e,t)=>e.name.localeCompare(t.name)))),[m]),h=r((()=>((e,t)=>{const n=new Map;for(const i of e){const e=t(i),a=n.get(e)||[];n.set(e,[...a,i])}return n})(u,kf)),[u]),p=l((e=>{a.location=e,n?.()}),[a,n]);return c(er,{className:"pb-20",head:c("div",{children:[o(_e,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(Cf,{defaultLocation:t?.default}),o(wf,{onSearch:d,searchTerm:s})]}),onClose:n,children:[s&&s.length>=3?o("div",{children:u.filter((({name:e})=>e&&Rg(e.toLowerCase())(s.toLowerCase())>=.8)).map(Nf(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(_e,{size:"text-h6",children:e})}),t.map(Nf(f,g))]},e)))}),bf(e)]});var g,f})),kf=e=>e.name?.charAt(0)??"",If=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),Tf=d((({className:e="",active:t,flat:n,children:i,data:a,...l})=>{const r=pe(),{href:s,target:c,text:d,onClick:m}=r(l);return o("a",{className:u(Bf(t,n),e),href:s,target:c,onClick:m,rel:"noopener noreferrer","aria-label":`Ссылка на ${d}`,...fe(a),children:o("span",{suppressHydrationWarning:!0,className:Pf(t,n),children:d||i})})})),Bf=(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}),Pf=(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"),Rf=d((({className:e,version:t,...n})=>{const i="transparent"===t?"white":"black",a=Op(n?.branches?.default),r=sn(Vg,n),s=sn(Sf,n),d=l((()=>r.open({})),[r]),m=l((()=>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:[n?.branches?.visible?o(Tf,{className:"whitespace-nowrap text-ellipsis overflow-hidden",flat:!0,href:"#",text:a?.name,data:bu(n?.branches?.dataClick,a?.name??""),onClick:m}):null,n?.officesAtms?.href?o(Tf,{className:"whitespace-nowrap",flat:!0,...n.officesAtms}):null,o(rf,{image:{icon:"LoupeIcon",iconVersion:i},ariaLabel:n?.search?.ariaLabel??"Поиск",onClick:d,data:n?.search?.data})]})})),Df=d((({observerOptions:e,onVisibilityChange:t,children:n,className:i,...a})=>{const r=ed(l((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e);return o("span",{ref:r,className:i,role:"menuitem",children:o(Tf,{...a,children:n})})})),Mf=d((({navigationItems:e=[],activeTopItem:t,dropdownMenuAriaLabel:n,version:a,headerData:l,search:d,bgColor:m,logo:u})=>{const[h,p]=i(e.length),g=e.slice(h),f=s(null),x={rootRef:f},y=r((()=>e.map(((e,t)=>e=>{p(e?Af(t):_f(t))}))),[e]),{dataFooter:b,dataHeader:v,...N}=u??{};return c("div",{className:"flex items-center justify-between",children:[o(xc,{className:"mr-3xl",bgColor:m,logo:N,data:v,showTitle:!1}),o("div",{ref:f,className:"overflow-hidden min-w-[160px] pb-xs mt-xs",role:"menu",children:e.map(((e,n)=>o(Df,{className:h-1<n?"invisible":"",active:e===t,observerOptions:x,onVisibilityChange:y[n],data:e.dataHeader,...e},String(n))))}),g.length?o(tf,{className:"mx-xs",items:g,activeItem:t,ariaLabel:n}):null,o(Rf,{version:a,className:"ml-auto",search:d,navigationItems:e,...l})]})})),Af=e=>t=>Math.max(t,e+1),_f=e=>t=>Math.min(t,e),Ef={"bg-white":"primary",transparent:"transparent"},zf=["all","header"],Ff=Ot((({className:e,bgColor:t="bg-white",logo:n={},version:i=Ef[t],portal:a,header:l={},...r})=>{const{common:s,navigation:d}=Vf(r?.options?.page),{navigationItems:m}=d,{logo:h={}}=s,[,p]=Zg(m),{internetBankButton:f}=a||{},x=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:i,...r,children:c("div",{className:"container",children:[o("div",{className:"whitespace-nowrap",children:o(Mf,{activeTopItem:p,navigationItems:m?.filter(xg(zf)),version:i,headerData:{...l,...d},search:s.search,bgColor:t,logo:x})}),o("div",{className:u("mt-s h-px bg-main-divider",Of(i))}),p?.items?.length&&o(ff,{subItems:p?.items?.filter(xg(zf)),version:i,internetBankButton:f})]})})})),Of=e=>"transparent"===e?"opacity-30":"",Vf=e=>({navigation:e?.navigation??{},common:e?.common??{}}),Lf=(e=!1)=>e?{}:{padding:"p-0"},$f={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},qf=Ot((({className:e="",padding:t="p-0",gap:n="XS",isInnerPadding:i=!0,version:a="transparent",isTheme:l=!1,isCardBorder:r,...s})=>o(g,{className:u("relative","grid grid-cols-12",$f[n],e),padding:t,version:a,isTheme:l,...s,children:R({...s,extraProps:{...Lf(i),className:Jc(r)}})})),{childrenTypes:{exclude:["HorizontalLayout"]}}),jf=d((e=>{const{className:t,align:n,image:i,...a}=e,l=n?u("flex",im[n]):"";return o(g,{className:u(l,t),defaultPadding:"p-0",...a,children:o(ne,{image:i})})})),Uf=(e,t=0)=>{const{itemCount:n,visibleItemCount:a}=e,[r,s]=i(t),o=l((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=l((()=>s((e=>Math.max(e-1,0)))),[n]),d=a?n>a&&r<n-a:r<n-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]};function Wf({dec:e,inc:t,canDec:n,canInc:i,btnClass:a,className:l=""}){return n||i?c("div",{children:[n?o(fd,{className:u("absolute z-40",a[0],l),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!n}):null,i?o(fd,{className:u("absolute z-40 rotate-180",a[1],l),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!i}):null]}):null}const Hf=d((({className:e="",cards:t=[],button:n})=>{const[a,r]=i(0),s=l((e=>r(e)),[]),d=t.length,[m,u]=Uf({itemCount:d,visibleItemCount:2}),{canDec:h,canInc:p}=u,g=t[m]?.href;return c("section",{role:"listitem",className:`min-w-full text-center ${e}`,children:[c("div",{className:"relative overflow-hidden","aria-label":"Страховые программы",children:[d?Yf({activeIndex:m,cards:t,selectedCardIndex:a,onClick:s}):null,Wf({...u,btnClass:["left-12","right-12"],className:"top-16"}),h?o("div",{className:"absolute top-0 left-0 h-full w-32 bg-opacity-from-white"}):null,p?o("div",{className:"absolute top-0 right-0 h-full w-32 bg-opacity-to-white"}):null]}),o(Ne,{className:"w-60 text-center",version:"primary",...n,href:g})]})}));function Yf({activeIndex:e,cards:t,selectedCardIndex:n,onClick:i}){const a=460*e,l=t.length>2?"justify-start":"justify-center";return o("div",{style:{transform:`translateX(-${a}px)`},className:"duration-1000 px-6xl",children:o("div",{className:`w-full flex flex-nowrap gap-s pb-6xl ${l}`,children:t.map(((e,t)=>function({slide:e,i:t,isActive:n,onClick:i}){return c("button",{type:"button",onClick:i,className:"p-3xl min-w-fit flex items-center gap-2xl bg-white border-solid border relative "+(n?"shadow-dark-blue border-primary-main":"ease-in duration-300 border-gray"),children:[e?.icon?o(ne,{className:"p-lg rounded-full bg-secondary-light",image:e.icon,width:"108",height:"108"}):null,c("div",{className:"flex gap-s",children:[e?.sum?Kf("страховая сумма",e.sum):null,e?.fee?Kf("страховой взнос",e.fee):null]}),Gf(n)]},String(t))}({slide:e,i:t,isActive:Boolean(t===n),onClick:()=>i(t)})))})})}function Kf(e,t){return c("div",{className:"flex flex-col text-left whitespace-pre",children:[c(_e,{size:"text-h6",children:[He(2)(t)," ₽"]}),o("div",{className:"mt-2xs",children:o(_e,{size:"text-l",color:"text-secondary-text",children:e})})]})}function Gf(e){return e?o(ne,{className:"h-6 w-6 min-w-6 min-h-6 absolute right-4 top-4",image:{icon:"DoneIcon"},width:"24",height:"24"}):null}const Xf=d((({className:e="",title:t,insuranceTabs:n=[],button:a,...r})=>{const[s,d]=i(0),m=l((e=>d(e)),[]);return c(g,{className:u("box-border overflow-hidden relative px-0 space-y-2xl",e),defaultPadding:"p-6xl",...r,children:[t?o(N,{className:"text-center",title:t,headingType:"h3"}):null,n?.length>1?o("div",{className:"p-xs bg-secondary-light w-fit mx-auto rounded-md",children:n.map(((e,t)=>function({title:e,i:t,isActive:n,onClick:i}){return o("button",{type:"button",onClick:i,"aria-label":`Кнопка ${e}`,className:"box-border px-m py-s text-m font-light "+(n?"bg-primary-main text-white rounded-md":"text-secondary-text"),children:e},String(t))}({title:e?.title,i:t,isActive:Boolean(t===s),onClick:()=>m(t)})))}):null,o("div",{className:"flex",style:{transform:`translateX(-${s}00%)`},role:"list",children:Jf({insuranceTabs:n,button:a})})]})})),Jf=({insuranceTabs:e,button:t})=>{const n=e?.map((e=>e.cards));return n?.length?n.map(((e,n)=>o(Hf,{button:t,cards:e},String(n)))):null};const Zf={yellow:"bg-yellow",green:"bg-green","green-light":"bg-green-light","green-dark":"bg-green-dark"},Qf={XS:"h-10",S:"h-16",M:"h-24",L:"h-32",XL:"h-52"},ex=d((e=>{const{className:t="",__html:n,isDotted:i,investmentZeroColumn:a,investmentColumns:l,...r}=e,s=l?[...l]:[];return a&&s.unshift(a),o(g,{className:t,defaultPadding:"p-4xl",...r,children:c("div",{className:"container text-m font-light space-y-4xl",children:[s?.length?c("div",{children:[c("div",{className:"flex items-end relative pl-3xl pr-lg text-white",children:[_d(o("div",{className:"w-px h-4 bg-gray"}))(s.map(tx)),o("div",{className:"absolute right-3xl w-px h-4 bg-gray"})]}),o("div",{className:"border-t border-gray -mt-xs mx-3xl"}),o("div",{className:"flex justify-between text-primary-text mt-s -mx-5xl",children:s.map(ax)})]}):null,n?o("div",{className:"max-w-2xl font-light text-base",children:o(Me,{__html:n,isDotted:i,itemSize:"list-s"})}):null]})})})),tx=(e,t,n)=>{const i=1===t,a=t===n.length-1,l=e.cells?.reverse()||[];return o("div",{className:`${nx(i,a,e.cells)}`,children:l.length?o("div",{className:"w-full "+(a?"border-4 border-green-more-dark p-1.5 min-w-72":""),children:l.map(ix)}):null},`column_${t}`)},nx=(e,t,n=[])=>[n.length?"flex-1":"flex-0",!n.length||e||t?"":"pl-s",n.length&&!t?"pr-s pb-3xl":"pb-xl"].join(" "),ix=(e,t)=>{const n=e.cellSize||"XS",i=e.cellColor||"green";return e.text?o("div",{className:`flex-1 flex items-center justify-center relative py-xs ${Qf[n]} ${Zf[i]} ${"XS"===n?"px-s":"px-5xl"}`,children:o(_e,{align:"text-center",children:e.text})},`cell_${t}`):null},ax=(e,t)=>e?.title?o("div",{className:"flex-1 max-w-44 text-center px-xs last:pr-4xl last:max-w-52",children:e.title},`title_${t}`):null,lx=["байт","Кб","Мб","Гб","Тб","Пб"],rx=d((({icon:e,text:t,href:n,target:i,fileFormat:a,data:l,fileSize:r})=>{const s=r&&a?",":"",d=r??"",m=a?String(a):"";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:i,...fe(l),children:[e,t?c(_e,{size:"text-l",font:"font-light",children:[t," ",sx(d,m),o(_e,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),sx=(e,t)=>e||t?o("span",{children:", "}):"",ox=(e,t)=>(n,i)=>{const a=j(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),l="Attachment"===n?.docType?((e,t=2)=>{if(0===e)return"";const n=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,n)).toFixed(t))} ${lx[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?dx(a):n?.fileFormat;return c("div",{role:"listitem",children:[o(rx,{text:n?.text,target:n?.target,href:a,fileFormat:r,fileSize:l,icon:cx(t),data:n?.data}),o(Me,{__html:n?.__html})]},String(i))},cx=e=>e?o(ne,{className:"min-w-6 min-h-6",image:e,width:"24",height:"24"}):null,dx=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),i=-1!==t?e.substring(t+1):"";return i.includes("/")?i.replace(n,""):i},mx=d((({href:e,__html:t,target:n,onClose:i})=>{const a=D(),l=j(a)(e);return c(er,{className:"my-6xl min-h-fit w-fit mx-auto",onClose:i,children:[t?o(Me,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(Ne,{text:"Я согласен",version:"primary",target:n,href:l,onClick:i}),o(Zl,{type:"button",version:"secondary",onClick:i,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]})})),ux=d((({text:e,href:t,target:n,__html:i,icon:a})=>{const{open:r}=sn(mx),s=l((()=>r({__html:i,href:t,target:n})),[i,t,n]);return e?c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[cx(a),o(_e,{font:"font-light",children:e})]}):null})),hx={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},px=Ot((({className:e="",title:t,description:n,align:i="text-center",documents:a,icon:l={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=D();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(S,{title:t,description:n,align:i,headlineVersion:"M",as:"h2",isEmbedded:!0}),a?.length?o("div",{className:u("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",hx[r]),role:"list",children:a.map(gx(d,l))}):null]})})),gx=(e,t)=>(n,i)=>{const a=n?.docType;return""===a?null:"reportSource"in n&&n?.reportSource?.__html?fx(t)(n,i):ox(e,t)(n,i)},fx=e=>(t,n)=>{const i={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(ux,{...i,icon:e,href:xx(t)?t?.href:t?.attachment?.src}),o(Me,{__html:t?.__html})]},String(n)):null},xx=e=>"href"in e,yx=Ot((({className:e,padding:t,align:n="text-left",buttons:i=[],description:a,image:l,__html:r,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const x="secondary"===p?"p-m min-w-32":"min-w-24",y=l?.src?o(ne,{className:"hidden lg:block",image:l}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:p,...f,children:c(Be,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(N,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:y,buttons:qe(i,{className:"flex-wrap"}),children:[a?o(_e,{size:"text-xl","font-weight":"font-light",children:a}):null,c("div",{className:u("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[r?o(Me,{__html:r,itemSize:"list-m"}):null,o(_e,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),d?.src?o("div",{className:u("flex justify-center bg-white rounded-md @xl:-order-1",x),children:o(ne,{className:"w-fit",image:d})}):null,l?.src?o(ne,{className:"lg:hidden",image:l}):null]})]})})})),bx=(e,t)=>e&&"underlined"!==t?"primary":"secondary",vx=(e=[],t={})=>e.filter((({content:e={}})=>$d(t,e))).length,Nx=(e,t)=>e===t;const wx=(e=>(t,n)=>t===n||Boolean(t&&n&&Object.keys(t).length===Object.keys(n).length&&Object.entries(t).every((([t,i])=>e(i,n[t])))))(function(...e){return(t,n)=>e.some((e=>e(t,n)))}(Nx,((e=Nx)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,i)=>e(t,n[i])))))())),Cx=[],Sx={},kx={primary:"bg-white/30",secondary:"bg-main-divider"},Ix={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},Tx=d((({count:e,version:t="secondary"})=>{const n=ke(),i=n?"bg-main-divider":kx[t],a=Ix[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",i),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(_e,{size:"text-xs",color:a,children:e})})})),Bx=({text:e,description:t,icon:n,isActive:i,type:a})=>{const l=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white"),text:e?"mb-xs text-xl":"mb-2xs text-l text-primary-text",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal",oldText:"text-m text-center",oldDesc:"text-m-light"}))(i);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(ne,{className:u("h-6 w-6 min-w-6 min-h-6",l.icon),image:{...n,iconVersion:n?.iconVersion??l.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===a?l.text:l.oldText,children:e}),o("div",{className:"animated"===a?l.desc:l.oldDesc,children:t})]})]})},Px={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},Rx={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},Dx={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},Mx={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},Ax=d((({tag:e="div",item:t={},isActive:n=!1,type:i="default",onClick:a})=>{const l=e,{text:r,description:s,icon:d,count:m,tabName:h,...p}=t;return o(l,{className:u("h-12","block flex-1","cursor-pointer",Px[i],n?Mx[i]:Dx[i]),role:"tablist","aria-label":"Список табов",onClick:a,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?Rx[i]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[Bx({text:r,description:s,icon:d,isActive:n,type:i}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(Tx,{count:m,version:bx(n,i)})}):null]})})})),_x=d((e=>o(e?.item?.href?Ex:zx,{...e}))),Ex=d((e=>{const t=pe(),n=l((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:i,...a}=t({...e.item,onClick:n});return o(Ax,{...e,tag:"a",item:a,onClick:i})})),zx=d((({item:e={},onClick:t,...n})=>{const i=l((()=>{t&&t(e)}),[t,e]);return o(Ax,{item:e,onClick:i,...n})})),Fx=(e,t,n)=>(i,a)=>o(_x,{isActive:i===e,onClick:t,type:n,item:i},String(a)),Ox=d((({className:e,tabsType:t="default",items:n=[],activeItem:i,onChange:a})=>o("div",{className:u("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tabpanel","aria-label":"Панель управления табами",children:n.map(Fx(i,a,t))}))),Vx={categories:[],extraOptions:[],propertyType:[],stage:[]},Lx=Ot((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:i,...a})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=jd(Vx,{block:a.block,page:a.options?.page}),f=l(((e=Vx)=>p(e)),[]),x=(({hotFilters:e=Cx,filtrationState:t=Sx,blocks:n=Cx,onFiltrationStateChange:i})=>{const a=r((()=>Math.max(0,e.findIndex((e=>wx(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:vx(n,t.filter),version:bx(t===e[a])})))),[e,n,a]),o=l((t=>{i(e[s.indexOf(t)].filter)}),[e,s]);return{activeItem:s[a],items:s,onChange:o}})({hotFilters:t,filtrationState:s,blocks:a.block?.blocks,onFiltrationStateChange:f});return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...a,children:[o(Ox,{...x}),o(zd,{filtrationSchema:n,resetButton:i,field:m,reset:h}),o(Md,{blocksToRender:d,...a})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),$x=(e,t,n)=>{const i=bx("all"===t),a=bx("business"===t),l=(e,t,i)=>{const a=e.currentTarget===e.target&&"business"===t?r(i):i;return n(t),a},r=e=>e.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription));return c("div",{className:"flex gap-lg flex-col sm:flex-row pb-lg",children:[o(Zl,{"data-id":"all",onClick:t=>l(t,"all",e),version:i,children:"Для физических лиц"}),o(Zl,{"data-id":"business",onClick:t=>l(t,"business",e),version:a,children:"Для юридических лиц"})]})},qx=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o(Me,{__html:e,richVersion:n})}):null,t?.length?o("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl",children:t.map(((e,t)=>c("div",{className:"flex gap-xs items-center",children:[e?.image?o(ne,{image:e.image}):null,e?.text?o(_e,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,jx="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",Ux=({filters:e,field:{field:t,reset:n},onlyOffice:i,labels:a})=>{const l=i?5:6,r=(e||[]).map((e=>o(Pi,{text:a[e],...t(e)},e))),[s,d]=l>0?[r.slice(0,l),r.slice(l)]:[r,[]];return o("div",{children:e?.length?o("div",{children:o(la,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:jx,children:s}),o(ra,{className:jx,isUnfolded:e,children:d})]}),renderFoldButton:Wx(n,i)})}):null})},Wx=(e,t=!1)=>({isUnfolded:n,onToggle:i})=>c("div",{className:"flex space-x-lg",children:[t?o(Ne,{version:"transparent",className:"text-secondary-text [&>*]:p-0",appendRight:o(W,{name:["ArrowDownIcon","ArrowUpIcon"][Number(n)],width:"16",height:"16"}),text:["Больше фильтров","Меньше фильтров"][Number(n)],onClick:i}):null,o(Ne,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:e,children:Hx()})]}),Hx=()=>c("div",{className:"flex items-center",children:["Очистить фильтр",o(W,{name:"CloseIcon",width:"16",height:"16",className:"ml-2xs"})]}),Yx=(e,t)=>o("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:c(N,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(_e,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),Kx=()=>{},Gx=e=>"all"===e?"block":"hidden",Xx=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:a=[],renderCard:l=Kx,renderRemoteWorkplaceCard:r=Kx,getBalloon:s=Kx,getBalloonRemoteWorkplaces:d=Kx,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=an(za),{filteredItems:y,points:b,filteredRemoteWorkplaces:v,lengthItems:N}=$a({data:t,remoteWorkplaces:a,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=i("all"),S={filters:Jx([...t,...a]),field:{field:f,reset:x},onlyOffice:p,labels:Fa};return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[Yx(h,N),m?qx(m):null,p&&$x(t,w,C),o("div",{className:u("pb-3xl",Gx(w)),children:Ux(S)})]}),o("div",{className:"h-[600px]",children:o(Wa,{children:o(Ji,{points:b,isLoad:n,className:"h-full"})})})]}),c(Wa,{children:[y.map(l),v.map(r)]})]})})),Jx=e=>Object.keys(za).filter((t=>e.filter((e=>Oa[t](e))).length)),Zx=({location:e,address:t,billAcceptorType:n,terminalType:i,billAcceptorEnable:a,atmCode:l="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:ty(i)},{label:"Модуль приема наличных",value:a?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:l}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(_e,{size:"text-h4",children:ty(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(_e,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(wa,{color:"green",children:ty(s)})})]}),o("div",{className:"hidden sm:block",children:o(ma,{className:"flex-wrap",children:m?.map(ey)})}),o(la,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ra,{isUnfolded:e,children:o(ma,{className:"flex-wrap",children:m?.map(ey)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Pa({isUnfolded:e,onToggle:t})})]},String(d))},Qx=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${ty(t)} №${n}`,body:e.toUpperCase()}),ey=(e,t)=>o(sa,{...e},String(t)),ty=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",ny=[];const iy=async e=>{const t=await Rt(e,{method:"GET"});return Array.isArray(t)?t:ny},ay={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},ly={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},ry=d((({descriptionData:e,className:t})=>{const n=Op(),i=n?.code??"000",{data:a,isLoad:l}=function(e){const{data:t,error:n}=gi(`${Ut}/atms?regionCode=${e}`,iy);return{data:t||ny,isLoad:!t&&!n}}(i);return o(Xx,{className:t,filterItems:sy,data:a,isLoad:l,initFilterState:ay,renderCard:Zx,getBalloon:Qx,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),sy=(e,t)=>{const n=Object.keys(t).filter((e=>t[e])),i=n.filter((e=>e.startsWith("terminalType"))),a=n.filter((e=>!i.includes(e)));return e.filter((e=>{const t=a.every((t=>ly[t](e))),n=!i.length||i.some((t=>ly[t](e)));return t&&n}))},oy=({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(_e,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(_e,{size:"text-l",children:e})]}):null]})}),o("div",{className:"hidden sm:block",children:cy({workScheduleDescription:t})}),o(la,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ra,{isUnfolded:e,children:cy({workScheduleDescription:t})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Pa({isUnfolded:e,onToggle:t})})]},String(n)):null,cy=({workScheduleDescription:e})=>c("div",{children:[c(ma,{className:"flex",children:[o(sa,{label:"Операции для физических лиц",children:o(_e,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(sa,{label:"Операции для физических лиц",children:o(_e,{children:"Оформление и обслуживание банковских карт"})}),o(sa,{label:"Операции для физических лиц",children:o(_e,{children:"Инвестиционное и накопительное страхование"})}),o(sa,{label:"Операции для физических лиц",children:o(_e,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(sa,{label:"Режим работы",className:"max-w-none",children:o(_e,{children:e})})]}),dy=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),my={branches:[],remoteWorkplaces:[]};const uy=async e=>await Rt(e,{method:"GET"})||my,hy=d((({className:e})=>{const t=Op(),n=t?.code??"000",{data:i,isLoad:a}=function(e="000"){const{data:t,error:n}=gi(`${Ut}/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,uy);return{data:t||my,isLoad:!t&&!n}}(n);return o(Xx,{className:e,data:i?.branches,isLoad:a,remoteWorkplaces:i?.remoteWorkplaces,renderCard:Aa,renderRemoteWorkplaceCard:oy,getBalloon:Ea,getBalloonRemoteWorkplaces:dy,title:`Офисы филиала ${t?.name}`})})),py=d((({data:e,className:t,...n})=>{const i=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===i?o(hy,{}):o(ry,{descriptionData:e})})})),gy=d((({className:e,title:t,description:n="Блок в разработке...",...i})=>c(g,{className:u("box-border",e),...i,children:[o(S,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(f,{})]}))),fy="hidden sm:flex absolute z-40 top-10",xy=Ot((({className:e="",padding:t,slides:n=[],...a})=>{const[l,r]=i(0),[s,d]=ud({itemCount:n?.length||0});return c(g,{className:u("box-border overflow-hidden",e),defaultPadding:"pt-6xl",padding:t,...a,children:[o("div",{className:"flex duration-1000",style:{transform:`translateX(-${100*l}%)`},role:"list",children:n.map((({productBlock:e},t)=>o("div",{className:"box-border grow-0 shrink-0 basis-full",role:"listitem",children:o(Ze,{className:"pl-6xl h-full",headlineVersion:"M",isFullWidthTitle:!1,...e,...a})},String(t))))}),c("div",{className:"relative pr-xs mt-m -mb-m flex gap-xs box-border",children:[o(ad,{containerRef:s,snapAlign:"snap-start",onVisibleIndicesChange:d.handleVisibleIndicesChange,itemClassName:"h-40 flex items-stretch w-screen",gap:8,children:n.map(yy({activeSlideIndex:l,onClick:r}))}),d.canScrollLeft?o(xd,{className:u("left-6",fy),onClick:d.scrollLeft}):null,d.canScrollRight?o(yd,{className:u("right-6",fy),onClick:d.scrollRight}):null]})]})})),yy=({activeSlideIndex:e,onClick:t})=>({nav:n},i)=>{const a=i===e,l=a?"min-w-[370px] mt-s h-28 bg-white shadow-dark-blue border-none p-6":"min-w-72 mt-lg h-24 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=a?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=a?"text-secondary-text text-l font-light":"text-secondary-text text-m font-light group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(i),"aria-label":n?.title,className:u("relative overflow-hidden grow","ml-xs px-xl","box-border basis-0 border","border-gray group-data-secondary:border-white/50","text-left whitespace-nowrap",l),children:[o("div",{className:r,children:n?.title}),o("div",{className:s,children:n?.description})]},String(i))},by=d((({address:e,email:t,telephone:n,button:i,className:a="",__html:l,richVersion:r,icon:s,title:d,version:m="primary",...h})=>c(g,{className:u("box-border text-left space-y-s",a),version:m,...h,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[$e(s)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ne,{image:s})}):null,d?o(N,{headingType:"h3",as:"h3",title:d}):null]}),c("div",{className:"w-full space-y-m",children:[l?vy({__html:l,richVersion:r}):null,Ny({label:"Адрес",data:e,iconName:"GeolocationIcon"}),Ny({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),Ny({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),i?.text?qe([i]):null]})]}))),vy=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(Me,{...e,itemSize:"list-s"})}),Ny=({label:e,data:t,iconName:n,dataColor:i=""})=>t?c("div",{className:"flex gap-s",children:[o(W,{iconVersion:"black",name:n,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(_e,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(_e,{size:"text-xl",color:i,children:t})]})]}):null,wy=d((e=>{const{__html:t,richVersion:n="",...i}=e;return o(g,{defaultPadding:"p-0",...i,children:o(Me,{__html:t,richVersion:n})})})),Cy=d((({label:e,labelIconBgVersion:t,icon:n,onToggle:i,labelIcon:a})=>o(Id,{tag:"button",className:u("border-none bg-transparent items-center group/button",a?.icon?"py-xs":"py-lg"),onClick:i,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[null,e?o(_e,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:n?o(W,{name:n,iconVersion:"color",width:"24",height:"24"}):null}))),Sy=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",ky=(e=!1)=>e?"MinusIcon":"PlusIcon",Iy=(e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon",Ty=Ot((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,label:i="Развернуть",labelIcon:a,labelIconBgVersion:l,foldButtonVersion:r="default",version:s,role:c,...d})=>{const m=ke();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:c,...d,children:o(la,{isFoldButtonOnTop:n,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(ra,{className:u("gap-lg",Sy(m)),isUnfolded:e,children:R({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>By({foldButtonVersion:r,label:i,labelIcon:a,labelIconBgVersion:l,isUnfolded:e,onToggle:t,isMobile:m})})})}),{childrenTypes:{exclude:["RollupItem"]}}),By=({foldButtonVersion:e,label:t,labelIcon:n,labelIconBgVersion:i,isUnfolded:a,onToggle:l,isMobile:r=!1})=>{const s=t||(a?"Скрыть":"Развернуть"),c=((e=!1,t=!1)=>t?Iy(e):ky(e))(a,r);return"accordion"===e?o(Cy,{label:s,labelIcon:n,labelIconBgVersion:i,icon:c,onToggle:l}):o(Td,{label:s,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:l})},Py=d((({name:e,text:t,value:n,checked:i,onChange:a,className:l})=>o("div",{className:l,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:u(hn.split(" ").filter((e=>"rounded"!==e)),Ti,"flex justify-center items-center after:block after:w-2.5 after:h-2.5 after:rounded-full rounded-full","checked:border-2 checked:!border-primary-main focus:checked:border-primary-main checked:after:bg-primary-main"),type:"radio",value:n,name:e,checked:i,onChange:e=>a?.(e.target.value),role:"radio"}),t?o(_e,{color:"text-primary-text",children:t}):null]})}))),Ry=d((({className:e=""})=>{const[t,n]=i("option2"),a=l((e=>n(e)),[]);return c("div",{className:u("order-4",e),role:"radiogroup",children:[o(Py,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),o(Py,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),Dy=d((({data:e,fieldLabel:t,fieldValue:n,selected:i,placeholder:a="",setSelected:l,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[n||t],text:e?.[t]}))),c=s.find((e=>e.key===i));return o(Dn,{options:s,label:r,placeholder:a||i,onChange:e=>l(e.key),value:c})})),My=d((({regions:e=[],selectedRegion:t,onSelectedRegion:n,branches:i=[],selectedBranch:a,onSelectedBranch:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Dy,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(Dy,{data:i,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:l,label:"Отделение",placeholder:"Выберите отделение"})})]}))),Ay=["От 1 дня","До 365 дней"],_y=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(_e,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(Qa,{min:1,max:365,value:e,items:Ay,onChange:t})]}))),Ey=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:n,safeBoxCases:i=[],selectedBoxSize:a,onSelectedBoxSize:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Dy,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(Dy,{data:i,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:l,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),zy=d((({regions:e,selectedRegion:t,branches:n,selectedBranch:i,days:a,selectedCaseVolume:l,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:u})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(My,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:i,onSelectedBranch:Fy(m)}),o(_y,{days:a,setDays:e=>m({days:e})}),o(Ey,{caseVolumes:d,selectedCaseVolume:l,onSelectedCaseVolume:Oy(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(_e,{size:"text-l",font:"font-light",color:"text-secondary-text",children:"Тип договора"})}),c("div",{className:"contents @md:flex justify-between items-center gap-m",children:[o(Ry,{}),o(Ne,{text:"Офисы на карте",version:"primary",onClick:u,className:"order-6"})]})]}))),Fy=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},Oy=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},Vy=d((({days:e,tariffs:t=[]})=>{const n=$y(e,t),i="На рисунке изображена пачка листов\nформата А4";return c("div",{className:"contents @xl:flex flex-col justify-between gap-xl order-2",children:[c("div",{className:"flex flex-col @xl:flex-row gap-x-6xl gap-y-2xl order-5 @xl:order-none py-2xl @xl:py-0 border-t border-main-divider @xl:border-none",children:[Ly("Аренда за",e),Ly("Цена",n+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:i})}),c("div",{className:"flex flex-col items-center gap-s order-3 @xl:order-none mb-xl @xl:mb-0 bg-primary-main py-s @xl:p-3xl text-center",children:[o(ne,{image:{icon:"PackA4Icon"},className:"@xl:h-60"}),o("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:o(w,{size:"text-s",font:"font-light",color:"text-white",children:i})})]})]})})),Ly=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(_e,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o("span",{className:"text-l @xl:text-h3 text-primary-text",children:t})]}),$y=(e,t)=>{const n=qy(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},qy=e=>{let t=1;switch(!0){case e>30&&e<=90:t=2;break;case e>90&&e<=180:t=3;break;case e>180&&e<=365:t=4}return t},jy=(e,t)=>e.find((e=>e.branchCode===t)),Uy=d((e=>{const{regions:t,data:n,branches:i,onChange:l,onClick:r}=e;a((()=>{l({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,l]);const s=jy(i,n.selectedBranch),d=Wy(s?.safeBoxCaseVolumes),m=Hy(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=Yy(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(zy,{...n,regions:t,onClick:r,branches:i,caseVolumes:d,safeBoxCases:m,onChange:l}),o(Vy,{days:n.days,tariffs:u})]})})),Wy=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Hy=(e,t)=>e?.find((e=>e.volume===t)),Yy=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Ky=`${Ut}/safeboxes`,Gy=[];const Xy=async e=>await Rt(e,{method:"GET"})||Gy,Jy=d((({title:e,footnote:t,className:n="",...a})=>{const[r,s]=i(!1),d=l((()=>s((e=>!e))),[]),[m,u]=i({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),h=xo(),p=Zy(m.selectedRegion,h),f=function(e){const{data:t}=gi(e?`${Ky}?regionCode=${e}`:null,Xy);return t||Gy}(p),x=l((e=>u((t=>({...t,...e})))),[u]),y=(b=jy(f,m.selectedBranch)||f,Array.isArray(b)?b.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)].filter(Boolean),content:void 0}))).filter((e=>e.coords&&2===e.coords.length)):b?.gpsLatitude&&b?.gpsLongitude?[{coords:[b.gpsLatitude,b.gpsLongitude]}]:[]);var b;return c(g,{className:n,defaultPadding:"",...a,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(N,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(Uy,{regions:h,branches:f,data:{...m,selectedRegion:p},onClick:d,onChange:x}),t?o(w,{size:"text-s",font:"font-light",children:t}):null]}),y.length&&r?o(Ji,{points:y,className:"h-[640px]"}):null]})})),Zy=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,Qy=e=>e<4?"w-72":"w-52",eb={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"},tb=d((({buttons:e,className:t="",description:n,showLines:i=!0,steps:a=[],stepVersion:l="gray",title:r,version:s="primary",...d})=>{const m=a.length>3,h=eb,p=(e=>e?"":"opacity-0")(i),f=ke();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:r,description:n,isEmbedded:!0,className:"w-full",align:Kd(f)}),a?.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:_d(o("div",{className:u("h-0.5 w-full bg-secondary-light flex-1",p)}))(a.map(nb(h,m,l)))}),o("div",{className:u("flex justify-between",m?"gap-x-s":"gap-x-20"),children:a.map((x={styleMap:h,version:s},(e,t,n)=>{const{styleMap:i,version:a}=x,{label:l,description:r,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",Qy(n.length)),children:[c("div",{className:"space-y-xs",children:[l?o(_e,{size:"text-h6",align:"text-center",children:l}):null,c("div",{className:"flex flex-col items-center gap-3xs",children:[r?o("div",{className:i.description,children:r}):null,o(Me,{__html:e.__html,itemSize:"list-s",isDotted:d})]})]}),s?.text?o(Ne,{className:"box-border py-s w-full mt-auto",version:a,...s,children:s?.text}):null]},String(t))}))})]}):null,qe(e)]});var x})),nb=(e,t,n)=>({icon:i},a)=>{const l="secondary"===n?"white":"color";return o(g,{defaultPadding:"",className:`${ib(t)} flex justify-center items-center text-center rounded-full box-border z-10`,version:n,children:$e(i)?o(ne,{image:{...i,iconVersion:i?.iconVersion||l},width:"48",height:"48"}):o("span",{className:u("text-h4","transparent"===n?e.iconText:(r=n,"secondary"===r?"group-data-primary:text-white":"text-secondary-text")),children:a+1})},String(a));var r},ib=e=>e?"h-16 w-16":"h-24 w-24",ab=d((()=>o("div",{className:"hidden",role:"none"}))),lb="hidden sm:flex absolute z-40",rb={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},sb=d((({className:e,items:t=[],activeItem:n,onChange:i,tabsType:l="default"})=>{const[r,s]=ud({itemCount:t?.length||0});return a((()=>ob(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(ad,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:rb[l].item,gap:rb[l].gap,children:t.map(Fx(n,i,l))}),s.canScrollLeft?o(xd,{className:u("left-6",lb,rb[l].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(yd,{className:u("right-6",lb,rb[l].buttonTop),onClick:s.scrollRight}):null]})})),ob=(e,t,n)=>{const i=t.findIndex((e=>e===n));e&&i>0&&e.scrollTo({left:e?.children[i]?.offsetLeft,behavior:"smooth"})},cb={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},db=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(cb[t].wrapper,e),children:o(sb,{className:cb[t].component,tabsType:t,...n})}):null,mb=Ot((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=ub(n??{}),p=D(),f=t.every((e=>"link"===e?.type)),x=s?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,{isReady:y}=p,[b,v]=i(gb(x,((e="")=>{const t=globalThis?.location?.href;return t?new URL(t).searchParams.get(e):null})(h))),N=x[b],w=x.findIndex((e=>Boolean(e.selected)));a((()=>{const e=p.query[h]?x.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===p.query[h])):w;v(-1===e?0:e)}),[y,w,h]);const C=pb(x[b],b),S=l((e=>{const t=x.indexOf(e),n=x[t];v(t),"group"===n.type&&((e,t)=>{const n=new URLSearchParams(p.query);e.text?n.set(h,e?.tabName??String(t)):n.delete(h),p.replace(`${p.pathname}?${n}`,"",{scroll:!1})})(e,t)}),[x]);return c(g,{className:u({"sticky top-1 z-20":d&&f},e),defaultPadding:"p-0",block:n,...m,children:[db({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:hb(t,x),activeItem:N,tabsType:r,onChange:S}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:Object.entries(n?.slots??{}).map((([e,t])=>P(t,{...m?.options,slotName:C,parent:n,extraProps:{className:e===C?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(pb)?.filter(Boolean)||[]}),ub=({__id:e,anchor:t})=>t??e??"tabs",hb=(e,t)=>t?.length?t:e,pb=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",gb=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),fb={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},xb=d((({children:e,activeIndex:t,columnWidth:n,version:i="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:fb[i],style:{transform:`translateX(-${t*n}px)`},children:e})}))),yb=d((({className:e="",isOpen:t,onClick:n})=>o(Ne,{className:e,appendRight:o(ne,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"24",height:"24"}),text:t?"Скрыть":"Показать",version:"gray",onClick:n}))),bb={Buttons:({buttons:e})=>qe(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ne,{image:e}):null,RichText:({__html:e,isDotted:t=!0})=>o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(Me,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(_e,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(_e,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:i,isOpen:a})=>e?o(yb,{className:"w-fit",isOpen:a,onClick:()=>{t({tableSource:n,pdfUrl:i})}}):null},vb=d((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:l,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=i(!0);a((()=>{l===o&&s||m(!0)}),[s,o]);return Nb({cell:e,cellProps:{rowIdx:n,cellIdx:l,fieldIdx:t,displayTable:e=>{m(!1),c(l),r(e)},isVisible:d}})})),Nb=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...i}=e;if(!n||!(n in bb))return null;return o(bb[n],{...t,...i})},wb=d((({cells:e,rowIdx:t,cellIdx:n,setTableInner:i,tableInner:a,openTableInnerIdx:l,setOpenTableInnerIdx:r})=>o("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>o(vb,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:i,tableInner:a,openTableInnerIdx:l,setOpenTableInnerIdx:r},String(s)))):null}))),Cb=(e,t)=>140*Mg(e.slice(0,t).map((e=>e?.cols?.length??1))),Sb=(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(_e,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,kb=d((({rows:e})=>{const t=e?.[0]?.length??0,[n,i]=Uf({itemCount:t,visibleItemCount:5});return c("div",{children:[e?.map((a=n,(e,t)=>{if(!e?.length)return null;const[n,...i]=e,l=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 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(_e,{size:"text-xl",font:"font-light",children:n.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:l,style:{transform:`translateX(-${Cb(i,a)}px)`},children:i?.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(_e,{size:"text-xl",children:e.data}):null,e?.cols?Sb(e.cols,a):null]},`row${t}`)))})})]},String(t))})),Wf({...i,btnClass:["left-3 top-20","right-3 top-20"],className:""})]});var a})),Ib=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const i=`activeTabIdx:${e}-tableIdx:${n}`;return c("div",{className:"w-full @container",children:[o("div",{className:"flex py-m sm:px-m bg-white @4xl:bg-gray relative",children:o(_e,{size:"text-xl",align:"text-left",children:t.title})}),o("div",{className:"w-full sm:pl-xs overflow-hidden transition-height duration-500 ease-in-out",children:o("div",{className:"relative",children:o(kb,{rows:t.rowsData})})})]},i)}))}))),Tb=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Bb=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:i})=>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:()=>i(t),children:o(_e,{size:"text-xl",font:"font-light",color:Tb(t===n),children:e||t+1})},e)))}):null,t?o(Ne,{className:"text-primary-main",href:t,version:"secondary",target:"_blank",appendLeft:o(W,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),Pb=Ot((({tableSource:e,pdfUrl:t,onClick:n})=>{const a=e?.tableData,[r,s]=i(0),d=l((e=>s(e)),[]),m=a?.[r]?.items??[],u=a?.map((e=>e.currency??""));return c("div",a?{className:"bg-white z-10",children:[o(Bb,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(Ib,{activeTabIndex:r,items:m}),o(yb,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(_e,{size:"text-h6",children:"Данных нет"}),o(yb,{onClick:n,isOpen:!0})]})})),Rb=d((({children:e,tableInner:t,onHideContentClick:n})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:u("@4xl:border-main-divider @4xl:border-b","flex flex-col @4xl:flex-row gap-y-xs gap-x-5xl pb-lg @4xl:pt-lg"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(Pb,{...t,onClick:n})}):null]}))),Db=d((({row:{header:e,data:t},activeIndex:n,rowIdx:a,...r})=>{const[s,d]=i(void 0),m=l((e=>d(e)),[]),[h,p]=i(void 0),g=l((e=>p(e)),[]);return c(Rb,{onHideContentClick:()=>d(void 0),tableInner:s,...r,children:[o("div",{className:u("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(ne,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(_e,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(xb,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(wb,{cells:e,rowIdx:a,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})})),Mb=d((({children:e,controls:t})=>{const{isScrollAvailable:n}=t;return c("div",{role:"table",className:"overflow-x-auto w-auto grid md:block",children:[c("div",{className:"relative space-y-xs",children:[e,Wf({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),n?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),Ab=d((({className:e="",title:t,description:n,rowHeaders:i,tariffsColumns:a,hiddenRowsNum:l=0,...r})=>{const s=a?.map((({data:e})=>e))||[],d=i?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=s.length,[h,p]=Uf({itemCount:m,visibleItemCount:2}),f=(d||[]).map(((e,t)=>o(Db,{row:e,activeIndex:h,rowIdx:t,...r},String(t)))),[x,y]=l>0?[f.slice(0,-l),f.slice(-l)]:[f,[]];return c(g,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...r,children:[o(S,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:l>0?o(la,{renderFoldableSection:({isUnfolded:e})=>c(Mb,{controls:p,children:[x,o(ra,{isUnfolded:e,children:y})]}),renderFoldButton:Bd}):o(Mb,{controls:p,children:f})})]})})),_b=d((({className:e="",title:t,description:n,iconVersion:i,__html:a,richVersion:l,...r})=>c(g,{className:u("flex gap-s sm:gap-m group-data-secondary:bg-primary-main/10",e),...r,children:["small"===i?Eb():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(_e,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?zb(n):null,a?o(Me,{richVersion:l,__html:a}):null]})]}))),Eb=()=>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"}),zb=e=>o(w,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),Fb=d((({prefix:e,unit:t,suffix:n})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(_e,{size:"text-h2",children:e})}):null,t?o("div",{className:"-mb-6 @xl:-mb-4",children:o("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,n?o("div",{className:"gradient-color-text",children:o(_e,{size:"text-h2",children:n})}):null]}))),Ob=d((e=>{const{prefix:t,unit:n,suffix:i,...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(Fb,{prefix:t,unit:n,suffix:i})})})),Vb=Ot((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:i=!0,version:a="transparent",isTheme:l=!1,isCardBorder:r=!1,image:s,...c})=>{const d=D();return o(g,{className:u("relative flex flex-col",$f[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${J(d)(s?.src)})`}}:{},padding:t,version:a,isTheme:l,...c,children:R({...c,extraProps:{className:u("w-full",Jc(r)),...Lf(i)}})})}),{childrenTypes:[]}),Lb=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",$b=d((({className:e,title:t,url:n,previewImg:i,...a})=>{const l=D();return c(g,{className:e,defaultPadding:Lb(e),...a,children:[o(S,{title:t,headlineVersion:"M"}),n?o("video",{className:"m-auto w-full object-fill",preload:"metadata",poster:j(l)(i?.src),style:{maxHeight:524},controls:!0,children:o("source",{src:j(l)(n)})}):null]})})),qb={AdTile:Lt,ApplicationForm:Qo,ApplicationLeadForm:Gc,BankAccountFiltration:Hd,BenefitsBlock:Jd,BonusBenefitsBlock:nm,ButtonsBlock:am,CalculatorBonus:mm,CalculatorBusinessDeposit:Nm,CalculatorCredit:Lr,CalculatorDeposit:Vm,CalculatorRefinancing:Ym,CardTransfer:eu,Carousel:ou,CarouselCard:uu,CarouselCatalogCard:pu,CarouselLinks:xu,CarouselRecommendationCard:ku,CarouselTariffsCard:Bu,ContactsBlock:Ru,CreditCardForm:Ch,CreditForm:rp,DepositFiltration:mp,Depository:Tp,ErrorBlock:Pp,ExchangeRateTile:hg,Footer:Hg,GracePeriod:Yg,GrantSupport:Jg,Header:Ff,Headline:S,HorizontalLayout:qf,ImgBlock:jf,InsuranceAmountBlock:Xf,InvestmentInfo:ex,LinkDocs:px,MobileAppTile:yx,MortgageFiltration:Lx,OfficesAtmsMap:py,Placeholder:gy,ProductBlock:Vt,ProductGallery:xy,RepresentativeOfficeInfo:by,RichTextBlock:wy,RollupItem:Ty,SafeDepositRental:Jy,StepsBlock:tb,StickyBottomMenu:ab,TabsLayout:mb,TariffsTable:Ab,TextBlock:_b,UnitBlock:Ob,VerticalLayout:Vb,Video:$b},jb=ce((()=>{a((()=>{Qt()}),[]);const e=tn();cn(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const i=JSON.parse(n?.dataset?.aspects??"[]");Xt({aspectsAttributes:i,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))})),Ub="cookie",Wb=d((({__html:e})=>{const[t,{setTrue:n,setFalse:i}]=on();Pg((()=>{globalThis.localStorage?.getItem(Ub)||n()}),[],3e3);const a=l((()=>{globalThis.localStorage?.setItem(Ub,"true"),i()}),[]);return t&&e?o("div",{className:"container fixed left-0 right-0 bottom-0 z-50",role:"dialog",children:c("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[o("div",{className:"sm:flex-1",children:o(Me,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(Ql,{className:"bg-main-gray rounded-md w-11 h-11",onClose:a})})]})}):null}));function Hb(e){const t=l((({key:t})=>{"Escape"===t&&e()}),[e]);cn(globalThis.document,"keydown",t)}function Yb(e,t,n){a((()=>e.subscribe(t,(e=>{const t=e?.type;if(t&&"string"==typeof t){const i=n[t];i&&i(e)}}))),[e,t,...Object.values(n)])}const Kb=()=>{const[e,{push:t,pop:n,clear:a}]=function(e=[]){const[t,n]=i(e),a=l((e=>n((t=>[...t,e]))),[]),r=l((()=>n((e=>e.slice(0,-1)))),[]),s=l((e=>n((t=>t.filter((t=>t!==e))))),[]),o=l((()=>n([])),[]);return[t,{setList:n,push:a,pop:r,remove:s,clear:o}]}();return Yb(ue.observable,"dialog",{open:t,close:n,closeAll:a}),[e,{close:n,closeAll:a}]},Gb=d((()=>{const[e,{close:t}]=Kb(),n=Boolean(e.length);return Hb(t),a((()=>{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",role:"dialog",children:e.map((({dialog:t,id:n},i)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:i!==e.length-1}),children:t},String(n||i))))}):null})),Xb=d((()=>{const[e,t]=i(null),n=l((()=>{t(null)}),[]);return Yb(ue.observable,"popup",{open:t,close:n}),Hb(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",children:e.popup}):null})),Jb="header",Zb="footer",Qb="sticky-footer",ev={},tv=d((({className:e,data:t=ev,blocksRegistry:n,blockDecorator:i})=>{const{slots:a,blocks:l,fallback:r,...s}=t,d=zt(s,r);jb(),Vp();const m={key:"",page:{slots:a,blocks:l,fallback:r,...d},blocksRegistry:n,blockDecorator:i,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:u("@container relative",t.style,e),children:[a?.[Jb]?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:P(a?.[Jb],{...m,slotName:Jb})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[R({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),P(a?.[Zb],{...m,slotName:Zb})]})]}),a?.[Qb]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:P(a?.[Qb],{...m,slotName:Qb})}):null,o(Gb,{}),o(Xb,{}),o(Wb,{__html:d?.cookieContent?.__html})]})}));Object.assign(tv,{childrenTypes:[],slots:()=>[Jb,Zb,Qb]});e.Blocks=qb,e.ContentPage=tv,e.handlerDecorator=ce,e.joinList=_d,e.locationNavigator=Jt,e.packageVersion="0.14.697",e.projectSettings=A,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=L,e.useRouter=D,Object.defineProperty(e,"__esModule",{value:!0})}));
|