@redneckz/wildless-cms-uni-blocks 0.14.192 → 0.14.193

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.
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniMobileBlocks={})}(this,(function(e){"use strict";let t;const l=e=>(...l)=>t[e](...l),n=l("useState"),a=l("useEffect"),i=l("useCallback"),r=l("useMemo"),s=l("useRef");const 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,l){const{children:n,...a}=t||{},i=l?.slots?.default,r=n||i&&i();return e(Object.assign(a,r&&{children:r}),l)}return t.inheritAttrs=!1,t},h=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),u=d((({children:e})=>h?e:null));const p=new class{subscribers={};subjectsStateMap={};subscribe(e,t){this.subscribers[e]=(this.subscribers[e]||[]).concat(t);const l=this.subjectsStateMap[e];return l&&t(l),()=>{this.unsubscribe(e,t)}}unsubscribe(e,t){this.subscribers[e]=this.subscribers[e]?.filter((e=>e!==t))}fire(e,t){e in this.subjectsStateMap&&(this.subjectsStateMap[e]=t),this.subscribers[e]?.forEach((e=>e(t)))}subject(e,t){this.subjectsStateMap[e]=t}};function g(){return g._impl()}g._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),g.setup=e=>{g._impl=e};const x=(...e)=>e.flatMap((e=>e)).filter(Boolean).join(" "),f={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","":""},b=d((({className:e,version:t="primary",isTheme:l=!0,defaultPadding:i="p-xl",padding:r,block:s,tag:c="section",role:d,children:m,style:h})=>{const u=c,b=g(),[y,v]=n(!1);a((()=>p.subscribe("tab",(e=>{e.groupName&&e.groupName!==s?.labelGroup||v(Boolean(e.label&&s?.labels?.length&&!s.labels.includes(e.label)))}))),[s,b]);const N=t&&l;return o(u,{className:x("@container font-sans",N?"group":"",f[t],y?"hidden":"",r||i,e),...N?{"data-ver":t}:{},...s?.anchor?{id:s.anchor}:{},role:d,style:h,children:m})})),y={h1:"h1",h2:"h1",h3:"h2",h4:"h2",h5:"h3",h6:"h3"},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:l="h3",title:n,children:a})=>{const i=y[l]||"h3";return o(i,{role:"heading",className:x("font-sans m-0",v[t],e),children:n||a})})),w=d((({children:e,...t})=>o("p",{className:x("font-sans",Object.values(t)),children:e}))),k={XXL:{title:{headingType:"h0",as:"h1"},descriptionSize:"text-h5",descriptionWeight:"font-normal",descriptionStyle:"mt-xl"},XL:{title:{headingType:"h1",as:"h1"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},L:{title:{headingType:"h2",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},M:{title:{headingType:"h3",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-s"},S:{title:{headingType:"h4",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-xs"},XS:{title:{headingType:"h5",as:"h2"},descriptionSize:"text-m",descriptionWeight:"font-light",descriptionStyle:"mt-xs"}},S=d((({className:e,version:t="",headlineVersion:l="XL",title:n,description:a,align:i="text-center",as:r,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=k[l],u={marginTop:h.descriptionStyle};return c(b,{className:x(s?"@container-normal":"",e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[n?o(N,{className:x("whitespace-pre-wrap",i),...h?.title,as:r||h?.title.as,title:n}):null,a?o(w,{size:h.descriptionSize,font:h.descriptionWeight,align:i,...u,children:a}):null]})})),C=({blockClassName:e,block:t,render:l})=>l({blockClassName:e,block:t}),I=[];function T(e,t,{className:l,...n}={}){const{key:a,blockDecorator:i=C,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 i({blockClassName:x(e.style?.length?e.style:"col-span-12",l),block:e,ancestors:s,render:({block:l,blockClassName:i})=>{const{content:r}=l;return d?o(d,{className:i,block:e,options:t,...r,...n},a):null}},a)}const B=[],M=(e,{key:t,ancestors:l=B,slotName:n=null,extraProps:a,renderProps:i=T,...r})=>{const s=a?(e,t)=>T(e,t,a):i;return(e||[]).map(((e,a)=>s(e,{...r,key:`${t||e.type}-${a}`,ancestors:r.parent?[...l||B,[r.parent,n]]:l},a)))};function V({block:e,options:t,children:l,extraProps:n,renderProps:a}){return l||(e&&t?M(e.blocks,{...t,parent:e,extraProps:n,renderProps:a}):null)}const P=e=>e&&!e.endsWith("/")?`${e}/`:e,R=["CDN","BASE_PATH"],z=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const l=e._[t]||e[t];return R.includes(t)?P(l):l}}),A=e=>Boolean(e?.includes(":")),D=(e,t)=>Boolean(e&&!A(e)&&(!t||"_self"===t)),j=e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),F=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/");var E=Object.freeze({__proto__:null,isURL:A,isLocalURL:D,isHash:e=>Boolean(e?.startsWith("#")),withoutQuery:j,joinPath:F});const L="/api/",O=`${L}v1/storage`,$=e=>(t,l=z.BASE_PATH)=>{if(!t||A(t)||[z.CDN,L].some((e=>_(t,e))))return t;if(/^[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(t))return`${O}/${t}/file`;const n=t.startsWith("/");return F(_(t,l)?"":l,n?"/":e.pathname?.split("/").slice(0,-1).join("/"),t)},_=(e,t)=>t&&e&&e.startsWith(t),U={normal:"",color:"text-primary-main",black:"text-black",white:"text-black"},H=d((({className:e="",imageClassName:t="",name:l="",alt:n=`Иконка ${l}`,title:a=n,iconVersion:i="color",width:r,height:s})=>{const d=g(),m="normal"===i?`${l}.svg`:`sprites.svg#${l}`,h=$(d)(F(z.CDN,"/icons/",m));return"normal"===i?o("img",{className:e,src:h,alt:n,title:a,"aria-hidden":"true",width:r,height:s,style:W(e,s)}):o(q,{className:e,children:c("svg",{className:x(K(r),U[i],"white"===i?"invert":"",t),width:r,height:s,"aria-hidden":"true",children:[a?o("title",{children:a}):null,n?o("desc",{children:n}):null,o("use",{href:h,xlinkHref:h})]})})})),W=(e,t)=>{return e?.includes("h-")?{}:{height:(l=t,l&&!/\D/.test(l)?`${t}px`:t),width:"auto"};var l},K=e=>e?"":"w-full h-full",q=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),G=(e,t)=>l=>l&&!A(l)?$(e)(F(t,l)):l,Y=(e,t)=>e?.media&&t?.media?e.media-t.media:0,X=d((({className:e="",image:t,imageClassName:l="",pathPrefix:n})=>{const a=g();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(Y).map((({src:e,format:l,media:i},r)=>o("source",{srcSet:G(a,n)(e),type:Z(l),media:i?`(max-width: ${i}px)`:"",width:t?.size?.width,height:t?.size?.height},`${r}_${e}`))):null,t?.src?Q({...t,src:G(a,n)(t.src)},l):null]})})),Q=(e,t="")=>o("img",{src:e.src,className:x("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}),Z=e=>e?`image/${String(e)}`:void 0,J=d((({className:e="",image:t,imageClassName:l="",pathPrefix:n,...a})=>t?.src||t?.icon?t.icon?o(H,{className:e,imageClassName:l,iconVersion:t?.iconVersion,name:t.icon,...a}):o(X,{className:e,imageClassName:l,image:t,pathPrefix:n}):null)),ee={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","":""},te="bg-main-divider text-main-disabled",le={primary:te,secondary:te,white:te,link:"",transparent:"",gray:te,"":""},ne="text-center font-sans select-none",ae={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","":""},ie=({className:e,rounded:t,version:l})=>[ne,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",l?ee[l]:"",t?"rounded-full":"rounded-md",e].join(" "),re=()=>({open:(e,t={})=>p.fire("dialog",{type:"open",dialog:e,...t}),close:()=>p.fire("dialog",{type:"close"}),closeAll:()=>p.fire("dialog",{type:"close",all:!0})}),se=(e,t)=>se._impl(e,t);function oe(e={}){const{isRemote:t,basePath:l}=e,n=g(),{closeAll:a}=re();return e=>({...e,href:t&&!l?e.href:$(n)(e.href,l),"aria-label":e.text,onClick:se(i(e),e)});function i({href:e,target:l,onClick:i}){return r=>{i&&i(r),e&&!t&&D(e,l)&&(a(),r?.preventDefault(),n.push(e))}}}se._impl=e=>e,se.setup=e=>{se._impl=e};const ce=d((e=>{const{text:t,aboveText:l,appendLeft:n,appendRight:a,version:i="primary"}=e,r=me(e)?"hidden lg:block":"";return c("div",{className:x(de(e),"flex gap-xs"),children:[n?o("div",{className:x(r,ae[i]),children:n}):null,me(e)?c("div",{className:"whitespace-pre",children:[l?o("div",{className:"text-xs font-light text-left",children:l}):null,o("div",{className:"text-left "+(l?"text-s -mt-3xs":"text-l"),children:t})]}):null,a?o("div",{className:x(r,ae[i]),children:a}):null]})})),de=e=>{const{version:t,aboveText:l,rounded:n}=e;if("link"===t)return"";const a=""+(l?"py-2.5 px-9":"py-4 px-9");return x("group/btn items-center justify-center",me(e)?a:"h-12 w-12 m-auto",n?"rounded-full":"")},me=({text:e,aboveText:t,appendLeft:l})=>Boolean(e||t||!l),he=({className:e,rounded:t,version:l})=>["inline-block",ne,l?le[l]:"",t?"rounded-full":"rounded-md",e].join(" "),ue=d((({disabled:e,children:t,method:l="LINK",href:n,...a})=>{const r=(({method:e,href:t})=>i((l=>{if("POST"!==e||!t)return;l.preventDefault();const{origin:n,pathname:a,searchParams:i}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[n,a].join(""));for(const[e,t]of i.entries()){const l=document.createElement("input");l.setAttribute("type","hidden"),l.setAttribute("name",e),l.setAttribute("value",t),r.appendChild(l)}document.body.appendChild(r),r.submit()}),[]))({method:l,href:n}),s=oe()({onClick:r,href:n,...a}),c=t??o(ce,{...s});return o(e?ge:pe,{...s,children:c})})),pe=d((({className:e="",href:t,rel:l,target:n,ariaLabel:a,version:i,rounded:r,onClick:s,type:c,children:d})=>o("a",{className:ie({className:e,version:i,rounded:r}),href:t,rel:l,target:n,"aria-label":a,role:t?"link":"button",onClick:s,type:c,children:d}))),ge=d((({className:e,ariaLabel:t,version:l,rounded:n,children:a})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:he({className:e,rounded:n,version:l}),children:a})));function xe(e,t){const l="primary"===e?"white":"black",n="Вернуться назад";return c("div",{className:"hidden sm:flex items-center gap-s",children:[o("div",{className:ie({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",version:e,rounded:!0}),onClick:t,children:o(J,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:l}})}),o(ue,{version:"link",className:"group-data-secondary:text-white/80",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const fe={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},be=d((({className:e,version:t="primary",defaultPadding:l,padding:n="",title:a="",insetTitle:r="",buttons:s,leftImage:d,rightImage:m,imageAlign:h,isImageAlwaysOnRight:u=!1,isImageSecondary:p=!1,backwardButton:f,children:b,...y})=>{const v=g(),N=i((()=>{v.back()}),[]);return c("div",{className:ye(n,l,e),children:[f?xe(t,N):null,a?o("div",{className:"relative h-full",children:a}):null,c("div",{className:x("grow relative flex flex-col @xl:flex-row gap-3xl w-full",d?"self-start @xl:w-auto":""),children:[Se(d,{imageAlign:h,className:"mx-auto"}),c("div",{className:x("grid gap-3xl",m?"@xl:grid-cols-2":"",d?"":"grow","h-full","auto-rows-[max-content_1fr]"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[r,b]}),ke(V({...y,extraProps:{className:"@container-normal"}})),Se(m,{className:x("@xl:justify-self-end @xl:col-start-2",s?ve(u):"",Ne(u),Ce(p)),imageAlign:h}),we(s)]})]})]})})),ye=(e="",t="",l="")=>x("relative flex flex-col gap-3xl overflow-hidden",e||t,l),ve=e=>e?"row-span-2":"@xl:row-span-2",Ne=e=>e?"col-start-2 self-center":"",we=e=>e?o("div",{className:"self-end",children:e}):null,ke=e=>e&&e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Se=(e,{className:t,imageAlign:l})=>e?o("div",{className:x("shrink-1/2 justify-self-center",l&&fe[l],t),children:e}):null,Ce=e=>e?"hidden @xl:block":"",Ie=(e=[])=>e.reduce(((e,t)=>e+t),0),Te=(e=[])=>e?.length?Ie(e)/e.length:0,Be=(e,t="normal")=>e?o("div",{className:x("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(J,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,Me=d((e=>{const{__html:t="",richVersion:l=""}=e;return t.replace(/<\/?[^>]+\/?>/g,"").trim()?o("div",{"data-component":"rich-text-container",children:o("div",{className:x(l,"md-container"),dangerouslySetInnerHTML:{__html:t}})}):null})),Ve=(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,Pe=d((({children:e,...t})=>o("span",{className:x("font-sans",Object.values(t)),children:e}))),Re=(e,t)=>e?o(Pe,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,ze=(e,t)=>"rte"===e.type&&"__html"in e&&e.__html?o(Me,{...e},`rte-${t}`):["label"in e?Re(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Ve(e.description,t)},String(t)):null],Ae=d((({className:e,benefitsVersion:t,...l})=>c("div",{className:x("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in l?Be(l.icon,t):null,o("div",{children:ze(l)})]}))),De=e=>"rte"===e.type?e?.__html?.length||0:Math.max(e?.label?.length||0,e?.description?.length||0),je=e=>{return((t=e.map(De))?.length?Math.sqrt(Math.abs(Te(t.map((e=>e**2)))-Te(t)**2)):0)>16;var t},Fe=e=>e&&"icon"in e&&e.icon&&(e.icon.icon||e.icon.src),Ee=e=>!e.some(Fe),Le=d((({className:e,benefitsVersion:t="normal",benefits:l})=>l?.length?o("div",{className:x("flex gap-x-m gap-y-s",je(l)||Ee(l)?"flex-col":"flex-wrap",e),role:"list",children:l.map(((e,l)=>o(Ae,{benefitsVersion:t,...e},String(l))))}):null)),Oe=d((({className:e,benefits:t})=>t?.length?o("div",{className:x("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap(ze)}):null)),$e=d((({isTabularBenefits:e,...t})=>o(e?Oe:Le,{...t}))),_e=e=>Boolean(e?.src||e?.icon),Ue=(e,{className:t,buttonClassName:l,isVertical:n}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:x("flex",n?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m",t),role:"group",children:e.map(He(l))}):null,He=(e="")=>(t,l)=>{const{text:n,icon:a,iconRight:i,version:r,...s}=t||{},c=We(a,r),d=We(i,r);return n||a?.icon?o(ue,{className:x("basis-full @lg:basis-auto",e),appendLeft:Ke({...a,iconVersion:c}),appendRight:Ke({...i,iconVersion:d}),version:r,text:n,...s},l?String(l):""):null},We=(e,t="secondary")=>{const l="secondary"===t?"color":"white";return e?.iconVersion?e?.iconVersion:l},Ke=e=>_e(e)?o(J,{image:e,width:String(e?.size?.width||24),height:String(24)}):null,qe=d((({className:e,isDotted:t,dotClassName:l,children:n})=>c("div",{className:x("font-sans flex",e),role:"listitem",children:[t?o("div",{className:"shrink-0",children:o("div",{className:x("align-middle inline-block rounded-full group-data-secondary:bg-white",l)})}):null,o("span",{children:n})]}))),Ge={S:{textSize:"text-l font-light",indentStyle:"ml-xs",dotStyle:"w-1 h-1 mr-xs"},M:{textSize:"text-h6",indentStyle:"ml-s",dotStyle:"w-1.5 h-1.5 mr-s"},L:{textSize:"text-h5",indentStyle:"ml-m",dotStyle:"w-1.5 h-1.5 mr-m"}},Ye=d((({className:e,isDotted:t=!0,items:l=[],listItemSize:n="M",dotClassName:a=""})=>{const i=Ge[n];return l?.length?o("section",{className:x("flex flex-col gap-xs text-left text-primary-text group-data-secondary:text-white group-data-gray:text-secondary-text",i.textSize,e),role:"list",children:l.map(((e,l)=>o(qe,{isDotted:t,dotClassName:x(a||"bg-primary-text",i.dotStyle),children:e},String(l))))}):null})),Xe=(e=0,{fixed:t}={})=>(l=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(l)||0),Qe=d((({priceList:e})=>e?.length?o("div",{className:"flex flex-wrap xl:flex-nowrap xl:bg-main-divider xl:rounded-md p-xs gap-xl",role:"list",children:e.map(Ze)}):null)),Ze=({label:e,amount:t},l)=>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(Pe,{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:[Xe(2)(t)," ₽"]}):null]},String(l)),Je=d((({className:e,tags:t})=>t?.length?o("div",{className:x("flex flex-wrap gap-xs",e),role:"list",children:t.map(et)}):null)),et=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(Pe,{size:"text-m",font:"font-light",children:e})},String(t)),tt={XXL:"L",XL:"L",L:"M",M:"M",S:"S",XS:"S"},lt=d((({className:e,padding:t,defaultPadding:l,title:n,description:a,headlineVersion:i="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:d,benefits:m,__html:h,isFullWidthTitle:u,items:p,isDotted:g=!0,priceList:x=[],tags:f=[],buttons:b,image:y,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:k=!1}={},backwardButton:C,children:I,...T})=>{const B=y?.src?o(J,{image:y}):null,M=o(S,{title:n,description:a,headlineVersion:i,align:r,isEmbedded:!0}),V=m?.filter((e=>"rte"===e?.type||"label"in e||"description"in e));return o(be,{className:e,padding:t,defaultPadding:l,...u?{title:M}:{insetTitle:M},...nt(B,N),isImageSecondary:k,imageAlign:v,isImageAlwaysOnRight:w,buttons:Ue(b),backwardButton:C,...T,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[V?.length?o($e,{benefitsVersion:s,isTabularBenefits:d,benefits:V}):null,h?o(Me,{__html:h}):null,p?.length?o(Ye,{items:p,isDotted:g,listItemSize:tt[i]}):null,I,x?.length?o(Qe,{priceList:x}):null,at(f)]})})})),nt=(e,t)=>t?{rightImage:e}:{leftImage:e},at=e=>e?.length?o(Je,{tags:e}):null,it=e=>Boolean(e&&Array.isArray(e)),rt=e=>Boolean(e&&!Array.isArray(e)&&"object"==typeof e),st=(e,t)=>{return l=e,Boolean(rt(l)&&"string"==typeof l.$ref)?t.ref(e):rt(e)?t.record(e):it(e)?t.array(e):t.scalar?t.scalar(e):e;var l},ot=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(ct,e),ct=(e,t)=>e&&t?rt(e)?e[t]:it(e)?e[parseInt(t,10)]:e:e,dt=(e,t)=>st(e,{ref:({$ref:e,...l})=>dt(e?ot(t(e),e):l,t),record:e=>Object.entries(e).map((([e,l])=>({[e]:dt(l,t)}))).reduce(((e,t)=>Object.assign(e,t)),{}),array:e=>e.map((e=>dt(e,t)))}),mt=(e,t,l=[])=>{st(e,{ref:e=>t(e.$ref,l),record:e=>{for(const n in e)mt(e[n],t,[...l,n])},array:e=>{for(let n=0;n<e.length;n++)mt(e[n],t,[...l,n])}})};async function ht(e,t){try{return e?await ut(e,t):null}catch(e){console.error(e)}return null}const ut=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),pt=e=>[...new Set(e)],gt={},xt=["/portal-resources"],ft=(e,t)=>{const l=(e=>{const t=[];return mt(e,(e=>t.push(e))),t})(e),[i,r]=n({});return a((()=>{l.length&&(async e=>Object.fromEntries((await Promise.allSettled(pt(e).filter((e=>!xt.some((t=>e.startsWith(t))))).map((async e=>[e,gt[e]||=await ut(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(l).then(r)}),[l.join()]),l.length?dt(e,(e=>i[e]||t?.[e])):e};function bt(e,t={}){const l=d((t=>{const l=ft((({block:e,options:t,className:l,defaultPadding:n,padding:a,isTheme:i,version:r,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...l})}));return Object.assign(l,t),l}const yt=bt((({className:e,padding:t,...l})=>o(b,{className:x("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...l,children:o(lt,{defaultPadding:"p-6xl",padding:t,className:"grow h-full",...l})})),{childrenTypes:["UnitBlock"]}),vt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},l=r((()=>Nt(0,t?.length)),[t]),n=t?.[l];return n?o(u,{children:o(yt,{...n,...e})}):null})),Nt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),wt=e=>e?.replace(/[^+\d]/g,"");function kt(){return{send:async function(e,t=!1){const l=t?"/api/v1/lead":"/api/v1/sendcorporatelead",{typeForm:n,region:a,phone:i="",email:r,birthday:s,inn:o,fullName:c,addressBranch:d,secondaryPhone:m="",bankEmpolee:h,applicationDate:u,...p}=e,g={typeForm:n,[t?"regionBranch":"region"]:a,[t?"phoneNumber":"phone"]:wt(i),[t?"email":"mail"]:r,...t?{birthday:s}:{inn:o,fullName:c},..."FEEDBACK"===n?{}:{addressBranch:d,bankEmpolee:h,applicationDate:u,...St(m)},...p};try{const e=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(g)});if(!e?.ok)return null;return await e.json()}catch(e){return null}}}}const St=e=>e&&"+7 ("!==e?{secondaryPhoneNumber:wt(e)}:{},Ct=d((({responseType:e})=>{const t="OK"===e,l=t?"ResponseOKIcon":"ResponseFailIcon";return c("div",{className:x("flex items-center p-lg rounded-md space-x-m",t?"bg-ok":"bg-fail"),children:[o(J,{image:{icon:l,iconVersion:"normal"},width:"42",height:"42"}),c("div",{children:[o(N,{headingType:"h6",title:t?"Ваша заявка отправлена":"Не удалось отправить заявку",className:"mb-2xs"}),o(Pe,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t?"Совсем скоро мы с вами свяжемся":"Пожалуйста, повторите позднее"})]})]})})),It=e=>e,Tt=(e,{resetOnSubmit:t,onSubmit:l}={})=>{const[a,r]=n(e),[o,c]=n(!1),[d,m]=n({}),h=s({}),u=i(((e,t)=>{const{parse:l=It,format:n=It}=t||{};return h.current||(h.current={}),h.current[e]||=t=>{r((n=>({...n,[e]:l(t)}))),m((t=>({...t,[e]:!0})))},{value:n(a[e]),isDirty:o||d[e],onChange:h.current[e]}}),[a,o,d]),p=i((e=>{r(e),m(e)}),[]),g=i((()=>{r(e),c(!1),m({})}),[e]),x=i((e=>{e.preventDefault(),t?g():c(!0),l&&l(a)}),[l,a]);return[a,{isDirty:o||Object.values(d).some(Boolean),field:u,update:p,reset:g,onSubmit:x}]},Bt=d((({value:e=!1,text:t,type:l="checkbox",onChange:n})=>c("div",{role:l,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>n&&n(!e),children:[o("div",{className:x("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:x("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(Pe,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),Mt=e=>t=>t&&Object.entries(e).flatMap((([e,l])=>l(t[e])))||[],Vt=e=>!e?.length,Pt=e=>t=>l=>e(l)?[]:[t],Rt=d((({text:e,link:t})=>c(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:[o(Pe,{children:e}),t?o(ue,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"text-primary-main",children:o(Pe,{children:t.text})}):null]}))),zt="container space-y-lg",At="w-full max-w-xl space-y-s m-auto",Dt=d((({key:e,className:t="",id:l,name:n,type:r="text",label:d,placeholder:m,value:h="",valid:u=!0,children:p,onChange:g,onFocus:f,onBlur:b,pattern:y,autoFocus:v=!1,isTextarea:N=!1})=>{const w=s(null),k=i((e=>{g&&g(e.target?.value||"")}),[g]);a((()=>{v&&w.current?.focus()}),[v,w]);const S="w-full border rounded-md text-primary-text outline-none p-m",C=p?"pr-3xl":"",I=Ft(u);return c("div",{className:x("relative",t),children:[c("label",{children:[d?jt(d):null,N?o("textarea",{className:x("block resize-y min-h-24",S,I),id:x("textarea",l),name:n||l,placeholder:m,value:h,onInput:k,onFocus:f,onBlur:b},e):o("input",{type:r,className:x("h-14",S,C,I),ref:w,id:l,name:n||l,placeholder:m,value:h,onInput:k,onFocus:f,onBlur:b,pattern:y},e)]}),p]})})),jt=e=>o("div",{className:"mb-xs",children:o(Pe,{size:"text-m",font:"font-light",children:e})}),Ft=e=>e?"border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text":"border-error",Et=e=>o("div",{className:"h-4",children:e?o(Pe,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),Lt=d((({className:e,label:t,value:l="",placeholder:n,error:a,onChange:i,onBlur:r,isTextarea:s,...d})=>c("div",{className:x("shrink-0 w-full",e),children:[o(Dt,{type:"text","aria-label":t,label:t&&d?.errors?`${t}*`:t,valid:Boolean(!a),value:l,onChange:i,onBlur:r,isTextarea:s,placeholder:d?.errors&&!t?`${n}*`:n}),Et(a)]}))),Ot=(e,t)=>{const{value:l,isDirty:n}=e,a=n?t(l):[];return{...e,errors:a,error:a[0]}},$t=d((({title:e,children:t})=>c("fieldset",{className:"grid @xl:flex @xl:justify-between gap-lg border-b border-b-main-divider @xl:border-none",children:[e?o("legend",{className:"w-full",children:o(N,{title:e,headingType:"h6",className:"@xl:text-center"})}):null,t]}))),_t="@xl:w-1/2 space-y-s",Ut=e=>"_"===e,Ht=e=>/\d/.test(e),Wt=e=>Ut(e)||Ht(e),Kt=[..."+7 (___) ___-__-__"],qt=Kt.findIndex(Ut),Gt=Kt.map(((e,t)=>Wt(e)?Kt.slice(0,t).filter(Wt).length:-1));const Yt=d((({children:e,onChange:t,...l})=>{const n=i((e=>t&&t(function(e){const t=e.replace(/\D/g,""),l=Kt.map(((e,l)=>Ht(e)?e:t.charAt(Gt[l])||e)),n=Gt.indexOf(t.length-1)+1;return(n?l.slice(0,Math.max(qt,n)):l).join("")}(e))),[t]);return o(Dt,{onChange:n,onFocus:e=>n(e?.target?.value||""),...l,children:e})})),Xt=d((({className:e,label:t,value:l,error:n,onChange:a,onBlur:i,...r})=>c("div",{className:x("shrink-0 w-full",e),children:[o(Yt,{"aria-label":t,label:r?.errors?`${t}*`:t,valid:Boolean(!n),value:l,onChange:a,onBlur:i,placeholder:"+7 (___) ___-__-__"}),Et(n)]}))),Qt="Некорректно заполненное поле",Zt=Pt((e=>null!=e&&""!==e))(Qt),Jt=Pt((e=>e?.key&&""!==e?.key))(Qt),el=Pt((e=>"string"==typeof e&&e.length>1))(Qt),tl=Pt((e=>"string"==typeof e&&(10===e.length||12===e.length)))(Qt),ll=(nl=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,Pt((e=>"string"==typeof e&&nl.test(e))))(Qt);var nl;const al=Pt((e=>"boolean"==typeof e&&e))(Qt),il=(e,t)=>c($t,{title:t,children:[c("div",{className:_t,children:[o(Lt,{label:"Наименование организации",...Ot(e("fullName"),Zt)}),o(Lt,{label:"Контактное лицо",...Ot(e("name"),el)})]}),c("div",{className:_t,children:[o(Lt,{label:"ИНН",...Ot(e("inn"),tl)}),o(Xt,{label:"Телефон",...Ot(e("phone"),ll)})]})]}),rl=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],sl=e=>null!=e,ol=new Map,cl=e=>Boolean(e?.every((e=>Array.isArray(e)?cl(e):!e||"string"==typeof e))),dl=e=>cl(e)?e.toString():"";function ml(e,t,{fallback:l,cache:i}={}){const s=r((()=>hl(e)),[e]),[o,c]=n(void 0),[d,m]=n(void 0);a((()=>{if(!s.some(sl))return;let e=!1;const l=(t,l)=>{e||(c(t),m(l))};return(async()=>{try{l(await((e,t=ol)=>l=>{const n=dl(l),a=t.get(n);if(n&&sl(a))return a;const i=e(...l);return n&&sl(i)&&t.set(n,Promise.resolve(i)),i})(t,i)(s))}catch(e){l(void 0,e)}})(),()=>{e=!0}}),[t,i,s]);const h=l&&(e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]))(s)&&l[s[0]];return{data:!o&&h?h:o,error:d,mutate:()=>Promise.resolve(void 0)}}function hl(e){return Array.isArray(e)?e:e instanceof Function?hl(e()):[e]}function ul(){const{data:e}=ml("/api/v1/regions",ut);return e||[]}function pl(e=!1){const[t,l]=n(e),a=i((()=>l(!0)),[]),r=i((()=>l(!1)),[]),s=i((()=>l((e=>!e))),[]);return[t,{setValue:l,setTrue:a,setFalse:r,toggle:s}]}const gl=e=>e?.text||e?.key||"";function xl(e,t,l,n){a((()=>{if(e&&l)return e.addEventListener(t,l,n),()=>{e.removeEventListener(t,l,n)}}),[e,t,l])}function fl(e){const t=s(null),l=i((l=>{t&&t.current&&l.target instanceof Node&&!t.current.contains(l.target)&&e()}),[e]);return xl(globalThis.document,"click",l),t}const bl=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,yl=d((({popupRef:e,options:t,value:l,query:n,onChange:a,iconVersion:i})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md",role:"list",ref:e,children:bl(t,n).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===l?.key,onClick:t=>{t.stopPropagation(),a&&a(e)},children:[o("span",{className:"min-h-6",children:gl(e)}),o(H,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:i,className:x("absolute right-4 pt-3xs",e.key===l?.key?"":"hidden")})]},e.key)))}):null));function vl({isOpen:e,options:t,value:l,query:n,onChange:r,onClose:c,iconVersion:d}){const m={open:(e,t)=>p.fire("popup",{type:"open",popup:e,...t}),update:(e,t)=>p.fire("popup",{type:"update",popup:e,...t}),close:()=>p.fire("popup",{type:"close"})},h=i((()=>{m.close(),c&&c()}),[c]),u=i((e=>{h(),r&&r(e)}),[h,r]),g=s(null),x=fl(h);return a((()=>{if(!e||!g.current)return;const a=g.current,{top:i,left:r,width:s,height:c}=a.getBoundingClientRect();m.update(o(yl,{popupRef:x,options:t,value:l,query:n,onChange:u,iconVersion:d}),{top:i+window.scrollY+c,left:r,width:s})}),[e,t,l,n,u]),g}const Nl=d((({className:e,label:t,options:l=[],value:a,valid:r=!0,isBorder:s=!0,placeholder:d="",isSearch:m=!1,iconVersion:h,onChange:u})=>{const[p,{setFalse:g,setTrue:f}]=pl(),[b,y]=n(""),v=i((()=>{y(""),g()}),[]),N=vl({isOpen:p,options:l,value:a,query:b,onChange:u,onClose:v,iconVersion:h});return c("div",{className:e,children:[wl(t),c("div",{className:x("relative",p?"z-20":"z-10"),ref:N,children:[c("div",{className:x("h-14 text-l flex justify-between items-center text-primary-text cursor-pointer relative z-10",Sl(s,r)),onClick:p?v:f,children:[o("p",{className:"p-m pr-8 flex items-center overflow-hidden text-ellipsis",children:gl(a)||d}),kl(p,h)]}),m&&p?o("div",{className:x("absolute top-0 w-full z-20"),children:o(Dt,{type:"text",autoFocus:!0,value:b,onChange:y})}):null]})]})})),wl=e=>e?o("div",{className:"mb-xs",children:o(Pe,{size:"text-m",color:"text-primary-text",font:"font-light",children:e})}):null,kl=(e,t)=>o(H,{className:x("absolute right-3",e?"":"rotate-180"),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),Sl=(e,t)=>x(e?"border rounded-md hover:border-primary-hover":"",t?" border-gray":"border-error"),Cl=d((({className:e="",label:t,error:l,...n})=>c("div",{className:e,children:[o(Nl,{...n,valid:!l,label:n?.errors?`${t}*`:t}),Et(l)]}))),Il=d((({field:e})=>{const t=ul();return o(Cl,{className:"w-full",label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:t.map((({code:e="",name:t=""})=>({key:e,text:t}))),...Ot(e("region"),Jt)})})),Tl=({field:e,title:t})=>c($t,{title:t,children:[o("div",{className:_t,children:o(Cl,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:rl,...Ot(e("acquiringType"),Zt)})}),o("div",{className:_t,children:o(Il,{field:e})})]});function Bl({disabled:e,onClick:t}){return l=>{!e&&t&&t(l)}}const Ml={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"},Vl={primary:x("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:x("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")},Pl=d((({children:e,...t})=>{const l=e=>({...e,onClick:se(Bl(e),e)}),{className:n,version:a="primary",active:i,disabled:r,type:s="button",rounded:c=!0,role:d,onClick:m}=l(t);return o("button",{className:x("font-sans px-9 py-4","flex justify-center items-center gap-xs",i?"text-white bg-primary-active":"",r?"bg-main-gray text-main-disabled cursor-not-allowed":"",i||r?"":x(Ml[a],Vl[a]),c?"rounded-md":"",n),type:s,role:d,onClick:m,children:e})})),Rl=(e,t)=>o(Pl,{className:x("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),zl={typeForm:{key:"acqr",text:"Предупреждение о мошенничестве"},acquiringType:{key:"trade",text:"Торговый эквайринг"},fullName:"",inn:"",name:"",phone:"",onlineCheckout:!1,posTerminal:!1},Al=Mt({acquiringType:Zt,region:Zt,fullName:Zt,inn:tl,name:el,phone:ll}),Dl=d((e=>{const{button:t,link:l,onSubmit:n}=e,a=i((e=>{const{acquiringType:t,onlineCheckout:l,posTerminal:a,...i}=e,r=jl(t?.key),s={partnerComments:`Вид эквайринга=${t?.text||""}${r?`/Онлайн касса=${l}/POS-терминал=${a}`:"/Онлайн касса=false/POS-терминал=false"}`,...i};Vt(Al(e))&&n(s,!1)}),[n]),[,{field:r,...s}]=Tt(zl,{onSubmit:a}),d=jl(r("acquiringType").value?.key);return c("form",{className:zt,onSubmit:s.onSubmit,children:[Tl({field:r,title:"Вид эквайринга и регион"}),il(r,"Данные организации"),d?c("div",{role:"radiogroup",children:[o(Bt,{type:"radio",text:"Хочу онлайн-кассу",...r("onlineCheckout")}),o(Bt,{type:"radio",text:"Хочу купить POS-терминал",...r("posTerminal")})]}):null,Rl(t),o(Rt,{link:l})]})})),jl=e=>"all"===e||"trade"===e,Fl={typeForm:{key:"bcrd",text:"Заявка на бизнес-карту"},name:"",phone:"",inn:"",email:""},El=Mt({region:Zt,name:el,phone:ll,inn:tl,email:Zt}),Ll=d((e=>{const{button:t,link:l,onSubmit:n}=e,a=i((e=>{Vt(El(e))&&n(e)}),[n]),[,{field:r,...s}]=Tt(Fl,{onSubmit:a});return c("form",{className:zt,onSubmit:s.onSubmit,children:[o(Il,{field:r}),c($t,{children:[c("div",{className:_t,children:[o(Lt,{label:"Контактное лицо",...Ot(r("name"),el)}),o(Lt,{label:"ИНН",...Ot(r("inn"),tl)})]}),c("div",{className:_t,children:[o(Xt,{label:"Телефон",...Ot(r("phone"),ll)}),o(Lt,{label:"Электронная почта",...Ot(r("email"),Zt)})]})]}),Rl(t),o(Rt,{link:l})]})})),Ol=[];const $l=async e=>await ht(e,{method:"GET"})||Ol;function _l(){const{data:e}=ml("/api/v1/premiumBranchesByRegions",ut);return e||[]}const Ul=d((({field:e,regionKey:t,isPremium:l=!1})=>{const n=l?_l().find((e=>e?.region===t))?.branches:function(e){const{data:t}=ml(e?`/api/v1/branches?regionCode=${e}`:null,$l);return t||Ol}(t).filter((e=>e?.address));return o(Cl,{label:"Адрес",placeholder:"Выберите адрес",options:(n||[]).map((({address:e=""})=>({key:e,text:e}))),...Ot(e("addressBranch"),Jt)})})),Hl=["От 1 000 ₽","До 1 000 000 000 ₽"],Wl=["От 1 мес","До 15 лет"],Kl=(e,t)=>c($t,{title:t,children:[c("div",{className:_t,children:[o(Lt,{label:"Наименование организации",...Ot(e("fullName"),Zt)}),o(Lt,{label:"ИНН",...Ot(e("inn"),tl)}),o(Xt,{label:"Телефон",...Ot(e("phone"),ll)})]}),c("div",{className:_t,children:[o(Lt,{label:"Годовая выручка, ₽",...Ot(e("annualRevenue"),Zt)}),o(Lt,{label:"Контактное лицо",...Ot(e("name"),el)}),o(Lt,{label:"Электронная почта",...Ot(e("email"),Zt)})]})]}),ql=(e,{normalize:t,format:l})=>{const{value:a,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=n(!1),m=i((e=>{d(!0),r&&r(e)}),[]),h=i((()=>{d(!1),o&&o(t(a)),s&&s()}),[o,a]);return{value:c||!l?a:l(a),onFocus:m,onBlur:h}},Gl=(e,t,l)=>Math.max(t,Math.min(e,l));function Yl(e){const t=(e||"").replace(/\D/g,""),l=parseInt(t,10);return Number.isNaN(l)?0:l}function Xl({list:e=[],min:t,max:l,step:n,value:a=e[0]||t,disabled:i,onChange:r}){const s=e.length?e.indexOf(a):a,d={backgroundSize:`${(100*(s>t?s-t:0)/(l-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:x("w-2 h-2 rounded-full",s<=t||i?"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:l,step:n,value:s,disabled:i,onInput:t=>{const l=Yl(t.target?.value),n=e.length?e[l]:l;r&&r(n||0)}})})]})}const Ql=1,Zl=100,Jl=d((e=>{const{className:t,title:l,items:n=[],list:a=[],min:r=(a.length?0:Ql),max:s=(a.length?a.length-1:Zl),step:d=1,value:m=a[0]||r,disabled:h=!1,onChange:u}=e,p=ql(e,{normalize:(e=0)=>a.length?en(a)(e):Gl(e,r,s),format:Xe()}),g=i((e=>{u&&u(Yl(e.target?.value))}),[u]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[l?o(Pe,{size:"text-m",font:"font-light",color:"text-primary-text",children:l}):null,o("input",{className:x("mt-xs font-sans text-h3 w-full h-14","border border-solid border-gray rounded-md outline-none","pl-m box-border","text-primary-text hover:border-primary-hover focus:border-primary-text","disabled:border-gray disabled:bg-main-divider"),disabled:h,onInput:g,...p}),Xl({list:a,min:r,max:s,step:d,disabled:h,value:m,onChange:u})]}),tn(n)]})})),en=e=>t=>e.reduce(((e,l)=>Math.abs(l-t)<Math.abs(e-t)?l:e)),tn=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Pe,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),ln=(e,t)=>c($t,{title:t,children:[o("div",{className:_t,children:o(Jl,{title:"Сумма, ₽",items:Hl,min:1e3,max:1e9,...e("amount")})}),o("div",{className:_t,children:o(Jl,{title:"Срок, месяцев",items:Wl,min:1,max:180,...e("term")})})]}),nn={typeForm:{key:"cred",text:"Кредит"},amount:1e3,term:12,fullName:"",inn:"",name:"",phone:"",email:"",annualRevenue:""},an=Mt({fullName:Zt,annualRevenue:Zt,inn:tl,name:el,phone:ll,region:Zt}),rn=d((({button:e,link:t,onSubmit:l})=>{const n=i((e=>{const{amount:t,term:n,addressBranch:a,annualRevenue:i,...r}=e;Vt(an(e))&&l({...r,addressBranch:a?.text||"",partnerComments:`Сумма=${t}/Срок=${n}/Выручка=${i}`})}),[l]),[a,{field:r,...s}]=Tt(nn,{onSubmit:n});return c("form",{className:zt,onSubmit:s.onSubmit,children:[ln(r,"Параметры"),Kl(r,"Данные организации"),c($t,{title:"Офис банка",children:[o("div",{className:_t,children:o(Il,{field:r})}),o("div",{className:_t,children:o(Ul,{field:r,regionKey:a.region?.key})})]}),Rl(e),o(Rt,{link:t})]})})),sn={typeForm:{key:"dpst",text:"Заявка на депозит"},name:"",phone:""},on=Mt({name:el,phone:ll}),cn=d((({button:e,link:t,onSubmit:l})=>{const n=i((e=>{Vt(on(e))&&l(e)}),[l]),[,{field:a,...r}]=Tt(sn,{onSubmit:n,resetOnSubmit:!1});return o("form",{className:zt,onSubmit:r.onSubmit,children:o($t,{title:"Оставьте заявку и мы ответим на любые вопросы по депозитам",children:c("div",{className:At,children:[o(Lt,{label:"Имя",...Ot(a("name"),el)}),o(Xt,{label:"Телефон",...Ot(a("phone"),ll)}),Rl(e),o(Rt,{link:t})]})})})})),dn=[{text:"Задать вопрос по продуктам и услугам",key:"FEEDBACK"},{text:"Качество обслуживания",key:"FEEDBACK_QS"}],mn=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],hn=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],un=d((({className:e,viewBox:t,fill:l="none",width:n,height:a,paths:i,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:l,width:n,height:a,children:i.map((({d:e,fill:t,...l},n)=>{const a={...r,...l};return o("path",{d:e,fill:t||"currentColor",stroke:a.stroke,strokeLinecap:a.strokeLinecap,strokeLinejoin:a.strokeLinejoin,strokeWidth:a.strokeWidth,strokeMiterlimit:a.strokeMiterlimit},n)}))}))),pn=[{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"}],gn=d((({className:e,value:t,text:l,disabled:n,isRadio:a,onChange:r})=>{const s=i((e=>{n||(e.preventDefault(),r&&r(!t))}),[r,n,t]),d=a?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(un,{paths:pn,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:"flex items-center relative cursor-pointer group/box",onClick:s,children:[o("div",{className:x("appearance-none w-5 h-5 border-solid cursor-pointer m-0",a?"rounded-full border-2":fn(t),t?"border-primary-main":"border-gray",n?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:xn(a),"aria-checked":Boolean(t),"aria-disabled":Boolean(n)}),t?d:null,l?o("div",{className:"ml-s",children:o(Pe,{size:"text-l",font:"font-light",children:l})}):null]})})})),xn=e=>e?"radio":"checkbox",fn=e=>x("rounded border",e?"bg-primary-main":""),bn=(e,t,l)=>c("div",{className:"flex col-span-2 gap-m flex-col lg:flex-row w-full justify-between items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3",children:[o(gn,{...e}),o(Rt,{link:t})]}),Et(Ot(e,al).error)]}):o(Rt,{text:"Нажимая кнопку, вы подтверждаете согласие с",link:t}),Rl(l)]}),yn=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const l=String(e.getDate()).padStart(2,"0"),n=String(e.getMonth()+1).padStart(2,"0"),a=t?String(e.getFullYear()):String(e.getFullYear()).slice(-2);return t?`${a}-${n}-${l}`:`${l}.${n}.${a}`}},vn=()=>{},Nn=({today:e,firstDayOfWeek:t,totalDays:l,currentMonth:n,currentYear:a,min:i,max:r,onDateClick:s})=>{const c=[];let d=1;for(let m=0;m<6;m++){const h=[];for(let c=0;c<7;c++)if(0===m&&c<t)h.push(o("td",{},`empty-${c}`));else if(d>l)h.push(o("td",{},`empty-${c}`));else{const t=new Date(a,n,d),l=wn(t,e),c=kn(t,i,r);h.push(o("td",{children:o("div",{className:Sn(l,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:h},`row-${m}`))}return c},wn=(e,t)=>t&&e.toDateString()===t.toDateString(),kn=(e,t,l)=>t&&e.getTime()<t.getTime()||l&&e.getTime()>l.getTime(),Sn=(e,t)=>x("p-s text-center rounded-md border",e?"":"border-transparent hover:bg-gray",t?"text-gray hover:bg-transparent":"cursor-pointer"),Cn=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],In=d((({today:e,currentMonth:t,currentYear:l,min:n,max:a,onDateSelect:s=vn})=>{const d=i((e=>s(e)),[]),{firstDayOfWeek:m,totalDays:h}=r((()=>({firstDayOfWeek:new Date(l,t,1).getDay()-1,totalDays:new Date(l,t+1,0).getDate()})),[l,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:Cn.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Nn({firstDayOfWeek:m,today:e,totalDays:h,currentYear:l,currentMonth:t,min:n,max:a,onDateClick:d})})]})})),Tn=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],Bn=Tn.map((e=>({key:e}))),Mn=Array.from({length:(new Date).getFullYear()-1940+1},((e,t)=>1940+t)).reverse().map((e=>({key:String(e)}))),Vn={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Pn={className:"min-w-32",iconVersion:"black",isBorder:!1},Rn=d((({className:e="",label:t="",value:l,valid:a=!0,minDate:r,maxDate:s,onChange:d})=>{const[m,{setValue:h}]=pl(!1),[u,p]=n(l?.getMonth()||(new Date).getMonth()),[g,f]=n(l?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:b,handleNextMonth:y,handleSelectMonth:v,handleSelectYear:N,monthsOptions:w,yearsOptions:k,handleChangeVisibleCalendar:S,ref:C}=(({onShowCalendar:e,showCalendar:t,selectedMonth:l,onMonthSelect:n,onYearSelect:a,selectedYear:r})=>{const s=fl(i((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:i((()=>e(!t)),[t]),handleNextMonth:i((()=>{l+1<=11?n(l+1):(n(0),a(r+1))}),[l]),handlePrevMonth:i((()=>{l-1>=0?n(l-1):(n(11),a(r-1))}),[l]),handleSelectMonth:i((({key:e})=>n(Tn.indexOf(e))),[]),handleSelectYear:i((({key:e})=>a(Number(e))),[]),monthsOptions:Bn,yearsOptions:Mn,ref:s}})({onYearSelect:f,onMonthSelect:p,onShowCalendar:h,selectedYear:g,selectedMonth:u,showCalendar:m});return c("div",{className:x(e,"relative"),ref:C,children:[o(Pe,{size:"text-m","font-weight":"font-light",children:t}),zn(S,l,a),m?c("div",{className:"absolute bg-white z-20 select-none",children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:b,children:o(H,{...Vn,className:"-rotate-90 cursor-pointer"})}),o(Nl,{onChange:v,value:{key:Tn[u]},options:w,...Pn}),o(Nl,{onChange:N,value:{key:String(g)},options:k,...Pn}),o("div",{className:"my-auto",onClick:y,children:o(H,{...Vn,className:"rotate-90 cursor-pointer"})})]}),o(In,{today:l,currentMonth:u,currentYear:g,onDateSelect:d,min:r,max:s})]}):null]})})),zn=(e,t,l)=>c("div",{onClick:e,className:x("flex justify-between items-center h-14 px-m py-s border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",l?"border-gray":"border-error"),children:[o(w,{children:t&&yn(t)}),o(H,{...Vn,name:"CalendarIcon"})]}),An=d((({className:e,label:t,value:l,error:n,onChange:a,...i})=>c("div",{className:x("shrink-0 w-full",e),children:[t?o("div",{className:"mb-xs",children:o(Pe,{size:"text-m",font:"font-light",children:i?.errors?`${t}*`:t})}):null,o(Rn,{value:l,onChange:a,valid:Boolean(!n)}),Et(n)]}))),Dn={surname:"",name:"",middleName:""},jn=(e,t=!0)=>c("div",{className:"space-y-s",children:[o(Lt,{label:"Фамилия",...Ot(e("surname"),el)}),o(Lt,{label:"Имя",...Ot(e("name"),el)}),o(Lt,{label:"Отчество (Обязательно, при наличии)",...e("middleName")}),t?o(An,{label:"Дата рождения",...Ot(e("birthday"),Zt)}):null]}),Fn={...Dn,typeForm:{key:"FEEDBACK",text:"Задать вопрос по продуктам и услугам"},serviceDirection:{key:"Физическое лицо"},birthday:void 0,feedbackMethod:{key:"Телефонный звонок"},phone:"",email:"",comment:"",consentDataProcessing:!1},En={typeForm:Zt,region:Zt,surname:Zt,name:el,feedbackMethod:Zt,phone:ll,email:Zt,comment:Zt,consentDataProcessing:al},Ln=d((({button:e,link:t,onSubmit:l})=>{const n=i((e=>{On(e,l)}),[l]),[a,{field:r,...s}]=Tt(Fn,{onSubmit:n}),d="FEEDBACK_QS"===r("typeForm").value?.key,m=_n(r("typeForm").value?.key,r("serviceDirection").value?.key);return o("form",{className:zt,onSubmit:s.onSubmit,children:o($t,{children:c("div",{className:At,children:[o(Cl,{label:"Тема",placeholder:"Выберите тему",options:dn,...Ot(r("typeForm"),Zt)}),d?o(Cl,{label:"Направление обслуживания",placeholder:"Выберите направление",options:hn,...Ot(r("serviceDirection"),Zt)}):null,o(Il,{field:r}),d?o(Ul,{field:r,regionKey:a?.region?.key}):null,jn(r,!0),m?c("div",{children:[o(Lt,{label:"ИНН",...Ot(r("inn"),tl)}),o(Lt,{label:"Наименование организации",...r("fullName")})]}):null,o(Cl,{label:"Способ получения ответа",options:mn,...Ot(r("feedbackMethod"),Zt)}),o(Xt,{label:"Телефон",...Ot(r("phone"),ll)}),d?c("div",{children:[o(Xt,{label:"Дополнительный телефон",...r("secondaryPhone").value&&"+7 ("!==r("secondaryPhone").value?Ot(r("secondaryPhone"),ll):r("secondaryPhone")}),o(Lt,{label:"Электронная почта",...Ot(r("email"),Zt)}),o(Lt,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...r("bankEmpolee")}),o(Lt,{label:"Дата и время обращения в Банк",...r("applicationDate")})]}):o(Lt,{label:"Электронная почта",...Ot(r("email"),Zt)}),o(Lt,{...Ot(r("comment"),Zt),placeholder:"Ваше сообщение",isTextarea:!0}),bn(r("consentDataProcessing"),t,e)]})})})})),On=(e,t)=>{const l=_n(e?.typeForm.key,e?.serviceDirection?.key),n=Mt({...En,...$n(e,l)});Vt(n(e))&&t(e,!l)},$n=(e,t)=>t?{addressBranch:Zt,inn:tl}:"FEEDBACK"===e.typeForm.key?{birthday:Zt}:{addressBranch:Zt},_n=(e="",t="")=>"FEEDBACK_QS"===e&&"Юридическое лицо / ИП"===t,Un=d((e=>{const{button:t,regionSource:l}=e,[a,i]=n({key:""}),r=l?.regions??[],s=ie({className:"text-white",version:t?.version}),d=r?.find((e=>e.name===a.key))?.href;return c("div",{className:"container space-y-s",children:[r?o(Cl,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:r.map((({name:e=""})=>({key:e,text:e}))),value:a,onChange:i}):null,d?o("div",{className:"text-center",children:o(ue,{href:d,target:"_blank",className:x("p-m w-full @xl:w-auto",s),children:t?.text?t.text:"Перейти"})}):null]})})),Hn={...Dn,phone:"",email:"",birthday:void 0,consentDataProcessing:!1},Wn=Mt({surname:el,name:el,phone:ll,email:Zt,birthday:Zt,consentDataProcessing:al}),Kn=d((e=>{const{button:t,link:l,product:n="",onSubmit:a}=e,r=i((e=>{Vt(Wn(e))&&a({...e,product:n},!0)}),[a]),[,{field:s,...d}]=Tt(Hn,{onSubmit:r});return c("form",{className:zt,onSubmit:d.onSubmit,children:[c($t,{children:[c("div",{className:_t,children:[o(Lt,{label:"Фамилия",...Ot(s("surname"),el)}),o(Lt,{label:"Отчество (Обязательно, при наличии)",...s("middleName")}),o(Xt,{label:"Телефон",...Ot(s("phone"),ll)})]}),c("div",{className:_t,children:[o(Lt,{label:"Имя",...Ot(s("name"),el)}),o(An,{label:"Дата рождения",...Ot(s("birthday"),Zt)}),o(Lt,{label:"Электронная почта",...Ot(s("email"),Zt)})]})]}),bn(s("consentDataProcessing"),l,t)]})})),qn={typeForm:{key:"SELFCOLLECTION",text:"Самоинкассация"},fullName:"",phone:"",consentDataProcessing:!1},Gn=Mt({typeForm:Zt,region:Zt,fullName:Zt,phone:ll,consentDataProcessing:al}),Yn=d((({button:e,link:t,onSubmit:l})=>{const n=i((e=>{Vt(Gn(e))&&l(e,!1)}),[l]),[,{field:a,...r}]=Tt(qn,{onSubmit:n});return o("form",{className:zt,onSubmit:r.onSubmit,children:o($t,{children:c("div",{className:At,children:[o(Lt,{label:"ФИО",...Ot(a("fullName"),Zt)}),o(Il,{field:a}),o(Xt,{label:"Телефон",...Ot(a("phone"),ll)}),bn(a("consentDataProcessing"),t,e)]})})})})),Xn=d((({field:e})=>{const t=_l().map((({region:e})=>({key:e,text:e})));return o(Cl,{label:"Регион",placeholder:"Выберите регион",options:t,...Ot(e("region"),Zt)})})),Qn=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],Zn={typeForm:Qn[0],...Dn,email:"",phone:"",comment:"",consentDataProcessing:!1},Jn=Mt({typeForm:Zt,surname:Zt,name:el,phone:ll,email:Zt,addressBranch:Zt,consentDataProcessing:al}),ea=d((({button:e,link:t,onSubmit:l,defaultType:n="PREMIUMSERVICE"})=>{const a=i((e=>{Vt(Jn(e))&&l(e,!0)}),[l]),[r,{field:s,...d}]=Tt({...Zn,typeForm:ta(n)},{onSubmit:a}),m=r?.region?.key;return c("form",{className:zt,onSubmit:d.onSubmit,children:[c($t,{title:"Ваши данные",children:[c("div",{className:_t,children:[o(Lt,{label:"Фамилия",...Ot(s("surname"),el)}),o(Lt,{label:"Отчество (Обязательно, при наличии)",...s("middleName")}),o(Lt,{label:"Электронная почта",...Ot(s("email"),Zt)})]}),c("div",{className:_t,children:[o(Lt,{label:"Имя",...Ot(s("name"),el)}),o(Xt,{label:"Телефон",...Ot(s("phone"),ll)}),o(Cl,{label:"Тип обслуживания",options:Qn,...Ot(s("typeForm"),Zt)})]})]}),c($t,{title:"Офис банка",children:[o("div",{className:_t,children:o(Xn,{field:s})}),o("div",{className:_t,children:o(Ul,{field:s,regionKey:m,isPremium:!0})})]}),o(Lt,{...s("comment"),placeholder:"Комментарий, удобное время и прочее",isTextarea:!0}),bn(s("consentDataProcessing"),t,e)]})})),ta=e=>Qn.find((t=>t.key===e)),la=d((({name:e,text:t,value:l,checked:n,onChange:a,className:i})=>o("div",{className:i,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:"appearance-none flex justify-center items-center shrink-0 w-5 h-5 border border-gray hover:border-primary-hover\n checked:border-2 checked:!border-primary-main focus:checked:border-primary-main focus:border-primary-text active:border-primary-text\n after:block after:w-2.5 after:h-2.5 after:rounded-full checked:after:bg-primary-main outline-none rounded-full cursor-pointer",type:"radio",value:l,name:e,checked:n,onChange:e=>a(e.target.value),role:"radio"}),t?o(Pe,{color:"text-primary-text",children:t}):null]})}))),na=e=>{const{value:t,onChange:l}=e("vedTypes");return o($t,{children:c("div",{className:"gap-xl grid @xl:flex @xl:items-center",children:[o(la,{name:"vedTypes",text:"Валютный контроль",value:"currencyControl",checked:"currencyControl"===t,onChange:e=>l&&l(e)}),o(la,{name:"vedTypes",text:"Документарные операции",value:"documentOperations",checked:"documentOperations"===t,onChange:e=>l&&l(e)}),o(la,{name:"vedTypes",text:"Конверсионные операции",value:"conversionTransactions",checked:"conversionTransactions"===t,onChange:e=>l&&l(e)}),o(la,{name:"vedTypes",text:"Иные вопросы ВЭД",value:"otherIssues",checked:"otherIssues"===t,onChange:e=>l&&l(e)})]})})},aa=({field:e})=>{const t="currencyControl"===e("vedTypes").value;return c("div",{className:"space-y-s",children:[t?o(Il,{field:e}):null,c("div",{className:"grid @xl:grid-cols-2 @xl:gap-x-lg gap-s",children:[t?o(Lt,{label:"ИНН",...Ot(e("inn"),tl)}):null,o(Lt,{label:"Наименование организации",...Ot(e("fullName"),Zt)}),o(Lt,{label:"ФИО",...Ot(e("name"),el)}),o(Xt,{label:"Телефон",...Ot(e("phone"),ll)}),t?null:o(Lt,{label:"Электронная почта",...e("email")})]})]})},ia={typeForm:{key:"KVED",text:"Заявка на консультацию ВЭД"},vedTypes:"currencyControl",fullName:"",name:"",phone:"",inn:"",email:"",partnerComments:""},ra={fullName:Zt,name:el,phone:ll},sa=Mt({...ra}),oa=Mt({...ra,inn:tl,region:Zt}),ca=e=>"currencyControl"===e,da=e=>({currencyControl:"currencyControl"===e,documentOperations:"documentOperations"===e,conversionTransactions:"conversionTransactions"===e,otherIssues:"otherIssues"===e}),ma={ApplicationFormBusinessCard:Ll,ApplicationFormWed:d((e=>{const{button:t,link:l,onSubmit:n}=e,a=i((e=>{const{typeForm:t,fullName:l,name:a,phone:i,email:r,inn:s,region:o,vedTypes:c,partnerComments:d}=e,m={typeForm:t,fullName:l,name:a,phone:i,vedTypes:da(c),partnerComments:d,...ca(c)?{inn:s,region:o}:{email:r}};Vt((e=>ca(e)?oa:sa)(c)(e))&&n(m)}),[n]),[,{field:r,...s}]=Tt(ia,{onSubmit:a});return c("form",{className:"container space-y-lg",onSubmit:s.onSubmit,children:[na(r),o(N,{headingType:"h6",title:"Данные организации",className:"@xl:text-center"}),aa({field:r}),o(Lt,{label:"Обращение",placeholder:"Укажите интересующий вас вопрос, место ведения бизнеса и удобное время для телефонного звонка",...r("partnerComments"),isTextarea:!0}),Rl(t),o(Rt,{link:l}),o(N,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex 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(J,{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(J,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]})})),ApplicationFormDeposit:cn,ApplicationFormCredit:rn,ApplicationFormAcquiring:Dl,ApplicationFormGrantSupport:Un,ApplicationFormIndividuals:Kn,ApplicationFormFeedback:Ln,ApplicationFormSelfCollection:Yn,ApplicationFormUltraPremium:ea},ha=kt(),ua=bt((({className:e,formBlock:t,...l})=>{const[a,r]=n(""),s=i((async(e,t=!1)=>{const l=ga(e),n=await ha.send(l,t)?"OK":"Fail";return r(n),n}),[]);return o(b,{className:e,defaultPadding:"p-6xl",...l,children:c("div",{className:"container max-w-[978px] space-y-lg",children:[t?.title?o(N,{headingType:"h3",title:t.title,className:"@xl:text-center"}):null,t?pa(t,s):null,a?o(Ct,{responseType:a}):null]})})})),pa=(e,t)=>{const l=e?.formType;if(!l||!(l in ma))return null;return o(ma[l],{...e,onSubmit:t})},ga=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(t?.region?t?.text:t?.key)||t]))),xa=d((e=>{const{className:t,title:l,responseType:n,children:a,...i}=e;return o(b,{className:t,defaultPadding:"p-6xl",...i,children:c("div",{className:"container max-w-[978px] space-y-lg",children:[l?o(N,{headingType:"h3",title:l,className:"@xl:text-center"}):null,a,n?o(Ct,{responseType:n}):null]})})})),fa={1:"space-y-s max-w-2xl mx-auto",2:"grid @xl:grid-cols-2 gap-s"},ba=d((({className:e,text:t,value:l,key:n,disabled:a,error:i,onChange:r})=>c("div",{className:x("shrink-0 w-full",e),children:[o(gn,{text:t,value:l,disabled:a,onChange:r},n),Et(i)]}))),ya=(e,t)=>({surname:o(Lt,{label:"Фамилия",...va(t("surname"),el,e?.required)}),name:o(Lt,{label:"Имя",...va(t("name"),el,e?.required)}),middleName:o(Lt,{label:"Отчество (Обязательно, при наличии)",...t("middleName")}),phone:o(Xt,{label:"Телефон",...va(t("phone"),ll,e?.required)}),email:o(Lt,{label:"Электронная почта",...va(t("email"),Zt,e?.required)}),comment:o(Lt,{className:"col-span-2",...va(t("comment"),Zt,e?.required),placeholder:"Ваше сообщение",isTextarea:!0}),region:o(Il,{field:t}),client:o(ba,{...t("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}),birthday:o(An,{label:"Дата рождения",...va(t("birthday"),Zt)}),legend:o("legend",{className:"w-full col-span-2",children:o(N,{title:e.label,headingType:"h6",className:"@xl:text-center"})})}[e.name]),va=(e,t,l=!1)=>l?Ot(e,t):e,Na=e=>Object.values(e).map((e=>e.name)),wa={typeForm:{key:"",text:""},region:{key:"",text:""},surname:"",name:"",middleName:"",phone:"",email:"",comment:"",consentDataProcessing:!1},ka=(e,t="")=>({...Object.fromEntries(Na(e).map((e=>[e,wa[e]]))),typeForm:{key:t,text:""}}),Sa={typeForm:Zt,surname:el,name:el,region:Zt,phone:ll,email:Zt,comment:Zt,consentDataProcessing:al},Ca=kt(),Ia=d((({className:e,title:t,typeForm:l="",inputs:a=[],button:r,link:s,formColumns:d=2,endpoint:m})=>{const h=ka(a,l),[u,p]=n(""),g=Mt((e=>{const t=Na(e.filter((e=>"required"in e&&e.required)));return Object.fromEntries(t.map((e=>[e,Sa?.[e]])))})(a)),f=i((async e=>{if(!Vt(g(e)))return"Fail";const t=(e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[e,("region"===e?t?.text:t?.key)||t]))))(e),l=await Ca.send(t,"lead"===m)?"OK":"Fail";return p(l),l}),[]),[,{field:b,onSubmit:y}]=Tt(h,{onSubmit:f}),v=Ta(a)?.name;return o(xa,{className:x(zt,e),title:t,responseType:u,children:c("form",{className:fa[d],onSubmit:y,children:[a.map(((e,t)=>o("div",{children:ya(e,b)},String(t)))),bn(v?b("consentDataProcessing"):void 0,s,r)]})})})),Ta=e=>e.find((e=>"consentDataProcessing"===e?.name)),Ba="text-left",Ma={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},Va=d((({className:e,defaultIconSize:t=44,iconBgVersion:l="primary",size:n,icon:a,...i})=>{const r=String(n?.width||t);return a?o("div",{style:{width:`${r}px`,height:`${r}px`},className:x("rounded-icon object-fit flex justify-center items-center",Ma[l],e),children:o(H,{...i,width:"54%",height:"54%",name:a})}):null})),Pa=d((({className:e="",title:t,benefitList:l,...n})=>c(b,{className:e,defaultPadding:"p-6xl",...n,children:[t?o(N,{headingType:"h3",as:"h2",className:Ba,title:t}):null,l?.length?o("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:l.map(Ra)}):null]}))),Ra=({label:e,description:t,items:l,icon:n,iconBgVersion:a,isDotted:i=!1},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[n?.icon?o(Va,{className:"shrink-0",defaultIconSize:56,iconBgVersion:a||"",...n}):null,n?.src?o(J,{className:"shrink-0",image:n}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(N,{headingType:"h6",children:e}),o(Pe,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),o(Ye,{dotClassName:"bg-secondary-text",listItemSize:"S",items:l,isDotted:i})]}):null]},String(r)),za=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function Aa(e=0){const t=Math.round(10*e);return Array.from({length:t}).fill(0).map(((e,l)=>Math.min(l/t)),1).concat(1)}const Da=d((({className:e,style:t,idx:l,activeIndex:n,observerOptions:c,children:d,onIntersection:m})=>{const h=function(e,{sensitivity:t,rootRef:l}={}){const n=s(null),i=r((()=>({threshold:Aa(t),root:l?.current})),[t,l?.current]);return a((()=>{if(!n.current)return;const t=new IntersectionObserver(e,i);return t.observe(n.current),()=>{t.disconnect()}}),[e,i]),n}(i((e=>{e.length&&m&&m(l||0,e[e.length-1])}),[m,l]),c);return o("div",{className:x("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(l===n),ref:h,role:"listitem",children:d})})),ja=["min-w-full","@lg:min-w-[50%]","@lg:min-w-[33.3%]","@lg:min-w-[25%]"],Fa=d((({className:e,itemClassName:t,containerRef:l,activeIndex:n,visibleItemCount:a=0,gap:r=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:u,onVisibleItemsChange:p,onVisibleIndicesChange:g})=>{const f={sensitivity:1,rootRef:l},b=s([]),y=i(((e,t)=>{const l=[...b.current||[]];l[e]=t,b.current=l,p&&p(l),g&&g(La(l))}),[p,g]),v=a>0?r*Number(a)-1:0,N="vertical-list"===d,w="horizontal-list"===d,k={...w?Ea(c,v):{},...N?za(h):{},gap:`${r}px`};return o("div",{className:x("box-border overflow-auto no-scrollbar",d,e),style:k,ref:l,role:"list",children:(S=(e,l)=>o(Da,{className:x(m,a?ja[a-1]:"",N?"h-full":"",t),style:w?Ea(c/4):{},activeIndex:n,idx:l,observerOptions:f,onIntersection:y,children:e},String(l)),e=>null==e?e:Array.isArray(e)?e.map(S):S(e,0))(u)});var S})),Ea=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),La=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Oa={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},$a={"horizontal-list":"w-6","vertical-list":"h-6"},_a=d((({className:e="",containerRef:t,activeIndex:l,dotCount:n=0,listType:a="horizontal-list",version:i})=>n?o("div",{className:x("flex gap-xs",Oa[a],i?"group":"",e),"data-ver":i,children:Array.from({length:n}).fill(null).map(((e,n)=>o("div",{className:`cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white group-data-transparent:bg-white ${n===l?$a[a]:"w-2 h-2 opacity-30"}`,role:"button","aria-hidden":!0,onClick:()=>(e=>{e!==l&&t?.current&&t.current.children[e]?.scrollIntoView({behavior:"smooth",block:"nearest"})})(n)},String(n))))}):null)),Ua=e=>e,Ha=(e=Ua)=>t=>t.reduceRight(((t,l)=>e(t)>e(l)?t:l)),Wa=Ha(),Ka=(e=Ua)=>Ha((t=>-e(t))),qa=Ka(),Ga=e=>t=>e.scrollWidth/t,Ya=e=>(t,l)=>{e.scrollBy({left:l*Ga(e)(t),behavior:"smooth"})},Xa=({itemCount:e,onVisibleIndicesChange:t})=>{const l=s(null),[a,r]=n([]),o=i((e=>{r((t=>{return(l=t)===(n=e)||Boolean(l&&n&&l?.length===n?.length&&l.every(((e,t)=>e===n[t])))?t:e;var l,n})),t&&t(e)}),[e]),[c,d]=a.length?[Ka()(a),Ha()(a)]:[-1,-1],m=c>0,h=d<e-1,u=i((()=>{var t;l.current&&(m?Ya(l.current)(e,-1):(t=l.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=i((()=>{l.current&&(h?Ya(l.current)(e,1):l.current.scrollTo({left:0,behavior:"smooth"}))}),[e,h]),g=i(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{l?.current&&l.current.children[e]?.scrollIntoView(t)}),[l]);return[l,{scrollLeft:u,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:h,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},Qa=d((({className:e,version:t,gap:l=14,padding:n=16,showDots:a=true,minHeight:i,children:r,onVisibleIndicesChange:s,listType:d="horizontal-list"})=>{const m=Array.isArray(r)?r.length:0,[h,u]=Xa({itemCount:m,onVisibleIndicesChange:s}),[p]=u.visibleIndicesRange;return c("div",{className:x(e,"vertical-list"===d?"relative h-full":""),children:[o(Fa,{containerRef:h,activeIndex:p,visibleItemCount:1,gap:l,padding:n,onVisibleIndicesChange:u.handleVisibleIndicesChange,listType:d,minHeight:i,children:r}),a?o(_a,{containerRef:h,activeIndex:p,dotCount:m,listType:d,version:t}):null]})})),Za=(e,t,l)=>{return o(Qa,{children:e.map((n=l,({icon:e,title:t,description:l},a)=>c("div",{className:x("flex flex-col gap-1","justify-between p-m h-full border border-gray",l||t?"":"justify-center"),children:[t?o(Pe,{size:"text-h6",font:"font-normal",align:n,children:t}):null,e?o(J,{image:e,height:"180",className:"w-auto mx-auto"}):null,l?o(Pe,{size:"text-h6",font:"font-normal",align:n,children:l}):null]},String(a))))});var n},Ja=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:l="",columnsCount:n="4",subtitle:a,title:i,...r})=>c(b,{className:x("space-y-3xl",l),defaultPadding:"p-6xl",...r,children:[o(S,{defaultPadding:"",title:i,description:a,headlineVersion:"M"}),e?.length?Za(e,0,t):null]}))),ei={start:"justify-start",center:"justify-center",end:"justify-end"},ti=d((({buttons:e,className:t="",align:l,...n})=>{const a=l?x("flex",ei[l]):"";return o(b,{className:x("!bg-transparent",a,t),defaultPadding:"p-0",...n,children:Ue(e)})})),li=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:l=!1,renderFoldableSection:a,renderFoldButton:r})=>{const[s,o]=n(l),d=i((()=>{o((e=>!e))}),[]),m=a({isUnfolded:s,onToggle:d}),h=r?r({isUnfolded:s,onToggle:d}):null;return c("div",t?{className:e,role:"group",children:[h,m]}:{className:e,role:"group",children:[m,h]})}));const ni=d((({className:e="",isUnfolded:t,children:l})=>{const n=s(null),i=function(e,t){const l=s(null);return a((()=>{const t=l?.current;if(!t)return;const n=new ResizeObserver((l=>{e(t,l[0])}));return n.observe(t),()=>{n.disconnect()}}),[e,...t]),l}((e=>{n.current&&(n.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:n,className:`transition-max-h duration-300 overflow-hidden ${n.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:i,children:l})})})),ai=d((({className:e,title:t,value:l,fractionDigits:n,fixed:a,prefix:i,postfix:r})=>c("div",{className:x("flex justify-between @xl:flex-col",e),children:[t?o(Pe,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t}):null,o("div",l?{children:o(Pe,{size:"text-h3",children:[i,Xe(n,{fixed:a})(l),r].filter(Boolean).join(" ")})}:{children:o(Pe,{size:"text-h3",children:"-"})})]}))),ii=1e4,ri=5e6,si=Math.round(29.5),oi={minSum:ii,maxSum:ri,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},ci={minSum:ii,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},di={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},mi={minSum:5e4,maxSum:5e6,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0},hi={minSum:1e3,maxSum:5e5,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},ui=(e,t)=>{const{travelExpenseValue:l,restExpenseValue:n}=e,[a,i]=((e,t,l)=>{const{maxBonus:n=5e3,prefMonthsNum:a=di.prefMonthsNum,prefTravelBonusRate:i=di.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(i*t)+Math.round(r*l),n);return[c,c*a+Math.min(Math.round(s*t)+Math.round(o*l),n)*(12-a)]})(t||di,l,n);return{...t,...e,monthBonus:a,yearBonus:i}},pi=e=>e?o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e}):null,gi=d((({rate:e=0,title:t="Ставка",unit:l,fractionDigits:n=2,depositeName:a,isShowDepositeName:i})=>c("div",{children:[o(Pe,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t}),c("div",{className:"relative",children:[c("div",{className:"flex justify-start gradient-color-text",children:[o("span",{className:"font-mohave text-title-huge pr-xl -mt-m tracking-[-15px]",children:Xe(n,{fixed:!0})(e)}),l?o("span",{className:"text-7xl",children:l}):null]}),a&&i?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:a}):null]})]}))),xi=d((({title:e="Ставка",isUnavailableByTerm:t=!1})=>c("div",{className:"space-y-s",children:[o(Pe,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(H,{className:"w-10 h-10 @5xl:h-auto @5xl:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:t?c(w,{size:"text-xl",font:"font-light",color:"text-primary-text",children:["Процентная ставка для срока ",o("strong",{children:"1-30 дней"})," устанавливается при обращении в Банк"]}):o(w,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Выберите другую сумму или срок"})})]}))),fi=({title:e="Ставка",rate:t=0,unit:l="%",fractionDigits:n=2,isUnknownRateShown:a=!0,...i})=>a&&0===t?o(xi,{title:e,...i}):c("div",{children:[o("div",{className:"hidden @xl:block",children:o(gi,{title:e,rate:t,unit:l,fractionDigits:n,...i})}),o("div",{className:"@xl:hidden",children:o(ai,{title:e,value:t,postfix:l,fractionDigits:n,fixed:!0,...i})})]});function bi({isShowItems:e=!0,step:t=1e3,...l}){const n=[`От ${Xe(2)(l.min||0)} ₽`,`До ${Xe(2)(l.max||0)} ₽`];return o(Jl,{items:e?n:[],step:t,...l})}const yi=d((({className:e="",calcSource:t,buttons:l,footnote:n})=>{const[a,{field:i}]=Tt({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:r,maxSumTravel:s,minSumOther:d,maxSumOther:m,monthBonus:h,yearBonus:u}=ui(a,t);return c("section",{className:x("flex flex-col justify-between @5xl:flex-row gap-y-4xl",e),children:[c("div",{className:"flex flex-col @xl:max-w-md gap-2xl border-b border-b-main-divider @xl:border-none pb-3xl @xl:pb-0",children:[bi({title:"Сумма покупок в категории путешествия, ₽",min:r,max:s,step:500,isShowItems:!1,...i("travelExpenseValue")}),bi({title:"Сумма покупок в остальных категориях, ₽",min:d,max:m,step:500,isShowItems:!1,...i("restExpenseValue")})]}),h>=0?fi({title:"Баллов за месяц",rate:h,fractionDigits:0,isUnknownRateShown:!1,unit:""}):null,c("div",{className:"flex flex-col gap-y-xl @xl:w-96",children:[u>=0?o(ai,{title:"Баллов за год",value:u}):null,Ue(l,{isVertical:!0}),pi(n)]})]})})),vi=d((({className:e,inputChildren:t,rateChildren:l,resultChildren:n})=>c("section",{className:x("flex flex-col justify-between @5xl:flex-row gap-m",e),children:[o("div",{className:"flex flex-col gap-y-m sm:max-w-md gap-2xl",children:t}),o("div",{className:"border-b border-main-divider md:hidden"}),l,o("div",{className:"flex flex-col gap-2xl sm:w-96 max-w-full",children:n})]}))),Ni=([e,t],l,n=[])=>l&&l[e]&&l[t]?{[e]:l[e],[t]:l[t]}:wi([e,t],n),wi=([e,t],l=[])=>({[e]:l.length?qa(l.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:l.length?Wa(l.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),ki=(e,[t,l],n)=>e>=n[t]&&e<=n[l],Si=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Ci=(e,t)=>{const{isMonthlyInterestPayment:l,moneyValue:n,daysValue:a}=t;return l?Math.round(n*Math.pow((1200+e)/1200,a/30)-n):Math.round(n*e*a/365/100)},Ii=(e,t=0)=>e?.sum&&e.sum>=ii&&e.sum<=ri?e.sum:t,Ti=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,Bi=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,Mi={horizontal:"gap-5xl",vertical:"flex-col gap-s"},Vi=d((({items:e,checkedItem:t,className:l,onChange:n,orientation:a="horizontal"})=>o("div",{className:x(`flex ${Mi[a]}`,l),role:"radiogroup",children:e?.map((({id:e,text:l})=>o(gn,{isRadio:!0,text:l,value:t===e,onChange:()=>n&&n(e)},String(e))))}))),Pi=({items:e,title:t,mobileTitle:l=t,orientation:n="horizontal",value:a,radioGroupClassName:i,onChange:r})=>c("div",{className:"space-y-s",children:[t?o("div",{className:"hidden @5xl:block",children:o(Pe,{color:"text-secondary-text",font:"font-light",children:t})}):null,l?o("div",{className:"@5xl:hidden",children:o(Pe,{color:"text-secondary-text",font:"font-light",children:l})}):null,o(Vi,{orientation:n,items:e,checkedItem:e[a?0:1].id,className:x("flex-col sm:flex-row",i),onChange:t=>r&&r(t===e[0].id)})]}),Ri=e=>Pi({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),zi=d((({className:e="",buttons:t,footnote:l,bottomFootnote:n,isShowDepositeName:a,defaultParams:i,calcSource:r})=>{const[s,{field:d}]=Tt({moneyValue:Ii(i,1e5),daysValue:Ti(i,60),isReplenished:Boolean(i?.isReplenished),isPartialWithdrawal:Boolean(i?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(i?.isMonthlyInterestPayment)}),m=((e,t)=>{const{daysValue:l,moneyValue:n,isPartialWithdrawal:a,isReplenished:i,isMonthlyInterestPayment:r}=e,s=i||a,o=l<90||l>730;if(l<=30)return{...hi,...e,isDisabledOperatingDeposit:o,isUnavailableByTerm:!0};const c=t?.rateRows?.find((e=>r===e.isMonthlyInterestPayment&&Si(s,e)&&ki(n,["minSum","maxSum"],e)&&ki(l,["minDays","maxDays"],e)))||hi,{rate:d}=c,m=Ci(d,e),h=n+m,u=t?.rateRows||[hi];return{...c,...wi(["minSum","maxSum"],u),...wi(["minDays","maxDays"],u),...e,isDisabledOperatingDeposit:o,income:m,finalSum:h}})(s,r),{income:h,finalSum:u,rate:p,isUnavailableByTerm:g,depositeName:x}=m;return o(vi,{className:e,inputChildren:c("div",{children:[bi({title:"Сумма, ₽",min:m.minSum,max:m.maxSum,...d("moneyValue"),value:m.moneyValue}),(f={title:"Срок, дней",min:m.minDays,max:m.maxDays,...d("daysValue"),value:m.daysValue},o(Jl,{items:[`От ${Bi(f.min||0)}`,`До ${Bi(f.max||0)}`],step:1,...f})),c("div",{className:"flex flex-col sm:flex-row gap-y-4 gap-x-14",children:[Ai(m,d),Ri({title:"Выплата процентов",orientation:"vertical",...d("isMonthlyInterestPayment"),radioGroupClassName:"sm:flex-col"})]})]}),rateChildren:fi({rate:p,depositeName:x,isShowDepositeName:a,isUnavailableByTerm:g}),resultChildren:c("div",{children:[Di(u,h),Ue(t,{isVertical:!0}),pi(l),pi(n)]})});var f})),Ai=(e,t)=>c("div",{className:"space-y-s",children:[o(Pe,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-xl sm:gap-y-s",children:[o(gn,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(gn,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),Di=(e,t)=>c("div",{className:"flex flex-col gap-2xl sm:gap-0 mb-lg",children:[o(ai,{title:"Доход в конце срока",value:t,postfix:"₽",prefix:"+"}),o(ai,{title:"Сумма в конце срока",value:e,postfix:"₽"})]}),ji=e=>Fi({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Fi({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&Fi({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&Fi({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Fi=({row:e,userInputParams:t,paramsViewSettings:l,fieldKey:n,viewSettingFieldKey:a})=>!!l&&!l[a]||t[n]===e[n],Ei=(e,t)=>{const{isAnnuity:l,moneyValue:n,monthsValue:a,moneyExtra:i}=t;if(0===e)return 0;if(l){const t=e/1200;return i?(n+i)*(t+t/(Math.pow(1+t,a)-1)):n*(t+t/(Math.pow(1+t,a)-1))}return Math.round(n/a)+n*(e/1200)},Li=(e,t,l)=>{const{moneyValue:n,monthsValue:a}=e,i=t?.rateRows||[oi],r=(({limitRows:e,userInputParams:t,paramsViewSettings:l})=>e?.find((e=>ji({row:e,userInputParams:t,paramsViewSettings:l}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:l}),{minSum:s,maxSum:o}=Ni(["minSum","maxSum"],r,i),{minMonths:c,maxMonths:d}=Ni(["minMonths","maxMonths"],r,i),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:l,moneyValue:n,monthsValue:a})=>e?.find((e=>ji({row:e,userInputParams:t,paramsViewSettings:l})&&ki(n,["minSum","maxSum"],e)&&ki(a,["minMonths","maxMonths"],e)))||oi)({rateRows:i,userInputParams:e,paramsViewSettings:l,moneyValue:n,monthsValue:a}),{rate:h}=m,u=Ei(h,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:n,monthsValue:a,monthlyPayment:u}},Oi=({min:e=0,max:t=0,availableMonths:l,...n})=>o(Jl,{items:[`От ${$i(e)}`,`До ${$i(t)}`],step:1,...l?.length?{list:l}:{min:e,max:t},...n}),$i=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,_i=e=>Pi({...e,radioGroupClassName:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Ui=d((({className:e,calcSource:t,buttons:l,footnote:n,paramsViewSettings:a,defaultParams:i})=>{const[r,{field:s}]=Tt({moneyValue:Ii(i,2e5),monthsValue:Ti(i,si),isAnnuity:Boolean(i?.isAnnuity),isInsurance:Boolean(i?.isEnableInsurance),isSalaryClient:Boolean(i?.isEnableSalaryClient),isPensionClient:Boolean(i?.isEnablePensionClient),isStateEmployee:Boolean(i?.isEnableStateEmployee)}),d=Li(r,t,a),m=_i({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...s("isAnnuity")});return o(vi,{className:e,inputChildren:c("div",{children:[bi({title:"Сумма кредита, ₽",step:500,min:d.minSum,max:d.maxSum,...s("moneyValue"),value:d.moneyValue}),Oi({title:"Срок кредита, месяцев",min:d.minMonths,max:d.maxMonths,...s("monthsValue"),value:d.monthsValue}),Hi({...d,...a},s),o("div",{className:"sm:hidden",children:m})]}),rateChildren:fi({rate:d.rate}),resultChildren:c("div",{children:[o(ai,{title:"Ежемесячный платёж",value:d.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:m}),Ue(l,{isVertical:!0}),pi(n)]})})})),Hi=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(gn,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(gn,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(gn,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(gn,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),Wi=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let l=1;for(;l<t.length;){const[e,n]=t[l-1],[a,i]=t[l];n>=a?t.splice(l-1,2,[e,Math.max(n,i)]):l++}return t},Ki=(e,t,l)=>{const{moneyValue:n,monthsValue:a}=e,i=t?.rateRows?.[0]?Yi(t.rateRows[0].minMonths,t.rateRows[0].maxMonths):0,r=!l?.isShowMonthlyInterestPayment,s=!l?.isShowRemoteRegistration,o=t?.rateRows?.find((t=>Gi({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r})&&Gi({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s})&&ki(n,["minSum","maxSum"],t)&&ki(a||i,["minMonths","maxMonths"],t)))||mi,{rate:c}=o,d=qi(c,e),m=n+d,h=t?.rateRows||[mi];return{...o,...wi(["minSum","maxSum"],h),...wi(["minMonths","maxMonths"],h),availableMonths:Wi(h.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,l=1)=>Array.from({length:Math.abs(t-e)/l+1},((n,a)=>t>=e?e+a*l:e-a*l)))(e,t))),...e,defaultMonth:i,income:d,finalSum:m}},qi=(e,t)=>{const{isMonthlyInterestPayment:l,moneyValue:n,monthsValue:a}=t;return l?Math.round(n*Math.pow((1200+e)/1200,a)-n):Math.round(n*e*30*a/365/100)},Gi=({row:e,userInputParams:t,paramKey:l,isExclude:n})=>n||t[l]===e[l],Yi=(e,t)=>e+Math.round((t-e)/2),Xi=d((e=>{const{className:t,calcSource:l,buttons:n,footnote:i,paramsViewSettings:r,defaultParams:s}=e,[d,{field:m}]=Tt({moneyValue:Ii(s,2e4),monthsValue:Ti(s),isMonthlyInterestPayment:Boolean(s?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(s?.isRemoteRegistration)}),h=Ki(d,l,r),{defaultMonth:u,rate:p,income:g,finalSum:x}=h,{onChange:f}=m("monthsValue"),{onChange:b}=m("moneyValue");return a((()=>{!d.monthsValue&&f&&f(u)}),[u]),a((()=>{b&&b(Gl(d.moneyValue,h.minSum,h.maxSum))}),[h.minSum,h.maxSum]),o(vi,{className:t,inputChildren:c("div",{children:[bi({title:"Сумма, ₽",min:h.minSum,max:h.maxSum,...m("moneyValue"),value:h.moneyValue}),Oi({title:"Срок, месяцев",min:h.minMonths,max:h.maxMonths,availableMonths:h.availableMonths,...m("monthsValue"),value:h.monthsValue}),Qi({...h,...r},m)]}),rateChildren:fi({rate:p}),resultChildren:c("div",{children:[o(ai,{title:"Доход в конце срока",value:g,postfix:"₽",prefix:"+"}),o(ai,{title:"Сумма в конце срока",value:x,postfix:"₽"}),Ue(n,{isVertical:!0}),pi(i)]})})})),Qi=(e,t)=>{return c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowMonthlyInterestPayment?Ri({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment}):null,e.isShowRemoteRegistration?(l={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration},Pi({...l,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]});var l},Zi=e=>Ji({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Ji({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Ji=({row:e,userInputParams:t,paramsViewSettings:l,fieldKey:n,viewSettingFieldKey:a})=>!!l&&!l[a]||t[n]===e[n],er=(e,t,l)=>{const{moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r}=e,s=t?.rateRows||[ci],o=(({limitRows:e,userInputParams:t,paramsViewSettings:l})=>e?.find((e=>Zi({row:e,userInputParams:t,paramsViewSettings:l}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:l}),{minSum:c,maxSum:d}=Ni(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:h}=Ni(["minMonths","maxMonths"],o,s),u=(({rateRows:e=[],userInputParams:t,paramsViewSettings:l,moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r})=>e?.find((e=>Zi({row:e,userInputParams:t,paramsViewSettings:l})&&ki(n+r,["minSum","maxSum"],e)&&ki(i,["minSumOld","maxSumOld"],e)&&ki(r,["minSumExtra","maxSumExtra"],e)&&ki(a,["minMonths","maxMonths"],e)))||ci)({rateRows:s,userInputParams:e,paramsViewSettings:l,moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r}),{rate:p}=u,g=Ei(p,e),x=e.oldMonthlyPayment-g;return{...u,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:h,moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r,monthlyPayment:g,benefit:x}},tr=d((({className:e,calcSource:t,buttons:l,footnote:n,paramsViewSettings:a})=>{const[i,{field:r}]=Tt({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),s=er(i,t,a),d=_i({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...r("isAnnuity")});return o(vi,{className:e,inputChildren:c("div",{children:[bi({title:"Остаток долга в других банках, ₽ ",step:500,min:s.minSum,max:s.maxSum-s.maxSumExtra,...r("moneyValue"),value:s.moneyValue}),bi({title:"Ежемесячный платёж в других банках, ₽",step:500,min:s.minSumOld,max:s.maxSumOld,...r("oldMonthlyPayment"),value:s.oldMonthlyPayment}),Oi({title:"Новый срок кредита, месяцев",min:s.minMonths,max:s.maxMonths,...r("monthsValue"),value:s.monthsValue}),lr({...s,...a},r),s.isExtraMoney?bi({title:"Дополнительная сумма, ₽ ",step:500,min:s.minSumExtra,max:s.maxSumExtra,...r("moneyExtra"),value:s.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:d})]}),rateChildren:fi({rate:s.rate,fractionDigits:1}),resultChildren:c("div",{children:[o(ai,{title:"Ежемесячный платёж",value:s.monthlyPayment,postfix:"₽"}),s.benefit>0?o(ai,{title:"Выгода в месяц",value:s.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:d}),Ue(l,{isVertical:!0}),pi(n)]})})})),lr=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(gn,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(gn,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(gn,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),nr={CreditCalculatorForm:Ui,DepositCalculatorForm:Xi,BusinessDepositCalculatorForm:zi,BonusCalculatorForm:yi,RefinancingCalculatorForm:tr},ar=bt((({className:e,calculatorTabs:t=[],...l})=>o(b,{className:e,defaultPadding:"p-0",...l,children:rr(t)}))),ir=e=>{const t=e.calculatorBlock?.calcType;if(!t||!(t in nr))return null;const l=nr[t];return c("div",{className:"p-xl",children:[e?.calculatorBlock?.title?o(N,{className:"mb-lg",title:e?.calculatorBlock?.title}):null,o(l,{...e.calculatorBlock,isMobile:!0})]})},rr=e=>{if(!e||!e.length)return null;return 1===e.length?ir(e[0]):e.map(((e,t)=>o(li,{isFoldButtonOnTop:!0,unfoldedByDefault:0===t,renderFoldableSection:({isUnfolded:t})=>o(ni,{isUnfolded:t,children:ir(e)}),renderFoldButton:sr(e)},t.toString())))},sr=e=>({isUnfolded:t,onToggle:l})=>{const n=e.nav?.align||"text-left";return c("button",{type:"button",onClick:l,className:"w-full p-xl bg-primary-main flex items-center border-b border-white",children:[o("div",{className:"w-11 h-11 bg-white rounded-md flex justify-center items-center",children:o(H,{name:e.nav?.icon?.icon,iconVersion:"color",width:"24",height:"24"})}),c("div",{className:"flex-1 flex flex-col pl-s",children:[o(Pe,{align:n,color:"text-white",children:e.nav?.title}),o(Pe,{align:n,size:"text-s",color:"text-white",font:"font-light",children:e.nav?.description})]}),o(H,{name:t?"ArrowUpIcon":"ArrowDownIcon",iconVersion:"white",width:"24",height:"24"})]})},or=d((e=>{const{onChange:t,min:l,max:n,defaultValue:a="0",fractionDigits:r=0,...s}=e,c=ql(e,{normalize:(e=a)=>l&&n?String(Gl(Number(cr(e)),l,n)):cr(e),format:Xe(r)}),d=i((e=>t&&t(cr(e))),[t]);return o(Dt,{onChange:d,...s,...c})})),cr=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),dr=d((e=>o(or,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Pe,{size:"text-xl",font:"font-light",children:"₽"})})}))),mr={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},hr={amount:1500},ur=d((({className:e="",title:t="Укажите сумму перевода",label:l="Сумма перевода",placeholder:i="1500",button:r,formType:s="private",...d})=>{const[{amount:m},{field:h}]=Tt(hr),[u,p]=n(!1);return a((()=>{p(m<=0)}),[m]),c(b,{className:x("flex flex-col items-center",e),defaultPadding:"p-6xl",...d,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:mr[s],children:[o(dr,{valid:!u,placeholder:i,label:l,...h("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:m}),r?.text?o(Pl,{className:"w-full mt-lg",type:"submit",disabled:u,children:r.text}):null]})]})})),pr=(e,t=0)=>{const{itemCount:l,visibleItemCount:a}=e,[r,s]=n(t),o=i((()=>s((e=>Math.min(e+1,l-1)))),[l]),c=i((()=>s((e=>Math.max(e-1,0)))),[l]),d=a?l>a&&r<l-a:r<l-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]},gr=d((({className:e,disabled:t,...l})=>o(ue,{rounded:!0,className:x("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,...l,children:o(J,{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"})}))),xr=d((e=>o(gr,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),fr=d((e=>o(gr,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),br="absolute top-[calc(50%-24px)] z-40",yr="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",vr=d((({scroll:e,activeIndex:t,itemCount:l,arrowsPadded:n,hasEdgeBlocks:a,onScrollLeft:r,onScrollRight:s})=>{const{canScrollLeft:d,canScrollRight:m,scrollLeft:h,scrollRight:u}=e,p=a?t>0:d,g=a?t<l-1:m,f=i((()=>{a?(d&&t!==l-1&&h(),r()):h()}),[h,r,a,d,t,l]),b=i((()=>{a?(m&&0!==t&&u(),s()):u()}),[u,s,a,d,t,l]);return c("div",{className:"hidden @lg:block",children:[Nr(e),p?o(xr,{className:x(br,n?"left-1 @lg:left-8":"left-0"),onClick:f}):null,g?o(fr,{className:x(br,n?"right-1 @lg:right-8":"right-0"),onClick:b}):null]})})),Nr=e=>c("div",{children:[e.canScrollLeft?o("div",{className:x(yr,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:x(yr,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),wr=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",kr=({className:e,text:t="ХИТ"}={})=>c("div",{className:x("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(H,{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})]}),Sr="relative h-full",Cr={small:"sm:min-w-64",normal:"sm:min-w-96",big:"sm:min-w-[515px]"},Ir=({noCardBorder:e,activeIndex:t,cardSize:l="normal",...n})=>{const{blocks:a}=n.block||{},i=a?.some(Mr);return V({...n,renderProps:(n,a,r)=>c("div",{className:Tr(n,{someCardsHighlighted:i}),children:[T(n,a,{className:Br(n,{someCardsHighlighted:i,showBorder:!e,cardSize:l}),blockIndex:r,isActive:r===t}),Mr(n)?kr({className:"absolute top-0 -right-4 z-40"}):null]},String(r))})},Tr=(e,{someCardsHighlighted:t})=>x(Sr,t&&(Mr(e)?"pt-3xl":"pt-3xl sm:pt-16")),Br=(e,{someCardsHighlighted:t,showBorder:l,cardSize:n="normal"})=>x(Sr,"min-w-80",Cr[n],t&&(Mr(e)?"pt-3xl sm:pt-16":"pt-3xl"),wr(l),l&&"h-full"),Mr=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,Vr=bt((({className:e,itemCount:t,visibleItemCount:l=0,noCardBorder:n,isAlignCenter:a,arrowsPadded:i=!0,isGap:r=!0,cardSize:s="normal",...d})=>{const{blocks:m=[]}=d.block||{},h=t||m?.length,[u,{inc:p,dec:g}]=pr({itemCount:h,visibleItemCount:l},Math.floor(l/2)),[f,y]=Xa({itemCount:h}),[v]=y.visibleIndicesRange,N=m&&"CarouselBankHistoryCard"===m[0]?.type;return c(b,{className:e,defaultPadding:"p-6xl",...d,children:[c("div",{className:x(a?"flex justify-center":"","relative max-w-full"),children:[o(Fa,{containerRef:f,visibleItemCount:l,snapAlign:"snap-start",gap:r?16:void 0,onVisibleIndicesChange:y.handleVisibleIndicesChange,children:Ir({noCardBorder:n,activeIndex:u,cardSize:s,...d})}),o(vr,{scroll:y,arrowsPadded:i,onScrollLeft:g,onScrollRight:p,hasEdgeBlocks:N,activeIndex:u,itemCount:h})]}),o(_a,{className:"@5xl:hidden",containerRef:f,activeIndex:v,dotCount:h,listType:"horizontal-list"})]})}),{childrenTypes:["CarouselCard","CarouselBankHistoryCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),Pr=d((({title:e,description:t,className:l})=>o(b,{className:l,defaultPadding:"p-6xl",children:o(S,{headlineVersion:"XS",title:e,description:t,align:"text-left",className:"text-primary-text",isEmbedded:!0})}))),Rr="z-10 border border-solid w-full h-full",zr=x(Rr,"absolute hidden @xl:block border-transparent"),Ar=d((({className:e,title:t,description:l,button:n,...a})=>o(b,{className:x("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...a,children:c("div",{className:"relative h-full",children:[o("div",{className:x(zr,"top-9 right-12 bg-green-dark")}),o("div",{className:x(zr,"top-6 right-8 bg-green")}),o("div",{className:x(zr,"top-3 right-4 bg-green-light")}),c("div",{className:x(Rr,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(S,{title:t,description:l,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),Ue([n],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),Dr={black:"bg-black",white:"bg-white"},jr=d((({className:e="",title:t,description:l,image:n,price:a,button:i,colors:r=[],align:s="text-left",padding:d,...m})=>o(b,{className:x("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(be,{className:"h-full",padding:d,title:o(S,{title:t,description:l,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:n?.src?o(J,{className:"flex justify-center align-center mb-xl",image:n}):null,buttons:Ue([i],{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(Pe,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(Fr)]}):null,a?c(Pe,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),Fr=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${Dr[e]}`},String(t)),Er=d((({textNode:e,iconNode:t,tag:l,onClick:n,justifyContent:a="between",className:i,role:r,...s})=>c(l,{tag:l,className:x("flex items-center w-full gap-1","between"===a?"justify-between":"justify-center",i),onClick:n,role:r,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),Lr=d((({className:e="",label:t,icon:l,dataTheme:n="",disabled:a=!1,onClick:i})=>o(Er,{tag:"button",onClick:i,disabled:a,"data-theme":n,justifyContent:"center",role:"button",className:x("py-4 border border-transparent outline-none focus:border-primary-text space-x-s",a?"bg-main-divider text-main-disabled hover:bg-main-divider":"bg-primary-main text-white hover:bg-primary-hove",e),textNode:o(Pe,{size:"text-h4",children:t}),iconNode:l?o(J,{image:{icon:l,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),Or=({isUnfolded:e,onToggle:t})=>o(Lr,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),$r=d((({className:e="",icon:t,...l})=>{const n=oe(),{text:a,href:i,target:r,onClick:s}=n(l);return a?o("div",{className:x("w-full pb-lg",e),children:c("a",{className:"bg-white flex justify-between rounded-md w-full p-lg whitespace-nowrap",role:"link",href:i,target:r,onClick:s,children:[c("div",{className:"flex items-center space-x-lg",children:[t?o(J,{imageClassName:"text-green-dark",image:t,width:"20",height:"20"}):null,o(Pe,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})]}),o(H,{className:"text-green",name:"ArrowRightIcon",width:"20",height:"20"})]})}):null})),_r=d((({className:e,additionalDescription:t,description:l,links:n=[],title:a,...i})=>c(b,{className:e,...i,children:[c("div",{children:[o(S,{isEmbedded:!0,title:a,description:l,as:"h1",align:"text-left"}),o(S,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),n?.length?Ur(n):null]}))),Ur=(e,t=3)=>{const l=(e||[]).map(((e,t)=>o($r,{...e},String(t)))),[n,a]=t>0?[l.slice(0,t),l.slice(t)]:[l,[]];return o("div",{className:"mt-4xl",children:a.length>0?o(li,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:"mb-1",children:n}),o(ni,{isUnfolded:e,children:a})]}),renderFoldButton:Hr}):o("div",{children:n})})},Hr=({isUnfolded:e,onToggle:t})=>e?null:o(Lr,{className:"border-t-main-divider/50",icon:"PlusIcon",label:"Показать еще",onClick:t}),Wr=d((({className:e="",href:t,target:l,isRemote:n=!1,children:a})=>{const i=oe({isRemote:n})({href:t,target:l});return o(t?"a":"div",{className:x("block",e),...t?i:{},role:t?"link":"none",children:a})})),Kr=[{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:["youtube.com"],iconMapped:{icon:"YoutubeIcon"}},{origins:["rutube.ru"],iconMapped:{icon:"RutubeIcon"}},{origins:["dzen.ru"],iconMapped:{icon:"DzenIcon"}}],qr=e=>Kr.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{},Gr=d((({className:e="",media:t,showButtonText:l,stretched:a,version:i="white",children:r})=>{const[s,d]=n(),m=t?.map((e=>{const{href:t,icon:n,text:a}=e,{iconMapped:r}=qr(t),o=_e(n)?n:r,c=l?{text:a}:{text:""};return!s&&a&&d(!0),{...e,...c,icon:{...o,iconVersion:"color"},version:e?.version??i}})),h=x("border border-solid hover:border-transparent group-data-primary:border-main-divider border-main-divider group-data-gray:border-green group/media",l&&s?"":"basis-auto",a?"flex-1 justify-center":"");return c("div",{className:x("flex flex-col gap-xs",e),children:[o("div",{className:"flex gap-xs",children:Ue(m,{className:x(a||s?"basis-full":""),buttonClassName:h})}),r?o(Pe,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),Yr=d((({className:e,padding:t,description:l,additionalDescription:n,href:a,icon:i,items:r=[],isDotted:s,socialMedia:d=[],target:m,title:h,align:u="text-left",benefits:p,imageOptions:{directionRight:g=!0,isImageAlwaysOnRight:f=false,isImageSecondary:y=!1}={},...v})=>o(b,{className:x("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...v,children:o(Wr,{href:a,target:m,className:"h-full",children:c(be,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(S,{title:h,description:l,headlineVersion:"XS",isEmbedded:!0,align:u}),...nt(_e(i)?o(J,{image:i}):null,g),buttons:d.length?o(Gr,{media:d,showButtonText:!0,version:v?.version}):null,isImageAlwaysOnRight:f,isImageSecondary:y,imageAlign:"center",children:[o($e,{benefits:p}),o(Ye,{items:r,isDotted:s,listItemSize:"S"}),Xr(n,u)]})})}))),Xr=(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,Qr=(e,t)=>{const{title:l,description:n,buttons:a}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[l?o("div",{className:"opacity-80",children:o(Pe,{size:"text-m",color:"text-secondary-text",children:l})}):null,n?o("div",{className:"mt-2xs",children:o(Pe,{size:"text-xl",color:"text-primary-text",children:n})}):null,a?.length?o("div",{className:"text-primary-main",children:Ue(a)}):null]},String(t))},Zr=d((({className:e="",title:t,align:l="text-center",icon:n,button:a,visibleCellsCount:i=1,cardCells:r=[],...s})=>{const d=r.map(Qr),[m,h]=i>0?[d.slice(0,i),d.slice(i)]:[d,[]];return c(b,{className:x("flex flex-col",e),defaultPadding:"p-2xl",...s,children:[_e(n)?o("div",{className:"self-center",children:o(J,{image:n})}):null,t?o(N,{className:x("pt-xs",l),headingType:"h5",title:t}):null,a?.text?o(ue,{className:"w-full mt-m mb-lg",...a}):null,h.length?o(li,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[m,o(ni,{isUnfolded:e,children:h})]}),renderFoldButton:r.length>1?Jr:null}):o("div",{children:m})]})})),Jr=({isUnfolded:e,onToggle:t})=>c("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:t,type:"button",children:[o("div",{children:e?"Скрыть":"Подробнее о тарифе"}),o(H,{className:"text-primary-text",name:e?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),es=(e=!1)=>e?"text-white":"",ts=(e=!1)=>"text-s mb-m "+(e?"text-white":"text-secondary-text/80"),ls=d((({icon:e,image:t,title:l,subtitle:n,isFillGradient:a})=>c("th",{className:"space-y-4 flex flex-col items-start",children:[e?o(J,{className:"h-16 w-16 min-w-16 min-h-16",image:e,width:"64",height:"64"}):null,t?.src&&o("div",{children:o(J,{image:t})}),l?o(N,{headingType:"h4",className:es(a),title:l}):null,n?o("div",{className:ts(a),children:n}):null]}))),ns=d((({cell:e,rowHeader:t,isFillGradient:l=!1})=>o("div",{className:"box-border flex flex-col",role:"cell",children:o("div",{className:x("h-full","border-main-divider border-b"),children:e?e.map(rs(l,t)):null})}))),as=(e=!1)=>""+(e?"text-white/80":"text-secondary-text"),is=(e=!1)=>""+(e?"text-white":""),rs=(e,t)=>({label:l,description:n},a)=>c("div",{className:"flex justify-between text-s py-s",children:[o(w,{size:"text-s",color:as(e),children:t}),c("div",{className:"basis-1/2",children:[l?o("div",{className:"text-right",children:o(w,{size:"text-s",align:"text-right",color:is(e),children:l})}):null,n?o("div",{className:"text-right",children:o(w,{size:"text-s",color:as(e),children:n})}):null]})]},String(a)),ss=d((({header:e,columnData:t,visibleRowLength:l=0,isFillGradient:n,showRow:a,onToggleColumn:i})=>{const r=t?.slice(0,a?t.length:l),s=n?"secondary":"primary";return o("tr",{className:"mb-m",children:c("td",{className:x("border border-gray rounded-md p-m",n?"bg-gradient-to-r from-main-gradient-start to-main-gradient-end":""),children:[o(ls,{...e,isFillGradient:n}),r?.length?r.map((({rowHeader:e,cell:t},l)=>o(ns,{cell:t,rowHeader:e,isFillGradient:n},String(l)))):null,a&&e?.link?o(ue,{href:e.link.href,target:e.link?.target,version:s,ariaLabel:"Подробнее",className:"text-s font-medium mt-m p-s",children:e.link.text}):null,os({onToggleColumn:i,isFillGradient:n,showRow:a})]})})})),os=({onToggleColumn:e,isFillGradient:t,showRow:l})=>o("td",{className:"pt-lg",children:o("a",{role:"link",onClick:e,className:"cursor-pointer "+(t?"text-white/80":"text-primary-main"),children:o(Pe,{size:"text-s",font:"font-medium",children:l?"Скрыть":"Показать описание"})})}),cs=d((e=>{const{className:t,title:l}=e;return c("section",{className:`bg-white font-sans p-6xl overflow-hidden text-primary-text relative space-y-lg ${t||""}`,children:[l?o(N,{headingType:"h3",className:"font-medium text-center",title:l}):null,o("table",{className:"border-separate",children:o(ds,{...e})})]})})),ds=d((({columns:e=[],rowHeaders:t,isColoredFirstColumn:l,visibleRowLength:a,orientation:r,...s})=>{const[c,d]=n(Array.from({length:e.length}).fill(!a)),m=i((e=>{const t=(t,l)=>l===e?!t:t;d((e=>e.map(t)))}),[]),h=i((()=>d((e=>Array.from({length:e.length}).fill(!1)))),[]),u=e?.map((({data:e,header:n},i)=>{return o(ss,{visibleRowLength:a,showRow:c[i],header:n,columnData:(r=e,r?.map(((e,l)=>({cell:e,rowHeader:t?.[l]?.title})))),isFillGradient:0===i&&l,onToggleColumn:()=>m(i),...s},String(i));var r}));return o("tbody","horizontal"===r?{children:o(Qa,{onVisibleIndicesChange:h,children:u})}:{children:u})})),ms=e=>e%2!=0,hs=d((({title:e,description:t})=>c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(J,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),o(S,{title:e,description:t,headlineVersion:"S",isEmbedded:!0,align:Ba})]}))),us=["ArrowDownIcon","ArrowUpIcon"],ps="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs border-box",gs=d((({label:e="",blocksToRender:t=[],topItemsCount:l=0,block:n,notFound:a,...i})=>{const[r,s]=l>0?[t.slice(0,l),t.slice(l)]:[t,[]];return c("div",{children:[o("div",{className:x(t.length?"hidden":"block"),children:a?o(hs,{...a}):null}),c("div",{className:x("space-y-2xs",t.length?"":"hidden"),children:[c("div",{className:x(ps),children:[M(r,{...i.options,parent:n}),ms(r.length)?o(vt,{className:"col-span-6",...i}):null]}),o(li,{renderFoldableSection:({isUnfolded:e})=>c(ni,{className:x(ps),isUnfolded:e,children:[M(s,{...i.options,parent:n}),ms(s.length)?o(vt,{className:"col-span-6",...i}):null]}),renderFoldButton:({isUnfolded:t,onToggle:n})=>o(Lr,{className:x(l<1?"hidden":""),disabled:!s?.length,label:e,icon:us[Number(t)],dataTheme:i.options?.page?.colorPalette,onClick:n})})]})]})})),xs=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,fs=(e,t)=>Object.entries(e).map((([l,n])=>"number"==typeof n?Array.isArray(t[l])?((e,t)=>l=>xs(t[e])||xs(l[e])||l[e]?.includes(t[e]))(l,e):((e,t)=>l=>xs(t[e])||xs(l[e])||bs(t[e])<=bs(l[e]))(l,e):"object"==typeof n&&"min"in n&&"max"in n?((e,t)=>l=>xs(t[e])||xs(l[e])||bs(t[e]?.min)>=bs(l[e]?.min)&&bs(t[e]?.min)<=bs(l[e]?.max))(l,e):Array.isArray(n)?((e,t)=>l=>xs(t[e])||xs(l[e])||t[e]?.every((t=>l[e]?.includes(t))))(l,e):((e,t)=>l=>xs(t[e])||xs(l[e])||t[e]===l[e])(l,e))).every((e=>e(t))),bs=e=>Number(e||0),ys=(e,t)=>(l=It)=>e&&e.filter((e=>fs(t,l(e.content||{})))),vs=d((({value:e,onChange:t,items:l=[],multiple:n})=>l.map((l=>o(Bt,{text:l?.title,value:[e].flatMap((e=>e)).includes(l.value),onChange:()=>(l=>{if(!t)return;const a=e?.includes(l);t(n?a?(e||[]).filter((e=>e!==l)):[...e||[],l]:a?[]:[l])})(l.value),type:n?"checkbox":"radio"},l.value))))),Ns=({field:e,reset:t,filtrationSchema:l,resetButton:n,children:a})=>c("form",{className:"flex flex-col @4xl:flex-row justify-between bg-white p-4xl gap-s @4xl:gap-0",children:[c("div",{className:"flex flex-col @4xl:flex-row gap-5xl",children:[a,Object.entries(l).map(ws(e))]}),n?o("div",{children:o(Pl,{type:"reset",className:"w-full @4xl:w-72 @4xl:ml-s",onClick:t,children:n?.text})}):null]}),ws=e=>([t,l])=>{const n=l?.type;return"array"===n?ks(t,e)(l):null},ks=(e,t)=>l=>{const n=l?.items?.enum?.map(((e,t)=>({value:e,title:l?.items?.enumNames?.[t]||""})))||[];return c("div",{children:[l?.title?o("div",{className:"mb-m",children:o(Pe,{size:"text-m",font:"font-light",color:"text-secondary-text",children:l.title})}):null,o(vs,{items:n,multiple:!l?.single,...t(e)})]},e)},Ss=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,Cs=(e,t)=>Array.from({length:t-e+1},((t,l)=>e+l)),Is=(e,t)=>pt((e[t?.sourceBook]?.rateRows||[]).filter(Ss).flatMap((e=>Cs(e.minMonths,e.maxMonths)))),Ts=(...e)=>{const t=e.map((e=>ht(e)));return Promise.all(t)};function Bs(e,...t){return e.map(((e,l)=>[e,...t.map((e=>e[l]))]))}const Ms=e=>Boolean(e&&e.content&&"string"==typeof e.content.sourceBook);function Vs(e){const{dirs:t=[],source:l=[]}=r((()=>{const t=(e=>e?.filter(Ms).map((({content:{sourceBook:e}})=>e)))(e);return{dirs:t?.map((e=>`/wcms-resources/${e}.json`)),source:t}}),[e]),{data:n=[]}=ml(t,Ts);return{source:Object.fromEntries(Bs(l,n).filter((([,e])=>Boolean(e)))),months:pt(n.flatMap((e=>e?.rateRows||[])).filter(Ss).flatMap((e=>Cs(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[]}}const Ps=1e9,Rs={sum:{min:1e4,max:Ps},period:3},zs=bt((({className:e,filtrationSchema:t={},resetButton:l,sumInput:n,periodInput:a,...i})=>{const{source:r,months:s}=Vs(i.block?.blocks),[d,{field:m,reset:h}]=Tt(Rs),u=d===Rs?i.block?.blocks:ys(i.block?.blocks,d)((e=>({...e,period:Is(r,e||{})||[]}))),p=c("div",{children:[o(dr,{label:n?.title,min:500,max:Ps,...m("sum",{parse:e=>({min:Number(e),max:Ps}),format:({min:e})=>String(e)})}),o(Jl,{title:a?.title,items:["От 3 мес","До 5 лет"],list:s,...m("period")})]});return c(b,{className:x("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...i,children:[Ns({field:m,reset:h,filtrationSchema:t,resetButton:l,children:p}),o(gs,{blocksToRender:u,...i})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},sourceBook:{type:"string",title:"Адрес справочника"}})}),As=e=>"Image"===e?.contentType&&e?.image?o(J,{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,Ds=d((({className:e="",title:t,description:l,error:n,button:a,...i})=>c(b,{className:x("flex flex-col justify-center items-center",e),defaultPadding:x("p-6xl"),version:"transparent",...i,children:[o("div",{className:"flex justify-center",children:As(n)}),o(S,{title:t,description:l,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),a?.text?o(ue,{version:a?.version,text:a?.text,...a}):null]}))),js="location";function Fs(e="Москва"){const[t,l]=((e,t,l)=>{const[r,s]=n(l||null);return a((()=>e.subscribe(t,(e=>s(e)))),[e,t]),[r,i((l=>e.fire(t,l)),[e,t])]})(p,"location",Ls()??{name:e}),r=i((e=>{Os(e),l(e)}),[]),{data:s}=ml(Es()?null:"/api/v1/region",ut);return a((()=>{s&&!Es()&&l(s)}),[s]),[t??{name:e},r]}const Es=()=>Boolean(globalThis.localStorage?.getItem(js)),Ls=()=>{try{const e=globalThis.localStorage?.getItem(js);return e&&JSON.parse(e)}catch(e){return null}},Os=e=>{try{globalThis.localStorage?.setItem(js,JSON.stringify(e))}catch(e){}};var $s;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}($s||($s={}));const _s=new Intl.NumberFormat("ru",{style:"currency",currency:$s.RUB}),Us=e=>e?_s.format(e):"",Hs="text-left text-m font-light text-secondary-text",Ws=`${Hs} pl-5xl`,Ks={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},qs=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:`h-fit w-fit ${e}`,children:[o("thead",{children:c("tr",{children:[o("th",{className:Hs,children:o(Pe,{size:"text-m",children:"Валюта"})}),o("th",{className:Ws,children:o(Pe,{size:"text-m",children:"Купить"})}),o("th",{className:Ws,children:o(Pe,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(Gs)})]}))),Gs=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m",children:c("div",{className:"flex items-center gap-xs",children:[t?o(J,{image:{icon:Ks[t]},width:"24",height:"24"}):null,o(Pe,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl",children:o(Pe,{size:"text-h6",children:Us(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl",children:o(Pe,{size:"text-h6",children:Us(e?.buyExchangeRate)})})]},t)},Ys={icon:"GpsIcon"},Xs=d((({className:e="",address:t})=>c("div",{className:`flex gap-s ${e}`,children:[o(Va,{...Ys,iconBgVersion:"primary"}),c("div",{className:"space-y-2xs",children:[t?o(w,{size:"text-l",color:"text-primary-main",children:t}):null,o(w,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),Qs=(e,t,l)=>{const n=Number(Zs(e))*Math.pow(t,l?-1:1);return Number.isInteger(n)?n:((e,t=2)=>{const l=10**t;return Math.round(parseFloat(String(e))*l)/l})(n)},Zs=e=>e.replace(/[^\d.,]/g,"").replace(",","."),Js=e=>{return(t=[[e=>e.value!==$s.RUB&&e.oppositeValue!==$s.RUB,()=>e.handleConvert(e.value,$s.RUB)],[e=>e.value===$s.RUB&&e.oppositeValue===$s.RUB,()=>e.handleConvert(e.value,$s.USD)],[e=>e.value===$s.RUB&&e.oppositeValue===$s.RUB,()=>e.handleConvert(e.value,$s.CNY)],[()=>!0,()=>e.handleConvert(e.value)]],e=>{const[,l]=t.find((([t])=>t(e)))||[];return l})(e)?.();var t};function eo(e){const{placeholder:t,rates:l,selected:n,value:a,setValue:i,setSelected:r}=e,s=l.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:n,text:n};return c("div",{className:"relative flex",children:[o(Dt,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:a,onChange:i}),s.length?o(Nl,{isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const to=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:l,button:a})=>{const[r,s]=n({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||$s.RUB,selectBuy:l?.[0]?.currency?.currency||$s.USD}),d=i((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`grid gap-m pt-2xl ${e}`,children:[eo({placeholder:"Хочу продать",rates:l,selected:r.selectSell,setSelected:lo(r,d,l),value:r.inputSell,setValue:e=>ao(d,l)(e,r.selectSell,r.selectBuy)}),eo({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:no(r,d,t),value:r.inputBuy,setValue:e=>io(d,t)(e,r.selectBuy,r.selectSell)}),a?.text?o(ue,{text:a.text,version:a?.version,...a}):null]})})),lo=(e,t,l)=>n=>{t({selectSell:n}),Js({value:n,oppositeValue:e.selectBuy,handleConvert:(n=e.selectSell,a=e.selectBuy)=>{ao(t,l)(e.inputSell,n,a)}})},no=(e,t,l)=>n=>{t({selectBuy:n}),Js({value:n,oppositeValue:e.selectSell,handleConvert:(n=e.selectBuy,a=e.selectSell)=>io(t,l)(e.inputBuy,n,a)})},ao=(e,t)=>(l,n,a)=>{e({inputSell:Zs(l),selectBuy:a});const i=t.find((e=>e.currency?.currency===a))?.buyExchangeRate||t.find((e=>e.currency?.currency===n))?.saleExchangeRate;i&&e({inputBuy:String(Qs(l,i,n===$s.RUB)||"")})},io=(e,t)=>(l,n,a)=>{e({inputBuy:Zs(l),selectSell:a});const i=t.find((e=>e.currency?.currency===a))?.saleExchangeRate||t.find((e=>e.currency?.currency===n))?.buyExchangeRate;i&&e({inputSell:String(Qs(l,i,n===$s.RUB)||"")})};const ro=d((({className:e="",title:t="Курсы обмена валют",button:l,...n})=>{const[a]=Fs(),i=function(e){const t=e?.code||"000",{data:l}=ml(`/api/v1/exchangerates?regionCode=${t}`,ut);return l||{}}(a),r=so(i?.exchangeRate?.currencies),s=r.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:$s.RUB}});const d=r.filter((e=>e.saleExchangeRate));return d.push({currency:{currency:$s.RUB}}),o(b,{className:x("box-border min-h-80",e),...n,children:o(be,{className:"h-full",title:o(N,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex gap-6xl flex-wrap",children:[c("div",{children:[r?o(qs,{className:"mb-xl",exchangeCurrencyItems:r}):null,o(Xs,{address:i?.address})]}),r.length&&s.length&&d.length?o(to,{className:"grow",currencyRatesBuy:s,currencyRatesSell:d,button:l}):null]})})})})),so=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],oo=(e,t)=>o(Va,{...e,iconBgVersion:t,className:"shrink-0"}),co=d((({label:e,labelIconBgVersion:t,icon:l,onToggle:n,labelIcon:a})=>o(Er,{tag:"button",className:x("border-none bg-transparent items-center group/button",a?.icon?"py-xs":"py-lg"),onClick:n,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[oo(a,t),e?o(Pe,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:l?o(H,{name:l,iconVersion:"black",width:"24",height:"24"}):null}))),mo=bt((({className:e="",isExpanded:t,isFoldButtonOnTop:l=!0,label:n="Развернуть",labelIcon:a,labelIconBgVersion:i,foldButtonVersion:r="default",version:s,role:c,...d})=>o(b,{className:x("w-full","",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:c,...d,children:o(li,{isFoldButtonOnTop:l,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(ni,{className:x("gap-lg","flex flex-wrap group-last:last:pb-0"),isUnfolded:e,children:V({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>ho({foldButtonVersion:r,label:n,labelIcon:a,labelIconBgVersion:i,isUnfolded:e,onToggle:t})})})),{childrenTypes:{exclude:["RollupItem"]}}),ho=({foldButtonVersion:e,label:t,labelIcon:l,labelIconBgVersion:n,isUnfolded:a,onToggle:i})=>{const r=t||(a?"Скрыть":"Развернуть"),s=((e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon")(a);return"accordion"===e?o(co,{label:r,labelIcon:l,labelIconBgVersion:n,icon:s,onToggle:i}):o(Lr,{label:r,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:i})},uo=d((({className:e="",items:t})=>c("div",{className:e,children:[t?.length?t.map(po):null,o(ue,{version:"primary",className:"w-full",href:"https://beta.rshb.ru/natural/feedback/question",target:"_blank",ariaLabel:"Обратная связь",text:"Обратная связь"})]}))),po=(e,t)=>c("div",{className:"mb-m space-y-m",children:[o("div",{children:o(Pe,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(go)})]},String(t)),go=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:xo(e.type,e.text)}),o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),xo=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${fo(t)}`,children:o(Pe,{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})}},fo=e=>e.replaceAll(/\D/g,""),bo=["split_version","New","Old"],yo=d((({className:e="",index:t,text:l,...n})=>{const a=oe(),{href:i,target:r,onClick:s}=a(n);return o("a",{className:x("",e),href:i,target:r,onClick:s,children:l||`Документ ${t}`})})),vo=d((({title:e,links:t,className:l=""})=>c("div",{className:x("flex flex-col gap-4",l),children:[o(Pe,{size:"text-l",font:"font-normal",children:e}),t?.length?o("div",{className:"flex flex-col gap-lg",children:t.map(((e,t)=>o(yo,{className:"text-l font-light",index:t,...e},String(t))))}):null]}))),No=d((({className:e="",items:t,basePath:l})=>t?.length?o("ul",{className:x("flex flex-col",e),children:t.map(wo(l))}):null)),wo=e=>(t,l)=>{const{text:n,...a}=t,i=oe({isRemote:!(!z.BASE_PATH||!e)&&!z.BASE_PATH.startsWith(e),basePath:e}),{href:r,target:s,onClick:c}=i(a);return o("li",{className:"list-none my-xs",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:r,target:s||"_self",onClick:c,children:n||null})},`list_item_${String(l)}`)},ko=d((({className:e="",index:t,...l})=>{const n=oe({isRemote:!0}),{href:a,target:i,text:r,onClick:s}=n(l);return o("a",{className:`text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px] ${e}`,href:a,target:i,onClick:s,children:r||`Документ ${t}`})})),So=d((({className:e="",links:t})=>c("div",{className:x("@container",e),children:[o("div",{className:"pt-lg",children:o(Pe,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} АО «Россельхозбанк» Генеральная лицензия Банка России № 3349 от 12.08.2015 г.`})}),t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs pt-lg",children:t.map(((e,t)=>o(ko,{index:t,...e},String(t))))}):null]}))),Co=bt((({className:e,footer:t,...l})=>{const{topItems:n}=l.options?.page?.sitemap??{},{relatedEnterprises:a,contacts:r,socialMedia:s,mobileApps:d,horizontalNavigationTitle:m,documents:h}=t||{},u=i((()=>{const[e,t,l]=bo;((e,t)=>{const l=globalThis.document?.cookie.split(";")??[],[,n]=l.map((e=>e.split("="))).find((([t])=>t.trim()===e))||[];t(n)&&(globalThis.document.cookie=`${e}=${t(n)}`)})(e,(e=>e?.replace(t,l)))}),[]);return c(b,{tag:"footer",className:e,defaultPadding:"p-4xl pb-24",...l,children:[o("div",{className:"mb-lg pb-xs border-b border-main-divider",role:"menu",children:Io(n)}),o(uo,{className:"overflow-hidden",items:r}),c("div",{className:"mt-xl",children:[o(Gr,{className:"mb-xl",media:s,stretched:!0,children:"Соцсети"}),c("div",{className:"mb-xl",children:[o("div",{className:"flex flex-col gap-4 mb-xs",children:d?.map(To)}),o(Pe,{size:"text-s",font:"font-light",color:"text-secondary-text",children:"Мобильное приложение"})]})]}),o("div",{className:"py-lg border-t border-main-divider",children:o(yo,{text:"Вернуться на прежнюю версию сайта",className:"text-l font-light max-w-[292px]",href:"https://old.rshb.ru",onClick:u})}),o(vo,{className:"py-lg border-y border-main-divider",title:m,links:a}),o(So,{links:h})]})})),Io=e=>e?.map(((e,t)=>o(mo,{foldButtonVersion:"accordion",label:e?.text,labelIcon:e?.icon,role:"menuitem",children:o(No,{items:e.items,basePath:P(e.href)})},String(t)))),To=({href:e="/",text:t},l)=>{const{label:n}=qr(e);return o(ue,{className:"w-full",text:t||n,version:"secondary",href:e,target:"_blank"},String(l))},Bo={width:"34",height:"34"},Mo={"bg-white":"color",transparent:"white"},Vo={"bg-white":"text-primary-main",transparent:"text-white"},Po=(e,t,l)=>o(J,t?.src?{image:t,className:Vo[e],width:l?.width,height:l?.height}:{image:{icon:t?.icon||"LogoIcon",iconVersion:Mo[e]},className:Vo[e],width:l?.width,height:l?.height}),Ro={"bg-white":"text-primary-text",transparent:"text-white"},zo=d((({className:e,href:t="/",logo:l,children:n,targetBlank:a,bgColor:i="bg-white",showTitle:r=!0})=>c("a",{className:x("inline-flex items-center font-sans no-underline",e),href:t,target:a?"_blank":"_self","aria-label":l?.title??"Россельхозбанк",children:[Po(i,l?.image,Bo),r?n??o("div",{className:"ml-s",children:o(Pe,{font:"font-medium",color:Ro[i],size:"text-s",children:l?.title??"Россельхозбанк"})}):null]}))),Ao={default:"px-5 bg-main-divider rounded hover:text-primary-main",transparent:"text-white hover:text-primary-hover"},Do=d((({bgColor:e,logo:t,alwaysShowLogo:l,internetBankUrl:n,version:a})=>{const r=g(),s=z.BASE_PATH?.startsWith(r.pathname),d=i((()=>{r.back()}),[]);return c("div",{className:"flex items-center justify-between w-full",children:[l||s?o("div",{children:o(zo,{className:"my-2xs",bgColor:e,logo:t})}):jo(d),n?o("div",{children:o(ue,{href:n,ariaLabel:"Войти",target:"_blank",className:x("p-s text-s whitespace-nowrap text-primary-main hover:text-primary-hover",Ao["transparent"===a?"transparent":"default"]),children:"Войти"})}):null]})})),jo=e=>o("div",{children:c("button",{className:"flex items-center text-l my-2xs","aria-label":"Вернуться назад",onClick:e,type:"button",children:[o(J,{className:"w-6 h-6",image:{icon:"ChevronLeftIcon",iconVersion:"black"},width:"24",height:"24"}),"Вернуться назад"]})}),Fo={"bg-white":"primary",transparent:"transparent"},Eo=bt((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:l=Fo[e],portal:n,...a})=>{const{logo:i}=a.options?.page?.sitemap??{},{internetBankUrl:r}=n||{};return o(b,{tag:"header",defaultPadding:"",version:l,...a,children:o("div",{className:"container px-lg py-2xs box-border",children:o(Do,{bgColor:e,logo:i,alwaysShowLogo:t,internetBankUrl:r,version:l,...a})})})})),Lo={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},Oo=bt((({className:e="",padding:t="p-0",gap:l="",isInnerPadding:n=!0,version:a="transparent",isTheme:i=!1,isCardBorder:r=!1,image:s,...c})=>{const d=g();return o(b,{className:x("relative flex flex-col",Lo[l],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${G(d)(s?.src)})`}}:{},padding:t,version:a,isTheme:i,...c,children:V({...c,extraProps:{className:x("w-full",wr(r)),padding:n?"":"p-0"}})})}),{childrenTypes:[]}),$o=bt((e=>o(Oo,{...e})),{childrenTypes:[]}),_o=d((e=>{const{className:t,image:l,...n}=e;return o(b,{className:t,defaultPadding:"p-0",...n,children:o(J,{image:l})})})),Uo=["байт","Кб","Мб","Гб","Тб","Пб"],Ho=d((({icon:e,text:t,href:l,target:n,fileFormat:a,fileSize:i})=>{const r=i&&a?",":"",s=i??"",d=a?String(a):"";return c("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",href:l,target:n,children:[e,t?c(Pe,{size:"text-l",font:"font-light",children:[t," ",Wo(s,d),o(Pe,{color:"text-secondary-text",children:l&&`${s+r+d}`})]}):null]})})),Wo=(e,t)=>e||t?o("span",{children:", "}):"",Ko={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},qo=d((({className:e="",title:t,description:l,align:n="text-center",documents:a,icon:i={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=g();return c(b,{className:x("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(S,{title:t,description:l,align:n,headlineVersion:"M",as:"h2",isEmbedded:!0}),a?.length?o("div",{className:x("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",Ko[r]),role:"list",children:a.map(Go(d,i))}):null]})})),Go=(e,t)=>(l,n)=>{if(""===l?.docType)return null;const a="Attachment"===l?.docType?$(e)(l?.attachment?.src):l?.href,i="Attachment"===l?.docType?((e,t=2)=>{if(0===e)return"";const l=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,l)).toFixed(t))} ${Uo[l]}`})(l?.attachment?.fileSize||0):l?.fileSize,r="Attachment"===l?.docType?Yo(a):l?.fileFormat;return o("div",{role:"listitem",children:o(Ho,{text:l?.text,target:l?.target,href:a,fileFormat:r,fileSize:i,icon:t?o(J,{className:"min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md",image:t,width:"24",height:"24"}):null})},String(n))},Yo=e=>{if(!e)return"";const t=e.lastIndexOf("."),l=new RegExp(/\/(.*)/),n=-1!==t?e.substring(t+1):"";return n.includes("/")?n.replace(l,""):n},Xo=d((({className:e,padding:t,align:l="text-left",buttons:n=[],description:a,image:i,items:r,qr:s,additionalDescription:d="",title:m="Мобильное приложение",version:h="primary",...u})=>{const p="secondary"===h?"p-m min-w-32":"min-w-24",g=i?.src?o(J,{className:"hidden lg:block",image:i}):null;return o(b,{className:x("min-h-80",e),padding:"p-0",version:h,...u,children:c(be,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(N,{headingType:"h3",title:m,className:x("whitespace-pre-wrap",l)}),rightImage:g,buttons:Ue(n,{className:"flex-wrap"}),children:[a?o(Pe,{size:"text-xl","font-weight":"font-light",children:a}):null,c("div",{className:x("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[o(Ye,{items:r,listItemSize:"M"}),o(Pe,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:d}),s?.src?o("div",{className:x("flex justify-center bg-white rounded-md @xl:-order-1",p),children:o(J,{className:"w-fit",image:s})}):null,i?.src?o(J,{className:"lg:hidden",image:i}):null]})]})})})),Qo={primary:"bg-white/30",secondary:"bg-main-divider"},Zo={primary:"text-white",secondary:"text-secondary-text"},Jo=d((({count:e,version:t="secondary"})=>o("div",{className:x("w-6 h-6 rounded-full flex items-center justify-center",Qo[t]),role:"status",children:o(Pe,{size:"text-xs",color:Zo[t],children:e})}))),ec=(e=[],t={})=>e.filter((({content:e={}})=>fs(t,e))).length,tc=(e,t)=>e===t;const lc=(nc=function(...e){return(t,l)=>e.some((e=>e(t,l)))}(tc,((e=tc)=>(t,l)=>t===l||Boolean(t&&l&&t.length===l.length&&t.every(((t,n)=>e(t,l[n])))))()),(e,t)=>e===t||Boolean(e&&t&&Object.keys(e).length===Object.keys(t).length&&Object.entries(e).every((([e,l])=>nc(l,t[e])))));var nc;const ac=[],ic={},rc={default:"px-xs",underlined:"px-m",rounded:"px-lg rounded-md"},sc={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",rounded:"text-white"},oc={default:"bg-white",underlined:"bg-white",rounded:"bg-transparent"},cc={default:"sm:bg-primary-main",underlined:"bg-white",rounded:"bg-primary-main"},dc=d((({tag:e="div",item:t={},isActive:l,type:n="default",onClick:a})=>{const i=e,{text:r,appendRight:s,...d}=t;return o(i,{className:x("h-12","block flex-1","cursor-pointer",rc[n],l?cc[n]:oc[n]),role:"tab","aria-selected":l,onClick:a,...d,children:c("div",{className:x("h-full","flex justify-center items-center","text-center whitespace-nowrap",l?sc[n]:"text-secondary-text hover:text-primary-main"),children:[o(Pe,{size:"text-m",children:r}),s?o("div",{className:"ml-xs",children:s}):null]})})})),mc=d((e=>o(e?.item?.href?hc:uc,{...e}))),hc=d((e=>{const t=oe(),l=i((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:n,...a}=t({...e.item,onClick:l});return o(dc,{...e,tag:"a",item:a,onClick:n})})),uc=d((({item:e={},onClick:t,...l})=>{const n=i((()=>{t&&t(e)}),[t,e]);return o(dc,{item:e,onClick:n,...l})})),pc=(e,t,l)=>(n,a)=>o(mc,{isActive:n===e,onClick:t,type:l,item:n},String(a)),gc=d((({className:e,tabsType:t="default",items:l=[],value:n,onChange:a})=>o("div",{className:x("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tablist",children:l.map(pc(n,a,t))}))),xc={categories:[],extraOptions:[],propertyType:[],stage:[]},fc=bt((({className:e,hotFilters:t,filtrationSchema:l={},resetButton:n,...a})=>{const[s,{field:d,reset:m,update:h}]=Tt(xc),u=s===xc?a.block?.blocks:ys(a.block?.blocks,s)(),p=i(((e=xc)=>h(e)),[]),g=(({hotFilters:e=ac,filtrationState:t=ic,blocks:l=ac,onFiltrationStateChange:n})=>{const a=r((()=>Math.max(0,e.findIndex((e=>lc(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,appendRight:o(Jo,{version:t===e[a]?"primary":"secondary",count:ec(l,t.filter)})})))),[e,l,a]),c=i((t=>{n(e[s.indexOf(t)].filter)}),[e,s]);return{value:s[a],items:s,onChange:c}})({hotFilters:t,filtrationState:s,blocks:a.block?.blocks,onFiltrationStateChange:p});return c(b,{className:x("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...a,children:[o(gc,{...g}),Ns({field:d,reset:m,filtrationSchema:l,resetButton:n}),o(gs,{blocksToRender:u,...a})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}});function bc(e,t,l){t.geoObjects.removeAll();const n=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),a=new e.Clusterer({clusterIcons:[{href:"/icons/MapMarkerClusterIcon.svg",size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),i=l.map((t=>new e.Placemark(t,{},{iconLayout:"default#image",iconImageHref:"/icons/MapMarkerSingleIcon.svg",iconImageSize:[78,84],iconImageOffset:[-35,-50]})));a.add(i),t.geoObjects.add(a),t.setBounds(e.util.bounds.fromPoints(l)).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const yc={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center",font:"text-center font-sans"},vc=(e,t,l)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(yc).join(" ")} ${l}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.geoObjects.add(t.geoObjects)}))},children:o(H,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),Nc=e=>globalThis[e];const wc=()=>function(e,t){const[l,r]=n(),s=i((()=>r(Nc(e))),[e]);return a((()=>{const l=document.getElementById(t);if(!l){const e=document.createElement("script");return e.src=t,e.async=!0,e.id=t,e.addEventListener("load",s),document.head.appendChild(e),()=>{document.head.removeChild(e),r(void 0)}}if(!Nc(e))return l.addEventListener("load",s),()=>{l.removeEventListener("load",s)};s()}),[e,t]),l}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${z.YANDEX_MAP_API_KEY||""}&lang=ru_RU`),kc={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center",font:"text-center font-sans text-l"},Sc=d((({yandexMaps:e,direction:t="in"})=>{const l="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const l=e.current.getZoom(),n="in"===t?l+1:l-1;e.current.setZoom(n,{checkZoomRange:!0})},className:`${Object.values(kc).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(H,{name:l,width:"20",height:"16"})})})),Cc={border:"border border-transparent rounded-md ",position:"absolute flex items-center justify-center",size:"w-12 h-12",focus:"focus:border-primary-text focus:border",font:"text-center font-sans",active:"active:bg-primary-active",hover:"hover:bg-primary-hover",other:"select-none cursor-pointer"},Ic=[55.753995,37.614069],Tc=d((({points:e,className:t="",zoom:l=5})=>{const i=s(null),r=wc(),[d,m]=n();if(a((()=>{i?.current?r&&(bc(r,i.current,e),e?.length||i.current.setCenter(Ic)):r?.ready((()=>{i.current||(i.current=new r.Map("map",{center:e?Bc(e):Ic,zoom:l,controls:[],suppressMapOpenBlock:!0}),bc(r,i.current,e))}))}),[r,i,e,l]),!r)return null;const h=d?"z-[100000]":"z-10";return c("div",{id:"map",className:x(!d&&"relative","w-full",t),children:[o("div",{className:x(Object.values(Cc),h,"right-2 top-4 bg-white"),onClick:()=>{const e=i.current.container;d?e.exitFullscreen():e.enterFullscreen(),m(e.isFullscreen())},children:o(H,{name:"FullScreenIcon",width:"16",height:"16"})}),c("div",{className:x("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(Sc,{yandexMaps:i}),o(Sc,{yandexMaps:i,direction:"out"})]}),vc(i.current,r,x("right-2 top-80",h))]})})),Bc=e=>[Vc(Mc(e,0)),Vc(Mc(e,1))],Mc=(e,t)=>e.map((e=>e[t])),Vc=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Pc={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных"},Rc=(e,{field:t,reset:l})=>c("div",{className:"pb-2xl",children:[e?.length?o("div",{className:"flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",children:e.map((e=>o(gn,{text:Pc[e],...t(e)},e)))}):null,o(ue,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:l,text:"Очистить фильтр",appendRight:o(H,{name:"CloseIcon",width:"16",height:"16"})})]}),zc=()=>null,Ac=()=>[],Dc=d((({className:e,data:t=[],renderCard:l=zc,filterItems:n=Ac,initFilterState:a={},descriptionData:i,title:s})=>{const[d,{field:m,reset:h}]=Tt(a),[p,g,f]=r((()=>{const e=n(t,d),l=e.map((e=>[e.gpsLatitude,e.gpsLongitude].filter(Boolean))).filter((e=>e&&2===e.length));return[e,l,e.length]}),[t,d]);return c("div",{className:x("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-6xl pb-0",children:[c("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:[o(N,{headingType:"h2",children:s}),f?o(Pe,{size:"text-h2",color:"text-secondary-text",children:`(${f})`}):null]}),i?jc(i):null,Rc(Object.keys(a),{field:m,reset:h})]}),o("div",{className:"h-[600px]",children:o(u,{children:o(Tc,{points:g,className:"h-full"})})})]}),p.map(l)]})})),jc=({__html:e,list:t})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o(Me,{__html:e})}):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(J,{image:e.image}):null,e?.text?o(Pe,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,Fc={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"}},Ec=d((({className:e,children:t,color:l="gray"})=>c("div",{className:x("pt-2xl sm:p-s sm:border sm:border-gray rounded-md flex items-center",Fc[l].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(J,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(Pe,{size:"text-m",color:Fc[l].text,children:t})]}))),Lc=d((({value:e,subText:t,children:l,...n})=>{const a=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[a.length,l,t].every((e=>!e))?null:Oc({textItems:a,subText:t,children:l,...n})})),Oc=({label:e,labelSize:t="text-m",textItems:l,subColor:n,subText:a,className:i,children:r})=>c("div",{className:x("flex gap-2xl sm:gap-2xs flex-col h-full max-w-[300px]",i),children:[e?o(Pe,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||l.filter(Boolean).map(((e,t)=>o(Pe,{size:"text-l",children:e.trim()},String(t)))),a?o(Pe,{color:n,size:"text-m",children:a}):null]}),$c=d((({className:e,children:t})=>o("div",{className:x("sm:flex sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),_c=["ArrowDownIcon","ArrowUpIcon"],Uc=["Подробнее","Скрыть"],Hc=({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:Uc[Number(e)]}),o(H,{className:"text-primary-text",name:_c[Number(e)],width:"16",height:"16"})]}),Wc=({location:e,address:t,billAcceptorType:l,terminalType:n,billAcceptorEnable:a,atmCode:i="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:qc(n)},{label:"Модуль приема наличных",value:a?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===l?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:i}];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(Pe,{size:"text-h4",children:qc(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(H,{name:"GeolocationIcon",width:"24",height:"24"}),o(Pe,{size:"text-l",children:t})]}):null]}),o(Ec,{color:"green",children:qc(s)})]}),o("div",{className:"hidden sm:block",children:o($c,{className:"flex-wrap",children:m?.map(Kc)})}),o(li,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ni,{isUnfolded:e,children:o($c,{className:"flex-wrap",children:m?.map(Kc)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Hc({isUnfolded:e,onToggle:t})})]},String(d))},Kc=(e,t)=>o(Lc,{...e},String(t)),qc=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",Gc=[];const Yc=async e=>await ht(e,{method:"GET"})||Gc,Xc={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1},Qc={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable)},Zc=d((({data:e,className:t})=>{const[l]=Fs(),n=function(e){const{data:t=Gc}=ml(`/api/v1/atms?regionCode=${e}`,Yc);return t}(l?.code??"000");return o(Dc,{className:t,filterItems:Jc,data:n,initFilterState:Xc,renderCard:Wc,title:`Банкоматы филиала ${l?.name}`,descriptionData:e})})),Jc=(e,t)=>{const l=Object.keys(t).filter((e=>t[e])),n=l.filter((e=>e.startsWith("terminalType"))),a=l.filter((e=>!n.includes(e)));return e.filter((e=>{const t=a.every((t=>Qc[t](e))),l=!n.length||n.some((t=>Qc[t](e)));return t&&l}))},ed=e=>{const t=e.find((e=>"workingSaturday"!==e.key&&Boolean(e.status)&&Boolean(e.workTime))),l=e.find((e=>"workingSaturday"===e.key&&Boolean(e.status)&&Boolean(e.workTime))),n=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", "),a=[td({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:l?"":n}),td({workTime:l?.workTime,lunchHour:l?.lunchHour,daysOff:n},!0)].filter(Boolean);return o(Lc,{label:"Режим работы",value:a,className:"max-w-none"})},td=({workTime:e="",lunchHour:t="",daysOff:l=""},n=!1)=>e?[`${n?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",l?`не работает: ${l}`:""].filter(Boolean).join("; "):"",ld=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],nd=e=>ld.map((([t,l,n])=>({key:t,title:n,short:l,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??"")}}))),ad=e=>{if(!e)return null;const t=id(e);return c($c,{className:"border-none",children:[o(Lc,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(rd)})}),o(Lc,{label:"Режим работы",className:"max-w-none",children:o(Pe,{children:e})})]})},id=e=>{const t=ld.map((([,e])=>({short:e,status:!0}))),l=e.split("/")??[],n=l[l.length-1]?.toLowerCase();return n?.includes("выходной")?t.map((e=>({...e,status:!n?.includes(e.short.toLowerCase())}))):t},rd=({short:e,status:t},l)=>o("div",{className:x("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(Pe,{size:"text-xs",children:e})},String(l)),sd=({currency:e,buyExchangeRate:t,saleExchangeRate:l},n)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(Lc,{label:"Валюта",value:e.currency}):null,t?o(Lc,{label:"Купить",value:String(t)}):null,l?o(Lc,{label:"Продать",value:String(l)}):null]},String(n)),od=(new Date).getDay(),cd=e=>{const[t]=e?.slice(od-1)??[];if(!t)return null;const{lunchHour:l,status:n,workTime:a,hasLunch:i}=t;return n?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[a?o(Ec,{color:"green",children:a}):null,l&&i?o(Ec,{color:"yellow",children:`перерыв: ${l}`}):null]}):o(Ec,{color:"red",children:"Выходной"})},dd=({lunchHour:e,hasLunch:t=!1,status:l=!1})=>l?e&&t?`Перерыв ${e}`:e:"Не работает",md=({title:e,status:t,workTime:l,lunchHour:n,hasLunch:a},i)=>o(Lc,{label:e,value:t&&l?l:"",subText:dd({lunchHour:n,hasLunch:a,status:t}),subColor:!t||a?"text-error":"text-green-dark"},String(i)),hd=({name:e,address:t,phone:l,fax:n,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},h)=>{if(!d)return null;const u=nd(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(Pe,{size:"text-h4",children:e}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(H,{name:"GeolocationIcon",width:"24",height:"24"}),o(Pe,{size:"text-l",children:t})]}):null]}),cd(u)]}),o("div",{className:"hidden sm:block",children:ud({phone:l,fax:n,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(li,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ni,{isUnfolded:e,children:ud({phone:l,fax:n,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Hc({isUnfolded:e,onToggle:t})})]},String(h))},ud=({phone:e,fax:t,phoneBusiness:l,phoneNatural:n,phoneCallCentre:a,phoneCurrencyControl:i,workSchedule:r,exchangeRate:s})=>{const d=nd(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c($c,{className:"flex-wrap",children:[o(Lc,{label:"Факс",value:t}),o(Lc,{label:"Телефон филиала",value:e}),o(Lc,{label:"Для обращений юридических лиц",value:l}),o(Lc,{label:"Обслуживание физических лиц",value:n}),o(Lc,{label:"Для консультаций по валютному контролю",value:i}),o(Lc,{label:"Контакт-центр",value:a})]}),r?.isMatchesPattern?o($c,{children:o(Lc,{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(md)})})}):c($c,{children:[o(Lc,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(rd)})}),ed(d)]}),r?.businessScheduleVisibleTag?ad(r?.businessScheduleDescription):null,s?.currencies?.length?o($c,{className:"flex-wrap",children:s?.currencies?.map(sd)}):null]})},pd=[];const gd=async e=>await ht(e,{method:"GET"})||pd,xd={workingSaturday:!1},fd={workingSaturday:e=>Boolean(e.workSchedule?.workingSaturday)},bd=d((({className:e})=>{const[t]=Fs(),l=function(e){const{data:t=pd}=ml(`/api/v1/branches?regionCode=${e}`,gd);return t}(t?.code??"000");return o(Dc,{className:e,filterItems:yd,data:l,initFilterState:xd,renderCard:hd,title:`Офисы филиала ${t?.name}`})})),yd=(e,t)=>{const l=Object.keys(t).filter((e=>t[e]));return e.filter((e=>l.every((t=>fd[t](e)))))},vd=d((({data:e,className:t,...l})=>{const n=e?.dataType??"offices";return o(b,{version:"transparent",className:x(t),defaultPadding:"p-0",...l,children:"offices"===n?o(bd,{}):o(Zc,{data:e})})})),Nd=d((({className:e,size:t})=>o("figure",{className:x("m-0 mt-xl min-w-[80%]",e),children:wd(t)}))),wd=(e=3)=>Sd(100,e).map((e=>Math.floor(e))).map(kd),kd=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-light"},String(t)),Sd=(e,t)=>[e].concat(t>0?Sd(e/1.618,t-1):[]),Cd=d((({className:e,title:t,description:l="Блок в разработке...",...n})=>c(b,{className:x("box-border",e),...n,children:[o(S,{className:"max-w-[600px]",title:t,description:l,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(Nd,{})]}))),Id=d((({className:e,padding:t,slides:l=[],...n})=>o(b,{className:x("overflow-hidden relative",e),padding:t,...n,children:o(Qa,{gap:0,padding:0,children:l.map((e=>e.productBlock)).map(((e,t)=>o("div",{className:"box-border h-full",children:o(lt,{className:"px-5 h-full",headlineVersion:"L",...e,...n})},String(t))))})}))),Td=d((({address:e,email:t,telephone:l,button:n,className:a="",__html:i,icon:r,title:s,version:d="primary",...m})=>c(b,{className:x("box-border text-left space-y-s",a),version:d,...m,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[_e(r)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(J,{image:r})}):null,s?o(N,{headingType:"h3",as:"h3",title:s}):null]}),c("div",{className:"w-full space-y-m",children:[i?Bd(i):null,Md({label:"Адрес",data:e,iconName:"GeolocationIcon"}),Md({label:"Телефон(факс)",data:l,iconName:"PhoneIcon"}),Md({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),n?.text?Ue([n]):null]})]}))),Bd=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(Me,{__html:e})}),Md=({label:e,data:t,iconName:l,dataColor:n=""})=>t?c("div",{className:"flex gap-s",children:[o(H,{iconVersion:"black",name:l,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(Pe,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(Pe,{size:"text-xl",color:n,children:t})]})]}):null,Vd=d((e=>{const{__html:t,richVersion:l,...n}=e;return o(b,{defaultPadding:"p-0",...n,children:o(Me,{__html:t,richVersion:l})})})),Pd=d((({className:e=""})=>{const[t,l]=n("option2"),a=i((e=>l(e)),[]);return c("div",{className:x("order-4",e),role:"radiogroup",children:[o(la,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),o(la,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),Rd=d((({data:e,fieldLabel:t,fieldValue:l,selected:n,placeholder:a="",setSelected:i,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[l||t],text:e?.[t]}))),c=s.find((e=>e.key===n));return o(Nl,{options:s,label:r,placeholder:a||n,onChange:e=>i(e.key),value:c})})),zd=d((({regions:e=[],selectedRegion:t,onSelectedRegion:l,branches:n=[],selectedBranch:a,onSelectedBranch:i})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Rd,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:l,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(Rd,{data:n,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:i,label:"Отделение",placeholder:"Выберите отделение"})})]}))),Ad=["От 1 дня","До 365 дней"],Dd=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Pe,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(Jl,{min:1,max:365,value:e,items:Ad,onChange:t})]}))),jd=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:l,safeBoxCases:n=[],selectedBoxSize:a,onSelectedBoxSize:i})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Rd,{data:e,fieldLabel:"volume",selected:t,setSelected:l,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(Rd,{data:n,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:i,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),Fd=d((({regions:e,selectedRegion:t,branches:l,selectedBranch:n,days:a,selectedCaseVolume:i,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:h})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(zd,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:l,selectedBranch:n,onSelectedBranch:Ed(m)}),o(Dd,{days:a,setDays:e=>m({days:e})}),o(jd,{caseVolumes:d,selectedCaseVolume:i,onSelectedCaseVolume:Ld(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(Pe,{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(Pd,{}),o(ue,{text:"Офисы на карте",version:"primary",onClick:h,className:"order-6"})]})]}))),Ed=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},Ld=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},Od=d((({days:e,tariffs:t=[]})=>{const l=_d(e,t),n="На рисунке изображена пачка листов\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:[$d("Аренда за",e),$d("Цена",l+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:n})}),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(J,{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:n})})]})]})})),$d=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(Pe,{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})]}),_d=(e,t)=>{const l=Ud(e);return e*(t?.find((e=>e.tariffType===String(l)))?.tariffValue||0)},Ud=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},Hd=(e,t)=>e.find((e=>e.branchCode===t)),Wd=d((e=>{const{regions:t,data:l,branches:n,onChange:i,onClick:r}=e;a((()=>{i({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[l.selectedRegion,i]);const s=Hd(n,l.selectedBranch),d=Kd(s?.safeBoxCaseVolumes),m=qd(s?.safeBoxCaseVolumes,l.selectedCaseVolume)?.safeBoxCases,h=Gd(m,l.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(Fd,{...l,regions:t,onClick:r,branches:n,caseVolumes:d,safeBoxCases:m,onChange:i}),o(Od,{days:l.days,tariffs:h})]})})),Kd=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],qd=(e,t)=>e?.find((e=>e.volume===t)),Gd=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Yd=[];const Xd=async e=>await ht(e,{method:"GET"})||Yd,Qd=d((({title:e,footnote:t,className:l="",...a})=>{const[r,s]=n(!1),d=i((()=>s((e=>!e))),[]),[m,h]=n({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),u=ul(),p=Zd(m.selectedRegion,u),g=function(e){const{data:t}=ml(e?`/api/v1/safeboxes?regionCode=${e}`:null,Xd);return t||Yd}(p),x=i((e=>h((t=>({...t,...e})))),[h]),f=(y=Hd(g,m.selectedBranch)||g,Array.isArray(y)?y.map((e=>e.gpsLatitude&&e.gpsLongitude?[e.gpsLatitude,e.gpsLongitude]:[])):y?.gpsLatitude&&y?.gpsLongitude?[[y.gpsLatitude,y.gpsLongitude]]:[]);var y;return c(b,{className:l,defaultPadding:"",...a,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(N,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(Wd,{regions:u,branches:g,data:{...m,selectedRegion:p},onClick:d,onChange:x}),t?o(w,{size:"text-s",font:"font-light",children:t}):null]}),f.length&&r?o(Tc,{points:f,className:"h-[640px]"}):null]})})),Zd=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e;function Jd(e){throw new Error(e)}const em={normal:{icon:"h-11 w-11",image:"h-14 w-14"},small:{icon:"h-12 w-12",image:"h-14 w-14"}},tm={normal:"",small:"min-h-6xl"},lm={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"},nm=d((({className:e="",title:t,description:l,steps:n,buttons:a,size:i="normal",stepVersion:r="gray",version:s="primary",...d})=>c(b,{className:x("box-border flex flex-col gap-xl",e),defaultPadding:"p-6xl",version:s,...d,children:[o(S,{title:t,description:l,headlineVersion:"M",isEmbedded:!0,align:"text-left"}),n?.length?o("div",{className:"box-border",children:o("div",{className:"flex flex-col gap-6xl justify-between",children:n.map(am(i,r))})}):null,Ue(a,{isVertical:!0})]}))),am=(e,t)=>(l,n)=>{const{type:a}=l;if("default"!==a&&"rte"!==a)return null;switch(a){case"default":return im(e,t)(l,n);case"rte":return o(Me,{__html:l.__html});default:Jd(l)}},im=(e,t)=>(l,n)=>o("div",{className:"contents",children:c("div",{className:"flex flex-row items-center relative",children:[o("div",{className:"overflow-hidden flex flex-shrink-0 items-center",children:rm(e,t)(l,n)}),c("div",{className:x("flex flex-col justify-center h-fit",tm[e]),children:[l.label?o(w,{size:"text-l",align:"text-left",children:l.label}):null,l.description?o("div",{className:x("text-s font-light text-left",lm.description),children:l.description}):null]})]})},String(n)),rm=(e,t)=>(l,n)=>{const a="secondary"===t?"white":"color",i=Boolean(l?.icon?.src),r=em[e][i?"image":"icon"],s=i?"transparent"===t:t;return o(b,{className:x(r,"z-10 mr-s flex justify-center content-center rounded-md"),defaultPadding:"",version:s,children:o("span",{className:"flex max-w-full max-h-full items-center justify-center",children:_e(l?.icon)?o(J,{image:{...l.icon,iconVersion:l.icon?.iconVersion||a},imageClassName:"max-w-full max-h-full",width:sm(e),height:sm(e)}):o("span",{className:x("text-h4","transparent"===t?lm.iconText:(c=t,"secondary"===c?"group-data-primary:text-white":"text-secondary-text")),children:n+1})})});var c},sm=e=>"normal"===e?"38":"24",om=e=>({href:t})=>!!t&&j(cm(t,e)).startsWith(j(t)),cm=(e,t)=>A(e)?t.href:t.pathname;function dm(e=[]){const t=g(),l=e.findIndex((e=>om(z.BASE_PATH?{pathname:z.BASE_PATH}:e))(t));return[l,e[l]]}const mm=d((({isActive:e,onClick:t})=>c("button",{className:x(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),onClick:t,type:"button",children:[o(H,{className:"w-6 h-6",name:"BurgerIcon",iconVersion:e?"color":"black"}),"Меню"]}))),hm=d((({isActive:e,item:t,onClick:l})=>{const n=oe({isRemote:!0}),{href:a,onClick:i}=n({href:t?.href,onClick:l});return c("a",{className:x(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),href:a,target:"_self",title:t?.title||"",onClick:i,children:[o(H,{className:"w-6 h-6",name:t?.icon?.icon,iconVersion:e?"color":"black"}),t?.title||""]})}));const um=({onCloseAll:e,onClose:t}={})=>{const[l,{push:r,pop:s,clear:o}]=function(e=[]){const[t,l]=n(e),a=i((e=>l((t=>[...t,e]))),[]),r=i((()=>l((e=>e.slice(0,-1)))),[]),s=i((e=>l((t=>t.filter((t=>t!==e))))),[]),o=i((()=>l([])),[]);return[t,{setList:l,push:a,pop:r,remove:s,clear:o}]}(),c=i((()=>{e&&e(l),o()}),[l,e]),d=i((()=>{t&&t(l[l.length-1]),s()}),[l,t]);return a((()=>p.subscribe("dialog",(e=>{switch(e.type){case"open":r(e);break;case"close":e.all?c():d();break;default:Jd(e)}}))),[c,d]),l},pm=d((({className:e,onClose:t})=>o("button",{className:x("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",type:"button",children:o(J,{image:{icon:"CloseIcon"},width:"24",height:"24"})}))),gm=d((({className:e,head:t,children:l,onClose:n})=>{const{close:a}=re(),r=i((()=>{a(),n&&n()}),[n]);return c("div",{className:x("relative min-h-full bg-white pt-0 p-5",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(pm,{className:"absolute top-0 right-0",onClose:r}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:l})]})})),xm=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:l,s1Matches:n,s2Matches:a}=function(e,t){const l=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),n=Array.from({length:e.length}),a=Array.from({length:t.length});let i=0;for(let r=0;r<e.length;r++){const s=Math.max(0,r-l),o=Math.min(r+l,t.length-1);for(let l=s;l<=o;l++)n[r]||a[l]||e[r]!==t[l]||(i++,n[r]=!0,a[l]=!0)}return{m:i,s1Matches:n,s2Matches:a}}(e,t);if(0===l)return 0;const i=function(e,t,{s1Matches:l,s2Matches:n}){let a=0;for(let i=0,r=0;i<e.length;i++){if(!l[i])continue;let s=r;for(;s<t.length;s++)if(n[s]){r=s+1;break}e[i]!==t[s]&&a++}return a}(e,t,{s1Matches:n,s2Matches:a}),r=(l/e.length+l/t.length+(l-i/2)/l)/3,s=r>.7?.1*function(e,t){let l=0;for(;e[l]===t[l]&&l<4;)l++;return l}(e,t):0;return r+s*(1-r)};const fm=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(Pe,{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(bm,{...e},String(t))))})]}):null,bm=d((({icon:e,...t})=>{const l=oe(),{text:n,target:a,href:i,onClick:r}=l(t);return c("div",{className:"flex gap-s items-center",children:[e?o(J,{pathPrefix:"/wcms-resources/",image:e}):null,n?o("a",{className:"hover:text-primary-hover",href:i,target:a,onClick:r,children:o(Pe,{size:"text-l",font:"font-light",color:"text-primary-text",children:n})}):null]})})),ym=e=>t=>o("div",{className:"mb-xs sm:mb-2xs",children:o("button",{className:"cursor-pointer hover:text-primary-hover",onClick:()=>{e&&e(t)},type:"button",children:o(Pe,{size:"text-l",font:"font-light",children:t.name||""})})},t.id),vm=d((({className:e,searchTerm:t,onSearch:l})=>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:"h-12 pl-m w-full peer text-l text-black border border-solid rounded-md box-border\n outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text",value:t,onChange:e=>l(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),Nm=d((({foreignOffices:e,defaultLocation:t})=>{const[l,a]=Fs(t),[r,s]=n(""),d=km(ul()).sort(((e,t)=>e.name.localeCompare(t.name))),m=((e,t)=>{const l=new Map;for(const n of e){const e=t(n),a=l.get(e)||[];l.set(e,[...a,n])}return l})(d,wm),{close:h}=re(),u=i((e=>{a(e),h()}),[]);return c(gm,{className:"pb-20",head:c("div",{children:[o(Pe,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),l?c("div",{className:"mb-s",children:[o(Pe,{size:"text-l",font:"font-light",children:"Сейчас выбран: "}),o("button",{type:"button",onClick:()=>a(l),children:o(Pe,{color:"text-primary-main",children:l.name})})]}):null,o(vm,{onSearch:s,searchTerm:r})]}),children:[r&&r.length>=3?o("div",{children:d.filter((({name:e})=>e&&xm(e.toLowerCase())(r.toLowerCase())>=.8)).map(ym(u))}):o("div",{className:"columns-1 sm:columns-5",children:Array.from(m.entries()).map((p=u,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(Pe,{size:"text-h6",children:e})}),t.map(ym(p))]},e)))}),fm(e)]});var p})),wm=e=>e.name?.charAt(0)||"",km=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()||""}))),Sm=d((({className:e,value:t,autoFocus:l,onChange:n,onFocus:a,placeholder:r="Поиск по сайту"})=>{const s=i((e=>{n&&n(e.target?.value||"")}),[n]);return c("div",{className:x("font-sans relative",e),role:"form",children:[o("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:o(J,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),o("input",{className:x("h-14 w-full px-10 text-l text-black outline-none box-border border border-solid rounded-md","border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text"),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:l,onChange:s,onFocus:a})]})}));function Cm(e,t,l=300){a((()=>{const t=globalThis.setTimeout(e,l);return()=>{globalThis.clearTimeout(t)}}),t)}const Im=(e,t)=>(l,n)=>{for(const[a,i]of n)l.set(a,e(l.get(a)||t,i));return l},Tm=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),Bm=e=>t=>e.map((([e,l])=>[xm(t)(e),l])).filter((([e])=>e>=.8)).map((([e,t])=>Vm(t,e))).reduce(Im(Math.max,0),new Map),Mm=e=>t=>{return Bs(t,t.map((({title:e})=>e)).map((e=>t=>{const l=Tm(t||"");return l.length?Ie(e.map((e=>Wa(l.map(xm(e)))))):0})(e))).sort((e=>(t,l)=>-e(t,l))((l=([,e])=>e,(e,t)=>l(e)-l(t)))).map((([e])=>e));var l},Vm=(e,t)=>new Map(e.map((e=>[e,t]))),Pm=({basePathList:e,initialQuery:t=""})=>{const[l,i]=n(t||"");a((()=>{null!=t&&i(t)}),[t]);const{data:r}=ml(e?.length?e:null,Rm),[s,o]=n(null);return Cm((()=>{r&&o(r.map((e=>t=>{const{corpus:l,dictionary:n}=t||{};if(!(e&&l?.length&&n&&Object.keys(n).length))return[];const a=Tm(e);if(!a.length)return[];const i=Object.entries(n),r=[...a.map(Bm(i)).reduce(Im(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*a.length)).map((([e])=>l[e]));return Mm(a)(r)})(l)))}),[r,l]),[s,{value:l,onChange:i}]},Rm=async(...e)=>(await Promise.allSettled(e.map((e=>ht(F(e,"/","search.index.json")))))).map((e=>"fulfilled"===e.status?e.value:{})),zm=d((({className:e,topItems:t})=>{const l=oe({isRemote:!0});return o("div",{className:x("flex items-start justify-between",e),children:t?.map(l).map(Dm)})})),Am=["all","footer"],Dm=(e,t)=>{const{text:l,items:n=[],href:a,target:i,onClick:r}=e,s=n.filter((e=>!e.displayArea||Am.includes(e.displayArea.toLowerCase())));return c("div",{className:"flex flex-col gap-s w-1/4",children:[o("a",{className:"leading-5 text-l text-primary-text hover:text-primary-main no-underline",href:a,target:i||"_self",onClick:r,children:l||`Раздел ${t}`}),s.map(((e,t)=>o(jm,{...e,basePath:P(a),index:t},String(t))))]},String(t))},jm=d((({text:e,index:t,basePath:l,...n})=>{const a=oe({isRemote:!(!z.BASE_PATH||!l)&&!z.BASE_PATH.startsWith(l),basePath:l}),{href:i,target:r,onClick:s}=a(n);return o("a",{className:x("text-l font-light text-secondary-text hover:text-primary-main no-underline","overflow-x-hidden overflow-ellipsis whitespace-nowrap"),href:i,target:r||"_self",onClick:s,children:e||`Раздел ${t}`})})),Fm=d((({initialQuery:e,topItems:t})=>{const l=r((()=>t?.map((e=>e.href||"/"))),[t]),[n,a]=Pm({basePathList:l,initialQuery:e}),i=r((()=>Em(t)(n)),[t,n]);return o(gm,{head:o(Sm,{autoFocus:!0,...a}),children:o(zm,{topItems:i})})})),Em=e=>t=>e?.length&&t?.length?Bs(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:F("/",t)})))}))):[],Lm=d((({className:e,...t})=>{const[l,a]=n(""),r=i((()=>a("")),[]),s=((e={})=>{const{open:t,close:l}=re();return{open:(l={},n={})=>t(o(Fm,{...e,...l}),n),close:l}})(t),d=i((e=>{a(e),Om(e)&&s.open({initialQuery:e},{onClose:r})}),[r,s]);return c("div",{className:x("relative",e),role:"search",children:[o(Sm,{value:l,onChange:d}),o(pm,{className:"absolute top-0 right-0 sm:hidden",onClose:r})]})})),Om=e=>e&&e.length>=3,$m=d((({item:e,basePath:t})=>{const l=oe({isRemote:!(!z.BASE_PATH||!t)&&!z.BASE_PATH.startsWith(t),basePath:t}),{href:n,target:a,onClick:i}=l(e),r=g(),s=om(r)({href:n});return c("a",{className:x(s?"text-primary-main":"text-primary-text","py-3 text-h5 font-light flex justify-between cursor-pointer"),href:n,target:a,onClick:i,children:[e.text,o(J,{image:{icon:"ChevronLeftIcon",iconVersion:"black"},width:"24",height:"24",className:"text-secondary-text rotate-180 opacity-30"})]})})),_m=({item:e,isActive:t,onClick:l})=>c("button",{type:"button",className:"relative",onClick:l,children:[o("span",{className:x("whitespace-nowrap",t?"text-primary-main":""),children:e.text}),t?o("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-transparent"}):null]}),Um=d((e=>{const{topItems:t,defaultLocation:l,officesLink:s}=e,[d]=Fs(l),m=(e=>{const{open:t,close:l}=re();return{open:(l={})=>t(o(Nm,{...e}),l),close:l}})(e),[h,u]=Xa({itemCount:t?.length??0}),[p]=dm(t),[g,x]=n(p),f=r((()=>t?.[g]),[t,g]),b=f?.items||[];a((()=>{x(p)}),[p]),a((()=>{g>0&&u.scrollTo(g)}),[g,u]);const y=i((e=>x(e)),[]);return o(gm,{head:o("div",{className:"flex items-center",children:o(N,{as:"h4",title:"Меню"})}),children:c("div",{className:"flex flex-col flex-nowrap relative w-full h-auto m-auto bg-white pb-24 box-border rounded-md",children:[o("div",{className:"w-full mb-3",children:o(Fa,{containerRef:h,visibleItemCount:0,gap:20,className:"pb-3",children:t?.map(((e,t)=>o(_m,{item:e,isActive:g===t,onClick:()=>y(t)},String(t))))})}),c("div",{className:"relative grow overflow-auto",children:[Hm(b,f?.href),o(Lm,{className:"grow mb-5",...e}),Wm(s),Km(d,(()=>m.open()))]})]})})})),Hm=(e,t)=>e?o("div",{children:e.map(((e,l)=>o($m,{item:e,basePath:t},String(l))))}):null,Wm=e=>e?c("a",{className:"flex items-center mb-3",href:e,rel:"noopener noreferrer","aria-label":"Офисы и банкоматы",children:[o(J,{image:{icon:"MapOpenedIcon",iconVersion:"black"},width:"24",height:"24",className:"text-primary-main box-border mr-xs bg-main-divider p-xs rounded-md"}),o("span",{children:"Офисы и банкоматы"})]}):null,Km=(e,t)=>c("div",{className:"flex items-center text-s cursor-pointer",onClick:t,children:[o(J,{image:{icon:"GeolocationIcon",iconVersion:"black"},width:"24",height:"24",className:"text-primary-main box-border mr-xs bg-main-divider p-xs rounded-md"}),c("div",{className:"flex flex-col items-start",children:[o(Pe,{size:"text-h5",children:e.name}),o(Pe,{color:"text-secondary-text",size:"text-s",children:"Ваша локация"})]})]}),qm="burgerMenuDialog",Gm=e=>{const{open:t,closeAll:l,close:n}=re(),a=um(),i=((e,t)=>Boolean(t.find((t=>t.id===e),e)))(qm,a),r=()=>t(o(Um,{...e}),{id:qm});return[i,{open:r,close:n,toggle:()=>{i?l():r()}}]},Ym=[],Xm=bt((({sticky:e,...t})=>{const{menuItems:l=Ym}=e??{},[n,{toggle:a,close:i}]=Gm(t.options?.page?.sitemap??{}),[,r]=dm(l),s=Math.floor(l.length/2),d=l.slice(0,s),m=l.slice(s);return o(b,{className:"h-[74px]",defaultPadding:"p-0",...t,children:c("div",{className:"ml-auto container bg-white flex justify-center shadow-blue-gray",children:[d.map(Qm(r,i)),o(mm,{isActive:n,onClick:a}),m.map(Qm(r,i))]})})})),Qm=(e,t)=>(l,n)=>o(hm,{isActive:l===e,item:l,onClick:t},l.href||String(n)),Zm="hidden sm:flex absolute z-40 top-0",Jm=d((({className:e,items:t=[],value:l,onChange:n,tabsType:a})=>{const[i,r]=Xa({itemCount:t?.length||0});return c("div",{className:x("relative overflow-x-auto no-scrollbar",e),role:"tablist",children:[o(Fa,{containerRef:i,snapAlign:"snap-start",onVisibleIndicesChange:r.handleVisibleIndicesChange,children:t.map(pc(l,n,a))}),r.canScrollLeft?o(xr,{className:x("left-6",Zm),onClick:r.scrollLeft}):null,r.canScrollRight?o(fr,{className:x("right-6",Zm),onClick:r.scrollRight}):null]})})),eh=({tabsMode:e,...t})=>{switch(e){case"wideScreen":return o(gc,{...t});case"centered":return o("div",{className:"flex",children:o(gc,{className:"m-auto p-xs rounded-md bg-main-gray",tabsType:"rounded",...t})});case"scrollable":return o("div",{className:"flex",children:o(Jm,{className:"m-auto",tabsType:"underlined",...t})});default:return null}},th="tab",lh=d((({className:e="",isSticky:t,tabs:l=[],tabsMode:s,...c})=>{const d=g(),{isReady:m}=d,h=r((()=>l.map(ah)),[l]),[u,f]=n(0);a((()=>{if(!l||!l[0])return;const e=d.query.tab&&l.findIndex((e=>"group"===e.type&&e.ref===d.query.tab))||0,t=l[e]||l[0];f(e),nh(t)}),[m]),a((()=>{const e=l[u];"group"===e?.type&&p.subject("tab",{type:e.type,label:e.ref,groupName:e.name})}),[l,u]);const y=i((e=>{const t=h.indexOf(e),n=l[t];f(t),nh(n),"group"===n.type&&(e=>{const t=new URLSearchParams(d.query);e.name?t.set(th,e.name):t.delete(th),d.replace(`${d.pathname}?${t}`,"",{scroll:!1})})(e)}),[l,h]);return o(b,{className:x(t?"sticky top-1 z-20":"",e),defaultPadding:"p-0",...c,children:eh({items:h,value:h[u],tabsMode:s,onChange:y})})})),nh=e=>{"group"===e.type&&p.fire("tab",{type:e.type,label:e.ref,groupName:e.name}),"link"===e.type&&p.fire("tab",{type:e.type,label:e.href})},ah=e=>"group"===e?.type?{text:e.title,name:e.ref}:e,ih={start:"text-start",center:"text-center",end:"text-end"},rh=d((({tab:e,className:t,onClick:l,isActive:n})=>{const a=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white text-primary-text"),title:e?"mb-xs text-xl":"mb-2xs text-l",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal"}))(n);return c("button",{type:"button",onClick:l,"aria-label":e?.title,className:x("border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs",a.btn,t),children:[e?.icon?o(J,{className:x("h-6 w-6 min-w-6 min-h-6",a.icon),image:{...e?.icon,iconVersion:e?.icon?.iconVersion??a.iconVersion},width:"24",height:"24"}):null,c("div",{className:"border-0",children:[e?.title?o("div",{className:a.title,children:e.title}):null,e?.description?o("div",{className:a.desc,children:e.description}):null]})]})})),sh=d((({tab:e})=>{const t=oe(),{onClick:l}=t({...e,onClick:()=>{e.href&&!D(e.href)&&(globalThis.location.href=e.href)}});return Cm(l,[],800),o(Nd,{className:"col-span-12 p-xl",size:5})})),oh=bt((({className:e="",tabs:t=[],block:l,tabAlign:a,...i})=>{const[r,s]=n(dh(t)),d=ch(t[r],r),m=t.length,[h,{inc:u,dec:p}]=pr({itemCount:m},r),[g,f]=Xa({itemCount:m});return c(b,{className:x(e),defaultPadding:"p-0",...i,children:[c("div",{className:"relative border-b-8 border-primary-main",children:[o(Fa,{itemClassName:"flex",containerRef:g,snapAlign:"snap-end",gap:8,onVisibleIndicesChange:f.handleVisibleIndicesChange,children:t.map(mh(r,s,a))}),o(vr,{scroll:f,arrowsPadded:!0,onScrollLeft:p,onScrollRight:u,activeIndex:h,itemCount:m})]}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:t[r]?.href?o(sh,{tab:t[r]}):M(l?.slots?.[d],{...i?.options,slotName:d,parent:l})})]})}),{slots:({tabs:e})=>e?.filter((e=>!e.href)).map(ch)||[],childrenTypes:{exclude:["TabsLayout"]}}),ch=(e,t)=>e?.title||`Слот №${t}`,dh=e=>e.reduce(((e,t,l)=>t.selected?l:e),0),mh=(e,t,l="start")=>(n,a)=>o(rh,{className:ih[l],tab:n,isActive:e===a,onClick:()=>t(a)},String(a)),hh={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},uh=d((({children:e,activeIndex:t,columnWidth:l,version:n="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:hh[n],style:{transform:`translateX(-${t*l}px)`},children:e})}))),ph=d((({className:e="",isOpen:t,onClick:l})=>o(ue,{className:e,appendRight:o(J,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"20",height:"20"}),text:t?"Скрыть":"Показать",version:"gray",onClick:l}))),gh={Buttons:({buttons:e})=>Ue(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(J,{image:e}):null,List:({isDotted:e,...t})=>o(Ye,{className:"flex flex-col justify-between items-start text-h6",isDotted:e??!0,...t}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(Pe,{size:"text-h6",children:e})}):null,t?o("div",{children:o(Pe,{size:"text-l",color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,dataUrl:l,pdfUrl:n,isOpen:a})=>e?o(ph,{isOpen:a,onClick:()=>{t({dataUrl:l,pdfUrl:n})}}):null},xh=d((({cell:e,fieldIdx:t,rowIdx:l,cellIdx:i,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=n(!0);a((()=>{i===o&&s||m(!0)}),[s,o]);return fh({cell:e,cellProps:{rowIdx:l,cellIdx:i,fieldIdx:t,displayTable:e=>{m(!1),c(i),r(e)},isVisible:d}})})),fh=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:l,...n}=e;if(!l||!(l in gh))return null;return o(gh[l],{...t,...n})},bh=d((({cells:e,rowIdx:t,cellIdx:l,setTableInner:n,tableInner:a,openTableInnerIdx:i,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(xh,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:l,setTableInner:n,tableInner:a,openTableInnerIdx:i,setOpenTableInnerIdx:r},String(s)))):null}))),yh=(e,t)=>140*Ie(e.slice(0,t).map((e=>e?.cols?.length??1))),vh=(e,t)=>e?.length>0?o("div",{className:x("flex",0===t?"text-secondary-text":""),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(Pe,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,Nh=d((({rows:e})=>{return o(Fa,{visibleItemCount:0,snapAlign:"snap-start",children:o("div",{children:e?.map((t=0,(e,l)=>{if(!e?.length)return null;const[n,...a]=e,i=x("flex duration-1000 text-center",0!==l?"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(Pe,{size:"text-xl",font:"font-light",children:n.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:i,style:{transform:`translateX(-${yh(a,t)}px)`},children:a?.map(((e,l)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(Pe,{size:"text-xl",children:e.data}):null,e?.cols?vh(e.cols,t):null]},`row${l}`)))})})]},String(l))}))})});var t})),wh=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,l)=>{const n=`activeTabIdx:${e}-tableIdx:${l}`;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(Pe,{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(Nh,{rows:t.rowsData})})})]},n)}))}))),kh=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Sh=d((({currencies:e,linkToPDF:t,activeTabIndex:l,setActiveTabIndex:n})=>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:x("rounded-md px-4 py-3 cursor-pointer",t===l?"bg-primary-main":""),onClick:()=>n(t),children:o(Pe,{size:"text-xl",font:"font-light",color:kh(t===l),children:e||t+1})},e)))}):null,t?o(ue,{className:"text-primary-main",href:t,version:"link",target:"_blank",appendLeft:o(H,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]})));async function Ch(e){const t=await fetch(e);return await t.json()}const Ih=d((({dataUrl:e,pdfUrl:t,onClick:l})=>{const{tableData:a}=function(e){const{data:t}=ml(function(e){return`/wcms-resources/${e||"tariffs-inner-table-data"}.json`}(e),Ch);return t||{}}(e),[r,s]=n(0),d=i((e=>s(e)),[]),m=a?.[r]?.items??[],h=a?.map((e=>e.currency??""));return c("div",a?{className:"bg-white z-10",children:[o(Sh,{currencies:h,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(wh,{activeTabIndex:r,items:m}),o(ph,{className:"mt-xl",onClick:l,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Pe,{size:"text-h6",children:"Данных нет"}),o(ph,{onClick:l,isOpen:!0})]})})),Th=d((({children:e,tableInner:t,onHideContentClick:l})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:x("@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(Ih,{...t,onClick:l})}):null]}))),Bh=d((({row:{header:e,data:t},activeIndex:l,rowIdx:a,...r})=>{const[s,d]=n(void 0),m=i((e=>d(e)),[]),[h,u]=n(void 0),p=i((e=>u(e)),[]);return c(Th,{onHideContentClick:()=>d(void 0),tableInner:s,...r,children:[o("div",{className:x("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(J,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(Pe,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(uh,{activeIndex:l,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(bh,{cells:e,rowIdx:a,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:p,...r},String(t))))}):null]})}));function Mh({dec:e,inc:t,canDec:l,canInc:n,btnClass:a,className:i=""}){return l||n?c("div",{children:[l?o(gr,{className:x("absolute z-40",a[0],i),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!l}):null,n?o(gr,{className:x("absolute z-40 rotate-180",a[1],i),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!n}):null]}):null}const Vh=d((({children:e,controls:t})=>{const{isScrollAvailable:l}=t;return c("div",{role:"table",children:[c("div",{className:"relative space-y-xs",children:[e,Mh({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),l?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),Ph=d((({className:e="",title:t,description:l,rowHeaders:n,tariffsColumns:a,hiddenRowsNum:i=0,...r})=>{const s=a?.map((({data:e})=>e))||[],d=n?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=s.length,[h,u]=pr({itemCount:m,visibleItemCount:2}),p=(d||[]).map(((e,t)=>o(Bh,{row:e,activeIndex:h,rowIdx:t,...r},String(t)))),[g,f]=i>0?[p.slice(0,-i),p.slice(-i)]:[p,[]];return c(b,{className:x("overflow-hidden relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...r,children:[o(S,{title:t,description:l,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m",children:i>0?o(li,{renderFoldableSection:({isUnfolded:e})=>c(Vh,{controls:u,children:[g,o(ni,{isUnfolded:e,children:f})]}),renderFoldButton:Or}):o(Vh,{controls:u,children:p})})]})})),Rh=d((({className:e="",title:t,description:l,iconVersion:n,__html:a,...i})=>c(b,{className:x("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...i,children:["small"===n?zh():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Pe,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,l?Ah(l):null,a?o(Me,{__html:a}):null]})]}))),zh=()=>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"}),Ah=e=>o(w,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),Dh=d((({prefix:e,unit:t,suffix:l})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(Pe,{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,l?o("div",{className:"gradient-color-text",children:o(Pe,{size:"text-h2",children:l})}):null]}))),jh=d((e=>{const{prefix:t,unit:l,suffix:n,...a}=e;return o(b,{defaultPadding:"p-0",...a,children:o(Dh,{prefix:t,unit:l,suffix:n})})})),Fh={AdTile:vt,ApplicationForm:ua,ApplicationFormCustom:Ia,BenefitsBlock:Pa,BonusBenefitsBlock:Ja,ButtonsBlock:ti,Calculator:ar,CardTransfer:ur,Carousel:Vr,CarouselBankHistoryCard:Pr,CarouselCard:Ar,CarouselCatalogCard:jr,CarouselLinks:_r,CarouselRecommendationCard:Yr,CarouselTariffsCard:Zr,ComparisonTable:cs,DepositFiltration:zs,ErrorBlock:Ds,ExchangeRateTile:ro,Footer:Co,Header:Eo,Headline:S,HorizontalLayout:$o,ImgBlock:_o,LinkDocs:qo,MobileAppTile:Xo,MortgageFiltration:fc,OfficesAtmsMap:vd,Placeholder:Cd,ProductBlock:yt,ProductGallery:Id,RepresentativeOfficeInfo:Td,RichTextBlock:Vd,RollupItem:mo,SafeDepositRental:Qd,StepsBlock:nm,StickyBottomMenu:Xm,Tabs:lh,TabsLayout:oh,TariffsTable:Ph,TextBlock:Rh,UnitBlock:jh,VerticalLayout:Oo},Eh="rshb-query-params";const Lh=e=>{const t=function(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(Eh)||"";return e&&globalThis.sessionStorage?.setItem(Eh,e),e}();if(!A(e)||!t)return e;const l=new URL(e);for(const[e,n]of new URLSearchParams(t))l.searchParams.set(e,n);return l.toString()},Oh=e=>{const t=e.target;if("A"===t?.tagName&&A(t.href)){e.preventDefault();const l=Lh(t.href)||t.href;globalThis.location.href=l}},$h="cookie",_h=d((({termLink:e,personalDataPolicyLink:t})=>{const[l,{setTrue:n,setFalse:a}]=pl();Cm((()=>{globalThis.localStorage?.getItem($h)||n()}),[],3e3);const r=i((()=>{globalThis.localStorage?.setItem($h,"true"),a()}),[]);return l?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:c(w,{size:"text-s",font:"font-light",color:"text-primary-text",children:["АО «Россельхозбанк» использует",o(Wr,{isRemote:!0,className:Uh(e?.href),...e,children:"cookie"}),"(файлы с данными о прошлых посещениях сайта) для персонализации сервисов и удобства пользователей. Вы можете запретить сохранение cookie в настройках своего браузера.",o(Wr,{isRemote:!0,className:Uh(t?.href),...t,children:"Обработка Ваших персональных данных"}),"производится в соответствии с требованиями Федерального закона от 27.07.2006 № 152-Ф3 «О персональных данных»."]})}),o("div",{className:"ml-s sm:ml-0 w-24 flex justify-end",children:o(pm,{className:"bg-main-gray rounded-md",onClose:r})})]})}):null})),Uh=e=>x("inline mx-2xs",e?"text-green-dark":""),Hh=d((()=>{const e=i((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=i((e=>{e?.onClose&&e.onClose()}),[]),l=um({onCloseAll:e,onClose:t}),{close:n}=re(),r=i((({key:e})=>{"Escape"===e&&n()}),[]);return xl(globalThis.document,"keydown",r),a((()=>{l.length?(globalThis.document?.body.classList.add("no-scrollbar"),globalThis.document?.body.classList.add("overflow-hidden")):(globalThis.document?.body.classList.remove("no-scrollbar"),globalThis.document?.body.classList.remove("overflow-hidden"))}),[l]),l.length?o("div",{className:"fixed inset-0 z-50",role:"dialog",children:l.map((({dialog:e,id:t},n)=>o("div",{className:x("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar",n===l.length-1?"":"hidden"),children:e},String(t||n))))}):null})),Wh=d((()=>{const[e,t]=n(null),l=i((()=>{t(null)}),[]);a((()=>p.subscribe("popup",(e=>{switch(e.type){case"open":case"update":t(e);break;case"close":l();break;default:Jd(e)}}))),[]);const r=i((({key:e})=>{"Escape"===e&&l()}),[l]);return xl(globalThis.document,"keydown",r),e?o("div",{className:"absolute z-50",style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",children:e.popup}):null})),Kh="header",qh="footer",Gh="sticky-footer",Yh={},Xh=d((({className:e,data:t=Yh,blocksRegistry:l,blockDecorator:n})=>{const{slots:a,blocks:i,fallback:r,...s}=t,d=ft(s,r);xl(globalThis,"click",Oh);const m={key:"",page:{slots:a,blocks:i,fallback:r,...d},blocksRegistry:l,blockDecorator:n,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:x("@container relative",t.style,e),children:[a?.header?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:M(a?.header,{...m,slotName:Kh})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[V({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),M(a?.footer,{...m,slotName:qh})]})]}),a?.["sticky-footer"]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:M(a?.["sticky-footer"],{...m,slotName:Gh})}):null,o(Hh,{}),o(Wh,{}),o(_h,{termLink:{href:"/pd-policy#cookie",target:"_blank"},personalDataPolicyLink:{href:"/pd-policy",target:"_blank"}})]})}));Object.assign(Xh,{childrenTypes:[],slots:()=>[Kh,qh,Gh]});e.Blocks=Fh,e.ContentPage=Xh,e.DaDataAPI=function(e=""){return{getFetcherAddress:async function(){if(!("geolocation"in navigator))return null;try{const t=await(async()=>new Promise((e=>navigator.geolocation.getCurrentPosition((({coords:t})=>e(t))))))(),l=await fetch(`${e}/geolocate`,{method:"POST",mode:"cors",body:JSON.stringify({lat:t.latitude,lon:t.longitude,count:1})});return(await l.json())?.suggestions?.[0]?.data?.city}catch(e){return console.error(e),null}}}},e.handlerDecorator=se,e.joinList=e=>t=>t.reduce(((t,l,n)=>t.length?t.concat({...e,key:`sep-${n}`},l):[l]),[]),e.packageVersion="0.14.191",e.projectSettings=z,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=E,e.useRouter=g,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniMobileBlocks={})}(this,(function(e){"use strict";let t;const l=e=>(...l)=>t[e](...l),n=l("useState"),a=l("useEffect"),i=l("useCallback"),r=l("useMemo"),s=l("useRef");const 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,l){const{children:n,...a}=t||{},i=l?.slots?.default,r=n||i&&i();return e(Object.assign(a,r&&{children:r}),l)}return t.inheritAttrs=!1,t},h=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),u=d((({children:e})=>h?e:null));const p=new class{subscribers={};subjectsStateMap={};subscribe(e,t){this.subscribers[e]=(this.subscribers[e]||[]).concat(t);const l=this.subjectsStateMap[e];return l&&t(l),()=>{this.unsubscribe(e,t)}}unsubscribe(e,t){this.subscribers[e]=this.subscribers[e]?.filter((e=>e!==t))}fire(e,t){e in this.subjectsStateMap&&(this.subjectsStateMap[e]=t),this.subscribers[e]?.forEach((e=>e(t)))}subject(e,t){this.subjectsStateMap[e]=t}};function g(){return g._impl()}g._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),g.setup=e=>{g._impl=e};const x=(...e)=>e.flatMap((e=>e)).filter(Boolean).join(" "),f={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","":""},b=d((({className:e,version:t="primary",isTheme:l=!0,defaultPadding:i="p-xl",padding:r,block:s,tag:c="section",role:d,children:m,style:h})=>{const u=c,b=g(),[y,v]=n(!1);a((()=>p.subscribe("tab",(e=>{e.groupName&&e.groupName!==s?.labelGroup||v(Boolean(e.label&&s?.labels?.length&&!s.labels.includes(e.label)))}))),[s,b]);const N=t&&l;return o(u,{className:x("@container font-sans",N?"group":"",f[t],y?"hidden":"",r||i,e),...N?{"data-ver":t}:{},...s?.anchor?{id:s.anchor}:{},role:d,style:h,children:m})})),y={h1:"h1",h2:"h1",h3:"h2",h4:"h2",h5:"h3",h6:"h3"},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:l="h3",title:n,children:a})=>{const i=y[l]||"h3";return o(i,{role:"heading",className:x("font-sans m-0",v[t],e),children:n||a})})),w=d((({children:e,...t})=>o("p",{className:x("font-sans",Object.values(t)),children:e}))),k={XXL:{title:{headingType:"h0",as:"h1"},descriptionSize:"text-h5",descriptionWeight:"font-normal",descriptionStyle:"mt-xl"},XL:{title:{headingType:"h1",as:"h1"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},L:{title:{headingType:"h2",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},M:{title:{headingType:"h3",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-s"},S:{title:{headingType:"h4",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-xs"},XS:{title:{headingType:"h5",as:"h2"},descriptionSize:"text-m",descriptionWeight:"font-light",descriptionStyle:"mt-xs"}},S=d((({className:e,version:t="",headlineVersion:l="XL",title:n,description:a,align:i="text-center",as:r,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=k[l],u={marginTop:h.descriptionStyle};return c(b,{className:x(s?"@container-normal":"",e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[n?o(N,{className:x("whitespace-pre-wrap",i),...h?.title,as:r||h?.title.as,title:n}):null,a?o(w,{size:h.descriptionSize,font:h.descriptionWeight,align:i,...u,children:a}):null]})})),C=({blockClassName:e,block:t,render:l})=>l({blockClassName:e,block:t}),I=[];function T(e,t,{className:l,...n}={}){const{key:a,blockDecorator:i=C,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 i({blockClassName:x(e.style?.length?e.style:"col-span-12",l),block:e,ancestors:s,render:({block:l,blockClassName:i})=>{const{content:r}=l;return d?o(d,{className:i,block:e,options:t,...r,...n},a):null}},a)}const B=[],M=(e,{key:t,ancestors:l=B,slotName:n=null,extraProps:a,renderProps:i=T,...r})=>{const s=a?(e,t)=>T(e,t,a):i;return(e||[]).map(((e,a)=>s(e,{...r,key:`${t||e.type}-${a}`,ancestors:r.parent?[...l||B,[r.parent,n]]:l},a)))};function V({block:e,options:t,children:l,extraProps:n,renderProps:a}){return l||(e&&t?M(e.blocks,{...t,parent:e,extraProps:n,renderProps:a}):null)}const P=e=>e&&!e.endsWith("/")?`${e}/`:e,R=["CDN","BASE_PATH"],z=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const l=e._[t]||e[t];return R.includes(t)?P(l):l}}),A=e=>Boolean(e?.includes(":")),D=(e,t)=>Boolean(e&&!A(e)&&(!t||"_self"===t)),j=e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),F=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/");var E=Object.freeze({__proto__:null,isURL:A,isLocalURL:D,isHash:e=>Boolean(e?.startsWith("#")),withoutQuery:j,joinPath:F});const L="/api/",O=`${L}v1/storage`,$=e=>(t,l=z.BASE_PATH)=>{if(!t||A(t)||[z.CDN,L].some((e=>_(t,e))))return t;if(/^[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(t))return`${O}/${t}/file`;const n=t.startsWith("/");return F(_(t,l)?"":l,n?"/":e.pathname?.split("/").slice(0,-1).join("/"),t)},_=(e,t)=>t&&e&&e.startsWith(t),U={normal:"",color:"text-primary-main",black:"text-black",white:"text-black"},H=d((({className:e="",imageClassName:t="",name:l="",alt:n=`Иконка ${l}`,title:a=n,iconVersion:i="color",width:r,height:s})=>{const d=g(),m="normal"===i?`${l}.svg`:`sprites.svg#${l}`,h=$(d)(F(z.CDN,"/icons/",m));return"normal"===i?o("img",{className:e,src:h,alt:n,title:a,"aria-hidden":"true",width:r,height:s,style:W(e,s)}):o(q,{className:e,children:c("svg",{className:x(K(r),U[i],"white"===i?"invert":"",t),width:r,height:s,"aria-hidden":"true",children:[a?o("title",{children:a}):null,n?o("desc",{children:n}):null,o("use",{href:h,xlinkHref:h})]})})})),W=(e,t)=>{return e?.includes("h-")?{}:{height:(l=t,l&&!/\D/.test(l)?`${t}px`:t),width:"auto"};var l},K=e=>e?"":"w-full h-full",q=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),G=(e,t)=>l=>l&&!A(l)?$(e)(F(t,l)):l,Y=(e,t)=>e?.media&&t?.media?e.media-t.media:0,X=d((({className:e="",image:t,imageClassName:l="",pathPrefix:n})=>{const a=g();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(Y).map((({src:e,format:l,media:i},r)=>o("source",{srcSet:G(a,n)(e),type:Z(l),media:i?`(max-width: ${i}px)`:"",width:t?.size?.width,height:t?.size?.height},`${r}_${e}`))):null,t?.src?Q({...t,src:G(a,n)(t.src)},l):null]})})),Q=(e,t="")=>o("img",{src:e.src,className:x("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}),Z=e=>e?`image/${String(e)}`:void 0,J=d((({className:e="",image:t,imageClassName:l="",pathPrefix:n,...a})=>t?.src||t?.icon?t.icon?o(H,{className:e,imageClassName:l,iconVersion:t?.iconVersion,name:t.icon,...a}):o(X,{className:e,imageClassName:l,image:t,pathPrefix:n}):null)),ee={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","":""},te="bg-main-divider text-main-disabled",le={primary:te,secondary:te,white:te,link:"",transparent:"",gray:te,"":""},ne="text-center font-sans select-none",ae={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","":""},ie=({className:e,rounded:t,version:l})=>[ne,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",l?ee[l]:"",t?"rounded-full":"rounded-md",e].join(" "),re=()=>({open:(e,t={})=>p.fire("dialog",{type:"open",dialog:e,...t}),close:()=>p.fire("dialog",{type:"close"}),closeAll:()=>p.fire("dialog",{type:"close",all:!0})}),se=(e,t)=>se._impl(e,t);function oe(e={}){const{isRemote:t,basePath:l}=e,n=g(),{closeAll:a}=re();return e=>({...e,href:t&&!l?e.href:$(n)(e.href,l),"aria-label":e.text,onClick:se(i(e),e)});function i({href:e,target:l,onClick:i}){return r=>{i&&i(r),e&&!t&&D(e,l)&&(a(),r?.preventDefault(),n.push(e))}}}se._impl=e=>e,se.setup=e=>{se._impl=e};const ce=d((e=>{const{text:t,aboveText:l,appendLeft:n,appendRight:a,version:i="primary"}=e,r=me(e)?"hidden lg:block":"";return c("div",{className:x(de(e),"flex gap-xs"),children:[n?o("div",{className:x(r,ae[i]),children:n}):null,me(e)?c("div",{className:"whitespace-pre",children:[l?o("div",{className:"text-xs font-light text-left",children:l}):null,o("div",{className:"text-left "+(l?"text-s -mt-3xs":"text-l"),children:t})]}):null,a?o("div",{className:x(r,ae[i]),children:a}):null]})})),de=e=>{const{version:t,aboveText:l,rounded:n}=e;if("link"===t)return"";const a=""+(l?"py-2.5 px-9":"py-4 px-9");return x("group/btn items-center justify-center",me(e)?a:"h-12 w-12 m-auto",n?"rounded-full":"")},me=({text:e,aboveText:t,appendLeft:l})=>Boolean(e||t||!l),he=({className:e,rounded:t,version:l})=>["inline-block",ne,l?le[l]:"",t?"rounded-full":"rounded-md",e].join(" "),ue=d((({disabled:e,children:t,method:l="LINK",href:n,...a})=>{const r=(({method:e,href:t})=>i((l=>{if("POST"!==e||!t)return;l.preventDefault();const{origin:n,pathname:a,searchParams:i}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[n,a].join(""));for(const[e,t]of i.entries()){const l=document.createElement("input");l.setAttribute("type","hidden"),l.setAttribute("name",e),l.setAttribute("value",t),r.appendChild(l)}document.body.appendChild(r),r.submit()}),[]))({method:l,href:n}),s=oe()({onClick:r,href:n,...a}),c=t??o(ce,{...s});return o(e?ge:pe,{...s,children:c})})),pe=d((({className:e="",href:t,rel:l,target:n,ariaLabel:a,version:i,rounded:r,onClick:s,type:c,children:d})=>o("a",{className:ie({className:e,version:i,rounded:r}),href:t,rel:l,target:n,"aria-label":a,role:t?"link":"button",onClick:s,type:c,children:d}))),ge=d((({className:e,ariaLabel:t,version:l,rounded:n,children:a})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:he({className:e,rounded:n,version:l}),children:a})));function xe(e,t){const l="primary"===e?"white":"black",n="Вернуться назад";return c("div",{className:"hidden sm:flex items-center gap-s",children:[o("div",{className:ie({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",version:e,rounded:!0}),onClick:t,children:o(J,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:l}})}),o(ue,{version:"link",className:"group-data-secondary:text-white/80",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const fe={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},be=d((({className:e,version:t="primary",defaultPadding:l,padding:n="",title:a="",insetTitle:r="",buttons:s,leftImage:d,rightImage:m,imageAlign:h,isImageAlwaysOnRight:u=!1,isImageSecondary:p=!1,backwardButton:f,children:b,...y})=>{const v=g(),N=i((()=>{v.back()}),[]);return c("div",{className:ye(n,l,e),children:[f?xe(t,N):null,a?o("div",{className:"relative h-full",children:a}):null,c("div",{className:x("grow relative flex flex-col @xl:flex-row gap-3xl w-full",d?"self-start @xl:w-auto":""),children:[Se(d,{imageAlign:h,className:"mx-auto"}),c("div",{className:x("grid gap-3xl",m?"@xl:grid-cols-2":"",d?"":"grow","h-full","auto-rows-[max-content_1fr]"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[r,b]}),ke(V({...y,extraProps:{className:"@container-normal"}})),Se(m,{className:x("@xl:justify-self-end @xl:col-start-2",s?ve(u):"",Ne(u),Ce(p)),imageAlign:h}),we(s)]})]})]})})),ye=(e="",t="",l="")=>x("relative flex flex-col gap-3xl overflow-hidden",e||t,l),ve=e=>e?"row-span-2":"@xl:row-span-2",Ne=e=>e?"col-start-2 self-center":"",we=e=>e?o("div",{className:"self-end",children:e}):null,ke=e=>e&&e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Se=(e,{className:t,imageAlign:l})=>e?o("div",{className:x("shrink-1/2 justify-self-center",l&&fe[l],t),children:e}):null,Ce=e=>e?"hidden @xl:block":"",Ie=(e=[])=>e.reduce(((e,t)=>e+t),0),Te=(e=[])=>e?.length?Ie(e)/e.length:0,Be=(e,t="normal")=>e?o("div",{className:x("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(J,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,Me=d((e=>{const{__html:t="",richVersion:l=""}=e;return t.replace(/<\/?[^>]+\/?>/g,"").trim()?o("div",{"data-component":"rich-text-container",children:o("div",{className:x(l,"md-container"),dangerouslySetInnerHTML:{__html:t}})}):null})),Ve=(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,Pe=d((({children:e,...t})=>o("span",{className:x("font-sans",Object.values(t)),children:e}))),Re=(e,t)=>e?o(Pe,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,ze=(e,t)=>"rte"===e.type&&"__html"in e&&e.__html?o(Me,{...e},`rte-${t}`):["label"in e?Re(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Ve(e.description,t)},String(t)):null],Ae=d((({className:e,benefitsVersion:t,...l})=>c("div",{className:x("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in l?Be(l.icon,t):null,o("div",{children:ze(l)})]}))),De=e=>"rte"===e.type?e?.__html?.length||0:Math.max(e?.label?.length||0,e?.description?.length||0),je=e=>{return((t=e.map(De))?.length?Math.sqrt(Math.abs(Te(t.map((e=>e**2)))-Te(t)**2)):0)>16;var t},Fe=e=>e&&"icon"in e&&e.icon&&(e.icon.icon||e.icon.src),Ee=e=>!e.some(Fe),Le=d((({className:e,benefitsVersion:t="normal",benefits:l})=>l?.length?o("div",{className:x("flex gap-x-m gap-y-s",je(l)||Ee(l)?"flex-col":"flex-wrap",e),role:"list",children:l.map(((e,l)=>o(Ae,{benefitsVersion:t,...e},String(l))))}):null)),Oe=d((({className:e,benefits:t})=>t?.length?o("div",{className:x("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap(ze)}):null)),$e=d((({isTabularBenefits:e,...t})=>o(e?Oe:Le,{...t}))),_e=e=>Boolean(e?.src||e?.icon),Ue=(e,{className:t,buttonClassName:l,isVertical:n}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:x("flex",n?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m",t),role:"group",children:e.map(He(l))}):null,He=(e="")=>(t,l)=>{const{text:n,icon:a,iconRight:i,version:r,...s}=t||{},c=We(a,r),d=We(i,r);return n||a?.icon?o(ue,{className:x("basis-full @lg:basis-auto",e),appendLeft:Ke({...a,iconVersion:c}),appendRight:Ke({...i,iconVersion:d}),version:r,text:n,...s},l?String(l):""):null},We=(e,t="secondary")=>{const l="secondary"===t?"color":"white";return e?.iconVersion?e?.iconVersion:l},Ke=e=>_e(e)?o(J,{image:e,width:String(e?.size?.width||24),height:String(24)}):null,qe=d((({className:e,isDotted:t,dotClassName:l,children:n})=>c("div",{className:x("font-sans flex",e),role:"listitem",children:[t?o("div",{className:"shrink-0",children:o("div",{className:x("align-middle inline-block rounded-full group-data-secondary:bg-white",l)})}):null,o("span",{children:n})]}))),Ge={S:{textSize:"text-l font-light",indentStyle:"ml-xs",dotStyle:"w-1 h-1 mr-xs"},M:{textSize:"text-h6",indentStyle:"ml-s",dotStyle:"w-1.5 h-1.5 mr-s"},L:{textSize:"text-h5",indentStyle:"ml-m",dotStyle:"w-1.5 h-1.5 mr-m"}},Ye=d((({className:e,isDotted:t=!0,items:l=[],listItemSize:n="M",dotClassName:a=""})=>{const i=Ge[n];return l?.length?o("section",{className:x("flex flex-col gap-xs text-left text-primary-text group-data-secondary:text-white group-data-gray:text-secondary-text",i.textSize,e),role:"list",children:l.map(((e,l)=>o(qe,{isDotted:t,dotClassName:x(a||"bg-primary-text",i.dotStyle),children:e},String(l))))}):null})),Xe=(e=0,{fixed:t}={})=>(l=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(l)||0),Qe=d((({priceList:e})=>e?.length?o("div",{className:"flex flex-wrap xl:flex-nowrap xl:bg-main-divider xl:rounded-md p-xs gap-xl",role:"list",children:e.map(Ze)}):null)),Ze=({label:e,amount:t},l)=>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(Pe,{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:[Xe(2)(t)," ₽"]}):null]},String(l)),Je=d((({className:e,tags:t})=>t?.length?o("div",{className:x("flex flex-wrap gap-xs",e),role:"list",children:t.map(et)}):null)),et=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(Pe,{size:"text-m",font:"font-light",children:e})},String(t)),tt={XXL:"L",XL:"L",L:"M",M:"M",S:"S",XS:"S"},lt=d((({className:e,padding:t,defaultPadding:l,title:n,description:a,headlineVersion:i="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:d,benefits:m,__html:h,isFullWidthTitle:u,items:p,isDotted:g=!0,priceList:x=[],tags:f=[],buttons:b,image:y,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:k=!1}={},backwardButton:C,children:I,...T})=>{const B=y?.src?o(J,{image:y}):null,M=o(S,{title:n,description:a,headlineVersion:i,align:r,isEmbedded:!0}),V=m?.filter((e=>"rte"===e?.type||"label"in e||"description"in e));return o(be,{className:e,padding:t,defaultPadding:l,...u?{title:M}:{insetTitle:M},...nt(B,N),isImageSecondary:k,imageAlign:v,isImageAlwaysOnRight:w,buttons:Ue(b),backwardButton:C,...T,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[V?.length?o($e,{benefitsVersion:s,isTabularBenefits:d,benefits:V}):null,h?o(Me,{__html:h}):null,p?.length?o(Ye,{items:p,isDotted:g,listItemSize:tt[i]}):null,I,x?.length?o(Qe,{priceList:x}):null,at(f)]})})})),nt=(e,t)=>t?{rightImage:e}:{leftImage:e},at=e=>e?.length?o(Je,{tags:e}):null,it=e=>Boolean(e&&Array.isArray(e)),rt=e=>Boolean(e&&!Array.isArray(e)&&"object"==typeof e),st=(e,t)=>{return l=e,Boolean(rt(l)&&"string"==typeof l.$ref)?t.ref(e):rt(e)?t.record(e):it(e)?t.array(e):t.scalar?t.scalar(e):e;var l},ot=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(ct,e),ct=(e,t)=>e&&t?rt(e)?e[t]:it(e)?e[parseInt(t,10)]:e:e,dt=(e,t)=>st(e,{ref:({$ref:e,...l})=>dt(e?ot(t(e),e):l,t),record:e=>Object.entries(e).map((([e,l])=>({[e]:dt(l,t)}))).reduce(((e,t)=>Object.assign(e,t)),{}),array:e=>e.map((e=>dt(e,t)))}),mt=(e,t,l=[])=>{st(e,{ref:e=>t(e.$ref,l),record:e=>{for(const n in e)mt(e[n],t,[...l,n])},array:e=>{for(let n=0;n<e.length;n++)mt(e[n],t,[...l,n])}})};async function ht(e,t){try{return e?await ut(e,t):null}catch(e){console.error(e)}return null}const ut=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),pt=e=>[...new Set(e)],gt={},xt=["/portal-resources"],ft=(e,t)=>{const l=(e=>{const t=[];return mt(e,(e=>t.push(e))),t})(e),[i,r]=n({});return a((()=>{l.length&&(async e=>Object.fromEntries((await Promise.allSettled(pt(e).filter((e=>!xt.some((t=>e.startsWith(t))))).map((async e=>[e,gt[e]||=await ut(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(l).then(r)}),[l.join()]),l.length?dt(e,(e=>i[e]||t?.[e])):e};function bt(e,t={}){const l=d((t=>{const l=ft((({block:e,options:t,className:l,defaultPadding:n,padding:a,isTheme:i,version:r,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...l})}));return Object.assign(l,t),l}const yt=bt((({className:e,padding:t,...l})=>o(b,{className:x("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...l,children:o(lt,{defaultPadding:"p-6xl",padding:t,className:"grow h-full",...l})})),{childrenTypes:["UnitBlock"]}),vt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},l=r((()=>Nt(0,t?.length)),[t]),n=t?.[l];return n?o(u,{children:o(yt,{...n,...e})}):null})),Nt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),wt=e=>e?.replace(/[^+\d]/g,"");function kt(){return{send:async function(e,t=!1){const l=t?"/api/v1/lead":"/api/v1/sendcorporatelead",{typeForm:n,region:a,phone:i="",email:r,birthday:s,inn:o,fullName:c,addressBranch:d,secondaryPhone:m="",bankEmpolee:h,applicationDate:u,...p}=e,g={typeForm:n,[t?"regionBranch":"region"]:a,[t?"phoneNumber":"phone"]:wt(i),[t?"email":"mail"]:r,...t?{birthday:s}:{inn:o,fullName:c},..."FEEDBACK"===n?{}:{addressBranch:d,bankEmpolee:h,applicationDate:u,...St(m)},...p};try{const e=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(g)});if(!e?.ok)return null;return await e.json()}catch(e){return null}}}}const St=e=>e&&"+7 ("!==e?{secondaryPhoneNumber:wt(e)}:{},Ct=d((({responseType:e})=>{const t="OK"===e,l=t?"ResponseOKIcon":"ResponseFailIcon";return c("div",{className:x("flex items-center p-lg rounded-md space-x-m",t?"bg-ok":"bg-fail"),children:[o(J,{image:{icon:l,iconVersion:"normal"},width:"42",height:"42"}),c("div",{children:[o(N,{headingType:"h6",title:t?"Ваша заявка отправлена":"Не удалось отправить заявку",className:"mb-2xs"}),o(Pe,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t?"Совсем скоро мы с вами свяжемся":"Пожалуйста, повторите позднее"})]})]})})),It=e=>e,Tt=(e,{resetOnSubmit:t,onSubmit:l}={})=>{const[a,r]=n(e),[o,c]=n(!1),[d,m]=n({}),h=s({}),u=i(((e,t)=>{const{parse:l=It,format:n=It}=t||{};return h.current||(h.current={}),h.current[e]||=t=>{r((n=>({...n,[e]:l(t)}))),m((t=>({...t,[e]:!0})))},{value:n(a[e]),isDirty:o||d[e],onChange:h.current[e]}}),[a,o,d]),p=i((e=>{r(e),m(e)}),[]),g=i((()=>{r(e),c(!1),m({})}),[e]),x=i((e=>{e.preventDefault(),t?g():c(!0),l&&l(a)}),[l,a]);return[a,{isDirty:o||Object.values(d).some(Boolean),field:u,update:p,reset:g,onSubmit:x}]},Bt=d((({value:e=!1,text:t,type:l="checkbox",onChange:n})=>c("div",{role:l,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>n&&n(!e),children:[o("div",{className:x("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:x("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(Pe,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),Mt=e=>t=>t&&Object.entries(e).flatMap((([e,l])=>l(t[e])))||[],Vt=e=>!e?.length,Pt=e=>t=>l=>e(l)?[]:[t],Rt=d((({text:e,link:t})=>c(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:[o(Pe,{children:e}),t?o(ue,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"text-primary-main",children:o(Pe,{children:t.text})}):null]}))),zt="container space-y-lg",At="w-full max-w-xl space-y-s m-auto",Dt=d((({key:e,className:t="",id:l,name:n,type:r="text",label:d,placeholder:m,value:h="",valid:u=!0,children:p,onChange:g,onFocus:f,onBlur:b,pattern:y,autoFocus:v=!1,isTextarea:N=!1})=>{const w=s(null),k=i((e=>{g&&g(e.target?.value||"")}),[g]);a((()=>{v&&w.current?.focus()}),[v,w]);const S="w-full border rounded-md text-primary-text outline-none p-m",C=p?"pr-3xl":"",I=Ft(u);return c("div",{className:x("relative",t),children:[c("label",{children:[d?jt(d):null,N?o("textarea",{className:x("block resize-y min-h-24",S,I),id:x("textarea",l),name:n||l,placeholder:m,value:h,onInput:k,onFocus:f,onBlur:b},e):o("input",{type:r,className:x("h-14",S,C,I),ref:w,id:l,name:n||l,placeholder:m,value:h,onInput:k,onFocus:f,onBlur:b,pattern:y},e)]}),p]})})),jt=e=>o("div",{className:"mb-xs",children:o(Pe,{size:"text-m",font:"font-light",children:e})}),Ft=e=>e?"border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text":"border-error",Et=e=>o("div",{className:"h-4",children:e?o(Pe,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),Lt=d((({className:e,label:t,value:l="",placeholder:n,error:a,onChange:i,onBlur:r,isTextarea:s,...d})=>c("div",{className:x("shrink-0 w-full",e),children:[o(Dt,{type:"text","aria-label":t,label:t&&d?.errors?`${t}*`:t,valid:Boolean(!a),value:l,onChange:i,onBlur:r,isTextarea:s,placeholder:d?.errors&&!t?`${n}*`:n}),Et(a)]}))),Ot=(e,t)=>{const{value:l,isDirty:n}=e,a=n?t(l):[];return{...e,errors:a,error:a[0]}},$t=d((({title:e,children:t})=>c("fieldset",{className:"grid @xl:flex @xl:justify-between gap-lg border-b border-b-main-divider @xl:border-none",children:[e?o("legend",{className:"w-full",children:o(N,{title:e,headingType:"h6",className:"@xl:text-center"})}):null,t]}))),_t="@xl:w-1/2 space-y-s",Ut=e=>"_"===e,Ht=e=>/\d/.test(e),Wt=e=>Ut(e)||Ht(e),Kt=[..."+7 (___) ___-__-__"],qt=Kt.findIndex(Ut),Gt=Kt.map(((e,t)=>Wt(e)?Kt.slice(0,t).filter(Wt).length:-1));const Yt=d((({children:e,onChange:t,...l})=>{const n=i((e=>t&&t(function(e){const t=e.replace(/\D/g,""),l=Kt.map(((e,l)=>Ht(e)?e:t.charAt(Gt[l])||e)),n=Gt.indexOf(t.length-1)+1;return(n?l.slice(0,Math.max(qt,n)):l).join("")}(e))),[t]);return o(Dt,{onChange:n,onFocus:e=>n(e?.target?.value||""),...l,children:e})})),Xt=d((({className:e,label:t,value:l,error:n,onChange:a,onBlur:i,...r})=>c("div",{className:x("shrink-0 w-full",e),children:[o(Yt,{"aria-label":t,label:r?.errors?`${t}*`:t,valid:Boolean(!n),value:l,onChange:a,onBlur:i,placeholder:"+7 (___) ___-__-__"}),Et(n)]}))),Qt="Некорректно заполненное поле",Zt=Pt((e=>null!=e&&""!==e))(Qt),Jt=Pt((e=>e?.key&&""!==e?.key))(Qt),el=Pt((e=>"string"==typeof e&&e.length>1))(Qt),tl=Pt((e=>"string"==typeof e&&(10===e.length||12===e.length)))(Qt),ll=(nl=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,Pt((e=>"string"==typeof e&&nl.test(e))))(Qt);var nl;const al=Pt((e=>"boolean"==typeof e&&e))(Qt),il=(e,t)=>c($t,{title:t,children:[c("div",{className:_t,children:[o(Lt,{label:"Наименование организации",...Ot(e("fullName"),Zt)}),o(Lt,{label:"Контактное лицо",...Ot(e("name"),el)})]}),c("div",{className:_t,children:[o(Lt,{label:"ИНН",...Ot(e("inn"),tl)}),o(Xt,{label:"Телефон",...Ot(e("phone"),ll)})]})]}),rl=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],sl=e=>null!=e,ol=new Map,cl=e=>Boolean(e?.every((e=>Array.isArray(e)?cl(e):!e||"string"==typeof e))),dl=e=>cl(e)?e.toString():"";function ml(e,t,{fallback:l,cache:i}={}){const s=r((()=>hl(e)),[e]),[o,c]=n(void 0),[d,m]=n(void 0);a((()=>{if(!s.some(sl))return;let e=!1;const l=(t,l)=>{e||(c(t),m(l))};return(async()=>{try{l(await((e,t=ol)=>l=>{const n=dl(l),a=t.get(n);if(n&&sl(a))return a;const i=e(...l);return n&&sl(i)&&t.set(n,Promise.resolve(i)),i})(t,i)(s))}catch(e){l(void 0,e)}})(),()=>{e=!0}}),[t,i,s]);const h=l&&(e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]))(s)&&l[s[0]];return{data:!o&&h?h:o,error:d,mutate:()=>Promise.resolve(void 0)}}function hl(e){return Array.isArray(e)?e:e instanceof Function?hl(e()):[e]}function ul(){const{data:e}=ml("/api/v1/regions",ut);return e||[]}function pl(e=!1){const[t,l]=n(e),a=i((()=>l(!0)),[]),r=i((()=>l(!1)),[]),s=i((()=>l((e=>!e))),[]);return[t,{setValue:l,setTrue:a,setFalse:r,toggle:s}]}const gl=e=>e?.text||e?.key||"";function xl(e,t,l,n){a((()=>{if(e&&l)return e.addEventListener(t,l,n),()=>{e.removeEventListener(t,l,n)}}),[e,t,l])}function fl(e){const t=s(null),l=i((l=>{t&&t.current&&l.target instanceof Node&&!t.current.contains(l.target)&&e()}),[e]);return xl(globalThis.document,"click",l),t}const bl=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,yl=d((({popupRef:e,options:t,value:l,query:n,onChange:a,iconVersion:i})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md",role:"list",ref:e,children:bl(t,n).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===l?.key,onClick:t=>{t.stopPropagation(),a&&a(e)},children:[o("span",{className:"min-h-6",children:gl(e)}),o(H,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:i,className:x("absolute right-4 pt-3xs",e.key===l?.key?"":"hidden")})]},e.key)))}):null));function vl({isOpen:e,options:t,value:l,query:n,onChange:r,onClose:c,iconVersion:d}){const m={open:(e,t)=>p.fire("popup",{type:"open",popup:e,...t}),update:(e,t)=>p.fire("popup",{type:"update",popup:e,...t}),close:()=>p.fire("popup",{type:"close"})},h=i((()=>{m.close(),c&&c()}),[c]),u=i((e=>{h(),r&&r(e)}),[h,r]),g=s(null),x=fl(h);return a((()=>{if(!e||!g.current)return;const a=g.current,{top:i,left:r,width:s,height:c}=a.getBoundingClientRect();m.update(o(yl,{popupRef:x,options:t,value:l,query:n,onChange:u,iconVersion:d}),{top:i+window.scrollY+c,left:r,width:s})}),[e,t,l,n,u]),g}const Nl=d((({className:e,label:t,options:l=[],value:a,valid:r=!0,isBorder:s=!0,placeholder:d="",isSearch:m=!1,iconVersion:h,onChange:u})=>{const[p,{setFalse:g,setTrue:f}]=pl(),[b,y]=n(""),v=i((()=>{y(""),g()}),[]),N=vl({isOpen:p,options:l,value:a,query:b,onChange:u,onClose:v,iconVersion:h});return c("div",{className:e,children:[wl(t),c("div",{className:x("relative",p?"z-20":"z-10"),ref:N,children:[c("div",{className:x("h-14 text-l flex justify-between items-center text-primary-text cursor-pointer relative z-10",Sl(s,r)),onClick:p?v:f,children:[o("p",{className:"p-m pr-8 flex items-center overflow-hidden text-ellipsis",children:gl(a)||d}),kl(p,h)]}),m&&p?o("div",{className:x("absolute top-0 w-full z-20"),children:o(Dt,{type:"text",autoFocus:!0,value:b,onChange:y})}):null]})]})})),wl=e=>e?o("div",{className:"mb-xs",children:o(Pe,{size:"text-m",color:"text-primary-text",font:"font-light",children:e})}):null,kl=(e,t)=>o(H,{className:x("absolute right-3",e?"":"rotate-180"),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),Sl=(e,t)=>x(e?"border rounded-md hover:border-primary-hover":"",t?" border-gray":"border-error"),Cl=d((({className:e="",label:t,error:l,...n})=>c("div",{className:e,children:[o(Nl,{...n,valid:!l,label:n?.errors?`${t}*`:t}),Et(l)]}))),Il=d((({field:e})=>{const t=ul();return o(Cl,{className:"w-full",label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:t.map((({code:e="",name:t=""})=>({key:e,text:t}))),...Ot(e("region"),Jt)})})),Tl=({field:e,title:t})=>c($t,{title:t,children:[o("div",{className:_t,children:o(Cl,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:rl,...Ot(e("acquiringType"),Zt)})}),o("div",{className:_t,children:o(Il,{field:e})})]});function Bl({disabled:e,onClick:t}){return l=>{!e&&t&&t(l)}}const Ml={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"},Vl={primary:x("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:x("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")},Pl=d((({children:e,...t})=>{const l=e=>({...e,onClick:se(Bl(e),e)}),{className:n,version:a="primary",active:i,disabled:r,type:s="button",rounded:c=!0,role:d,onClick:m}=l(t);return o("button",{className:x("font-sans px-9 py-4","flex justify-center items-center gap-xs",i?"text-white bg-primary-active":"",r?"bg-main-gray text-main-disabled cursor-not-allowed":"",i||r?"":x(Ml[a],Vl[a]),c?"rounded-md":"",n),type:s,role:d,onClick:m,children:e})})),Rl=(e,t)=>o(Pl,{className:x("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),zl={typeForm:{key:"acqr",text:"Предупреждение о мошенничестве"},acquiringType:{key:"trade",text:"Торговый эквайринг"},fullName:"",inn:"",name:"",phone:"",onlineCheckout:!1,posTerminal:!1},Al=Mt({acquiringType:Zt,region:Zt,fullName:Zt,inn:tl,name:el,phone:ll}),Dl=d((e=>{const{button:t,link:l,onSubmit:n}=e,a=i((e=>{const{acquiringType:t,onlineCheckout:l,posTerminal:a,...i}=e,r=jl(t?.key),s={partnerComments:`Вид эквайринга=${t?.text||""}${r?`/Онлайн касса=${l}/POS-терминал=${a}`:"/Онлайн касса=false/POS-терминал=false"}`,...i};Vt(Al(e))&&n(s,!1)}),[n]),[,{field:r,...s}]=Tt(zl,{onSubmit:a}),d=jl(r("acquiringType").value?.key);return c("form",{className:zt,onSubmit:s.onSubmit,children:[Tl({field:r,title:"Вид эквайринга и регион"}),il(r,"Данные организации"),d?c("div",{role:"radiogroup",children:[o(Bt,{type:"radio",text:"Хочу онлайн-кассу",...r("onlineCheckout")}),o(Bt,{type:"radio",text:"Хочу купить POS-терминал",...r("posTerminal")})]}):null,Rl(t),o(Rt,{link:l})]})})),jl=e=>"all"===e||"trade"===e,Fl={typeForm:{key:"bcrd",text:"Заявка на бизнес-карту"},name:"",phone:"",inn:"",email:""},El=Mt({region:Zt,name:el,phone:ll,inn:tl,email:Zt}),Ll=d((e=>{const{button:t,link:l,onSubmit:n}=e,a=i((e=>{Vt(El(e))&&n(e)}),[n]),[,{field:r,...s}]=Tt(Fl,{onSubmit:a});return c("form",{className:zt,onSubmit:s.onSubmit,children:[o(Il,{field:r}),c($t,{children:[c("div",{className:_t,children:[o(Lt,{label:"Контактное лицо",...Ot(r("name"),el)}),o(Lt,{label:"ИНН",...Ot(r("inn"),tl)})]}),c("div",{className:_t,children:[o(Xt,{label:"Телефон",...Ot(r("phone"),ll)}),o(Lt,{label:"Электронная почта",...Ot(r("email"),Zt)})]})]}),Rl(t),o(Rt,{link:l})]})})),Ol=[];const $l=async e=>await ht(e,{method:"GET"})||Ol;function _l(){const{data:e}=ml("/api/v1/premiumBranchesByRegions",ut);return e||[]}const Ul=d((({field:e,regionKey:t,isPremium:l=!1})=>{const n=l?_l().find((e=>e?.region===t))?.branches:function(e){const{data:t}=ml(e?`/api/v1/branches?regionCode=${e}`:null,$l);return t||Ol}(t).filter((e=>e?.address));return o(Cl,{label:"Адрес",placeholder:"Выберите адрес",options:(n||[]).map((({address:e=""})=>({key:e,text:e}))),...Ot(e("addressBranch"),Jt)})})),Hl=["От 1 000 ₽","До 1 000 000 000 ₽"],Wl=["От 1 мес","До 15 лет"],Kl=(e,t)=>c($t,{title:t,children:[c("div",{className:_t,children:[o(Lt,{label:"Наименование организации",...Ot(e("fullName"),Zt)}),o(Lt,{label:"ИНН",...Ot(e("inn"),tl)}),o(Xt,{label:"Телефон",...Ot(e("phone"),ll)})]}),c("div",{className:_t,children:[o(Lt,{label:"Годовая выручка, ₽",...Ot(e("annualRevenue"),Zt)}),o(Lt,{label:"Контактное лицо",...Ot(e("name"),el)}),o(Lt,{label:"Электронная почта",...Ot(e("email"),Zt)})]})]}),ql=(e,{normalize:t,format:l})=>{const{value:a,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=n(!1),m=i((e=>{d(!0),r&&r(e)}),[]),h=i((()=>{d(!1),o&&o(t(a)),s&&s()}),[o,a]);return{value:c||!l?a:l(a),onFocus:m,onBlur:h}},Gl=(e,t,l)=>Math.max(t,Math.min(e,l));function Yl(e){const t=(e||"").replace(/\D/g,""),l=parseInt(t,10);return Number.isNaN(l)?0:l}function Xl({list:e=[],min:t,max:l,step:n,value:a=e[0]||t,disabled:i,onChange:r}){const s=e.length?e.indexOf(a):a,d={backgroundSize:`${(100*(s>t?s-t:0)/(l-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:x("w-2 h-2 rounded-full",s<=t||i?"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:l,step:n,value:s,disabled:i,onInput:t=>{const l=Yl(t.target?.value),n=e.length?e[l]:l;r&&r(n||0)}})})]})}const Ql=1,Zl=100,Jl=d((e=>{const{className:t,title:l,items:n=[],list:a=[],min:r=(a.length?0:Ql),max:s=(a.length?a.length-1:Zl),step:d=1,value:m=a[0]||r,disabled:h=!1,onChange:u}=e,p=ql(e,{normalize:(e=0)=>a.length?en(a)(e):Gl(e,r,s),format:Xe()}),g=i((e=>{u&&u(Yl(e.target?.value))}),[u]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[l?o(Pe,{size:"text-m",font:"font-light",color:"text-primary-text",children:l}):null,o("input",{className:x("mt-xs font-sans text-h3 w-full h-14","border border-solid border-gray rounded-md outline-none","pl-m box-border","text-primary-text hover:border-primary-hover focus:border-primary-text","disabled:border-gray disabled:bg-main-divider"),disabled:h,onInput:g,...p}),Xl({list:a,min:r,max:s,step:d,disabled:h,value:m,onChange:u})]}),tn(n)]})})),en=e=>t=>e.reduce(((e,l)=>Math.abs(l-t)<Math.abs(e-t)?l:e)),tn=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Pe,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),ln=(e,t)=>c($t,{title:t,children:[o("div",{className:_t,children:o(Jl,{title:"Сумма, ₽",items:Hl,min:1e3,max:1e9,...e("amount")})}),o("div",{className:_t,children:o(Jl,{title:"Срок, месяцев",items:Wl,min:1,max:180,...e("term")})})]}),nn={typeForm:{key:"cred",text:"Кредит"},amount:1e3,term:12,fullName:"",inn:"",name:"",phone:"",email:"",annualRevenue:""},an=Mt({fullName:Zt,annualRevenue:Zt,inn:tl,name:el,phone:ll,region:Zt}),rn=d((({button:e,link:t,onSubmit:l})=>{const n=i((e=>{const{amount:t,term:n,addressBranch:a,annualRevenue:i,...r}=e;Vt(an(e))&&l({...r,addressBranch:a?.text||"",partnerComments:`Сумма=${t}/Срок=${n}/Выручка=${i}`})}),[l]),[a,{field:r,...s}]=Tt(nn,{onSubmit:n});return c("form",{className:zt,onSubmit:s.onSubmit,children:[ln(r,"Параметры"),Kl(r,"Данные организации"),c($t,{title:"Офис банка",children:[o("div",{className:_t,children:o(Il,{field:r})}),o("div",{className:_t,children:o(Ul,{field:r,regionKey:a.region?.key})})]}),Rl(e),o(Rt,{link:t})]})})),sn={typeForm:{key:"dpst",text:"Заявка на депозит"},name:"",phone:""},on=Mt({name:el,phone:ll}),cn=d((({button:e,link:t,onSubmit:l})=>{const n=i((e=>{Vt(on(e))&&l(e)}),[l]),[,{field:a,...r}]=Tt(sn,{onSubmit:n,resetOnSubmit:!1});return o("form",{className:zt,onSubmit:r.onSubmit,children:o($t,{title:"Оставьте заявку и мы ответим на любые вопросы по депозитам",children:c("div",{className:At,children:[o(Lt,{label:"Имя",...Ot(a("name"),el)}),o(Xt,{label:"Телефон",...Ot(a("phone"),ll)}),Rl(e),o(Rt,{link:t})]})})})})),dn=[{text:"Задать вопрос по продуктам и услугам",key:"FEEDBACK"},{text:"Качество обслуживания",key:"FEEDBACK_QS"}],mn=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],hn=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],un=d((({className:e,viewBox:t,fill:l="none",width:n,height:a,paths:i,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:l,width:n,height:a,children:i.map((({d:e,fill:t,...l},n)=>{const a={...r,...l};return o("path",{d:e,fill:t||"currentColor",stroke:a.stroke,strokeLinecap:a.strokeLinecap,strokeLinejoin:a.strokeLinejoin,strokeWidth:a.strokeWidth,strokeMiterlimit:a.strokeMiterlimit},n)}))}))),pn=[{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"}],gn=d((({className:e,value:t,text:l,disabled:n,isRadio:a,onChange:r})=>{const s=i((e=>{n||(e.preventDefault(),r&&r(!t))}),[r,n,t]),d=a?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(un,{paths:pn,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:"flex items-center relative cursor-pointer group/box",onClick:s,children:[o("div",{className:x("appearance-none w-5 h-5 border-solid cursor-pointer m-0",a?"rounded-full border-2":fn(t),t?"border-primary-main":"border-gray",n?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:xn(a),"aria-checked":Boolean(t),"aria-disabled":Boolean(n)}),t?d:null,l?o("div",{className:"ml-s",children:o(Pe,{size:"text-l",font:"font-light",children:l})}):null]})})})),xn=e=>e?"radio":"checkbox",fn=e=>x("rounded border",e?"bg-primary-main":""),bn=(e,t,l)=>c("div",{className:"flex col-span-2 gap-m flex-col lg:flex-row w-full justify-between items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3",children:[o(gn,{...e}),o(Rt,{link:t})]}),Et(Ot(e,al).error)]}):o(Rt,{text:"Нажимая кнопку, вы подтверждаете согласие с",link:t}),Rl(l)]}),yn=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const l=String(e.getDate()).padStart(2,"0"),n=String(e.getMonth()+1).padStart(2,"0"),a=t?String(e.getFullYear()):String(e.getFullYear()).slice(-2);return t?`${a}-${n}-${l}`:`${l}.${n}.${a}`}},vn=()=>{},Nn=({today:e,firstDayOfWeek:t,totalDays:l,currentMonth:n,currentYear:a,min:i,max:r,onDateClick:s})=>{const c=[];let d=1;for(let m=0;m<6;m++){const h=[];for(let c=0;c<7;c++)if(0===m&&c<t)h.push(o("td",{},`empty-${c}`));else if(d>l)h.push(o("td",{},`empty-${c}`));else{const t=new Date(a,n,d),l=wn(t,e),c=kn(t,i,r);h.push(o("td",{children:o("div",{className:Sn(l,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:h},`row-${m}`))}return c},wn=(e,t)=>t&&e.toDateString()===t.toDateString(),kn=(e,t,l)=>t&&e.getTime()<t.getTime()||l&&e.getTime()>l.getTime(),Sn=(e,t)=>x("p-s text-center rounded-md border",e?"":"border-transparent hover:bg-gray",t?"text-gray hover:bg-transparent":"cursor-pointer"),Cn=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],In=d((({today:e,currentMonth:t,currentYear:l,min:n,max:a,onDateSelect:s=vn})=>{const d=i((e=>s(e)),[]),{firstDayOfWeek:m,totalDays:h}=r((()=>({firstDayOfWeek:new Date(l,t,1).getDay()-1,totalDays:new Date(l,t+1,0).getDate()})),[l,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:Cn.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Nn({firstDayOfWeek:m,today:e,totalDays:h,currentYear:l,currentMonth:t,min:n,max:a,onDateClick:d})})]})})),Tn=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],Bn=Tn.map((e=>({key:e}))),Mn=Array.from({length:(new Date).getFullYear()-1940+1},((e,t)=>1940+t)).reverse().map((e=>({key:String(e)}))),Vn={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Pn={className:"min-w-32",iconVersion:"black",isBorder:!1},Rn=d((({className:e="",label:t="",value:l,valid:a=!0,minDate:r,maxDate:s,onChange:d})=>{const[m,{setValue:h}]=pl(!1),[u,p]=n(l?.getMonth()||(new Date).getMonth()),[g,f]=n(l?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:b,handleNextMonth:y,handleSelectMonth:v,handleSelectYear:N,monthsOptions:w,yearsOptions:k,handleChangeVisibleCalendar:S,ref:C}=(({onShowCalendar:e,showCalendar:t,selectedMonth:l,onMonthSelect:n,onYearSelect:a,selectedYear:r})=>{const s=fl(i((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:i((()=>e(!t)),[t]),handleNextMonth:i((()=>{l+1<=11?n(l+1):(n(0),a(r+1))}),[l]),handlePrevMonth:i((()=>{l-1>=0?n(l-1):(n(11),a(r-1))}),[l]),handleSelectMonth:i((({key:e})=>n(Tn.indexOf(e))),[]),handleSelectYear:i((({key:e})=>a(Number(e))),[]),monthsOptions:Bn,yearsOptions:Mn,ref:s}})({onYearSelect:f,onMonthSelect:p,onShowCalendar:h,selectedYear:g,selectedMonth:u,showCalendar:m});return c("div",{className:x(e,"relative"),ref:C,children:[o(Pe,{size:"text-m","font-weight":"font-light",children:t}),zn(S,l,a),m?c("div",{className:"absolute bg-white z-20 select-none",children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:b,children:o(H,{...Vn,className:"-rotate-90 cursor-pointer"})}),o(Nl,{onChange:v,value:{key:Tn[u]},options:w,...Pn}),o(Nl,{onChange:N,value:{key:String(g)},options:k,...Pn}),o("div",{className:"my-auto",onClick:y,children:o(H,{...Vn,className:"rotate-90 cursor-pointer"})})]}),o(In,{today:l,currentMonth:u,currentYear:g,onDateSelect:d,min:r,max:s})]}):null]})})),zn=(e,t,l)=>c("div",{onClick:e,className:x("flex justify-between items-center h-14 px-m py-s border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",l?"border-gray":"border-error"),children:[o(w,{children:t&&yn(t)}),o(H,{...Vn,name:"CalendarIcon"})]}),An=d((({className:e,label:t,value:l,error:n,onChange:a,...i})=>c("div",{className:x("shrink-0 w-full",e),children:[t?o("div",{className:"mb-xs",children:o(Pe,{size:"text-m",font:"font-light",children:i?.errors?`${t}*`:t})}):null,o(Rn,{value:l,onChange:a,valid:Boolean(!n)}),Et(n)]}))),Dn={surname:"",name:"",middleName:""},jn=(e,t=!0)=>c("div",{className:"space-y-s",children:[o(Lt,{label:"Фамилия",...Ot(e("surname"),el)}),o(Lt,{label:"Имя",...Ot(e("name"),el)}),o(Lt,{label:"Отчество (Обязательно, при наличии)",...e("middleName")}),t?o(An,{label:"Дата рождения",...Ot(e("birthday"),Zt)}):null]}),Fn={...Dn,typeForm:{key:"FEEDBACK",text:"Задать вопрос по продуктам и услугам"},serviceDirection:{key:"Физическое лицо"},birthday:void 0,feedbackMethod:{key:"Телефонный звонок"},phone:"",email:"",comment:"",consentDataProcessing:!1},En={typeForm:Zt,region:Zt,surname:Zt,name:el,feedbackMethod:Zt,phone:ll,email:Zt,comment:Zt,consentDataProcessing:al},Ln=d((({button:e,link:t,onSubmit:l})=>{const n=i((e=>{On(e,l)}),[l]),[a,{field:r,...s}]=Tt(Fn,{onSubmit:n}),d="FEEDBACK_QS"===r("typeForm").value?.key,m=_n(r("typeForm").value?.key,r("serviceDirection").value?.key);return o("form",{className:zt,onSubmit:s.onSubmit,children:o($t,{children:c("div",{className:At,children:[o(Cl,{label:"Тема",placeholder:"Выберите тему",options:dn,...Ot(r("typeForm"),Zt)}),d?o(Cl,{label:"Направление обслуживания",placeholder:"Выберите направление",options:hn,...Ot(r("serviceDirection"),Zt)}):null,o(Il,{field:r}),d?o(Ul,{field:r,regionKey:a?.region?.key}):null,jn(r,!0),m?c("div",{children:[o(Lt,{label:"ИНН",...Ot(r("inn"),tl)}),o(Lt,{label:"Наименование организации",...r("fullName")})]}):null,o(Cl,{label:"Способ получения ответа",options:mn,...Ot(r("feedbackMethod"),Zt)}),o(Xt,{label:"Телефон",...Ot(r("phone"),ll)}),d?c("div",{children:[o(Xt,{label:"Дополнительный телефон",...r("secondaryPhone").value&&"+7 ("!==r("secondaryPhone").value?Ot(r("secondaryPhone"),ll):r("secondaryPhone")}),o(Lt,{label:"Электронная почта",...Ot(r("email"),Zt)}),o(Lt,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...r("bankEmpolee")}),o(Lt,{label:"Дата и время обращения в Банк",...r("applicationDate")})]}):o(Lt,{label:"Электронная почта",...Ot(r("email"),Zt)}),o(Lt,{...Ot(r("comment"),Zt),placeholder:"Ваше сообщение",isTextarea:!0}),bn(r("consentDataProcessing"),t,e)]})})})})),On=(e,t)=>{const l=_n(e?.typeForm.key,e?.serviceDirection?.key),n=Mt({...En,...$n(e,l)});Vt(n(e))&&t(e,!l)},$n=(e,t)=>t?{addressBranch:Zt,inn:tl}:"FEEDBACK"===e.typeForm.key?{birthday:Zt}:{addressBranch:Zt},_n=(e="",t="")=>"FEEDBACK_QS"===e&&"Юридическое лицо / ИП"===t,Un=d((e=>{const{button:t,regionSource:l}=e,[a,i]=n({key:""}),r=l?.regions??[],s=ie({className:"text-white",version:t?.version}),d=r?.find((e=>e.name===a.key))?.href;return c("div",{className:"container space-y-s",children:[r?o(Cl,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:r.map((({name:e=""})=>({key:e,text:e}))),value:a,onChange:i}):null,d?o("div",{className:"text-center",children:o(ue,{href:d,target:"_blank",className:x("p-m w-full @xl:w-auto",s),children:t?.text?t.text:"Перейти"})}):null]})})),Hn={...Dn,phone:"",email:"",birthday:void 0,consentDataProcessing:!1},Wn=Mt({surname:el,name:el,phone:ll,email:Zt,birthday:Zt,consentDataProcessing:al}),Kn=d((e=>{const{button:t,link:l,product:n="",onSubmit:a}=e,r=i((e=>{Vt(Wn(e))&&a({...e,product:n},!0)}),[a]),[,{field:s,...d}]=Tt(Hn,{onSubmit:r});return c("form",{className:zt,onSubmit:d.onSubmit,children:[c($t,{children:[c("div",{className:_t,children:[o(Lt,{label:"Фамилия",...Ot(s("surname"),el)}),o(Lt,{label:"Отчество (Обязательно, при наличии)",...s("middleName")}),o(Xt,{label:"Телефон",...Ot(s("phone"),ll)})]}),c("div",{className:_t,children:[o(Lt,{label:"Имя",...Ot(s("name"),el)}),o(An,{label:"Дата рождения",...Ot(s("birthday"),Zt)}),o(Lt,{label:"Электронная почта",...Ot(s("email"),Zt)})]})]}),bn(s("consentDataProcessing"),l,t)]})})),qn={typeForm:{key:"SELFCOLLECTION",text:"Самоинкассация"},fullName:"",phone:"",consentDataProcessing:!1},Gn=Mt({typeForm:Zt,region:Zt,fullName:Zt,phone:ll,consentDataProcessing:al}),Yn=d((({button:e,link:t,onSubmit:l})=>{const n=i((e=>{Vt(Gn(e))&&l(e,!1)}),[l]),[,{field:a,...r}]=Tt(qn,{onSubmit:n});return o("form",{className:zt,onSubmit:r.onSubmit,children:o($t,{children:c("div",{className:At,children:[o(Lt,{label:"ФИО",...Ot(a("fullName"),Zt)}),o(Il,{field:a}),o(Xt,{label:"Телефон",...Ot(a("phone"),ll)}),bn(a("consentDataProcessing"),t,e)]})})})})),Xn=d((({field:e})=>{const t=_l().map((({region:e})=>({key:e,text:e})));return o(Cl,{label:"Регион",placeholder:"Выберите регион",options:t,...Ot(e("region"),Zt)})})),Qn=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],Zn={typeForm:Qn[0],...Dn,email:"",phone:"",comment:"",consentDataProcessing:!1},Jn=Mt({typeForm:Zt,surname:Zt,name:el,phone:ll,email:Zt,addressBranch:Zt,consentDataProcessing:al}),ea=d((({button:e,link:t,onSubmit:l,defaultType:n="PREMIUMSERVICE"})=>{const a=i((e=>{Vt(Jn(e))&&l(e,!0)}),[l]),[r,{field:s,...d}]=Tt({...Zn,typeForm:ta(n)},{onSubmit:a}),m=r?.region?.key;return c("form",{className:zt,onSubmit:d.onSubmit,children:[c($t,{title:"Ваши данные",children:[c("div",{className:_t,children:[o(Lt,{label:"Фамилия",...Ot(s("surname"),el)}),o(Lt,{label:"Отчество (Обязательно, при наличии)",...s("middleName")}),o(Lt,{label:"Электронная почта",...Ot(s("email"),Zt)})]}),c("div",{className:_t,children:[o(Lt,{label:"Имя",...Ot(s("name"),el)}),o(Xt,{label:"Телефон",...Ot(s("phone"),ll)}),o(Cl,{label:"Тип обслуживания",options:Qn,...Ot(s("typeForm"),Zt)})]})]}),c($t,{title:"Офис банка",children:[o("div",{className:_t,children:o(Xn,{field:s})}),o("div",{className:_t,children:o(Ul,{field:s,regionKey:m,isPremium:!0})})]}),o(Lt,{...s("comment"),placeholder:"Комментарий, удобное время и прочее",isTextarea:!0}),bn(s("consentDataProcessing"),t,e)]})})),ta=e=>Qn.find((t=>t.key===e)),la=d((({name:e,text:t,value:l,checked:n,onChange:a,className:i})=>o("div",{className:i,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:"appearance-none flex justify-center items-center shrink-0 w-5 h-5 border border-gray hover:border-primary-hover\n checked:border-2 checked:!border-primary-main focus:checked:border-primary-main focus:border-primary-text active:border-primary-text\n after:block after:w-2.5 after:h-2.5 after:rounded-full checked:after:bg-primary-main outline-none rounded-full cursor-pointer",type:"radio",value:l,name:e,checked:n,onChange:e=>a(e.target.value),role:"radio"}),t?o(Pe,{color:"text-primary-text",children:t}):null]})}))),na=e=>{const{value:t,onChange:l}=e("vedTypes");return o($t,{children:c("div",{className:"gap-xl grid @xl:flex @xl:items-center",children:[o(la,{name:"vedTypes",text:"Валютный контроль",value:"currencyControl",checked:"currencyControl"===t,onChange:e=>l&&l(e)}),o(la,{name:"vedTypes",text:"Документарные операции",value:"documentOperations",checked:"documentOperations"===t,onChange:e=>l&&l(e)}),o(la,{name:"vedTypes",text:"Конверсионные операции",value:"conversionTransactions",checked:"conversionTransactions"===t,onChange:e=>l&&l(e)}),o(la,{name:"vedTypes",text:"Иные вопросы ВЭД",value:"otherIssues",checked:"otherIssues"===t,onChange:e=>l&&l(e)})]})})},aa=({field:e})=>{const t="currencyControl"===e("vedTypes").value;return c("div",{className:"space-y-s",children:[t?o(Il,{field:e}):null,c("div",{className:"grid @xl:grid-cols-2 @xl:gap-x-lg gap-s",children:[t?o(Lt,{label:"ИНН",...Ot(e("inn"),tl)}):null,o(Lt,{label:"Наименование организации",...Ot(e("fullName"),Zt)}),o(Lt,{label:"ФИО",...Ot(e("name"),el)}),o(Xt,{label:"Телефон",...Ot(e("phone"),ll)}),t?null:o(Lt,{label:"Электронная почта",...e("email")})]})]})},ia={typeForm:{key:"KVED",text:"Заявка на консультацию ВЭД"},vedTypes:"currencyControl",fullName:"",name:"",phone:"",inn:"",email:"",partnerComments:""},ra={fullName:Zt,name:el,phone:ll},sa=Mt({...ra}),oa=Mt({...ra,inn:tl,region:Zt}),ca=e=>"currencyControl"===e,da=e=>({currencyControl:"currencyControl"===e,documentOperations:"documentOperations"===e,conversionTransactions:"conversionTransactions"===e,otherIssues:"otherIssues"===e}),ma={ApplicationFormBusinessCard:Ll,ApplicationFormWed:d((e=>{const{button:t,link:l,onSubmit:n}=e,a=i((e=>{const{typeForm:t,fullName:l,name:a,phone:i,email:r,inn:s,region:o,vedTypes:c,partnerComments:d}=e,m={typeForm:t,fullName:l,name:a,phone:i,vedTypes:da(c),partnerComments:d,...ca(c)?{inn:s,region:o}:{email:r}};Vt((e=>ca(e)?oa:sa)(c)(e))&&n(m)}),[n]),[,{field:r,...s}]=Tt(ia,{onSubmit:a});return c("form",{className:"container space-y-lg",onSubmit:s.onSubmit,children:[na(r),o(N,{headingType:"h6",title:"Данные организации",className:"@xl:text-center"}),aa({field:r}),o(Lt,{label:"Обращение",placeholder:"Укажите интересующий вас вопрос, место ведения бизнеса и удобное время для телефонного звонка",...r("partnerComments"),isTextarea:!0}),Rl(t),o(Rt,{link:l}),o(N,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex 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(J,{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(J,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]})})),ApplicationFormDeposit:cn,ApplicationFormCredit:rn,ApplicationFormAcquiring:Dl,ApplicationFormGrantSupport:Un,ApplicationFormIndividuals:Kn,ApplicationFormFeedback:Ln,ApplicationFormSelfCollection:Yn,ApplicationFormUltraPremium:ea},ha=kt(),ua=bt((({className:e,formBlock:t,...l})=>{const[a,r]=n(""),s=i((async(e,t=!1)=>{const l=ga(e),n=await ha.send(l,t)?"OK":"Fail";return r(n),n}),[]);return o(b,{className:e,defaultPadding:"p-6xl",...l,children:c("div",{className:"container max-w-[978px] space-y-lg",children:[t?.title?o(N,{headingType:"h3",title:t.title,className:"@xl:text-center"}):null,t?pa(t,s):null,a?o(Ct,{responseType:a}):null]})})})),pa=(e,t)=>{const l=e?.formType;if(!l||!(l in ma))return null;return o(ma[l],{...e,onSubmit:t})},ga=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(t?.region?t?.text:t?.key)||t]))),xa=d((e=>{const{className:t,title:l,responseType:n,children:a,...i}=e;return o(b,{className:t,defaultPadding:"p-6xl",...i,children:c("div",{className:"container max-w-[978px] space-y-lg",children:[l?o(N,{headingType:"h3",title:l,className:"@xl:text-center"}):null,a,n?o(Ct,{responseType:n}):null]})})})),fa={1:"space-y-s max-w-2xl mx-auto",2:"grid @xl:grid-cols-2 gap-s"},ba=d((({className:e,text:t,value:l,key:n,disabled:a,error:i,onChange:r})=>c("div",{className:x("shrink-0 w-full",e),children:[o(gn,{text:t,value:l,disabled:a,onChange:r},n),Et(i)]}))),ya=(e,t)=>({surname:o(Lt,{label:"Фамилия",...va(t("surname"),el,e?.required)}),name:o(Lt,{label:"Имя",...va(t("name"),el,e?.required)}),middleName:o(Lt,{label:"Отчество (Обязательно, при наличии)",...t("middleName")}),phone:o(Xt,{label:"Телефон",...va(t("phone"),ll,e?.required)}),email:o(Lt,{label:"Электронная почта",...va(t("email"),Zt,e?.required)}),comment:o(Lt,{className:"col-span-2",...va(t("comment"),Zt,e?.required),placeholder:"Ваше сообщение",isTextarea:!0}),region:o(Il,{field:t}),client:o(ba,{...t("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}),birthday:o(An,{label:"Дата рождения",...va(t("birthday"),Zt)}),legend:o("legend",{className:"w-full col-span-2",children:o(N,{title:e.label,headingType:"h6",className:"@xl:text-center"})})}[e.name]),va=(e,t,l=!1)=>l?Ot(e,t):e,Na=e=>Object.values(e).map((e=>e.name)),wa={typeForm:{key:"",text:""},region:{key:"",text:""},surname:"",name:"",middleName:"",phone:"",email:"",comment:"",consentDataProcessing:!1},ka=(e,t="")=>({...Object.fromEntries(Na(e).map((e=>[e,wa[e]]))),typeForm:{key:t,text:""}}),Sa={typeForm:Zt,surname:el,name:el,region:Zt,phone:ll,email:Zt,comment:Zt,consentDataProcessing:al},Ca=kt(),Ia=d((({className:e,title:t,typeForm:l="",inputs:a=[],button:r,link:s,formColumns:d=2,endpoint:m})=>{const h=ka(a,l),[u,p]=n(""),g=Mt((e=>{const t=Na(e.filter((e=>"required"in e&&e.required)));return Object.fromEntries(t.map((e=>[e,Sa?.[e]])))})(a)),f=i((async e=>{if(!Vt(g(e)))return"Fail";const t=(e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[e,("region"===e?t?.text:t?.key)||t]))))(e),l=await Ca.send(t,"lead"===m)?"OK":"Fail";return p(l),l}),[]),[,{field:b,onSubmit:y}]=Tt(h,{onSubmit:f}),v=Ta(a)?.name;return o(xa,{className:x(zt,e),title:t,responseType:u,children:c("form",{className:fa[d],onSubmit:y,children:[a.map(((e,t)=>o("div",{children:ya(e,b)},String(t)))),bn(v?b("consentDataProcessing"):void 0,s,r)]})})})),Ta=e=>e.find((e=>"consentDataProcessing"===e?.name)),Ba="text-left",Ma={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},Va=d((({className:e,defaultIconSize:t=44,iconBgVersion:l="primary",size:n,icon:a,...i})=>{const r=String(n?.width||t);return a?o("div",{style:{width:`${r}px`,height:`${r}px`},className:x("rounded-icon object-fit flex justify-center items-center",Ma[l],e),children:o(H,{...i,width:"54%",height:"54%",name:a})}):null})),Pa=d((({className:e="",title:t,benefitList:l,...n})=>c(b,{className:e,defaultPadding:"p-6xl",...n,children:[t?o(N,{headingType:"h3",as:"h2",className:Ba,title:t}):null,l?.length?o("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:l.map(Ra)}):null]}))),Ra=({label:e,description:t,items:l,icon:n,iconBgVersion:a,isDotted:i=!1},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[n?.icon?o(Va,{className:"shrink-0",defaultIconSize:56,iconBgVersion:a||"",...n}):null,n?.src?o(J,{className:"shrink-0",image:n}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(N,{headingType:"h6",children:e}),o(Pe,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),o(Ye,{dotClassName:"bg-secondary-text",listItemSize:"S",items:l,isDotted:i})]}):null]},String(r)),za=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function Aa(e=0){const t=Math.round(10*e);return Array.from({length:t}).fill(0).map(((e,l)=>Math.min(l/t)),1).concat(1)}const Da=d((({className:e,style:t,idx:l,activeIndex:n,observerOptions:c,children:d,onIntersection:m})=>{const h=function(e,{sensitivity:t,rootRef:l}={}){const n=s(null),i=r((()=>({threshold:Aa(t),root:l?.current})),[t,l?.current]);return a((()=>{if(!n.current)return;const t=new IntersectionObserver(e,i);return t.observe(n.current),()=>{t.disconnect()}}),[e,i]),n}(i((e=>{e.length&&m&&m(l||0,e[e.length-1])}),[m,l]),c);return o("div",{className:x("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(l===n),ref:h,role:"listitem",children:d})})),ja=["min-w-full","@lg:min-w-[50%]","@lg:min-w-[33.3%]","@lg:min-w-[25%]"],Fa=d((({className:e,itemClassName:t,containerRef:l,activeIndex:n,visibleItemCount:a=0,gap:r=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:u,onVisibleItemsChange:p,onVisibleIndicesChange:g})=>{const f={sensitivity:1,rootRef:l},b=s([]),y=i(((e,t)=>{const l=[...b.current||[]];l[e]=t,b.current=l,p&&p(l),g&&g(La(l))}),[p,g]),v=a>0?r*Number(a)-1:0,N="vertical-list"===d,w="horizontal-list"===d,k={...w?Ea(c,v):{},...N?za(h):{},gap:`${r}px`};return o("div",{className:x("box-border overflow-auto no-scrollbar",d,e),style:k,ref:l,role:"list",children:(S=(e,l)=>o(Da,{className:x(m,a?ja[a-1]:"",N?"h-full":"",t),style:w?Ea(c/4):{},activeIndex:n,idx:l,observerOptions:f,onIntersection:y,children:e},String(l)),e=>null==e?e:Array.isArray(e)?e.map(S):S(e,0))(u)});var S})),Ea=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),La=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Oa={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},$a={"horizontal-list":"w-6","vertical-list":"h-6"},_a=d((({className:e="",containerRef:t,activeIndex:l,dotCount:n=0,listType:a="horizontal-list",version:i})=>n?o("div",{className:x("flex gap-xs",Oa[a],i?"group":"",e),"data-ver":i,children:Array.from({length:n}).fill(null).map(((e,n)=>o("div",{className:`cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white group-data-transparent:bg-white ${n===l?$a[a]:"w-2 h-2 opacity-30"}`,role:"button","aria-hidden":!0,onClick:()=>(e=>{e!==l&&t?.current&&t.current.children[e]?.scrollIntoView({behavior:"smooth",block:"nearest"})})(n)},String(n))))}):null)),Ua=e=>e,Ha=(e=Ua)=>t=>t.reduceRight(((t,l)=>e(t)>e(l)?t:l)),Wa=Ha(),Ka=(e=Ua)=>Ha((t=>-e(t))),qa=Ka(),Ga=e=>t=>e.scrollWidth/t,Ya=e=>(t,l)=>{e.scrollBy({left:l*Ga(e)(t),behavior:"smooth"})},Xa=({itemCount:e,onVisibleIndicesChange:t})=>{const l=s(null),[a,r]=n([]),o=i((e=>{r((t=>{return(l=t)===(n=e)||Boolean(l&&n&&l?.length===n?.length&&l.every(((e,t)=>e===n[t])))?t:e;var l,n})),t&&t(e)}),[e]),[c,d]=a.length?[Ka()(a),Ha()(a)]:[-1,-1],m=c>0,h=d<e-1,u=i((()=>{var t;l.current&&(m?Ya(l.current)(e,-1):(t=l.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=i((()=>{l.current&&(h?Ya(l.current)(e,1):l.current.scrollTo({left:0,behavior:"smooth"}))}),[e,h]),g=i(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{l?.current&&l.current.children[e]?.scrollIntoView(t)}),[l]);return[l,{scrollLeft:u,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:h,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},Qa=d((({className:e,version:t,gap:l=14,padding:n=16,showDots:a=true,minHeight:i,children:r,onVisibleIndicesChange:s,listType:d="horizontal-list"})=>{const m=Array.isArray(r)?r.length:0,[h,u]=Xa({itemCount:m,onVisibleIndicesChange:s}),[p]=u.visibleIndicesRange;return c("div",{className:x(e,"vertical-list"===d?"relative h-full":""),children:[o(Fa,{containerRef:h,activeIndex:p,visibleItemCount:1,gap:l,padding:n,onVisibleIndicesChange:u.handleVisibleIndicesChange,listType:d,minHeight:i,children:r}),a?o(_a,{containerRef:h,activeIndex:p,dotCount:m,listType:d,version:t}):null]})})),Za=(e,t,l)=>{return o(Qa,{children:e.map((n=l,({icon:e,title:t,description:l},a)=>c("div",{className:x("flex flex-col gap-1","justify-between p-m h-full border border-gray",l||t?"":"justify-center"),children:[t?o(Pe,{size:"text-h6",font:"font-normal",align:n,children:t}):null,e?o(J,{image:e,height:"180",className:"w-auto mx-auto"}):null,l?o(Pe,{size:"text-h6",font:"font-normal",align:n,children:l}):null]},String(a))))});var n},Ja=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:l="",columnsCount:n="4",subtitle:a,title:i,...r})=>c(b,{className:x("space-y-3xl",l),defaultPadding:"p-6xl",...r,children:[o(S,{defaultPadding:"",title:i,description:a,headlineVersion:"M"}),e?.length?Za(e,0,t):null]}))),ei={start:"justify-start",center:"justify-center",end:"justify-end"},ti=d((({buttons:e,className:t="",align:l,...n})=>{const a=l?x("flex",ei[l]):"";return o(b,{className:x("!bg-transparent",a,t),defaultPadding:"p-0",...n,children:Ue(e)})})),li=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:l=!1,renderFoldableSection:a,renderFoldButton:r})=>{const[s,o]=n(l),d=i((()=>{o((e=>!e))}),[]),m=a({isUnfolded:s,onToggle:d}),h=r?r({isUnfolded:s,onToggle:d}):null;return c("div",t?{className:e,role:"group",children:[h,m]}:{className:e,role:"group",children:[m,h]})}));const ni=d((({className:e="",isUnfolded:t,children:l})=>{const n=s(null),i=function(e,t){const l=s(null);return a((()=>{const t=l?.current;if(!t)return;const n=new ResizeObserver((l=>{e(t,l[0])}));return n.observe(t),()=>{n.disconnect()}}),[e,...t]),l}((e=>{n.current&&(n.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:n,className:`transition-max-h duration-300 overflow-hidden ${n.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:i,children:l})})})),ai=d((({className:e,title:t,value:l,fractionDigits:n,fixed:a,prefix:i,postfix:r})=>c("div",{className:x("flex justify-between @xl:flex-col",e),children:[t?o(Pe,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t}):null,o("div",l?{children:o(Pe,{size:"text-h3",children:[i,Xe(n,{fixed:a})(l),r].filter(Boolean).join(" ")})}:{children:o(Pe,{size:"text-h3",children:"-"})})]}))),ii=1e4,ri=5e6,si=Math.round(29.5),oi={minSum:ii,maxSum:ri,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},ci={minSum:ii,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},di={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},mi={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0},hi={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},ui=(e,t)=>{const{travelExpenseValue:l,restExpenseValue:n}=e,[a,i]=((e,t,l)=>{const{maxBonus:n=5e3,prefMonthsNum:a=di.prefMonthsNum,prefTravelBonusRate:i=di.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(i*t)+Math.round(r*l),n);return[c,c*a+Math.min(Math.round(s*t)+Math.round(o*l),n)*(12-a)]})(t||di,l,n);return{...t,...e,monthBonus:a,yearBonus:i}},pi=e=>e?o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e}):null,gi=d((({rate:e=0,title:t="Ставка",unit:l,fractionDigits:n=2,depositeName:a,isShowDepositeName:i})=>c("div",{children:[o(Pe,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t}),c("div",{className:"relative",children:[c("div",{className:"flex justify-start gradient-color-text",children:[o("span",{className:"font-mohave text-title-huge pr-xl -mt-m tracking-[-15px]",children:Xe(n,{fixed:!0})(e)}),l?o("span",{className:"text-7xl",children:l}):null]}),a&&i?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:a}):null]})]}))),xi=d((({title:e="Ставка",isUnavailableByTerm:t=!1})=>c("div",{className:"space-y-s",children:[o(Pe,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(H,{className:"w-10 h-10 @5xl:h-auto @5xl:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:t?c(w,{size:"text-xl",font:"font-light",color:"text-primary-text",children:["Процентная ставка для срока ",o("strong",{children:"1-30 дней"})," устанавливается при обращении в Банк"]}):o(w,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Выберите другую сумму или срок"})})]}))),fi=({title:e="Ставка",rate:t=0,unit:l="%",fractionDigits:n=2,isUnknownRateShown:a=!0,...i})=>a&&0===t?o(xi,{title:e,...i}):c("div",{children:[o("div",{className:"hidden @xl:block",children:o(gi,{title:e,rate:t,unit:l,fractionDigits:n,...i})}),o("div",{className:"@xl:hidden",children:o(ai,{title:e,value:t,postfix:l,fractionDigits:n,fixed:!0,...i})})]});function bi({isShowItems:e=!0,step:t=1e3,...l}){const n=[`От ${Xe(2)(l.min||0)} ₽`,`До ${Xe(2)(l.max||0)} ₽`];return o(Jl,{items:e?n:[],step:t,...l})}const yi=d((({className:e="",calcSource:t,buttons:l,footnote:n})=>{const[a,{field:i}]=Tt({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:r,maxSumTravel:s,minSumOther:d,maxSumOther:m,monthBonus:h,yearBonus:u}=ui(a,t);return c("section",{className:x("flex flex-col justify-between @5xl:flex-row gap-y-4xl",e),children:[c("div",{className:"flex flex-col @xl:max-w-md gap-2xl border-b border-b-main-divider @xl:border-none pb-3xl @xl:pb-0",children:[bi({title:"Сумма покупок в категории путешествия, ₽",min:r,max:s,step:500,isShowItems:!1,...i("travelExpenseValue")}),bi({title:"Сумма покупок в остальных категориях, ₽",min:d,max:m,step:500,isShowItems:!1,...i("restExpenseValue")})]}),h>=0?fi({title:"Баллов за месяц",rate:h,fractionDigits:0,isUnknownRateShown:!1,unit:""}):null,c("div",{className:"flex flex-col gap-y-xl @xl:w-96",children:[u>=0?o(ai,{title:"Баллов за год",value:u}):null,Ue(l,{isVertical:!0}),pi(n)]})]})})),vi=d((({className:e,inputChildren:t,rateChildren:l,resultChildren:n})=>c("section",{className:x("flex flex-col justify-between @5xl:flex-row gap-m",e),children:[o("div",{className:"flex flex-col gap-y-m sm:max-w-md gap-2xl",children:t}),o("div",{className:"border-b border-main-divider md:hidden"}),l,o("div",{className:"flex flex-col gap-2xl sm:w-96 max-w-full",children:n})]}))),Ni=([e,t],l,n=[])=>l&&l[e]&&l[t]?{[e]:l[e],[t]:l[t]}:wi([e,t],n),wi=([e,t],l=[])=>({[e]:l.length?qa(l.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:l.length?Wa(l.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),ki=(e,[t,l],n)=>e>=n[t]&&e<=n[l],Si=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Ci=(e,t)=>{const{isMonthlyInterestPayment:l,moneyValue:n,daysValue:a}=t;return l?Math.round(n*Math.pow((1200+e)/1200,a/30)-n):Math.round(n*e*a/365/100)},Ii=(e,t=0)=>e?.sum&&e.sum>=ii&&e.sum<=ri?e.sum:t,Ti=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,Bi=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,Mi={horizontal:"gap-5xl",vertical:"flex-col gap-s"},Vi=d((({items:e,checkedItem:t,className:l,onChange:n,orientation:a="horizontal"})=>o("div",{className:x(`flex ${Mi[a]}`,l),role:"radiogroup",children:e?.map((({id:e,text:l})=>o(gn,{isRadio:!0,text:l,value:t===e,onChange:()=>n&&n(e)},String(e))))}))),Pi=({items:e,title:t,mobileTitle:l=t,orientation:n="horizontal",value:a,radioGroupClassName:i,onChange:r})=>c("div",{className:"space-y-s",children:[t?o("div",{className:"hidden @5xl:block",children:o(Pe,{color:"text-secondary-text",font:"font-light",children:t})}):null,l?o("div",{className:"@5xl:hidden",children:o(Pe,{color:"text-secondary-text",font:"font-light",children:l})}):null,o(Vi,{orientation:n,items:e,checkedItem:e[a?0:1].id,className:x("flex-col sm:flex-row",i),onChange:t=>r&&r(t===e[0].id)})]}),Ri=e=>Pi({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),zi=d((({className:e="",buttons:t,footnote:l,bottomFootnote:n,isShowDepositeName:a,defaultParams:i,calcSource:r})=>{const[s,{field:d}]=Tt({moneyValue:Ii(i,1e5),daysValue:Ti(i,60),isReplenished:Boolean(i?.isReplenished),isPartialWithdrawal:Boolean(i?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(i?.isMonthlyInterestPayment)}),m=((e,t)=>{const{daysValue:l,moneyValue:n,isPartialWithdrawal:a,isReplenished:i,isMonthlyInterestPayment:r}=e,s=i||a,o=l<90||l>730;if(l<=30)return{...hi,...e,isDisabledOperatingDeposit:o,isUnavailableByTerm:!0};const c=t?.rateRows?.find((e=>r===e.isMonthlyInterestPayment&&Si(s,e)&&ki(n,["minSum","maxSum"],e)&&ki(l,["minDays","maxDays"],e)))||hi,{rate:d}=c,m=Ci(d,e),h=n+m,u=t?.rateRows||[hi];return{...c,...wi(["minSum","maxSum"],u),...wi(["minDays","maxDays"],u),...e,isDisabledOperatingDeposit:o,income:m,finalSum:h}})(s,r),{income:h,finalSum:u,rate:p,isUnavailableByTerm:g,depositeName:x}=m;return o(vi,{className:e,inputChildren:c("div",{children:[bi({title:"Сумма, ₽",min:m.minSum,max:m.maxSum,...d("moneyValue"),value:m.moneyValue}),(f={title:"Срок, дней",min:m.minDays,max:m.maxDays,...d("daysValue"),value:m.daysValue},o(Jl,{items:[`От ${Bi(f.min||0)}`,`До ${Bi(f.max||0)}`],step:1,...f})),c("div",{className:"flex flex-col sm:flex-row gap-y-4 gap-x-14",children:[Ai(m,d),Ri({title:"Выплата процентов",orientation:"vertical",...d("isMonthlyInterestPayment"),radioGroupClassName:"sm:flex-col"})]})]}),rateChildren:fi({rate:p,depositeName:x,isShowDepositeName:a,isUnavailableByTerm:g}),resultChildren:c("div",{children:[Di(u,h),Ue(t,{isVertical:!0}),pi(l),pi(n)]})});var f})),Ai=(e,t)=>c("div",{className:"space-y-s",children:[o(Pe,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-xl sm:gap-y-s",children:[o(gn,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(gn,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),Di=(e,t)=>c("div",{className:"flex flex-col gap-2xl sm:gap-0 mb-lg",children:[o(ai,{title:"Доход в конце срока",value:t,postfix:"₽",prefix:"+"}),o(ai,{title:"Сумма в конце срока",value:e,postfix:"₽"})]}),ji=e=>Fi({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Fi({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&Fi({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&Fi({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Fi=({row:e,userInputParams:t,paramsViewSettings:l,fieldKey:n,viewSettingFieldKey:a})=>!!l&&!l[a]||t[n]===e[n],Ei=(e,t)=>{const{isAnnuity:l,moneyValue:n,monthsValue:a,moneyExtra:i}=t;if(0===e)return 0;if(l){const t=e/1200;return i?(n+i)*(t+t/(Math.pow(1+t,a)-1)):n*(t+t/(Math.pow(1+t,a)-1))}return Math.round(n/a)+n*(e/1200)},Li=(e,t,l)=>{const{moneyValue:n,monthsValue:a}=e,i=t?.rateRows||[oi],r=(({limitRows:e,userInputParams:t,paramsViewSettings:l})=>e?.find((e=>ji({row:e,userInputParams:t,paramsViewSettings:l}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:l}),{minSum:s,maxSum:o}=Ni(["minSum","maxSum"],r,i),{minMonths:c,maxMonths:d}=Ni(["minMonths","maxMonths"],r,i),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:l,moneyValue:n,monthsValue:a})=>e?.find((e=>ji({row:e,userInputParams:t,paramsViewSettings:l})&&ki(n,["minSum","maxSum"],e)&&ki(a,["minMonths","maxMonths"],e)))||oi)({rateRows:i,userInputParams:e,paramsViewSettings:l,moneyValue:n,monthsValue:a}),{rate:h}=m,u=Ei(h,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:n,monthsValue:a,monthlyPayment:u}},Oi=({min:e=0,max:t=0,availableMonths:l,...n})=>o(Jl,{items:[`От ${$i(e)}`,`До ${$i(t)}`],step:1,...l?.length?{list:l}:{min:e,max:t},...n}),$i=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,_i=e=>Pi({...e,radioGroupClassName:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Ui=d((({className:e,calcSource:t,buttons:l,footnote:n,paramsViewSettings:a,defaultParams:i})=>{const[r,{field:s}]=Tt({moneyValue:Ii(i,2e5),monthsValue:Ti(i,si),isAnnuity:Boolean(i?.isAnnuity),isInsurance:Boolean(i?.isEnableInsurance),isSalaryClient:Boolean(i?.isEnableSalaryClient),isPensionClient:Boolean(i?.isEnablePensionClient),isStateEmployee:Boolean(i?.isEnableStateEmployee)}),d=Li(r,t,a),m=_i({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...s("isAnnuity")});return o(vi,{className:e,inputChildren:c("div",{children:[bi({title:"Сумма кредита, ₽",step:500,min:d.minSum,max:d.maxSum,...s("moneyValue"),value:d.moneyValue}),Oi({title:"Срок кредита, месяцев",min:d.minMonths,max:d.maxMonths,...s("monthsValue"),value:d.monthsValue}),Hi({...d,...a},s),o("div",{className:"sm:hidden",children:m})]}),rateChildren:fi({rate:d.rate}),resultChildren:c("div",{children:[o(ai,{title:"Ежемесячный платёж",value:d.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:m}),Ue(l,{isVertical:!0}),pi(n)]})})})),Hi=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(gn,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(gn,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(gn,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(gn,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),Wi=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let l=1;for(;l<t.length;){const[e,n]=t[l-1],[a,i]=t[l];n>=a?t.splice(l-1,2,[e,Math.max(n,i)]):l++}return t},Ki=(e,t,l)=>{const{moneyValue:n,monthsValue:a}=e,i=t?.rateRows?.[0]?Yi(t.rateRows[0].minMonths,t.rateRows[0].maxMonths):0,r=!l?.isShowMonthlyInterestPayment,s=!l?.isShowRemoteRegistration,o=t?.rateRows?.find((t=>Gi({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r})&&Gi({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s})&&ki(n,["minSum","maxSum"],t)&&ki(a||i,["minMonths","maxMonths"],t)))||mi,{rate:c}=o,d=qi(c,e),m=n+d,h=t?.rateRows||[mi];return{...o,...wi(["minSum","maxSum"],h),...wi(["minMonths","maxMonths"],h),availableMonths:Wi(h.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,l=1)=>Array.from({length:Math.abs(t-e)/l+1},((n,a)=>t>=e?e+a*l:e-a*l)))(e,t))),...e,defaultMonth:i,income:d,finalSum:m}},qi=(e,t)=>{const{isMonthlyInterestPayment:l,moneyValue:n,monthsValue:a}=t;return l?Math.round(n*Math.pow((1200+e)/1200,a)-n):Math.round(n*e*30*a/365/100)},Gi=({row:e,userInputParams:t,paramKey:l,isExclude:n})=>n||t[l]===e[l],Yi=(e,t)=>e+Math.round((t-e)/2),Xi=d((e=>{const{className:t,calcSource:l,buttons:n,footnote:i,paramsViewSettings:r,defaultParams:s}=e,[d,{field:m}]=Tt({moneyValue:Ii(s,2e4),monthsValue:Ti(s),isMonthlyInterestPayment:Boolean(s?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(s?.isRemoteRegistration)}),h=Ki(d,l,r),{defaultMonth:u,rate:p,income:g,finalSum:x}=h,{onChange:f}=m("monthsValue"),{onChange:b}=m("moneyValue");return a((()=>{!d.monthsValue&&f&&f(u)}),[u]),a((()=>{b&&b(Gl(d.moneyValue,h.minSum,h.maxSum))}),[h.minSum,h.maxSum]),o(vi,{className:t,inputChildren:c("div",{children:[bi({title:"Сумма, ₽",min:h.minSum,max:h.maxSum,...m("moneyValue"),value:h.moneyValue}),Oi({title:"Срок, месяцев",min:h.minMonths,max:h.maxMonths,availableMonths:h.availableMonths,...m("monthsValue"),value:h.monthsValue}),Qi({...h,...r},m)]}),rateChildren:fi({rate:p}),resultChildren:c("div",{children:[o(ai,{title:"Доход в конце срока",value:g,postfix:"₽",prefix:"+"}),o(ai,{title:"Сумма в конце срока",value:x,postfix:"₽"}),Ue(n,{isVertical:!0}),pi(i)]})})})),Qi=(e,t)=>{return c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowMonthlyInterestPayment?Ri({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment}):null,e.isShowRemoteRegistration?(l={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration},Pi({...l,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]});var l},Zi=e=>Ji({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Ji({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Ji=({row:e,userInputParams:t,paramsViewSettings:l,fieldKey:n,viewSettingFieldKey:a})=>!!l&&!l[a]||t[n]===e[n],er=(e,t,l)=>{const{moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r}=e,s=t?.rateRows||[ci],o=(({limitRows:e,userInputParams:t,paramsViewSettings:l})=>e?.find((e=>Zi({row:e,userInputParams:t,paramsViewSettings:l}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:l}),{minSum:c,maxSum:d}=Ni(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:h}=Ni(["minMonths","maxMonths"],o,s),u=(({rateRows:e=[],userInputParams:t,paramsViewSettings:l,moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r})=>e?.find((e=>Zi({row:e,userInputParams:t,paramsViewSettings:l})&&ki(n+r,["minSum","maxSum"],e)&&ki(i,["minSumOld","maxSumOld"],e)&&ki(r,["minSumExtra","maxSumExtra"],e)&&ki(a,["minMonths","maxMonths"],e)))||ci)({rateRows:s,userInputParams:e,paramsViewSettings:l,moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r}),{rate:p}=u,g=Ei(p,e),x=e.oldMonthlyPayment-g;return{...u,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:h,moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r,monthlyPayment:g,benefit:x}},tr=d((({className:e,calcSource:t,buttons:l,footnote:n,paramsViewSettings:a})=>{const[i,{field:r}]=Tt({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),s=er(i,t,a),d=_i({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...r("isAnnuity")});return o(vi,{className:e,inputChildren:c("div",{children:[bi({title:"Остаток долга в других банках, ₽ ",step:500,min:s.minSum,max:s.maxSum-s.maxSumExtra,...r("moneyValue"),value:s.moneyValue}),bi({title:"Ежемесячный платёж в других банках, ₽",step:500,min:s.minSumOld,max:s.maxSumOld,...r("oldMonthlyPayment"),value:s.oldMonthlyPayment}),Oi({title:"Новый срок кредита, месяцев",min:s.minMonths,max:s.maxMonths,...r("monthsValue"),value:s.monthsValue}),lr({...s,...a},r),s.isExtraMoney?bi({title:"Дополнительная сумма, ₽ ",step:500,min:s.minSumExtra,max:s.maxSumExtra,...r("moneyExtra"),value:s.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:d})]}),rateChildren:fi({rate:s.rate,fractionDigits:1}),resultChildren:c("div",{children:[o(ai,{title:"Ежемесячный платёж",value:s.monthlyPayment,postfix:"₽"}),s.benefit>0?o(ai,{title:"Выгода в месяц",value:s.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:d}),Ue(l,{isVertical:!0}),pi(n)]})})})),lr=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(gn,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(gn,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(gn,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),nr={CreditCalculatorForm:Ui,DepositCalculatorForm:Xi,BusinessDepositCalculatorForm:zi,BonusCalculatorForm:yi,RefinancingCalculatorForm:tr},ar=bt((({className:e,calculatorTabs:t=[],...l})=>o(b,{className:e,defaultPadding:"p-0",...l,children:rr(t)}))),ir=e=>{const t=e.calculatorBlock?.calcType;if(!t||!(t in nr))return null;const l=nr[t];return c("div",{className:"p-xl",children:[e?.calculatorBlock?.title?o(N,{className:"mb-lg",title:e?.calculatorBlock?.title}):null,o(l,{...e.calculatorBlock,isMobile:!0})]})},rr=e=>{if(!e||!e.length)return null;return 1===e.length?ir(e[0]):e.map(((e,t)=>o(li,{isFoldButtonOnTop:!0,unfoldedByDefault:0===t,renderFoldableSection:({isUnfolded:t})=>o(ni,{isUnfolded:t,children:ir(e)}),renderFoldButton:sr(e)},t.toString())))},sr=e=>({isUnfolded:t,onToggle:l})=>{const n=e.nav?.align||"text-left";return c("button",{type:"button",onClick:l,className:"w-full p-xl bg-primary-main flex items-center border-b border-white",children:[o("div",{className:"w-11 h-11 bg-white rounded-md flex justify-center items-center",children:o(H,{name:e.nav?.icon?.icon,iconVersion:"color",width:"24",height:"24"})}),c("div",{className:"flex-1 flex flex-col pl-s",children:[o(Pe,{align:n,color:"text-white",children:e.nav?.title}),o(Pe,{align:n,size:"text-s",color:"text-white",font:"font-light",children:e.nav?.description})]}),o(H,{name:t?"ArrowUpIcon":"ArrowDownIcon",iconVersion:"white",width:"24",height:"24"})]})},or=d((e=>{const{onChange:t,min:l,max:n,defaultValue:a="0",fractionDigits:r=0,...s}=e,c=ql(e,{normalize:(e=a)=>l&&n?String(Gl(Number(cr(e)),l,n)):cr(e),format:Xe(r)}),d=i((e=>t&&t(cr(e))),[t]);return o(Dt,{onChange:d,...s,...c})})),cr=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),dr=d((e=>o(or,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Pe,{size:"text-xl",font:"font-light",children:"₽"})})}))),mr={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},hr={amount:1500},ur=d((({className:e="",title:t="Укажите сумму перевода",label:l="Сумма перевода",placeholder:i="1500",button:r,formType:s="private",...d})=>{const[{amount:m},{field:h}]=Tt(hr),[u,p]=n(!1);return a((()=>{p(m<=0)}),[m]),c(b,{className:x("flex flex-col items-center",e),defaultPadding:"p-6xl",...d,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:mr[s],children:[o(dr,{valid:!u,placeholder:i,label:l,...h("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:m}),r?.text?o(Pl,{className:"w-full mt-lg",type:"submit",disabled:u,children:r.text}):null]})]})})),pr=(e,t=0)=>{const{itemCount:l,visibleItemCount:a}=e,[r,s]=n(t),o=i((()=>s((e=>Math.min(e+1,l-1)))),[l]),c=i((()=>s((e=>Math.max(e-1,0)))),[l]),d=a?l>a&&r<l-a:r<l-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]},gr=d((({className:e,disabled:t,...l})=>o(ue,{rounded:!0,className:x("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,...l,children:o(J,{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"})}))),xr=d((e=>o(gr,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),fr=d((e=>o(gr,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),br="absolute top-[calc(50%-24px)] z-40",yr="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",vr=d((({scroll:e,activeIndex:t,itemCount:l,arrowsPadded:n,hasEdgeBlocks:a,onScrollLeft:r,onScrollRight:s})=>{const{canScrollLeft:d,canScrollRight:m,scrollLeft:h,scrollRight:u}=e,p=a?t>0:d,g=a?t<l-1:m,f=i((()=>{a?(d&&t!==l-1&&h(),r()):h()}),[h,r,a,d,t,l]),b=i((()=>{a?(m&&0!==t&&u(),s()):u()}),[u,s,a,d,t,l]);return c("div",{className:"hidden @lg:block",children:[Nr(e),p?o(xr,{className:x(br,n?"left-1 @lg:left-8":"left-0"),onClick:f}):null,g?o(fr,{className:x(br,n?"right-1 @lg:right-8":"right-0"),onClick:b}):null]})})),Nr=e=>c("div",{children:[e.canScrollLeft?o("div",{className:x(yr,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:x(yr,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),wr=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",kr=({className:e,text:t="ХИТ"}={})=>c("div",{className:x("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(H,{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})]}),Sr="relative h-full",Cr={small:"sm:min-w-64",normal:"sm:min-w-96",big:"sm:min-w-[515px]"},Ir=({noCardBorder:e,activeIndex:t,cardSize:l="normal",...n})=>{const{blocks:a}=n.block||{},i=a?.some(Mr);return V({...n,renderProps:(n,a,r)=>c("div",{className:Tr(n,{someCardsHighlighted:i}),children:[T(n,a,{className:Br(n,{someCardsHighlighted:i,showBorder:!e,cardSize:l}),blockIndex:r,isActive:r===t}),Mr(n)?kr({className:"absolute top-0 -right-4 z-40"}):null]},String(r))})},Tr=(e,{someCardsHighlighted:t})=>x(Sr,t&&(Mr(e)?"pt-3xl":"pt-3xl sm:pt-16")),Br=(e,{someCardsHighlighted:t,showBorder:l,cardSize:n="normal"})=>x(Sr,"min-w-80",Cr[n],t&&(Mr(e)?"pt-3xl sm:pt-16":"pt-3xl"),wr(l),l&&"h-full"),Mr=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,Vr=bt((({className:e,itemCount:t,visibleItemCount:l=0,noCardBorder:n,isAlignCenter:a,arrowsPadded:i=!0,isGap:r=!0,cardSize:s="normal",...d})=>{const{blocks:m=[]}=d.block||{},h=t||m?.length,[u,{inc:p,dec:g}]=pr({itemCount:h,visibleItemCount:l},Math.floor(l/2)),[f,y]=Xa({itemCount:h}),[v]=y.visibleIndicesRange,N=m&&"CarouselBankHistoryCard"===m[0]?.type;return c(b,{className:e,defaultPadding:"p-6xl",...d,children:[c("div",{className:x(a?"flex justify-center":"","relative max-w-full"),children:[o(Fa,{containerRef:f,visibleItemCount:l,snapAlign:"snap-start",gap:r?16:void 0,onVisibleIndicesChange:y.handleVisibleIndicesChange,children:Ir({noCardBorder:n,activeIndex:u,cardSize:s,...d})}),o(vr,{scroll:y,arrowsPadded:i,onScrollLeft:g,onScrollRight:p,hasEdgeBlocks:N,activeIndex:u,itemCount:h})]}),o(_a,{className:"@5xl:hidden",containerRef:f,activeIndex:v,dotCount:h,listType:"horizontal-list"})]})}),{childrenTypes:["CarouselCard","CarouselBankHistoryCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),Pr=d((({title:e,description:t,className:l})=>o(b,{className:l,defaultPadding:"p-6xl",children:o(S,{headlineVersion:"XS",title:e,description:t,align:"text-left",className:"text-primary-text",isEmbedded:!0})}))),Rr="z-10 border border-solid w-full h-full",zr=x(Rr,"absolute hidden @xl:block border-transparent"),Ar=d((({className:e,title:t,description:l,button:n,...a})=>o(b,{className:x("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...a,children:c("div",{className:"relative h-full",children:[o("div",{className:x(zr,"top-9 right-12 bg-green-dark")}),o("div",{className:x(zr,"top-6 right-8 bg-green")}),o("div",{className:x(zr,"top-3 right-4 bg-green-light")}),c("div",{className:x(Rr,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(S,{title:t,description:l,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),Ue([n],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),Dr={black:"bg-black",white:"bg-white"},jr=d((({className:e="",title:t,description:l,image:n,price:a,button:i,colors:r=[],align:s="text-left",padding:d,...m})=>o(b,{className:x("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(be,{className:"h-full",padding:d,title:o(S,{title:t,description:l,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:n?.src?o(J,{className:"flex justify-center align-center mb-xl",image:n}):null,buttons:Ue([i],{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(Pe,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(Fr)]}):null,a?c(Pe,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),Fr=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${Dr[e]}`},String(t)),Er=d((({textNode:e,iconNode:t,tag:l,onClick:n,justifyContent:a="between",className:i,role:r,...s})=>c(l,{tag:l,className:x("flex items-center w-full gap-1","between"===a?"justify-between":"justify-center",i),onClick:n,role:r,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),Lr=d((({className:e="",label:t,icon:l,dataTheme:n="",disabled:a=!1,onClick:i})=>o(Er,{tag:"button",onClick:i,disabled:a,"data-theme":n,justifyContent:"center",role:"button",className:x("py-4 border border-transparent outline-none focus:border-primary-text space-x-s",a?"bg-main-divider text-main-disabled hover:bg-main-divider":"bg-primary-main text-white hover:bg-primary-hove",e),textNode:o(Pe,{size:"text-h4",children:t}),iconNode:l?o(J,{image:{icon:l,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),Or=({isUnfolded:e,onToggle:t})=>o(Lr,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),$r=d((({className:e="",icon:t,...l})=>{const n=oe(),{text:a,href:i,target:r,onClick:s}=n(l);return a?o("div",{className:x("w-full pb-lg",e),children:c("a",{className:"bg-white flex justify-between rounded-md w-full p-lg whitespace-nowrap",role:"link",href:i,target:r,onClick:s,children:[c("div",{className:"flex items-center space-x-lg",children:[t?o(J,{imageClassName:"text-green-dark",image:t,width:"20",height:"20"}):null,o(Pe,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})]}),o(H,{className:"text-green",name:"ArrowRightIcon",width:"20",height:"20"})]})}):null})),_r=d((({className:e,additionalDescription:t,description:l,links:n=[],title:a,...i})=>c(b,{className:e,...i,children:[c("div",{children:[o(S,{isEmbedded:!0,title:a,description:l,as:"h1",align:"text-left"}),o(S,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),n?.length?Ur(n):null]}))),Ur=(e,t=3)=>{const l=(e||[]).map(((e,t)=>o($r,{...e},String(t)))),[n,a]=t>0?[l.slice(0,t),l.slice(t)]:[l,[]];return o("div",{className:"mt-4xl",children:a.length>0?o(li,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:"mb-1",children:n}),o(ni,{isUnfolded:e,children:a})]}),renderFoldButton:Hr}):o("div",{children:n})})},Hr=({isUnfolded:e,onToggle:t})=>e?null:o(Lr,{className:"border-t-main-divider/50",icon:"PlusIcon",label:"Показать еще",onClick:t}),Wr=d((({className:e="",href:t,target:l,isRemote:n=!1,children:a})=>{const i=oe({isRemote:n})({href:t,target:l});return o(t?"a":"div",{className:x("block",e),...t?i:{},role:t?"link":"none",children:a})})),Kr=[{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:["youtube.com"],iconMapped:{icon:"YoutubeIcon"}},{origins:["rutube.ru"],iconMapped:{icon:"RutubeIcon"}},{origins:["dzen.ru"],iconMapped:{icon:"DzenIcon"}}],qr=e=>Kr.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{},Gr=d((({className:e="",media:t,showButtonText:l,stretched:a,version:i="white",children:r})=>{const[s,d]=n(),m=t?.map((e=>{const{href:t,icon:n,text:a}=e,{iconMapped:r}=qr(t),o=_e(n)?n:r,c=l?{text:a}:{text:""};return!s&&a&&d(!0),{...e,...c,icon:{...o,iconVersion:"color"},version:e?.version??i}})),h=x("border border-solid hover:border-transparent group-data-primary:border-main-divider border-main-divider group-data-gray:border-green group/media",l&&s?"":"basis-auto",a?"flex-1 justify-center":"");return c("div",{className:x("flex flex-col gap-xs",e),children:[o("div",{className:"flex gap-xs",children:Ue(m,{className:x(a||s?"basis-full":""),buttonClassName:h})}),r?o(Pe,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),Yr=d((({className:e,padding:t,description:l,additionalDescription:n,href:a,icon:i,items:r=[],isDotted:s,socialMedia:d=[],target:m,title:h,align:u="text-left",benefits:p,imageOptions:{directionRight:g=!0,isImageAlwaysOnRight:f=false,isImageSecondary:y=!1}={},...v})=>o(b,{className:x("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...v,children:o(Wr,{href:a,target:m,className:"h-full",children:c(be,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(S,{title:h,description:l,headlineVersion:"XS",isEmbedded:!0,align:u}),...nt(_e(i)?o(J,{image:i}):null,g),buttons:d.length?o(Gr,{media:d,showButtonText:!0,version:v?.version}):null,isImageAlwaysOnRight:f,isImageSecondary:y,imageAlign:"center",children:[o($e,{benefits:p}),o(Ye,{items:r,isDotted:s,listItemSize:"S"}),Xr(n,u)]})})}))),Xr=(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,Qr=(e,t)=>{const{title:l,description:n,buttons:a}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[l?o("div",{className:"opacity-80",children:o(Pe,{size:"text-m",color:"text-secondary-text",children:l})}):null,n?o("div",{className:"mt-2xs",children:o(Pe,{size:"text-xl",color:"text-primary-text",children:n})}):null,a?.length?o("div",{className:"text-primary-main",children:Ue(a)}):null]},String(t))},Zr=d((({className:e="",title:t,align:l="text-center",icon:n,button:a,visibleCellsCount:i=1,cardCells:r=[],...s})=>{const d=r.map(Qr),[m,h]=i>0?[d.slice(0,i),d.slice(i)]:[d,[]];return c(b,{className:x("flex flex-col",e),defaultPadding:"p-2xl",...s,children:[_e(n)?o("div",{className:"self-center",children:o(J,{image:n})}):null,t?o(N,{className:x("pt-xs",l),headingType:"h5",title:t}):null,a?.text?o(ue,{className:"w-full mt-m mb-lg",...a}):null,h.length?o(li,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[m,o(ni,{isUnfolded:e,children:h})]}),renderFoldButton:r.length>1?Jr:null}):o("div",{children:m})]})})),Jr=({isUnfolded:e,onToggle:t})=>c("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:t,type:"button",children:[o("div",{children:e?"Скрыть":"Подробнее о тарифе"}),o(H,{className:"text-primary-text",name:e?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),es=(e=!1)=>e?"text-white":"",ts=(e=!1)=>"text-s mb-m "+(e?"text-white":"text-secondary-text/80"),ls=d((({icon:e,image:t,title:l,subtitle:n,isFillGradient:a})=>c("th",{className:"space-y-4 flex flex-col items-start",children:[e?o(J,{className:"h-16 w-16 min-w-16 min-h-16",image:e,width:"64",height:"64"}):null,t?.src&&o("div",{children:o(J,{image:t})}),l?o(N,{headingType:"h4",className:es(a),title:l}):null,n?o("div",{className:ts(a),children:n}):null]}))),ns=d((({cell:e,rowHeader:t,isFillGradient:l=!1})=>o("div",{className:"box-border flex flex-col",role:"cell",children:o("div",{className:x("h-full","border-main-divider border-b"),children:e?e.map(rs(l,t)):null})}))),as=(e=!1)=>""+(e?"text-white/80":"text-secondary-text"),is=(e=!1)=>""+(e?"text-white":""),rs=(e,t)=>({label:l,description:n},a)=>c("div",{className:"flex justify-between text-s py-s",children:[o(w,{size:"text-s",color:as(e),children:t}),c("div",{className:"basis-1/2",children:[l?o("div",{className:"text-right",children:o(w,{size:"text-s",align:"text-right",color:is(e),children:l})}):null,n?o("div",{className:"text-right",children:o(w,{size:"text-s",color:as(e),children:n})}):null]})]},String(a)),ss=d((({header:e,columnData:t,visibleRowLength:l=0,isFillGradient:n,showRow:a,onToggleColumn:i})=>{const r=t?.slice(0,a?t.length:l),s=n?"secondary":"primary";return o("tr",{className:"mb-m",children:c("td",{className:x("border border-gray rounded-md p-m",n?"bg-gradient-to-r from-main-gradient-start to-main-gradient-end":""),children:[o(ls,{...e,isFillGradient:n}),r?.length?r.map((({rowHeader:e,cell:t},l)=>o(ns,{cell:t,rowHeader:e,isFillGradient:n},String(l)))):null,a&&e?.link?o(ue,{href:e.link.href,target:e.link?.target,version:s,ariaLabel:"Подробнее",className:"text-s font-medium mt-m p-s",children:e.link.text}):null,os({onToggleColumn:i,isFillGradient:n,showRow:a})]})})})),os=({onToggleColumn:e,isFillGradient:t,showRow:l})=>o("td",{className:"pt-lg",children:o("a",{role:"link",onClick:e,className:"cursor-pointer "+(t?"text-white/80":"text-primary-main"),children:o(Pe,{size:"text-s",font:"font-medium",children:l?"Скрыть":"Показать описание"})})}),cs=d((e=>{const{className:t,title:l}=e;return c("section",{className:`bg-white font-sans p-6xl overflow-hidden text-primary-text relative space-y-lg ${t||""}`,children:[l?o(N,{headingType:"h3",className:"font-medium text-center",title:l}):null,o("table",{className:"border-separate",children:o(ds,{...e})})]})})),ds=d((({columns:e=[],rowHeaders:t,isColoredFirstColumn:l,visibleRowLength:a,orientation:r,...s})=>{const[c,d]=n(Array.from({length:e.length}).fill(!a)),m=i((e=>{const t=(t,l)=>l===e?!t:t;d((e=>e.map(t)))}),[]),h=i((()=>d((e=>Array.from({length:e.length}).fill(!1)))),[]),u=e?.map((({data:e,header:n},i)=>{return o(ss,{visibleRowLength:a,showRow:c[i],header:n,columnData:(r=e,r?.map(((e,l)=>({cell:e,rowHeader:t?.[l]?.title})))),isFillGradient:0===i&&l,onToggleColumn:()=>m(i),...s},String(i));var r}));return o("tbody","horizontal"===r?{children:o(Qa,{onVisibleIndicesChange:h,children:u})}:{children:u})})),ms=e=>e%2!=0,hs=d((({title:e,description:t})=>c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(J,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),o(S,{title:e,description:t,headlineVersion:"S",isEmbedded:!0,align:Ba})]}))),us=["ArrowDownIcon","ArrowUpIcon"],ps="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs border-box",gs=d((({label:e="",blocksToRender:t=[],topItemsCount:l=0,block:n,notFound:a,...i})=>{const[r,s]=l>0?[t.slice(0,l),t.slice(l)]:[t,[]];return c("div",{children:[o("div",{className:x(t.length?"hidden":"block"),children:a?o(hs,{...a}):null}),c("div",{className:x("space-y-2xs",t.length?"":"hidden"),children:[c("div",{className:x(ps),children:[M(r,{...i.options,parent:n}),ms(r.length)?o(vt,{className:"col-span-6",...i}):null]}),o(li,{renderFoldableSection:({isUnfolded:e})=>c(ni,{className:x(ps),isUnfolded:e,children:[M(s,{...i.options,parent:n}),ms(s.length)?o(vt,{className:"col-span-6",...i}):null]}),renderFoldButton:({isUnfolded:t,onToggle:n})=>o(Lr,{className:x(l<1?"hidden":""),disabled:!s?.length,label:e,icon:us[Number(t)],dataTheme:i.options?.page?.colorPalette,onClick:n})})]})]})})),xs=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,fs=(e,t)=>Object.entries(e).map((([l,n])=>"number"==typeof n?Array.isArray(t[l])?((e,t)=>l=>xs(t[e])||xs(l[e])||l[e]?.includes(t[e]))(l,e):((e,t)=>l=>xs(t[e])||xs(l[e])||bs(t[e])<=bs(l[e]))(l,e):"object"==typeof n&&"min"in n&&"max"in n?((e,t)=>l=>xs(t[e])||xs(l[e])||bs(t[e]?.min)>=bs(l[e]?.min)&&bs(t[e]?.min)<=bs(l[e]?.max))(l,e):Array.isArray(n)?((e,t)=>l=>xs(t[e])||xs(l[e])||t[e]?.every((t=>l[e]?.includes(t))))(l,e):((e,t)=>l=>xs(t[e])||xs(l[e])||t[e]===l[e])(l,e))).every((e=>e(t))),bs=e=>Number(e||0),ys=(e,t)=>(l=It)=>e&&e.filter((e=>fs(t,l(e.content||{})))),vs=d((({value:e,onChange:t,items:l=[],multiple:n})=>l.map((l=>o(Bt,{text:l?.title,value:[e].flatMap((e=>e)).includes(l.value),onChange:()=>(l=>{if(!t)return;const a=e?.includes(l);t(n?a?(e||[]).filter((e=>e!==l)):[...e||[],l]:a?[]:[l])})(l.value),type:n?"checkbox":"radio"},l.value))))),Ns=({field:e,reset:t,filtrationSchema:l,resetButton:n,children:a})=>c("form",{className:"flex flex-col @4xl:flex-row justify-between bg-white p-4xl gap-s @4xl:gap-0",children:[c("div",{className:"flex flex-col @4xl:flex-row gap-5xl",children:[a,Object.entries(l).map(ws(e))]}),n?o("div",{children:o(Pl,{type:"reset",className:"w-full @4xl:w-72 @4xl:ml-s",onClick:t,children:n?.text})}):null]}),ws=e=>([t,l])=>{const n=l?.type;return"array"===n?ks(t,e)(l):null},ks=(e,t)=>l=>{const n=l?.items?.enum?.map(((e,t)=>({value:e,title:l?.items?.enumNames?.[t]||""})))||[];return c("div",{children:[l?.title?o("div",{className:"mb-m",children:o(Pe,{size:"text-m",font:"font-light",color:"text-secondary-text",children:l.title})}):null,o(vs,{items:n,multiple:!l?.single,...t(e)})]},e)},Ss=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,Cs=(e,t)=>Array.from({length:t-e+1},((t,l)=>e+l)),Is=(e,t)=>pt((e[t?.sourceBook]?.rateRows||[]).filter(Ss).flatMap((e=>Cs(e.minMonths,e.maxMonths)))),Ts=(...e)=>{const t=e.map((e=>ht(e)));return Promise.all(t)};function Bs(e,...t){return e.map(((e,l)=>[e,...t.map((e=>e[l]))]))}const Ms=e=>Boolean(e&&e.content&&"string"==typeof e.content.sourceBook);function Vs(e){const{dirs:t=[],source:l=[]}=r((()=>{const t=(e=>e?.filter(Ms).map((({content:{sourceBook:e}})=>e)))(e);return{dirs:t?.map((e=>`/wcms-resources/${e}.json`)),source:t}}),[e]),{data:n=[]}=ml(t,Ts);return{source:Object.fromEntries(Bs(l,n).filter((([,e])=>Boolean(e)))),months:pt(n.flatMap((e=>e?.rateRows||[])).filter(Ss).flatMap((e=>Cs(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[]}}const Ps=1e9,Rs={sum:{min:1e4,max:Ps},period:3},zs=bt((({className:e,filtrationSchema:t={},resetButton:l,sumInput:n,periodInput:a,...i})=>{const{source:r,months:s}=Vs(i.block?.blocks),[d,{field:m,reset:h}]=Tt(Rs),u=d===Rs?i.block?.blocks:ys(i.block?.blocks,d)((e=>({...e,period:Is(r,e||{})||[]}))),p=c("div",{children:[o(dr,{label:n?.title,min:500,max:Ps,...m("sum",{parse:e=>({min:Number(e),max:Ps}),format:({min:e})=>String(e)})}),o(Jl,{title:a?.title,items:["От 3 мес","До 5 лет"],list:s,...m("period")})]});return c(b,{className:x("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...i,children:[Ns({field:m,reset:h,filtrationSchema:t,resetButton:l,children:p}),o(gs,{blocksToRender:u,...i})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},sourceBook:{type:"string",title:"Адрес справочника"}})}),As=e=>"Image"===e?.contentType&&e?.image?o(J,{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,Ds=d((({className:e="",title:t,description:l,error:n,button:a,...i})=>c(b,{className:x("flex flex-col justify-center items-center",e),defaultPadding:x("p-6xl"),version:"transparent",...i,children:[o("div",{className:"flex justify-center",children:As(n)}),o(S,{title:t,description:l,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),a?.text?o(ue,{version:a?.version,text:a?.text,...a}):null]}))),js="location";function Fs(e="Москва"){const[t,l]=((e,t,l)=>{const[r,s]=n(l||null);return a((()=>e.subscribe(t,(e=>s(e)))),[e,t]),[r,i((l=>e.fire(t,l)),[e,t])]})(p,"location",Ls()??{name:e}),r=i((e=>{Os(e),l(e)}),[]),{data:s}=ml(Es()?null:"/api/v1/region",ut);return a((()=>{s&&!Es()&&l(s)}),[s]),[t??{name:e},r]}const Es=()=>Boolean(globalThis.localStorage?.getItem(js)),Ls=()=>{try{const e=globalThis.localStorage?.getItem(js);return e&&JSON.parse(e)}catch(e){return null}},Os=e=>{try{globalThis.localStorage?.setItem(js,JSON.stringify(e))}catch(e){}};var $s;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}($s||($s={}));const _s=new Intl.NumberFormat("ru",{style:"currency",currency:$s.RUB}),Us=e=>e?_s.format(e):"",Hs="text-left text-m font-light text-secondary-text",Ws=`${Hs} pl-5xl`,Ks={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},qs=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:`h-fit w-fit ${e}`,children:[o("thead",{children:c("tr",{children:[o("th",{className:Hs,children:o(Pe,{size:"text-m",children:"Валюта"})}),o("th",{className:Ws,children:o(Pe,{size:"text-m",children:"Купить"})}),o("th",{className:Ws,children:o(Pe,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(Gs)})]}))),Gs=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m",children:c("div",{className:"flex items-center gap-xs",children:[t?o(J,{image:{icon:Ks[t]},width:"24",height:"24"}):null,o(Pe,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl",children:o(Pe,{size:"text-h6",children:Us(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl",children:o(Pe,{size:"text-h6",children:Us(e?.buyExchangeRate)})})]},t)},Ys={icon:"GpsIcon"},Xs=d((({className:e="",address:t})=>c("div",{className:`flex gap-s ${e}`,children:[o(Va,{...Ys,iconBgVersion:"primary"}),c("div",{className:"space-y-2xs",children:[t?o(w,{size:"text-l",color:"text-primary-main",children:t}):null,o(w,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),Qs=(e,t,l)=>{const n=Number(Zs(e))*Math.pow(t,l?-1:1);return Number.isInteger(n)?n:((e,t=2)=>{const l=10**t;return Math.round(parseFloat(String(e))*l)/l})(n)},Zs=e=>e.replace(/[^\d.,]/g,"").replace(",","."),Js=e=>{return(t=[[e=>e.value!==$s.RUB&&e.oppositeValue!==$s.RUB,()=>e.handleConvert(e.value,$s.RUB)],[e=>e.value===$s.RUB&&e.oppositeValue===$s.RUB,()=>e.handleConvert(e.value,$s.USD)],[e=>e.value===$s.RUB&&e.oppositeValue===$s.RUB,()=>e.handleConvert(e.value,$s.CNY)],[()=>!0,()=>e.handleConvert(e.value)]],e=>{const[,l]=t.find((([t])=>t(e)))||[];return l})(e)?.();var t};function eo(e){const{placeholder:t,rates:l,selected:n,value:a,setValue:i,setSelected:r}=e,s=l.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:n,text:n};return c("div",{className:"relative flex",children:[o(Dt,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:a,onChange:i}),s.length?o(Nl,{isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const to=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:l,button:a})=>{const[r,s]=n({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||$s.RUB,selectBuy:l?.[0]?.currency?.currency||$s.USD}),d=i((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`grid gap-m pt-2xl ${e}`,children:[eo({placeholder:"Хочу продать",rates:l,selected:r.selectSell,setSelected:lo(r,d,l),value:r.inputSell,setValue:e=>ao(d,l)(e,r.selectSell,r.selectBuy)}),eo({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:no(r,d,t),value:r.inputBuy,setValue:e=>io(d,t)(e,r.selectBuy,r.selectSell)}),a?.text?o(ue,{text:a.text,version:a?.version,...a}):null]})})),lo=(e,t,l)=>n=>{t({selectSell:n}),Js({value:n,oppositeValue:e.selectBuy,handleConvert:(n=e.selectSell,a=e.selectBuy)=>{ao(t,l)(e.inputSell,n,a)}})},no=(e,t,l)=>n=>{t({selectBuy:n}),Js({value:n,oppositeValue:e.selectSell,handleConvert:(n=e.selectBuy,a=e.selectSell)=>io(t,l)(e.inputBuy,n,a)})},ao=(e,t)=>(l,n,a)=>{e({inputSell:Zs(l),selectBuy:a});const i=t.find((e=>e.currency?.currency===a))?.buyExchangeRate||t.find((e=>e.currency?.currency===n))?.saleExchangeRate;i&&e({inputBuy:String(Qs(l,i,n===$s.RUB)||"")})},io=(e,t)=>(l,n,a)=>{e({inputBuy:Zs(l),selectSell:a});const i=t.find((e=>e.currency?.currency===a))?.saleExchangeRate||t.find((e=>e.currency?.currency===n))?.buyExchangeRate;i&&e({inputSell:String(Qs(l,i,n===$s.RUB)||"")})};const ro=d((({className:e="",title:t="Курсы обмена валют",button:l,...n})=>{const[a]=Fs(),i=function(e){const t=e?.code||"000",{data:l}=ml(`/api/v1/exchangerates?regionCode=${t}`,ut);return l||{}}(a),r=so(i?.exchangeRate?.currencies),s=r.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:$s.RUB}});const d=r.filter((e=>e.saleExchangeRate));return d.push({currency:{currency:$s.RUB}}),o(b,{className:x("box-border min-h-80",e),...n,children:o(be,{className:"h-full",title:o(N,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex gap-6xl flex-wrap",children:[c("div",{children:[r?o(qs,{className:"mb-xl",exchangeCurrencyItems:r}):null,o(Xs,{address:i?.address})]}),r.length&&s.length&&d.length?o(to,{className:"grow",currencyRatesBuy:s,currencyRatesSell:d,button:l}):null]})})})})),so=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],oo=(e,t)=>o(Va,{...e,iconBgVersion:t,className:"shrink-0"}),co=d((({label:e,labelIconBgVersion:t,icon:l,onToggle:n,labelIcon:a})=>o(Er,{tag:"button",className:x("border-none bg-transparent items-center group/button",a?.icon?"py-xs":"py-lg"),onClick:n,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[oo(a,t),e?o(Pe,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:l?o(H,{name:l,iconVersion:"black",width:"24",height:"24"}):null}))),mo=bt((({className:e="",isExpanded:t,isFoldButtonOnTop:l=!0,label:n="Развернуть",labelIcon:a,labelIconBgVersion:i,foldButtonVersion:r="default",version:s,role:c,...d})=>o(b,{className:x("w-full","",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:c,...d,children:o(li,{isFoldButtonOnTop:l,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(ni,{className:x("gap-lg","flex flex-wrap group-last:last:pb-0"),isUnfolded:e,children:V({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>ho({foldButtonVersion:r,label:n,labelIcon:a,labelIconBgVersion:i,isUnfolded:e,onToggle:t})})})),{childrenTypes:{exclude:["RollupItem"]}}),ho=({foldButtonVersion:e,label:t,labelIcon:l,labelIconBgVersion:n,isUnfolded:a,onToggle:i})=>{const r=t||(a?"Скрыть":"Развернуть"),s=((e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon")(a);return"accordion"===e?o(co,{label:r,labelIcon:l,labelIconBgVersion:n,icon:s,onToggle:i}):o(Lr,{label:r,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:i})},uo=d((({className:e="",items:t})=>c("div",{className:e,children:[t?.length?t.map(po):null,o(ue,{version:"primary",className:"w-full",href:"https://beta.rshb.ru/natural/feedback/question",target:"_blank",ariaLabel:"Обратная связь",text:"Обратная связь"})]}))),po=(e,t)=>c("div",{className:"mb-m space-y-m",children:[o("div",{children:o(Pe,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(go)})]},String(t)),go=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:xo(e.type,e.text)}),o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),xo=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${fo(t)}`,children:o(Pe,{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})}},fo=e=>e.replaceAll(/\D/g,""),bo=["split_version","New","Old"],yo=d((({className:e="",index:t,text:l,...n})=>{const a=oe(),{href:i,target:r,onClick:s}=a(n);return o("a",{className:x("",e),href:i,target:r,onClick:s,children:l||`Документ ${t}`})})),vo=d((({title:e,links:t,className:l=""})=>c("div",{className:x("flex flex-col gap-4",l),children:[o(Pe,{size:"text-l",font:"font-normal",children:e}),t?.length?o("div",{className:"flex flex-col gap-lg",children:t.map(((e,t)=>o(yo,{className:"text-l font-light",index:t,...e},String(t))))}):null]}))),No=d((({className:e="",items:t,basePath:l})=>t?.length?o("ul",{className:x("flex flex-col",e),children:t.map(wo(l))}):null)),wo=e=>(t,l)=>{const{text:n,...a}=t,i=oe({isRemote:!(!z.BASE_PATH||!e)&&!z.BASE_PATH.startsWith(e),basePath:e}),{href:r,target:s,onClick:c}=i(a);return o("li",{className:"list-none my-xs",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:r,target:s||"_self",onClick:c,children:n||null})},`list_item_${String(l)}`)},ko=d((({className:e="",index:t,...l})=>{const n=oe({isRemote:!0}),{href:a,target:i,text:r,onClick:s}=n(l);return o("a",{className:`text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px] ${e}`,href:a,target:i,onClick:s,children:r||`Документ ${t}`})})),So=d((({className:e="",links:t})=>c("div",{className:x("@container",e),children:[o("div",{className:"pt-lg",children:o(Pe,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} АО «Россельхозбанк» Генеральная лицензия Банка России № 3349 от 12.08.2015 г.`})}),t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs pt-lg",children:t.map(((e,t)=>o(ko,{index:t,...e},String(t))))}):null]}))),Co=bt((({className:e,footer:t,...l})=>{const{topItems:n}=l.options?.page?.sitemap??{},{relatedEnterprises:a,contacts:r,socialMedia:s,mobileApps:d,horizontalNavigationTitle:m,documents:h}=t||{},u=i((()=>{const[e,t,l]=bo;((e,t)=>{const l=globalThis.document?.cookie.split(";")??[],[,n]=l.map((e=>e.split("="))).find((([t])=>t.trim()===e))||[];t(n)&&(globalThis.document.cookie=`${e}=${t(n)}`)})(e,(e=>e?.replace(t,l)))}),[]);return c(b,{tag:"footer",className:e,defaultPadding:"p-4xl pb-24",...l,children:[o("div",{className:"mb-lg pb-xs border-b border-main-divider",role:"menu",children:Io(n)}),o(uo,{className:"overflow-hidden",items:r}),c("div",{className:"mt-xl",children:[o(Gr,{className:"mb-xl",media:s,stretched:!0,children:"Соцсети"}),c("div",{className:"mb-xl",children:[o("div",{className:"flex flex-col gap-4 mb-xs",children:d?.map(To)}),o(Pe,{size:"text-s",font:"font-light",color:"text-secondary-text",children:"Мобильное приложение"})]})]}),o("div",{className:"py-lg border-t border-main-divider",children:o(yo,{text:"Вернуться на прежнюю версию сайта",className:"text-l font-light max-w-[292px]",href:"https://old.rshb.ru",onClick:u})}),o(vo,{className:"py-lg border-y border-main-divider",title:m,links:a}),o(So,{links:h})]})})),Io=e=>e?.map(((e,t)=>o(mo,{foldButtonVersion:"accordion",label:e?.text,labelIcon:e?.icon,role:"menuitem",children:o(No,{items:e.items,basePath:P(e.href)})},String(t)))),To=({href:e="/",text:t},l)=>{const{label:n}=qr(e);return o(ue,{className:"w-full",text:t||n,version:"secondary",href:e,target:"_blank"},String(l))},Bo={width:"34",height:"34"},Mo={"bg-white":"color",transparent:"white"},Vo={"bg-white":"text-primary-main",transparent:"text-white"},Po=(e,t,l)=>o(J,t?.src?{image:t,className:Vo[e],width:l?.width,height:l?.height}:{image:{icon:t?.icon||"LogoIcon",iconVersion:Mo[e]},className:Vo[e],width:l?.width,height:l?.height}),Ro={"bg-white":"text-primary-text",transparent:"text-white"},zo=d((({className:e,href:t="/",logo:l,children:n,targetBlank:a,bgColor:i="bg-white",showTitle:r=!0})=>c("a",{className:x("inline-flex items-center font-sans no-underline",e),href:t,target:a?"_blank":"_self","aria-label":l?.title??"Россельхозбанк",children:[Po(i,l?.image,Bo),r?n??o("div",{className:"ml-s",children:o(Pe,{font:"font-medium",color:Ro[i],size:"text-s",children:l?.title??"Россельхозбанк"})}):null]}))),Ao={default:"px-5 bg-main-divider rounded hover:text-primary-main",transparent:"text-white hover:text-primary-hover"},Do=d((({bgColor:e,logo:t,alwaysShowLogo:l,internetBankUrl:n,version:a})=>{const r=g(),s=z.BASE_PATH?.startsWith(r.pathname),d=i((()=>{r.back()}),[]);return c("div",{className:"flex items-center justify-between w-full",children:[l||s?o("div",{children:o(zo,{className:"my-2xs",bgColor:e,logo:t})}):jo(d),n?o("div",{children:o(ue,{href:n,ariaLabel:"Войти",target:"_blank",className:x("p-s text-s whitespace-nowrap text-primary-main hover:text-primary-hover",Ao["transparent"===a?"transparent":"default"]),children:"Войти"})}):null]})})),jo=e=>o("div",{children:c("button",{className:"flex items-center text-l my-2xs","aria-label":"Вернуться назад",onClick:e,type:"button",children:[o(J,{className:"w-6 h-6",image:{icon:"ChevronLeftIcon",iconVersion:"black"},width:"24",height:"24"}),"Вернуться назад"]})}),Fo={"bg-white":"primary",transparent:"transparent"},Eo=bt((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:l=Fo[e],portal:n,...a})=>{const{logo:i}=a.options?.page?.sitemap??{},{internetBankUrl:r}=n||{};return o(b,{tag:"header",defaultPadding:"",version:l,...a,children:o("div",{className:"container px-lg py-2xs box-border",children:o(Do,{bgColor:e,logo:i,alwaysShowLogo:t,internetBankUrl:r,version:l,...a})})})})),Lo={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},Oo=bt((({className:e="",padding:t="p-0",gap:l="",isInnerPadding:n=!0,version:a="transparent",isTheme:i=!1,isCardBorder:r=!1,image:s,...c})=>{const d=g();return o(b,{className:x("relative flex flex-col",Lo[l],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${G(d)(s?.src)})`}}:{},padding:t,version:a,isTheme:i,...c,children:V({...c,extraProps:{className:x("w-full",wr(r)),padding:n?"":"p-0"}})})}),{childrenTypes:[]}),$o=bt((e=>o(Oo,{...e})),{childrenTypes:[]}),_o=d((e=>{const{className:t,image:l,...n}=e;return o(b,{className:t,defaultPadding:"p-0",...n,children:o(J,{image:l})})})),Uo=["байт","Кб","Мб","Гб","Тб","Пб"],Ho=d((({icon:e,text:t,href:l,target:n,fileFormat:a,fileSize:i})=>{const r=i&&a?",":"",s=i??"",d=a?String(a):"";return c("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",href:l,target:n,children:[e,t?c(Pe,{size:"text-l",font:"font-light",children:[t," ",Wo(s,d),o(Pe,{color:"text-secondary-text",children:l&&`${s+r+d}`})]}):null]})})),Wo=(e,t)=>e||t?o("span",{children:", "}):"",Ko={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},qo=d((({className:e="",title:t,description:l,align:n="text-center",documents:a,icon:i={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=g();return c(b,{className:x("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(S,{title:t,description:l,align:n,headlineVersion:"M",as:"h2",isEmbedded:!0}),a?.length?o("div",{className:x("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",Ko[r]),role:"list",children:a.map(Go(d,i))}):null]})})),Go=(e,t)=>(l,n)=>{if(""===l?.docType)return null;const a="Attachment"===l?.docType?$(e)(l?.attachment?.src):l?.href,i="Attachment"===l?.docType?((e,t=2)=>{if(0===e)return"";const l=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,l)).toFixed(t))} ${Uo[l]}`})(l?.attachment?.fileSize||0):l?.fileSize,r="Attachment"===l?.docType?Yo(a):l?.fileFormat;return o("div",{role:"listitem",children:o(Ho,{text:l?.text,target:l?.target,href:a,fileFormat:r,fileSize:i,icon:t?o(J,{className:"min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md",image:t,width:"24",height:"24"}):null})},String(n))},Yo=e=>{if(!e)return"";const t=e.lastIndexOf("."),l=new RegExp(/\/(.*)/),n=-1!==t?e.substring(t+1):"";return n.includes("/")?n.replace(l,""):n},Xo=d((({className:e,padding:t,align:l="text-left",buttons:n=[],description:a,image:i,items:r,qr:s,additionalDescription:d="",title:m="Мобильное приложение",version:h="primary",...u})=>{const p="secondary"===h?"p-m min-w-32":"min-w-24",g=i?.src?o(J,{className:"hidden lg:block",image:i}):null;return o(b,{className:x("min-h-80",e),padding:"p-0",version:h,...u,children:c(be,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(N,{headingType:"h3",title:m,className:x("whitespace-pre-wrap",l)}),rightImage:g,buttons:Ue(n,{className:"flex-wrap"}),children:[a?o(Pe,{size:"text-xl","font-weight":"font-light",children:a}):null,c("div",{className:x("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[o(Ye,{items:r,listItemSize:"M"}),o(Pe,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:d}),s?.src?o("div",{className:x("flex justify-center bg-white rounded-md @xl:-order-1",p),children:o(J,{className:"w-fit",image:s})}):null,i?.src?o(J,{className:"lg:hidden",image:i}):null]})]})})})),Qo={primary:"bg-white/30",secondary:"bg-main-divider"},Zo={primary:"text-white",secondary:"text-secondary-text"},Jo=d((({count:e,version:t="secondary"})=>o("div",{className:x("w-6 h-6 rounded-full flex items-center justify-center",Qo[t]),role:"status",children:o(Pe,{size:"text-xs",color:Zo[t],children:e})}))),ec=(e=[],t={})=>e.filter((({content:e={}})=>fs(t,e))).length,tc=(e,t)=>e===t;const lc=(nc=function(...e){return(t,l)=>e.some((e=>e(t,l)))}(tc,((e=tc)=>(t,l)=>t===l||Boolean(t&&l&&t.length===l.length&&t.every(((t,n)=>e(t,l[n])))))()),(e,t)=>e===t||Boolean(e&&t&&Object.keys(e).length===Object.keys(t).length&&Object.entries(e).every((([e,l])=>nc(l,t[e])))));var nc;const ac=[],ic={},rc={default:"px-xs",underlined:"px-m",rounded:"px-lg rounded-md"},sc={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",rounded:"text-white"},oc={default:"bg-white",underlined:"bg-white",rounded:"bg-transparent"},cc={default:"sm:bg-primary-main",underlined:"bg-white",rounded:"bg-primary-main"},dc=d((({tag:e="div",item:t={},isActive:l,type:n="default",onClick:a})=>{const i=e,{text:r,appendRight:s,...d}=t;return o(i,{className:x("h-12","block flex-1","cursor-pointer",rc[n],l?cc[n]:oc[n]),role:"tab","aria-selected":l,onClick:a,...d,children:c("div",{className:x("h-full","flex justify-center items-center","text-center whitespace-nowrap",l?sc[n]:"text-secondary-text hover:text-primary-main"),children:[o(Pe,{size:"text-m",children:r}),s?o("div",{className:"ml-xs",children:s}):null]})})})),mc=d((e=>o(e?.item?.href?hc:uc,{...e}))),hc=d((e=>{const t=oe(),l=i((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:n,...a}=t({...e.item,onClick:l});return o(dc,{...e,tag:"a",item:a,onClick:n})})),uc=d((({item:e={},onClick:t,...l})=>{const n=i((()=>{t&&t(e)}),[t,e]);return o(dc,{item:e,onClick:n,...l})})),pc=(e,t,l)=>(n,a)=>o(mc,{isActive:n===e,onClick:t,type:l,item:n},String(a)),gc=d((({className:e,tabsType:t="default",items:l=[],value:n,onChange:a})=>o("div",{className:x("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tablist",children:l.map(pc(n,a,t))}))),xc={categories:[],extraOptions:[],propertyType:[],stage:[]},fc=bt((({className:e,hotFilters:t,filtrationSchema:l={},resetButton:n,...a})=>{const[s,{field:d,reset:m,update:h}]=Tt(xc),u=s===xc?a.block?.blocks:ys(a.block?.blocks,s)(),p=i(((e=xc)=>h(e)),[]),g=(({hotFilters:e=ac,filtrationState:t=ic,blocks:l=ac,onFiltrationStateChange:n})=>{const a=r((()=>Math.max(0,e.findIndex((e=>lc(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,appendRight:o(Jo,{version:t===e[a]?"primary":"secondary",count:ec(l,t.filter)})})))),[e,l,a]),c=i((t=>{n(e[s.indexOf(t)].filter)}),[e,s]);return{value:s[a],items:s,onChange:c}})({hotFilters:t,filtrationState:s,blocks:a.block?.blocks,onFiltrationStateChange:p});return c(b,{className:x("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...a,children:[o(gc,{...g}),Ns({field:d,reset:m,filtrationSchema:l,resetButton:n}),o(gs,{blocksToRender:u,...a})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}});function bc(e,t,l){t.geoObjects.removeAll();const n=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),a=new e.Clusterer({clusterIcons:[{href:"/icons/MapMarkerClusterIcon.svg",size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),i=l.map((t=>new e.Placemark(t,{},{iconLayout:"default#image",iconImageHref:"/icons/MapMarkerSingleIcon.svg",iconImageSize:[78,84],iconImageOffset:[-35,-50]})));a.add(i),t.geoObjects.add(a),t.setBounds(e.util.bounds.fromPoints(l)).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const yc={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center",font:"text-center font-sans"},vc=(e,t,l)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(yc).join(" ")} ${l}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.geoObjects.add(t.geoObjects)}))},children:o(H,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),Nc=e=>globalThis[e];const wc=()=>function(e,t){const[l,r]=n(),s=i((()=>r(Nc(e))),[e]);return a((()=>{const l=document.getElementById(t);if(!l){const e=document.createElement("script");return e.src=t,e.async=!0,e.id=t,e.addEventListener("load",s),document.head.appendChild(e),()=>{document.head.removeChild(e),r(void 0)}}if(!Nc(e))return l.addEventListener("load",s),()=>{l.removeEventListener("load",s)};s()}),[e,t]),l}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${z.YANDEX_MAP_API_KEY||""}&lang=ru_RU`),kc={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center",font:"text-center font-sans text-l"},Sc=d((({yandexMaps:e,direction:t="in"})=>{const l="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const l=e.current.getZoom(),n="in"===t?l+1:l-1;e.current.setZoom(n,{checkZoomRange:!0})},className:`${Object.values(kc).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(H,{name:l,width:"20",height:"16"})})})),Cc={border:"border border-transparent rounded-md ",position:"absolute flex items-center justify-center",size:"w-12 h-12",focus:"focus:border-primary-text focus:border",font:"text-center font-sans",active:"active:bg-primary-active",hover:"hover:bg-primary-hover",other:"select-none cursor-pointer"},Ic=[55.753995,37.614069],Tc=d((({points:e,className:t="",zoom:l=5})=>{const i=s(null),r=wc(),[d,m]=n();if(a((()=>{i?.current?r&&(bc(r,i.current,e),e?.length||i.current.setCenter(Ic)):r?.ready((()=>{i.current||(i.current=new r.Map("map",{center:e?Bc(e):Ic,zoom:l,controls:[],suppressMapOpenBlock:!0}),bc(r,i.current,e))}))}),[r,i,e,l]),!r)return null;const h=d?"z-[100000]":"z-10";return c("div",{id:"map",className:x(!d&&"relative","w-full",t),children:[o("div",{className:x(Object.values(Cc),h,"right-2 top-4 bg-white"),onClick:()=>{const e=i.current.container;d?e.exitFullscreen():e.enterFullscreen(),m(e.isFullscreen())},children:o(H,{name:"FullScreenIcon",width:"16",height:"16"})}),c("div",{className:x("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(Sc,{yandexMaps:i}),o(Sc,{yandexMaps:i,direction:"out"})]}),vc(i.current,r,x("right-2 top-80",h))]})})),Bc=e=>[Vc(Mc(e,0)),Vc(Mc(e,1))],Mc=(e,t)=>e.map((e=>e[t])),Vc=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Pc={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных"},Rc=(e,{field:t,reset:l})=>c("div",{className:"pb-2xl",children:[e?.length?o("div",{className:"flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",children:e.map((e=>o(gn,{text:Pc[e],...t(e)},e)))}):null,o(ue,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:l,text:"Очистить фильтр",appendRight:o(H,{name:"CloseIcon",width:"16",height:"16"})})]}),zc=()=>null,Ac=()=>[],Dc=d((({className:e,data:t=[],renderCard:l=zc,filterItems:n=Ac,initFilterState:a={},descriptionData:i,title:s})=>{const[d,{field:m,reset:h}]=Tt(a),[p,g,f]=r((()=>{const e=n(t,d),l=e.map((e=>[e.gpsLatitude,e.gpsLongitude].filter(Boolean))).filter((e=>e&&2===e.length));return[e,l,e.length]}),[t,d]);return c("div",{className:x("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-6xl pb-0",children:[c("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:[o(N,{headingType:"h2",children:s}),f?o(Pe,{size:"text-h2",color:"text-secondary-text",children:`(${f})`}):null]}),i?jc(i):null,Rc(Object.keys(a),{field:m,reset:h})]}),o("div",{className:"h-[600px]",children:o(u,{children:o(Tc,{points:g,className:"h-full"})})})]}),p.map(l)]})})),jc=({__html:e,list:t})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o(Me,{__html:e})}):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(J,{image:e.image}):null,e?.text?o(Pe,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,Fc={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"}},Ec=d((({className:e,children:t,color:l="gray"})=>c("div",{className:x("pt-2xl sm:p-s sm:border sm:border-gray rounded-md flex items-center",Fc[l].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(J,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(Pe,{size:"text-m",color:Fc[l].text,children:t})]}))),Lc=d((({value:e,subText:t,children:l,...n})=>{const a=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[a.length,l,t].every((e=>!e))?null:Oc({textItems:a,subText:t,children:l,...n})})),Oc=({label:e,labelSize:t="text-m",textItems:l,subColor:n,subText:a,className:i,children:r})=>c("div",{className:x("flex gap-2xl sm:gap-2xs flex-col h-full max-w-[300px]",i),children:[e?o(Pe,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||l.filter(Boolean).map(((e,t)=>o(Pe,{size:"text-l",children:e.trim()},String(t)))),a?o(Pe,{color:n,size:"text-m",children:a}):null]}),$c=d((({className:e,children:t})=>o("div",{className:x("sm:flex sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),_c=["ArrowDownIcon","ArrowUpIcon"],Uc=["Подробнее","Скрыть"],Hc=({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:Uc[Number(e)]}),o(H,{className:"text-primary-text",name:_c[Number(e)],width:"16",height:"16"})]}),Wc=({location:e,address:t,billAcceptorType:l,terminalType:n,billAcceptorEnable:a,atmCode:i="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:qc(n)},{label:"Модуль приема наличных",value:a?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===l?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:i}];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(Pe,{size:"text-h4",children:qc(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(H,{name:"GeolocationIcon",width:"24",height:"24"}),o(Pe,{size:"text-l",children:t})]}):null]}),o(Ec,{color:"green",children:qc(s)})]}),o("div",{className:"hidden sm:block",children:o($c,{className:"flex-wrap",children:m?.map(Kc)})}),o(li,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ni,{isUnfolded:e,children:o($c,{className:"flex-wrap",children:m?.map(Kc)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Hc({isUnfolded:e,onToggle:t})})]},String(d))},Kc=(e,t)=>o(Lc,{...e},String(t)),qc=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",Gc=[];const Yc=async e=>await ht(e,{method:"GET"})||Gc,Xc={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1},Qc={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable)},Zc=d((({data:e,className:t})=>{const[l]=Fs(),n=function(e){const{data:t=Gc}=ml(`/api/v1/atms?regionCode=${e}`,Yc);return t}(l?.code??"000");return o(Dc,{className:t,filterItems:Jc,data:n,initFilterState:Xc,renderCard:Wc,title:`Банкоматы филиала ${l?.name}`,descriptionData:e})})),Jc=(e,t)=>{const l=Object.keys(t).filter((e=>t[e])),n=l.filter((e=>e.startsWith("terminalType"))),a=l.filter((e=>!n.includes(e)));return e.filter((e=>{const t=a.every((t=>Qc[t](e))),l=!n.length||n.some((t=>Qc[t](e)));return t&&l}))},ed=e=>{const t=e.find((e=>"workingSaturday"!==e.key&&Boolean(e.status)&&Boolean(e.workTime))),l=e.find((e=>"workingSaturday"===e.key&&Boolean(e.status)&&Boolean(e.workTime))),n=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", "),a=[td({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:l?"":n}),td({workTime:l?.workTime,lunchHour:l?.lunchHour,daysOff:n},!0)].filter(Boolean);return o(Lc,{label:"Режим работы",value:a,className:"max-w-none"})},td=({workTime:e="",lunchHour:t="",daysOff:l=""},n=!1)=>e?[`${n?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",l?`не работает: ${l}`:""].filter(Boolean).join("; "):"",ld=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],nd=e=>ld.map((([t,l,n])=>({key:t,title:n,short:l,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??"")}}))),ad=e=>{if(!e)return null;const t=id(e);return c($c,{className:"border-none",children:[o(Lc,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(rd)})}),o(Lc,{label:"Режим работы",className:"max-w-none",children:o(Pe,{children:e})})]})},id=e=>{const t=ld.map((([,e])=>({short:e,status:!0}))),l=e.split("/")??[],n=l[l.length-1]?.toLowerCase();return n?.includes("выходной")?t.map((e=>({...e,status:!n?.includes(e.short.toLowerCase())}))):t},rd=({short:e,status:t},l)=>o("div",{className:x("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(Pe,{size:"text-xs",children:e})},String(l)),sd=({currency:e,buyExchangeRate:t,saleExchangeRate:l},n)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(Lc,{label:"Валюта",value:e.currency}):null,t?o(Lc,{label:"Купить",value:String(t)}):null,l?o(Lc,{label:"Продать",value:String(l)}):null]},String(n)),od=(new Date).getDay(),cd=e=>{const[t]=e?.slice(od-1)??[];if(!t)return null;const{lunchHour:l,status:n,workTime:a,hasLunch:i}=t;return n?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[a?o(Ec,{color:"green",children:a}):null,l&&i?o(Ec,{color:"yellow",children:`перерыв: ${l}`}):null]}):o(Ec,{color:"red",children:"Выходной"})},dd=({lunchHour:e,hasLunch:t=!1,status:l=!1})=>l?e&&t?`Перерыв ${e}`:e:"Не работает",md=({title:e,status:t,workTime:l,lunchHour:n,hasLunch:a},i)=>o(Lc,{label:e,value:t&&l?l:"",subText:dd({lunchHour:n,hasLunch:a,status:t}),subColor:!t||a?"text-error":"text-green-dark"},String(i)),hd=({name:e,address:t,phone:l,fax:n,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},h)=>{if(!d)return null;const u=nd(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(Pe,{size:"text-h4",children:e}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(H,{name:"GeolocationIcon",width:"24",height:"24"}),o(Pe,{size:"text-l",children:t})]}):null]}),cd(u)]}),o("div",{className:"hidden sm:block",children:ud({phone:l,fax:n,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(li,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ni,{isUnfolded:e,children:ud({phone:l,fax:n,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Hc({isUnfolded:e,onToggle:t})})]},String(h))},ud=({phone:e,fax:t,phoneBusiness:l,phoneNatural:n,phoneCallCentre:a,phoneCurrencyControl:i,workSchedule:r,exchangeRate:s})=>{const d=nd(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c($c,{className:"flex-wrap",children:[o(Lc,{label:"Факс",value:t}),o(Lc,{label:"Телефон филиала",value:e}),o(Lc,{label:"Для обращений юридических лиц",value:l}),o(Lc,{label:"Обслуживание физических лиц",value:n}),o(Lc,{label:"Для консультаций по валютному контролю",value:i}),o(Lc,{label:"Контакт-центр",value:a})]}),r?.isMatchesPattern?o($c,{children:o(Lc,{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(md)})})}):c($c,{children:[o(Lc,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(rd)})}),ed(d)]}),r?.businessScheduleVisibleTag?ad(r?.businessScheduleDescription):null,s?.currencies?.length?o($c,{className:"flex-wrap",children:s?.currencies?.map(sd)}):null]})},pd=[];const gd=async e=>await ht(e,{method:"GET"})||pd,xd={workingSaturday:!1},fd={workingSaturday:e=>Boolean(e.workSchedule?.workingSaturday)},bd=d((({className:e})=>{const[t]=Fs(),l=function(e){const{data:t=pd}=ml(`/api/v1/branches?regionCode=${e}`,gd);return t}(t?.code??"000");return o(Dc,{className:e,filterItems:yd,data:l,initFilterState:xd,renderCard:hd,title:`Офисы филиала ${t?.name}`})})),yd=(e,t)=>{const l=Object.keys(t).filter((e=>t[e]));return e.filter((e=>l.every((t=>fd[t](e)))))},vd=d((({data:e,className:t,...l})=>{const n=e?.dataType??"offices";return o(b,{version:"transparent",className:x(t),defaultPadding:"p-0",...l,children:"offices"===n?o(bd,{}):o(Zc,{data:e})})})),Nd=d((({className:e,size:t})=>o("figure",{className:x("m-0 mt-xl min-w-[80%]",e),children:wd(t)}))),wd=(e=3)=>Sd(100,e).map((e=>Math.floor(e))).map(kd),kd=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-light"},String(t)),Sd=(e,t)=>[e].concat(t>0?Sd(e/1.618,t-1):[]),Cd=d((({className:e,title:t,description:l="Блок в разработке...",...n})=>c(b,{className:x("box-border",e),...n,children:[o(S,{className:"max-w-[600px]",title:t,description:l,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(Nd,{})]}))),Id=d((({className:e,padding:t,slides:l=[],...n})=>o(b,{className:x("overflow-hidden relative",e),padding:t,...n,children:o(Qa,{gap:0,padding:0,children:l.map((e=>e.productBlock)).map(((e,t)=>o("div",{className:"box-border h-full",children:o(lt,{className:"px-5 h-full",headlineVersion:"L",...e,...n})},String(t))))})}))),Td=d((({address:e,email:t,telephone:l,button:n,className:a="",__html:i,icon:r,title:s,version:d="primary",...m})=>c(b,{className:x("box-border text-left space-y-s",a),version:d,...m,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[_e(r)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(J,{image:r})}):null,s?o(N,{headingType:"h3",as:"h3",title:s}):null]}),c("div",{className:"w-full space-y-m",children:[i?Bd(i):null,Md({label:"Адрес",data:e,iconName:"GeolocationIcon"}),Md({label:"Телефон(факс)",data:l,iconName:"PhoneIcon"}),Md({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),n?.text?Ue([n]):null]})]}))),Bd=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(Me,{__html:e})}),Md=({label:e,data:t,iconName:l,dataColor:n=""})=>t?c("div",{className:"flex gap-s",children:[o(H,{iconVersion:"black",name:l,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(Pe,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(Pe,{size:"text-xl",color:n,children:t})]})]}):null,Vd=d((e=>{const{__html:t,richVersion:l,...n}=e;return o(b,{defaultPadding:"p-0",...n,children:o(Me,{__html:t,richVersion:l})})})),Pd=d((({className:e=""})=>{const[t,l]=n("option2"),a=i((e=>l(e)),[]);return c("div",{className:x("order-4",e),role:"radiogroup",children:[o(la,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),o(la,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),Rd=d((({data:e,fieldLabel:t,fieldValue:l,selected:n,placeholder:a="",setSelected:i,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[l||t],text:e?.[t]}))),c=s.find((e=>e.key===n));return o(Nl,{options:s,label:r,placeholder:a||n,onChange:e=>i(e.key),value:c})})),zd=d((({regions:e=[],selectedRegion:t,onSelectedRegion:l,branches:n=[],selectedBranch:a,onSelectedBranch:i})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Rd,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:l,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(Rd,{data:n,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:i,label:"Отделение",placeholder:"Выберите отделение"})})]}))),Ad=["От 1 дня","До 365 дней"],Dd=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Pe,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(Jl,{min:1,max:365,value:e,items:Ad,onChange:t})]}))),jd=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:l,safeBoxCases:n=[],selectedBoxSize:a,onSelectedBoxSize:i})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Rd,{data:e,fieldLabel:"volume",selected:t,setSelected:l,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(Rd,{data:n,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:i,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),Fd=d((({regions:e,selectedRegion:t,branches:l,selectedBranch:n,days:a,selectedCaseVolume:i,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:h})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(zd,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:l,selectedBranch:n,onSelectedBranch:Ed(m)}),o(Dd,{days:a,setDays:e=>m({days:e})}),o(jd,{caseVolumes:d,selectedCaseVolume:i,onSelectedCaseVolume:Ld(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(Pe,{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(Pd,{}),o(ue,{text:"Офисы на карте",version:"primary",onClick:h,className:"order-6"})]})]}))),Ed=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},Ld=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},Od=d((({days:e,tariffs:t=[]})=>{const l=_d(e,t),n="На рисунке изображена пачка листов\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:[$d("Аренда за",e),$d("Цена",l+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:n})}),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(J,{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:n})})]})]})})),$d=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(Pe,{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})]}),_d=(e,t)=>{const l=Ud(e);return e*(t?.find((e=>e.tariffType===String(l)))?.tariffValue||0)},Ud=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},Hd=(e,t)=>e.find((e=>e.branchCode===t)),Wd=d((e=>{const{regions:t,data:l,branches:n,onChange:i,onClick:r}=e;a((()=>{i({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[l.selectedRegion,i]);const s=Hd(n,l.selectedBranch),d=Kd(s?.safeBoxCaseVolumes),m=qd(s?.safeBoxCaseVolumes,l.selectedCaseVolume)?.safeBoxCases,h=Gd(m,l.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(Fd,{...l,regions:t,onClick:r,branches:n,caseVolumes:d,safeBoxCases:m,onChange:i}),o(Od,{days:l.days,tariffs:h})]})})),Kd=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],qd=(e,t)=>e?.find((e=>e.volume===t)),Gd=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Yd=[];const Xd=async e=>await ht(e,{method:"GET"})||Yd,Qd=d((({title:e,footnote:t,className:l="",...a})=>{const[r,s]=n(!1),d=i((()=>s((e=>!e))),[]),[m,h]=n({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),u=ul(),p=Zd(m.selectedRegion,u),g=function(e){const{data:t}=ml(e?`/api/v1/safeboxes?regionCode=${e}`:null,Xd);return t||Yd}(p),x=i((e=>h((t=>({...t,...e})))),[h]),f=(y=Hd(g,m.selectedBranch)||g,Array.isArray(y)?y.map((e=>e.gpsLatitude&&e.gpsLongitude?[e.gpsLatitude,e.gpsLongitude]:[])):y?.gpsLatitude&&y?.gpsLongitude?[[y.gpsLatitude,y.gpsLongitude]]:[]);var y;return c(b,{className:l,defaultPadding:"",...a,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(N,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(Wd,{regions:u,branches:g,data:{...m,selectedRegion:p},onClick:d,onChange:x}),t?o(w,{size:"text-s",font:"font-light",children:t}):null]}),f.length&&r?o(Tc,{points:f,className:"h-[640px]"}):null]})})),Zd=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e;function Jd(e){throw new Error(e)}const em={normal:{icon:"h-11 w-11",image:"h-14 w-14"},small:{icon:"h-12 w-12",image:"h-14 w-14"}},tm={normal:"",small:"min-h-6xl"},lm={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"},nm=d((({className:e="",title:t,description:l,steps:n,buttons:a,size:i="normal",stepVersion:r="gray",version:s="primary",...d})=>c(b,{className:x("box-border flex flex-col gap-xl",e),defaultPadding:"p-6xl",version:s,...d,children:[o(S,{title:t,description:l,headlineVersion:"M",isEmbedded:!0,align:"text-left"}),n?.length?o("div",{className:"box-border",children:o("div",{className:"flex flex-col gap-6xl justify-between",children:n.map(am(i,r))})}):null,Ue(a,{isVertical:!0})]}))),am=(e,t)=>(l,n)=>{const{type:a}=l;if("default"!==a&&"rte"!==a)return null;switch(a){case"default":return im(e,t)(l,n);case"rte":return o(Me,{__html:l.__html});default:Jd(l)}},im=(e,t)=>(l,n)=>o("div",{className:"contents",children:c("div",{className:"flex flex-row items-center relative",children:[o("div",{className:"overflow-hidden flex flex-shrink-0 items-center",children:rm(e,t)(l,n)}),c("div",{className:x("flex flex-col justify-center h-fit",tm[e]),children:[l.label?o(w,{size:"text-l",align:"text-left",children:l.label}):null,l.description?o("div",{className:x("text-s font-light text-left",lm.description),children:l.description}):null]})]})},String(n)),rm=(e,t)=>(l,n)=>{const a="secondary"===t?"white":"color",i=Boolean(l?.icon?.src),r=em[e][i?"image":"icon"],s=i?"transparent"===t:t;return o(b,{className:x(r,"z-10 mr-s flex justify-center content-center rounded-md"),defaultPadding:"",version:s,children:o("span",{className:"flex max-w-full max-h-full items-center justify-center",children:_e(l?.icon)?o(J,{image:{...l.icon,iconVersion:l.icon?.iconVersion||a},imageClassName:"max-w-full max-h-full",width:sm(e),height:sm(e)}):o("span",{className:x("text-h4","transparent"===t?lm.iconText:(c=t,"secondary"===c?"group-data-primary:text-white":"text-secondary-text")),children:n+1})})});var c},sm=e=>"normal"===e?"38":"24",om=e=>({href:t})=>!!t&&j(cm(t,e)).startsWith(j(t)),cm=(e,t)=>A(e)?t.href:t.pathname;function dm(e=[]){const t=g(),l=e.findIndex((e=>om(z.BASE_PATH?{pathname:z.BASE_PATH}:e))(t));return[l,e[l]]}const mm=d((({isActive:e,onClick:t})=>c("button",{className:x(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),onClick:t,type:"button",children:[o(H,{className:"w-6 h-6",name:"BurgerIcon",iconVersion:e?"color":"black"}),"Меню"]}))),hm=d((({isActive:e,item:t,onClick:l})=>{const n=oe({isRemote:!0}),{href:a,onClick:i}=n({href:t?.href,onClick:l});return c("a",{className:x(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),href:a,target:"_self",title:t?.title||"",onClick:i,children:[o(H,{className:"w-6 h-6",name:t?.icon?.icon,iconVersion:e?"color":"black"}),t?.title||""]})}));const um=({onCloseAll:e,onClose:t}={})=>{const[l,{push:r,pop:s,clear:o}]=function(e=[]){const[t,l]=n(e),a=i((e=>l((t=>[...t,e]))),[]),r=i((()=>l((e=>e.slice(0,-1)))),[]),s=i((e=>l((t=>t.filter((t=>t!==e))))),[]),o=i((()=>l([])),[]);return[t,{setList:l,push:a,pop:r,remove:s,clear:o}]}(),c=i((()=>{e&&e(l),o()}),[l,e]),d=i((()=>{t&&t(l[l.length-1]),s()}),[l,t]);return a((()=>p.subscribe("dialog",(e=>{switch(e.type){case"open":r(e);break;case"close":e.all?c():d();break;default:Jd(e)}}))),[c,d]),l},pm=d((({className:e,onClose:t})=>o("button",{className:x("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",type:"button",children:o(J,{image:{icon:"CloseIcon"},width:"24",height:"24"})}))),gm=d((({className:e,head:t,children:l,onClose:n})=>{const{close:a}=re(),r=i((()=>{a(),n&&n()}),[n]);return c("div",{className:x("relative min-h-full bg-white pt-0 p-5",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(pm,{className:"absolute top-0 right-0",onClose:r}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:l})]})})),xm=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:l,s1Matches:n,s2Matches:a}=function(e,t){const l=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),n=Array.from({length:e.length}),a=Array.from({length:t.length});let i=0;for(let r=0;r<e.length;r++){const s=Math.max(0,r-l),o=Math.min(r+l,t.length-1);for(let l=s;l<=o;l++)n[r]||a[l]||e[r]!==t[l]||(i++,n[r]=!0,a[l]=!0)}return{m:i,s1Matches:n,s2Matches:a}}(e,t);if(0===l)return 0;const i=function(e,t,{s1Matches:l,s2Matches:n}){let a=0;for(let i=0,r=0;i<e.length;i++){if(!l[i])continue;let s=r;for(;s<t.length;s++)if(n[s]){r=s+1;break}e[i]!==t[s]&&a++}return a}(e,t,{s1Matches:n,s2Matches:a}),r=(l/e.length+l/t.length+(l-i/2)/l)/3,s=r>.7?.1*function(e,t){let l=0;for(;e[l]===t[l]&&l<4;)l++;return l}(e,t):0;return r+s*(1-r)};const fm=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(Pe,{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(bm,{...e},String(t))))})]}):null,bm=d((({icon:e,...t})=>{const l=oe(),{text:n,target:a,href:i,onClick:r}=l(t);return c("div",{className:"flex gap-s items-center",children:[e?o(J,{pathPrefix:"/wcms-resources/",image:e}):null,n?o("a",{className:"hover:text-primary-hover",href:i,target:a,onClick:r,children:o(Pe,{size:"text-l",font:"font-light",color:"text-primary-text",children:n})}):null]})})),ym=e=>t=>o("div",{className:"mb-xs sm:mb-2xs",children:o("button",{className:"cursor-pointer hover:text-primary-hover",onClick:()=>{e&&e(t)},type:"button",children:o(Pe,{size:"text-l",font:"font-light",children:t.name||""})})},t.id),vm=d((({className:e,searchTerm:t,onSearch:l})=>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:"h-12 pl-m w-full peer text-l text-black border border-solid rounded-md box-border\n outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text",value:t,onChange:e=>l(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),Nm=d((({foreignOffices:e,defaultLocation:t})=>{const[l,a]=Fs(t),[r,s]=n(""),d=km(ul()).sort(((e,t)=>e.name.localeCompare(t.name))),m=((e,t)=>{const l=new Map;for(const n of e){const e=t(n),a=l.get(e)||[];l.set(e,[...a,n])}return l})(d,wm),{close:h}=re(),u=i((e=>{a(e),h()}),[]);return c(gm,{className:"pb-20",head:c("div",{children:[o(Pe,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),l?c("div",{className:"mb-s",children:[o(Pe,{size:"text-l",font:"font-light",children:"Сейчас выбран: "}),o("button",{type:"button",onClick:()=>a(l),children:o(Pe,{color:"text-primary-main",children:l.name})})]}):null,o(vm,{onSearch:s,searchTerm:r})]}),children:[r&&r.length>=3?o("div",{children:d.filter((({name:e})=>e&&xm(e.toLowerCase())(r.toLowerCase())>=.8)).map(ym(u))}):o("div",{className:"columns-1 sm:columns-5",children:Array.from(m.entries()).map((p=u,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(Pe,{size:"text-h6",children:e})}),t.map(ym(p))]},e)))}),fm(e)]});var p})),wm=e=>e.name?.charAt(0)||"",km=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()||""}))),Sm=d((({className:e,value:t,autoFocus:l,onChange:n,onFocus:a,placeholder:r="Поиск по сайту"})=>{const s=i((e=>{n&&n(e.target?.value||"")}),[n]);return c("div",{className:x("font-sans relative",e),role:"form",children:[o("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:o(J,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),o("input",{className:x("h-14 w-full px-10 text-l text-black outline-none box-border border border-solid rounded-md","border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text"),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:l,onChange:s,onFocus:a})]})}));function Cm(e,t,l=300){a((()=>{const t=globalThis.setTimeout(e,l);return()=>{globalThis.clearTimeout(t)}}),t)}const Im=(e,t)=>(l,n)=>{for(const[a,i]of n)l.set(a,e(l.get(a)||t,i));return l},Tm=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),Bm=e=>t=>e.map((([e,l])=>[xm(t)(e),l])).filter((([e])=>e>=.8)).map((([e,t])=>Vm(t,e))).reduce(Im(Math.max,0),new Map),Mm=e=>t=>{return Bs(t,t.map((({title:e})=>e)).map((e=>t=>{const l=Tm(t||"");return l.length?Ie(e.map((e=>Wa(l.map(xm(e)))))):0})(e))).sort((e=>(t,l)=>-e(t,l))((l=([,e])=>e,(e,t)=>l(e)-l(t)))).map((([e])=>e));var l},Vm=(e,t)=>new Map(e.map((e=>[e,t]))),Pm=({basePathList:e,initialQuery:t=""})=>{const[l,i]=n(t||"");a((()=>{null!=t&&i(t)}),[t]);const{data:r}=ml(e?.length?e:null,Rm),[s,o]=n(null);return Cm((()=>{r&&o(r.map((e=>t=>{const{corpus:l,dictionary:n}=t||{};if(!(e&&l?.length&&n&&Object.keys(n).length))return[];const a=Tm(e);if(!a.length)return[];const i=Object.entries(n),r=[...a.map(Bm(i)).reduce(Im(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*a.length)).map((([e])=>l[e]));return Mm(a)(r)})(l)))}),[r,l]),[s,{value:l,onChange:i}]},Rm=async(...e)=>(await Promise.allSettled(e.map((e=>ht(F(e,"/","search.index.json")))))).map((e=>"fulfilled"===e.status?e.value:{})),zm=d((({className:e,topItems:t})=>{const l=oe({isRemote:!0});return o("div",{className:x("flex items-start justify-between",e),children:t?.map(l).map(Dm)})})),Am=["all","footer"],Dm=(e,t)=>{const{text:l,items:n=[],href:a,target:i,onClick:r}=e,s=n.filter((e=>!e.displayArea||Am.includes(e.displayArea.toLowerCase())));return c("div",{className:"flex flex-col gap-s w-1/4",children:[o("a",{className:"leading-5 text-l text-primary-text hover:text-primary-main no-underline",href:a,target:i||"_self",onClick:r,children:l||`Раздел ${t}`}),s.map(((e,t)=>o(jm,{...e,basePath:P(a),index:t},String(t))))]},String(t))},jm=d((({text:e,index:t,basePath:l,...n})=>{const a=oe({isRemote:!(!z.BASE_PATH||!l)&&!z.BASE_PATH.startsWith(l),basePath:l}),{href:i,target:r,onClick:s}=a(n);return o("a",{className:x("text-l font-light text-secondary-text hover:text-primary-main no-underline","overflow-x-hidden overflow-ellipsis whitespace-nowrap"),href:i,target:r||"_self",onClick:s,children:e||`Раздел ${t}`})})),Fm=d((({initialQuery:e,topItems:t})=>{const l=r((()=>t?.map((e=>e.href||"/"))),[t]),[n,a]=Pm({basePathList:l,initialQuery:e}),i=r((()=>Em(t)(n)),[t,n]);return o(gm,{head:o(Sm,{autoFocus:!0,...a}),children:o(zm,{topItems:i})})})),Em=e=>t=>e?.length&&t?.length?Bs(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:F("/",t)})))}))):[],Lm=d((({className:e,...t})=>{const[l,a]=n(""),r=i((()=>a("")),[]),s=((e={})=>{const{open:t,close:l}=re();return{open:(l={},n={})=>t(o(Fm,{...e,...l}),n),close:l}})(t),d=i((e=>{a(e),Om(e)&&s.open({initialQuery:e},{onClose:r})}),[r,s]);return c("div",{className:x("relative",e),role:"search",children:[o(Sm,{value:l,onChange:d}),o(pm,{className:"absolute top-0 right-0 sm:hidden",onClose:r})]})})),Om=e=>e&&e.length>=3,$m=d((({item:e,basePath:t})=>{const l=oe({isRemote:!(!z.BASE_PATH||!t)&&!z.BASE_PATH.startsWith(t),basePath:t}),{href:n,target:a,onClick:i}=l(e),r=g(),s=om(r)({href:n});return c("a",{className:x(s?"text-primary-main":"text-primary-text","py-3 text-h5 font-light flex justify-between cursor-pointer"),href:n,target:a,onClick:i,children:[e.text,o(J,{image:{icon:"ChevronLeftIcon",iconVersion:"black"},width:"24",height:"24",className:"text-secondary-text rotate-180 opacity-30"})]})})),_m=({item:e,isActive:t,onClick:l})=>c("button",{type:"button",className:"relative",onClick:l,children:[o("span",{className:x("whitespace-nowrap",t?"text-primary-main":""),children:e.text}),t?o("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-transparent"}):null]}),Um=d((e=>{const{topItems:t,defaultLocation:l,officesLink:s}=e,[d]=Fs(l),m=(e=>{const{open:t,close:l}=re();return{open:(l={})=>t(o(Nm,{...e}),l),close:l}})(e),[h,u]=Xa({itemCount:t?.length??0}),[p]=dm(t),[g,x]=n(p),f=r((()=>t?.[g]),[t,g]),b=f?.items||[];a((()=>{x(p)}),[p]),a((()=>{g>0&&u.scrollTo(g)}),[g,u]);const y=i((e=>x(e)),[]);return o(gm,{head:o("div",{className:"flex items-center",children:o(N,{as:"h4",title:"Меню"})}),children:c("div",{className:"flex flex-col flex-nowrap relative w-full h-auto m-auto bg-white pb-24 box-border rounded-md",children:[o("div",{className:"w-full mb-3",children:o(Fa,{containerRef:h,visibleItemCount:0,gap:20,className:"pb-3",children:t?.map(((e,t)=>o(_m,{item:e,isActive:g===t,onClick:()=>y(t)},String(t))))})}),c("div",{className:"relative grow overflow-auto",children:[Hm(b,f?.href),o(Lm,{className:"grow mb-5",...e}),Wm(s),Km(d,(()=>m.open()))]})]})})})),Hm=(e,t)=>e?o("div",{children:e.map(((e,l)=>o($m,{item:e,basePath:t},String(l))))}):null,Wm=e=>e?c("a",{className:"flex items-center mb-3",href:e,rel:"noopener noreferrer","aria-label":"Офисы и банкоматы",children:[o(J,{image:{icon:"MapOpenedIcon",iconVersion:"black"},width:"24",height:"24",className:"text-primary-main box-border mr-xs bg-main-divider p-xs rounded-md"}),o("span",{children:"Офисы и банкоматы"})]}):null,Km=(e,t)=>c("div",{className:"flex items-center text-s cursor-pointer",onClick:t,children:[o(J,{image:{icon:"GeolocationIcon",iconVersion:"black"},width:"24",height:"24",className:"text-primary-main box-border mr-xs bg-main-divider p-xs rounded-md"}),c("div",{className:"flex flex-col items-start",children:[o(Pe,{size:"text-h5",children:e.name}),o(Pe,{color:"text-secondary-text",size:"text-s",children:"Ваша локация"})]})]}),qm="burgerMenuDialog",Gm=e=>{const{open:t,closeAll:l,close:n}=re(),a=um(),i=((e,t)=>Boolean(t.find((t=>t.id===e),e)))(qm,a),r=()=>t(o(Um,{...e}),{id:qm});return[i,{open:r,close:n,toggle:()=>{i?l():r()}}]},Ym=[],Xm=bt((({sticky:e,...t})=>{const{menuItems:l=Ym}=e??{},[n,{toggle:a,close:i}]=Gm(t.options?.page?.sitemap??{}),[,r]=dm(l),s=Math.floor(l.length/2),d=l.slice(0,s),m=l.slice(s);return o(b,{className:"h-[74px]",defaultPadding:"p-0",...t,children:c("div",{className:"ml-auto container bg-white flex justify-center shadow-blue-gray",children:[d.map(Qm(r,i)),o(mm,{isActive:n,onClick:a}),m.map(Qm(r,i))]})})})),Qm=(e,t)=>(l,n)=>o(hm,{isActive:l===e,item:l,onClick:t},l.href||String(n)),Zm="hidden sm:flex absolute z-40 top-0",Jm=d((({className:e,items:t=[],value:l,onChange:n,tabsType:a})=>{const[i,r]=Xa({itemCount:t?.length||0});return c("div",{className:x("relative overflow-x-auto no-scrollbar",e),role:"tablist",children:[o(Fa,{containerRef:i,snapAlign:"snap-start",onVisibleIndicesChange:r.handleVisibleIndicesChange,children:t.map(pc(l,n,a))}),r.canScrollLeft?o(xr,{className:x("left-6",Zm),onClick:r.scrollLeft}):null,r.canScrollRight?o(fr,{className:x("right-6",Zm),onClick:r.scrollRight}):null]})})),eh=({tabsMode:e,...t})=>{switch(e){case"wideScreen":return o(gc,{...t});case"centered":return o("div",{className:"flex",children:o(gc,{className:"m-auto p-xs rounded-md bg-main-gray",tabsType:"rounded",...t})});case"scrollable":return o("div",{className:"flex",children:o(Jm,{className:"m-auto",tabsType:"underlined",...t})});default:return null}},th="tab",lh=d((({className:e="",isSticky:t,tabs:l=[],tabsMode:s,...c})=>{const d=g(),{isReady:m}=d,h=r((()=>l.map(ah)),[l]),[u,f]=n(0);a((()=>{if(!l||!l[0])return;const e=d.query.tab&&l.findIndex((e=>"group"===e.type&&e.ref===d.query.tab))||0,t=l[e]||l[0];f(e),nh(t)}),[m]),a((()=>{const e=l[u];"group"===e?.type&&p.subject("tab",{type:e.type,label:e.ref,groupName:e.name})}),[l,u]);const y=i((e=>{const t=h.indexOf(e),n=l[t];f(t),nh(n),"group"===n.type&&(e=>{const t=new URLSearchParams(d.query);e.name?t.set(th,e.name):t.delete(th),d.replace(`${d.pathname}?${t}`,"",{scroll:!1})})(e)}),[l,h]);return o(b,{className:x(t?"sticky top-1 z-20":"",e),defaultPadding:"p-0",...c,children:eh({items:h,value:h[u],tabsMode:s,onChange:y})})})),nh=e=>{"group"===e.type&&p.fire("tab",{type:e.type,label:e.ref,groupName:e.name}),"link"===e.type&&p.fire("tab",{type:e.type,label:e.href})},ah=e=>"group"===e?.type?{text:e.title,name:e.ref}:e,ih={start:"text-start",center:"text-center",end:"text-end"},rh=d((({tab:e,className:t,onClick:l,isActive:n})=>{const a=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white text-primary-text"),title:e?"mb-xs text-xl":"mb-2xs text-l",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal"}))(n);return c("button",{type:"button",onClick:l,"aria-label":e?.title,className:x("border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs",a.btn,t),children:[e?.icon?o(J,{className:x("h-6 w-6 min-w-6 min-h-6",a.icon),image:{...e?.icon,iconVersion:e?.icon?.iconVersion??a.iconVersion},width:"24",height:"24"}):null,c("div",{className:"border-0",children:[e?.title?o("div",{className:a.title,children:e.title}):null,e?.description?o("div",{className:a.desc,children:e.description}):null]})]})})),sh=d((({tab:e})=>{const t=oe(),{onClick:l}=t({...e,onClick:()=>{e.href&&!D(e.href)&&(globalThis.location.href=e.href)}});return Cm(l,[],800),o(Nd,{className:"col-span-12 p-xl",size:5})})),oh=bt((({className:e="",tabs:t=[],block:l,tabAlign:a,...i})=>{const[r,s]=n(dh(t)),d=ch(t[r],r),m=t.length,[h,{inc:u,dec:p}]=pr({itemCount:m},r),[g,f]=Xa({itemCount:m});return c(b,{className:x(e),defaultPadding:"p-0",...i,children:[c("div",{className:"relative border-b-8 border-primary-main",children:[o(Fa,{itemClassName:"flex",containerRef:g,snapAlign:"snap-end",gap:8,onVisibleIndicesChange:f.handleVisibleIndicesChange,children:t.map(mh(r,s,a))}),o(vr,{scroll:f,arrowsPadded:!0,onScrollLeft:p,onScrollRight:u,activeIndex:h,itemCount:m})]}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:t[r]?.href?o(sh,{tab:t[r]}):M(l?.slots?.[d],{...i?.options,slotName:d,parent:l})})]})}),{slots:({tabs:e})=>e?.filter((e=>!e.href)).map(ch)||[],childrenTypes:{exclude:["TabsLayout"]}}),ch=(e,t)=>e?.title||`Слот №${t}`,dh=e=>e.reduce(((e,t,l)=>t.selected?l:e),0),mh=(e,t,l="start")=>(n,a)=>o(rh,{className:ih[l],tab:n,isActive:e===a,onClick:()=>t(a)},String(a)),hh={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},uh=d((({children:e,activeIndex:t,columnWidth:l,version:n="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:hh[n],style:{transform:`translateX(-${t*l}px)`},children:e})}))),ph=d((({className:e="",isOpen:t,onClick:l})=>o(ue,{className:e,appendRight:o(J,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"20",height:"20"}),text:t?"Скрыть":"Показать",version:"gray",onClick:l}))),gh={Buttons:({buttons:e})=>Ue(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(J,{image:e}):null,List:({isDotted:e,...t})=>o(Ye,{className:"flex flex-col justify-between items-start text-h6",isDotted:e??!0,...t}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(Pe,{size:"text-h6",children:e})}):null,t?o("div",{children:o(Pe,{size:"text-l",color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,dataUrl:l,pdfUrl:n,isOpen:a})=>e?o(ph,{isOpen:a,onClick:()=>{t({dataUrl:l,pdfUrl:n})}}):null},xh=d((({cell:e,fieldIdx:t,rowIdx:l,cellIdx:i,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=n(!0);a((()=>{i===o&&s||m(!0)}),[s,o]);return fh({cell:e,cellProps:{rowIdx:l,cellIdx:i,fieldIdx:t,displayTable:e=>{m(!1),c(i),r(e)},isVisible:d}})})),fh=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:l,...n}=e;if(!l||!(l in gh))return null;return o(gh[l],{...t,...n})},bh=d((({cells:e,rowIdx:t,cellIdx:l,setTableInner:n,tableInner:a,openTableInnerIdx:i,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(xh,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:l,setTableInner:n,tableInner:a,openTableInnerIdx:i,setOpenTableInnerIdx:r},String(s)))):null}))),yh=(e,t)=>140*Ie(e.slice(0,t).map((e=>e?.cols?.length??1))),vh=(e,t)=>e?.length>0?o("div",{className:x("flex",0===t?"text-secondary-text":""),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(Pe,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,Nh=d((({rows:e})=>{return o(Fa,{visibleItemCount:0,snapAlign:"snap-start",children:o("div",{children:e?.map((t=0,(e,l)=>{if(!e?.length)return null;const[n,...a]=e,i=x("flex duration-1000 text-center",0!==l?"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(Pe,{size:"text-xl",font:"font-light",children:n.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:i,style:{transform:`translateX(-${yh(a,t)}px)`},children:a?.map(((e,l)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(Pe,{size:"text-xl",children:e.data}):null,e?.cols?vh(e.cols,t):null]},`row${l}`)))})})]},String(l))}))})});var t})),wh=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,l)=>{const n=`activeTabIdx:${e}-tableIdx:${l}`;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(Pe,{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(Nh,{rows:t.rowsData})})})]},n)}))}))),kh=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Sh=d((({currencies:e,linkToPDF:t,activeTabIndex:l,setActiveTabIndex:n})=>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:x("rounded-md px-4 py-3 cursor-pointer",t===l?"bg-primary-main":""),onClick:()=>n(t),children:o(Pe,{size:"text-xl",font:"font-light",color:kh(t===l),children:e||t+1})},e)))}):null,t?o(ue,{className:"text-primary-main",href:t,version:"link",target:"_blank",appendLeft:o(H,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]})));async function Ch(e){const t=await fetch(e);return await t.json()}const Ih=d((({dataUrl:e,pdfUrl:t,onClick:l})=>{const{tableData:a}=function(e){const{data:t}=ml(function(e){return`/wcms-resources/${e||"tariffs-inner-table-data"}.json`}(e),Ch);return t||{}}(e),[r,s]=n(0),d=i((e=>s(e)),[]),m=a?.[r]?.items??[],h=a?.map((e=>e.currency??""));return c("div",a?{className:"bg-white z-10",children:[o(Sh,{currencies:h,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(wh,{activeTabIndex:r,items:m}),o(ph,{className:"mt-xl",onClick:l,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Pe,{size:"text-h6",children:"Данных нет"}),o(ph,{onClick:l,isOpen:!0})]})})),Th=d((({children:e,tableInner:t,onHideContentClick:l})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:x("@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(Ih,{...t,onClick:l})}):null]}))),Bh=d((({row:{header:e,data:t},activeIndex:l,rowIdx:a,...r})=>{const[s,d]=n(void 0),m=i((e=>d(e)),[]),[h,u]=n(void 0),p=i((e=>u(e)),[]);return c(Th,{onHideContentClick:()=>d(void 0),tableInner:s,...r,children:[o("div",{className:x("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(J,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(Pe,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(uh,{activeIndex:l,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(bh,{cells:e,rowIdx:a,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:p,...r},String(t))))}):null]})}));function Mh({dec:e,inc:t,canDec:l,canInc:n,btnClass:a,className:i=""}){return l||n?c("div",{children:[l?o(gr,{className:x("absolute z-40",a[0],i),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!l}):null,n?o(gr,{className:x("absolute z-40 rotate-180",a[1],i),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!n}):null]}):null}const Vh=d((({children:e,controls:t})=>{const{isScrollAvailable:l}=t;return c("div",{role:"table",children:[c("div",{className:"relative space-y-xs",children:[e,Mh({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),l?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),Ph=d((({className:e="",title:t,description:l,rowHeaders:n,tariffsColumns:a,hiddenRowsNum:i=0,...r})=>{const s=a?.map((({data:e})=>e))||[],d=n?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=s.length,[h,u]=pr({itemCount:m,visibleItemCount:2}),p=(d||[]).map(((e,t)=>o(Bh,{row:e,activeIndex:h,rowIdx:t,...r},String(t)))),[g,f]=i>0?[p.slice(0,-i),p.slice(-i)]:[p,[]];return c(b,{className:x("overflow-hidden relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...r,children:[o(S,{title:t,description:l,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m",children:i>0?o(li,{renderFoldableSection:({isUnfolded:e})=>c(Vh,{controls:u,children:[g,o(ni,{isUnfolded:e,children:f})]}),renderFoldButton:Or}):o(Vh,{controls:u,children:p})})]})})),Rh=d((({className:e="",title:t,description:l,iconVersion:n,__html:a,...i})=>c(b,{className:x("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...i,children:["small"===n?zh():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Pe,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,l?Ah(l):null,a?o(Me,{__html:a}):null]})]}))),zh=()=>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"}),Ah=e=>o(w,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),Dh=d((({prefix:e,unit:t,suffix:l})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(Pe,{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,l?o("div",{className:"gradient-color-text",children:o(Pe,{size:"text-h2",children:l})}):null]}))),jh=d((e=>{const{prefix:t,unit:l,suffix:n,...a}=e;return o(b,{defaultPadding:"p-0",...a,children:o(Dh,{prefix:t,unit:l,suffix:n})})})),Fh={AdTile:vt,ApplicationForm:ua,ApplicationFormCustom:Ia,BenefitsBlock:Pa,BonusBenefitsBlock:Ja,ButtonsBlock:ti,Calculator:ar,CardTransfer:ur,Carousel:Vr,CarouselBankHistoryCard:Pr,CarouselCard:Ar,CarouselCatalogCard:jr,CarouselLinks:_r,CarouselRecommendationCard:Yr,CarouselTariffsCard:Zr,ComparisonTable:cs,DepositFiltration:zs,ErrorBlock:Ds,ExchangeRateTile:ro,Footer:Co,Header:Eo,Headline:S,HorizontalLayout:$o,ImgBlock:_o,LinkDocs:qo,MobileAppTile:Xo,MortgageFiltration:fc,OfficesAtmsMap:vd,Placeholder:Cd,ProductBlock:yt,ProductGallery:Id,RepresentativeOfficeInfo:Td,RichTextBlock:Vd,RollupItem:mo,SafeDepositRental:Qd,StepsBlock:nm,StickyBottomMenu:Xm,Tabs:lh,TabsLayout:oh,TariffsTable:Ph,TextBlock:Rh,UnitBlock:jh,VerticalLayout:Oo},Eh="rshb-query-params";const Lh=e=>{const t=function(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(Eh)||"";return e&&globalThis.sessionStorage?.setItem(Eh,e),e}();if(!A(e)||!t)return e;const l=new URL(e);for(const[e,n]of new URLSearchParams(t))l.searchParams.set(e,n);return l.toString()},Oh=e=>{const t=e.target;if("A"===t?.tagName&&A(t.href)){e.preventDefault();const l=Lh(t.href)||t.href;globalThis.location.href=l}},$h="cookie",_h=d((({termLink:e,personalDataPolicyLink:t})=>{const[l,{setTrue:n,setFalse:a}]=pl();Cm((()=>{globalThis.localStorage?.getItem($h)||n()}),[],3e3);const r=i((()=>{globalThis.localStorage?.setItem($h,"true"),a()}),[]);return l?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:c(w,{size:"text-s",font:"font-light",color:"text-primary-text",children:["АО «Россельхозбанк» использует",o(Wr,{isRemote:!0,className:Uh(e?.href),...e,children:"cookie"}),"(файлы с данными о прошлых посещениях сайта) для персонализации сервисов и удобства пользователей. Вы можете запретить сохранение cookie в настройках своего браузера.",o(Wr,{isRemote:!0,className:Uh(t?.href),...t,children:"Обработка Ваших персональных данных"}),"производится в соответствии с требованиями Федерального закона от 27.07.2006 № 152-Ф3 «О персональных данных»."]})}),o("div",{className:"ml-s sm:ml-0 w-24 flex justify-end",children:o(pm,{className:"bg-main-gray rounded-md",onClose:r})})]})}):null})),Uh=e=>x("inline mx-2xs",e?"text-green-dark":""),Hh=d((()=>{const e=i((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=i((e=>{e?.onClose&&e.onClose()}),[]),l=um({onCloseAll:e,onClose:t}),{close:n}=re(),r=i((({key:e})=>{"Escape"===e&&n()}),[]);return xl(globalThis.document,"keydown",r),a((()=>{l.length?(globalThis.document?.body.classList.add("no-scrollbar"),globalThis.document?.body.classList.add("overflow-hidden")):(globalThis.document?.body.classList.remove("no-scrollbar"),globalThis.document?.body.classList.remove("overflow-hidden"))}),[l]),l.length?o("div",{className:"fixed inset-0 z-50",role:"dialog",children:l.map((({dialog:e,id:t},n)=>o("div",{className:x("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar",n===l.length-1?"":"hidden"),children:e},String(t||n))))}):null})),Wh=d((()=>{const[e,t]=n(null),l=i((()=>{t(null)}),[]);a((()=>p.subscribe("popup",(e=>{switch(e.type){case"open":case"update":t(e);break;case"close":l();break;default:Jd(e)}}))),[]);const r=i((({key:e})=>{"Escape"===e&&l()}),[l]);return xl(globalThis.document,"keydown",r),e?o("div",{className:"absolute z-50",style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",children:e.popup}):null})),Kh="header",qh="footer",Gh="sticky-footer",Yh={},Xh=d((({className:e,data:t=Yh,blocksRegistry:l,blockDecorator:n})=>{const{slots:a,blocks:i,fallback:r,...s}=t,d=ft(s,r);xl(globalThis,"click",Oh);const m={key:"",page:{slots:a,blocks:i,fallback:r,...d},blocksRegistry:l,blockDecorator:n,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:x("@container relative",t.style,e),children:[a?.header?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:M(a?.header,{...m,slotName:Kh})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[V({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),M(a?.footer,{...m,slotName:qh})]})]}),a?.["sticky-footer"]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:M(a?.["sticky-footer"],{...m,slotName:Gh})}):null,o(Hh,{}),o(Wh,{}),o(_h,{termLink:{href:"/pd-policy#cookie",target:"_blank"},personalDataPolicyLink:{href:"/pd-policy",target:"_blank"}})]})}));Object.assign(Xh,{childrenTypes:[],slots:()=>[Kh,qh,Gh]});e.Blocks=Fh,e.ContentPage=Xh,e.DaDataAPI=function(e=""){return{getFetcherAddress:async function(){if(!("geolocation"in navigator))return null;try{const t=await(async()=>new Promise((e=>navigator.geolocation.getCurrentPosition((({coords:t})=>e(t))))))(),l=await fetch(`${e}/geolocate`,{method:"POST",mode:"cors",body:JSON.stringify({lat:t.latitude,lon:t.longitude,count:1})});return(await l.json())?.suggestions?.[0]?.data?.city}catch(e){return console.error(e),null}}}},e.handlerDecorator=se,e.joinList=e=>t=>t.reduce(((t,l,n)=>t.length?t.concat({...e,key:`sep-${n}`},l):[l]),[]),e.packageVersion="0.14.192",e.projectSettings=z,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=E,e.useRouter=g,Object.defineProperty(e,"__esModule",{value:!0})}));