@redneckz/wildless-cms-uni-blocks 0.14.704 → 0.14.706
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/bundle.umd.js +62 -33
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/LeadFormState.d.ts +1 -1
- package/bundle/components/CreditCardForm/useCreditCardFormAPI.d.ts +10 -0
- package/bundle/components/CreditForm/useCreditFormAPI.d.ts +10 -0
- package/dist/api/RetailAPI/sendCode.js +1 -1
- package/dist/api/RetailAPI/sendCode.js.map +1 -1
- package/dist/components/ApplicationLeadForm/LeadFormState.d.ts +1 -1
- package/dist/components/CreditCardForm/PendingStatusContent.js +2 -2
- package/dist/components/CreditCardForm/PendingStatusContent.js.map +1 -1
- package/dist/components/CreditCardForm/ReworkStatusContent.js +3 -3
- package/dist/components/CreditCardForm/ReworkStatusContent.js.map +1 -1
- package/dist/components/CreditCardForm/SuccessStatusContent.js +3 -3
- package/dist/components/CreditCardForm/SuccessStatusContent.js.map +1 -1
- package/dist/components/CreditCardForm/formStateMap.js +1 -1
- package/dist/components/CreditCardForm/formStateMap.js.map +1 -1
- package/dist/components/CreditCardForm/useCreditCardFormAPI.d.ts +10 -0
- package/dist/components/CreditCardForm/useCreditCardFormAPI.js +14 -3
- package/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/dist/components/CreditForm/PendingStatusContent.js +4 -4
- package/dist/components/CreditForm/PendingStatusContent.js.map +1 -1
- package/dist/components/CreditForm/ReworkStatusContent.js +3 -3
- package/dist/components/CreditForm/ReworkStatusContent.js.map +1 -1
- package/dist/components/CreditForm/SuccessStatusContent.js +3 -3
- package/dist/components/CreditForm/SuccessStatusContent.js.map +1 -1
- package/dist/components/CreditForm/formStateMap.js +1 -1
- package/dist/components/CreditForm/formStateMap.js.map +1 -1
- package/dist/components/CreditForm/useCreditFormAPI.d.ts +10 -0
- package/dist/components/CreditForm/useCreditFormAPI.js +19 -3
- package/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/SnilsField.js +1 -1
- package/dist/ui-kit/FormField/Fields/SnilsField.js.map +1 -1
- package/dist/ui-kit/Input/InputSnilsControl.js +1 -1
- package/dist/ui-kit/Input/InputSnilsControl.js.map +1 -1
- package/dist/ui-kit/SnilsInput/SnilsInput.js +4 -2
- package/dist/ui-kit/SnilsInput/SnilsInput.js.map +1 -1
- package/dist/utils/normalizeWithMask.js +1 -1
- package/dist/utils/normalizeWithMask.js.map +1 -1
- package/lib/api/RetailAPI/sendCode.js +1 -1
- package/lib/api/RetailAPI/sendCode.js.map +1 -1
- package/lib/components/ApplicationLeadForm/LeadFormState.d.ts +1 -1
- package/lib/components/CreditCardForm/PendingStatusContent.js +2 -2
- package/lib/components/CreditCardForm/PendingStatusContent.js.map +1 -1
- package/lib/components/CreditCardForm/ReworkStatusContent.js +3 -3
- package/lib/components/CreditCardForm/ReworkStatusContent.js.map +1 -1
- package/lib/components/CreditCardForm/SuccessStatusContent.js +3 -3
- package/lib/components/CreditCardForm/SuccessStatusContent.js.map +1 -1
- package/lib/components/CreditCardForm/formStateMap.js +1 -1
- package/lib/components/CreditCardForm/formStateMap.js.map +1 -1
- package/lib/components/CreditCardForm/useCreditCardFormAPI.d.ts +10 -0
- package/lib/components/CreditCardForm/useCreditCardFormAPI.js +14 -3
- package/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/lib/components/CreditForm/PendingStatusContent.js +4 -4
- package/lib/components/CreditForm/PendingStatusContent.js.map +1 -1
- package/lib/components/CreditForm/ReworkStatusContent.js +3 -3
- package/lib/components/CreditForm/ReworkStatusContent.js.map +1 -1
- package/lib/components/CreditForm/SuccessStatusContent.js +3 -3
- package/lib/components/CreditForm/SuccessStatusContent.js.map +1 -1
- package/lib/components/CreditForm/formStateMap.js +1 -1
- package/lib/components/CreditForm/formStateMap.js.map +1 -1
- package/lib/components/CreditForm/useCreditFormAPI.d.ts +10 -0
- package/lib/components/CreditForm/useCreditFormAPI.js +19 -3
- package/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/SnilsField.js +1 -1
- package/lib/ui-kit/FormField/Fields/SnilsField.js.map +1 -1
- package/lib/ui-kit/Input/InputSnilsControl.js +1 -1
- package/lib/ui-kit/Input/InputSnilsControl.js.map +1 -1
- package/lib/ui-kit/SnilsInput/SnilsInput.js +4 -2
- package/lib/ui-kit/SnilsInput/SnilsInput.js.map +1 -1
- package/lib/utils/normalizeWithMask.js +1 -1
- package/lib/utils/normalizeWithMask.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +62 -33
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/LeadFormState.d.ts +1 -1
- package/mobile/bundle/components/CreditCardForm/useCreditCardFormAPI.d.ts +10 -0
- package/mobile/bundle/components/CreditForm/useCreditFormAPI.d.ts +10 -0
- package/mobile/dist/api/RetailAPI/sendCode.js +1 -1
- package/mobile/dist/api/RetailAPI/sendCode.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/LeadFormState.d.ts +1 -1
- package/mobile/dist/components/CreditCardForm/PendingStatusContent.js +2 -2
- package/mobile/dist/components/CreditCardForm/PendingStatusContent.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/ReworkStatusContent.js +3 -3
- package/mobile/dist/components/CreditCardForm/ReworkStatusContent.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/SuccessStatusContent.js +3 -3
- package/mobile/dist/components/CreditCardForm/SuccessStatusContent.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/formStateMap.js +1 -1
- package/mobile/dist/components/CreditCardForm/formStateMap.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.d.ts +10 -0
- package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js +14 -3
- package/mobile/dist/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/mobile/dist/components/CreditForm/PendingStatusContent.js +4 -4
- package/mobile/dist/components/CreditForm/PendingStatusContent.js.map +1 -1
- package/mobile/dist/components/CreditForm/ReworkStatusContent.js +3 -3
- package/mobile/dist/components/CreditForm/ReworkStatusContent.js.map +1 -1
- package/mobile/dist/components/CreditForm/SuccessStatusContent.js +3 -3
- package/mobile/dist/components/CreditForm/SuccessStatusContent.js.map +1 -1
- package/mobile/dist/components/CreditForm/formStateMap.js +1 -1
- package/mobile/dist/components/CreditForm/formStateMap.js.map +1 -1
- package/mobile/dist/components/CreditForm/useCreditFormAPI.d.ts +10 -0
- package/mobile/dist/components/CreditForm/useCreditFormAPI.js +19 -3
- package/mobile/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/SnilsField.js +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/SnilsField.js.map +1 -1
- package/mobile/dist/ui-kit/Input/InputSnilsControl.js +1 -1
- package/mobile/dist/ui-kit/Input/InputSnilsControl.js.map +1 -1
- package/mobile/dist/ui-kit/SnilsInput/SnilsInput.js +4 -2
- package/mobile/dist/ui-kit/SnilsInput/SnilsInput.js.map +1 -1
- package/mobile/dist/utils/normalizeWithMask.js +1 -1
- package/mobile/dist/utils/normalizeWithMask.js.map +1 -1
- package/mobile/lib/api/RetailAPI/sendCode.js +1 -1
- package/mobile/lib/api/RetailAPI/sendCode.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/LeadFormState.d.ts +1 -1
- package/mobile/lib/components/CreditCardForm/PendingStatusContent.js +2 -2
- package/mobile/lib/components/CreditCardForm/PendingStatusContent.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/ReworkStatusContent.js +3 -3
- package/mobile/lib/components/CreditCardForm/ReworkStatusContent.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/SuccessStatusContent.js +3 -3
- package/mobile/lib/components/CreditCardForm/SuccessStatusContent.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/formStateMap.js +1 -1
- package/mobile/lib/components/CreditCardForm/formStateMap.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.d.ts +10 -0
- package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js +14 -3
- package/mobile/lib/components/CreditCardForm/useCreditCardFormAPI.js.map +1 -1
- package/mobile/lib/components/CreditForm/PendingStatusContent.js +4 -4
- package/mobile/lib/components/CreditForm/PendingStatusContent.js.map +1 -1
- package/mobile/lib/components/CreditForm/ReworkStatusContent.js +3 -3
- package/mobile/lib/components/CreditForm/ReworkStatusContent.js.map +1 -1
- package/mobile/lib/components/CreditForm/SuccessStatusContent.js +3 -3
- package/mobile/lib/components/CreditForm/SuccessStatusContent.js.map +1 -1
- package/mobile/lib/components/CreditForm/formStateMap.js +1 -1
- package/mobile/lib/components/CreditForm/formStateMap.js.map +1 -1
- package/mobile/lib/components/CreditForm/useCreditFormAPI.d.ts +10 -0
- package/mobile/lib/components/CreditForm/useCreditFormAPI.js +19 -3
- package/mobile/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/SnilsField.js +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/SnilsField.js.map +1 -1
- package/mobile/lib/ui-kit/Input/InputSnilsControl.js +1 -1
- package/mobile/lib/ui-kit/Input/InputSnilsControl.js.map +1 -1
- package/mobile/lib/ui-kit/SnilsInput/SnilsInput.js +4 -2
- package/mobile/lib/ui-kit/SnilsInput/SnilsInput.js.map +1 -1
- package/mobile/lib/utils/normalizeWithMask.js +1 -1
- package/mobile/lib/utils/normalizeWithMask.js.map +1 -1
- package/mobile/src/api/RetailAPI/sendCode.ts +1 -1
- package/mobile/src/components/ApplicationLeadForm/LeadFormState.ts +1 -1
- package/mobile/src/components/CreditCardForm/PendingStatusContent.tsx +3 -2
- package/mobile/src/components/CreditCardForm/ReworkStatusContent.tsx +4 -3
- package/mobile/src/components/CreditCardForm/SuccessStatusContent.tsx +4 -3
- package/mobile/src/components/CreditCardForm/formStateMap.tsx +1 -1
- package/mobile/src/components/CreditCardForm/useCreditCardFormAPI.tsx +37 -3
- package/mobile/src/components/CreditForm/PendingStatusContent.tsx +5 -5
- package/mobile/src/components/CreditForm/ReworkStatusContent.tsx +4 -3
- package/mobile/src/components/CreditForm/SuccessStatusContent.tsx +4 -3
- package/mobile/src/components/CreditForm/formStateMap.tsx +1 -1
- package/mobile/src/components/CreditForm/useCreditFormAPI.tsx +42 -3
- package/mobile/src/ui-kit/FormField/Fields/SnilsField.tsx +1 -0
- package/mobile/src/ui-kit/Input/InputSnilsControl.tsx +1 -0
- package/mobile/src/ui-kit/SnilsInput/SnilsInput.tsx +5 -2
- package/mobile/src/utils/normalizeWithMask.ts +1 -1
- package/package.json +1 -1
- package/src/api/RetailAPI/sendCode.ts +1 -1
- package/src/components/ApplicationLeadForm/LeadFormState.ts +1 -1
- package/src/components/CreditCardForm/PendingStatusContent.tsx +3 -2
- package/src/components/CreditCardForm/ReworkStatusContent.tsx +4 -3
- package/src/components/CreditCardForm/SuccessStatusContent.tsx +4 -3
- package/src/components/CreditCardForm/formStateMap.tsx +1 -1
- package/src/components/CreditCardForm/useCreditCardFormAPI.tsx +37 -3
- package/src/components/CreditForm/PendingStatusContent.tsx +5 -5
- package/src/components/CreditForm/ReworkStatusContent.tsx +4 -3
- package/src/components/CreditForm/SuccessStatusContent.tsx +4 -3
- package/src/components/CreditForm/formStateMap.tsx +1 -1
- package/src/components/CreditForm/useCreditFormAPI.tsx +42 -3
- package/src/ui-kit/FormField/Fields/SnilsField.tsx +1 -0
- package/src/ui-kit/Input/InputSnilsControl.tsx +1 -0
- package/src/ui-kit/SnilsInput/SnilsInput.tsx +5 -2
- package/src/utils/normalizeWithMask.ts +1 -1
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=[],R=(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 P({block:e,options:t,children:n,extraProps:a,renderProps:i}){return n||(e&&t?R(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 E=["CDN","BASE_PATH"],A=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return E.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),_=e=>Boolean(e?.includes(":")),M=(e,t)=>Boolean(e&&!_(e)&&(!t||"_self"===t)),O=e=>Boolean(e?.startsWith("#")),z=e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),F=(...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:M,isHash:O,withoutQuery:z,joinPath:F,hasPrefix:V});const $="/api/",q=`${$}v1/storage`,j=e=>(t,n)=>{if([!t,_(t),O(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 F(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)(F(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(G,{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",G=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),K=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(K.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(K.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(!M(e,t))return!0;const a=K.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]}),Pe(P({...y,extraProps:{className:"@container-normal"}})),Te(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Re(p)]:r,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),r?o("div",{className:"self-end",children:r}):null]})]})]})})),Re=e=>u(e?"row-span-2":"@xl:row-span-2"),Pe=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,Ee=d((({__html:e="",richVersion:t="",itemSize:n="list-m",isDotted:a=!0,children:i})=>e||i?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(t,n,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",a?"":"without-dots"),dangerouslySetInnerHTML:e?{__html:e}:void 0,children:i})}):null)),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}))),Me=(e,t)=>e?o(_e,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,Oe=(e,t)=>["label"in e?Me(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Ae(e.description,t)},String(t)):null,"__html"in e?o(Ee,{...e},`rte-${t}`):null],ze=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:Oe(n)})]}))),Fe=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(ze,{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(Oe)}):null)),Le=d((({isTabularBenefits:e,...t})=>o(e?Ve:Fe,{...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(Ge)}):null)),Ge=({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)),Ke=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,R=o(S,{title:a,description:i,headlineVersion:l,align:r,isEmbedded:!0}),P=u?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Be,{className:e,padding:t,defaultPadding:n,...g?{title:R}:{insetTitle:R},...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:[P?.length?o(Le,{benefitsVersion:s,isTabularBenefits:d,benefits:P}):null,h?o(Ee,{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(Ke,{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)),Rt=e=>{return t=Bt(e).map((([,e])=>e)),[...new Set(t)];var t};async function Pt(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(),Et=e=>[...new Set(e)],At={},_t=["/portal-resources"],Mt=(e,t)=>Tt(e,(e=>t?.[e])),Ot=(e,t)=>{const n=Rt(e),[l,r]=a({});return i((()=>{zt(n).then(r)}),[n.join()]),n.length?Mt(e,{...t,...l}):e},zt=async(e,t={})=>{if(e.length){const n=await(async e=>Object.fromEntries((await Promise.allSettled(Et(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])=>Rt(e)));return i.length?zt(i,a):a}return t};function Ft(e,t={}){const n=d((t=>{const n=Ot((({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=Ft((({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}),Gt=(e,t=!0)=>({[t?"email":"mail"]:e}),Kt=(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 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?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: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=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: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]})})),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(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(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||"",Rn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Pn=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:Rn(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(Pn,{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:[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}),En(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]})]})})),En=(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,Mn=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)]}))),On=e=>!e?.length,zn=e=>t=>n=>e(n)?[]:[t],Fn=zn((e=>null!=e&&""!==e)),Vn="Некорректно заполненное поле",Ln="Укажите регион, город/населенный пункт, улицу, дом",$n=e=>Fn(e??Vn),qn=e=>zn((e=>e?.key&&""!==e?.key))(e??Vn),jn=e=>zn((e=>"string"==typeof e&&e.length>0&&e.length<=2))(e??Vn),Un=e=>zn((e=>"string"==typeof e&&e.length>1&&Qn(e)))(e??Vn),Wn=(e,t)=>zn((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??Vn),Hn=e=>zn((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}$/,zn((e=>"string"==typeof e&&t.test(e))))(e);var t},Gn=zn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),Kn=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=()=>zn(Xn)(Ln),Zn=/^[\u0400-\u04FF\d\s]+$/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:zn(ea)("Допустимый возраст заёмщика - от 23 до 75 лет"),birthPlace:$n("Укажите место рождения"),education:qn("Выберите ваше образование"),housing:qn("Выберите тип жилья"),employment:qn("Выберите информацию о трудоустройстве"),organization:qn("Выберите тип организации"),amountWorkers:qn("Выберите информацию о количестве сотрудников"),employerActivities:qn("Выберите вид деятельности организации"),employerOrganization:qn("Выберите вид организации"),positionOrganization:qn("Выберите вашу должность"),dulSerie:(na="Укажите серию паспорта",zn((e=>"string"==typeof e&&4===e.length))(na)),dulNumber:Hn("Укажите номер паспорта"),dulIssueDateField:$n("Укажите дату выдачи паспорта"),dulSubdivisionCode:Hn("Укажите код подразделения"),dulIssuedBy:$n("Укажите организацию, выдавшую паспорт"),email:(e=>zn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(e))("Укажите электронную почту"),fullName:$n(),inn:(e=>zn((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:Gn,annualRevenue:$n(),consentToReceiveMaterials:Gn,processPersonalDataFlg:Gn,consentProviderFlg:Gn,consentPfrFlg:Gn,consentOthersFlg:Gn,consentInformFlg:Gn,familyStatus:qn("Выберите семейное положение"),children:Wn(2,"Укажите количество детей"),familyMembers:Wn(2,"Укажите количество членов семьи"),dependents:Wn(2,"Укажите количество иждивенцев"),totalIncome:Wn(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:Wn(10,"Укажите сумму обязательных выплат"),snils:(e=>zn(Kn)(e))("Некорректный номер СНИЛС"),conscription:$n(),armyIdFlg:Gn,sex:$n("Укажите свой пол"),addressRegistration:Jn(),organizationAddress:zn((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=>zn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&Qn(e)))(e??Vn))("Необходимо ввести кодовое слово"),confirmationIncome:qn(),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(Mn,{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 Pt(e,{method:"GET"})||ya;function va(e=!1){const{data:t}=ga(`${Ut}${e?"/premiumBranchesByRegions":"/branchesByRegions"}`,Dt);return Array.isArray(t)?t:[]}const Na=(e="")=>"ULTRASERVICE"===e||"PREMIUMSERVICE"===e,wa=d((({field:e,input:t,params:n})=>{const a=Na(n?.typeForm),l=e("region"),r=l?.value?.key,s=l?.value?.text,c=a?va(a)?.find((e=>e?.region===s))?.branches:function(e){const{data:t}=ga(e?`${xa}?regionCode=${e}`:null,ba);return t||ya}(r)?.filter((e=>e?.address));return i((()=>{""!==l?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[l?.value]),o(Mn,{label:"Отделение",placeholder:"Выберите отделение",options:(c||[]).map((({address:e=""})=>({key:e,text:e}))),...la(e("addressBranch"),ta.addressBranch,t?.required),isSearch:!0})})),Ca=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})})),Sa=(e,t)=>Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t).value,ka=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",a=e(n).value,i=l((t=>{e?.(n)?.onChange?.(Ia(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&&Sa(e,n),label:"Адрес",...la(e(n),ta[n],t?.required),value:a.fullAddress,onChange:r,...t,onDaDataChange:i})})),Ia=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}),Ta=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)}))}))),Ba="appearance-none w-5 h-5 border-solid flex-none",Ra=[{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(Ta,{paths:Ra,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",Ea(a)),onClick:s,children:[o("div",{className:u(Ba,"m-0",i?"rounded-full border-2":_a(t),!a&&t?"border-primary-main":"border-gray",a?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:Aa(i),"aria-checked":Boolean(t),"aria-disabled":Boolean(a),"aria-label":n}),t?d:null,Da(n)]})})})),Da=e=>e?o("div",{className:"ml-s",children:o(_e,{size:"text-l",font:"font-light",children:e})}):null,Ea=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",Aa=(e=!1)=>e?"radio":"checkbox",_a=(e=!1)=>u("rounded border",{"bg-primary-main":e}),Ma=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)]}))),Oa=d((({field:e,input:t})=>o(Ma,{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",Va="/icons/MapMarkerClusterYellowIcon.svg";function La({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=$a("offices",e,i);if(n.length&&n.every((e=>"type"in e))){const a=$a("workplaces",e,i),r=qa(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=qa(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=qa(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 $a=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?Fa:Va,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),qa=(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:Va,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),ja={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},Ua={...ja,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},Wa=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(Ua).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"})}),Ha=e=>globalThis[e],Ya=(e,t)=>{const n=document.getElementById(t);if(n){const t=Ha(e);return t?Promise.resolve(t):new Promise((t=>{n.addEventListener("load",(()=>{t(Ha(e))}))}))}return new Promise(((n,a)=>{const i=document.createElement("script");i.src=t,i.async=!0,i.id=t,i.addEventListener("load",(()=>{n(Ha(e))})),i.addEventListener("error",(e=>{a(e)})),document.head.appendChild(i)}))};const Ga=()=>function(e,t,n=!0){const[l,r]=a(void 0);return i((()=>{let a=!0;return Ya(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={...ja,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},Xa=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"})})})),Ja=[55.753995,37.614069],Za=d((({points:e,className:t="",zoom:n=5,isLoad:a,selectedAddress:l})=>{const r=s(null),d=s(null),m=Ga();if(i((()=>{r.current?La({yandexMaps:m,map:r.current,points:e,isLoad:a}):m?.ready((()=>{r.current||(r.current=new m.Map(d.current,{center:Qa(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),La({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(Xa,{yandexMaps:r}),o(Xa,{yandexMaps:r,direction:"out"})]}),Wa(r,m,u("right-2 top-80",h))]})})),Qa=e=>{const t=[ti(ei(e,0)),ti(ei(e,1))];return t.every((e=>e))?t:Ja},ei=(e,t)=>e.map((e=>e.coords?.[t])),ti=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,ni=async(e,t,n)=>{try{return(await ai(e,t,n)).json()}catch(e){return console.error(e),null}};async function ai(e,t,n){return globalThis?.fetch?.(`${Ut}${e}`,{method:t,headers:{"Content-Type":"application/json",...ii()},credentials:"include",body:n?JSON.stringify(n):null})}const ii=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},li=e=>Number(e.toString().replace(",",".")),ri=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 si=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})})})),oi=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:ci({textItems:l,subText:t,children:n,isPhone:a,...i})})),ci=({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||di(n,s),i?o(_e,{color:a,size:"text-m",children:i}):null]}),di=(e,t)=>e.filter(Boolean).map(((e,n)=>o(_e,{size:"text-l",children:t?o("a",{href:`tel:${mi(e)}`,children:e.trim()}):e.trim()},String(n)))),mi=e=>e.replace(/\D/g,""),ui=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}))),hi=e=>{const t=gi(e);return o(oi,{label:"Режим работы",value:t,className:"max-w-none"})},pi=({workTime:e="",lunchHour:t="",daysOff:n=""},a=!1)=>e?[`${a?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",gi=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[pi({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":a}),pi({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:a},!0)].filter(Boolean)},fi=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],xi=e=>fi.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??"")}}))),yi=e=>{if(!e)return null;const t=bi(e);return c(ui,{className:"border-none",children:[o(oi,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(vi)})}),o(oi,{label:"Режим работы",className:"max-w-none",children:o(_e,{children:e})})]})},bi=e=>{const t=fi.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},vi=({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)),Ni=({currency:e,buyExchangeRate:t,saleExchangeRate:n},a)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(oi,{label:"Валюта",value:e.currency}):null,t?o(oi,{label:"Купить",value:String(t)}):null,n?o(oi,{label:"Продать",value:String(n)}):null]},String(a)),wi={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"}},Ci=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",wi[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:wi[n].text,children:t})]}))),Si=(new Date).getDay(),ki=e=>{const[t]=e?.slice(Si-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(Ci,{color:"green",children:i}):null,n&&l?o(Ci,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(Ci,{color:"red",children:"Выходной"})},Ii=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Ti=({title:e,status:t,workTime:n,lunchHour:a,hasLunch:i},l)=>o(oi,{label:e,value:t&&n?n:"",subText:Ii({lunchHour:a,hasLunch:i,status:t}),subColor:!t||i?"text-error":"text-green-dark"},String(l)),Bi=["ArrowDownIcon","ArrowUpIcon"],Ri=["Подробнее","Скрыть"],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:Ri[Number(e)]}),o(W,{className:"text-primary-text",name:Bi[Number(e)],width:"16",height:"16"})]}),Di=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,Ei=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,Ai=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,_i=({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=xi(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]}),ki(h)]}),o("div",{className:"hidden sm:block",children:Mi({phone:n,fax:a,phoneBusiness:i,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(ri,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(si,{isUnfolded:e,children:Mi({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))},Mi=({phone:e,fax:t,phoneBusiness:n,phoneNatural:a,phoneCallCentre:i,phoneCurrencyControl:l,workSchedule:r,exchangeRate:s})=>{const d=xi(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(ui,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(oi,{label:"Факс",value:t,isPhone:!0}),o(oi,{label:"Телефон филиала",value:e,isPhone:!0}),o(oi,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(oi,{label:"Обслуживание физических лиц",value:a,isPhone:!0}),o(oi,{label:"Для консультаций по валютному контролю",value:l,isPhone:!0}),o(oi,{label:"Контакт-центр",value:i,isPhone:!0})]}),r?.isMatchesPattern?o(ui,{children:o(oi,{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(Ti)})})}):c(ui,{children:[o(oi,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(vi)})}),hi(d)]}),r?.businessScheduleVisibleTag?yi(r?.businessScheduleDescription):null,s?.currencies?.length?o(ui,{className:"flex-wrap",children:s?.currencies?.map(Ni)}):null]})},Oi=({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=xi(e),n=e?gi(t):"",a=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?Di(n):Ai(n,a):Ei(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:"Для маломобильных граждан"},Vi={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)},Li=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>Vi[t](e)))))},$i=()=>{},qi=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:a=$i,getBalloonRemoteWorkplaces:i=$i})=>{const[l,s,o,c]=r((()=>{const l=Li(e,n),r=Li(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}},ji=e=>{const{data:t,error:n}=ga(`/api/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,Ui);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},Ui=async e=>await Pt(e,{method:"POST"})||[],Wi=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),Hi=d((({children:e})=>Wi?e:null)),Yi=d((({field:e,input:t})=>{const[n,l]=a([]),{data:r}=ji("REGION_RF"),s=e("regionRetail")?.value||{},d=e("addressRetail");i((()=>{(async()=>{const e=await(async e=>{const t=await ni("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0});return t?.offices?.map((e=>({...e,gpsLatitude:li(e.latitude??Ja[0]),gpsLongitude:li(e.longitude??Ja[1])})))||[]})(s?.key??"");l(e)})(),s?.key&&e?.("addressRetail")?.onChange?.("")}),[s.key]);const{points:m}=qi({data:n,filtrationState:{},getBalloon:Oi}),u=Boolean(s?.key);return c("div",{children:[o(Mn,{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(Hi,{children:o(Za,{points:m,isLoad:!r,className:"h-full",selectedAddress:d?.value?.text})})})]})})),Gi=(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 Xi(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function Ji({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=Xi(t.target?.value),a=e.length?e[n]:n;r&&r(a||0)}})})]})}const Zi=1,Qi=100,el=d((e=>{const{className:t,title:n,items:a=[],list:i=[],min:r=(i.length?0:Zi),max:s=(i.length?i.length-1:Qi),step:d=1,value:m=i[0]||r,disabled:h=!1,onChange:p}=e,g=Gi(e,{normalize:(e=0)=>i.length?tl(i)(e):Ki(e,r,s),format:He()}),f=l((e=>{p&&p(Xi(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}),Ji({list:i,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),nl(a)]})})),tl=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),nl=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))))}),al=["От 1 000 ₽","До 1 000 000 000 ₽"],il=d((({field:e})=>o(el,{title:"Сумма, ₽",items:al,min:1e3,max:1e9,...e("amount")})));function ll(e,t){for(const[n,a]of e.entries())null!=a?t.setItem(n,a):t.removeItem(n)}const rl={};function sl(e,t=rl){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 ol=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 cl,dl;function ml(e){return sl(ol,e)}cl=ol,dl=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),ll(cl,dl),ll(dl,cl),cl.bus.watch((({type:e,event:t})=>{null!=t?dl.setItem(e,t):dl.removeItem(e)}));const ul=()=>ml(),hl=Ft((({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(Mn,{placeholder:i,options:s,...la(e(n),ta[n],a?.required),...r})})),pl=d((({field:e,input:t})=>{const{data:n}=ji("EMPLOYEES_NUMBER"),a=ul();return i((()=>{n&&(a.amountWorkers=n)}),[n]),o(hl,{field:e,source:a.amountWorkers??[],label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),gl=d((({field:e,input:t})=>o(kn,{label:"Годовая выручка, ₽",...la(e("annualRevenue"),ta.annualRevenue,t?.required)}))),fl=d((({field:e,input:t})=>o(Ma,{text:"Наличие военного билета",...la(e("armyIdFlg"),ta.armyIdFlg,t?.required)}))),xl=d((({field:e,input:t})=>o(kn,{label:"Код представителя Банка",placeholder:"Введите код",isInteger:!0,...la(e("bankEmployeeCode"),ta.bankEmployeeCode,t?.required),...t}))),yl=d((({field:e})=>o(kn,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e("bankEmpolee")}))),bl=d((({field:e,input:t})=>o(Ma,{text:"В отношении меня ведётся производство по делу о банкротстве",...la(e("bankruptcyFlg"),ta.bankruptcyFlg,t?.required)}))),vl=({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=Nl(t,e),c=wl(t,l,r);u.push(o("td",{children:o("div",{className:Cl(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},Nl=(e,t)=>t&&e.toDateString()===t.toDateString(),wl=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),Cl=(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"),Sl=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],kl=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:Sl.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:vl({firstDayOfWeek:u,today:e,totalDays:h,currentYear:n,currentMonth:t,min:a,max:i,onDateClick:m})})]})})),Il=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function Tl(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)=>Pl(e)?a.slice(0,t).filter(Pl).length:-1)),r=a.map(((e,t)=>Rl(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,Rl=e=>/\d/.test(e),Pl=e=>Bl(e)||Rl(e),Dl=1940,El={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Al=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(Tl(t,"__.__.____"))},onBlur:()=>{if(_l(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",...El})]})})),_l=e=>{const[t,n,a]=e.split(".");if((e=>Number(e)>=Dl&&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},Ml=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:a,setSelectedMonth:i,setSelectedYear:l,disabled:r=!1})=>o(Al,{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")}),Ol=Il.map((e=>({key:e}))),zl=Array.from({length:(new Date).getFullYear()-Dl+1},((e,t)=>Dl+t)).reverse().map((e=>({key:String(e)}))),Fl=(e,t)=>{const n=new Date(e,t,1);let a=0;for(;n.getMonth()===t;)a++,n.setDate(n.getDate()+1);return a},Vl=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:a,onChange:i})=>{a&&i?.(new Date(t,n,Math.min(e,a.getDate())))},Ll={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},$l={className:"min-w-32",iconVersion:"black",isBorder:!1},ql=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(Il.indexOf(e));const t=Fl(r,Il.indexOf(e));Vl({maxDateOfMonth:t,selectedYear:r,selectedMonth:Il.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:Ol,yearsOptions:zl,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:[gn(t),c("div",{className:"relative",children:[Ml({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,{...Ll,className:"-rotate-90 cursor-pointer"})}),o(Dn,{onChange:w,value:{key:Il[f]},options:S,...$l}),o(Dn,{onChange:C,value:{key:String(y)},options:k,...$l}),o("div",{className:"my-auto",onClick:N,children:o(W,{...Ll,className:"rotate-90 cursor-pointer"})})]}),o(kl,{today:n,currentMonth:f,currentYear:y,onDateSelect:h,min:s,max:d,setValue:g})]}):null]})]})})),jl=d((({className:e,label:t,error:n,errors:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ql,{label:mn({label:t,errors:a}),valid:Boolean(!n),...i}),yn(n)]}))),Ul=d((({field:e,input:t})=>o(jl,{label:"Дата начала работы на текущем месте",...la(e("beginDate"),ta.beginDate,t?.required),...t}))),Wl=d((({field:e,input:t})=>o(jl,{label:"Дата рождения",...la(e("birthday"),ta.birthday,t?.required)}))),Hl=d((({field:e,input:t})=>o(kn,{label:"Место рождения",...la(e("birthPlace"),ta.birthPlace,t?.required),...t,disabled:t?.filledByEsia&&Sa(e,"birthPlace")}))),Yl=e=>{try{return JSON.parse(String(e))}catch(e){return null}};function Gl(e){const t=globalThis.localStorage?.getItem(e),[n,i]=a(t?Yl(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 Kl=d((({field:e,input:t})=>{const[n,l]=a([]),[r]=Gl("programId"),{value:s,onChange:c}=e("cardCategory"),d=e("paymentSystem")?.value?.type;return i((()=>{d&&r&&(async()=>{const e=await(async(e,t)=>{const n=await ni("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemTypeCd:e,creditProgramId:t}});return Array.isArray(n)?n:[]})(d,r);l(e),Xl(e,s)||c&&c(null)})()}),[d]),o(hl,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t})})),Xl=(e,t)=>e.some((e=>e.key===t?.key)),Jl=d((({field:e,input:t})=>o(kn,{label:"Количество детей до 18 лет",placeholder:"Введите значение",isInteger:!0,...la(e("children"),ta.children,t?.required),...t}))),Zl=d((({field:e,input:t})=>o(kn,{label:"Кодовое слово",...la(e("codeWord"),ta.codeWord,t?.required),...t}))),Ql=d((({field:e,input:t})=>o(kn,{label:"Количество объектов инкассации",isInteger:!0,...la(e("collectionCount"),ta.collectionCount,t?.required)}))),er=d((({field:e,input:t})=>o(kn,{className:"col-span-2",...la(e("comment"),ta.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),tr=d((({field:e,input:t})=>{const{data:n}=ji("INCOME_CERT_UNITED");return o(hl,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),nr=d((({field:e,input:t})=>{const{data:n}=ji("MILITARY_STATUS");return o(hl,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),ar={processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3},consentToReceiveMaterials:{text:"Согласен на получение информационных и аналитических материалов по электронной почте"}};function ir({disabled:e,onClick:t}){return n=>{!e&&t&&t(n)}}const lr={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"},rr={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")},sr=d((({children:e,...t})=>{const n=e=>({...e,onClick:ce(ir(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(lr[i],rr[i]),a),type:s,role:d,onClick:m,children:e})})),or=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"})}))),cr=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>c("div",{className:u("relative bg-white pt-0 p-lg",e),role:"dialog",onClick:i,children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(or,{className:"absolute top-0 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]}))),dr=d((({src:e,convertToPng:t,onClose:n})=>c(cr,{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(sr,{className:"mx-auto mt-m",type:"button",onClick:n,children:"Ознакомиться"})]}))),mr=e=>{const{open:t}=sn(dr),n=ke();return l((async()=>{if(e){const a=URL.createObjectURL(await(async(e,t=!1)=>{const n=await ai(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return n?await n.blob():new Blob})(e,n));t({src:a})}}),[t,e,n])},ur=d((({className:e,error:t,docId:n,...a})=>{const i=mr(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)]})})),hr=d((({field:e,input:t})=>t&&t.name?o(ur,{text:ar[t.name]?.text,docId:ar[t.name]?.docId,...la(e(t.name),ta[t.name],t?.required)}):null)),pr=Math.round(29.5),gr=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]}))),fr="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",xr="flex flex-col lg:w-1/2 gap-2xl",yr="flex flex-col gap-y-xl min-w-52",br=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}))),vr=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(br,{value:n,...i}):o(_e,{size:"text-h3",children:"-"})]}))),Nr=(e=[],t=!1)=>wr([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),wr=(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]},Cr=(e,t=0)=>e?.sum?e.sum:t,Sr=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,kr=(e,t)=>e?o(w,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,Ir=({min:e=0,max:t=0,availableMonths:n,...a})=>o(el,{items:[`От ${Tr(e)}`,`До ${Tr(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...a}),Tr=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Br={horizontal:"@lg:flex-row",vertical:""},Rr=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",Br[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))))})]}))),Pr=({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(Rr,{orientation:a,items:e,value:e[i?0:1].id,onChange:t=>l&&l(t===e[0].id),...r})]}),Dr=e=>Pr({...e,className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Er=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...a})=>o(el,{items:e?[`От ${He(1)(a.min||0)} ${n}`,`До ${He(1)(a.max||0)} ${n}`]:[],step:t,...a}),Ar=({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))},_r=(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)},Mr=e=>e,Or=(e=Mr)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),zr=Or(),Fr=(e=Mr)=>Or((t=>-e(t))),Vr=Fr(),Lr=([e,t],n,a=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:$r([e,t],a),$r=([e,t],n=[])=>({[e]:n.length?Vr(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?zr(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),qr=(e,[t,n],a)=>e>=a[t]&&e<=a[n],jr={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Ur=e=>Wr({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Wr({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&Wr({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&Wr({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Wr=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],Hr=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,l=t?.rateRows||[jr],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Ur({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Lr(["minSum","maxSum"],r,l),{minMonths:c,maxMonths:d}=Lr(["minMonths","maxMonths"],r,l),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i})=>e?.find((e=>Ur({row:e,userInputParams:t,paramsViewSettings:n})&&qr(a,["minSum","maxSum"],e)&&qr(i,["minMonths","maxMonths"],e)))||jr)({rateRows:l,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i}),{rate:u}=m,h=_r(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:a,monthsValue:i,monthlyPayment:h}},Yr=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),Gr={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},Kr=Ft((({className:e,title:t,calcSource:n,buttons:a,footnote:l,paramsViewSettings:r,defaultParams:s,onChange:d,...m})=>{const h=(p=n?.rateRows,wr([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],p));var p;const[g,{field:f,isDirty:x}]=an({moneyValue:Cr(s,2e5),monthsValue:Sr(s,pr),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=Hr(g,n,r),b=Dr({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((()=>{!Yr(s)&&h&&Ar({field:f,defParams:h,calcParams:y,map:Gr,monthsValue:"minMonths"})}),[n,s]),o(gr,{className:e,title:t,...m,children:c("section",{className:u(fr,e),children:[c("div",{className:xr,children:[Er({title:"Сумма кредита, ₽",step:500,min:y.minSum,max:y.maxSum,...f("moneyValue"),value:y.moneyValue}),Ir({title:"Срок кредита, месяцев",min:y.minMonths,max:y.maxMonths,...f("monthsValue"),value:y.monthsValue}),Xr({...y,...r},f),o("div",{className:"sm:hidden",children:b})]}),c("div",{className:u(yr,"@4xl:w-1/2"),children:[o(vr,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(vr,{title:"Ставка",value:y?.rate,fractionDigits:2,postfix:"%"}),o(vr,{title:"Ежемесячный платёж",value:y.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:b}),qe(a,{isVertical:!0}),kr(l)]})]})})})),Xr=(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]}),Jr={moneyValue:"sum",monthsValue:"period",isInsurance:"isEnableInsurance",isPensionClient:"isEnablePensionClient",isStateEmployee:"isEnableStateEmployee",isSalaryClient:"isEnableSalaryClient",isAnnuity:"isAnnuity"},Zr=(e,t=!1)=>{const n=t?Qr(Jr):Jr;return Object.fromEntries(Object.entries(e??{}).map((([e,t])=>[n[e],t])))},Qr=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[t,e]))),es="calculator",ts=d((({field:e,params:t})=>{const n=l((t=>{e(es).onChange?.(t)}),[]);return o(Kr,{...t?.calcData,padding:"p-0",defaultParams:Zr(e(es).value),onChange:n})})),ns=d((({field:e,input:t})=>{const{data:n}=ji("CREDIT_IN_RSHB");return o(hl,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /\n вкладчиком с долей участия более 20% уставного капитала руководителем,\n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t,disabled:!e?.("shareholderFlg")?.value})})),as=d((({className:e,label:t,onChange:n,error:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Rr,{label:mn({label:t,errors:i?.errors}),onChange:e=>n&&n(e),...i}),yn(a)]}))),is=[{id:"810",text:"Рубли"}],ls=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("currency"),{data:i}=ji("CURRENCY"),l=i?.map((e=>({id:e.key,text:e.value})))??is;return o(as,{label:"Валюта",orientation:"horizontal",items:l,value:n,onChange:e=>a?.(e),...la(e("currency"),ta.currency,t?.required)})})),rs=d((({field:e,input:t})=>o(jl,{label:"Дата доставки",...la(e("deliveryDate"),ta.deliveryDate,t?.required)}))),ss=d((({field:e,input:t})=>o(kn,{label:"Количество иждивенцев",placeholder:"За исключение детей до 18 лет",isInteger:!0,maxLength:2,...la(e("dependents"),ta.dependents,t?.required),...t}))),os=d((({field:e,input:t})=>o(jl,{label:"Желаемая дата встречи",...la(e("desiredMeetingDate"),ta.meetingDay,t?.required)}))),cs=d((({field:e,input:t})=>o(Ma,{text:"Являюсь инвалидом",...la(e("disablePeopleFlg"),ta.disablePeopleFlg,t?.required)}))),ds="dulIssueDateField",ms=d((({field:e,input:t})=>o(jl,{label:"Дата выдачи",...la(e(ds),ta.dulIssueDateField,t?.required),disabled:t?.filledByEsia&&Sa(e,ds)}))),us="dulIssuedBy",hs=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&&Sa(e,us),label:"Кем выдан",...t,...la(e(us),ta.dulIssuedBy,t?.required),onDaDataChange:i,daDataQueryPrefix:n})})),ps=d((({field:e,input:t})=>o(kn,{disabled:t?.filledByEsia&&Sa(e,"dulNumber"),label:"Номер документа",isInteger:!0,maxLength:6,...la(e("dulNumber"),ta.dulNumber,t?.required)}))),gs=d((({field:e,input:t})=>o(kn,{disabled:t?.filledByEsia&&Sa(e,"dulSerie"),label:"Серия документа",isInteger:!0,maxLength:4,...la(e("dulSerie"),ta.dulSerie,t?.required)}))),fs="dulSubdivisionCode",xs=d((({field:e,input:t})=>{const n=l((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(kn,{disabled:t?.filledByEsia&&Sa(e,fs),label:"Код подразделения",isInteger:!0,maxLength:6,...t,...la(e(fs),ta.dulSubdivisionCode,t?.required),onDaDataChange:n})})),ys=d((({field:e,input:t})=>{const{data:n}=ji("EDUCATION_LEVEL");return o(hl,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),bs=d((({field:e,input:t})=>{const{required:n,...a}=t;return o(kn,{label:"Электронная почта",...la(e("email"),ta.email,n),...a})})),vs=d((({field:e,input:t})=>{const{data:n}=ji("ORGANIZATION_ACTIVITY_TYPE"),a=ul();return i((()=>{n&&(a.employerActivities=n)}),[n]),o(hl,{field:e,source:a.employerActivities??[],label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),Ns=d((({field:e,input:t})=>{const{data:n}=ji("ORGANIZATION_KIND"),a=ul();return i((()=>{n&&(a.employerOrganization=n)}),[n]),o(hl,{field:e,source:a.employerOrganization??[],label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),ws=d((({field:e,input:t})=>{const{data:n}=ji("EMPLOYMENT_INFO_UNITED");return o(hl,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),Cs=d((({field:e,input:t})=>o(kn,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",isInteger:!0,...la(e("expenses"),ta.expenses,t?.required),...t}))),Ss=d((({field:e,input:t})=>o(kn,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",maxLength:2,...la(e("experience5Years"),ta.experience5Years,t?.required),...t}))),ks=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)})})),Is=d((({field:e,input:t})=>{const{data:n}=ji("MARITAL_STATUS");return o(hl,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),Ts=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],Bs=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],Rs=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],Ps=d((({field:e,input:t})=>o(Mn,{label:"Способ получения ответа",options:Rs,...la(e("feedbackMethod"),ta.feedbackMethod,t?.required)}))),Ds=d((({field:e,input:t})=>o(kn,{label:"ФИО",...la(e("fullName"),ta.fullName,t?.required),...t}))),Es=d((({field:e,input:t})=>o(kn,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...la(e("generalSeniority"),ta.generalSeniority,t?.required),...t}))),As=d((({field:e,input:t})=>{const{data:n}=ji("HOUSE_TYPE");return o(hl,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),_s=e=>t=>e.map((e=>({key:t,text:e.value||""}))).find((e=>e.key===t))??null,Ms=(e,t,n)=>{const a=n.data?.inn??"",i=Number(n.data?.opf?.code),l=n.data?.okved??"";t?.("legalForm")?.onChange?.(n.data?.opf?.short),t?.("organizationAddress")?.onChange?.(Ia(n.data?.address)),t?.("amountWorkers")?.onChange?.(((e,t)=>{const[n]=[e?.find((e=>Number(t)<=Number(e.description)))].map((e=>({key:e?.key??"",text:e?.value??""})));return n})(e?.amountWorkers,n.data?.employee_count)),t?.("employerActivities")?.onChange?.(((e,t)=>{if(!t)return null;const n=_s(e),a=+t?.split(".")[0],i=+t?.split(".")[1];switch(a){case 1:return n("AGRICULTURE");case 35:return n("FUEL_AND_ENERGY");case 41:case 42:case 43:return n("CONSTRUCTION");case 46:case 47:return n("TRADE");case 55:case 79:return n("TOURISM");case 62:return n("TECHNOLOGY");case 63:return n("CONSULTING_SERVICE");case 64:return n("BANK");case 65:return n("INSURER");case 66:return n("FINANCIAL_INSTITUTIONS");case 72:case 74:return n("SCIENCE");case 80:return n("SECURITY");case 84:return n(i<22?"GOVERNANCE":22===i?"ARMY":"OTHER_SECTORS");case 85:return n("EDUCATION");case 86:return n("HEALTHCARE");case 87:return n("SOCIAL_SPHERE");default:return n(a>=10&&a<=33?"INDUSTRY":a>=5&&a<=9?"FUEL_AND_ENERGY":a>=49&&a<=53?"TRANSPORT":"OTHER_SECTORS")}})(e?.employerActivities??[],l)),t?.("organization")?.onChange?.(((e,t,n)=>_s(e)("7725114488"===n?"RSHB":50102===t?"SOLE_TRADER":t>=75e3&&t<=75505&&75500!==t?"BUDGETARY":"COMMERCIAL"))(e?.organization??[],i,a)),t?.("employerOrganization")?.onChange?.(((e,t)=>{const n=_s(e);return[40001,40002,71610].includes(t)?n("FOREIGN"):n("RUSSIAN")})(e?.employerOrganization??[],i))},Os=d((({field:e,input:t})=>{const n=ul(),a=l((t=>{e?.("organizationName")?.onChange?.(t.data?.name?.short_with_opf),Ms(n,e,t)}),[]);return o(kn,{label:"ИНН",isInteger:!0,maxLength:12,...t,...la(e("inn"),ta.inn,t?.required),onDaDataChange:a})})),zs=d((({field:e})=>o(Ma,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),Fs=d((({field:e,input:t})=>o(kn,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",isInteger:!0,maxLength:2,...la(e("jobsNumber"),ta.jobsNumber,t?.required),...t}))),Vs=d((({field:e,input:t})=>o(kn,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...la(e("lastJobExperience"),ta.lastJobExperience,t?.required),...t}))),Ls=d((({field:e,input:t})=>o(kn,{label:"Наименование юридического лица",...t,...la(e("legalEntityName"),ta.legalEntityName,t?.required),disabled:!e?.("shareholderFlg")?.value}))),$s=d((({field:e,input:t})=>o(kn,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...la(e("legalForm"),ta.legalForm,t?.required),...t}))),qs="limitedBirthday",js=d((({field:e,input:t})=>o(jl,{label:"Дата рождения",...la(e(qs),ta.limitedBirthday,t?.required),disabled:t?.filledByEsia&&Sa(e,qs)}))),Us=`${Ut}/outservice`,Ws=[];async function Hs(){const e=await Pt(`${Us}/outserviceregions`);return e&&Array.isArray(e)?e:Ws}const Ys=d((({field:e,input:t})=>{const n=e("region"),a=n?.value?.key,{data:l}=ga("outServiceRegions",Hs),r=l?.find((e=>e.code===a))?.localities?.map((e=>({key:e,text:e})));return i((()=>{""!==a&&e?.("localities")?.onChange?.("")}),[a]),o(Mn,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:r,...la(e("localities"),ta.localities,t?.required),isSearch:!0})})),Gs=d((({field:e,input:t})=>o(kn,{label:"Обязательные выплаты",placeholder:"Введите значение",isInteger:!0,...la(e("mandatoryPayments"),ta.mandatoryPayments,t?.required),...t}))),Ks=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],Xs=d((({field:e,input:t})=>o(as,{orientation:"horizontal",items:Ks,...la(e("methodObtain"),ta.methodObtain,t?.required)}))),Js="middleName",Zs=d((({field:e,input:t})=>o(kn,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&Sa(e,Js),...la(e(Js),ta.middleName,t?.required),...t}))),Qs=d((({field:e,input:t})=>o(kn,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&Sa(e,t.name??""),...la(e("name"),ta.name,t?.required),...t}))),eo=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]}))),to=d((({field:e})=>oa(e("acquiringType")?.value?.key)?o(eo,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),no=d((({field:e,input:t})=>{const{data:n}=ji("ORGANIZATION_TYPE"),a=ul();return i((()=>{n&&(a.organization=n)}),[n]),o(hl,{field:e,source:a.organization??[],label:"Тип организации",fieldName:"organization",input:t})})),ao=d((({field:e,input:t})=>{const n=ul(),a=l((t=>{e?.("inn")?.onChange?.(t.data?.inn),Ms(n,e,t)}),[]);return o(kn,{label:"Наименование организации",...t,...la(e("organizationName"),ta.organizationName,t?.required),onDaDataChange:a})})),io=d((({field:e,input:t})=>o(kn,{label:"Иные доходы",placeholder:"Введите значение",isInteger:!0,...la(e("otherIncome"),ta.otherIncome,t?.required),...t}))),lo=d((({field:e,input:t})=>o(jl,{label:"Дата регистрации по месту жительства",...la(e("participantDateRegistration"),ta.participantDateRegistration,t?.required)}))),ro="partInBusiness",so=d((({field:e,input:t})=>{const n=l((t=>{e(ro)?.onChange?.(String(Number(t)>100?100:Number(t)||""))}),[]);return o(kn,{label:"Доля участия в бизнесе",placeholder:"в %",isInteger:!0,maxLength:3,...la(e(ro),ta.partInBusiness,t?.required),...t,onChange:n})})),oo=d((({field:e,input:t})=>{const{required:n,...a}=t;return o(kn,{...la(e("partnerComments"),ta.partnerComments,n),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...a})})),co=d((({field:e,input:t})=>{const{value:n,onChange:r}=e("paymentSystem"),[s]=Gl("programId"),[c,d]=a([]);i((()=>{s&&(async()=>{const e=await(async e=>{const t=await ni("/public-data/creditProgramConditions","POST",{creditProgramId:e});return t?.paymentSystems||[]})(s);d(e||[])})()}),[]);const m=l((e=>r?.(c?.find((t=>t.type===e)))),[c,r]);return o(as,{label:"Платежная система",orientation:"horizontal",items:mo(c),...la(e("paymentSystem"),ta.paymentSystem,t?.required),value:n?.type,onChange:m})})),mo=e=>e?.map((e=>({id:e.type,text:e.name})))??[],uo=e=>"_"===e,ho=e=>/\d/.test(e),po=e=>uo(e)||ho(e),go=[..."+7 (___) ___-__-__"],fo=go.findIndex(uo),xo=go.map(((e,t)=>po(e)?go.slice(0,t).filter(po).length:-1));function yo(e){const t=e.replace(/\D/g,""),n=go.map(((e,n)=>ho(e)?e:t.charAt(xo[n])||e)),a=xo.indexOf(t.length-1)+1;return(a?n.slice(0,Math.max(fo,a)):n).join("")}const bo=d((({children:e,onChange:t,...n})=>{const a=l((e=>t&&t(yo(e))),[t]),i=l((e=>{"+7 ("===e&&t&&t("")}),[]);return o(fn,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>i(e?.target?.value||""),children:e})})),vo=d((({className:e,label:t,error:n,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(bo,{"aria-label":t,label:mn({label:t,errors:a?.errors}),valid:Boolean(!n),placeholder:"+7 (___) ___-__-__",...a}),yn(n)]}))),No=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(vo,{label:"Телефон",...la(e(n),ta.phone,t?.required),disabled:t?.filledByEsia&&Sa(e,n),...t})})),wo=d((({field:e,input:t})=>{const{data:n}=ji("POSITION");return o(hl,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),Co=d((({field:e})=>oa(e("acquiringType")?.value?.key)?o(eo,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),So=d((({field:e,source:t})=>o(Mn,{placeholder:"Выберите продукт",label:"Продукт",options:ko(t?.productList),...ia(e("product"),ta.product)}))),ko=e=>(e??[]).map((e=>({key:e,value:e}))),Io=`${Ut}/outservice/outserviceregions`,To=`${Ut}/regions`,Bo=[];function Ro(e=To){const{data:t}=ga(e,Dt);return Array.isArray(t)?t:Bo}const Po=d((({field:e,input:t,params:n})=>{var a;const i=Ro((a=n?.typeForm,"OUTSERVICE"===a?Io:void 0));return o(Mn,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...la(e("region"),ta.region,t?.required)})})),Do=d((({field:e,input:t})=>{const n=va(!0),a=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(Mn,{label:"Регион",placeholder:"Выберите регион",options:a,...la(e("region"),ta.region,t?.required)})})),Eo=d((({field:e,input:t})=>{const{data:n}=ji("REGION_RF"),a=n?.map((({key:e,value:t})=>({key:e,text:t})));return o(Mn,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:a,...la(e("regionRetail"),ta.regionRetail,t?.required)})})),Ao=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})})),_o=d((({field:e})=>{const t=e("secondaryPhone");return o(vo,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?ia(t,ta.secondaryPhone):t})})),Mo=d((({field:e,input:t})=>o(Mn,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Bs,...la(e("serviceDirection"),ta.serviceDirection,t?.required)}))),Oo=["male","female"],zo=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],Fo=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 ni("/suggestions/suggest/fio","POST",{query:e,count:1,parts:["NAME"]}),n=t?.suggestions[0]?.data?.gender?.toLowerCase()||"";return Oo.includes(n)?n:""})(n);e&&l?.(e)})()}),[]),o(as,{label:"Пол",orientation:"horizontal",items:zo,...la(e("sex"),ta.sex,t?.required)})})),Vo=d((({field:e,input:t})=>o(Ma,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...la(e("shareholderFlg"),ta.shareholderFlg,t?.required)}))),Lo=d((({children:e,onChange:t,...n})=>{const a=l((e=>t&&t(Tl(e,"___-___-___ __"))),[t]),i=l((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(fn,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>i(e?.target?.value||""),children:e})})),$o=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(Lo,{"aria-label":t,label:mn({label:t,errors:r?.errors}),valid:Boolean(!a),value:n,onChange:i,onBlur:l,placeholder:"___-___-___ __"}),yn(a)]}))),qo=d((({field:e,input:t})=>o($o,{label:"СНИЛС",...la(e("snils"),ta.snils,t?.required),...t}))),jo=d((({field:e,input:t})=>o(kn,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&Sa(e,"surname"),...la(e("surname"),ta.surname,t?.required),...t}))),Uo=["От 1 мес","До 15 лет"],Wo=d((({field:e})=>o(el,{title:"Срок, месяцев",items:Uo,min:1,max:180,...e("term")}))),Ho=d((({field:e,input:t})=>o(kn,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...la(e("totalIncome"),ta.totalIncome,t?.required),...t}))),Yo=d((({field:e,input:t})=>o(Mn,{label:"Тип обслуживания",options:Ts,...la(e("serviceType"),ta.serviceType,t?.required)}))),Go=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],Ko=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(Rr,{className:"whitespace-normal",orientation:"horizontal",items:Go,value:t,onChange:e=>n&&n(e)})})})),Xo=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 Jo={$ref:"/wcms-resources/outservice-productlist.json"},Zo={fullName:e=>o(Ds,{...e}),addressBranch:e=>o(wa,{...e}),desiredMeetingDate:e=>o(os,{...e}),product:e=>o(So,{...e,source:Jo}),localities:e=>o(Ys,{...e}),isClient:e=>o(zs,{...e}),partnerComments:e=>o(oo,{...e}),collectionCount:e=>o(Ql,{...e}),acquiringType:e=>o(sa,{...e}),onlineCheckout:e=>o(to,{...e}),posTerminal:e=>o(Co,{...e}),serviceType:e=>o(Yo,{...e}),term:e=>o(Wo,{...e}),amount:e=>o(il,{...e}),annualRevenue:e=>o(gl,{...e}),vedTypes:e=>o(Ko,{...e}),feedbackMethod:e=>o(Ps,{...e}),serviceDirection:e=>o(Mo,{...e}),bankEmpolee:e=>o(yl,{...e}),secondaryPhone:e=>o(_o,{...e}),applicationDate:e=>o(kn,{label:"Дата и время обращения в Банк",...e}),region:e=>Na(e?.params?.typeForm)?o(Do,{...e}):o(Po,{...e}),consentToReceiveMaterials:e=>o(hr,{...e}),surname:e=>o(jo,{...e}),name:e=>o(Qs,{...e}),middleName:e=>o(Zs,{...e}),birthday:e=>o(Wl,{...e}),phone:e=>o(No,{...e}),email:e=>o(bs,{...e}),inn:e=>o(Os,{...e}),comment:e=>o(er,{...e})},Qo={processPersonalDataFlg:e=>o(hr,{...e}),consentProviderFlg:e=>o(hr,{...e}),consentOthersFlg:e=>o(hr,{...e}),consentInformFlg:e=>o(hr,{...e}),consentPfrFlg:e=>o(hr,{...e}),organizationPhone:e=>o(No,{...e}),legalForm:e=>o($s,{...e}),organizationName:e=>o(ao,{...e}),generalSeniority:e=>o(Es,{...e}),lastJobExperience:e=>o(Vs,{...e}),experience5Years:e=>o(Ss,{...e}),jobsNumber:e=>o(Fs,{...e}),beginDate:e=>o(Ul,{...e}),addressFact:e=>o(Ca,{...e}),organizationAddress:e=>o(ka,{...e}),sex:e=>o(Fo,{...e}),limitedBirthday:e=>o(js,{...e}),birthPlace:e=>o(Hl,{...e}),education:e=>o(ys,{...e}),housing:e=>o(As,{...e}),employment:e=>o(ws,{...e}),organization:e=>o(no,{...e}),amountWorkers:e=>o(pl,{...e}),employerActivities:e=>o(vs,{...e}),employerOrganization:e=>o(Ns,{...e}),positionOrganization:e=>o(wo,{...e}),familyStatus:e=>o(Is,{...e}),children:e=>o(Jl,{...e}),familyMembers:e=>o(ks,{...e}),dependents:e=>o(ss,{...e}),totalIncome:e=>o(Ho,{...e}),expenses:e=>o(Cs,{...e}),snils:e=>o(qo,{...e}),conscription:e=>o(nr,{...e}),armyIdFlg:e=>o(fl,{...e}),dulSerie:e=>o(gs,{...e}),dulNumber:e=>o(ps,{...e}),dulIssueDateField:e=>o(ms,{...e}),dulSubdivisionCode:e=>o(xs,{...e}),dulIssuedBy:e=>o(hs,{...e}),addressRegistration:e=>o(ka,{...e}),addressCourier:e=>o(ka,{...e}),participantDateRegistration:e=>o(lo,{...e}),retirementIncome:e=>o(Ao,{...e}),otherIncome:e=>o(io,{...e}),wages:e=>o(Xo,{...e}),mandatoryPayments:e=>o(Gs,{...e}),disablePeopleFlg:e=>o(cs,{...e}),bankruptcyFlg:e=>o(bl,{...e}),shareholderFlg:e=>o(Vo,{...e}),legalEntityName:e=>o(Ls,{...e}),creditInRshbCd:e=>o(ns,{...e}),bankEmployeeCode:e=>o(xl,{...e}),partInBusiness:e=>o(so,{...e}),regionRetail:e=>o(Eo,{...e}),addressRetail:e=>o(Yi,{...e}),addressMatch:e=>o(Oa,{...e}),calculator:e=>o(ts,{...e})},ec={paymentSystem:e=>o(co,{...e}),currency:e=>o(ls,{...e}),cardCategory:e=>o(Kl,{...e}),codeWord:e=>o(Zl,{...e}),confirmationIncome:e=>o(tr,{...e}),methodObtain:e=>o(Xs,{...e}),deliveryDate:e=>o(rs,{...e})},tc=(e,t)=>(n,a)=>{const i={...Zo,...Qo,...ec};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:i[n?.name||""]?.({field:e,input:n,params:t})},String(a)):null},nc=e=>2===e?"@xl:grid-cols-2":"",ac=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(_e,{size:"text-h6",children:e})}):null,ic=d((({responseType:e,typeForm:t,onClose:n})=>{const a="OK"===e,i="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(cr,{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(sr,{type:"button",onClick:n,children:"Хорошо"})]})})})),lc=e=>t=>t&&Object.entries(e).flatMap((([e,n])=>n(t[e])))||[],rc=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,...oc(o),...sc(c),...m?{partnerComments:m}:{},...s?{typeForm:s}:{}};return Object.fromEntries(Object.entries(u)?.map((([e,t])=>[e,t?.key||t])))},sc=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},oc=e=>e?{vedTypes:Object.fromEntries(Go.map((({id:t})=>[t,t===e])))}:{},cc={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:ra[0],serviceType:Ts[0],feedbackMethod:Rs[0],serviceDirection:Bs[0],vedTypes:Go[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},dc=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]}))),mc=(e,t)=>o(sr,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),uc=(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(dc,{link:t})]}),yn(ia(e,Gn).error)]}):o(dc,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),mc(n)]}),hc={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),...Gt(l,g),...Wt(i),...Ht(s,"desiredMeetingDate"),...g?Ht(r):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...Kt(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}}},pc=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||cc[e.name||""]])));return n?.serviceType&&"PREMIUMSERVICE"===t&&(n.serviceType=Ts[1]),{...n,typeForm:{key:t,text:""}}})(x,n),[b,v]=a(""),w=sn(ic),C=l((async(e,t)=>{const a=gc(x,e),i=lc(aa(a));if(!On(i(e)))return console.warn("validation fail");const l=rc({...e,...h}),r=await hc.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(nc(e.columns),"grid gap-x-m"),children:[ac(e.title),(e?.inputs||[])?.map(tc(S,{typeForm:n}))]},`section-${t}`))),uc(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]})})),gc=(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)})))),fc=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(ri,{isFoldButtonOnTop:!0,unfoldedByDefault:!0,renderFoldableSection:({isUnfolded:a})=>o(si,{isUnfolded:a,className:"flex flex-col pl-2xl",children:e.map(tc(n,{typeForm:t}))}),renderFoldButton:xc(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?"Отметьте все обязательные соглашения":"")]}))})})})),xc=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"})})]}),yc=({field:e,typeForm:t="",inputs:n})=>{const{consentInputs:a,restInputs:i}=bc(n||[]);return a.length>2?c("div",{children:[i.map(tc(e,{typeForm:t})),o(fc,{inputs:a,field:e})]}):(n||[])?.map(tc(e,{typeForm:t}))},bc=e=>({consentInputs:e?.filter((e=>Object.keys(ar).includes(e.name||"")))||[],restInputs:e?.filter((e=>!Object.keys(ar).includes(e.name||"")))||[]}),vc=[{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"}]}],Nc=(e,t)=>o(sr,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),wc=e=>ai("/user-data/updateUserProfile","PUT",e),Cc=e=>ai("/user-data/updateUserTask","PUT",e),Sc=(e,t)=>Boolean(e)&&"string"!=typeof e&&Boolean(e?.errorMessage.startsWith(`Too many request for phoneNumber [${t}]`)),kc={width:"118",height:"24"},Ic={"bg-white":"color",transparent:"white"},Tc={"bg-white":"text-primary-main",transparent:"text-white"},Bc=(e,t,n)=>o(ne,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:Ic[e]},className:Tc[e],width:n?.width,height:n?.height}),Rc={"bg-white":"text-primary-text",transparent:"text-white"},Pc=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:[Bc(l,n?.image,kc),r?a??o("div",{className:"ml-s",children:o(_e,{font:"font-medium",color:Rc[l],size:"",children:n?.title??"Россельхозбанк"})}):null]}))),Dc=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},ai("/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=>ai(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?await e.blob():new Blob)))(e)))})()}),[]);return i(g,[]),o(cr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",head:o(Pc,{}),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(sr,{onClick:close,version:"secondary",children:"Вернуться"}),o(sr,{type:"submit",disabled:!d,onClick:p,version:"secondary",children:"Отправить"})]})]})})})),Ec=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:Ac(e)})))),Ac=e=>`${`${Math.floor(e/60)}`.padStart(2,"0")}:${(""+e%60).padStart(2,"0")}`,_c=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:Mc(a,e,n)},a)))}),n?o("div",{className:"text-error",children:r}):null]})})),Mc=(e,t,n=!1)=>{const a=!t[e];return`w-16 sm:w-20 h-24 text-5xl text-center p-md m-2 border ${pn(!n||!a)} rounded-md caret-transparent outline-none`},Oc=d((({isDisabled:e,onClick:t,text:n})=>o(sr,{type:"button",onClick:t,disabled:e,children:o(_e,{font:"font-normal",children:n})}))),zc=e=>{e&&(globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token))},Fc=({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=>ni("/sms/checkCode","POST",e).then(zc))({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}},Vc=d((({phone:e,code:t=!0,codeLength:n=4,consents:r,onSuccess:s=un,onClose:d=un})=>{const[m,u]=a(Array(n).fill("")),{handleSubmit:h,hasError:p,errorText:g,isLoading:f,timeNextReq:x,isSubmitButtonDisabled:y,setTimeNextReq:b,setIsTimerStarted:v,setAttempts:N}=Fc({values:m,onSuccess:s}),w=sn(Dc),C=jt(e),k=l((async()=>{var e;await(e={phoneNumber:C,smsCodesSetName:{key:"AUTHENTICATION"}},ni("/sms/sendCode","POST",e).then((t=>!Sc(t,e.phoneNumber))))?(N(0),b(180),v(!0)):w.open({phoneNumber:C,sendCode:k,onClose:d})}),[C,d]);return i((()=>{k()}),[]),o(cr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl p-m",onClose:d,children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[o(S,{className:"w-full",title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),t?o(_c,{values:m,setValues:u,errorText:g,hasError:p}):null,$c(x,b,k),c(Ee,{itemSize:"list-s",children:[o("span",{children:"Вводя код, я подтверждаю, что ознакомлен и подписываю: "}),o("ul",{children:r?.map(((e,t)=>o("li",{children:e},`${e}-${t}`)))})]}),Lc(y,h),f?o(za,{blur:!1}):null]})})})),Lc=(e,t)=>o(Oc,{text:"Далее",isDisabled:e,onClick:t}),$c=(e,t,n)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(Ec,{className:"text-base ml-1",time:e,setTime:t})]}):o(Ne,{onClick:n,className:"text-primary-main",children:"Получить новый код"}),qc={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},jc={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},Uc=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],Wc=d((({onSubmit:e=un,onClose:t=un})=>{const[n,i]=a(""),[r,s]=a(!1),d=mr(2),m=l((()=>{e(n)}),[e,n]),u=l((e=>{i(e),"REFUSE"===e&&s(!0)}),[]),h=r?jc:qc;return o(cr,{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(Rr,{className:"whitespace-normal",orientation:"horizontal",items:Uc,value:n,onChange:u}),o(sr,{disabled:!n,type:"button",onClick:m,children:"Далее"})]})})})),Hc=()=>ml(),Yc=(e,t)=>l((n=>{const a=n instanceof Function?n(e[t]):n;null!=a?e[t]=a:delete e[t]}),[e,t]),Gc=d((({title:e,icon:t,description:n,onClick:a=un})=>c("button",{className:"flex gap-lg items-center border border-gray rounded-md cursor-pointer p-4 hover:border-green",type:"button",onClick:a,children:[o(ne,{image:{src:t},width:"78",height:"78"}),c("div",{children:[o(N,{className:"text-left",title:e,headingType:"h5"}),n?o(w,{color:"text-secondary-text",size:"text-m",children:n}):null]})]}))),Kc={credit_cash:"10",credit_cash_single_doc:"28",credit_mcx:"39",family_offer_credit:"41",gas_engine_fuel:"33",pension_credit:"12",ref_credit:"11",ref_credit_single_doc:"29",self_employed:"34",summer_cash:"35",summer_cash_pens:"36"},Xc={...Kc,amur_card:"14",owner_card:"13",travel_card:"15"},Jc=e=>{const t=e?.find((e=>"WAGES"===e.incomeTypeCd.key))?.value,n=e?.find((e=>"MANDATORY_PAYMENTS"===e.incomeTypeCd.key))?.value,a=e?.find((e=>"INCOME_AVERAGE"===e.incomeTypeCd.key))?.value,i=e?.find((e=>"ADDITIONAL_INCOME"===e.incomeTypeCd.key))?.value,l=e?.find((e=>"OTHER_INCOME"===e.incomeTypeCd.key))?.value,r=e?.find((e=>"OTHER_PAYMENTS"===e.incomeTypeCd.key))?.value,s=e?.find((e=>"RENTAL_INCOME"===e.incomeTypeCd.key))?.value,o=e?.find((e=>"RETIREMENT_INCOME"===e.incomeTypeCd.key))?.value;return{wages:t,mandatoryPayments:n,incomeAverage:a,additionalIncome:i,otherIncome:l,otherPayments:r,rentalIncome:s,retirementIncome:o}},Zc=e=>{const t=e?.find((e=>"REGISTRATION"===e.addressType.key)),n=e?.find((e=>"RESIDENTAL"===e.addressType.key)),a=e?.find((e=>"WORK"===e.addressType.key));return{addressRegistration:t,addressFact:n,organizationAddress:a}},Qc=e=>{const t=e?.find((e=>"EMAIL"===e.contactTypeCd.key))?.value,n=e?.find((e=>"MAIN_PHONE"===e.contactTypeCd.key))?.value,a=e?.find((e=>"ORGANIZATION_PHONE"===e.contactTypeCd.key))?.value;return{email:t,phone:n,organizationPhone:a}},ed=e=>e?.key?{key:e.key,text:e.value}:void 0,td=d((function({task:e,isFromLead:t=!1,onClose:n=un}){const a=Hc(),i=Yc(a,"leadForm"),r=Jt(),{participants:s,creditProgram:d,id:m}=e,u=Xc[d.code],h=Boolean(Kc[d.code]),p=h?"/credit-lead":"/credit-card-lead",{name:g,midname:f,id:x,profile:y}=s[0],b=l((()=>{const t=(e=>{const t=e.participants[0],{loanAmount:n,creditPeriod:a,paymentTypeCd:i}=e,{currencyCode:l,paymentSystemTypeCd:r,classCard:s,codeWord:o,birthDate:c,midname:d,name:m,surname:u,birthPlace:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:x,dulSubdivisionCode:y,educationLevelCd:b,registrationDate:v,houseTypeCd:N,genderCd:w,participantContacts:C=[],participantAddresses:S=[],employmentContractDate:k,employmentTypeCd:I,organizationName:T,organizationInn:B,organizationActivityTypeCd:R,organizationTypeCd:P,organizationKindCd:D,employeesNumberCd:E,opf:A,seniority:_,generalSeniority:M,jobsNumber:O,lastWorkDuration:z,positionCd:F,maritalStatusCd:V,childrenDependents:L,totalDependents:$,otherDependents:q,militaryStatusCd:j,participantIncomes:U,snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:G,nameLegalEntity:K,creditInRshbCd:X,payrollCardRshbFlg:J,consentInsuranceFlg:Z}=t;return{currency:l?.key,paymentSystem:r,cardCategory:ed(s),codeWord:o,limitedBirthday:c,middleName:d,name:m,surname:u,birthPlace:h,dulIssueDateField:p,dulIssuedBy:g,dulNumber:f,dulSerie:x,dulSubdivisionCode:y,education:ed(b),participantDateRegistration:v,housing:ed(N),beginDate:k,employment:ed(I),organizationName:T,inn:B,employerActivities:ed(R),organization:ed(P),employerOrganization:ed(D),amountWorkers:ed(E),legalForm:A,generalSeniority:_?.toString(),experience5Years:M?.toString(),jobsNumber:O?.toString(),lastJobExperience:z?.toString(),positionOrganization:ed(F),familyStatus:ed(V),children:L?.toString(),familyMembers:$?.toString(),dependents:q?.toString(),conscription:ed(j),snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:G,legalEntityName:K,creditInRshbCd:ed(X),calculator:{isInsurance:J,isSalaryClient:Z,moneyValue:n,monthsValue:a,isAnnuity:"ANNUITY"===i?.key},...Jc(U),...Zc(S),...Qc(C),...(Q=w,Q?.key?{sex:"MAN"===Q.key?"male":"female"}:null)};var Q})(e);a.participantId=x,a.taskId=m,a.profileId=y?.id,a.programId=u,i(t),r.assign(p)}),[]),v=l((()=>{r.assign(h?"/natural/loans/all-goals":"/natural/creditcards/svoya")}),[]),w=l((()=>{r.assign("/")}),[]);return o(cr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:n,children:c("div",{className:"flex flex-col gap-lg",children:[o(N,{className:"whitespace-pre-wrap",title:`${g&&f?`${g} ${f}, `:""}мы нашли черновик вашей заявки.\nПродолжите заполнение?`,headingType:"h5"}),o(Gc,{title:"Перейти к черновику",icon:"api/v1/wcms-file-storage/72d06937-5d8b-4996-9503-52389b93919e/file.svg",description:"Продолжайте заполнять заявку из черновика",onClick:b}),o(Gc,{title:t?"Продолжить заполнение текущей заявки":"Заполнить новую заявку",icon:"api/v1/wcms-file-storage/796c3e8d-341a-480b-b52f-3aa5784ed623/file.svg",onClick:t?n:v}),o(sr,{type:"button",version:"secondary",className:"w-full text-h5",onClick:w,children:"Вернуться на главную"})]})})})),nd=d((function({onClose:e=un}){const t=Jt(),n=l((()=>{t.assign("/natural/loans/all-goals")}),[]),a=l((()=>{t.assign("/")}),[]);return o(cr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:e,children:c("div",{className:"flex flex-col gap-lg",children:[o(N,{className:"text-center",title:"Заявки не найдены",headingType:"h3"}),o(w,{size:"text-l",align:"text-center",children:"По данному номеру не найдено незавершенных заявок. Вы можете заполнить новую заявку или вернуться на главную страницу"}),o(sr,{type:"button",className:"w-full",onClick:n,children:"Заполнить новую заявку"}),o(sr,{type:"button",version:"secondary",className:"w-full",onClick:a,children:"Вернуться на главную"})]})})})),ad=d((({onClose:e})=>{const t=Jt(),[n,a]=Gl("leadForm"),i=l((async()=>{const e=await(n={redirectUri:t.href},ni("/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(cr,{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(sr,{type:"button",onClick:i,children:"Заполнить через Госуслуги"}),o(sr,{type:"button",version:"secondary",onClick:r,children:"Пропустить"})]})]})})})),id={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},ld={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK"},rd={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},sd=e=>Object.entries(e).reduce(((e,[t,n])=>t in id?[...e,{contactTypeCd:{key:id[t]},value:n}]:e),[]),od=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in ld){const a=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:ld[t]},...a}]}return e}),[]),cd=e=>Object.entries(e).reduce(((e,[t,n])=>t in rd?[...e,{incomeTypeCd:{key:rd[t]},value:Number(n||0)}]:e),[]),dd=({inputs:e,programId:t,nextStepLink:n})=>{const[i,r]=a(""),s=(()=>{const e=Hc(),t=Yc(e,"leadForm");return l((({participantId:n,taskId:a,profileId:i,formData:l,programId:r})=>{e.participantId=n,e.taskId=a,e.profileId=i,e.programId=r,t(l)}),[])})(),o=(e=>{const{open:t}=sn(ad),n=Jt();return l((()=>{t({onClose:()=>n.assign(e)})}),[t,e])})(n),c=(e=>{const{open:t}=sn(Wc),n=sn(Vc),a=t=>async n=>{try{t&&await wc({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()}catch(e){console.log(e)}},i=(t,i)=>async l=>{"SIGNED"===l&&t?n.open({phone:t,consents:["согласие на запрос информации в БКИ"],onSuccess:a(i)}):e()};return{open:(n,a)=>t({onSubmit:i(n,a),onClose:e})}})(o),d=sn(Vc),m=(()=>{const{open:e}=sn(td),{open:t}=sn(nd);return{open:({task:n,isFromLead:a,onClose:i})=>{n?e({task:n,isFromLead:a,onClose:i}):t({})}}})();return{handleSubmit:l((async n=>{const a=lc(aa(e));var i;if(On(a(n)))try{const e=await(i={profile:{phone:jt(n.phone)}},ni("/public-data/createUserProfile","POST",i).then((e=>e?.profile?.id||null)));if(e&&n?.phone){const a=async()=>{await md({programId:t,profileId:e,formData:n,saveUserData:s}),d.close(),c.open(n.phone,e)},i=async()=>{try{const n=await(async e=>{const t=await ni("/user-data/getLastStatus","POST",e);return"DRAFT"===t?.statusCd?t?.taskId:null})({profileId:e,programId:t});if(n){const e=await(async e=>await ni("/user-data/getTaskById","POST",e)||void 0)({taskId:n});d.close(),m.open({task:e,isFromLead:!0,onClose:a})}else await a()}catch{r("Fail")}},l=Object.keys(ar).filter((e=>n[e])).map((e=>ar[e]?.text));d.open({phone:n?.phone,consents:l,onSuccess:i})}}catch{r("Fail")}}),[]),responseStatus:i}},md=async({programId:e,profileId:t,formData:n,saveUserData:a})=>{const i=ud(n);await wc(((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,i));const{taskId:l,participantId:r}=await(async e=>await ni("/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:sd({phone:o&&jt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}]}}})({participantId:r,taskId:l,profileId:t,formData:i}))}catch(e){console.log(e)}a({participantId:r,taskId:l,profileId:t,programId:e,formData:n})},ud=e=>{const{consentOthersFlg:t,...n}=e;return{...n,consentCollectionFlg:t,consentAssignmentClaimsFlg:t,consentPhotoFlg:t}},hd={typeForm:"",region:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",organizationPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:ra[0],serviceType:Ts[0],feedbackMethod:Rs[0],serviceDirection:Bs[0],vedTypes:Go[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:{name:"",type:""},cardCategory:{key:"",text:""},codeWord:"",addressRetail:{key:"",text:""}},pd=(e,t)=>{if(t)return{...t,limitedBirthday:new Date(t?.limitedBirthday||0)};return{...Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||hd[e.name||""]]))),typeForm:{key:"",text:""}}},gd=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:yo(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:fd(i),addressFact:fd(l),esiaAccountTypeCd:t?.esiaAccountType}},fd=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}},xd=(e,t)=>{const n=Jt(),[a,{setTrue:s,setFalse:o}]=on(!1),c=Hc(),d=Yc(c,"leadForm"),m=r((()=>pd(e,c.leadForm)),[e,c.leadForm]),u=l((async(e,a,i)=>{s();try{const r=await(l={profileId:e,code:a,state:i,redirectUri:globalThis.location?.href},ni("/esia/updateProfileEsia","POST",l));r&&d((e=>({...e,...gd(r)}))),n.assign(t)}finally{o()}var l}),[t]);return i((()=>{const e=Yl(globalThis.localStorage?.getItem("profileId")??""),t=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),n=t.get("code"),a=t.get("state");e&&n&&a?u(e,n,a):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),[m,{isLoading:a}]},yd=d((({className:e,title:t,programId:n="",nextStepLink:a="/credit-lead",button:l,...s})=>{const d=r((()=>vc?.flatMap((e=>e?.inputs))||[]),[vc]),[m,{isLoading:h}]=xd(d,a),{handleSubmit:p,responseStatus:g}=dd({inputs:d,programId:n,nextStepLink:a}),[,{field:f,onSubmit:x}]=an(m,{onSubmit:p}),y=sn(ic);return i((()=>{g&&y.open({responseType:g})}),[g]),o(rn,{className:u("container space-y-m",e),title:t,...s,children:c("form",{onSubmit:x,className:"space-y-m relative",children:[h?o(za,{blur:!1}):null,vc.map(((e,t)=>c("div",{className:u(nc(e.columns),"grid gap-x-m"),children:[ac(e.title),yc({field:f,inputs:e?.inputs})]},`section-${t}`))),Nc(l)]})})})),bd=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"})]})})),vd=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",Nd=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`}),wd=10;function Cd(e,{sensitivity:t,rootRef:n}={}){const a=s(null),l=r((()=>({threshold:Sd(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 Sd(e=0){const t=Math.round(e*wd);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const kd=d((({className:e,style:t,idx:n,activeIndex:a,observerOptions:i,children:r,onIntersection:s})=>{const c=Cd(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})})),Id=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],Td=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(Rd(n))}),[g,f]),v=i>0?r*Number(i)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?Bd(c,v):{},...N?Nd(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(kd,{className:u(m,i?Id[i-1]:"",{"h-full":N},t),style:w?Bd(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})),Bd=(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)),Pd={"horizontal-list":"w-6","vertical-list":"h-6"},Dd=({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?Pd[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(i)},String(i)),Ed=({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))},Ad=e=>t=>e.scrollWidth/t,_d=e=>(t,n)=>{e.scrollBy({left:n*Ad(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?[Fr()(i),Or()(i)]:[-1,-1],m=c>0,u=d<e-1,h=l((()=>{var t;n.current&&(m?_d(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=l((()=>{n.current&&(u?_d(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}]},Od={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},zd=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=Fd(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(Td,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(Ed({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",Od[a],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(Dd({activeIndex:t,onClick:f,listType:a}))}):null})),Fd=(e=!1)=>({behavior:e?"auto":"smooth"}),Vd=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"})}))),Ld=d((e=>o(Vd,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),$d=d((e=>o(Vd,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),qd="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",jd=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?Ud(t):null,l?o(Ld,{className:u(Wd(i),m?"left-1":"left-0"),onClick:s}):null,r?o($d,{className:u(Wd(i),m?"right-1":"right-0"),onClick:d}):null]})})),Ud=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(qd,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(qd,"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)]"),Hd=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(Td,{containerRef:b,activeIndex:N,visibleItemCount:i,gap:n,padding:a,listType:l,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(jd,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(zd,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:y,listType:l,version:t,navButtons:x,containerRef:b,containerScroll:v})]})})),Yd=({blocksToRender:e,...t})=>o(Hd,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:R(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",vd(!0)),children:T(e,t)},String(n))})}),Gd=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]}))),Xd=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}))),Jd=({isUnfolded:e,onToggle:t})=>o(Xd,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Zd=["ArrowDownIcon","ArrowUpIcon"],Qd="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",em=({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(Qd),children:[R(l,{...i.options,parent:n}),Gd(l.length)?o(Lt,{className:"col-span-6",...i}):null]}),o(ri,{renderFoldableSection:({isUnfolded:e})=>c(si,{className:u(Qd),isUnfolded:e,children:[R(r,{...i.options,parent:n}),Gd(r.length)?o(Lt,{className:"col-span-6",...i}):null]}),renderFoldButton:({isUnfolded:n,onToggle:a})=>o(Xd,{className:u({hidden:e<1}),disabled:!r?.length,label:t,icon:Zd[Number(n)],dataTheme:i.options?.page?.colorPalette,onClick:a})})]})},tm=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...a})=>{switch(e?.view){case"grid":return c("div",{children:[nm(n,t),em({...e,...a,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[nm(n,t),Yd({...a,blocksToRender:t})]});default:return null}})),nm=(e,t)=>e&&!t.length?o(bd,{...e}):null,am=e=>t=>t.reduce(((t,n,a)=>t.length?t.concat({...e,key:`sep-${a}`},n):[n]),[]),im=d((({value:e,onChange:t,items:n=[],multiple:a})=>n.map((n=>o(eo,{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))))),lm=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,am(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(rm(a)).filter(Boolean))]}),n?o("div",{children:o(sr,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:i,children:n?.text})}):null]}))),rm=e=>([t,n])=>{const a=n?.type;return"array"===a?sm(t,e)(n):null},sm=(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(im,{items:a,multiple:!n?.single,...t(e)})]},e)};function om(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const cm=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,dm=(e,t)=>Object.entries(e).map((([n,a])=>"number"==typeof a?Array.isArray(t[n])?((e,t)=>n=>cm(t[e])||cm(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>cm(t[e])||cm(n[e])||mm(t[e])<=mm(n[e]))(n,e):"object"==typeof a&&"min"in a&&"max"in a?((e,t)=>n=>cm(t[e])||cm(n[e])||mm(t[e]?.min)>=mm(n[e]?.min)&&mm(t[e]?.min)<=mm(n[e]?.max))(n,e):Array.isArray(a)?((e,t)=>n=>cm(t[e])||cm(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>cm(t[e])||cm(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),mm=e=>Number(e||0),um=(e,{block:t,page:n,normalize:a=nn})=>{const i=t?.blocks||[],[l,{field:s,reset:o,update:c}]=an(e),d=r((()=>om(i,i.map((e=>Mt(e.content,n?.fallback))))),[i,n?.fallback]),m=l===e?i:((e,t)=>(n=nn)=>e?.filter((([,e])=>dm(t,n(e)||{}))).map((([e])=>e)))(d,l)(a);return[l,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},hm={},pm={},gm=Ft((({className:e,filtrationSchema:t=hm,consumerField:n={},resetButton:a,...i})=>{const[,{blocksToRender:l},{field:r,reset:s}]=um(pm,{block:i.block,page:i.options?.page}),d=o(Dn,{className:"w-64",label:n?.title,options:fm(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>fm(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...i,children:[o(lm,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(sr,{type:"reset",className:"mt-lg w-64",onClick:s,version:a?.version,children:a?.text})})]})}),o(tm,{blocksToRender:l,...i})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),fm=e=>om(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),xm=(e=!1)=>e?"text-left":"text-center",ym={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},bm=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",ym[n],e),children:o(W,{...l,width:"54%",height:"54%",name:i})}):null})),vm=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:xm(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(Nm)}):null]})})),Nm=({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(bm,{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(Ee,{__html:n,isDotted:i,itemSize:"list-s"}):null]}):null]},String(r)),wm=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)),Cm=(e,t,n)=>o("div",{className:`grid gap-2xs ${Sm(t)}`,children:e.map(wm(n))}),Sm=e=>{switch(e){case"3":return"grid-cols-3";case"4":return"grid-cols-4";default:return"grid-cols-5"}},km=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?Cm(e,a,t):null]}))),Im={start:"justify-start",center:"justify-center",end:"justify-end"},Tm=d((({buttons:e,className:t="",align:n,...a})=>{const i=n&&u("flex",Im[n]);return o(g,{className:u("!bg-transparent",i,t),defaultPadding:"p-0",...a,children:qe(e)})})),Bm=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]})]}))),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:"Процентная ставка не найдена, выберите другие параметры"})})]}))),Pm=({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(Bm,{title:e,rate:t,unit:n,fractionDigits:a,color:i,...r})}),o(vr,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:a,fixed:!0,color:i,...r}),l]}):o(Rm,{title:e,...r}),Dm={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Em={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Am=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:a}=e,[i,l]=((e,t,n)=>{const{maxBonus:a=5e3,prefMonthsNum:i=Dm.prefMonthsNum,prefTravelBonusRate:l=Dm.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||Em,n,a);return{...t,...e,monthBonus:i,yearBonus:l}},_m=Ft((({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}=Am(r,n);return o(gr,{className:e,title:t,...l,children:c("section",{className:u(fr,e),children:[c("div",{className:xr,children:[Er({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),Er({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?Pm({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:yr,children:[f>=0?o(vr,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,qe(a,{isVertical:!0}),kr(i)]})]})})})),Mm=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,Om=e=>Pr({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),zm=" (c капитализацией)",Fm=({income:e,finalSum:t,postfix:n="₽",buttons:a=[],footnotes:i=[],isCapitalization:l=!1})=>c("div",{className:yr,children:[o(vr,{title:`Доход в конце срока${l?zm:""}`,value:e,postfix:n,prefix:"+"}),o(vr,{title:`Сумма в конце срока${l?zm:""}`,value:t,postfix:n}),qe(a,{isVertical:!0}),i?.map(kr)]}),Vm={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const Lm={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},$m=(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?Vm[e?.rateType]:"",{data:n}=ga(t?`${Ut}/depositrates/${t}`:null,Dt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&qm(s,e)&&qr(a,["minSum","maxSum"],e)&&qr(n,["minDays","maxDays"],e)))||Lm,{rate:m}=d,u=jm(m,e),h=a+u,p=c||[Lm];return{...d,...$r(["minSum","maxSum"],p),...$r(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},qm=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,jm=(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)},Um=Ft((({className:e="",title:t,buttons:n,footnote:a,bottomFootnote:i,isShowDepositeName:l,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=an({moneyValue:Cr(r,1e5),daysValue:Sr(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=$m(m,s),{income:g,finalSum:f,rate:x,depositeName:y}=p;return o(gr,{className:e,title:t,...d,children:c("section",{className:u(fr,e),children:[c("div",{className:xr,children:[Er({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(el,{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:[Wm(p,h),Om({title:"Выплата процентов",orientation:"vertical",...h("isMonthlyInterestPayment"),className:"sm:flex-col"})]})]}),Pm({rate:x,depositeName:y,isShowDepositeName:l}),Fm({income:g,finalSum:f,buttons:n,footnotes:[a,i]})]})});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(Pa,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(Pa,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),Hm=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},Ym={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},Gm=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,l=t?.[0]?Jm(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=>[Xm({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),Xm({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),Xm({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),Xm({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,qr(a,["minSum","maxSum"],t),qr(i||l,["minMonths","maxMonths"],t)].every(Boolean)))||Ym,{rate:u}=m,h=Km(u,e),p=a+h,g=t||[Ym];return{...m,...$r(["minSum","maxSum"],g),...$r(["minMonths","maxMonths"],g),availableMonths:Hm(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)},Xm=({row:e,userInputParams:t,paramKey:n,isExclude:a})=>a||t[n]===e[n],Jm=(e,t)=>e+Math.round((t-e)/2),Zm=(e="rub")=>"rub"===e,Qm=(e,t)=>{const{minMonths:n,maxMonths:a}=$r(["minMonths","maxMonths"],au(t,e?.currency)),i=e.monthsValue||Math.round((n+a)/2);return{monthsValue:Ki(i,n,a)}},eu=(e,t)=>{const{minSum:n,maxSum:a}=$r(["minSum","maxSum"],au(t,e?.currency)),i=e.moneyValue||n;return{moneyValue:Ki(i,n,a)}},tu=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),nu=e=>{const t=Zm(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},au=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},iu=(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?Pr({title:"Пополнение",...t("isReplenish"),value:e.isReplenish,orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,e.isShowWithdrawn?Pr({title:"Снятие",...t("isWithdrawn"),value:e.isWithdrawn,orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null]}),lu(e.isShowReplenish||e.isShowWithdrawn),c("div",{className:"flex gap-lg",children:[e.isShowMonthlyInterestPayment?Om({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment,orientation:"vertical"}):null,e.isShowRemoteRegistration?(a={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration,orientation:"vertical"},Pr({...a,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]}),lu(e.isShowNewClient),e.isShowNewClient?o(Pa,{text:"Новый вкладчик",...t("isNewClient")}):null]});var a},lu=(e=!1)=>e?o("div",{className:"border-b border-main-divider w-full"}):null,ru={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum"},su={text:"₽",key:"rub"},ou=Ft((({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))??[su],g=l((e=>t=>e?{...t,...nu(t),...eu(t,e),...Qm(t,e),...tu(t,e)}:t)(h),[h]),[f,{field:x}]=an({moneyValue:Cr(d,2e4),monthsValue:Sr(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:su},{normalize:g}),y=x?.("currency")?.value??su,b=x?.("isNewClient")?.value,v=au(h,y),N=Gm(f,v,s),{rate:w,income:C,finalSum:S,type:k=""}=N,I=l((()=>{Ar({field:x,defParams:Nr(v,b),calcParams:N,monthsValue:"minMonths",map:ru})}),[x,h]);i((()=>{!Yr(d)&&v&&I()}),[d,h]);const T=w===Nr(v,b)?.rate;return o(gr,{className:e,title:t,...m,children:c("section",{className:u(fr,e),children:[c("div",{className:xr,children:[c("div",{className:"flex gap-m",children:[Er({className:"w-full",title:`Сумма, ${y?.text}`,min:N.minSum,max:N.maxSum,...x("moneyValue"),value:N.moneyValue,postfix:y?.text,step:cu(y?.key)}),h&&h?.length>1?o(Mn,{label:"Валюта",options:p,...x("currency")}):null]}),Ir({title:"Срок, месяцев",min:N.minMonths,max:N.maxMonths,availableMonths:N.availableMonths,...x("monthsValue"),value:N.monthsValue}),iu({...N,...s},x)]}),Pm({rate:w,children:mu(I,T)}),Fm({income:C,finalSum:S,buttons:[...a,du(n?.buttons,k)],footnotes:[r],postfix:y?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),cu=(e="")=>Zm(e)?1e3:100,du=(e=[],t="")=>{const{type:n,...a}=e.find((e=>e.type===t))??{};return a},mu=(e,t=!1)=>t?null:o(sr,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),uu=e=>hu({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&hu({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),hu=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],pu={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},gu=(e,t,n)=>{const{moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r}=e,s=t?.rateRows||[pu],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>uu({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Lr(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Lr(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r})=>e?.find((e=>uu({row:e,userInputParams:t,paramsViewSettings:n})&&qr(a+r,["minSum","maxSum"],e)&&qr(l,["minSumOld","maxSumOld"],e)&&qr(r,["minSumExtra","maxSumExtra"],e)&&qr(i,["minMonths","maxMonths"],e)))||pu)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r}),{rate:p}=h,g=_r(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}},fu=Ft((({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=gu(s,n,l),h=Dr({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")});return o(gr,{className:e,title:t,...r,children:c("section",{className:u(fr,e),children:[c("div",{className:xr,children:[Er({title:"Остаток долга в других банках, ₽ ",step:500,min:m.minSum,max:m.maxSum-m.maxSumExtra,...d("moneyValue"),value:m.moneyValue}),Er({title:"Ежемесячный платёж в других банках, ₽",step:500,min:m.minSumOld,max:m.maxSumOld,...d("oldMonthlyPayment"),value:m.oldMonthlyPayment}),Ir({title:"Новый срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),xu({...m,...l},d),m.isExtraMoney?Er({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(yr,"@4xl:w-1/2"),children:[o(vr,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(vr,{title:"Ставка",value:m?.rate,fractionDigits:2,postfix:"%"}),o(vr,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),m.benefit>0?o(vr,{title:"Выгода в месяц",value:m.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:h}),qe(a,{isVertical:!0}),kr(i)]})]})})})),xu=(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})]}),yu=d((e=>{const{onChange:t,min:n,max:a,defaultValue:i="0",fractionDigits:r=0,...s}=e,c=Gi(e,{normalize:(e=i)=>n&&a?String(Ki(Number(bu(e)),n,a)):bu(e),format:He(r)}),d=l((e=>t&&t(bu(e))),[t]);return o(fn,{onChange:d,...s,...c})})),bu=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),vu=d((e=>o(yu,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(_e,{size:"text-xl",font:"font-light",children:"₽"})})}))),Nu={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},wu={amount:1500},Cu=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:l,formType:r="private",...s})=>{const[{amount:d},{field:m}]=an(wu),[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:Nu[r],children:[o(vu,{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(sr,{className:"w-full mt-lg",type:"submit",disabled:h,children:l.text}):null]})]})})),Su=({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})]}),ku="relative h-full",Iu={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},Tu=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...a})=>{const{blocks:i}=a.block||{},l=i?.some(Pu),r=n?{defaultPadding:"p-6xl pb-m"}:{};return P({...a,renderProps:(n,a,i)=>c("div",{className:Bu(n,{someCardsHighlighted:l}),children:[T(n,a,{className:Ru(n,{someCardsHighlighted:l,showBorder:!e,cardSize:t}),...r,blockIndex:i}),Pu(n)?Su({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},Bu=(e,{someCardsHighlighted:t})=>u(ku,t&&(Pu(e)?"pt-3xl":"pt-3xl sm:pt-16")),Ru=(e,{someCardsHighlighted:t,showBorder:n,cardSize:a="normal"})=>u(ku,"min-w-80",Iu[a],t&&(Pu(e)?"pt-3xl sm:pt-16":"pt-3xl"),vd(n),n&&"h-full"),Pu=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,Du=Ft((({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(Hd,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:i?16:0,padding:0,arrowsPadded:a,navButtons:r?Eu(s?.block?.blocks):[],hasBlur:!0,children:Tu({noCardBorder:n,cardSize:l,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),Eu=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],Au="z-10 border border-solid w-full h-full",_u=u(Au,"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(_u,"top-9 right-12 bg-green-dark")}),o("div",{className:u(_u,"top-6 right-8 bg-green")}),o("div",{className:u(_u,"top-3 right-4 bg-green-light")}),c("div",{className:u(Au,"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})]})]})}))),Ou={black:"bg-black",white:"bg-white"},zu=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(Fu)]}):null,i?c(_e,{size:"text-h3",align:"text-left",children:[i," ₽"]}):null]})}))),Fu=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${Ou[e]}`},String(t)),Vu=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})),Lu=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?$u(a):null]})}))),$u=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(Vu,{...e},String(t))))}),qu=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"mindboxEvent"===e?{...n,eventJson:t}:n}))),ju=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})})),Uu=[{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: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=>Uu.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},Hu(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:Yu(s??!1,i??!1,n),buttonClassName:h})}),r?o(_e,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),Hu=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",Yu=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),Gu=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(ju,{href:i,target:m,className:"h-full",data:qu(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(Ee,{__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,Xu=(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))},Ju=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(Xu),[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(ri,{renderFoldableSection:()=>c("div",{children:[x,o(si,{isUnfolded:b,children:y})]}),renderFoldButton:d.length>=s?Zu(m?.parent,h,b):null}):o("div",{children:x})]})})),Zu=(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"})]}),Qu=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?eh(n):null,t?.length?eh(t):null]}))),eh=e=>o("div",{className:"flex gap-5xl grow basis-0",children:e.map(((e,t)=>th({column:e,i:t})))}),th=({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,nh=()=>{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 ai("/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)},ah=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]})]}))),ih=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(ah,{step:a,showPercentage:!1})]})})}));var lh;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.rework="REVISION"}(lh||(lh={}));const rh=e=>ni("/user-data/getTaskStatus","POST",e),sh=e=>ai("/user-data/sendSignalToProcess","POST",e),oh=(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},ch=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(Ee,{__html:e}),a?.text?o(Ne,{className:"text-primary-main",children:a.text}):null]})]}))),dh=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(Ec,{interval:e,time:l,setTime:e=>{0===e&&t(),r(e)}})})]}),i?o(Ee,{__html:i}):null]})]})})),mh=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(dh,{interval:d,intervalExpireAction:m}):null]}),o(uh,{title:a,items:i}),o(uh,{title:l,items:r,countColumns:!0}),n?.__html?o(ch,{__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]}))),uh=({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",nc(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:hh(e)},t)))}):null]})]}):null},hh=({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})]}),ph=d((()=>o(mh,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),gh=d((({handleExpireTimer:e})=>{const[t]=Gl("leadForm");return o(mh,{interval:300,intervalExpireAction:e,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:t?.cardCategory?.text}]})})),fh=d((()=>{const[e]=Gl("leadForm");return o(mh,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),xh=d((()=>{const[e]=Gl("leadForm");return o(mh,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),yh=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],bh=d((()=>{const[e,t]=a(lh.process),[n]=Gl("taskId");i((()=>{(async()=>{for(const e of yh)await sh({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const a=await rh({taskId:n});a&&a?.statusCd!==lh.process&&(e(),t(a.statusCd))}),[n]);oh(r,3e4);return vh(e,(()=>t(lh.rework)))})),vh=(e,t)=>({IN_PROCESS:o(gh,{handleExpireTimer:t}),CANCELLED:o(ph,{}),APPROVED:o(xh,{}),REVISION:o(fh,{})}[e]||o(fh,{})),Nh=[{paymentSystem:{name:"",type:""},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}],wh=e=>{if(e)try{return new Date(e)}catch(e){return}},Ch=e=>(t,n)=>t.filter((e=>e)).map((t=>[Sh(n,e),kh(t,e),Rh(t,e),Ih(t,e),Th(t,e),Bh(t,e)].some(Boolean)?{...t,required:!1}:t)),Sh=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,kh=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Ih=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Th=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Bh=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),Rh=({name:e},t)=>"snils"===e&&Ph(t),Ph=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,Dh=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(ch,{__html:e},`${t}_${n}`))):null},Eh=({field:e,inputs:t,params:n})=>t.map(tc(e,n)),Ah=({sections:e,field:t,step:n,params:a})=>e?.map((({inputs:e=[],columns:i,title:l},r)=>{const s=Ch(_h(t))(e,n),o=s.filter((e=>!Bh(e,_h(t))));return c("div",{className:u(nc(i),"grid gap-x-m"),children:[Dh(o),ac(l),Eh({field:t,inputs:s,params:a})]},`section-${r}`)})),_h=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(sr,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(sr,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),Oh=e=>{const{currency:t,paymentSystem:n,cardCategory:a,codeWord:i}=e;return{currencyCode:t?{key:t}:void 0,paymentSystemTypeCd:n,classCard:a,codeWord:i}},zh=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},Fh=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{office:{id:t.key}}:{}},Vh=(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:sd({phone:jt(l),email:r}),participantAddresses:od({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:sd({organizationPhone:p&&jt(p)}),participantAddresses:od({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:cd({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);case 5:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:od({addressCourier:t})}:{}})(t)}},Lh=({step:e,inputs:t,onNextStep:n,saveStep:a,finishForm:i})=>{const r=5===e,[s]=Gl("taskId"),[o]=Gl("profileId"),[c]=Gl("participantId"),d=l((async l=>{const d=lc(aa(Ch(qh(l))(t,e)));if(!On(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,...Fh(a),authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Vh(i,a)}],...Oh(a),...zh(a)}}))({participantId:c,taskId:s,profileId:o,step:e,formData:l}));$h(r,t)}}catch(e){return"Fail"}return n(),r&&i?.(!0),"OK"}),[]);return{handleSubmit:d}},$h=(e,t)=>{e&&t.ok&&globalThis.localStorage.removeItem("leadForm")},qh=e=>t=>e[t],jh=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,isFormFinished:i,finishForm:l})=>{const[r,s]=Gl("leadForm"),d=((e,t)=>({...Nh[e],...t,limitedBirthday:wh(t?.limitedBirthday),dulIssueDateField:wh(t?.dulIssueDateField),participantDateRegistration:wh(t?.participantDateRegistration),beginDate:wh(t?.beginDate),deliveryDate:wh(t?.deliveryDate)}))(e,r),m=t?.flatMap((e=>e?.inputs))||[],{handleSubmit:u}=Lh({step:e,inputs:m,onNextStep:a,saveStep:s,finishForm:l}),[,{field:h,onSubmit:p}]=an(d,{onSubmit:u});return i?o(bh,{}):c("form",{onSubmit:p,className:"space-y-m",children:[Ah({sections:t,field:h,step:e}),o(Mh,{step:e,onPrevStep:n})]})})),Uh=[[{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=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],Hh=d((({className:e,...t})=>{const[n,d]=a(0),m=s(null),u=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);i(nh,[]);const h=l((()=>{d((e=>Math.min(e+1,6))),u()}),[]),p=l((()=>{d((e=>Math.max(e-1,0))),u()}),[]),f=r((()=>Uh[n]),[n]),[x,y]=a(!1);return o(g,{className:e,...t,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[x?null:o(ih,{stepsTitles:Wh,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(jh,{step:n,sections:f,onNextStep:h,onPrevStep:p,isFormFinished:x,finishForm:y},String(n))})]})})})),Yh=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(ah,{step:a,showPercentage:!1})]})})})),Gh=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(dh,{interval:d,intervalExpireAction:m}):null]}),o(Kh,{title:a,items:i}),o(Kh,{title:l,items:r,countColumns:!0}),n?.__html?o(ch,{__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",nc(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:Xh(e)},t)))}):null]})]}):null},Xh=({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})]}),Jh=d((()=>o(Gh,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Zh=d((({handleExpireTimer:e})=>{const[t]=Gl("leadForm");return o(Gh,{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?"Аннуитетный":"Дифференцированный"}]})})),Qh=d((()=>{const[e]=Gl("leadForm");return o(Gh,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),ep=d((()=>{const[e]=Gl("leadForm");return o(Gh,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),tp=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],np=d((()=>{const[e,t]=a(lh.process),[n]=Gl("taskId");i((()=>{(async()=>{for(const e of tp)await sh({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const a=await rh({taskId:n});a&&a?.statusCd!==lh.process&&(e(),t(a.statusCd))}),[n]);oh(r,3e4);return ap(e,(()=>t(lh.rework)))})),ap=(e,t)=>({IN_PROCESS:o(Zh,{handleExpireTimer:t}),CANCELLED:o(Jh,{}),APPROVED:o(ep,{}),REVISION:o(Qh,{})}[e]||o(Qh,{})),ip=[{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}],lp=e=>{if(e)try{return new Date(e)}catch(e){return}},rp=e=>(t,n)=>t.filter((e=>e)).map((t=>[sp(n,e),op(t,e),up(t,e),cp(t,e),dp(t,e),mp(t,e)].some(Boolean)?{...t,required:!1}:t)),sp=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,op=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,cp=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,dp=({name:e},t)=>"addressFact"===e&&t("addressMatch"),mp=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),up=({name:e},t)=>"snils"===e&&hp(t),hp=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,pp=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(ch,{__html:e},`${t}_${n}`))):null},gp=({field:e,inputs:t,params:n})=>t.map(tc(e,n)),fp=({sections:e,field:t,step:n,params:a})=>e?.map((({inputs:e=[],columns:i,title:l},r)=>{const s=rp(xp(t))(e,n);return c("div",{className:u(nc(i),"grid gap-x-m"),children:[pp(s),ac(l),gp({field:t,inputs:s,params:a})]},`section-${r}`)})),xp=e=>t=>e(t)?.value,yp=d((({step:e,onPrevStep:t})=>{const n=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(sr,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(sr,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),bp={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},vp=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:a}=e?.calculator??{};return{loanAmount:t,creditPeriod:n,paymentTypeCd:bp[a?"annuity":"differential"]}},Np=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},wp=(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:sd({phone:jt(l),email:r}),participantAddresses:od({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:sd({organizationPhone:p&&jt(p)}),participantAddresses:od({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:cd({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{}}},Cp=({step:e,inputs:t,onNextStep:n,saveStep:a,finishForm:i})=>{const r=5===e,[s]=Gl("taskId"),[o]=Gl("profileId"),[c]=Gl("participantId"),d=l((async l=>{const d=lc(aa(rp(kp(l))(t,e)));if(!On(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:"Заемщик"},...wp(i,a)}],...vp(a),...Np(a),esiaAccountTypeCd:{key:a?.esiaAccountTypeCd?.key}}}))({participantId:c,taskId:s,profileId:o,step:e,formData:l}));Sp(r,t)}}catch(e){return"Fail"}return n(),r&&i?.(!0),"OK"}),[]);return{handleSubmit:d}},Sp=(e,t)=>{e&&t.ok&&globalThis.localStorage.removeItem("leadForm")},kp=e=>t=>e[t],Ip=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,isFormFinished:i,finishForm:l,programsSource:r})=>{const[s,d]=Gl("leadForm"),[m]=Gl("programId"),u=r?.[m??""],h=((e,t)=>({...ip[e],...t,limitedBirthday:lp(t?.limitedBirthday),dulIssueDateField:lp(t?.dulIssueDateField),participantDateRegistration:lp(t?.participantDateRegistration),beginDate:lp(t?.beginDate),deliveryDate:lp(t?.deliveryDate)}))(e,s),p=t?.flatMap((e=>e?.inputs))||[],{handleSubmit:g}=Cp({step:e,inputs:p,onNextStep:a,saveStep:d,finishForm:l}),[,{field:f,onSubmit:x}]=an(h,{onSubmit:g});return i?o(np,{}):c("form",{onSubmit:x,className:"space-y-m",children:[fp({sections:t,field:f,step:e,params:{calcData:u}}),o(yp,{step:e,onPrevStep:n})]})})),Tp=[[{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"}]}]],Bp=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Отделение Банка"],Rp=Ft((({className:e,programsSource:t,...n})=>{const[d,m]=a(0),u=s(null),h=l((()=>u?.current?.scrollIntoView({behavior:"smooth"})),[u]);i(nh,[]);const p=l((()=>{m((e=>Math.min(e+1,5))),h()}),[]),f=l((()=>{m((e=>Math.max(e-1,0))),h()}),[]),x=r((()=>Tp[d]),[d]),y=0===d,[b,v]=a(!1);return o(g,{className:e,...n,children:c("div",{ref:u,className:"container grid grid-cols-12",children:[y||b?null:o(Yh,{stepsTitles:Bp,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))})]})})})),Pp=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,Dp=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),Ep=1e9,Ap={sum:{min:1e4,max:Ep},period:3},_p=Ft((({className:e,filtrationSchema:t={},resetButton:n,sumInput:a,periodInput:i,...l})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=um(Ap,{block:l.block,page:l.options?.page,normalize:e=>({...e,period:Mp(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=Op(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...l,children:[o(lm,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(vu,{label:a?.title,min:500,max:Ep,...d("sum",{parse:e=>({min:Number(e),max:Ep}),format:({min:e})=>String(e)})}),o(el,{title:i?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(tm,{blocksToRender:r,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),Mp=e=>Et((e?.paramsSource?.rateRows||[]).filter(Pp).flatMap((e=>Dp(e.minMonths,e.maxMonths)))),Op=e=>Et(e.flatMap((e=>e||[])).filter(Pp).flatMap((e=>Dp(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],zp=[{key:"10"},{key:"50"},{key:"100"}],Fp=({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:zp,iconVersion:"black"})]})},Vp="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",Lp=(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:Vp,"aria-label":`Страница ${l}`,children:l},String(t)):null},$p={width:"24",height:"24"},qp=({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:jp(1===e),...$p})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:Vp,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,a.map(Lp),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:Vp,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(W,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:jp(e===n),...$p})})]})},jp=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",Up=({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(qp,{currentPage:e,onPageChange:t,totalPages:n}),a&&i?o(Fp,{itemCount:a,onItemCountChange:i}):null]}),Wp=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})]})})),Hp=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(ql,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(ql,{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(sr,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),Yp=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)})),Gp=`${Ut}/depository`,Kp={startDate:void 0,endDate:void 0,query:""},Xp=Ft((({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(Gp);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(Gp+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(Hp,{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(Yp,{...e},String(e.publicId)))):o(bd,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(Up,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:y})]})]})})),Jp=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,Zp=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:Jp(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]}))),Qp=`${Ut}/region`;function eg(e="Москва"){return ml().location??{name:e}}function tg(e="Москва"){const t=ml(),n=l((async()=>{if(!t.location){const n=await Pt(Qp);t.location=n??{name:e}}}),[t,e]);return ga(Qp,n),t}var ng;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(ng||(ng={}));const ag=new Intl.NumberFormat("ru",{style:"currency",currency:ng.RUB}),ig=e=>e?ag.format(e):"",lg="text-m font-light text-secondary-text ",rg=`${lg} text-left`,sg=`${lg} pl-5xl text-center`,og=`${lg} pl-5xl text-right`,cg={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},dg=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:rg,children:o(_e,{size:"text-m",children:"Валюта"})}),o("th",{className:sg,children:o(_e,{size:"text-m",children:"Купить"})}),o("th",{className:og,children:o(_e,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(mg)})]}))),mg=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:cg[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:ig(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(_e,{size:"text-h6",children:ig(e?.buyExchangeRate)})})]},t)},ug={icon:"GpsIcon"},hg=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(bm,{...ug,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:"Курс указан для заданного офиса"})]})]}))),pg=(e,t,n)=>{const a=Number(gg(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)},gg=e=>e.replace(/[^\d.,]/g,"").replace(",",".");function fg(e){if(!e)throw new Error("Value should be fulfilled");return e}const xg=e=>t=>{const[,n]=fg(e.find((([e])=>e(t))));return n(t)},yg=e=>xg(e.map((([e,t])=>[e,()=>t])));yg.if=e=>new bg(void 0,e);class bg{parent;predicate;unit;get entry(){return[fg(this.predicate),fg(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new bg(this,e)}then(e){return new bg(this.parent,this.predicate,e)}else(e){return xg([...vg(this),[()=>!0,e]])}}const vg=e=>[...e?.parent?vg(e.parent):[],e.entry],Ng=e=>yg([[e=>e.value!==ng.RUB&&e.oppositeValue!==ng.RUB,()=>e.handleConvert(e.value,ng.RUB)],[e=>e.value===ng.RUB&&e.oppositeValue===ng.RUB,()=>e.handleConvert(e.value,ng.USD)],[e=>e.value===ng.RUB&&e.oppositeValue===ng.RUB,()=>e.handleConvert(e.value,ng.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function wg(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(fn,{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 Cg=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:i})=>{const[r,s]=a({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||ng.RUB,selectBuy:n?.[0]?.currency?.currency||ng.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:[wg({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:Sg(r,d,n),value:r.inputSell,setValue:e=>Ig(d,n)(e,r.selectSell,r.selectBuy)}),wg({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:kg(r,d,t),value:r.inputBuy,setValue:e=>Tg(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}),Ng({value:a,oppositeValue:e.selectBuy,handleConvert:(a=e.selectSell,i=e.selectBuy)=>{Ig(t,n)(e.inputSell,a,i)}})},kg=(e,t,n)=>a=>{t({selectBuy:a}),Ng({value:a,oppositeValue:e.selectSell,handleConvert:(a=e.selectBuy,i=e.selectSell)=>Tg(t,n)(e.inputBuy,a,i)})},Ig=(e,t)=>(n,a,i)=>{e({inputSell:gg(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(pg(n,l,a===ng.RUB)||"")})},Tg=(e,t)=>(n,a,i)=>{e({inputBuy:gg(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(pg(n,l,a===ng.RUB)||"")})},Bg=`${Ut}/exchangerates`;const Rg=d((({className:e="",title:t="Курсы обмена валют",button:n,...a})=>{const i=function(e){const t=e?.code||"000",{data:n}=ga(Bg+`?regionCode=${t}`,Dt);return n||{}}(eg()),l=Pg(i?.exchangeRate?.currencies),r=l.filter((e=>e.buyExchangeRate));r.unshift({currency:{currency:ng.RUB}});const s=l.filter((e=>e.saleExchangeRate));return s.push({currency:{currency:ng.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(dg,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(hg,{address:i?.address})]}),o(Cg,{className:"grow w-1/2",currencyRatesBuy:r,currencyRatesSell:s,button:n})]})})})})),Pg=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],Dg=d((({className:e="",items:t})=>{const n=pe();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(Eg(n))})})),Eg=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},Ag=e=>t=>!t.displayArea||e.includes(t.displayArea.toLowerCase()),_g=["all","footer"],Mg=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(Ag(_g)).map(n).map(Og)})})),Og=(e,t)=>{const{text:n,items:a=[],href:i,target:l="_self",onClick:r,dataFooter:s}=e,d=a.filter(Ag(_g));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(Dg,{items:d}):null]},String(t))},zg=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(Fg)}):null)),Fg=(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(Vg)})]},String(t)),Vg=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Lg(e.type,e.text)}),o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Lg=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${$g(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})}},$g=e=>e.replaceAll(/\D/g,""),qg=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}`})})),jg=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(qg,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),Ug="w-full lg:w-52";function Wg(e,t,n=300){i((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}const Hg=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 Yg=(e,t)=>(n,a)=>{for(const[i,l]of a)n.set(i,e(n.get(i)||t,l));return n},Gg=(e=[])=>e.reduce(((e,t)=>e+t),0),Kg=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),Xg=e=>t=>e.map((([e,n])=>[Hg(t)(e),n])).filter((([e])=>e>=.8)).map((([e,t])=>Zg(t,e))).reduce(Yg(Math.max,0),new Map),Jg=e=>t=>{return om(t,t.map((({title:e})=>e)).map((e=>t=>{const n=Kg(t||"");return n.length?Gg(e.map((e=>zr(n.map(Hg(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]))),Qg=({basePathList:e,initialQuery:t=""})=>{const[n,l]=a(t||"");i((()=>{null!=t&&l(t)}),[t]);const{data:r}=ga(e?.length?e:null,ef),[s,o]=a(null);return Wg((()=>{r&&o(r.map((e=>t=>{const{corpus:n,dictionary:a}=t||{};if(!(e&&n?.length&&a&&Object.keys(a).length))return[];const i=Kg(e);if(!i.length)return[];const l=Object.entries(a),r=[...i.map(Xg(l)).reduce(Yg(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*i.length)).map((([e])=>n[e]));return Jg(i)(r)})(n)))}),[r,n]),[s,{value:n,onChange:l}]},ef=async(...e)=>(await Promise.allSettled(e.map((e=>Pt(F(e,"/","search.index.json")))))).map((e=>"fulfilled"===e.status?e.value:{})),tf=d((({initialQuery:e,navigationItems:t,onClose:n})=>{const a=r((()=>t?.map((e=>e.href||"/"))),[t]),[i,l]=Qg({basePathList:a,initialQuery:e}),s=r((()=>nf(t)(i)),[t,i]);return o(cr,{head:o(Wp,{autoFocus:!0,...l}),onClose:n,children:o(Mg,{navigationItems:s})})})),nf=e=>t=>e?.length&&t?.length?om(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:F("/",t)})))}))):[],af=d((({className:e,search:t,...n})=>{const[i,r]=a(""),s=l((()=>r("")),[]),d=sn(tf,n),m=l((e=>{r(e),lf(e)&&d.open({initialQuery:e,onClose:s})}),[s,d]);return c("div",{className:u("relative",e),role:"search",children:[o(Wp,{value:i,placeholder:t?.placeholder,onChange:m}),o(or,{className:"absolute top-0 right-0 sm:hidden",onClose:s})]})})),lf=e=>e&&e.length>=3,rf=(e,t)=>{const{logo:n}=e??{},{dataHeader:a,dataFooter:i,...l}=n??{};return c("div",{className:"flex items-stretch gap-3xl",children:[o(Pc,{className:Ug,logo:l,data:i,showTitle:!1}),o(af,{className:"grow",navigationItems:t,...e})]})},sf=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}`})})),of=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(sf,{index:t,...e},String(t))))}):null]}))),cf=Ft((({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:[rf(i,a),c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(Mg,{navigationItems:a}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u(Ug,"flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(zg,{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(jg,{title:m,links:r}),o(of,{links:l,license:p})]})})),df=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?mf(a):null]}))),mf=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=>uf(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:hf(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}`)))})]})},uf=(e,t)=>e.month?.map(((e,n)=>o("div",{style:{flexBasis:`${t}%`},children:e.text},`monthName-${n}`))),hf=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)),pf=Ft((({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 space-y-m",children:[t?o(N,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(Mn,{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:qu(l,s?.key),children:f})}):null]})})}));function gf(e=[]){const t=D(),n=Array.from(e.entries()).filter((([,e])=>ff(t)(e)));return n.find((([,e])=>ff(t,!0)(e)))??n[n.length-1]??[]}const ff=(e,t=!1)=>({href:n})=>{if(!n)return!1;const a=z(xf(e)(n));return t?a===z(n):a.startsWith(z(n))},xf=e=>t=>{const n=X(K.SITE_URL);return _(t)?e.href:F(n,e.pathname)},yf=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:vf(t,n)})]})})),bf=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})})),vf=(e,t)=>e?.map(((e,n)=>o(bf,{isActive:e===t,...e},e?.text??String(n)))),Nf={default:"w-6 h-6",large:"w-12 h-12"},wf=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":`${Nf[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"})}))),Cf="chatbot",Sf="text-page__btn-chat",kf={personal:"//chat.mes.rshb.ru/assets/js/webchat_rshb",business:""},If=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=kf[e??""];return n=>{if(t)if("personal"!==e)Ya(Cf,t);else{const e=n.target;e?.classList.contains(Sf)||e?.classList.add(Sf),document.getElementById("webchat-js-container:webchat_rshb")||Ya(Cf,t)}}})(e);return o(wf,{className:n,image:{icon:"HeadphonesIcon",iconVersion:t},ariaLabel:a,onClick:r,buttonSize:"large",isGrayBg:!0,version:l})})),Tf=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:Bf(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]})})),Bf=(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"),Rf=d((({observerOptions:e,onVisibilityChange:t,children:n,className:a,...i})=>{const r=Cd(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(Tf,{...i,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"},Df=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",Pf["transparent"===e?"transparent":"default"]),...a,children:i}):null})),Ef=d((({subItems:e=[],version:t,internetBankButton:n,dropdownMenuAriaLabel:i,chatBotAriaLabel:l})=>{const d="transparent"===t?"white":"black",[,m]=gf(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?Af(t):_f(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(Rf,{className:u-1<t?"invisible":"",active:e===m,observerOptions:f,onVisibilityChange:x[t],data:e.dataHeader,...e},String(t))))}),p.length?o(yf,{items:p,activeItem:m,ariaLabel:i}):null,A.CHAT_BOT?o(If,{version:t,iconVersion:d,chat:A.CHAT_BOT,ariaLabel:l}):null,o(Df,{version:t,...n})]})})),Af=e=>t=>Math.max(t,e+1),_f=e=>t=>Math.min(t,e),Mf=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(Of,{...e},String(t))))})]}):null,Of=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]})})),zf=(e,t)=>n=>n.name?o(ju,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:qu(e,n.name),children:o(_e,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,Ff=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"})]}))),Vf=d((({defaultLocation:e})=>{const t=eg(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(ju,{href:a,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),Lf=d((({foreignOffices:e,branches:t,onClose:n})=>{const i=tg(t?.default),[s,d]=a(""),m=Ro(),u=r((()=>qf(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,$f)),[u]),p=l((e=>{i.location=e,n?.()}),[i,n]);return c(cr,{className:"pb-20",head:c("div",{children:[o(_e,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(Vf,{defaultLocation:t?.default}),o(Ff,{onSearch:d,searchTerm:s})]}),onClose:n,children:[s&&s.length>=3?o("div",{children:u.filter((({name:e})=>e&&Hg(e.toLowerCase())(s.toLowerCase())>=.8)).map(zf(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(zf(f,g))]},e)))}),Mf(e)]});var g,f})),$f=e=>e.name?.charAt(0)??"",qf=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),jf=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(Uf(t,n),e),href:s,target:c,onClick:m,rel:"noopener noreferrer","aria-label":`Ссылка на ${d}`,...fe(i),children:o("span",{suppressHydrationWarning:!0,className:Wf(t,n),children:d||a})})})),Uf=(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}),Wf=(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"),Hf=d((({className:e,version:t,...n})=>{const a="transparent"===t?"white":"black",i=eg(n?.branches?.default),r=sn(tf,n),s=sn(Lf,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(jf,{className:"whitespace-nowrap text-ellipsis overflow-hidden",flat:!0,href:"#",text:i?.name,data:qu(n?.branches?.dataClick,i?.name??""),onClick:m}):null,n?.officesAtms?.href?o(jf,{className:"whitespace-nowrap",flat:!0,...n.officesAtms}):null,o(wf,{image:{icon:"LoupeIcon",iconVersion:a},ariaLabel:n?.search?.ariaLabel??"Поиск",onClick:d,data:n?.search?.data})]})})),Yf=d((({observerOptions:e,onVisibilityChange:t,children:n,className:a,...i})=>{const r=Cd(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(jf,{...i,children:n})})})),Gf=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?Kf(t):Xf(t))}))),[e]),{dataFooter:b,dataHeader:v,...N}=u??{};return c("div",{className:"flex items-center justify-between",children:[o(Pc,{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(Yf,{className:h-1<n?"invisible":"",active:e===t,observerOptions:x,onVisibilityChange:y[n],data:e.dataHeader,...e},String(n))))}),g.length?o(yf,{className:"mx-xs",items:g,activeItem:t,ariaLabel:n}):null,o(Hf,{version:i,className:"ml-auto",search:d,navigationItems:e,...l})]})})),Kf=e=>t=>Math.max(t,e+1),Xf=e=>t=>Math.min(t,e),Jf={"bg-white":"primary",transparent:"transparent"},Zf=["all","header"],Qf=Ft((({className:e,bgColor:t="bg-white",logo:n={},version:a=Jf[t],portal:i,header:l={},...r})=>{const{common:s,navigation:d}=tx(r?.options?.page),{navigationItems:m}=d,{logo:h={}}=s,[,p]=gf(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(Gf,{activeTopItem:p,navigationItems:m?.filter(Ag(Zf)),version:a,headerData:{...l,...d},search:s.search,bgColor:t,logo:x})}),o("div",{className:u("mt-s h-px bg-main-divider",ex(a))}),p?.items?.length&&o(Ef,{subItems:p?.items?.filter(Ag(Zf)),version:a,internetBankButton:f})]})})})),ex=e=>"transparent"===e?"opacity-30":"",tx=e=>({navigation:e?.navigation??{},common:e?.common??{}}),nx=(e=!1)=>e?{}:{padding:"p-0"},ax={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},ix=Ft((({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",ax[n],e),padding:t,version:i,isTheme:l,...s,children:P({...s,extraProps:{...nx(a),className:vd(r)}})})),{childrenTypes:{exclude:["HorizontalLayout"]}}),lx=d((e=>{const{className:t,align:n,image:a,...i}=e,l=n?u("flex",Im[n]):"";return o(g,{className:u(l,t),defaultPadding:"p-0",...i,children:o(ne,{image:a})})})),rx=(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 sx({dec:e,inc:t,canDec:n,canInc:a,btnClass:i,className:l=""}){return n||a?c("div",{children:[n?o(Vd,{className:u("absolute z-40",i[0],l),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!n}):null,a?o(Vd,{className:u("absolute z-40 rotate-180",i[1],l),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!a}):null]}):null}const ox=d((({className:e="",cards:t=[],button:n})=>{const[i,r]=a(0),s=l((e=>r(e)),[]),d=t.length,[m,u]=rx({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?cx({activeIndex:m,cards:t,selectedCardIndex:i,onClick:s}):null,sx({...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 cx({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?dx("страховая сумма",e.sum):null,e?.fee?dx("страховой взнос",e.fee):null]}),mx(n)]},String(t))}({slide:e,i:t,isActive:Boolean(t===n),onClick:()=>a(t)})))})})}function dx(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 mx(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 ux=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:hx({insuranceTabs:n,button:i})})]})})),hx=({insuranceTabs:e,button:t})=>{const n=e?.map((e=>e.cards));return n?.length?n.map(((e,n)=>o(ox,{button:t,cards:e},String(n)))):null};const px={yellow:"bg-yellow",green:"bg-green","green-light":"bg-green-light","green-dark":"bg-green-dark"},gx={XS:"h-10",S:"h-16",M:"h-24",L:"h-32",XL:"h-52"},fx=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:[am(o("div",{className:"w-px h-4 bg-gray"}))(s.map(xx)),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(vx)})]}):null,n?o("div",{className:"max-w-2xl font-light text-base",children:o(Ee,{__html:n,isDotted:a,itemSize:"list-s"})}):null]})})})),xx=(e,t,n)=>{const a=1===t,i=t===n.length-1,l=e.cells?.reverse()||[];return o("div",{className:`${yx(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(bx)}):null},`column_${t}`)},yx=(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(" "),bx=(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 ${gx[n]} ${px[a]} ${"XS"===n?"px-s":"px-5xl"}`,children:o(_e,{align:"text-center",children:e.text})},`cell_${t}`):null},vx=(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,Nx=["байт","Кб","Мб","Гб","Тб","Пб"],wx=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," ",Cx(d,m),o(_e,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),Cx=(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))} ${Nx[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?Ix(i):n?.fileFormat;return c("div",{role:"listitem",children:[o(wx,{text:n?.text,target:n?.target,href:i,fileFormat:r,fileSize:l,icon:kx(t),data:n?.data}),o(Ee,{__html:n?.__html})]},String(a))},kx=e=>e?o(ne,{className:"min-w-6 min-h-6",image:e,width:"24",height:"24"}):null,Ix=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},Tx=d((({href:e,__html:t,target:n,onClose:a})=>{const i=D(),l=j(i)(e);return c(cr,{className:"my-6xl min-h-fit w-fit mx-auto",onClose:a,children:[t?o(Ee,{__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(sr,{type:"button",version:"secondary",onClick:a,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]})})),Bx=d((({text:e,href:t,target:n,__html:a,icon:i})=>{const{open:r}=sn(Tx),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:[kx(i),o(_e,{font:"font-light",children:e})]}):null})),Rx={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},Px=Ft((({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",Rx[r]),role:"list",children:i.map(Dx(d,l))}):null]})})),Dx=(e,t)=>(n,a)=>{const i=n?.docType;return""===i?null:"reportSource"in n&&n?.reportSource?.__html?Ex(t)(n,a):Sx(e,t)(n,a)},Ex=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(Bx,{...a,icon:e,href:Ax(t)?t?.href:t?.attachment?.src}),o(Ee,{__html:t?.__html})]},String(n)):null},Ax=e=>"href"in e,_x=Ft((({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(Ee,{__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]})]})})})),Mx=(e,t)=>e&&"underlined"!==t?"primary":"secondary",Ox=(e=[],t={})=>e.filter((({content:e={}})=>dm(t,e))).length,zx=(e,t)=>e===t;const Fx=(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)))}(zx,((e=zx)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,a)=>e(t,n[a])))))())),Vx=[],Lx={},$x={primary:"bg-white/30",secondary:"bg-main-divider"},qx={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},jx=d((({count:e,version:t="secondary"})=>{const n=ke(),a=n?"bg-main-divider":$x[t],i=qx[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})})})),Ux=({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})]})]})},Wx={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},Hx={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},Yx={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},Gx={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},Kx=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",Wx[a],n?Gx[a]:Yx[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?Hx[a]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[Ux({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(jx,{count:m,version:Mx(n,a)})}):null]})})})),Xx=d((e=>o(e?.item?.href?Jx:Zx,{...e}))),Jx=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(Kx,{...e,tag:"a",item:i,onClick:a})})),Zx=d((({item:e={},onClick:t,...n})=>{const a=l((()=>{t&&t(e)}),[t,e]);return o(Kx,{item:e,onClick:a,...n})})),Qx=(e,t,n)=>(a,i)=>o(Xx,{isActive:a===e,onClick:t,type:n,item:a},String(i)),ey=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(Qx(a,i,t))}))),ty={categories:[],extraOptions:[],propertyType:[],stage:[]},ny=Ft((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:a,...i})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=um(ty,{block:i.block,page:i.options?.page}),f=l(((e=ty)=>p(e)),[]),x=(({hotFilters:e=Vx,filtrationState:t=Lx,blocks:n=Vx,onFiltrationStateChange:a})=>{const i=r((()=>Math.max(0,e.findIndex((e=>Fx(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:Ox(n,t.filter),version:Mx(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(ey,{...x}),o(lm,{filtrationSchema:n,resetButton:a,field:m,reset:h}),o(tm,{blocksToRender:d,...i})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),ay=(e,t,n)=>{const a=Mx("all"===t),i=Mx("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(sr,{"data-id":"all",onClick:t=>l(t,"all",e),version:a,children:"Для физических лиц"}),o(sr,{"data-id":"business",onClick:t=>l(t,"business",e),version:i,children:"Для юридических лиц"})]})},iy=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o(Ee,{__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,ly="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",ry=({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(ri,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:ly,children:s}),o(si,{className:ly,isUnfolded:e,children:d})]}),renderFoldButton:sy(n,a)})}):null})},sy=(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:oy()})]}),oy=()=>c("div",{className:"flex items-center",children:["Очистить фильтр",o(W,{name:"CloseIcon",width:"16",height:"16",className:"ml-2xs"})]}),cy=(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]})}),dy=()=>{},my=e=>"all"===e?"block":"hidden",uy=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:i=[],renderCard:l=dy,renderRemoteWorkplaceCard:r=dy,getBalloon:s=dy,getBalloonRemoteWorkplaces:d=dy,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=an(zi),{filteredItems:y,points:b,filteredRemoteWorkplaces:v,lengthItems:N}=qi({data:t,remoteWorkplaces:i,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=a("all"),S={filters:hy([...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:[cy(h,N),m?iy(m):null,p&&ay(t,w,C),o("div",{className:u("pb-3xl",my(w)),children:ry(S)})]}),o("div",{className:"h-[600px]",children:o(Hi,{children:o(Za,{points:b,isLoad:n,className:"h-full"})})})]}),c(Hi,{children:[y.map(l),v.map(r)]})]})})),hy=e=>Object.keys(zi).filter((t=>e.filter((e=>Vi[t](e))).length)),py=({location:e,address:t,billAcceptorType:n,terminalType:a,billAcceptorEnable:i,atmCode:l="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:xy(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:xy(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(Ci,{color:"green",children:xy(s)})})]}),o("div",{className:"hidden sm:block",children:o(ui,{className:"flex-wrap",children:m?.map(fy)})}),o(ri,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(si,{isUnfolded:e,children:o(ui,{className:"flex-wrap",children:m?.map(fy)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Pi({isUnfolded:e,onToggle:t})})]},String(d))},gy=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${xy(t)} №${n}`,body:e.toUpperCase()}),fy=(e,t)=>o(oi,{...e},String(t)),xy=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",yy=[];const by=async e=>{const t=await Pt(e,{method:"GET"});return Array.isArray(t)?t:yy},vy={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},Ny={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)},wy=d((({descriptionData:e,className:t})=>{const n=eg(),a=n?.code??"000",{data:i,isLoad:l}=function(e){const{data:t,error:n}=ga(`${Ut}/atms?regionCode=${e}`,by);return{data:t||yy,isLoad:!t&&!n}}(a);return o(uy,{className:t,filterItems:Cy,data:i,isLoad:l,initFilterState:vy,renderCard:py,getBalloon:gy,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),Cy=(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=>Ny[t](e))),n=!a.length||a.some((t=>Ny[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:ky({workScheduleDescription:t})}),o(ri,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(si,{isUnfolded:e,children:ky({workScheduleDescription:t})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Pi({isUnfolded:e,onToggle:t})})]},String(n)):null,ky=({workScheduleDescription:e})=>c("div",{children:[c(ui,{className:"flex",children:[o(oi,{label:"Операции для физических лиц",children:o(_e,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(oi,{label:"Операции для физических лиц",children:o(_e,{children:"Оформление и обслуживание банковских карт"})}),o(oi,{label:"Операции для физических лиц",children:o(_e,{children:"Инвестиционное и накопительное страхование"})}),o(oi,{label:"Операции для физических лиц",children:o(_e,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(oi,{label:"Режим работы",className:"max-w-none",children:o(_e,{children:e})})]}),Iy=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),Ty={branches:[],remoteWorkplaces:[]};const By=async e=>await Pt(e,{method:"GET"})||Ty,Ry=d((({className:e})=>{const t=eg(),n=t?.code??"000",{data:a,isLoad:i}=function(e="000"){const{data:t,error:n}=ga(`${Ut}/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,By);return{data:t||Ty,isLoad:!t&&!n}}(n);return o(uy,{className:e,data:a?.branches,isLoad:i,remoteWorkplaces:a?.remoteWorkplaces,renderCard:_i,renderRemoteWorkplaceCard:Sy,getBalloon:Oi,getBalloonRemoteWorkplaces:Iy,title:`Офисы филиала ${t?.name}`})})),Py=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(Ry,{}):o(wy,{descriptionData:e})})})),Dy=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,{})]}))),Ey="hidden sm:flex absolute z-40 top-10",Ay=Ft((({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(Td,{containerRef:s,snapAlign:"snap-start",onVisibleIndicesChange:d.handleVisibleIndicesChange,itemClassName:"h-40 flex items-stretch w-screen",gap:8,children:n.map(_y({activeSlideIndex:l,onClick:r}))}),d.canScrollLeft?o(Ld,{className:u("left-6",Ey),onClick:d.scrollLeft}):null,d.canScrollRight?o($d,{className:u("right-6",Ey),onClick:d.scrollRight}):null]})]})})),_y=({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))},My=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?Oy({__html:l,richVersion:r}):null,zy({label:"Адрес",data:e,iconName:"GeolocationIcon"}),zy({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),zy({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),a?.text?qe([a]):null]})]}))),Oy=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(Ee,{...e,itemSize:"list-s"})}),zy=({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,Fy=d((e=>{const{__html:t,richVersion:n="",...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(Ee,{__html:t,richVersion:n})})})),Vy=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}))),Ly=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",$y=(e=!1)=>e?"MinusIcon":"PlusIcon",qy=(e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon",jy=Ft((({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(ri,{isFoldButtonOnTop:n,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(si,{className:u("gap-lg",Ly(m)),isUnfolded:e,children:P({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Uy({foldButtonVersion:r,label:a,labelIcon:i,labelIconBgVersion:l,isUnfolded:e,onToggle:t,isMobile:m})})})}),{childrenTypes:{exclude:["RollupItem"]}}),Uy=({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?qy(e):$y(e))(i,r);return"accordion"===e?o(Vy,{label:s,labelIcon:n,labelIconBgVersion:a,icon:c,onToggle:l}):o(Xd,{label:s,icon:i?"ArrowUpIcon":"ArrowDownIcon",onClick:l})},Wy=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)),Ba,"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]})}))),Hy=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(Wy,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:i}),o(Wy,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:i})]})})),Yy=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})})),Gy=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(Yy,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(Yy,{data:a,fieldValue:"branchCode",fieldLabel:"address",selected:i,setSelected:l,label:"Отделение",placeholder:"Выберите отделение"})})]}))),Ky=["От 1 дня","До 365 дней"],Xy=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(_e,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(el,{min:1,max:365,value:e,items:Ky,onChange:t})]}))),Jy=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(Yy,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(Yy,{data:a,fieldLabel:"safeBoxCasesSize",selected:i,setSelected:l,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),Zy=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(Gy,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:a,onSelectedBranch:Qy(m)}),o(Xy,{days:i,setDays:e=>m({days:e})}),o(Jy,{caseVolumes:d,selectedCaseVolume:l,onSelectedCaseVolume:eb(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(Hy,{}),o(Ne,{text:"Офисы на карте",version:"primary",onClick:u,className:"order-6"})]})]}))),Qy=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},eb=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},tb=d((({days:e,tariffs:t=[]})=>{const n=ab(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:[nb("Аренда за",e),nb("Цена",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})})]})]})})),nb=(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})]}),ab=(e,t)=>{const n=ib(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},ib=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},lb=(e,t)=>e.find((e=>e.branchCode===t)),rb=d((e=>{const{regions:t,data:n,branches:a,onChange:l,onClick:r}=e;i((()=>{l({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,l]);const s=lb(a,n.selectedBranch),d=sb(s?.safeBoxCaseVolumes),m=ob(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=cb(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:a,caseVolumes:d,safeBoxCases:m,onChange:l}),o(tb,{days:n.days,tariffs:u})]})})),sb=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],ob=(e,t)=>e?.find((e=>e.volume===t)),cb=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,db=`${Ut}/safeboxes`,mb=[];const ub=async e=>await Pt(e,{method:"GET"})||mb,hb=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=Ro(),p=pb(m.selectedRegion,h),f=function(e){const{data:t}=ga(e?`${db}?regionCode=${e}`:null,ub);return t||mb}(p),x=l((e=>u((t=>({...t,...e})))),[u]),y=(b=lb(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(rb,{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(Za,{points:y,className:"h-[640px]"}):null]})})),pb=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,gb=e=>e<4?"w-72":"w-52",fb={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"},xb=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=fb,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:xm(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:am(o("div",{className:u("h-0.5 w-full bg-secondary-light flex-1",p)}))(i.map(yb(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",gb(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(Ee,{__html:e.__html,itemSize:"list-s",isDotted:d})]})]}),s?.text?o(Ne,{className:"box-border py-s w-full mt-auto",version:i,...s,children:s?.text}):null]},String(t))}))})]}):null,qe(e)]});var x})),yb=(e,t,n)=>({icon:a},i)=>{const l="secondary"===n?"white":"color";return o(g,{defaultPadding:"",className:`${bb(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},bb=e=>e?"h-16 w-16":"h-24 w-24",vb=d((()=>o("div",{className:"hidden",role:"none"}))),Nb="hidden sm:flex absolute z-40",wb={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},Cb=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(Td,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:wb[l].item,gap:wb[l].gap,children:t.map(Qx(n,a,l))}),s.canScrollLeft?o(Ld,{className:u("left-6",Nb,wb[l].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o($d,{className:u("right-6",Nb,wb[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"})},kb={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},Ib=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(kb[t].wrapper,e),children:o(Cb,{className:kb[t].component,tabsType:t,...n})}):null,Tb=Ft((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=Bb(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(Db(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=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:[Ib({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:Rb(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])=>R(t,{...m?.options,slotName:C,parent:n,extraProps:{className:e===C?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(Pb)?.filter(Boolean)||[]}),Bb=({__id:e,anchor:t})=>t??e??"tabs",Rb=(e,t)=>t?.length?t:e,Pb=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",Db=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),Eb={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},Ab=d((({children:e,activeIndex:t,columnWidth:n,version:a="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:Eb[a],style:{transform:`translateX(-${t*n}px)`},children:e})}))),_b=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}))),Mb={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(Ee,{__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(_b,{className:"w-fit",isOpen:i,onClick:()=>{t({tableSource:n,pdfUrl:a})}}):null},Ob=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 zb({cell:e,cellProps:{rowIdx:n,cellIdx:l,fieldIdx:t,displayTable:e=>{m(!1),c(l),r(e)},isVisible:d}})})),zb=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...a}=e;if(!n||!(n in Mb))return null;return o(Mb[n],{...t,...a})},Fb=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(Ob,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:i,openTableInnerIdx:l,setOpenTableInnerIdx:r},String(s)))):null}))),Vb=(e,t)=>140*Gg(e.slice(0,t).map((e=>e?.cols?.length??1))),Lb=(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,$b=d((({rows:e})=>{const t=e?.[0]?.length??0,[n,a]=rx({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(-${Vb(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?Lb(e.cols,i):null]},`row${t}`)))})})]},String(t))})),sx({...a,btnClass:["left-3 top-20","right-3 top-20"],className:""})]});var i})),qb=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($b,{rows:t.rowsData})})})]},a)}))}))),jb=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Ub=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:jb(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]}))),Wb=Ft((({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(Ub,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(qb,{activeTabIndex:r,items:m}),o(_b,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(_e,{size:"text-h6",children:"Данных нет"}),o(_b,{onClick:n,isOpen:!0})]})})),Hb=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(Wb,{...t,onClick:n})}):null]}))),Yb=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(Hb,{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(Ab,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(Fb,{cells:e,rowIdx:i,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})})),Gb=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,sx({...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]})})),Kb=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]=rx({itemCount:m,visibleItemCount:2}),f=(d||[]).map(((e,t)=>o(Yb,{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(ri,{renderFoldableSection:({isUnfolded:e})=>c(Gb,{controls:p,children:[x,o(si,{isUnfolded:e,children:y})]}),renderFoldButton:Jd}):o(Gb,{controls:p,children:f})})]})})),Xb=d((({className:e="",title:t,description:n,iconVersion:a,__html:i,richVersion:l,...r})=>c(g,{className:u("flex gap-s sm:gap-m group-data-secondary:bg-primary-main/10",e),...r,children:["small"===a?Jb():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,i?o(Ee,{richVersion:l,__html:i}):null]})]}))),Jb=()=>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}),Qb=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]}))),ev=d((e=>{const{prefix:t,unit:n,suffix:a,...i}=e;return o(g,{defaultPadding:"p-0",...i,children:o(Qb,{prefix:t,unit:n,suffix:a})})})),tv=Ft((({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",ax[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:P({...c,extraProps:{className:u("w-full",vd(r)),...nx(a)}})})}),{childrenTypes:[]}),nv=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",av=d((({className:e,title:t,url:n,previewImg:a,...i})=>{const l=D();return c(g,{className:e,defaultPadding:nv(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]})})),iv={AdTile:Lt,ApplicationForm:pc,ApplicationLeadForm:yd,BankAccountFiltration:gm,BenefitsBlock:vm,BonusBenefitsBlock:km,ButtonsBlock:Tm,CalculatorBonus:_m,CalculatorBusinessDeposit:Um,CalculatorCredit:Kr,CalculatorDeposit:ou,CalculatorRefinancing:fu,CardTransfer:Cu,Carousel:Du,CarouselCard:Mu,CarouselCatalogCard:zu,CarouselLinks:Lu,CarouselRecommendationCard:Gu,CarouselTariffsCard:Ju,ContactsBlock:Qu,CreditCardForm:Hh,CreditForm:Rp,DepositFiltration:_p,Depository:Xp,ErrorBlock:Zp,ExchangeRateTile:Rg,Footer:cf,GracePeriod:df,GrantSupport:pf,Header:Qf,Headline:S,HorizontalLayout:ix,ImgBlock:lx,InsuranceAmountBlock:ux,InvestmentInfo:fx,LinkDocs:Px,MobileAppTile:_x,MortgageFiltration:ny,OfficesAtmsMap:Py,Placeholder:Dy,ProductBlock:Vt,ProductGallery:Ay,RepresentativeOfficeInfo:My,RichTextBlock:Fy,RollupItem:jy,SafeDepositRental:hb,StepsBlock:xb,StickyBottomMenu:vb,TabsLayout:Tb,TariffsTable:Kb,TextBlock:Xb,UnitBlock:ev,VerticalLayout:tv,Video:av},lv=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))})),rv="cookie",sv=d((({__html:e})=>{const[t,{setTrue:n,setFalse:a}]=on();Wg((()=>{globalThis.localStorage?.getItem(rv)||n()}),[],3e3);const i=l((()=>{globalThis.localStorage?.setItem(rv,"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(Ee,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(or,{className:"bg-main-gray rounded-md w-11 h-11",onClose:i})})]})}):null}));function ov(e){const t=l((({key:t})=>{"Escape"===t&&e()}),[e]);cn(globalThis.document,"keydown",t)}function cv(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 dv=()=>{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 cv(ue.observable,"dialog",{open:t,close:n,closeAll:i}),[e,{close:n,closeAll:i}]},mv=d((()=>{const[e,{close:t}]=dv(),n=Boolean(e.length);return ov(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})),uv=d((()=>{const[e,t]=a(null),n=l((()=>{t(null)}),[]);return cv(ue.observable,"popup",{open:t,close:n}),ov(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})),hv="header",pv="footer",gv="sticky-footer",fv={},xv=d((({className:e,data:t=fv,blocksRegistry:n,blockDecorator:a})=>{const{slots:i,blocks:l,fallback:r,...s}=t,d=Ot(s,r);lv(),tg();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?.[hv]?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:R(i?.[hv],{...m,slotName:hv})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[P({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),R(i?.[pv],{...m,slotName:pv})]})]}),i?.[gv]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:R(i?.[gv],{...m,slotName:gv})}):null,o(mv,{}),o(uv,{}),o(sv,{__html:d?.cookieContent?.__html})]})}));Object.assign(xv,{childrenTypes:[],slots:()=>[hv,pv,gv]});e.Blocks=iv,e.ContentPage=xv,e.handlerDecorator=ce,e.joinList=am,e.locationNavigator=Jt,e.packageVersion="0.14.703",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),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 R=[],B=(e,{key:t,ancestors:n=R,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||R,[r.parent,a]]:n},i)))};function P({block:e,options:t,children:n,extraProps:a,renderProps:i}){return n||(e&&t?B(e.blocks,{...t,parent:e,extraProps:a,renderProps:i}):null)}function D(){return D._impl()}D._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),D.setup=e=>{D._impl=e};const A=["CDN","BASE_PATH"],E=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return A.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),_=e=>Boolean(e?.includes(":")),M=(e,t)=>Boolean(e&&!_(e)&&(!t||"_self"===t)),O=e=>Boolean(e?.startsWith("#")),z=e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),F=(...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:M,isHash:O,withoutQuery:z,joinPath:F,hasPrefix:V});const $="/api/",q=`${$}v1/storage`,j=e=>(t,n)=>{if([!t,_(t),O(t),[E.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 F(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)(F(E.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(G,{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",G=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),K=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(K.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(K.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(!M(e,t))return!0;const a=K.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,Re=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]}),Pe(P({...y,extraProps:{className:"@container-normal"}})),Te(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Be(p)]:r,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),r?o("div",{className:"self-end",children:r}):null]})]})]})})),Be=e=>u(e?"row-span-2":"@xl:row-span-2"),Pe=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,Ae=d((({__html:e="",richVersion:t="",itemSize:n="list-m",isDotted:a=!0,children:i})=>e||i?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(t,n,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",a?"":"without-dots"),dangerouslySetInnerHTML:e?{__html:e}:void 0,children:i})}):null)),Ee=(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}))),Me=(e,t)=>e?o(_e,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,Oe=(e,t)=>["label"in e?Me(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Ee(e.description,t)},String(t)):null,"__html"in e?o(Ae,{...e},`rte-${t}`):null],ze=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:Oe(n)})]}))),Fe=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(ze,{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(Oe)}):null)),Le=d((({isTabularBenefits:e,...t})=>o(e?Ve:Fe,{...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(Ge)}):null)),Ge=({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)),Ke=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 R=b?.src?o(ne,{image:b}):null,B=o(S,{title:a,description:i,headlineVersion:l,align:r,isEmbedded:!0}),P=u?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Re,{className:e,padding:t,defaultPadding:n,...g?{title:B}:{insetTitle:B},...Qe(R,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:[P?.length?o(Le,{benefitsVersion:s,isTabularBenefits:d,benefits:P}):null,h?o(Ae,{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(Ke,{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),Rt=e=>vt(e).filter(((e=st)=>([t])=>e(t))(Ct)),Bt=e=>{return t=Rt(e).map((([,e])=>e)),[...new Set(t)];var t};async function Pt(e,t){try{return e?await Dt(e,t):null}catch(e){console.error(e)}return null}const Dt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),At=e=>[...new Set(e)],Et={},_t=["/portal-resources"],Mt=(e,t)=>Tt(e,(e=>t?.[e])),Ot=(e,t)=>{const n=Bt(e),[l,r]=a({});return i((()=>{zt(n).then(r)}),[n.join()]),n.length?Mt(e,{...t,...l}):e},zt=async(e,t={})=>{if(e.length){const n=await(async e=>Object.fromEntries((await Promise.allSettled(At(e).filter((e=>!_t.some((t=>e.startsWith(t))))).map((async e=>[e,Et[e]||=await Dt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(e),a={...t,...n},i=Object.entries(n).flatMap((([,e])=>Bt(e)));return i.length?zt(i,a):a}return t};function Ft(e,t={}){const n=d((t=>{const n=Ot((({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=Ft((({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}),Gt=(e,t=!0)=>({[t?"email":"mail"]:e}),Kt=(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 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?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: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=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: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]})})),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(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(a,s,t)})}),yn(r)]})})),In=(e="")=>e.replace(/[^\d]+/g,""),Tn=(e,t,n)=>t&&!n?`${e}*`:e,Rn=e=>e?.text||e?.key||"",Bn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Pn=d((({popupRef:e,options:t,value:n,query:a,onChange:i,iconVersion:l})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",ref:e,children:Bn(t,a).map((e=>c("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem","aria-selected":e.key===n?.key,onClick:t=>{t.stopPropagation(),i&&i(e)},children:[o("span",{className:"min-h-6",children:Rn(e)}),o(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(Pn,{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:[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",En(m,d,C)),onClick:S?I:k,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:Rn(r)||h}),An(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]})]})})),An=(e,t)=>o(W,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),En=(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,Mn=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)]}))),On=e=>!e?.length,zn=e=>t=>n=>e(n)?[]:[t],Fn=zn((e=>null!=e&&""!==e)),Vn="Некорректно заполненное поле",Ln="Укажите регион, город/населенный пункт, улицу, дом",$n=e=>Fn(e??Vn),qn=e=>zn((e=>e?.key&&""!==e?.key))(e??Vn),jn=e=>zn((e=>"string"==typeof e&&e.length>0&&e.length<=2))(e??Vn),Un=e=>zn((e=>"string"==typeof e&&e.length>1&&Qn(e)))(e??Vn),Wn=(e,t)=>zn((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??Vn),Hn=e=>zn((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}$/,zn((e=>"string"==typeof e&&t.test(e))))(e);var t},Gn=zn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),Kn=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=()=>zn(Xn)(Ln),Zn=/^[\u0400-\u04FF\d\s]+$/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:zn(ea)("Допустимый возраст заёмщика - от 23 до 75 лет"),birthPlace:$n("Укажите место рождения"),education:qn("Выберите ваше образование"),housing:qn("Выберите тип жилья"),employment:qn("Выберите информацию о трудоустройстве"),organization:qn("Выберите тип организации"),amountWorkers:qn("Выберите информацию о количестве сотрудников"),employerActivities:qn("Выберите вид деятельности организации"),employerOrganization:qn("Выберите вид организации"),positionOrganization:qn("Выберите вашу должность"),dulSerie:(na="Укажите серию паспорта",zn((e=>"string"==typeof e&&4===e.length))(na)),dulNumber:Hn("Укажите номер паспорта"),dulIssueDateField:$n("Укажите дату выдачи паспорта"),dulSubdivisionCode:Hn("Укажите код подразделения"),dulIssuedBy:$n("Укажите организацию, выдавшую паспорт"),email:(e=>zn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(e))("Укажите электронную почту"),fullName:$n(),inn:(e=>zn((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:Gn,annualRevenue:$n(),consentToReceiveMaterials:Gn,processPersonalDataFlg:Gn,consentProviderFlg:Gn,consentPfrFlg:Gn,consentOthersFlg:Gn,consentInformFlg:Gn,familyStatus:qn("Выберите семейное положение"),children:Wn(2,"Укажите количество детей"),familyMembers:Wn(2,"Укажите количество членов семьи"),dependents:Wn(2,"Укажите количество иждивенцев"),totalIncome:Wn(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:Wn(10,"Укажите сумму обязательных выплат"),snils:(e=>zn(Kn)(e))("Некорректный номер СНИЛС"),conscription:$n(),armyIdFlg:Gn,sex:$n("Укажите свой пол"),addressRegistration:Jn(),organizationAddress:zn((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=>zn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&Qn(e)))(e??Vn))("Необходимо ввести кодовое слово"),confirmationIncome:qn(),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(Mn,{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 Pt(e,{method:"GET"})||ya;function va(e=!1){const{data:t}=ga(`${Ut}${e?"/premiumBranchesByRegions":"/branchesByRegions"}`,Dt);return Array.isArray(t)?t:[]}const Na=(e="")=>"ULTRASERVICE"===e||"PREMIUMSERVICE"===e,wa=d((({field:e,input:t,params:n})=>{const a=Na(n?.typeForm),l=e("region"),r=l?.value?.key,s=l?.value?.text,c=a?va(a)?.find((e=>e?.region===s))?.branches:function(e){const{data:t}=ga(e?`${xa}?regionCode=${e}`:null,ba);return t||ya}(r)?.filter((e=>e?.address));return i((()=>{""!==l?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[l?.value]),o(Mn,{label:"Отделение",placeholder:"Выберите отделение",options:(c||[]).map((({address:e=""})=>({key:e,text:e}))),...la(e("addressBranch"),ta.addressBranch,t?.required),isSearch:!0})})),Ca=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})})),Sa=(e,t)=>Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t).value,ka=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",a=e(n).value,i=l((t=>{e?.(n)?.onChange?.(Ia(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&&Sa(e,n),label:"Адрес",...la(e(n),ta[n],t?.required),value:a.fullAddress,onChange:r,...t,onDaDataChange:i})})),Ia=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}),Ta=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)}))}))),Ra="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(Ta,{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",Aa(a)),onClick:s,children:[o("div",{className:u(Ra,"m-0",i?"rounded-full border-2":_a(t),!a&&t?"border-primary-main":"border-gray",a?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:Ea(i),"aria-checked":Boolean(t),"aria-disabled":Boolean(a),"aria-label":n}),t?d:null,Da(n)]})})})),Da=e=>e?o("div",{className:"ml-s",children:o(_e,{size:"text-l",font:"font-light",children:e})}):null,Aa=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",Ea=(e=!1)=>e?"radio":"checkbox",_a=(e=!1)=>u("rounded border",{"bg-primary-main":e}),Ma=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)]}))),Oa=d((({field:e,input:t})=>o(Ma,{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",Va="/icons/MapMarkerClusterYellowIcon.svg";function La({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=$a("offices",e,i);if(n.length&&n.every((e=>"type"in e))){const a=$a("workplaces",e,i),r=qa(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=qa(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=qa(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 $a=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?Fa:Va,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),qa=(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:Va,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),ja={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},Ua={...ja,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},Wa=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(Ua).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"})}),Ha=e=>globalThis[e],Ya=(e,t)=>{const n=document.getElementById(t);if(n){const t=Ha(e);return t?Promise.resolve(t):new Promise((t=>{n.addEventListener("load",(()=>{t(Ha(e))}))}))}return new Promise(((n,a)=>{const i=document.createElement("script");i.src=t,i.async=!0,i.id=t,i.addEventListener("load",(()=>{n(Ha(e))})),i.addEventListener("error",(e=>{a(e)})),document.head.appendChild(i)}))};const Ga=()=>function(e,t,n=!0){const[l,r]=a(void 0);return i((()=>{let a=!0;return Ya(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=${E.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1),Ka={...ja,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},Xa=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"})})})),Ja=[55.753995,37.614069],Za=d((({points:e,className:t="",zoom:n=5,isLoad:a,selectedAddress:l})=>{const r=s(null),d=s(null),m=Ga();if(i((()=>{r.current?La({yandexMaps:m,map:r.current,points:e,isLoad:a}):m?.ready((()=>{r.current||(r.current=new m.Map(d.current,{center:Qa(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),La({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(Xa,{yandexMaps:r}),o(Xa,{yandexMaps:r,direction:"out"})]}),Wa(r,m,u("right-2 top-80",h))]})})),Qa=e=>{const t=[ti(ei(e,0)),ti(ei(e,1))];return t.every((e=>e))?t:Ja},ei=(e,t)=>e.map((e=>e.coords?.[t])),ti=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,ni=async(e,t,n)=>{try{return(await ai(e,t,n)).json()}catch(e){return console.error(e),null}};async function ai(e,t,n){return globalThis?.fetch?.(`${Ut}${e}`,{method:t,headers:{"Content-Type":"application/json",...ii()},credentials:"include",body:n?JSON.stringify(n):null})}const ii=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},li=e=>Number(e.toString().replace(",",".")),ri=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 si=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})})})),oi=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:ci({textItems:l,subText:t,children:n,isPhone:a,...i})})),ci=({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||di(n,s),i?o(_e,{color:a,size:"text-m",children:i}):null]}),di=(e,t)=>e.filter(Boolean).map(((e,n)=>o(_e,{size:"text-l",children:t?o("a",{href:`tel:${mi(e)}`,children:e.trim()}):e.trim()},String(n)))),mi=e=>e.replace(/\D/g,""),ui=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}))),hi=e=>{const t=gi(e);return o(oi,{label:"Режим работы",value:t,className:"max-w-none"})},pi=({workTime:e="",lunchHour:t="",daysOff:n=""},a=!1)=>e?[`${a?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",gi=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[pi({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":a}),pi({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:a},!0)].filter(Boolean)},fi=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],xi=e=>fi.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??"")}}))),yi=e=>{if(!e)return null;const t=bi(e);return c(ui,{className:"border-none",children:[o(oi,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(vi)})}),o(oi,{label:"Режим работы",className:"max-w-none",children:o(_e,{children:e})})]})},bi=e=>{const t=fi.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},vi=({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)),Ni=({currency:e,buyExchangeRate:t,saleExchangeRate:n},a)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(oi,{label:"Валюта",value:e.currency}):null,t?o(oi,{label:"Купить",value:String(t)}):null,n?o(oi,{label:"Продать",value:String(n)}):null]},String(a)),wi={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"}},Ci=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",wi[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:wi[n].text,children:t})]}))),Si=(new Date).getDay(),ki=e=>{const[t]=e?.slice(Si-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(Ci,{color:"green",children:i}):null,n&&l?o(Ci,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(Ci,{color:"red",children:"Выходной"})},Ii=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Ti=({title:e,status:t,workTime:n,lunchHour:a,hasLunch:i},l)=>o(oi,{label:e,value:t&&n?n:"",subText:Ii({lunchHour:a,hasLunch:i,status:t}),subColor:!t||i?"text-error":"text-green-dark"},String(l)),Ri=["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:Ri[Number(e)],width:"16",height:"16"})]}),Di=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,Ai=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,Ei=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,_i=({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=xi(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]}),ki(h)]}),o("div",{className:"hidden sm:block",children:Mi({phone:n,fax:a,phoneBusiness:i,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(ri,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(si,{isUnfolded:e,children:Mi({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))},Mi=({phone:e,fax:t,phoneBusiness:n,phoneNatural:a,phoneCallCentre:i,phoneCurrencyControl:l,workSchedule:r,exchangeRate:s})=>{const d=xi(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(ui,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(oi,{label:"Факс",value:t,isPhone:!0}),o(oi,{label:"Телефон филиала",value:e,isPhone:!0}),o(oi,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(oi,{label:"Обслуживание физических лиц",value:a,isPhone:!0}),o(oi,{label:"Для консультаций по валютному контролю",value:l,isPhone:!0}),o(oi,{label:"Контакт-центр",value:i,isPhone:!0})]}),r?.isMatchesPattern?o(ui,{children:o(oi,{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(Ti)})})}):c(ui,{children:[o(oi,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(vi)})}),hi(d)]}),r?.businessScheduleVisibleTag?yi(r?.businessScheduleDescription):null,s?.currencies?.length?o(ui,{className:"flex-wrap",children:s?.currencies?.map(Ni)}):null]})},Oi=({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=xi(e),n=e?gi(t):"",a=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?Di(n):Ei(n,a):Ai(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:"Для маломобильных граждан"},Vi={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)},Li=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>Vi[t](e)))))},$i=()=>{},qi=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:a=$i,getBalloonRemoteWorkplaces:i=$i})=>{const[l,s,o,c]=r((()=>{const l=Li(e,n),r=Li(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}},ji=e=>{const{data:t,error:n}=ga(`/api/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,Ui);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},Ui=async e=>await Pt(e,{method:"POST"})||[],Wi=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),Hi=d((({children:e})=>Wi?e:null)),Yi=d((({field:e,input:t})=>{const[n,l]=a([]),{data:r}=ji("REGION_RF"),s=e("regionRetail")?.value||{},d=e("addressRetail");i((()=>{(async()=>{const e=await(async e=>{const t=await ni("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0});return t?.offices?.map((e=>({...e,gpsLatitude:li(e.latitude??Ja[0]),gpsLongitude:li(e.longitude??Ja[1])})))||[]})(s?.key??"");l(e)})(),s?.key&&e?.("addressRetail")?.onChange?.("")}),[s.key]);const{points:m}=qi({data:n,filtrationState:{},getBalloon:Oi}),u=Boolean(s?.key);return c("div",{children:[o(Mn,{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(Hi,{children:o(Za,{points:m,isLoad:!r,className:"h-full",selectedAddress:d?.value?.text})})})]})})),Gi=(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 Xi(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function Ji({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=Xi(t.target?.value),a=e.length?e[n]:n;r&&r(a||0)}})})]})}const Zi=1,Qi=100,el=d((e=>{const{className:t,title:n,items:a=[],list:i=[],min:r=(i.length?0:Zi),max:s=(i.length?i.length-1:Qi),step:d=1,value:m=i[0]||r,disabled:h=!1,onChange:p}=e,g=Gi(e,{normalize:(e=0)=>i.length?tl(i)(e):Ki(e,r,s),format:He()}),f=l((e=>{p&&p(Xi(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}),Ji({list:i,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),nl(a)]})})),tl=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),nl=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))))}),al=["От 1 000 ₽","До 1 000 000 000 ₽"],il=d((({field:e})=>o(el,{title:"Сумма, ₽",items:al,min:1e3,max:1e9,...e("amount")})));function ll(e,t){for(const[n,a]of e.entries())null!=a?t.setItem(n,a):t.removeItem(n)}const rl={};function sl(e,t=rl){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 ol=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 cl,dl;function ml(e){return sl(ol,e)}cl=ol,dl=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),ll(cl,dl),ll(dl,cl),cl.bus.watch((({type:e,event:t})=>{null!=t?dl.setItem(e,t):dl.removeItem(e)}));const ul=()=>ml(),hl=Ft((({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(Mn,{placeholder:i,options:s,...la(e(n),ta[n],a?.required),...r})})),pl=d((({field:e,input:t})=>{const{data:n}=ji("EMPLOYEES_NUMBER"),a=ul();return i((()=>{n&&(a.amountWorkers=n)}),[n]),o(hl,{field:e,source:a.amountWorkers??[],label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),gl=d((({field:e,input:t})=>o(kn,{label:"Годовая выручка, ₽",...la(e("annualRevenue"),ta.annualRevenue,t?.required)}))),fl=d((({field:e,input:t})=>o(Ma,{text:"Наличие военного билета",...la(e("armyIdFlg"),ta.armyIdFlg,t?.required)}))),xl=d((({field:e,input:t})=>o(kn,{label:"Код представителя Банка",placeholder:"Введите код",isInteger:!0,...la(e("bankEmployeeCode"),ta.bankEmployeeCode,t?.required),...t}))),yl=d((({field:e})=>o(kn,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e("bankEmpolee")}))),bl=d((({field:e,input:t})=>o(Ma,{text:"В отношении меня ведётся производство по делу о банкротстве",...la(e("bankruptcyFlg"),ta.bankruptcyFlg,t?.required)}))),vl=({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=Nl(t,e),c=wl(t,l,r);u.push(o("td",{children:o("div",{className:Cl(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},Nl=(e,t)=>t&&e.toDateString()===t.toDateString(),wl=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),Cl=(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"),Sl=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],kl=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:Sl.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:vl({firstDayOfWeek:u,today:e,totalDays:h,currentYear:n,currentMonth:t,min:a,max:i,onDateClick:m})})]})})),Il=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function Tl(e,t){const n=e.replace(/\D/g,"");if(""===n||n.length===t.length)return e;const a=[...t],i=a.findIndex(Rl),l=a.map(((e,t)=>Pl(e)?a.slice(0,t).filter(Pl).length:-1)),r=a.map(((e,t)=>Bl(e)?e:n.charAt(l[t])||e)),s=l.indexOf(n.length-1)+1;return r.slice(0,Math.max(i,s)).join("")}const Rl=e=>"_"===e,Bl=e=>/\d/.test(e),Pl=e=>Rl(e)||Bl(e),Dl=1940,Al={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},El=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(Tl(t,"__.__.____"))},onBlur:()=>{if(_l(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",...Al})]})})),_l=e=>{const[t,n,a]=e.split(".");if((e=>Number(e)>=Dl&&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},Ml=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:a,setSelectedMonth:i,setSelectedYear:l,disabled:r=!1})=>o(El,{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")}),Ol=Il.map((e=>({key:e}))),zl=Array.from({length:(new Date).getFullYear()-Dl+1},((e,t)=>Dl+t)).reverse().map((e=>({key:String(e)}))),Fl=(e,t)=>{const n=new Date(e,t,1);let a=0;for(;n.getMonth()===t;)a++,n.setDate(n.getDate()+1);return a},Vl=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:a,onChange:i})=>{a&&i?.(new Date(t,n,Math.min(e,a.getDate())))},Ll={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},$l={className:"min-w-32",iconVersion:"black",isBorder:!1},ql=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(Il.indexOf(e));const t=Fl(r,Il.indexOf(e));Vl({maxDateOfMonth:t,selectedYear:r,selectedMonth:Il.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:Ol,yearsOptions:zl,ref:c}})({onYearSelect:b,onMonthSelect:x,onShowCalendar:g,selectedYear:y,selectedMonth:f,showCalendar:p,onChange:h,value:n}),R=((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:[gn(t),c("div",{className:"relative",children:[Ml({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":R}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:v,children:o(W,{...Ll,className:"-rotate-90 cursor-pointer"})}),o(Dn,{onChange:w,value:{key:Il[f]},options:S,...$l}),o(Dn,{onChange:C,value:{key:String(y)},options:k,...$l}),o("div",{className:"my-auto",onClick:N,children:o(W,{...Ll,className:"rotate-90 cursor-pointer"})})]}),o(kl,{today:n,currentMonth:f,currentYear:y,onDateSelect:h,min:s,max:d,setValue:g})]}):null]})]})})),jl=d((({className:e,label:t,error:n,errors:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ql,{label:mn({label:t,errors:a}),valid:Boolean(!n),...i}),yn(n)]}))),Ul=d((({field:e,input:t})=>o(jl,{label:"Дата начала работы на текущем месте",...la(e("beginDate"),ta.beginDate,t?.required),...t}))),Wl=d((({field:e,input:t})=>o(jl,{label:"Дата рождения",...la(e("birthday"),ta.birthday,t?.required)}))),Hl=d((({field:e,input:t})=>o(kn,{label:"Место рождения",...la(e("birthPlace"),ta.birthPlace,t?.required),...t,disabled:t?.filledByEsia&&Sa(e,"birthPlace")}))),Yl=e=>{try{return JSON.parse(String(e))}catch(e){return null}};function Gl(e){const t=globalThis.localStorage?.getItem(e),[n,i]=a(t?Yl(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 Kl=d((({field:e,input:t})=>{const[n,l]=a([]),[r]=Gl("programId"),{value:s,onChange:c}=e("cardCategory"),d=e("paymentSystem")?.value?.type;return i((()=>{d&&r&&(async()=>{const e=await(async(e,t)=>{const n=await ni("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemTypeCd:e,creditProgramId:t}});return Array.isArray(n)?n:[]})(d,r);l(e),Xl(e,s)||c&&c(null)})()}),[d]),o(hl,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t})})),Xl=(e,t)=>e.some((e=>e.key===t?.key)),Jl=d((({field:e,input:t})=>o(kn,{label:"Количество детей до 18 лет",placeholder:"Введите значение",isInteger:!0,...la(e("children"),ta.children,t?.required),...t}))),Zl=d((({field:e,input:t})=>o(kn,{label:"Кодовое слово",...la(e("codeWord"),ta.codeWord,t?.required),...t}))),Ql=d((({field:e,input:t})=>o(kn,{label:"Количество объектов инкассации",isInteger:!0,...la(e("collectionCount"),ta.collectionCount,t?.required)}))),er=d((({field:e,input:t})=>o(kn,{className:"col-span-2",...la(e("comment"),ta.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),tr=d((({field:e,input:t})=>{const{data:n}=ji("INCOME_CERT_UNITED");return o(hl,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),nr=d((({field:e,input:t})=>{const{data:n}=ji("MILITARY_STATUS");return o(hl,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),ar={processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3},consentToReceiveMaterials:{text:"Согласен на получение информационных и аналитических материалов по электронной почте"}};function ir({disabled:e,onClick:t}){return n=>{!e&&t&&t(n)}}const lr={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"},rr={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")},sr=d((({children:e,...t})=>{const n=e=>({...e,onClick:ce(ir(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(lr[i],rr[i]),a),type:s,role:d,onClick:m,children:e})})),or=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"})}))),cr=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>c("div",{className:u("relative bg-white pt-0 p-lg",e),role:"dialog",onClick:i,children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(or,{className:"absolute top-0 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]}))),dr=d((({src:e,convertToPng:t,onClose:n})=>c(cr,{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(sr,{className:"mx-auto mt-m",type:"button",onClick:n,children:"Ознакомиться"})]}))),mr=e=>{const{open:t}=sn(dr),n=ke();return l((async()=>{if(e){const a=URL.createObjectURL(await(async(e,t=!1)=>{const n=await ai(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return n?await n.blob():new Blob})(e,n));t({src:a})}}),[t,e,n])},ur=d((({className:e,error:t,docId:n,...a})=>{const i=mr(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)]})})),hr=d((({field:e,input:t})=>t&&t.name?o(ur,{text:ar[t.name]?.text,docId:ar[t.name]?.docId,...la(e(t.name),ta[t.name],t?.required)}):null)),pr=Math.round(29.5),gr=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]}))),fr="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",xr="flex flex-col lg:w-1/2 gap-2xl",yr="flex flex-col gap-y-xl min-w-52",br=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}))),vr=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(br,{value:n,...i}):o(_e,{size:"text-h3",children:"-"})]}))),Nr=(e=[],t=!1)=>wr([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),wr=(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]},Cr=(e,t=0)=>e?.sum?e.sum:t,Sr=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,kr=(e,t)=>e?o(w,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,Ir=({min:e=0,max:t=0,availableMonths:n,...a})=>o(el,{items:[`От ${Tr(e)}`,`До ${Tr(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...a}),Tr=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Rr={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",Rr[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))))})]}))),Pr=({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})]}),Dr=e=>Pr({...e,className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Ar=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...a})=>o(el,{items:e?[`От ${He(1)(a.min||0)} ${n}`,`До ${He(1)(a.max||0)} ${n}`]:[],step:t,...a}),Er=({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))},_r=(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)},Mr=e=>e,Or=(e=Mr)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),zr=Or(),Fr=(e=Mr)=>Or((t=>-e(t))),Vr=Fr(),Lr=([e,t],n,a=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:$r([e,t],a),$r=([e,t],n=[])=>({[e]:n.length?Vr(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?zr(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),qr=(e,[t,n],a)=>e>=a[t]&&e<=a[n],jr={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Ur=e=>Wr({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Wr({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&Wr({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&Wr({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Wr=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],Hr=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,l=t?.rateRows||[jr],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Ur({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Lr(["minSum","maxSum"],r,l),{minMonths:c,maxMonths:d}=Lr(["minMonths","maxMonths"],r,l),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i})=>e?.find((e=>Ur({row:e,userInputParams:t,paramsViewSettings:n})&&qr(a,["minSum","maxSum"],e)&&qr(i,["minMonths","maxMonths"],e)))||jr)({rateRows:l,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i}),{rate:u}=m,h=_r(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:a,monthsValue:i,monthlyPayment:h}},Yr=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),Gr={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},Kr=Ft((({className:e,title:t,calcSource:n,buttons:a,footnote:l,paramsViewSettings:r,defaultParams:s,onChange:d,...m})=>{const h=(p=n?.rateRows,wr([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],p));var p;const[g,{field:f,isDirty:x}]=an({moneyValue:Cr(s,2e5),monthsValue:Sr(s,pr),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=Hr(g,n,r),b=Dr({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((()=>{!Yr(s)&&h&&Er({field:f,defParams:h,calcParams:y,map:Gr,monthsValue:"minMonths"})}),[n,s]),o(gr,{className:e,title:t,...m,children:c("section",{className:u(fr,e),children:[c("div",{className:xr,children:[Ar({title:"Сумма кредита, ₽",step:500,min:y.minSum,max:y.maxSum,...f("moneyValue"),value:y.moneyValue}),Ir({title:"Срок кредита, месяцев",min:y.minMonths,max:y.maxMonths,...f("monthsValue"),value:y.monthsValue}),Xr({...y,...r},f),o("div",{className:"sm:hidden",children:b})]}),c("div",{className:u(yr,"@4xl:w-1/2"),children:[o(vr,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(vr,{title:"Ставка",value:y?.rate,fractionDigits:2,postfix:"%"}),o(vr,{title:"Ежемесячный платёж",value:y.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:b}),qe(a,{isVertical:!0}),kr(l)]})]})})})),Xr=(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]}),Jr={moneyValue:"sum",monthsValue:"period",isInsurance:"isEnableInsurance",isPensionClient:"isEnablePensionClient",isStateEmployee:"isEnableStateEmployee",isSalaryClient:"isEnableSalaryClient",isAnnuity:"isAnnuity"},Zr=(e,t=!1)=>{const n=t?Qr(Jr):Jr;return Object.fromEntries(Object.entries(e??{}).map((([e,t])=>[n[e],t])))},Qr=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[t,e]))),es="calculator",ts=d((({field:e,params:t})=>{const n=l((t=>{e(es).onChange?.(t)}),[]);return o(Kr,{...t?.calcData,padding:"p-0",defaultParams:Zr(e(es).value),onChange:n})})),ns=d((({field:e,input:t})=>{const{data:n}=ji("CREDIT_IN_RSHB");return o(hl,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /\n вкладчиком с долей участия более 20% уставного капитала руководителем,\n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t,disabled:!e?.("shareholderFlg")?.value})})),as=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)]}))),is=[{id:"810",text:"Рубли"}],ls=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("currency"),{data:i}=ji("CURRENCY"),l=i?.map((e=>({id:e.key,text:e.value})))??is;return o(as,{label:"Валюта",orientation:"horizontal",items:l,value:n,onChange:e=>a?.(e),...la(e("currency"),ta.currency,t?.required)})})),rs=d((({field:e,input:t})=>o(jl,{label:"Дата доставки",...la(e("deliveryDate"),ta.deliveryDate,t?.required)}))),ss=d((({field:e,input:t})=>o(kn,{label:"Количество иждивенцев",placeholder:"За исключение детей до 18 лет",isInteger:!0,maxLength:2,...la(e("dependents"),ta.dependents,t?.required),...t}))),os=d((({field:e,input:t})=>o(jl,{label:"Желаемая дата встречи",...la(e("desiredMeetingDate"),ta.meetingDay,t?.required)}))),cs=d((({field:e,input:t})=>o(Ma,{text:"Являюсь инвалидом",...la(e("disablePeopleFlg"),ta.disablePeopleFlg,t?.required)}))),ds="dulIssueDateField",ms=d((({field:e,input:t})=>o(jl,{label:"Дата выдачи",...la(e(ds),ta.dulIssueDateField,t?.required),disabled:t?.filledByEsia&&Sa(e,ds)}))),us="dulIssuedBy",hs=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&&Sa(e,us),label:"Кем выдан",...t,...la(e(us),ta.dulIssuedBy,t?.required),onDaDataChange:i,daDataQueryPrefix:n})})),ps=d((({field:e,input:t})=>o(kn,{disabled:t?.filledByEsia&&Sa(e,"dulNumber"),label:"Номер документа",isInteger:!0,maxLength:6,...la(e("dulNumber"),ta.dulNumber,t?.required)}))),gs=d((({field:e,input:t})=>o(kn,{disabled:t?.filledByEsia&&Sa(e,"dulSerie"),label:"Серия документа",isInteger:!0,maxLength:4,...la(e("dulSerie"),ta.dulSerie,t?.required)}))),fs="dulSubdivisionCode",xs=d((({field:e,input:t})=>{const n=l((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(kn,{disabled:t?.filledByEsia&&Sa(e,fs),label:"Код подразделения",isInteger:!0,maxLength:6,...t,...la(e(fs),ta.dulSubdivisionCode,t?.required),onDaDataChange:n})})),ys=d((({field:e,input:t})=>{const{data:n}=ji("EDUCATION_LEVEL");return o(hl,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),bs=d((({field:e,input:t})=>{const{required:n,...a}=t;return o(kn,{label:"Электронная почта",...la(e("email"),ta.email,n),...a})})),vs=d((({field:e,input:t})=>{const{data:n}=ji("ORGANIZATION_ACTIVITY_TYPE"),a=ul();return i((()=>{n&&(a.employerActivities=n)}),[n]),o(hl,{field:e,source:a.employerActivities??[],label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),Ns=d((({field:e,input:t})=>{const{data:n}=ji("ORGANIZATION_KIND"),a=ul();return i((()=>{n&&(a.employerOrganization=n)}),[n]),o(hl,{field:e,source:a.employerOrganization??[],label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),ws=d((({field:e,input:t})=>{const{data:n}=ji("EMPLOYMENT_INFO_UNITED");return o(hl,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),Cs=d((({field:e,input:t})=>o(kn,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",isInteger:!0,...la(e("expenses"),ta.expenses,t?.required),...t}))),Ss=d((({field:e,input:t})=>o(kn,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",maxLength:2,...la(e("experience5Years"),ta.experience5Years,t?.required),...t}))),ks=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)})})),Is=d((({field:e,input:t})=>{const{data:n}=ji("MARITAL_STATUS");return o(hl,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),Ts=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],Rs=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],Bs=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],Ps=d((({field:e,input:t})=>o(Mn,{label:"Способ получения ответа",options:Bs,...la(e("feedbackMethod"),ta.feedbackMethod,t?.required)}))),Ds=d((({field:e,input:t})=>o(kn,{label:"ФИО",...la(e("fullName"),ta.fullName,t?.required),...t}))),As=d((({field:e,input:t})=>o(kn,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...la(e("generalSeniority"),ta.generalSeniority,t?.required),...t}))),Es=d((({field:e,input:t})=>{const{data:n}=ji("HOUSE_TYPE");return o(hl,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),_s=e=>t=>e.map((e=>({key:t,text:e.value||""}))).find((e=>e.key===t))??null,Ms=(e,t,n)=>{const a=n.data?.inn??"",i=Number(n.data?.opf?.code),l=n.data?.okved??"";t?.("legalForm")?.onChange?.(n.data?.opf?.short),t?.("organizationAddress")?.onChange?.(Ia(n.data?.address)),t?.("amountWorkers")?.onChange?.(((e,t)=>{const[n]=[e?.find((e=>Number(t)<=Number(e.description)))].map((e=>({key:e?.key??"",text:e?.value??""})));return n})(e?.amountWorkers,n.data?.employee_count)),t?.("employerActivities")?.onChange?.(((e,t)=>{if(!t)return null;const n=_s(e),a=+t?.split(".")[0],i=+t?.split(".")[1];switch(a){case 1:return n("AGRICULTURE");case 35:return n("FUEL_AND_ENERGY");case 41:case 42:case 43:return n("CONSTRUCTION");case 46:case 47:return n("TRADE");case 55:case 79:return n("TOURISM");case 62:return n("TECHNOLOGY");case 63:return n("CONSULTING_SERVICE");case 64:return n("BANK");case 65:return n("INSURER");case 66:return n("FINANCIAL_INSTITUTIONS");case 72:case 74:return n("SCIENCE");case 80:return n("SECURITY");case 84:return n(i<22?"GOVERNANCE":22===i?"ARMY":"OTHER_SECTORS");case 85:return n("EDUCATION");case 86:return n("HEALTHCARE");case 87:return n("SOCIAL_SPHERE");default:return n(a>=10&&a<=33?"INDUSTRY":a>=5&&a<=9?"FUEL_AND_ENERGY":a>=49&&a<=53?"TRANSPORT":"OTHER_SECTORS")}})(e?.employerActivities??[],l)),t?.("organization")?.onChange?.(((e,t,n)=>_s(e)("7725114488"===n?"RSHB":50102===t?"SOLE_TRADER":t>=75e3&&t<=75505&&75500!==t?"BUDGETARY":"COMMERCIAL"))(e?.organization??[],i,a)),t?.("employerOrganization")?.onChange?.(((e,t)=>{const n=_s(e);return[40001,40002,71610].includes(t)?n("FOREIGN"):n("RUSSIAN")})(e?.employerOrganization??[],i))},Os=d((({field:e,input:t})=>{const n=ul(),a=l((t=>{e?.("organizationName")?.onChange?.(t.data?.name?.short_with_opf),Ms(n,e,t)}),[]);return o(kn,{label:"ИНН",isInteger:!0,maxLength:12,...t,...la(e("inn"),ta.inn,t?.required),onDaDataChange:a})})),zs=d((({field:e})=>o(Ma,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),Fs=d((({field:e,input:t})=>o(kn,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",isInteger:!0,maxLength:2,...la(e("jobsNumber"),ta.jobsNumber,t?.required),...t}))),Vs=d((({field:e,input:t})=>o(kn,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...la(e("lastJobExperience"),ta.lastJobExperience,t?.required),...t}))),Ls=d((({field:e,input:t})=>o(kn,{label:"Наименование юридического лица",...t,...la(e("legalEntityName"),ta.legalEntityName,t?.required),disabled:!e?.("shareholderFlg")?.value}))),$s=d((({field:e,input:t})=>o(kn,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...la(e("legalForm"),ta.legalForm,t?.required),...t}))),qs="limitedBirthday",js=d((({field:e,input:t})=>o(jl,{label:"Дата рождения",...la(e(qs),ta.limitedBirthday,t?.required),disabled:t?.filledByEsia&&Sa(e,qs)}))),Us=`${Ut}/outservice`,Ws=[];async function Hs(){const e=await Pt(`${Us}/outserviceregions`);return e&&Array.isArray(e)?e:Ws}const Ys=d((({field:e,input:t})=>{const n=e("region"),a=n?.value?.key,{data:l}=ga("outServiceRegions",Hs),r=l?.find((e=>e.code===a))?.localities?.map((e=>({key:e,text:e})));return i((()=>{""!==a&&e?.("localities")?.onChange?.("")}),[a]),o(Mn,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:r,...la(e("localities"),ta.localities,t?.required),isSearch:!0})})),Gs=d((({field:e,input:t})=>o(kn,{label:"Обязательные выплаты",placeholder:"Введите значение",isInteger:!0,...la(e("mandatoryPayments"),ta.mandatoryPayments,t?.required),...t}))),Ks=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],Xs=d((({field:e,input:t})=>o(as,{orientation:"horizontal",items:Ks,...la(e("methodObtain"),ta.methodObtain,t?.required)}))),Js="middleName",Zs=d((({field:e,input:t})=>o(kn,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&Sa(e,Js),...la(e(Js),ta.middleName,t?.required),...t}))),Qs=d((({field:e,input:t})=>o(kn,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&Sa(e,t.name??""),...la(e("name"),ta.name,t?.required),...t}))),eo=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]}))),to=d((({field:e})=>oa(e("acquiringType")?.value?.key)?o(eo,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),no=d((({field:e,input:t})=>{const{data:n}=ji("ORGANIZATION_TYPE"),a=ul();return i((()=>{n&&(a.organization=n)}),[n]),o(hl,{field:e,source:a.organization??[],label:"Тип организации",fieldName:"organization",input:t})})),ao=d((({field:e,input:t})=>{const n=ul(),a=l((t=>{e?.("inn")?.onChange?.(t.data?.inn),Ms(n,e,t)}),[]);return o(kn,{label:"Наименование организации",...t,...la(e("organizationName"),ta.organizationName,t?.required),onDaDataChange:a})})),io=d((({field:e,input:t})=>o(kn,{label:"Иные доходы",placeholder:"Введите значение",isInteger:!0,...la(e("otherIncome"),ta.otherIncome,t?.required),...t}))),lo=d((({field:e,input:t})=>o(jl,{label:"Дата регистрации по месту жительства",...la(e("participantDateRegistration"),ta.participantDateRegistration,t?.required)}))),ro="partInBusiness",so=d((({field:e,input:t})=>{const n=l((t=>{e(ro)?.onChange?.(String(Number(t)>100?100:Number(t)||""))}),[]);return o(kn,{label:"Доля участия в бизнесе",placeholder:"в %",isInteger:!0,maxLength:3,...la(e(ro),ta.partInBusiness,t?.required),...t,onChange:n})})),oo=d((({field:e,input:t})=>{const{required:n,...a}=t;return o(kn,{...la(e("partnerComments"),ta.partnerComments,n),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...a})})),co=d((({field:e,input:t})=>{const{value:n,onChange:r}=e("paymentSystem"),[s]=Gl("programId"),[c,d]=a([]);i((()=>{s&&(async()=>{const e=await(async e=>{const t=await ni("/public-data/creditProgramConditions","POST",{creditProgramId:e});return t?.paymentSystems||[]})(s);d(e||[])})()}),[]);const m=l((e=>r?.(c?.find((t=>t.type===e)))),[c,r]);return o(as,{label:"Платежная система",orientation:"horizontal",items:mo(c),...la(e("paymentSystem"),ta.paymentSystem,t?.required),value:n?.type,onChange:m})})),mo=e=>e?.map((e=>({id:e.type,text:e.name})))??[],uo=e=>"_"===e,ho=e=>/\d/.test(e),po=e=>uo(e)||ho(e),go=[..."+7 (___) ___-__-__"],fo=go.findIndex(uo),xo=go.map(((e,t)=>po(e)?go.slice(0,t).filter(po).length:-1));function yo(e){const t=e.replace(/\D/g,""),n=go.map(((e,n)=>ho(e)?e:t.charAt(xo[n])||e)),a=xo.indexOf(t.length-1)+1;return(a?n.slice(0,Math.max(fo,a)):n).join("")}const bo=d((({children:e,onChange:t,...n})=>{const a=l((e=>t&&t(yo(e))),[t]),i=l((e=>{"+7 ("===e&&t&&t("")}),[]);return o(fn,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>i(e?.target?.value||""),children:e})})),vo=d((({className:e,label:t,error:n,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(bo,{"aria-label":t,label:mn({label:t,errors:a?.errors}),valid:Boolean(!n),placeholder:"+7 (___) ___-__-__",...a}),yn(n)]}))),No=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(vo,{label:"Телефон",...la(e(n),ta.phone,t?.required),disabled:t?.filledByEsia&&Sa(e,n),...t})})),wo=d((({field:e,input:t})=>{const{data:n}=ji("POSITION");return o(hl,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),Co=d((({field:e})=>oa(e("acquiringType")?.value?.key)?o(eo,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),So=d((({field:e,source:t})=>o(Mn,{placeholder:"Выберите продукт",label:"Продукт",options:ko(t?.productList),...ia(e("product"),ta.product)}))),ko=e=>(e??[]).map((e=>({key:e,value:e}))),Io=`${Ut}/outservice/outserviceregions`,To=`${Ut}/regions`,Ro=[];function Bo(e=To){const{data:t}=ga(e,Dt);return Array.isArray(t)?t:Ro}const Po=d((({field:e,input:t,params:n})=>{var a;const i=Bo((a=n?.typeForm,"OUTSERVICE"===a?Io:void 0));return o(Mn,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...la(e("region"),ta.region,t?.required)})})),Do=d((({field:e,input:t})=>{const n=va(!0),a=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(Mn,{label:"Регион",placeholder:"Выберите регион",options:a,...la(e("region"),ta.region,t?.required)})})),Ao=d((({field:e,input:t})=>{const{data:n}=ji("REGION_RF"),a=n?.map((({key:e,value:t})=>({key:e,text:t})));return o(Mn,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:a,...la(e("regionRetail"),ta.regionRetail,t?.required)})})),Eo=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})})),_o=d((({field:e})=>{const t=e("secondaryPhone");return o(vo,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?ia(t,ta.secondaryPhone):t})})),Mo=d((({field:e,input:t})=>o(Mn,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Rs,...la(e("serviceDirection"),ta.serviceDirection,t?.required)}))),Oo=["male","female"],zo=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],Fo=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 ni("/suggestions/suggest/fio","POST",{query:e,count:1,parts:["NAME"]}),n=t?.suggestions[0]?.data?.gender?.toLowerCase()||"";return Oo.includes(n)?n:""})(n);e&&l?.(e)})()}),[]),o(as,{label:"Пол",orientation:"horizontal",items:zo,...la(e("sex"),ta.sex,t?.required)})})),Vo=d((({field:e,input:t})=>o(Ma,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...la(e("shareholderFlg"),ta.shareholderFlg,t?.required)}))),Lo=d((({children:e,onChange:t,maxLength:n,...a})=>{const i=l((e=>n?e.length<=n&&t?.(Tl(e,"___-___-___ __")):t?.(Tl(e,"___-___-___ __"))),[t]),r=l((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(fn,{...a,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>r(e?.target?.value||""),children:e})})),$o=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(Lo,{"aria-label":t,label:mn({label:t,errors:r?.errors}),valid:Boolean(!a),value:n,onChange:i,onBlur:l,placeholder:"___-___-___ __",...r}),yn(a)]}))),qo=d((({field:e,input:t})=>o($o,{label:"СНИЛС",maxLength:14,...la(e("snils"),ta.snils,t?.required),...t}))),jo=d((({field:e,input:t})=>o(kn,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&Sa(e,"surname"),...la(e("surname"),ta.surname,t?.required),...t}))),Uo=["От 1 мес","До 15 лет"],Wo=d((({field:e})=>o(el,{title:"Срок, месяцев",items:Uo,min:1,max:180,...e("term")}))),Ho=d((({field:e,input:t})=>o(kn,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...la(e("totalIncome"),ta.totalIncome,t?.required),...t}))),Yo=d((({field:e,input:t})=>o(Mn,{label:"Тип обслуживания",options:Ts,...la(e("serviceType"),ta.serviceType,t?.required)}))),Go=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],Ko=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:Go,value:t,onChange:e=>n&&n(e)})})})),Xo=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 Jo={$ref:"/wcms-resources/outservice-productlist.json"},Zo={fullName:e=>o(Ds,{...e}),addressBranch:e=>o(wa,{...e}),desiredMeetingDate:e=>o(os,{...e}),product:e=>o(So,{...e,source:Jo}),localities:e=>o(Ys,{...e}),isClient:e=>o(zs,{...e}),partnerComments:e=>o(oo,{...e}),collectionCount:e=>o(Ql,{...e}),acquiringType:e=>o(sa,{...e}),onlineCheckout:e=>o(to,{...e}),posTerminal:e=>o(Co,{...e}),serviceType:e=>o(Yo,{...e}),term:e=>o(Wo,{...e}),amount:e=>o(il,{...e}),annualRevenue:e=>o(gl,{...e}),vedTypes:e=>o(Ko,{...e}),feedbackMethod:e=>o(Ps,{...e}),serviceDirection:e=>o(Mo,{...e}),bankEmpolee:e=>o(yl,{...e}),secondaryPhone:e=>o(_o,{...e}),applicationDate:e=>o(kn,{label:"Дата и время обращения в Банк",...e}),region:e=>Na(e?.params?.typeForm)?o(Do,{...e}):o(Po,{...e}),consentToReceiveMaterials:e=>o(hr,{...e}),surname:e=>o(jo,{...e}),name:e=>o(Qs,{...e}),middleName:e=>o(Zs,{...e}),birthday:e=>o(Wl,{...e}),phone:e=>o(No,{...e}),email:e=>o(bs,{...e}),inn:e=>o(Os,{...e}),comment:e=>o(er,{...e})},Qo={processPersonalDataFlg:e=>o(hr,{...e}),consentProviderFlg:e=>o(hr,{...e}),consentOthersFlg:e=>o(hr,{...e}),consentInformFlg:e=>o(hr,{...e}),consentPfrFlg:e=>o(hr,{...e}),organizationPhone:e=>o(No,{...e}),legalForm:e=>o($s,{...e}),organizationName:e=>o(ao,{...e}),generalSeniority:e=>o(As,{...e}),lastJobExperience:e=>o(Vs,{...e}),experience5Years:e=>o(Ss,{...e}),jobsNumber:e=>o(Fs,{...e}),beginDate:e=>o(Ul,{...e}),addressFact:e=>o(Ca,{...e}),organizationAddress:e=>o(ka,{...e}),sex:e=>o(Fo,{...e}),limitedBirthday:e=>o(js,{...e}),birthPlace:e=>o(Hl,{...e}),education:e=>o(ys,{...e}),housing:e=>o(Es,{...e}),employment:e=>o(ws,{...e}),organization:e=>o(no,{...e}),amountWorkers:e=>o(pl,{...e}),employerActivities:e=>o(vs,{...e}),employerOrganization:e=>o(Ns,{...e}),positionOrganization:e=>o(wo,{...e}),familyStatus:e=>o(Is,{...e}),children:e=>o(Jl,{...e}),familyMembers:e=>o(ks,{...e}),dependents:e=>o(ss,{...e}),totalIncome:e=>o(Ho,{...e}),expenses:e=>o(Cs,{...e}),snils:e=>o(qo,{...e}),conscription:e=>o(nr,{...e}),armyIdFlg:e=>o(fl,{...e}),dulSerie:e=>o(gs,{...e}),dulNumber:e=>o(ps,{...e}),dulIssueDateField:e=>o(ms,{...e}),dulSubdivisionCode:e=>o(xs,{...e}),dulIssuedBy:e=>o(hs,{...e}),addressRegistration:e=>o(ka,{...e}),addressCourier:e=>o(ka,{...e}),participantDateRegistration:e=>o(lo,{...e}),retirementIncome:e=>o(Eo,{...e}),otherIncome:e=>o(io,{...e}),wages:e=>o(Xo,{...e}),mandatoryPayments:e=>o(Gs,{...e}),disablePeopleFlg:e=>o(cs,{...e}),bankruptcyFlg:e=>o(bl,{...e}),shareholderFlg:e=>o(Vo,{...e}),legalEntityName:e=>o(Ls,{...e}),creditInRshbCd:e=>o(ns,{...e}),bankEmployeeCode:e=>o(xl,{...e}),partInBusiness:e=>o(so,{...e}),regionRetail:e=>o(Ao,{...e}),addressRetail:e=>o(Yi,{...e}),addressMatch:e=>o(Oa,{...e}),calculator:e=>o(ts,{...e})},ec={paymentSystem:e=>o(co,{...e}),currency:e=>o(ls,{...e}),cardCategory:e=>o(Kl,{...e}),codeWord:e=>o(Zl,{...e}),confirmationIncome:e=>o(tr,{...e}),methodObtain:e=>o(Xs,{...e}),deliveryDate:e=>o(rs,{...e})},tc=(e,t)=>(n,a)=>{const i={...Zo,...Qo,...ec};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:i[n?.name||""]?.({field:e,input:n,params:t})},String(a)):null},nc=e=>2===e?"@xl:grid-cols-2":"",ac=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(_e,{size:"text-h6",children:e})}):null,ic=d((({responseType:e,typeForm:t,onClose:n})=>{const a="OK"===e,i="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(cr,{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(sr,{type:"button",onClick:n,children:"Хорошо"})]})})})),lc=e=>t=>t&&Object.entries(e).flatMap((([e,n])=>n(t[e])))||[],rc=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,...oc(o),...sc(c),...m?{partnerComments:m}:{},...s?{typeForm:s}:{}};return Object.fromEntries(Object.entries(u)?.map((([e,t])=>[e,t?.key||t])))},sc=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},oc=e=>e?{vedTypes:Object.fromEntries(Go.map((({id:t})=>[t,t===e])))}:{},cc={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:ra[0],serviceType:Ts[0],feedbackMethod:Bs[0],serviceDirection:Rs[0],vedTypes:Go[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},dc=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]}))),mc=(e,t)=>o(sr,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),uc=(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(dc,{link:t})]}),yn(ia(e,Gn).error)]}):o(dc,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),mc(n)]}),hc={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),...Gt(l,g),...Wt(i),...Ht(s,"desiredMeetingDate"),...g?Ht(r):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...Kt(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}}},pc=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||cc[e.name||""]])));return n?.serviceType&&"PREMIUMSERVICE"===t&&(n.serviceType=Ts[1]),{...n,typeForm:{key:t,text:""}}})(x,n),[b,v]=a(""),w=sn(ic),C=l((async(e,t)=>{const a=gc(x,e),i=lc(aa(a));if(!On(i(e)))return console.warn("validation fail");const l=rc({...e,...h}),r=await hc.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(nc(e.columns),"grid gap-x-m"),children:[ac(e.title),(e?.inputs||[])?.map(tc(S,{typeForm:n}))]},`section-${t}`))),uc(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]})})),gc=(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)})))),fc=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(ri,{isFoldButtonOnTop:!0,unfoldedByDefault:!0,renderFoldableSection:({isUnfolded:a})=>o(si,{isUnfolded:a,className:"flex flex-col pl-2xl",children:e.map(tc(n,{typeForm:t}))}),renderFoldButton:xc(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?"Отметьте все обязательные соглашения":"")]}))})})})),xc=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"})})]}),yc=({field:e,typeForm:t="",inputs:n})=>{const{consentInputs:a,restInputs:i}=bc(n||[]);return a.length>2?c("div",{children:[i.map(tc(e,{typeForm:t})),o(fc,{inputs:a,field:e})]}):(n||[])?.map(tc(e,{typeForm:t}))},bc=e=>({consentInputs:e?.filter((e=>Object.keys(ar).includes(e.name||"")))||[],restInputs:e?.filter((e=>!Object.keys(ar).includes(e.name||"")))||[]}),vc=[{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"}]}],Nc=(e,t)=>o(sr,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),wc=e=>ai("/user-data/updateUserProfile","PUT",e),Cc=e=>ai("/user-data/updateUserTask","PUT",e),Sc=(e,t)=>Boolean(e)&&"string"!=typeof e&&Boolean(e?.errorMessage?.startsWith(`Too many request for phoneNumber [${t}]`)),kc={width:"118",height:"24"},Ic={"bg-white":"color",transparent:"white"},Tc={"bg-white":"text-primary-main",transparent:"text-white"},Rc=(e,t,n)=>o(ne,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:Ic[e]},className:Tc[e],width:n?.width,height:n?.height}),Bc={"bg-white":"text-primary-text",transparent:"text-white"},Pc=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:[Rc(l,n?.image,kc),r?a??o("div",{className:"ml-s",children:o(_e,{font:"font-medium",color:Bc[l],size:"",children:n?.title??"Россельхозбанк"})}):null]}))),Dc=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},ai("/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=>ai(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?await e.blob():new Blob)))(e)))})()}),[]);return i(g,[]),o(cr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",head:o(Pc,{}),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(sr,{onClick:close,version:"secondary",children:"Вернуться"}),o(sr,{type:"submit",disabled:!d,onClick:p,version:"secondary",children:"Отправить"})]})]})})})),Ac=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:Ec(e)})))),Ec=e=>`${`${Math.floor(e/60)}`.padStart(2,"0")}:${(""+e%60).padStart(2,"0")}`,_c=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:Mc(a,e,n)},a)))}),n?o("div",{className:"text-error",children:r}):null]})})),Mc=(e,t,n=!1)=>{const a=!t[e];return`w-16 sm:w-20 h-24 text-5xl text-center p-md m-2 border ${pn(!n||!a)} rounded-md caret-transparent outline-none`},Oc=d((({isDisabled:e,onClick:t,text:n})=>o(sr,{type:"button",onClick:t,disabled:e,children:o(_e,{font:"font-normal",children:n})}))),zc=e=>{e&&(globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token))},Fc=({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=>ni("/sms/checkCode","POST",e).then(zc))({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}},Vc=d((({phone:e,code:t=!0,codeLength:n=4,consents:r,onSuccess:s=un,onClose:d=un})=>{const[m,u]=a(Array(n).fill("")),{handleSubmit:h,hasError:p,errorText:g,isLoading:f,timeNextReq:x,isSubmitButtonDisabled:y,setTimeNextReq:b,setIsTimerStarted:v,setAttempts:N}=Fc({values:m,onSuccess:s}),w=sn(Dc),C=jt(e),k=l((async()=>{var e;await(e={phoneNumber:C,smsCodesSetName:{key:"AUTHENTICATION"}},ni("/sms/sendCode","POST",e).then((t=>!Sc(t,e.phoneNumber))))?(N(0),b(180),v(!0)):w.open({phoneNumber:C,sendCode:k,onClose:d})}),[C,d]);return i((()=>{k()}),[]),o(cr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl p-m",onClose:d,children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[o(S,{className:"w-full",title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),t?o(_c,{values:m,setValues:u,errorText:g,hasError:p}):null,$c(x,b,k),c(Ae,{itemSize:"list-s",children:[o("span",{children:"Вводя код, я подтверждаю, что ознакомлен и подписываю: "}),o("ul",{children:r?.map(((e,t)=>o("li",{children:e},`${e}-${t}`)))})]}),Lc(y,h),f?o(za,{blur:!1}):null]})})})),Lc=(e,t)=>o(Oc,{text:"Далее",isDisabled:e,onClick:t}),$c=(e,t,n)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(Ac,{className:"text-base ml-1",time:e,setTime:t})]}):o(Ne,{onClick:n,className:"text-primary-main",children:"Получить новый код"}),qc={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},jc={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},Uc=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],Wc=d((({onSubmit:e=un,onClose:t=un})=>{const[n,i]=a(""),[r,s]=a(!1),d=mr(2),m=l((()=>{e(n)}),[e,n]),u=l((e=>{i(e),"REFUSE"===e&&s(!0)}),[]),h=r?jc:qc;return o(cr,{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(Br,{className:"whitespace-normal",orientation:"horizontal",items:Uc,value:n,onChange:u}),o(sr,{disabled:!n,type:"button",onClick:m,children:"Далее"})]})})})),Hc=()=>ml(),Yc=(e,t)=>l((n=>{const a=n instanceof Function?n(e[t]):n;null!=a?e[t]=a:delete e[t]}),[e,t]),Gc=d((({title:e,icon:t,description:n,onClick:a=un})=>c("button",{className:"flex gap-lg items-center border border-gray rounded-md cursor-pointer p-4 hover:border-green",type:"button",onClick:a,children:[o(ne,{image:{src:t},width:"78",height:"78"}),c("div",{children:[o(N,{className:"text-left",title:e,headingType:"h5"}),n?o(w,{color:"text-secondary-text",size:"text-m",children:n}):null]})]}))),Kc={credit_cash:"10",credit_cash_single_doc:"28",credit_mcx:"39",family_offer_credit:"41",gas_engine_fuel:"33",pension_credit:"12",ref_credit:"11",ref_credit_single_doc:"29",self_employed:"34",summer_cash:"35",summer_cash_pens:"36"},Xc={...Kc,amur_card:"14",owner_card:"13",travel_card:"15"},Jc=e=>{const t=e?.find((e=>"WAGES"===e.incomeTypeCd.key))?.value,n=e?.find((e=>"MANDATORY_PAYMENTS"===e.incomeTypeCd.key))?.value,a=e?.find((e=>"INCOME_AVERAGE"===e.incomeTypeCd.key))?.value,i=e?.find((e=>"ADDITIONAL_INCOME"===e.incomeTypeCd.key))?.value,l=e?.find((e=>"OTHER_INCOME"===e.incomeTypeCd.key))?.value,r=e?.find((e=>"OTHER_PAYMENTS"===e.incomeTypeCd.key))?.value,s=e?.find((e=>"RENTAL_INCOME"===e.incomeTypeCd.key))?.value,o=e?.find((e=>"RETIREMENT_INCOME"===e.incomeTypeCd.key))?.value;return{wages:t,mandatoryPayments:n,incomeAverage:a,additionalIncome:i,otherIncome:l,otherPayments:r,rentalIncome:s,retirementIncome:o}},Zc=e=>{const t=e?.find((e=>"REGISTRATION"===e.addressType.key)),n=e?.find((e=>"RESIDENTAL"===e.addressType.key)),a=e?.find((e=>"WORK"===e.addressType.key));return{addressRegistration:t,addressFact:n,organizationAddress:a}},Qc=e=>{const t=e?.find((e=>"EMAIL"===e.contactTypeCd.key))?.value,n=e?.find((e=>"MAIN_PHONE"===e.contactTypeCd.key))?.value,a=e?.find((e=>"ORGANIZATION_PHONE"===e.contactTypeCd.key))?.value;return{email:t,phone:n,organizationPhone:a}},ed=e=>e?.key?{key:e.key,text:e.value}:void 0,td=d((function({task:e,isFromLead:t=!1,onClose:n=un}){const a=Hc(),i=Yc(a,"leadForm"),r=Jt(),{participants:s,creditProgram:d,id:m}=e,u=Xc[d.code],h=Boolean(Kc[d.code]),p=h?"/credit-lead":"/credit-card-lead",{name:g,midname:f,id:x,profile:y}=s[0],b=l((()=>{const t=(e=>{const t=e.participants[0],{loanAmount:n,creditPeriod:a,paymentTypeCd:i}=e,{currencyCode:l,paymentSystemTypeCd:r,classCard:s,codeWord:o,birthDate:c,midname:d,name:m,surname:u,birthPlace:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:x,dulSubdivisionCode:y,educationLevelCd:b,registrationDate:v,houseTypeCd:N,genderCd:w,participantContacts:C=[],participantAddresses:S=[],employmentContractDate:k,employmentTypeCd:I,organizationName:T,organizationInn:R,organizationActivityTypeCd:B,organizationTypeCd:P,organizationKindCd:D,employeesNumberCd:A,opf:E,seniority:_,generalSeniority:M,jobsNumber:O,lastWorkDuration:z,positionCd:F,maritalStatusCd:V,childrenDependents:L,totalDependents:$,otherDependents:q,militaryStatusCd:j,participantIncomes:U,snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:G,nameLegalEntity:K,creditInRshbCd:X,payrollCardRshbFlg:J,consentInsuranceFlg:Z}=t;return{currency:l?.key,paymentSystem:r,cardCategory:ed(s),codeWord:o,limitedBirthday:c,middleName:d,name:m,surname:u,birthPlace:h,dulIssueDateField:p,dulIssuedBy:g,dulNumber:f,dulSerie:x,dulSubdivisionCode:y,education:ed(b),participantDateRegistration:v,housing:ed(N),beginDate:k,employment:ed(I),organizationName:T,inn:R,employerActivities:ed(B),organization:ed(P),employerOrganization:ed(D),amountWorkers:ed(A),legalForm:E,generalSeniority:_?.toString(),experience5Years:M?.toString(),jobsNumber:O?.toString(),lastJobExperience:z?.toString(),positionOrganization:ed(F),familyStatus:ed(V),children:L?.toString(),familyMembers:$?.toString(),dependents:q?.toString(),conscription:ed(j),snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:G,legalEntityName:K,creditInRshbCd:ed(X),calculator:{isInsurance:J,isSalaryClient:Z,moneyValue:n,monthsValue:a,isAnnuity:"ANNUITY"===i?.key},...Jc(U),...Zc(S),...Qc(C),...(Q=w,Q?.key?{sex:"MAN"===Q.key?"male":"female"}:null)};var Q})(e);a.participantId=x,a.taskId=m,a.profileId=y?.id,a.programId=u,i(t),r.assign(p)}),[]),v=l((()=>{r.assign(h?"/natural/loans/all-goals":"/natural/creditcards/svoya")}),[]),w=l((()=>{r.assign("/")}),[]);return o(cr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:n,children:c("div",{className:"flex flex-col gap-lg",children:[o(N,{className:"whitespace-pre-wrap",title:`${g&&f?`${g} ${f}, `:""}мы нашли черновик вашей заявки.\nПродолжите заполнение?`,headingType:"h5"}),o(Gc,{title:"Перейти к черновику",icon:"api/v1/wcms-file-storage/72d06937-5d8b-4996-9503-52389b93919e/file.svg",description:"Продолжайте заполнять заявку из черновика",onClick:b}),o(Gc,{title:t?"Продолжить заполнение текущей заявки":"Заполнить новую заявку",icon:"api/v1/wcms-file-storage/796c3e8d-341a-480b-b52f-3aa5784ed623/file.svg",onClick:t?n:v}),o(sr,{type:"button",version:"secondary",className:"w-full text-h5",onClick:w,children:"Вернуться на главную"})]})})})),nd=d((function({onClose:e=un}){const t=Jt(),n=l((()=>{t.assign("/natural/loans/all-goals")}),[]),a=l((()=>{t.assign("/")}),[]);return o(cr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:e,children:c("div",{className:"flex flex-col gap-lg",children:[o(N,{className:"text-center",title:"Заявки не найдены",headingType:"h3"}),o(w,{size:"text-l",align:"text-center",children:"По данному номеру не найдено незавершенных заявок. Вы можете заполнить новую заявку или вернуться на главную страницу"}),o(sr,{type:"button",className:"w-full",onClick:n,children:"Заполнить новую заявку"}),o(sr,{type:"button",version:"secondary",className:"w-full",onClick:a,children:"Вернуться на главную"})]})})})),ad=d((({onClose:e})=>{const t=Jt(),[n,a]=Gl("leadForm"),i=l((async()=>{const e=await(n={redirectUri:t.href},ni("/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(cr,{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(sr,{type:"button",onClick:i,children:"Заполнить через Госуслуги"}),o(sr,{type:"button",version:"secondary",onClick:r,children:"Пропустить"})]})]})})})),id={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},ld={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK"},rd={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},sd=e=>Object.entries(e).reduce(((e,[t,n])=>t in id?[...e,{contactTypeCd:{key:id[t]},value:n}]:e),[]),od=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in ld){const a=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:ld[t]},...a}]}return e}),[]),cd=e=>Object.entries(e).reduce(((e,[t,n])=>t in rd?[...e,{incomeTypeCd:{key:rd[t]},value:Number(n||0)}]:e),[]),dd=({inputs:e,programId:t,nextStepLink:n})=>{const[i,r]=a(""),s=(()=>{const e=Hc(),t=Yc(e,"leadForm");return l((({participantId:n,taskId:a,profileId:i,formData:l,programId:r})=>{e.participantId=n,e.taskId=a,e.profileId=i,e.programId=r,t(l)}),[])})(),o=(e=>{const{open:t}=sn(ad),n=Jt();return l((()=>{t({onClose:()=>n.assign(e)})}),[t,e])})(n),c=(e=>{const{open:t}=sn(Wc),n=sn(Vc),a=t=>async n=>{try{t&&await wc({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()}catch(e){console.log(e)}},i=(t,i)=>async l=>{"SIGNED"===l&&t?n.open({phone:t,consents:["согласие на запрос информации в БКИ"],onSuccess:a(i)}):e()};return{open:(n,a)=>t({onSubmit:i(n,a),onClose:e})}})(o),d=sn(Vc),m=(()=>{const{open:e}=sn(td),{open:t}=sn(nd);return{open:({task:n,isFromLead:a,onClose:i})=>{n?e({task:n,isFromLead:a,onClose:i}):t({})}}})();return{handleSubmit:l((async n=>{const a=lc(aa(e));var i;if(On(a(n)))try{const e=await(i={profile:{phone:jt(n.phone)}},ni("/public-data/createUserProfile","POST",i).then((e=>e?.profile?.id||null)));if(e&&n?.phone){const a=async()=>{await md({programId:t,profileId:e,formData:n,saveUserData:s}),d.close(),c.open(n.phone,e)},i=async()=>{try{const n=await(async e=>{const t=await ni("/user-data/getLastStatus","POST",e);return"DRAFT"===t?.statusCd?t?.taskId:null})({profileId:e,programId:t});if(n){const e=await(async e=>await ni("/user-data/getTaskById","POST",e)||void 0)({taskId:n});d.close(),m.open({task:e,isFromLead:!0,onClose:a})}else await a()}catch{r("Fail")}},l=Object.keys(ar).filter((e=>n[e])).map((e=>ar[e]?.text));d.open({phone:n?.phone,consents:l,onSuccess:i})}}catch{r("Fail")}}),[]),responseStatus:i}},md=async({programId:e,profileId:t,formData:n,saveUserData:a})=>{const i=ud(n);await wc(((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,i));const{taskId:l,participantId:r}=await(async e=>await ni("/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:sd({phone:o&&jt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}]}}})({participantId:r,taskId:l,profileId:t,formData:i}))}catch(e){console.log(e)}a({participantId:r,taskId:l,profileId:t,programId:e,formData:n})},ud=e=>{const{consentOthersFlg:t,...n}=e;return{...n,consentCollectionFlg:t,consentAssignmentClaimsFlg:t,consentPhotoFlg:t}},hd={typeForm:"",region:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",organizationPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:ra[0],serviceType:Ts[0],feedbackMethod:Bs[0],serviceDirection:Rs[0],vedTypes:Go[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:{name:"",type:""},cardCategory:{key:"",text:""},codeWord:"",addressRetail:{key:"",text:""}},pd=(e,t)=>{if(t)return{...t,limitedBirthday:new Date(t?.limitedBirthday||0)};return{...Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||hd[e.name||""]]))),typeForm:{key:"",text:""}}},gd=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:yo(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:fd(i),addressFact:fd(l),esiaAccountTypeCd:t?.esiaAccountType}},fd=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}},xd=(e,t)=>{const n=Jt(),[a,{setTrue:s,setFalse:o}]=on(!1),c=Hc(),d=Yc(c,"leadForm"),m=r((()=>pd(e,c.leadForm)),[e,c.leadForm]),u=l((async(e,a,i)=>{s();try{const r=await(l={profileId:e,code:a,state:i,redirectUri:globalThis.location?.href},ni("/esia/updateProfileEsia","POST",l));r&&d((e=>({...e,...gd(r)}))),n.assign(t)}finally{o()}var l}),[t]);return i((()=>{const e=Yl(globalThis.localStorage?.getItem("profileId")??""),t=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),n=t.get("code"),a=t.get("state");e&&n&&a?u(e,n,a):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),[m,{isLoading:a}]},yd=d((({className:e,title:t,programId:n="",nextStepLink:a="/credit-lead",button:l,...s})=>{const d=r((()=>vc?.flatMap((e=>e?.inputs))||[]),[vc]),[m,{isLoading:h}]=xd(d,a),{handleSubmit:p,responseStatus:g}=dd({inputs:d,programId:n,nextStepLink:a}),[,{field:f,onSubmit:x}]=an(m,{onSubmit:p}),y=sn(ic);return i((()=>{g&&y.open({responseType:g})}),[g]),o(rn,{className:u("container space-y-m",e),title:t,...s,children:c("form",{onSubmit:x,className:"space-y-m relative",children:[h?o(za,{blur:!1}):null,vc.map(((e,t)=>c("div",{className:u(nc(e.columns),"grid gap-x-m"),children:[ac(e.title),yc({field:f,inputs:e?.inputs})]},`section-${t}`))),Nc(l)]})})})),bd=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"})]})})),vd=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",Nd=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`}),wd=10;function Cd(e,{sensitivity:t,rootRef:n}={}){const a=s(null),l=r((()=>({threshold:Sd(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 Sd(e=0){const t=Math.round(e*wd);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const kd=d((({className:e,style:t,idx:n,activeIndex:a,observerOptions:i,children:r,onIntersection:s})=>{const c=Cd(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})})),Id=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],Td=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(Bd(n))}),[g,f]),v=i>0?r*Number(i)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?Rd(c,v):{},...N?Nd(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(kd,{className:u(m,i?Id[i-1]:"",{"h-full":N},t),style:w?Rd(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})),Rd=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Bd=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Pd={"horizontal-list":"w-6","vertical-list":"h-6"},Dd=({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?Pd[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(i)},String(i)),Ad=({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))},Ed=e=>t=>e.scrollWidth/t,_d=e=>(t,n)=>{e.scrollBy({left:n*Ed(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?[Fr()(i),Or()(i)]:[-1,-1],m=c>0,u=d<e-1,h=l((()=>{var t;n.current&&(m?_d(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=l((()=>{n.current&&(u?_d(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}]},Od={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},zd=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=Fd(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(Td,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(Ad({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",Od[a],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(Dd({activeIndex:t,onClick:f,listType:a}))}):null})),Fd=(e=!1)=>({behavior:e?"auto":"smooth"}),Vd=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"})}))),Ld=d((e=>o(Vd,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),$d=d((e=>o(Vd,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),qd="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",jd=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?Ud(t):null,l?o(Ld,{className:u(Wd(i),m?"left-1":"left-0"),onClick:s}):null,r?o($d,{className:u(Wd(i),m?"right-1":"right-0"),onClick:d}):null]})})),Ud=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(qd,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(qd,"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)]"),Hd=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(Td,{containerRef:b,activeIndex:N,visibleItemCount:i,gap:n,padding:a,listType:l,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(jd,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(zd,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:y,listType:l,version:t,navButtons:x,containerRef:b,containerScroll:v})]})})),Yd=({blocksToRender:e,...t})=>o(Hd,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:B(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",vd(!0)),children:T(e,t)},String(n))})}),Gd=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]}))),Xd=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}))),Jd=({isUnfolded:e,onToggle:t})=>o(Xd,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Zd=["ArrowDownIcon","ArrowUpIcon"],Qd="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",em=({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(Qd),children:[B(l,{...i.options,parent:n}),Gd(l.length)?o(Lt,{className:"col-span-6",...i}):null]}),o(ri,{renderFoldableSection:({isUnfolded:e})=>c(si,{className:u(Qd),isUnfolded:e,children:[B(r,{...i.options,parent:n}),Gd(r.length)?o(Lt,{className:"col-span-6",...i}):null]}),renderFoldButton:({isUnfolded:n,onToggle:a})=>o(Xd,{className:u({hidden:e<1}),disabled:!r?.length,label:t,icon:Zd[Number(n)],dataTheme:i.options?.page?.colorPalette,onClick:a})})]})},tm=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...a})=>{switch(e?.view){case"grid":return c("div",{children:[nm(n,t),em({...e,...a,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[nm(n,t),Yd({...a,blocksToRender:t})]});default:return null}})),nm=(e,t)=>e&&!t.length?o(bd,{...e}):null,am=e=>t=>t.reduce(((t,n,a)=>t.length?t.concat({...e,key:`sep-${a}`},n):[n]),[]),im=d((({value:e,onChange:t,items:n=[],multiple:a})=>n.map((n=>o(eo,{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))))),lm=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,am(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(rm(a)).filter(Boolean))]}),n?o("div",{children:o(sr,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:i,children:n?.text})}):null]}))),rm=e=>([t,n])=>{const a=n?.type;return"array"===a?sm(t,e)(n):null},sm=(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(im,{items:a,multiple:!n?.single,...t(e)})]},e)};function om(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const cm=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,dm=(e,t)=>Object.entries(e).map((([n,a])=>"number"==typeof a?Array.isArray(t[n])?((e,t)=>n=>cm(t[e])||cm(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>cm(t[e])||cm(n[e])||mm(t[e])<=mm(n[e]))(n,e):"object"==typeof a&&"min"in a&&"max"in a?((e,t)=>n=>cm(t[e])||cm(n[e])||mm(t[e]?.min)>=mm(n[e]?.min)&&mm(t[e]?.min)<=mm(n[e]?.max))(n,e):Array.isArray(a)?((e,t)=>n=>cm(t[e])||cm(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>cm(t[e])||cm(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),mm=e=>Number(e||0),um=(e,{block:t,page:n,normalize:a=nn})=>{const i=t?.blocks||[],[l,{field:s,reset:o,update:c}]=an(e),d=r((()=>om(i,i.map((e=>Mt(e.content,n?.fallback))))),[i,n?.fallback]),m=l===e?i:((e,t)=>(n=nn)=>e?.filter((([,e])=>dm(t,n(e)||{}))).map((([e])=>e)))(d,l)(a);return[l,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},hm={},pm={},gm=Ft((({className:e,filtrationSchema:t=hm,consumerField:n={},resetButton:a,...i})=>{const[,{blocksToRender:l},{field:r,reset:s}]=um(pm,{block:i.block,page:i.options?.page}),d=o(Dn,{className:"w-64",label:n?.title,options:fm(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>fm(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...i,children:[o(lm,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(sr,{type:"reset",className:"mt-lg w-64",onClick:s,version:a?.version,children:a?.text})})]})}),o(tm,{blocksToRender:l,...i})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),fm=e=>om(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),xm=(e=!1)=>e?"text-left":"text-center",ym={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},bm=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",ym[n],e),children:o(W,{...l,width:"54%",height:"54%",name:i})}):null})),vm=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:xm(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(Nm)}):null]})})),Nm=({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(bm,{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(Ae,{__html:n,isDotted:i,itemSize:"list-s"}):null]}):null]},String(r)),wm=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)),Cm=(e,t,n)=>o("div",{className:`grid gap-2xs ${Sm(t)}`,children:e.map(wm(n))}),Sm=e=>{switch(e){case"3":return"grid-cols-3";case"4":return"grid-cols-4";default:return"grid-cols-5"}},km=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?Cm(e,a,t):null]}))),Im={start:"justify-start",center:"justify-center",end:"justify-end"},Tm=d((({buttons:e,className:t="",align:n,...a})=>{const i=n&&u("flex",Im[n]);return o(g,{className:u("!bg-transparent",i,t),defaultPadding:"p-0",...a,children:qe(e)})})),Rm=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]})]}))),Bm=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:"Процентная ставка не найдена, выберите другие параметры"})})]}))),Pm=({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(Rm,{title:e,rate:t,unit:n,fractionDigits:a,color:i,...r})}),o(vr,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:a,fixed:!0,color:i,...r}),l]}):o(Bm,{title:e,...r}),Dm={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Am={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Em=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:a}=e,[i,l]=((e,t,n)=>{const{maxBonus:a=5e3,prefMonthsNum:i=Dm.prefMonthsNum,prefTravelBonusRate:l=Dm.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||Am,n,a);return{...t,...e,monthBonus:i,yearBonus:l}},_m=Ft((({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}=Em(r,n);return o(gr,{className:e,title:t,...l,children:c("section",{className:u(fr,e),children:[c("div",{className:xr,children:[Ar({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),Ar({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?Pm({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:yr,children:[f>=0?o(vr,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,qe(a,{isVertical:!0}),kr(i)]})]})})})),Mm=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,Om=e=>Pr({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),zm=" (c капитализацией)",Fm=({income:e,finalSum:t,postfix:n="₽",buttons:a=[],footnotes:i=[],isCapitalization:l=!1})=>c("div",{className:yr,children:[o(vr,{title:`Доход в конце срока${l?zm:""}`,value:e,postfix:n,prefix:"+"}),o(vr,{title:`Сумма в конце срока${l?zm:""}`,value:t,postfix:n}),qe(a,{isVertical:!0}),i?.map(kr)]}),Vm={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const Lm={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},$m=(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?Vm[e?.rateType]:"",{data:n}=ga(t?`${Ut}/depositrates/${t}`:null,Dt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&qm(s,e)&&qr(a,["minSum","maxSum"],e)&&qr(n,["minDays","maxDays"],e)))||Lm,{rate:m}=d,u=jm(m,e),h=a+u,p=c||[Lm];return{...d,...$r(["minSum","maxSum"],p),...$r(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},qm=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,jm=(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)},Um=Ft((({className:e="",title:t,buttons:n,footnote:a,bottomFootnote:i,isShowDepositeName:l,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=an({moneyValue:Cr(r,1e5),daysValue:Sr(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=$m(m,s),{income:g,finalSum:f,rate:x,depositeName:y}=p;return o(gr,{className:e,title:t,...d,children:c("section",{className:u(fr,e),children:[c("div",{className:xr,children:[Ar({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(el,{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:[Wm(p,h),Om({title:"Выплата процентов",orientation:"vertical",...h("isMonthlyInterestPayment"),className:"sm:flex-col"})]})]}),Pm({rate:x,depositeName:y,isShowDepositeName:l}),Fm({income:g,finalSum:f,buttons:n,footnotes:[a,i]})]})});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(Pa,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(Pa,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),Hm=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},Ym={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},Gm=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,l=t?.[0]?Jm(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=>[Xm({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),Xm({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),Xm({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),Xm({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,qr(a,["minSum","maxSum"],t),qr(i||l,["minMonths","maxMonths"],t)].every(Boolean)))||Ym,{rate:u}=m,h=Km(u,e),p=a+h,g=t||[Ym];return{...m,...$r(["minSum","maxSum"],g),...$r(["minMonths","maxMonths"],g),availableMonths:Hm(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)},Xm=({row:e,userInputParams:t,paramKey:n,isExclude:a})=>a||t[n]===e[n],Jm=(e,t)=>e+Math.round((t-e)/2),Zm=(e="rub")=>"rub"===e,Qm=(e,t)=>{const{minMonths:n,maxMonths:a}=$r(["minMonths","maxMonths"],au(t,e?.currency)),i=e.monthsValue||Math.round((n+a)/2);return{monthsValue:Ki(i,n,a)}},eu=(e,t)=>{const{minSum:n,maxSum:a}=$r(["minSum","maxSum"],au(t,e?.currency)),i=e.moneyValue||n;return{moneyValue:Ki(i,n,a)}},tu=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),nu=e=>{const t=Zm(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},au=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},iu=(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?Pr({title:"Пополнение",...t("isReplenish"),value:e.isReplenish,orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,e.isShowWithdrawn?Pr({title:"Снятие",...t("isWithdrawn"),value:e.isWithdrawn,orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null]}),lu(e.isShowReplenish||e.isShowWithdrawn),c("div",{className:"flex gap-lg",children:[e.isShowMonthlyInterestPayment?Om({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment,orientation:"vertical"}):null,e.isShowRemoteRegistration?(a={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration,orientation:"vertical"},Pr({...a,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]}),lu(e.isShowNewClient),e.isShowNewClient?o(Pa,{text:"Новый вкладчик",...t("isNewClient")}):null]});var a},lu=(e=!1)=>e?o("div",{className:"border-b border-main-divider w-full"}):null,ru={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum"},su={text:"₽",key:"rub"},ou=Ft((({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))??[su],g=l((e=>t=>e?{...t,...nu(t),...eu(t,e),...Qm(t,e),...tu(t,e)}:t)(h),[h]),[f,{field:x}]=an({moneyValue:Cr(d,2e4),monthsValue:Sr(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:su},{normalize:g}),y=x?.("currency")?.value??su,b=x?.("isNewClient")?.value,v=au(h,y),N=Gm(f,v,s),{rate:w,income:C,finalSum:S,type:k=""}=N,I=l((()=>{Er({field:x,defParams:Nr(v,b),calcParams:N,monthsValue:"minMonths",map:ru})}),[x,h]);i((()=>{!Yr(d)&&v&&I()}),[d,h]);const T=w===Nr(v,b)?.rate;return o(gr,{className:e,title:t,...m,children:c("section",{className:u(fr,e),children:[c("div",{className:xr,children:[c("div",{className:"flex gap-m",children:[Ar({className:"w-full",title:`Сумма, ${y?.text}`,min:N.minSum,max:N.maxSum,...x("moneyValue"),value:N.moneyValue,postfix:y?.text,step:cu(y?.key)}),h&&h?.length>1?o(Mn,{label:"Валюта",options:p,...x("currency")}):null]}),Ir({title:"Срок, месяцев",min:N.minMonths,max:N.maxMonths,availableMonths:N.availableMonths,...x("monthsValue"),value:N.monthsValue}),iu({...N,...s},x)]}),Pm({rate:w,children:mu(I,T)}),Fm({income:C,finalSum:S,buttons:[...a,du(n?.buttons,k)],footnotes:[r],postfix:y?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),cu=(e="")=>Zm(e)?1e3:100,du=(e=[],t="")=>{const{type:n,...a}=e.find((e=>e.type===t))??{};return a},mu=(e,t=!1)=>t?null:o(sr,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),uu=e=>hu({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&hu({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),hu=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],pu={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},gu=(e,t,n)=>{const{moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r}=e,s=t?.rateRows||[pu],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>uu({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Lr(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Lr(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r})=>e?.find((e=>uu({row:e,userInputParams:t,paramsViewSettings:n})&&qr(a+r,["minSum","maxSum"],e)&&qr(l,["minSumOld","maxSumOld"],e)&&qr(r,["minSumExtra","maxSumExtra"],e)&&qr(i,["minMonths","maxMonths"],e)))||pu)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r}),{rate:p}=h,g=_r(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}},fu=Ft((({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=gu(s,n,l),h=Dr({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")});return o(gr,{className:e,title:t,...r,children:c("section",{className:u(fr,e),children:[c("div",{className:xr,children:[Ar({title:"Остаток долга в других банках, ₽ ",step:500,min:m.minSum,max:m.maxSum-m.maxSumExtra,...d("moneyValue"),value:m.moneyValue}),Ar({title:"Ежемесячный платёж в других банках, ₽",step:500,min:m.minSumOld,max:m.maxSumOld,...d("oldMonthlyPayment"),value:m.oldMonthlyPayment}),Ir({title:"Новый срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),xu({...m,...l},d),m.isExtraMoney?Ar({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(yr,"@4xl:w-1/2"),children:[o(vr,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(vr,{title:"Ставка",value:m?.rate,fractionDigits:2,postfix:"%"}),o(vr,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),m.benefit>0?o(vr,{title:"Выгода в месяц",value:m.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:h}),qe(a,{isVertical:!0}),kr(i)]})]})})})),xu=(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})]}),yu=d((e=>{const{onChange:t,min:n,max:a,defaultValue:i="0",fractionDigits:r=0,...s}=e,c=Gi(e,{normalize:(e=i)=>n&&a?String(Ki(Number(bu(e)),n,a)):bu(e),format:He(r)}),d=l((e=>t&&t(bu(e))),[t]);return o(fn,{onChange:d,...s,...c})})),bu=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),vu=d((e=>o(yu,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(_e,{size:"text-xl",font:"font-light",children:"₽"})})}))),Nu={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},wu={amount:1500},Cu=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:l,formType:r="private",...s})=>{const[{amount:d},{field:m}]=an(wu),[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:Nu[r],children:[o(vu,{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(sr,{className:"w-full mt-lg",type:"submit",disabled:h,children:l.text}):null]})]})})),Su=({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})]}),ku="relative h-full",Iu={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},Tu=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...a})=>{const{blocks:i}=a.block||{},l=i?.some(Pu),r=n?{defaultPadding:"p-6xl pb-m"}:{};return P({...a,renderProps:(n,a,i)=>c("div",{className:Ru(n,{someCardsHighlighted:l}),children:[T(n,a,{className:Bu(n,{someCardsHighlighted:l,showBorder:!e,cardSize:t}),...r,blockIndex:i}),Pu(n)?Su({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},Ru=(e,{someCardsHighlighted:t})=>u(ku,t&&(Pu(e)?"pt-3xl":"pt-3xl sm:pt-16")),Bu=(e,{someCardsHighlighted:t,showBorder:n,cardSize:a="normal"})=>u(ku,"min-w-80",Iu[a],t&&(Pu(e)?"pt-3xl sm:pt-16":"pt-3xl"),vd(n),n&&"h-full"),Pu=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,Du=Ft((({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(Hd,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:i?16:0,padding:0,arrowsPadded:a,navButtons:r?Au(s?.block?.blocks):[],hasBlur:!0,children:Tu({noCardBorder:n,cardSize:l,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),Au=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],Eu="z-10 border border-solid w-full h-full",_u=u(Eu,"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(_u,"top-9 right-12 bg-green-dark")}),o("div",{className:u(_u,"top-6 right-8 bg-green")}),o("div",{className:u(_u,"top-3 right-4 bg-green-light")}),c("div",{className:u(Eu,"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})]})]})}))),Ou={black:"bg-black",white:"bg-white"},zu=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(Re,{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(Fu)]}):null,i?c(_e,{size:"text-h3",align:"text-left",children:[i," ₽"]}):null]})}))),Fu=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${Ou[e]}`},String(t)),Vu=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})),Lu=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?$u(a):null]})}))),$u=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(Vu,{...e},String(t))))}),qu=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"mindboxEvent"===e?{...n,eventJson:t}:n}))),ju=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})})),Uu=[{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: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=>Uu.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},Hu(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:Yu(s??!1,i??!1,n),buttonClassName:h})}),r?o(_e,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),Hu=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",Yu=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),Gu=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(ju,{href:i,target:m,className:"h-full",data:qu(v),children:c(Re,{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(Ae,{__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,Xu=(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))},Ju=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(Xu),[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(ri,{renderFoldableSection:()=>c("div",{children:[x,o(si,{isUnfolded:b,children:y})]}),renderFoldButton:d.length>=s?Zu(m?.parent,h,b):null}):o("div",{children:x})]})})),Zu=(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"})]}),Qu=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?eh(n):null,t?.length?eh(t):null]}))),eh=e=>o("div",{className:"flex gap-5xl grow basis-0",children:e.map(((e,t)=>th({column:e,i:t})))}),th=({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,nh=()=>{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 ai("/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)},ah=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]})]}))),ih=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(ah,{step:a,showPercentage:!1})]})})}));var lh;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.rework="REVISION"}(lh||(lh={}));const rh=e=>ni("/user-data/getTaskStatus","POST",e),sh=e=>ai("/user-data/sendSignalToProcess","POST",e),oh=(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},ch=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(Ae,{__html:e}),a?.text?o(Ne,{className:"text-primary-main",children:a.text}):null]})]}))),dh=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(Ac,{interval:e,time:l,setTime:e=>{0===e&&t(),r(e)}})})]}),i?o(Ae,{__html:i}):null]})]})})),mh=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(dh,{interval:d,intervalExpireAction:m}):null]}),o(uh,{title:a,items:i}),o(uh,{title:l,items:r,countColumns:!0}),n?.__html?o(ch,{__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]}))),uh=({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",nc(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:hh(e)},t)))}):null]})]}):null},hh=({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})]}),ph=d((()=>o(mh,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),gh=d((({handleExpireTimer:e})=>{const[t]=Gl("statusInfo");return o(mh,{interval:300,intervalExpireAction:e,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:t?.cardCategory}]})})),fh=d((()=>{const[e]=Gl("statusInfo");return o(mh,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),xh=d((()=>{const[e]=Gl("statusInfo");return o(mh,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.calculator?.monthsValue+" мес"},{label:"Тип платежа",description:e?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),yh=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],bh=d((()=>{const[e,t]=a(lh.process),[n]=Gl("taskId");i((()=>{(async()=>{for(const e of yh)await sh({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const a=await rh({taskId:n});a&&a?.statusCd!==lh.process&&(e(),t(a.statusCd))}),[n]);oh(r,3e4);return vh(e,(()=>t(lh.rework)))})),vh=(e,t)=>({IN_PROCESS:o(gh,{handleExpireTimer:t}),CANCELLED:o(ph,{}),APPROVED:o(xh,{}),REVISION:o(fh,{})}[e]||o(fh,{})),Nh=[{paymentSystem:{name:"",type:""},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:{key:"",text:""},addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:"office",deliveryDate:void 0}],wh=e=>{if(e)try{return new Date(e)}catch(e){return}},Ch=e=>(t,n)=>t.filter((e=>e)).map((t=>[Sh(n,e),kh(t,e),Bh(t,e),Ih(t,e),Th(t,e),Rh(t,e)].some(Boolean)?{...t,required:!1}:t)),Sh=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,kh=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Ih=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Th=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Rh=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),Bh=({name:e},t)=>"snils"===e&&Ph(t),Ph=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,Dh=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(ch,{__html:e},`${t}_${n}`))):null},Ah=({field:e,inputs:t,params:n})=>t.map(tc(e,n)),Eh=({sections:e,field:t,step:n,params:a})=>e?.map((({inputs:e=[],columns:i,title:l},r)=>{const s=Ch(_h(t))(e,n),o=s.filter((e=>!Rh(e,_h(t))));return c("div",{className:u(nc(i),"grid gap-x-m"),children:[Dh(o),ac(l),Ah({field:t,inputs:s,params:a})]},`section-${r}`)})),_h=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(sr,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(sr,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),Oh=e=>{const{currency:t,paymentSystem:n,cardCategory:a,codeWord:i}=e;return{currencyCode:t?{key:t}:void 0,paymentSystemTypeCd:n,classCard:a,codeWord:i}},zh=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},Fh=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{office:{id:t.key}}:{}},Vh=(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:sd({phone:jt(l),email:r}),participantAddresses:od({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:sd({organizationPhone:p&&jt(p)}),participantAddresses:od({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:cd({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);case 5:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:od({addressCourier:t})}:{}})(t)}},Lh=({step:e,inputs:t,onNextStep:n,saveStep:a,finishForm:i})=>{const r=5===e,[s]=Gl("taskId"),[o]=Gl("profileId"),[c]=Gl("participantId"),[,d]=Gl("statusInfo"),[m]=Gl("leadForm"),u=l((async l=>{const u=lc(aa(Ch(qh(l))(t,e)));if(!On(u(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,...Fh(a),authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Vh(i,a)}],...Oh(a),...zh(a)}}))({participantId:c,taskId:s,profileId:o,step:e,formData:l}));$h({isFinalStep:r,response:t,leadForm:m,setStatusInfo:d})}}catch(e){return"Fail"}return n(),r&&i?.(!0),"OK"}),[]);return{handleSubmit:u}},$h=({isFinalStep:e,response:t,leadForm:n,setStatusInfo:a})=>{if(e&&t.ok&&n){const e=n?.regionRetail?.text,t=n?.addressRetail?.text,i=n?.cardCategory?.text;a({regionRetail:e,addressRetail:t,cardCategory:i,calculator:{monthsValue:n?.calculator?.monthsValue,moneyValue:n?.calculator?.moneyValue,isAnnuity:n?.calculator?.isAnnuity}}),globalThis.localStorage.removeItem("leadForm")}},qh=e=>t=>e[t],jh=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,isFormFinished:i,finishForm:l})=>{const[r,s]=Gl("leadForm"),d=((e,t)=>({...Nh[e],...t,limitedBirthday:wh(t?.limitedBirthday),dulIssueDateField:wh(t?.dulIssueDateField),participantDateRegistration:wh(t?.participantDateRegistration),beginDate:wh(t?.beginDate),deliveryDate:wh(t?.deliveryDate)}))(e,r),m=t?.flatMap((e=>e?.inputs))||[],{handleSubmit:u}=Lh({step:e,inputs:m,onNextStep:a,saveStep:s,finishForm:l}),[,{field:h,onSubmit:p}]=an(d,{onSubmit:u});return i?o(bh,{}):c("form",{onSubmit:p,className:"space-y-m",children:[Eh({sections:t,field:h,step:e}),o(Mh,{step:e,onPrevStep:n})]})})),Uh=[[{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=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],Hh=d((({className:e,...t})=>{const[n,d]=a(0),m=s(null),u=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);i(nh,[]);const h=l((()=>{d((e=>Math.min(e+1,6))),u()}),[]),p=l((()=>{d((e=>Math.max(e-1,0))),u()}),[]),f=r((()=>Uh[n]),[n]),[x,y]=a(!1);return o(g,{className:e,...t,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[x?null:o(ih,{stepsTitles:Wh,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(jh,{step:n,sections:f,onNextStep:h,onPrevStep:p,isFormFinished:x,finishForm:y},String(n))})]})})})),Yh=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(ah,{step:a,showPercentage:!1})]})})})),Gh=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(dh,{interval:d,intervalExpireAction:m}):null]}),o(Kh,{title:a,items:i}),o(Kh,{title:l,items:r,countColumns:!0}),n?.__html?o(ch,{__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",nc(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:Xh(e)},t)))}):null]})]}):null},Xh=({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})]}),Jh=d((()=>o(Gh,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Zh=d((({handleExpireTimer:e})=>{const[t]=Gl("statusInfo");return o(Gh,{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?"Аннуитетный":"Дифференцированный"}]})})),Qh=d((()=>{const[e]=Gl("statusInfo");return o(Gh,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),ep=d((()=>{const[e]=Gl("statusInfo");return o(Gh,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.calculator?.monthsValue+" мес"},{label:"Тип платежа",description:e?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),tp=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],np=d((()=>{const[e,t]=a(lh.process),[n]=Gl("taskId");i((()=>{(async()=>{for(const e of tp)await sh({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const a=await rh({taskId:n});a&&a?.statusCd!==lh.process&&(e(),t(a.statusCd))}),[n]);oh(r,3e4);return ap(e,(()=>t(lh.rework)))})),ap=(e,t)=>({IN_PROCESS:o(Zh,{handleExpireTimer:t}),CANCELLED:o(Jh,{}),APPROVED:o(ep,{}),REVISION:o(Qh,{})}[e]||o(Qh,{})),ip=[{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:{key:"",text:""},addressRetail:void 0,bankEmployeeCode:void 0}],lp=e=>{if(e)try{return new Date(e)}catch(e){return}},rp=e=>(t,n)=>t.filter((e=>e)).map((t=>[sp(n,e),op(t,e),up(t,e),cp(t,e),dp(t,e),mp(t,e)].some(Boolean)?{...t,required:!1}:t)),sp=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,op=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,cp=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,dp=({name:e},t)=>"addressFact"===e&&t("addressMatch"),mp=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),up=({name:e},t)=>"snils"===e&&hp(t),hp=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,pp=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(ch,{__html:e},`${t}_${n}`))):null},gp=({field:e,inputs:t,params:n})=>t.map(tc(e,n)),fp=({sections:e,field:t,step:n,params:a})=>e?.map((({inputs:e=[],columns:i,title:l},r)=>{const s=rp(xp(t))(e,n);return c("div",{className:u(nc(i),"grid gap-x-m"),children:[pp(s),ac(l),gp({field:t,inputs:s,params:a})]},`section-${r}`)})),xp=e=>t=>e(t)?.value,yp=d((({step:e,onPrevStep:t})=>{const n=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(sr,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(sr,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),bp={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},vp=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:a}=e?.calculator??{};return{loanAmount:t,creditPeriod:n,paymentTypeCd:bp[a?"annuity":"differential"]}},Np=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},wp=(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:sd({phone:jt(l),email:r}),participantAddresses:od({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:sd({organizationPhone:p&&jt(p)}),participantAddresses:od({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:cd({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{}}},Cp=({step:e,inputs:t,onNextStep:n,saveStep:a,finishForm:i})=>{const r=5===e,[s]=Gl("taskId"),[o]=Gl("profileId"),[c]=Gl("participantId"),[,d]=Gl("statusInfo"),[m]=Gl("leadForm"),u=l((async l=>{const u=lc(aa(rp(kp(l))(t,e)));if(!On(u(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:"Заемщик"},...wp(i,a)}],...vp(a),...Np(a),esiaAccountTypeCd:{key:a?.esiaAccountTypeCd?.key}}}))({participantId:c,taskId:s,profileId:o,step:e,formData:l}));Sp({isFinalStep:r,response:t,leadForm:m,setStatusInfo:d})}}catch(e){return"Fail"}return n(),r&&i?.(!0),"OK"}),[]);return{handleSubmit:u}},Sp=({isFinalStep:e,response:t,leadForm:n,setStatusInfo:a})=>{if(e&&t.ok&&null!==n){const e=n?.regionRetail?.text,t=n?.addressRetail?.text,i=n?.cardCategory?.text;a({regionRetail:e,addressRetail:t,cardCategory:i,calculator:{monthsValue:n?.calculator?.monthsValue,moneyValue:n?.calculator?.moneyValue,isAnnuity:n?.calculator?.isAnnuity}}),globalThis.localStorage.removeItem("leadForm")}},kp=e=>t=>e[t],Ip=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,isFormFinished:i,finishForm:l,programsSource:r})=>{const[s,d]=Gl("leadForm"),[m]=Gl("programId"),u=r?.[m??""],h=((e,t)=>({...ip[e],...t,limitedBirthday:lp(t?.limitedBirthday),dulIssueDateField:lp(t?.dulIssueDateField),participantDateRegistration:lp(t?.participantDateRegistration),beginDate:lp(t?.beginDate),deliveryDate:lp(t?.deliveryDate)}))(e,s),p=t?.flatMap((e=>e?.inputs))||[],{handleSubmit:g}=Cp({step:e,inputs:p,onNextStep:a,saveStep:d,finishForm:l}),[,{field:f,onSubmit:x}]=an(h,{onSubmit:g});return i?o(np,{}):c("form",{onSubmit:x,className:"space-y-m",children:[fp({sections:t,field:f,step:e,params:{calcData:u}}),o(yp,{step:e,onPrevStep:n})]})})),Tp=[[{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"}]}]],Rp=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Отделение Банка"],Bp=Ft((({className:e,programsSource:t,...n})=>{const[d,m]=a(0),u=s(null),h=l((()=>u?.current?.scrollIntoView({behavior:"smooth"})),[u]);i(nh,[]);const p=l((()=>{m((e=>Math.min(e+1,5))),h()}),[]),f=l((()=>{m((e=>Math.max(e-1,0))),h()}),[]),x=r((()=>Tp[d]),[d]),y=0===d,[b,v]=a(!1);return o(g,{className:e,...n,children:c("div",{ref:u,className:"container grid grid-cols-12",children:[y||b?null:o(Yh,{stepsTitles:Rp,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))})]})})})),Pp=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,Dp=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),Ap=1e9,Ep={sum:{min:1e4,max:Ap},period:3},_p=Ft((({className:e,filtrationSchema:t={},resetButton:n,sumInput:a,periodInput:i,...l})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=um(Ep,{block:l.block,page:l.options?.page,normalize:e=>({...e,period:Mp(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=Op(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...l,children:[o(lm,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(vu,{label:a?.title,min:500,max:Ap,...d("sum",{parse:e=>({min:Number(e),max:Ap}),format:({min:e})=>String(e)})}),o(el,{title:i?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(tm,{blocksToRender:r,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),Mp=e=>At((e?.paramsSource?.rateRows||[]).filter(Pp).flatMap((e=>Dp(e.minMonths,e.maxMonths)))),Op=e=>At(e.flatMap((e=>e||[])).filter(Pp).flatMap((e=>Dp(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],zp=[{key:"10"},{key:"50"},{key:"100"}],Fp=({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:zp,iconVersion:"black"})]})},Vp="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",Lp=(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:Vp,"aria-label":`Страница ${l}`,children:l},String(t)):null},$p={width:"24",height:"24"},qp=({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:jp(1===e),...$p})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:Vp,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,a.map(Lp),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:Vp,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(W,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:jp(e===n),...$p})})]})},jp=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",Up=({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(qp,{currentPage:e,onPageChange:t,totalPages:n}),a&&i?o(Fp,{itemCount:a,onItemCountChange:i}):null]}),Wp=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})]})})),Hp=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(ql,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(ql,{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(sr,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),Yp=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)})),Gp=`${Ut}/depository`,Kp={startDate:void 0,endDate:void 0,query:""},Xp=Ft((({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(Gp);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(Gp+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(Hp,{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(Yp,{...e},String(e.publicId)))):o(bd,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(Up,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:y})]})]})})),Jp=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,Zp=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:Jp(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]}))),Qp=`${Ut}/region`;function eg(e="Москва"){return ml().location??{name:e}}function tg(e="Москва"){const t=ml(),n=l((async()=>{if(!t.location){const n=await Pt(Qp);t.location=n??{name:e}}}),[t,e]);return ga(Qp,n),t}var ng;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(ng||(ng={}));const ag=new Intl.NumberFormat("ru",{style:"currency",currency:ng.RUB}),ig=e=>e?ag.format(e):"",lg="text-m font-light text-secondary-text ",rg=`${lg} text-left`,sg=`${lg} pl-5xl text-center`,og=`${lg} pl-5xl text-right`,cg={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},dg=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:rg,children:o(_e,{size:"text-m",children:"Валюта"})}),o("th",{className:sg,children:o(_e,{size:"text-m",children:"Купить"})}),o("th",{className:og,children:o(_e,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(mg)})]}))),mg=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:cg[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:ig(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(_e,{size:"text-h6",children:ig(e?.buyExchangeRate)})})]},t)},ug={icon:"GpsIcon"},hg=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(bm,{...ug,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:"Курс указан для заданного офиса"})]})]}))),pg=(e,t,n)=>{const a=Number(gg(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)},gg=e=>e.replace(/[^\d.,]/g,"").replace(",",".");function fg(e){if(!e)throw new Error("Value should be fulfilled");return e}const xg=e=>t=>{const[,n]=fg(e.find((([e])=>e(t))));return n(t)},yg=e=>xg(e.map((([e,t])=>[e,()=>t])));yg.if=e=>new bg(void 0,e);class bg{parent;predicate;unit;get entry(){return[fg(this.predicate),fg(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new bg(this,e)}then(e){return new bg(this.parent,this.predicate,e)}else(e){return xg([...vg(this),[()=>!0,e]])}}const vg=e=>[...e?.parent?vg(e.parent):[],e.entry],Ng=e=>yg([[e=>e.value!==ng.RUB&&e.oppositeValue!==ng.RUB,()=>e.handleConvert(e.value,ng.RUB)],[e=>e.value===ng.RUB&&e.oppositeValue===ng.RUB,()=>e.handleConvert(e.value,ng.USD)],[e=>e.value===ng.RUB&&e.oppositeValue===ng.RUB,()=>e.handleConvert(e.value,ng.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function wg(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(fn,{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 Cg=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:i})=>{const[r,s]=a({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||ng.RUB,selectBuy:n?.[0]?.currency?.currency||ng.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:[wg({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:Sg(r,d,n),value:r.inputSell,setValue:e=>Ig(d,n)(e,r.selectSell,r.selectBuy)}),wg({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:kg(r,d,t),value:r.inputBuy,setValue:e=>Tg(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}),Ng({value:a,oppositeValue:e.selectBuy,handleConvert:(a=e.selectSell,i=e.selectBuy)=>{Ig(t,n)(e.inputSell,a,i)}})},kg=(e,t,n)=>a=>{t({selectBuy:a}),Ng({value:a,oppositeValue:e.selectSell,handleConvert:(a=e.selectBuy,i=e.selectSell)=>Tg(t,n)(e.inputBuy,a,i)})},Ig=(e,t)=>(n,a,i)=>{e({inputSell:gg(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(pg(n,l,a===ng.RUB)||"")})},Tg=(e,t)=>(n,a,i)=>{e({inputBuy:gg(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(pg(n,l,a===ng.RUB)||"")})},Rg=`${Ut}/exchangerates`;const Bg=d((({className:e="",title:t="Курсы обмена валют",button:n,...a})=>{const i=function(e){const t=e?.code||"000",{data:n}=ga(Rg+`?regionCode=${t}`,Dt);return n||{}}(eg()),l=Pg(i?.exchangeRate?.currencies),r=l.filter((e=>e.buyExchangeRate));r.unshift({currency:{currency:ng.RUB}});const s=l.filter((e=>e.saleExchangeRate));return s.push({currency:{currency:ng.RUB}}),o(g,{className:u("box-border min-h-80",e),...a,children:o(Re,{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(dg,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(hg,{address:i?.address})]}),o(Cg,{className:"grow w-1/2",currencyRatesBuy:r,currencyRatesSell:s,button:n})]})})})})),Pg=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],Dg=d((({className:e="",items:t})=>{const n=pe();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(Ag(n))})})),Ag=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},Eg=e=>t=>!t.displayArea||e.includes(t.displayArea.toLowerCase()),_g=["all","footer"],Mg=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(Eg(_g)).map(n).map(Og)})})),Og=(e,t)=>{const{text:n,items:a=[],href:i,target:l="_self",onClick:r,dataFooter:s}=e,d=a.filter(Eg(_g));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(Dg,{items:d}):null]},String(t))},zg=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(Fg)}):null)),Fg=(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(Vg)})]},String(t)),Vg=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Lg(e.type,e.text)}),o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Lg=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${$g(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})}},$g=e=>e.replaceAll(/\D/g,""),qg=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}`})})),jg=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(qg,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),Ug="w-full lg:w-52";function Wg(e,t,n=300){i((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}const Hg=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 Yg=(e,t)=>(n,a)=>{for(const[i,l]of a)n.set(i,e(n.get(i)||t,l));return n},Gg=(e=[])=>e.reduce(((e,t)=>e+t),0),Kg=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),Xg=e=>t=>e.map((([e,n])=>[Hg(t)(e),n])).filter((([e])=>e>=.8)).map((([e,t])=>Zg(t,e))).reduce(Yg(Math.max,0),new Map),Jg=e=>t=>{return om(t,t.map((({title:e})=>e)).map((e=>t=>{const n=Kg(t||"");return n.length?Gg(e.map((e=>zr(n.map(Hg(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]))),Qg=({basePathList:e,initialQuery:t=""})=>{const[n,l]=a(t||"");i((()=>{null!=t&&l(t)}),[t]);const{data:r}=ga(e?.length?e:null,ef),[s,o]=a(null);return Wg((()=>{r&&o(r.map((e=>t=>{const{corpus:n,dictionary:a}=t||{};if(!(e&&n?.length&&a&&Object.keys(a).length))return[];const i=Kg(e);if(!i.length)return[];const l=Object.entries(a),r=[...i.map(Xg(l)).reduce(Yg(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*i.length)).map((([e])=>n[e]));return Jg(i)(r)})(n)))}),[r,n]),[s,{value:n,onChange:l}]},ef=async(...e)=>(await Promise.allSettled(e.map((e=>Pt(F(e,"/","search.index.json")))))).map((e=>"fulfilled"===e.status?e.value:{})),tf=d((({initialQuery:e,navigationItems:t,onClose:n})=>{const a=r((()=>t?.map((e=>e.href||"/"))),[t]),[i,l]=Qg({basePathList:a,initialQuery:e}),s=r((()=>nf(t)(i)),[t,i]);return o(cr,{head:o(Wp,{autoFocus:!0,...l}),onClose:n,children:o(Mg,{navigationItems:s})})})),nf=e=>t=>e?.length&&t?.length?om(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:F("/",t)})))}))):[],af=d((({className:e,search:t,...n})=>{const[i,r]=a(""),s=l((()=>r("")),[]),d=sn(tf,n),m=l((e=>{r(e),lf(e)&&d.open({initialQuery:e,onClose:s})}),[s,d]);return c("div",{className:u("relative",e),role:"search",children:[o(Wp,{value:i,placeholder:t?.placeholder,onChange:m}),o(or,{className:"absolute top-0 right-0 sm:hidden",onClose:s})]})})),lf=e=>e&&e.length>=3,rf=(e,t)=>{const{logo:n}=e??{},{dataHeader:a,dataFooter:i,...l}=n??{};return c("div",{className:"flex items-stretch gap-3xl",children:[o(Pc,{className:Ug,logo:l,data:i,showTitle:!1}),o(af,{className:"grow",navigationItems:t,...e})]})},sf=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}`})})),of=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(sf,{index:t,...e},String(t))))}):null]}))),cf=Ft((({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:[rf(i,a),c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(Mg,{navigationItems:a}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u(Ug,"flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(zg,{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(jg,{title:m,links:r}),o(of,{links:l,license:p})]})})),df=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?mf(a):null]}))),mf=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=>uf(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:hf(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}`)))})]})},uf=(e,t)=>e.month?.map(((e,n)=>o("div",{style:{flexBasis:`${t}%`},children:e.text},`monthName-${n}`))),hf=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)),pf=Ft((({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 space-y-m",children:[t?o(N,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(Mn,{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:qu(l,s?.key),children:f})}):null]})})}));function gf(e=[]){const t=D(),n=Array.from(e.entries()).filter((([,e])=>ff(t)(e)));return n.find((([,e])=>ff(t,!0)(e)))??n[n.length-1]??[]}const ff=(e,t=!1)=>({href:n})=>{if(!n)return!1;const a=z(xf(e)(n));return t?a===z(n):a.startsWith(z(n))},xf=e=>t=>{const n=X(K.SITE_URL);return _(t)?e.href:F(n,e.pathname)},yf=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:vf(t,n)})]})})),bf=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})})),vf=(e,t)=>e?.map(((e,n)=>o(bf,{isActive:e===t,...e},e?.text??String(n)))),Nf={default:"w-6 h-6",large:"w-12 h-12"},wf=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":`${Nf[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"})}))),Cf="chatbot",Sf="text-page__btn-chat",kf={personal:"//chat.mes.rshb.ru/assets/js/webchat_rshb",business:""},If=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=kf[e??""];return n=>{if(t)if("personal"!==e)Ya(Cf,t);else{const e=n.target;e?.classList.contains(Sf)||e?.classList.add(Sf),document.getElementById("webchat-js-container:webchat_rshb")||Ya(Cf,t)}}})(e);return o(wf,{className:n,image:{icon:"HeadphonesIcon",iconVersion:t},ariaLabel:a,onClick:r,buttonSize:"large",isGrayBg:!0,version:l})})),Tf=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:Rf(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]})})),Rf=(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"),Bf=d((({observerOptions:e,onVisibilityChange:t,children:n,className:a,...i})=>{const r=Cd(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(Tf,{...i,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"},Df=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",Pf["transparent"===e?"transparent":"default"]),...a,children:i}):null})),Af=d((({subItems:e=[],version:t,internetBankButton:n,dropdownMenuAriaLabel:i,chatBotAriaLabel:l})=>{const d="transparent"===t?"white":"black",[,m]=gf(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?Ef(t):_f(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(Bf,{className:u-1<t?"invisible":"",active:e===m,observerOptions:f,onVisibilityChange:x[t],data:e.dataHeader,...e},String(t))))}),p.length?o(yf,{items:p,activeItem:m,ariaLabel:i}):null,E.CHAT_BOT?o(If,{version:t,iconVersion:d,chat:E.CHAT_BOT,ariaLabel:l}):null,o(Df,{version:t,...n})]})})),Ef=e=>t=>Math.max(t,e+1),_f=e=>t=>Math.min(t,e),Mf=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(Of,{...e},String(t))))})]}):null,Of=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]})})),zf=(e,t)=>n=>n.name?o(ju,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:qu(e,n.name),children:o(_e,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,Ff=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"})]}))),Vf=d((({defaultLocation:e})=>{const t=eg(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(ju,{href:a,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),Lf=d((({foreignOffices:e,branches:t,onClose:n})=>{const i=tg(t?.default),[s,d]=a(""),m=Bo(),u=r((()=>qf(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,$f)),[u]),p=l((e=>{i.location=e,n?.()}),[i,n]);return c(cr,{className:"pb-20",head:c("div",{children:[o(_e,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(Vf,{defaultLocation:t?.default}),o(Ff,{onSearch:d,searchTerm:s})]}),onClose:n,children:[s&&s.length>=3?o("div",{children:u.filter((({name:e})=>e&&Hg(e.toLowerCase())(s.toLowerCase())>=.8)).map(zf(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(zf(f,g))]},e)))}),Mf(e)]});var g,f})),$f=e=>e.name?.charAt(0)??"",qf=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),jf=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(Uf(t,n),e),href:s,target:c,onClick:m,rel:"noopener noreferrer","aria-label":`Ссылка на ${d}`,...fe(i),children:o("span",{suppressHydrationWarning:!0,className:Wf(t,n),children:d||a})})})),Uf=(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}),Wf=(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"),Hf=d((({className:e,version:t,...n})=>{const a="transparent"===t?"white":"black",i=eg(n?.branches?.default),r=sn(tf,n),s=sn(Lf,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(jf,{className:"whitespace-nowrap text-ellipsis overflow-hidden",flat:!0,href:"#",text:i?.name,data:qu(n?.branches?.dataClick,i?.name??""),onClick:m}):null,n?.officesAtms?.href?o(jf,{className:"whitespace-nowrap",flat:!0,...n.officesAtms}):null,o(wf,{image:{icon:"LoupeIcon",iconVersion:a},ariaLabel:n?.search?.ariaLabel??"Поиск",onClick:d,data:n?.search?.data})]})})),Yf=d((({observerOptions:e,onVisibilityChange:t,children:n,className:a,...i})=>{const r=Cd(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(jf,{...i,children:n})})})),Gf=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?Kf(t):Xf(t))}))),[e]),{dataFooter:b,dataHeader:v,...N}=u??{};return c("div",{className:"flex items-center justify-between",children:[o(Pc,{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(Yf,{className:h-1<n?"invisible":"",active:e===t,observerOptions:x,onVisibilityChange:y[n],data:e.dataHeader,...e},String(n))))}),g.length?o(yf,{className:"mx-xs",items:g,activeItem:t,ariaLabel:n}):null,o(Hf,{version:i,className:"ml-auto",search:d,navigationItems:e,...l})]})})),Kf=e=>t=>Math.max(t,e+1),Xf=e=>t=>Math.min(t,e),Jf={"bg-white":"primary",transparent:"transparent"},Zf=["all","header"],Qf=Ft((({className:e,bgColor:t="bg-white",logo:n={},version:a=Jf[t],portal:i,header:l={},...r})=>{const{common:s,navigation:d}=tx(r?.options?.page),{navigationItems:m}=d,{logo:h={}}=s,[,p]=gf(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(Gf,{activeTopItem:p,navigationItems:m?.filter(Eg(Zf)),version:a,headerData:{...l,...d},search:s.search,bgColor:t,logo:x})}),o("div",{className:u("mt-s h-px bg-main-divider",ex(a))}),p?.items?.length&&o(Af,{subItems:p?.items?.filter(Eg(Zf)),version:a,internetBankButton:f})]})})})),ex=e=>"transparent"===e?"opacity-30":"",tx=e=>({navigation:e?.navigation??{},common:e?.common??{}}),nx=(e=!1)=>e?{}:{padding:"p-0"},ax={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},ix=Ft((({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",ax[n],e),padding:t,version:i,isTheme:l,...s,children:P({...s,extraProps:{...nx(a),className:vd(r)}})})),{childrenTypes:{exclude:["HorizontalLayout"]}}),lx=d((e=>{const{className:t,align:n,image:a,...i}=e,l=n?u("flex",Im[n]):"";return o(g,{className:u(l,t),defaultPadding:"p-0",...i,children:o(ne,{image:a})})})),rx=(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 sx({dec:e,inc:t,canDec:n,canInc:a,btnClass:i,className:l=""}){return n||a?c("div",{children:[n?o(Vd,{className:u("absolute z-40",i[0],l),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!n}):null,a?o(Vd,{className:u("absolute z-40 rotate-180",i[1],l),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!a}):null]}):null}const ox=d((({className:e="",cards:t=[],button:n})=>{const[i,r]=a(0),s=l((e=>r(e)),[]),d=t.length,[m,u]=rx({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?cx({activeIndex:m,cards:t,selectedCardIndex:i,onClick:s}):null,sx({...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 cx({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?dx("страховая сумма",e.sum):null,e?.fee?dx("страховой взнос",e.fee):null]}),mx(n)]},String(t))}({slide:e,i:t,isActive:Boolean(t===n),onClick:()=>a(t)})))})})}function dx(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 mx(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 ux=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:hx({insuranceTabs:n,button:i})})]})})),hx=({insuranceTabs:e,button:t})=>{const n=e?.map((e=>e.cards));return n?.length?n.map(((e,n)=>o(ox,{button:t,cards:e},String(n)))):null};const px={yellow:"bg-yellow",green:"bg-green","green-light":"bg-green-light","green-dark":"bg-green-dark"},gx={XS:"h-10",S:"h-16",M:"h-24",L:"h-32",XL:"h-52"},fx=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:[am(o("div",{className:"w-px h-4 bg-gray"}))(s.map(xx)),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(vx)})]}):null,n?o("div",{className:"max-w-2xl font-light text-base",children:o(Ae,{__html:n,isDotted:a,itemSize:"list-s"})}):null]})})})),xx=(e,t,n)=>{const a=1===t,i=t===n.length-1,l=e.cells?.reverse()||[];return o("div",{className:`${yx(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(bx)}):null},`column_${t}`)},yx=(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(" "),bx=(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 ${gx[n]} ${px[a]} ${"XS"===n?"px-s":"px-5xl"}`,children:o(_e,{align:"text-center",children:e.text})},`cell_${t}`):null},vx=(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,Nx=["байт","Кб","Мб","Гб","Тб","Пб"],wx=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," ",Cx(d,m),o(_e,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),Cx=(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))} ${Nx[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?Ix(i):n?.fileFormat;return c("div",{role:"listitem",children:[o(wx,{text:n?.text,target:n?.target,href:i,fileFormat:r,fileSize:l,icon:kx(t),data:n?.data}),o(Ae,{__html:n?.__html})]},String(a))},kx=e=>e?o(ne,{className:"min-w-6 min-h-6",image:e,width:"24",height:"24"}):null,Ix=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},Tx=d((({href:e,__html:t,target:n,onClose:a})=>{const i=D(),l=j(i)(e);return c(cr,{className:"my-6xl min-h-fit w-fit mx-auto",onClose:a,children:[t?o(Ae,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(Ne,{text:"Я согласен",version:"primary",target:n,href:l,onClick:a}),o(sr,{type:"button",version:"secondary",onClick:a,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]})})),Rx=d((({text:e,href:t,target:n,__html:a,icon:i})=>{const{open:r}=sn(Tx),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:[kx(i),o(_e,{font:"font-light",children:e})]}):null})),Bx={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},Px=Ft((({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",Bx[r]),role:"list",children:i.map(Dx(d,l))}):null]})})),Dx=(e,t)=>(n,a)=>{const i=n?.docType;return""===i?null:"reportSource"in n&&n?.reportSource?.__html?Ax(t)(n,a):Sx(e,t)(n,a)},Ax=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(Rx,{...a,icon:e,href:Ex(t)?t?.href:t?.attachment?.src}),o(Ae,{__html:t?.__html})]},String(n)):null},Ex=e=>"href"in e,_x=Ft((({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(Re,{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(Ae,{__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]})]})})})),Mx=(e,t)=>e&&"underlined"!==t?"primary":"secondary",Ox=(e=[],t={})=>e.filter((({content:e={}})=>dm(t,e))).length,zx=(e,t)=>e===t;const Fx=(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)))}(zx,((e=zx)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,a)=>e(t,n[a])))))())),Vx=[],Lx={},$x={primary:"bg-white/30",secondary:"bg-main-divider"},qx={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},jx=d((({count:e,version:t="secondary"})=>{const n=ke(),a=n?"bg-main-divider":$x[t],i=qx[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})})})),Ux=({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})]})]})},Wx={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},Hx={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},Yx={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},Gx={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},Kx=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",Wx[a],n?Gx[a]:Yx[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?Hx[a]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[Ux({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(jx,{count:m,version:Mx(n,a)})}):null]})})})),Xx=d((e=>o(e?.item?.href?Jx:Zx,{...e}))),Jx=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(Kx,{...e,tag:"a",item:i,onClick:a})})),Zx=d((({item:e={},onClick:t,...n})=>{const a=l((()=>{t&&t(e)}),[t,e]);return o(Kx,{item:e,onClick:a,...n})})),Qx=(e,t,n)=>(a,i)=>o(Xx,{isActive:a===e,onClick:t,type:n,item:a},String(i)),ey=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(Qx(a,i,t))}))),ty={categories:[],extraOptions:[],propertyType:[],stage:[]},ny=Ft((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:a,...i})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=um(ty,{block:i.block,page:i.options?.page}),f=l(((e=ty)=>p(e)),[]),x=(({hotFilters:e=Vx,filtrationState:t=Lx,blocks:n=Vx,onFiltrationStateChange:a})=>{const i=r((()=>Math.max(0,e.findIndex((e=>Fx(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:Ox(n,t.filter),version:Mx(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(ey,{...x}),o(lm,{filtrationSchema:n,resetButton:a,field:m,reset:h}),o(tm,{blocksToRender:d,...i})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),ay=(e,t,n)=>{const a=Mx("all"===t),i=Mx("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(sr,{"data-id":"all",onClick:t=>l(t,"all",e),version:a,children:"Для физических лиц"}),o(sr,{"data-id":"business",onClick:t=>l(t,"business",e),version:i,children:"Для юридических лиц"})]})},iy=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o(Ae,{__html:e,richVersion:n})}):null,t?.length?o("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl",children:t.map(((e,t)=>c("div",{className:"flex gap-xs items-center",children:[e?.image?o(ne,{image:e.image}):null,e?.text?o(_e,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,ly="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",ry=({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(ri,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:ly,children:s}),o(si,{className:ly,isUnfolded:e,children:d})]}),renderFoldButton:sy(n,a)})}):null})},sy=(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:oy()})]}),oy=()=>c("div",{className:"flex items-center",children:["Очистить фильтр",o(W,{name:"CloseIcon",width:"16",height:"16",className:"ml-2xs"})]}),cy=(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]})}),dy=()=>{},my=e=>"all"===e?"block":"hidden",uy=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:i=[],renderCard:l=dy,renderRemoteWorkplaceCard:r=dy,getBalloon:s=dy,getBalloonRemoteWorkplaces:d=dy,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=an(zi),{filteredItems:y,points:b,filteredRemoteWorkplaces:v,lengthItems:N}=qi({data:t,remoteWorkplaces:i,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=a("all"),S={filters:hy([...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:[cy(h,N),m?iy(m):null,p&&ay(t,w,C),o("div",{className:u("pb-3xl",my(w)),children:ry(S)})]}),o("div",{className:"h-[600px]",children:o(Hi,{children:o(Za,{points:b,isLoad:n,className:"h-full"})})})]}),c(Hi,{children:[y.map(l),v.map(r)]})]})})),hy=e=>Object.keys(zi).filter((t=>e.filter((e=>Vi[t](e))).length)),py=({location:e,address:t,billAcceptorType:n,terminalType:a,billAcceptorEnable:i,atmCode:l="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:xy(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:xy(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(Ci,{color:"green",children:xy(s)})})]}),o("div",{className:"hidden sm:block",children:o(ui,{className:"flex-wrap",children:m?.map(fy)})}),o(ri,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(si,{isUnfolded:e,children:o(ui,{className:"flex-wrap",children:m?.map(fy)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Pi({isUnfolded:e,onToggle:t})})]},String(d))},gy=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${xy(t)} №${n}`,body:e.toUpperCase()}),fy=(e,t)=>o(oi,{...e},String(t)),xy=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",yy=[];const by=async e=>{const t=await Pt(e,{method:"GET"});return Array.isArray(t)?t:yy},vy={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},Ny={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)},wy=d((({descriptionData:e,className:t})=>{const n=eg(),a=n?.code??"000",{data:i,isLoad:l}=function(e){const{data:t,error:n}=ga(`${Ut}/atms?regionCode=${e}`,by);return{data:t||yy,isLoad:!t&&!n}}(a);return o(uy,{className:t,filterItems:Cy,data:i,isLoad:l,initFilterState:vy,renderCard:py,getBalloon:gy,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),Cy=(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=>Ny[t](e))),n=!a.length||a.some((t=>Ny[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:ky({workScheduleDescription:t})}),o(ri,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(si,{isUnfolded:e,children:ky({workScheduleDescription:t})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Pi({isUnfolded:e,onToggle:t})})]},String(n)):null,ky=({workScheduleDescription:e})=>c("div",{children:[c(ui,{className:"flex",children:[o(oi,{label:"Операции для физических лиц",children:o(_e,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(oi,{label:"Операции для физических лиц",children:o(_e,{children:"Оформление и обслуживание банковских карт"})}),o(oi,{label:"Операции для физических лиц",children:o(_e,{children:"Инвестиционное и накопительное страхование"})}),o(oi,{label:"Операции для физических лиц",children:o(_e,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(oi,{label:"Режим работы",className:"max-w-none",children:o(_e,{children:e})})]}),Iy=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),Ty={branches:[],remoteWorkplaces:[]};const Ry=async e=>await Pt(e,{method:"GET"})||Ty,By=d((({className:e})=>{const t=eg(),n=t?.code??"000",{data:a,isLoad:i}=function(e="000"){const{data:t,error:n}=ga(`${Ut}/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,Ry);return{data:t||Ty,isLoad:!t&&!n}}(n);return o(uy,{className:e,data:a?.branches,isLoad:i,remoteWorkplaces:a?.remoteWorkplaces,renderCard:_i,renderRemoteWorkplaceCard:Sy,getBalloon:Oi,getBalloonRemoteWorkplaces:Iy,title:`Офисы филиала ${t?.name}`})})),Py=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(By,{}):o(wy,{descriptionData:e})})})),Dy=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,{})]}))),Ay="hidden sm:flex absolute z-40 top-10",Ey=Ft((({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(Td,{containerRef:s,snapAlign:"snap-start",onVisibleIndicesChange:d.handleVisibleIndicesChange,itemClassName:"h-40 flex items-stretch w-screen",gap:8,children:n.map(_y({activeSlideIndex:l,onClick:r}))}),d.canScrollLeft?o(Ld,{className:u("left-6",Ay),onClick:d.scrollLeft}):null,d.canScrollRight?o($d,{className:u("right-6",Ay),onClick:d.scrollRight}):null]})]})})),_y=({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))},My=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?Oy({__html:l,richVersion:r}):null,zy({label:"Адрес",data:e,iconName:"GeolocationIcon"}),zy({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),zy({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),a?.text?qe([a]):null]})]}))),Oy=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(Ae,{...e,itemSize:"list-s"})}),zy=({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,Fy=d((e=>{const{__html:t,richVersion:n="",...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(Ae,{__html:t,richVersion:n})})})),Vy=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}))),Ly=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",$y=(e=!1)=>e?"MinusIcon":"PlusIcon",qy=(e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon",jy=Ft((({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(ri,{isFoldButtonOnTop:n,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(si,{className:u("gap-lg",Ly(m)),isUnfolded:e,children:P({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Uy({foldButtonVersion:r,label:a,labelIcon:i,labelIconBgVersion:l,isUnfolded:e,onToggle:t,isMobile:m})})})}),{childrenTypes:{exclude:["RollupItem"]}}),Uy=({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?qy(e):$y(e))(i,r);return"accordion"===e?o(Vy,{label:s,labelIcon:n,labelIconBgVersion:a,icon:c,onToggle:l}):o(Xd,{label:s,icon:i?"ArrowUpIcon":"ArrowDownIcon",onClick:l})},Wy=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)),Ra,"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]})}))),Hy=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(Wy,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:i}),o(Wy,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:i})]})})),Yy=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})})),Gy=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(Yy,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(Yy,{data:a,fieldValue:"branchCode",fieldLabel:"address",selected:i,setSelected:l,label:"Отделение",placeholder:"Выберите отделение"})})]}))),Ky=["От 1 дня","До 365 дней"],Xy=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(_e,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(el,{min:1,max:365,value:e,items:Ky,onChange:t})]}))),Jy=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(Yy,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(Yy,{data:a,fieldLabel:"safeBoxCasesSize",selected:i,setSelected:l,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),Zy=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(Gy,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:a,onSelectedBranch:Qy(m)}),o(Xy,{days:i,setDays:e=>m({days:e})}),o(Jy,{caseVolumes:d,selectedCaseVolume:l,onSelectedCaseVolume:eb(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(Hy,{}),o(Ne,{text:"Офисы на карте",version:"primary",onClick:u,className:"order-6"})]})]}))),Qy=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},eb=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},tb=d((({days:e,tariffs:t=[]})=>{const n=ab(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:[nb("Аренда за",e),nb("Цена",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})})]})]})})),nb=(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})]}),ab=(e,t)=>{const n=ib(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},ib=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},lb=(e,t)=>e.find((e=>e.branchCode===t)),rb=d((e=>{const{regions:t,data:n,branches:a,onChange:l,onClick:r}=e;i((()=>{l({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,l]);const s=lb(a,n.selectedBranch),d=sb(s?.safeBoxCaseVolumes),m=ob(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=cb(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:a,caseVolumes:d,safeBoxCases:m,onChange:l}),o(tb,{days:n.days,tariffs:u})]})})),sb=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],ob=(e,t)=>e?.find((e=>e.volume===t)),cb=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,db=`${Ut}/safeboxes`,mb=[];const ub=async e=>await Pt(e,{method:"GET"})||mb,hb=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=Bo(),p=pb(m.selectedRegion,h),f=function(e){const{data:t}=ga(e?`${db}?regionCode=${e}`:null,ub);return t||mb}(p),x=l((e=>u((t=>({...t,...e})))),[u]),y=(b=lb(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(rb,{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(Za,{points:y,className:"h-[640px]"}):null]})})),pb=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,gb=e=>e<4?"w-72":"w-52",fb={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"},xb=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=fb,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:xm(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:am(o("div",{className:u("h-0.5 w-full bg-secondary-light flex-1",p)}))(i.map(yb(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",gb(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(Ae,{__html:e.__html,itemSize:"list-s",isDotted:d})]})]}),s?.text?o(Ne,{className:"box-border py-s w-full mt-auto",version:i,...s,children:s?.text}):null]},String(t))}))})]}):null,qe(e)]});var x})),yb=(e,t,n)=>({icon:a},i)=>{const l="secondary"===n?"white":"color";return o(g,{defaultPadding:"",className:`${bb(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},bb=e=>e?"h-16 w-16":"h-24 w-24",vb=d((()=>o("div",{className:"hidden",role:"none"}))),Nb="hidden sm:flex absolute z-40",wb={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},Cb=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(Td,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:wb[l].item,gap:wb[l].gap,children:t.map(Qx(n,a,l))}),s.canScrollLeft?o(Ld,{className:u("left-6",Nb,wb[l].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o($d,{className:u("right-6",Nb,wb[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"})},kb={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},Ib=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(kb[t].wrapper,e),children:o(Cb,{className:kb[t].component,tabsType:t,...n})}):null,Tb=Ft((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=Rb(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(Db(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=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:[Ib({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:Bb(t,x),activeItem:N,tabsType:r,onChange:S}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:Object.entries(n?.slots??{}).map((([e,t])=>B(t,{...m?.options,slotName:C,parent:n,extraProps:{className:e===C?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(Pb)?.filter(Boolean)||[]}),Rb=({__id:e,anchor:t})=>t??e??"tabs",Bb=(e,t)=>t?.length?t:e,Pb=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",Db=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),Ab={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},Eb=d((({children:e,activeIndex:t,columnWidth:n,version:a="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:Ab[a],style:{transform:`translateX(-${t*n}px)`},children:e})}))),_b=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}))),Mb={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(Ae,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(_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(_b,{className:"w-fit",isOpen:i,onClick:()=>{t({tableSource:n,pdfUrl:a})}}):null},Ob=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 zb({cell:e,cellProps:{rowIdx:n,cellIdx:l,fieldIdx:t,displayTable:e=>{m(!1),c(l),r(e)},isVisible:d}})})),zb=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...a}=e;if(!n||!(n in Mb))return null;return o(Mb[n],{...t,...a})},Fb=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(Ob,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:i,openTableInnerIdx:l,setOpenTableInnerIdx:r},String(s)))):null}))),Vb=(e,t)=>140*Gg(e.slice(0,t).map((e=>e?.cols?.length??1))),Lb=(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,$b=d((({rows:e})=>{const t=e?.[0]?.length??0,[n,a]=rx({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(-${Vb(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?Lb(e.cols,i):null]},`row${t}`)))})})]},String(t))})),sx({...a,btnClass:["left-3 top-20","right-3 top-20"],className:""})]});var i})),qb=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($b,{rows:t.rowsData})})})]},a)}))}))),jb=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Ub=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:jb(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]}))),Wb=Ft((({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(Ub,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(qb,{activeTabIndex:r,items:m}),o(_b,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(_e,{size:"text-h6",children:"Данных нет"}),o(_b,{onClick:n,isOpen:!0})]})})),Hb=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(Wb,{...t,onClick:n})}):null]}))),Yb=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(Hb,{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(Eb,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(Fb,{cells:e,rowIdx:i,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})})),Gb=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,sx({...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]})})),Kb=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]=rx({itemCount:m,visibleItemCount:2}),f=(d||[]).map(((e,t)=>o(Yb,{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(ri,{renderFoldableSection:({isUnfolded:e})=>c(Gb,{controls:p,children:[x,o(si,{isUnfolded:e,children:y})]}),renderFoldButton:Jd}):o(Gb,{controls:p,children:f})})]})})),Xb=d((({className:e="",title:t,description:n,iconVersion:a,__html:i,richVersion:l,...r})=>c(g,{className:u("flex gap-s sm:gap-m group-data-secondary:bg-primary-main/10",e),...r,children:["small"===a?Jb():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,i?o(Ae,{richVersion:l,__html:i}):null]})]}))),Jb=()=>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}),Qb=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]}))),ev=d((e=>{const{prefix:t,unit:n,suffix:a,...i}=e;return o(g,{defaultPadding:"p-0",...i,children:o(Qb,{prefix:t,unit:n,suffix:a})})})),tv=Ft((({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",ax[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:P({...c,extraProps:{className:u("w-full",vd(r)),...nx(a)}})})}),{childrenTypes:[]}),nv=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",av=d((({className:e,title:t,url:n,previewImg:a,...i})=>{const l=D();return c(g,{className:e,defaultPadding:nv(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]})})),iv={AdTile:Lt,ApplicationForm:pc,ApplicationLeadForm:yd,BankAccountFiltration:gm,BenefitsBlock:vm,BonusBenefitsBlock:km,ButtonsBlock:Tm,CalculatorBonus:_m,CalculatorBusinessDeposit:Um,CalculatorCredit:Kr,CalculatorDeposit:ou,CalculatorRefinancing:fu,CardTransfer:Cu,Carousel:Du,CarouselCard:Mu,CarouselCatalogCard:zu,CarouselLinks:Lu,CarouselRecommendationCard:Gu,CarouselTariffsCard:Ju,ContactsBlock:Qu,CreditCardForm:Hh,CreditForm:Bp,DepositFiltration:_p,Depository:Xp,ErrorBlock:Zp,ExchangeRateTile:Bg,Footer:cf,GracePeriod:df,GrantSupport:pf,Header:Qf,Headline:S,HorizontalLayout:ix,ImgBlock:lx,InsuranceAmountBlock:ux,InvestmentInfo:fx,LinkDocs:Px,MobileAppTile:_x,MortgageFiltration:ny,OfficesAtmsMap:Py,Placeholder:Dy,ProductBlock:Vt,ProductGallery:Ey,RepresentativeOfficeInfo:My,RichTextBlock:Fy,RollupItem:jy,SafeDepositRental:hb,StepsBlock:xb,StickyBottomMenu:vb,TabsLayout:Tb,TariffsTable:Kb,TextBlock:Xb,UnitBlock:ev,VerticalLayout:tv,Video:av},lv=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))})),rv="cookie",sv=d((({__html:e})=>{const[t,{setTrue:n,setFalse:a}]=on();Wg((()=>{globalThis.localStorage?.getItem(rv)||n()}),[],3e3);const i=l((()=>{globalThis.localStorage?.setItem(rv,"true"),a()}),[]);return t&&e?o("div",{className:"container fixed left-0 right-0 bottom-0 z-50",role:"dialog",children:c("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[o("div",{className:"sm:flex-1",children:o(Ae,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(or,{className:"bg-main-gray rounded-md w-11 h-11",onClose:i})})]})}):null}));function ov(e){const t=l((({key:t})=>{"Escape"===t&&e()}),[e]);cn(globalThis.document,"keydown",t)}function cv(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 dv=()=>{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 cv(ue.observable,"dialog",{open:t,close:n,closeAll:i}),[e,{close:n,closeAll:i}]},mv=d((()=>{const[e,{close:t}]=dv(),n=Boolean(e.length);return ov(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})),uv=d((()=>{const[e,t]=a(null),n=l((()=>{t(null)}),[]);return cv(ue.observable,"popup",{open:t,close:n}),ov(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})),hv="header",pv="footer",gv="sticky-footer",fv={},xv=d((({className:e,data:t=fv,blocksRegistry:n,blockDecorator:a})=>{const{slots:i,blocks:l,fallback:r,...s}=t,d=Ot(s,r);lv(),tg();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?.[hv]?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:B(i?.[hv],{...m,slotName:hv})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[P({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),B(i?.[pv],{...m,slotName:pv})]})]}),i?.[gv]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:B(i?.[gv],{...m,slotName:gv})}):null,o(mv,{}),o(uv,{}),o(sv,{__html:d?.cookieContent?.__html})]})}));Object.assign(xv,{childrenTypes:[],slots:()=>[hv,pv,gv]});e.Blocks=iv,e.ContentPage=xv,e.handlerDecorator=ce,e.joinList=am,e.locationNavigator=Jt,e.packageVersion="0.14.705",e.projectSettings=E,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})}));
|