@redneckz/wildless-cms-uni-blocks 0.14.151 → 0.14.152

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).UniBlocks={})}(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=>e&&!e.endsWith("/")?`${e}/`:e,c={PROD_BRANCH:"master"},d=new class{_=c;setup(e){this._=e}get TEST_BRANCH(){return this._.TEST_BRANCH}get RC_BRANCH(){return this._.RC_BRANCH}get PROD_BRANCH(){return this._.PROD_BRANCH||c.PROD_BRANCH}get FORCED_DRAFT_FLOW(){return this._.FORCED_DRAFT_FLOW}get ASSIST_PROJECT_ID(){return this._.ASSIST_PROJECT_ID}get SITEMAP(){return this._.SITEMAP}get STICKY_MOBILE_MENU(){return this._.STICKY_MOBILE_MENU}get FOOTER(){return this._.FOOTER}get PORTAL_DATA(){return this._.PORTAL_DATA}get CHAT_BOT(){return this._.CHAT_BOT}get CDN(){return o(this._.CDN)}get BASE_PATH(){return o(this._.BASE_PATH)}get YANDEX_MAP_API_KEY(){return this._.YANDEX_MAP_API_KEY}get YANDEX_METRIKA_ID(){return this._.YANDEX_METRIKA_ID}},m="likesToken";function h(){async function e(){try{const e=JSON.parse(globalThis.localStorage?.getItem(m)||"");if(e?.token)return e}catch(e){}try{const e=await fetch("/assist/v1/public/auth",{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({prefix:"guest"})}),{token:t,name:l}=await e.json();return globalThis.localStorage?.setItem(m,JSON.stringify({token:t,name:l})),{token:t,name:l}}catch(e){return console.error(e),{}}}return{getLikeCount:async function(...t){if(!t.length)return[];const{token:l}=await e();try{const e=await fetch(`/assist/v1/public/projects/${d.ASSIST_PROJECT_ID}/nodes/likes`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:l},body:JSON.stringify({node_ids:t})}),{likes:n}=await e.json();return n||[]}catch(e){return console.error(e),[]}},like:async function(t){if(!t)return 0;const{token:l,name:n}=await e();try{const e=await fetch(`/assist/v1/public/projects/${d.ASSIST_PROJECT_ID}/nodes/like`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:l,UserID:n},body:JSON.stringify({node_id:t,user_name:n})}),{likes:a}=await e.json();return a||0}catch(e){return console.error(e),0}},dislike:async function(t){if(!t)return 0;const{token:l,name:n}=await e();try{const e=await fetch(`/assist/v1/public/projects/${d.ASSIST_PROJECT_ID}/nodes/unlike`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:l,UserID:n},body:JSON.stringify({node_id:t,user_name:n})}),{likes:a}=await e.json();return a||0}catch(e){return console.error(e),0}}}}const u=(...e)=>globalThis._uni._jsx(...e),p=(...e)=>globalThis._uni._jsxs(...e),g=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:x(e)),t._tmpl},x=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},f=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),b=g((({children:e})=>f?e:null));const y=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 v(){return v._impl()}v._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),v.setup=e=>{v._impl=e};const N=(...e)=>e.flatMap((e=>e)).filter(Boolean).join(" "),w={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","":""},k=g((({className:e,version:t="primary",isTheme:l=!0,defaultPadding:i="p-xl",padding:r,block:s,tag:o="section",role:c,children:d,style:m})=>{const h=o,p=v(),[g,x]=n(!1);a((()=>y.subscribe("tab",(e=>{e.groupName&&e.groupName!==s?.labelGroup||x(Boolean(e.label&&s?.labels?.length&&!s.labels.includes(e.label)))}))),[s,p]);const f=t&&l;return u(h,{className:N("@container font-sans",f?"group":"",w[t],g?"hidden":"",r||i,e),...f?{"data-ver":t}:{},...s?.anchor?{id:s.anchor}:{},role:c,style:m,children:d})})),C={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},S=g((({className:e="",headingType:t="h3",as:l="h3",title:n,children:a})=>u(l,{className:N("font-sans m-0",C[t],e),children:n||a}))),I=g((({children:e,...t})=>u("p",{className:N("font-sans",Object.values(t)),children:e}))),T={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"}},B=g((({className:e,version:t="",headlineVersion:l="XL",title:n,description:a,align:i="text-center",as:r,isEmbedded:s=!1,isTheme:o=!1,...c})=>{const d=T[l],m={marginTop:d.descriptionStyle};return p(k,{className:N(s?"@container-normal":"",e),defaultPadding:s?"":"p-6xl",version:t,isTheme:o,...c,children:[n?u(S,{className:N("whitespace-pre-wrap",i),...d?.title,as:r||d?.title.as,title:n}):null,a?u(I,{size:d.descriptionSize,font:d.descriptionWeight,align:i,...m,children:a}):null]})})),P=({blockClassName:e,block:t,render:l})=>l({blockClassName:e,block:t}),M=[];function R(e,t,{className:l,...n}={}){const{key:a,blockDecorator:i=P,blocksRegistry:r={},ancestors:s=M}=t,{type:o}=e;o&&o in r||console.warn(`No block with "${o}" is registered`);const c=o&&r[o];return i({blockClassName:N(e.style?.length?e.style:"col-span-12",l),block:e,ancestors:s,render:({block:l,blockClassName:i})=>{const{content:r}=l;return c?u(c,{className:i,block:e,options:t,...r,...n},a):null}},a)}const A=[],z=(e,{key:t,ancestors:l=A,slotName:n=null,extraProps:a,renderProps:i=R,...r})=>{const s=a?(e,t)=>R(e,t,a):i;return(e||[]).map(((e,a)=>s(e,{...r,key:`${t||e.type}-${a}`,ancestors:r.parent?[...l||A,[r.parent,n]]:l},a)))};function D({block:e,options:t,children:l,extraProps:n,renderProps:a}){return l||(e&&t?z(e.blocks,{...t,parent:e,extraProps:n,renderProps:a}):null)}const V=e=>Boolean(e?.includes(":")),_=(e,t)=>Boolean(e&&!V(e)&&(!t||"_self"===t)),F=e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),j=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/");var L=Object.freeze({__proto__:null,isURL:V,isLocalURL:_,isHash:e=>Boolean(e?.startsWith("#")),withoutQuery:F,joinPath:j});const E="/api/",O=`${E}v1/storage`,$=e=>(t,l=d.BASE_PATH)=>{if(!t||V(t)||[d.CDN,E].some((e=>U(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 j(U(t,l)?"":l,n?"/":e.pathname?.split("/").slice(0,-1).join("/"),t)},U=(e,t)=>t&&e&&e.startsWith(t),H={normal:"",color:"text-primary-main",black:"text-black",white:"text-black"},W=g((({className:e="",imageClassName:t="",name:l="",alt:n=`Иконка ${l}`,title:a=n,iconVersion:i="color",width:r,height:s})=>{const o=v(),c="normal"===i?`${l}.svg`:`sprites.svg#${l}`,m=$(o)(j(d.CDN,"/icons/",c));return"normal"===i?u("img",{className:e,src:m,alt:n,title:a,"aria-hidden":"true",width:r,height:s,style:K(e,s)}):u(Y,{className:e,children:p("svg",{className:N(X(r),H[i],"white"===i?"invert":"",t),width:r,height:s,"aria-hidden":"true",children:[a?u("title",{children:a}):null,n?u("desc",{children:n}):null,u("use",{href:m,xlinkHref:m})]})})})),K=(e,t)=>{return e?.includes("h-")?{}:{height:(l=t,l&&!/\D/.test(l)?`${t}px`:t),width:"auto"};var l},X=e=>e?"":"w-full h-full",Y=g((({className:e,children:t})=>e?u("div",{className:e,children:t}):t)),q=(e,t)=>l=>l&&!V(l)?$(e)(j(t,l)):l,G=(e,t)=>e?.media&&t?.media?e.media-t.media:0,J=g((({className:e="",image:t,imageClassName:l="",pathPrefix:n})=>{const a=v();return p("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(G).map((({src:e,format:l,media:i},r)=>u("source",{srcSet:q(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:q(a,n)(t.src)},l):null]})})),Q=(e,t="")=>u("img",{src:e.src,className:N("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,ee=g((({className:e="",image:t,imageClassName:l="",pathPrefix:n,...a})=>t?.src||t?.icon?t.icon?u(W,{className:e,imageClassName:l,iconVersion:t?.iconVersion,name:t.icon,...a}):u(J,{className:e,imageClassName:l,image:t,pathPrefix:n}):null)),te={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active",white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",transparent:"",gray:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","":""},le="bg-main-divider text-main-disabled",ne={primary:le,secondary:le,white:le,link:"",transparent:"",gray:le,"":""},ae="text-center font-sans select-none",ie={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","":""},re=({className:e,rounded:t,version:l})=>[ae,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",l?te[l]:"",t?"rounded-full":"rounded-md",e].join(" "),se=()=>({open:(e,t={})=>y.fire("dialog",{type:"open",dialog:e,...t}),close:()=>y.fire("dialog",{type:"close"}),closeAll:()=>y.fire("dialog",{type:"close",all:!0})}),oe=(e,t)=>oe._impl(e,t);function ce(e={}){const{isRemote:t,basePath:l}=e,n=v(),{closeAll:a}=se();return e=>({...e,href:t&&!l?e.href:$(n)(e.href,l),"aria-label":e.text,onClick:oe(i(e),e)});function i({href:e,target:l,onClick:i}){return r=>{i&&i(r),e&&!t&&_(e,l)&&(a(),r?.preventDefault(),n.push(e))}}}oe._impl=e=>e,oe.setup=e=>{oe._impl=e};const de=g((e=>{const{text:t,aboveText:l,appendLeft:n,appendRight:a,version:i="primary"}=e,r=he(e)?"hidden lg:block":"";return p("div",{className:N(me(e),"flex gap-xs"),children:[n?u("div",{className:N(r,ie[i]),children:n}):null,he(e)?p("div",{className:"whitespace-pre",children:[l?u("div",{className:"text-xs font-light text-left",children:l}):null,u("div",{className:"text-left "+(l?"text-s -mt-3xs":"text-l"),children:t})]}):null,a?u("div",{className:N(r,ie[i]),children:a}):null]})})),me=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 N("group/btn items-center justify-center",he(e)?a:"h-12 w-12 m-auto",n?"rounded-full":"")},he=({text:e,aboveText:t,appendLeft:l})=>Boolean(e||t||!l),ue=({className:e,rounded:t,version:l})=>["inline-block",ae,l?ne[l]:"",t?"rounded-full":"rounded-md",e].join(" "),pe=g((({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=ce()({onClick:r,href:n,...a}),o=t??u(de,{...s});return u(e?xe:ge,{...s,children:o})})),ge=g((({className:e="",href:t,rel:l,target:n,ariaLabel:a,version:i,rounded:r,onClick:s,children:o})=>u("a",{className:re({className:e,version:i,rounded:r}),href:t,rel:l,target:n,"aria-label":a,role:t?"link":"button",onClick:s,children:o}))),xe=g((({className:e,ariaLabel:t,version:l,rounded:n,children:a})=>u("div",{role:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:ue({className:e,rounded:n,version:l}),children:a})));function fe(e,t){const l="primary"===e?"white":"black",n="Вернуться назад";return p("div",{className:"hidden sm:flex items-center gap-s",children:[u("div",{className:re({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",version:e,rounded:!0}),onClick:t,children:u(ee,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:l}})}),u(pe,{version:"link",className:"group-data-secondary:text-white/80",text:n,ariaLabel:n,onClick:t})]})}const be={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},ye=g((({className:e,version:t="primary",defaultPadding:l,padding:n="",title:a="",insetTitle:r="",buttons:s,leftImage:o,rightImage:c,imageAlign:d,isImageAlwaysOnRight:m=!1,isImageSecondary:h=!1,backwardButton:g,children:x,...f})=>{const b=v(),y=i((e=>{e?.preventDefault(),b.back()}),[]);return p("div",{className:ve(n,l,e),children:[g?fe(t,y):null,a?u("div",{className:"relative h-full",children:a}):null,p("div",{className:N("grow relative flex flex-col @xl:flex-row gap-3xl w-full",o?"self-start @xl:w-auto":""),children:[Se(o,{imageAlign:d,className:"mx-auto"}),p("div",{className:N("grid gap-3xl",c?"@xl:grid-cols-2":"",o?"":"grow","h-full","auto-rows-[max-content_1fr]"),children:[p("div",{className:"grow space-y-lg min-w-fit",children:[r,x]}),Ce(D({...f,extraProps:{className:"@container-normal"}})),Se(c,{className:N("@xl:justify-self-end @xl:col-start-2",s?Ne(m):"",we(m),Ie(h)),imageAlign:d}),ke(s)]})]})]})})),ve=(e="",t="",l="")=>N("relative flex flex-col gap-3xl overflow-hidden",e||t,l),Ne=e=>e?"row-span-2":"@xl:row-span-2",we=e=>e?"col-start-2 self-center":"",ke=e=>e?u("div",{className:"self-end",children:e}):null,Ce=e=>e&&e?.length?u("div",{className:"flex items-start justify-end",children:e}):null,Se=(e,{className:t,imageAlign:l})=>e?u("div",{className:N("shrink-1/2 justify-self-center",l&&be[l],t),children:e}):null,Ie=e=>e?"hidden @xl:block":"",Te=(e=[])=>e.reduce(((e,t)=>e+t),0),Be=(e=[])=>e?.length?Te(e)/e.length:0,Pe=(e,t="normal")=>e?u("div",{className:N("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:u(ee,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,Me=g((e=>{const{__html:t="",richVersion:l=""}=e;return t.replace(/<\/?[^>]+\/?>/g,"").trim()?u("div",{"data-component":"rich-text-container",children:u("div",{className:N(l,"md-container"),dangerouslySetInnerHTML:{__html:t}})}):null})),Re=(e,t)=>e?u(I,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,Ae=g((({children:e,...t})=>u("span",{className:N("font-sans",Object.values(t)),children:e}))),ze=(e,t)=>e?u(Ae,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,De=(e,t)=>"rte"===e.type&&"__html"in e&&e.__html?u(Me,{...e},`rte-${t}`):["label"in e?ze(e.label,t):null,"description"in e?u("span",{className:e.descriptionClassName,children:Re(e.description,t)},String(t)):null],Ve=g((({className:e,benefitsVersion:t,...l})=>p("div",{className:N("flex gap-m min-w-56 items-center",e),children:["icon"in l?Pe(l.icon,t):null,u("div",{children:De(l)})]}))),_e=e=>"rte"===e.type?e?.__html?.length||0:Math.max(e?.label?.length||0,e?.description?.length||0),Fe=e=>{return((t=e.map(_e))?.length?Math.sqrt(Math.abs(Be(t.map((e=>e**2)))-Be(t)**2)):0)>16;var t},je=e=>e&&"icon"in e&&e.icon&&(e.icon.icon||e.icon.src),Le=e=>!e.some(je),Ee=g((({className:e,benefitsVersion:t="normal",benefits:l})=>l?.length?u("div",{className:N("flex gap-x-m gap-y-s",Fe(l)||Le(l)?"flex-col":"flex-wrap",e),children:l.map(((e,l)=>u(Ve,{benefitsVersion:t,...e},String(l))))}):null)),Oe=g((({className:e,benefits:t})=>t?.length?u("div",{className:N("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),children:t.flatMap(De)}):null)),$e=g((({isTabularBenefits:e,...t})=>u(e?Oe:Ee,{...t}))),Ue=e=>Boolean(e?.src||e?.icon),He=(e,{className:t,buttonClassName:l,isVertical:n}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?u("div",{className:N("flex",n?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m",t),children:e.map(We(l))}):null,We=(e="")=>(t,l)=>{const{text:n,icon:a,iconRight:i,version:r,...s}=t||{},o=Ke(a,r),c=Ke(i,r);return n||a?.icon?u(pe,{className:N("basis-full @lg:basis-auto",e),appendLeft:Xe({...a,iconVersion:o}),appendRight:Xe({...i,iconVersion:c}),version:r,text:n,...s},l?String(l):""):null},Ke=(e,t="secondary")=>{const l="secondary"===t?"color":"white";return e?.iconVersion?e?.iconVersion:l},Xe=e=>Ue(e)?u(ee,{image:e,width:String(e?.size?.width||24),height:String(24)}):null,Ye=g((({className:e,isDotted:t,dotClassName:l,children:n})=>p("div",{className:N("font-sans flex",e),role:"listitem",children:[t?u("div",{className:"shrink-0",children:u("div",{className:N("align-middle inline-block rounded-full group-data-secondary:bg-white",l)})}):null,u("span",{children:n})]}))),qe={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"}},Ge=g((({className:e,isDotted:t=!0,items:l=[],listItemSize:n="M",dotClassName:a=""})=>{const i=qe[n];return l?.length?u("section",{className:N("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)=>u(Ye,{isDotted:t,dotClassName:N(a||"bg-primary-text",i.dotStyle),children:e},String(l))))}):null})),Je=(e=0,{fixed:t}={})=>(l=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(l)||0),Qe=g((({priceList:e})=>e?.length?u("div",{className:"flex flex-wrap xl:flex-nowrap xl:bg-main-divider xl:rounded-md p-xs gap-xl",children:e.map(Ze)}):null)),Ze=({label:e,amount:t})=>p("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",children:[u(Ae,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?p("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[Je(2)(t)," ₽"]}):null]}),et=g((({className:e,tags:t})=>t?.length?u("div",{className:N("flex flex-wrap gap-xs",e),role:"list",children:t.map(tt)}):null)),tt=(e,t)=>u("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:u(Ae,{size:"text-m",font:"font-light",children:e})},String(t)),lt={XXL:"L",XL:"L",L:"M",M:"M",S:"S",XS:"S"},nt=g((({className:e,padding:t,defaultPadding:l,title:n,description:a,headlineVersion:i="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:o,benefits:c,__html:d,isFullWidthTitle:m,items:h,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:S,...I})=>{const T=y?.src?u(ee,{image:y}):null,P=u(B,{title:n,description:a,headlineVersion:i,align:r,isEmbedded:!0}),M=c?.filter((e=>"rte"===e?.type||"label"in e||"description"in e));return u(ye,{className:e,padding:t,defaultPadding:l,...m?{title:P}:{insetTitle:P},...at(T,N),isImageSecondary:k,imageAlign:v,isImageAlwaysOnRight:w,buttons:He(b),backwardButton:C,...I,children:p("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[M?.length?u($e,{benefitsVersion:s,isTabularBenefits:o,benefits:M}):null,d?u(Me,{__html:d}):null,h?.length?u(Ge,{items:h,isDotted:g,listItemSize:lt[i]}):null,S,x?.length?u(Qe,{priceList:x}):null,it(f)]})})})),at=(e,t)=>t?{rightImage:e}:{leftImage:e},it=e=>e?.length?u(et,{tags:e}):null,rt=g((({className:e,padding:t,...l})=>u(k,{className:N("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...l,children:u(nt,{defaultPadding:"p-6xl",padding:t,className:"grow h-full",...l})})));rt.childrenTypes=["UnitBlock"];const st=e=>null!=e,ot=new Map,ct=e=>Boolean(e?.every((e=>Array.isArray(e)?ct(e):!e||"string"==typeof e))),dt=e=>ct(e)?e.toString():"";function mt(e,t,{fallback:l,cache:i}={}){const s=r((()=>ht(e)),[e]),[o,c]=n(void 0),[d,m]=n(void 0);a((()=>{if(!s.some(st))return;let e=!1;const l=(t,l)=>{e||(c(t),m(l))};return(async()=>{try{l(await((e,t=ot)=>l=>{const n=dt(l),a=t.get(n);if(n&&st(a))return a;const i=e(...l);return n&&st(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 ht(e){return Array.isArray(e)?e:e instanceof Function?ht(e()):[e]}async function ut(e,t){try{return e?await pt(e,t):null}catch(e){console.error(e)}return null}const pt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),gt={},xt="/wcms-resources";function ft(e,t={}){const{fallback:l=gt,pathDir:n=xt}=t,{data:a}=mt(e?`${n}/${e}.json`:null,pt,{fallback:l});return a||gt}const bt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),yt=g((e=>{const t=((e="reklamnaya-plitka")=>{const t=ft(e),l=r((()=>bt(0,t?.items?.length)),[t]);return t?.items?.[l]})(e.options?.page?.adSourceBook);return t?u(b,{children:u(rt,{...t,...e})}):null}));const vt=e=>e,Nt=(e,t)=>{const[l,a]=n(e),[r,o]=n(!1),[c,d]=n({}),m=s({}),h=i(((e,t)=>{const{parse:n=vt,format:i=vt}=t||{};return m.current||(m.current={}),m.current[e]||=t=>{a((l=>({...l,[e]:n(t)}))),d((t=>({...t,[e]:!0})))},{value:i(l[e]),isDirty:r||c[e],onChange:m.current[e]}}),[l,r,c]),u=i((e=>{a(e),d(e)}),[]),p=i((()=>{a(e),o(!1),d({})}),[e]),g=i((e=>{e.preventDefault(),o(!0),t&&t(l)}),[t,l]);return[l,{isDirty:r||Object.values(c).some(Boolean),field:h,update:u,reset:p,onSubmit:g}]},wt=e=>e.replace(/[^+\d]/g,""),kt=e=>t=>t&&Object.entries(e).flatMap((([e,l])=>l(t[e])))||[],Ct=e=>!e?.length,St=e=>t=>l=>e(l)?[]:[t],It=g((({text:e,link:t})=>p(I,{size:"text-s",font:"font-light",color:"text-secondary-text",children:[u(Ae,{children:e||"Нажимая кнопку, вы подтверждаете согласие с "}),t?u(pe,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"text-primary-main",children:u(Ae,{children:t.text})}):null]}))),Tt="container space-y-lg",Bt="w-full max-w-xl space-y-s m-auto",Pt=(e,t)=>{const{value:l,isDirty:n}=e,a=n?t(l):[];return{...e,errors:a,error:a[0]}},Mt=g((({title:e,children:t})=>p("fieldset",{className:"grid @xl:flex @xl:justify-between gap-lg border-b border-b-main-divider @xl:border-none",children:[e?u("legend",{className:"w-full",children:u(S,{title:e,headingType:"h6",className:"@xl:text-center"})}):null,t]}))),Rt="@xl:w-1/2 space-y-s",At=g((({key:e,className:t="",id:l,name:n,type:r="text",label:o,placeholder:c,value:d="",valid:m=!0,children:h,onChange:g,onFocus:x,onBlur:f,pattern:b,autoFocus:y=!1,isTextarea:v=!1})=>{const w=s(null),k=i((e=>{g&&g(e.target?.value||"")}),[g]);a((()=>{y&&w.current?.focus()}),[y,w]);const C="w-full border rounded-md text-primary-text outline-none p-m",S=h?"pr-3xl":"",I=Dt(m);return p("div",{className:N("relative",t),children:[p("label",{children:[o?zt(o):null,v?u("textarea",{className:N("block resize-y min-h-24",C,I),id:N("textarea",l),name:n||l,placeholder:c,value:d,onInput:k,onFocus:x,onBlur:f},e):u("input",{type:r,className:N("h-14",C,S,I),ref:w,id:l,name:n||l,placeholder:c,value:d,onInput:k,onFocus:x,onBlur:f,pattern:b},e)]}),h]})})),zt=e=>u("div",{className:"mb-xs",children:u(Ae,{size:"text-m",font:"font-light",children:e})}),Dt=e=>e?"border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text":"border-error",Vt=e=>u("div",{className:"h-4",children:e?u(Ae,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),_t=g((({className:e,label:t,value:l="",placeholder:n,error:a,onChange:i,onBlur:r,isTextarea:s})=>p("div",{className:N("shrink-0 w-full",e),children:[u(At,{type:"text","aria-label":t,label:t,valid:Boolean(!a),value:l,onChange:i,onBlur:r,isTextarea:s,placeholder:n}),Vt(a)]}))),Ft=e=>"_"===e,jt=e=>/\d/.test(e),Lt=e=>Ft(e)||jt(e),Et=[..."+7 (___) ___-__-__"],Ot=Et.findIndex(Ft),$t=Et.map(((e,t)=>Lt(e)?Et.slice(0,t).filter(Lt).length:-1));const Ut=g((({children:e,onChange:t,...l})=>{const n=i((e=>t&&t(function(e){const t=e.replace(/\D/g,""),l=Et.map(((e,l)=>jt(e)?e:t.charAt($t[l])||e)),n=$t.indexOf(t.length-1)+1;return(n?l.slice(0,Math.max(Ot,n)):l).join("")}(e))),[t]);return u(At,{onChange:n,onFocus:e=>n(e?.target?.value||""),...l,children:e})})),Ht=g((({className:e,label:t,value:l,error:n,onChange:a,onBlur:i})=>p("div",{className:N("shrink-0 w-full",e),children:[u(Ut,{"aria-label":t,label:t,valid:Boolean(!n),value:l,onChange:a,onBlur:i,placeholder:"+7 (___) ___-__-__"}),Vt(n)]}))),Wt="Некорректно заполненное поле",Kt=St((e=>null!=e&&""!==e))(Wt),Xt=St((e=>"string"==typeof e&&e.length>1))(Wt),Yt=St((e=>"string"==typeof e&&(10===e.length||12===e.length)))(Wt),qt=(Gt=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,St((e=>"string"==typeof e&&Gt.test(e))))(Wt);var Gt;const Jt=St((e=>"boolean"==typeof e&&e))(Wt),Qt=(e,t)=>p(Mt,{title:t,children:[p("div",{className:Rt,children:[u(_t,{label:"Наименование организации*",...Pt(e("fullName"),Kt)}),u(_t,{label:"Контактное лицо*",...Pt(e("name"),Xt)})]}),p("div",{className:Rt,children:[u(_t,{label:"ИНН*",...Pt(e("inn"),Yt)}),u(Ht,{label:"Телефон*",...Pt(e("phone"),qt)})]})]}),Zt=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}];function el(){const{data:e}=mt("/api/v1/regions",pt);return e||[]}function tl(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 ll=e=>e?.text||e?.key||"";function nl(e,t,l,n){a((()=>{if(e&&l)return e.addEventListener(t,l,n),()=>{e.removeEventListener(t,l,n)}}),[e,t,l])}function al(e){const t=s(null),l=i((l=>{t&&t.current&&l.target instanceof Node&&!t.current.contains(l.target)&&e()}),[e]);return nl(globalThis.document,"click",l),t}const il=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,rl=g((({popupRef:e,options:t,value:l,query:n,onChange:a,iconVersion:i})=>t?.length?u("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md",role:"listbox",ref:e,children:il(t,n).map((e=>p("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"option","aria-selected":e.key===l?.key,onClick:t=>{t.stopPropagation(),a&&a(e)},children:[u("span",{className:"min-h-6",children:ll(e)}),u(W,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:i,className:N("absolute right-4 pt-3xs",e.key===l?.key?"":"hidden")})]},e.key)))}):null));function sl({isOpen:e,options:t,value:l,query:n,onChange:r,onClose:o,iconVersion:c}){const d={open:(e,t)=>y.fire("popup",{type:"open",popup:e,...t}),update:(e,t)=>y.fire("popup",{type:"update",popup:e,...t}),close:()=>y.fire("popup",{type:"close"})},m=i((()=>{d.close(),o&&o()}),[o]),h=i((e=>{m(),r&&r(e)}),[m,r]),p=s(null),g=al(m);return a((()=>{if(!e||!p.current)return;const a=p.current,{top:i,left:r,width:s,height:o}=a.getBoundingClientRect();d.update(u(rl,{popupRef:g,options:t,value:l,query:n,onChange:h,iconVersion:c}),{top:i+window.scrollY+o,left:r,width:s})}),[e,t,l,n,h]),p}const ol=g((({className:e,label:t,options:l=[],value:a,valid:r=!0,isBorder:s=!0,placeholder:o="",isSearch:c=!1,iconVersion:d,onChange:m})=>{const[h,{setFalse:g,setTrue:x}]=tl(),[f,b]=n(""),y=i((()=>{b(""),g()}),[]),v=sl({isOpen:h,options:l,value:a,query:f,onChange:m,onClose:y,iconVersion:d});return p("div",{className:e,children:[cl(t),p("div",{className:N("relative",h?"z-20":"z-10"),ref:v,children:[p("div",{className:N("h-14 text-l flex justify-between items-center text-primary-text cursor-pointer relative z-10",ml(s,r)),onClick:h?y:x,children:[u("p",{className:"p-m pr-8 flex items-center overflow-hidden text-ellipsis",children:ll(a)||o}),dl(h,d)]}),c&&h?u("div",{className:N("absolute top-0 w-full z-20"),children:u(At,{type:"text",autoFocus:!0,value:f,onChange:b})}):null]})]})})),cl=e=>e?u("div",{className:"mb-xs",children:u(Ae,{size:"text-m",color:"text-primary-text",font:"font-light",children:e})}):null,dl=(e,t)=>u(W,{className:N("absolute right-3",e?"":"rotate-180"),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),ml=(e,t)=>N(e?"border rounded-md hover:border-primary-hover":"",t?" border-gray":"border-error"),hl=g((({className:e="",error:t,...l})=>p("div",{className:e,children:[u(ol,{...l,valid:!t}),Vt(t)]}))),ul=g((({field:e})=>{const t=el();return u(hl,{className:"w-full",label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:t.map((({code:e="",name:t=""})=>({key:e,text:t}))),...Pt(e("region"),Kt)})})),pl=({field:e,title:t})=>p(Mt,{title:t,children:[u("div",{className:Rt,children:u(hl,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:Zt,...Pt(e("acquiringType"),Kt)})}),u("div",{className:Rt,children:u(ul,{field:e})})]}),gl=g((({value:e=!1,text:t,type:l="checkbox",onChange:n})=>p("div",{role:l,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>n&&n(!e),children:[u("div",{className:N("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:u("div",{className:N("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?u(Ae,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),xl=e=>p("div",{children:[u(gl,{text:"Хочу купить онлайн-кассу",...e("onlineCheckout")}),u(gl,{text:"Хочу купить POS-терминал",...e("posTerminal")})]});function fl({disabled:e,onClick:t}){return l=>{!e&&t&&t(l)}}const bl={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"},yl={primary:N("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:N("group-data-secondary:text-white group-data-secondary:bg-white/20","group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active")},vl=g((({children:e,...t})=>{const l=e=>({...e,onClick:oe(fl(e),e)}),{className:n,version:a="primary",active:i,disabled:r,type:s="button",rounded:o=!0,role:c,onClick:d}=l(t);return u("button",{className:N("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?"":N(bl[a],yl[a]),o?"rounded-md":"",n),type:s,role:c,onClick:d,children:e})})),Nl=(e,t)=>u(vl,{className:N("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),wl={acquiringType:{key:"trade",text:"Торговый эквайринг"},fullName:"",inn:"",name:"",phone:"",onlineCheckout:!1,posTerminal:!1},kl=kt({acquiringType:Kt,region:Kt,fullName:Kt,inn:Yt,name:Xt,phone:qt}),Cl=g((e=>{const{button:t,link:l,onSubmit:n}=e,a=i((e=>{const{acquiringType:t,region:l,fullName:a,inn:i,name:r,phone:s,onlineCheckout:o,posTerminal:c}=e,d=Sl(t?.key),m=`Вид эквайринга=${t?.text||""}${d?`/Онлайн касса=${o}/POS-терминал=${c}`:"/Онлайн касса=false/POS-терминал=false"}`,h={typeForm:"acqr",region:l?.text||"",partnerComments:m,fullName:a,inn:i,name:r,phone:wt(s)};Ct(kl(e))&&n(h,!1)}),[n]),[,{field:r,...s}]=Nt(wl,a),o=Sl(r("acquiringType").value?.key);return p("form",{className:Tt,onSubmit:s.onSubmit,children:[pl({field:r,title:"Вид эквайринга и регион"}),Qt(r,"Данные организации"),o?xl(r):null,Nl(t),u(It,{link:l})]})})),Sl=e=>"all"===e||"trade"===e,Il=g((({className:e,viewBox:t,fill:l="none",width:n,height:a,paths:i,...r})=>u("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 u("path",{d:e,fill:t||"currentColor",stroke:a.stroke,strokeLinecap:a.strokeLinecap,strokeLinejoin:a.strokeLinejoin,strokeWidth:a.strokeWidth,strokeMiterlimit:a.strokeMiterlimit},n)}))}))),Tl=[{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"}],Bl=g((({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]),o=a?u("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):u(Il,{paths:Tl,className:"absolute left-1 ml-px block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"});return u("div",{className:e,children:p("label",{className:"flex items-center relative cursor-pointer group/box",onClick:s,children:[u("div",{className:N("appearance-none w-5 h-5 border-solid cursor-pointer m-0",a?"rounded-full border-2":Pl(t),t?"border-primary-main":"border-gray",n?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:"checkbox","aria-checked":Boolean(t),"aria-disabled":Boolean(n)}),t?o:null,l?u("div",{className:"ml-s",children:u(Ae,{size:"text-l",font:"font-light",children:l})}):null]})})})),Pl=e=>N("rounded border",e?"bg-primary-main":""),Ml=g((({className:e,text:t,value:l,key:n,disabled:a,error:i,onChange:r})=>p("div",{className:N("shrink-0 w-full",e),children:[u(Bl,{text:t,value:l,disabled:a,onChange:r},n),Vt(i)]}))),Rl=(e,t,l)=>p("div",{className:"flex gap-m flex-col lg:flex-row w-full justify-between items-baseline",children:[p("div",{children:[p("div",{className:"flex gap-3",children:[u(Bl,{...e}),u(It,{text:"Согласен с ",link:t})]}),Vt(Pt(e,Jt).error)]}),Nl(l)]}),Al=(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}`}},zl=()=>{},Dl=({today:e,firstDayOfWeek:t,totalDays:l,currentMonth:n,currentYear:a,min:i,max:r,onDateClick:s})=>{const o=[];let c=1;for(let d=0;d<6;d++){const m=[];for(let o=0;o<7;o++)if(0===d&&o<t)m.push(u("td",{},`empty-${o}`));else if(c>l)m.push(u("td",{},`empty-${o}`));else{const t=new Date(a,n,c),l=Vl(t,e),o=_l(t,i,r);m.push(u("td",{children:u("div",{className:Fl(l,o),onClick:()=>!o&&s(t),children:c})},`day-${c}`)),c++}o.push(u("tr",{children:m},`row-${d}`))}return o},Vl=(e,t)=>t&&e.toDateString()===t.toDateString(),_l=(e,t,l)=>t&&e.getTime()<t.getTime()||l&&e.getTime()>l.getTime(),Fl=(e,t)=>N("p-s text-center rounded-md border",e?"":"border-transparent hover:bg-gray",t?"text-gray hover:bg-transparent":"cursor-pointer"),jl=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Ll=g((({today:e,currentMonth:t,currentYear:l,min:n,max:a,onDateSelect:s=zl})=>{const o=i((e=>s(e)),[]),{firstDayOfWeek:c,totalDays:d}=r((()=>({firstDayOfWeek:new Date(l,t,1).getDay()-1,totalDays:new Date(l,t+1,0).getDate()})),[l,t]);return p("table",{className:"mx-auto",children:[u("thead",{className:"text-gray font-light",children:u("tr",{children:jl.map(((e,t)=>u("th",{className:"p-s",children:e},String(t))))})}),u("tbody",{children:Dl({firstDayOfWeek:c,today:e,totalDays:d,currentYear:l,currentMonth:t,min:n,max:a,onDateClick:o})})]})})),El=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],Ol=El.map((e=>({key:e}))),$l=Array.from({length:(new Date).getFullYear()-1940+1},((e,t)=>1940+t)).reverse().map((e=>({key:String(e)}))),Ul={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Hl={className:"min-w-32",iconVersion:"black",isBorder:!1},Wl=g((({className:e="",label:t="",value:l,valid:a=!0,minDate:r,maxDate:s,onChange:o})=>{const[c,{setValue:d}]=tl(!1),[m,h]=n(l?.getMonth()||(new Date).getMonth()),[g,x]=n(l?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:f,handleNextMonth:b,handleSelectMonth:y,handleSelectYear:v,monthsOptions:w,yearsOptions:k,handleChangeVisibleCalendar:C,ref:S}=(({onShowCalendar:e,showCalendar:t,selectedMonth:l,onMonthSelect:n,onYearSelect:a,selectedYear:r})=>{const s=al(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(El.indexOf(e))),[]),handleSelectYear:i((({key:e})=>a(Number(e))),[]),monthsOptions:Ol,yearsOptions:$l,ref:s}})({onYearSelect:x,onMonthSelect:h,onShowCalendar:d,selectedYear:g,selectedMonth:m,showCalendar:c});return p("div",{className:N(e,"relative"),ref:S,children:[u(Ae,{size:"text-m","font-weight":"font-light",children:t}),Kl(C,l,a),c?p("div",{className:"absolute bg-white z-20 select-none",children:[p("div",{className:"flex gap-s",children:[u("div",{className:"my-auto",onClick:f,children:u(W,{...Ul,className:"-rotate-90 cursor-pointer"})}),u(ol,{onChange:y,value:{key:El[m]},options:w,...Hl}),u(ol,{onChange:v,value:{key:String(g)},options:k,...Hl}),u("div",{className:"my-auto",onClick:b,children:u(W,{...Ul,className:"rotate-90 cursor-pointer"})})]}),u(Ll,{today:l,currentMonth:m,currentYear:g,onDateSelect:o,min:r,max:s})]}):null]})})),Kl=(e,t,l)=>p("div",{onClick:e,className:N("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:[u(I,{children:t&&Al(t)}),u(W,{...Ul,name:"CalendarIcon"})]}),Xl=g((({className:e,label:t,value:l,error:n,onChange:a})=>p("div",{className:N("shrink-0 w-full",e),children:[t?u("div",{className:"mb-xs",children:u(Ae,{size:"text-m",font:"font-light",children:t})}):null,u(Wl,{value:l,onChange:a,valid:Boolean(!n)}),Vt(n)]}))),Yl={surname:"",name:"",middleName:""},ql=(e,t=!0)=>p("div",{className:"space-y-s",children:[u(_t,{label:"Фамилия*",...Pt(e("surname"),Xt)}),u(_t,{label:"Имя*",...Pt(e("name"),Xt)}),u(_t,{label:"Отчество (Обязательно, при наличии)",...e("middleName")}),t?u(Xl,{label:"Дата рождения*",...Pt(e("birthday"),Kt)}):null]}),Gl={...Yl,typeForm:{key:"ANTIFRAUD",text:"Предупреждение о мошенничестве"},phone:"",birthday:void 0,isClient:!1,comment:"",consentDataProcessing:!1},Jl=kt({typeForm:Kt,surname:Kt,name:Xt,birthday:Kt,phone:qt,isClient:Jt,comment:Kt,consentDataProcessing:Jt}),Ql=g((({button:e,link:t,onSubmit:l})=>{const n=i((e=>{const{typeForm:t,phone:n,...a}=e,i={...a,typeForm:t.key,phone:wt(n)};Ct(Jl(e))&&l(i,!0)}),[l]),[,{field:a,...r}]=Nt(Gl,n);return u("form",{className:Tt,onSubmit:r.onSubmit,children:u(Mt,{children:p("div",{className:Bt,children:[ql(a,!0),u(Ht,{label:"Телефон*",...Pt(a("phone"),qt)}),u(Ml,{...Pt(a("isClient"),Jt),text:'Являюсь клиентом банка АО "Россельхозбанк"'}),u(_t,{...Pt(a("comment"),Kt),placeholder:"Комментарий*",isTextarea:!0}),Rl(a("consentDataProcessing"),t,e)]})})})})),Zl=e=>p(Mt,{children:[p("div",{className:Rt,children:[u(_t,{label:"Контактное лицо",...Pt(e("name"),Xt)}),u(_t,{label:"ИНН",...Pt(e("inn"),Yt)})]}),p("div",{className:Rt,children:[u(Ht,{label:"Телефон",...Pt(e("phone"),qt)}),u(_t,{label:"Электронная почта",...Pt(e("mail"),Kt)})]})]}),en={name:"",phone:"",inn:"",mail:""},tn=kt({region:Kt,name:Xt,phone:qt,inn:Yt,mail:Kt}),ln=g((e=>{const{button:t,link:l,onSubmit:n}=e,a=i((e=>{const{region:t,name:l,phone:a,inn:i,mail:r}=e;Ct(tn(e))&&n({typeForm:"bcrd",region:t?.text||"",name:l,inn:i,mail:r,phone:wt(a)})}),[n]),[,{field:r,...s}]=Nt(en,a);return p("form",{className:Tt,onSubmit:s.onSubmit,children:[u(ul,{field:r}),Zl(r),Nl(t),u(It,{link:l})]})})),nn={...Yl,typeForm:{key:"CORRUPTION",text:"Факты коррупции"},phone:"",email:"",comment:"",consentDataProcessing:!1},an=kt({typeForm:Kt,surname:Kt,name:Xt,region:Kt,phone:qt,email:Kt,comment:Kt,consentDataProcessing:Jt}),rn=g((({button:e,link:t,onSubmit:l})=>{const n=i((e=>{const{typeForm:t,phone:n,region:a,...i}=e,r={...i,typeForm:t.key,regionBranch:a?.text,phone:wt(n)};Ct(an(e))&&l(r,!0)}),[l]),[,{field:a,...r}]=Nt(nn,n);return u("form",{className:Tt,onSubmit:r.onSubmit,children:u(Mt,{children:p("div",{className:Bt,children:[ql(a,!1),u(ul,{field:a}),u(Ht,{label:"Телефон*",...Pt(a("phone"),qt)}),u(_t,{label:"Электронная почта*",...Pt(a("email"),Kt)}),u(_t,{...Pt(a("comment"),Kt),placeholder:"Ваше сообщение*",isTextarea:!0}),Rl(a("consentDataProcessing"),t,e)]})})})})),sn=[];function on(e){const{data:t}=mt(e?`/api/v1/branches?regionCode=${e}`:null,cn);return t||sn}const cn=async e=>await ut(e,{method:"GET"})||sn,dn=["От 1 000 ₽","До 1 000 000 000 ₽"],mn=["От 1 мес","До 15 лет"],hn=(e,t)=>p(Mt,{title:t,children:[p("div",{className:Rt,children:[u(_t,{label:"Наименование организации",...Pt(e("fullName"),Kt)}),u(_t,{label:"ИНН",...Pt(e("inn"),Yt)}),u(Ht,{label:"Телефон",...Pt(e("phone"),qt)})]}),p("div",{className:Rt,children:[u(_t,{label:"Годовая выручка, ₽",...Pt(e("annualRevenue"),Kt)}),u(_t,{label:"Контактное лицо",...Pt(e("name"),Xt)}),u(_t,{label:"Электронная почта",...Pt(e("mail"),Kt)})]})]}),un=(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}},pn=(e,t,l)=>Math.max(t,Math.min(e,l));function gn(e){const t=(e||"").replace(/\D/g,""),l=parseInt(t,10);return Number.isNaN(l)?0:l}function xn({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,o={backgroundSize:`${(100*(s>t?s-t:0)/(l-t)).toFixed(2)}% 100%`};return p("div",{children:[e.length?u("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>u("div",{className:N("w-2 h-2 rounded-full",s<=t||i?"bg-gray":"bg-primary-main")},String(t))))}):null,u("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:u("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:o,type:"range",min:t,max:l,step:n,value:s,disabled:i,onInput:t=>{const l=gn(t.target?.value),n=e.length?e[l]:l;r&&r(n||0)}})})]})}const fn=1,bn=100,yn=g((e=>{const{className:t,title:l,items:n=[],list:a=[],min:r=(a.length?0:fn),max:s=(a.length?a.length-1:bn),step:o=1,value:c=a[0]||r,disabled:d=!1,onChange:m}=e,h=un(e,{normalize:(e=0)=>a.length?vn(a)(e):pn(e,r,s),format:Je()}),g=i((e=>{m&&m(gn(e.target?.value))}),[m]);return p("div",{className:t,children:[p("label",{className:"block relative",children:[l?u(Ae,{size:"text-m",font:"font-light",color:"text-primary-text",children:l}):null,u("input",{className:N("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:d,onInput:g,...h}),xn({list:a,min:r,max:s,step:o,disabled:d,value:c,onChange:m})]}),Nn(n)]})})),vn=e=>t=>e.reduce(((e,l)=>Math.abs(l-t)<Math.abs(e-t)?l:e)),Nn=e=>u("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>u(Ae,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),wn=(e,t)=>p(Mt,{title:t,children:[u("div",{className:Rt,children:u(yn,{title:"Сумма, ₽",items:dn,min:1e3,max:1e9,...e("amount")})}),u("div",{className:Rt,children:u(yn,{title:"Срок, месяцев",items:mn,min:1,max:180,...e("term")})})]}),kn={amount:1e3,term:12,fullName:"",inn:"",name:"",phone:"",mail:"",annualRevenue:""},Cn=kt({fullName:Kt,annualRevenue:Kt,inn:Yt,name:Xt,phone:qt,region:Kt,department:Kt}),Sn=g((({button:e,link:t,onSubmit:l})=>{const n=i((e=>{const{amount:t,term:n,fullName:a,inn:i,name:r,phone:s,mail:o,region:c,department:d,annualRevenue:m}=e;Ct(Cn(e))&&l({typeForm:"cred",fullName:a,inn:i,name:r,phone:wt(s),mail:o,region:c?.text||"",department:d?.text||"",partnerComments:`Сумма=${t}/Срок=${n}/Выручка=${m}`})}),[l]),[a,{field:r,...s}]=Nt(kn,n),o=on(a.region?.key).filter((e=>e?.address));return p("form",{className:Tt,onSubmit:s.onSubmit,children:[wn(r,"Параметры"),hn(r,"Данные организации"),p(Mt,{title:"Офис банка",children:[u("div",{className:Rt,children:u(ul,{field:r})}),u("div",{className:Rt,children:u(hl,{label:"Адрес",placeholder:"Выберите адрес",options:o.map((({branchCode:e="",address:t=""})=>({key:e,text:t}))),...Pt(r("department"),Kt)})})]}),Nl(e),u(It,{link:t})]})})),In={name:"",phone:""},Tn=kt({name:Xt,phone:qt}),Bn=g((({button:e,link:t,onSubmit:l})=>{const n=i((e=>{const{name:t,phone:n}=e;Ct(Tn(e))&&l({typeForm:"dpst",name:t,phone:wt(n)})}),[l]),[,{field:a,...r}]=Nt(In,n);return u("form",{className:Tt,onSubmit:r.onSubmit,children:u(Mt,{title:"Оставьте заявку и мы ответим на любые вопросы по депозитам",children:p("div",{className:Bt,children:[u(_t,{label:"Имя",...Pt(a("name"),Xt)}),u(Ht,{label:"Телефон",...Pt(a("phone"),qt)}),Nl(e),u(It,{link:t})]})})})})),Pn=[{text:"Задать вопрос по продуктам и услугам",key:"FEEDBACK"},{text:"Качество обслуживания",key:"FEEDBACK_QS"}],Mn=[{key:"phone",text:"Телефонный звонок"},{key:"mail",text:"Электронное сообщение"}],Rn=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],An={typeForm:Kt,region:Kt,surname:Kt,name:Xt,feedbackMethod:Kt,phone:qt,email:Kt,comment:Kt,consentDataProcessing:Jt},zn={...Yl,typeForm:{key:"FEEDBACK",text:"Задать вопрос по продуктам и услугам"},serviceDirection:{key:"Физическое лицо"},birthday:void 0,feedbackMethod:{key:"Телефонный звонок"},phone:"",email:"",comment:"",consentDataProcessing:!1},Dn=g((({button:e,link:t,onSubmit:l})=>{const n=i((e=>{Vn(e.typeForm.key,e.serviceDirection?.key)?((e,t)=>{const l=kt({...An,addressBranch:Kt,inn:Yt}),n={typeForm:e.typeForm.key,region:e.region?.text,addressBranch:e.addressBranch?.text||"",surname:e.surname,name:e.name,middleName:e.middleName,inn:e.inn,fullName:e.fullName,feedbackMethod:e.feedbackMethod.text,phone:wt(e.phone),secondaryPhoneNumber:e?.secondaryPhone,mail:e.email,bankEmpolee:e.bankEmpolee,applicationDate:e.applicationDate,comment:e.comment,consentDataProcessing:e.consentDataProcessing};Ct(l(e))&&t(n,!1)})(e,l):"FEEDBACK"===e.typeForm.key?((e,t)=>{const l=kt({...An,birthday:Kt}),n={typeForm:e.typeForm.key,regionBranch:e.region?.text,surname:e.surname,name:e.name,middleName:e.middleName,birthday:e.birthday,feedbackMethod:e.feedbackMethod.text,phoneNumber:wt(e.phone),email:e.email,comment:e.comment,consentDataProcessing:e.consentDataProcessing};Ct(l(e))&&t(n,!0)})(e,l):((e,t)=>{const l=kt({...An,addressBranch:Kt}),n={typeForm:e.typeForm.key,regionBranch:e?.region?.text,addressBranch:e.addressBranch?.text||"",surname:e.surname,name:e.name,middleName:e.middleName,feedbackMethod:e.feedbackMethod.text,phoneNumber:wt(e.phone),secondaryPhoneNumber:e.secondaryPhone?.replace(/[^+\d]/g,""),email:e.email,bankEmpolee:e.bankEmpolee,applicationDate:e.applicationDate,comment:e.comment,consentDataProcessing:e.consentDataProcessing};Ct(l(e))&&t(n,!0)})(e,l)}),[l]),[a,{field:r,...s}]=Nt(zn,n),o="FEEDBACK_QS"===r("typeForm").value?.key,c=Vn(r("typeForm").value?.key,r("serviceDirection").value?.key),d=on(a?.region?.key).filter((e=>e?.address));return u("form",{className:Tt,onSubmit:s.onSubmit,children:u(Mt,{children:p("div",{className:Bt,children:[u(hl,{label:"Тема*",placeholder:"Выберите тему",options:Pn,...Pt(r("typeForm"),Kt)}),o?u(hl,{label:"Направление обслуживания*",placeholder:"Выберите направление",options:Rn,...Pt(r("serviceDirection"),Kt)}):null,u(ul,{field:r}),o?u(hl,{label:"Адрес*",placeholder:"Выберите адрес",options:d.map((({branchCode:e="",address:t=""})=>({key:e,text:t}))),...Pt(r("addressBranch"),Kt)}):null,ql(r,!0),c?p("div",{children:[u(_t,{label:"ИНН*",...Pt(r("inn"),Yt)}),u(_t,{label:"Наименование организации",...r("fullName")})]}):null,u(hl,{label:"Способ получения ответа*",options:Mn,...Pt(r("feedbackMethod"),Kt)}),u(Ht,{label:"Телефон*",...Pt(r("phone"),qt)}),o?p("div",{children:[u(Ht,{label:"Дополнительный телефон",...r("secondaryPhone")}),u(_t,{label:"Электронная почта*",...Pt(r("email"),Kt)}),u(_t,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...r("bankEmpolee")}),u(_t,{label:"Дата и время обращения в Банк",...r("applicationDate")})]}):u(_t,{label:"Электронная почта*",...Pt(r("email"),Kt)}),u(_t,{...Pt(r("comment"),Kt),placeholder:"Ваше сообщение*",isTextarea:!0}),Rl(r("consentDataProcessing"),t,e)]})})})})),Vn=(e="",t="")=>"FEEDBACK_QS"===e&&"Юридическое лицо / ИП"===t,_n=g((e=>{const{button:t,sourceBookDir:l}=e,{regions:a}=ft(l||"regions-grant-support"),[i,r]=n({key:""}),s=re({className:"text-white",version:t?.version}),o=a?.find((e=>e.name===i.key))?.href;return p("div",{className:"container space-y-s",children:[a?u(hl,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:a.map((({name:e=""})=>({key:e,text:e}))),value:i,onChange:r}):null,o?u("div",{className:"text-center",children:u(pe,{href:o,target:"_blank",className:N("p-m w-full @xl:w-auto",s),children:t?.text?t.text:"Перейти"})}):null]})})),Fn={...Yl,phone:"",email:"",birthday:void 0,consentDataProcessing:!1},jn=kt({surname:Xt,name:Xt,phone:qt,email:Kt,birthday:Kt}),Ln=g((e=>{const{button:t,link:l,product:n,onSubmit:a}=e,r=i((e=>{const{surname:t,name:l,middleName:i,phone:r,email:s,birthday:o,consentDataProcessing:c}=e;Ct(jn(e))&&a({typeForm:"dpst",surname:t,name:l,middleName:i,email:s,consentDataProcessing:c,phoneNumber:wt(r),birthday:o?.toISOString().slice(0,10)||"",product:n||""},!0)}),[a]),[,{field:s,...o}]=Nt(Fn,r);return p("form",{className:Tt,onSubmit:o.onSubmit,children:[p(Mt,{children:[p("div",{className:Rt,children:[u(_t,{label:"Фамилия",...Pt(s("surname"),Xt)}),u(_t,{label:"Отчество (Обязательно, при наличии)",...s("middleName")}),u(Ht,{label:"Телефон",...Pt(s("phone"),qt)})]}),p("div",{className:Rt,children:[u(_t,{label:"Имя",...Pt(s("name"),Xt)}),u(Xl,{label:"Дата рождения*",...Pt(s("birthday"),Kt)}),u(_t,{label:"Электронная почта",...Pt(s("email"),Kt)})]})]}),Rl(s("consentDataProcessing"),l,t)]})})),En={...Yl,typeForm:{key:"SELFCOLLECTION",text:"Самоинкассация"},fullName:"",phone:""},On=kt({typeForm:Kt,region:Kt,fullName:Kt,phone:qt}),$n=g((({button:e,link:t,onSubmit:l})=>{const n=i((e=>{const{typeForm:t,region:n,fullName:a,phone:i}=e,r={typeForm:t.key,region:n?.text,name:a,phone:wt(i)};Ct(On(e))&&l(r,!0)}),[l]),[,{field:a,...r}]=Nt(En,n);return u("form",{className:Tt,onSubmit:r.onSubmit,children:u(Mt,{children:p("div",{className:Bt,children:[u(_t,{label:"ФИО*",...Pt(a("fullName"),Kt)}),u(ul,{field:a}),u(Ht,{label:"Телефон*",...Pt(a("phone"),qt)}),Nl(e),u(It,{link:t})]})})})}));const Un=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],Hn={typeForm:Un[0],...Yl,email:"",phone:"",comment:"",consentDataProcessing:!1},Wn=kt({typeForm:Kt,surname:Kt,name:Xt,phone:qt,email:Kt,addressBranch:Kt,consentDataProcessing:Jt}),Kn=g((({button:e,link:t,onSubmit:l,defaultType:n="PREMIUMSERVICE"})=>{const a=i((e=>{const{surname:t,name:n,middleName:a,email:i,comment:r,consentDataProcessing:s}=e,o={typeForm:e.typeForm.key,surname:t,name:n,middleName:a,phoneNumber:wt(e.phone),email:i,addressBranch:e.addressBranch?.key,comment:r,consentDataProcessing:s};console.log(o),Ct(Wn(e))&&l(o,!0)}),[l]),[r,{field:s,...o}]=Nt({...Hn,typeForm:Xn(n)},a),c=function(){const{data:e}=mt("/api/v1/premiumBranchesByRegions",pt);return e||[]}(),d=c.map((({region:e})=>({key:e,text:e}))),m=r?.region?.key,h=c.find((e=>e?.region===m))?.branches;return p("form",{className:Tt,onSubmit:o.onSubmit,children:[p(Mt,{title:"Ваши данные",children:[p("div",{className:Rt,children:[u(_t,{label:"Фамилия*",...Pt(s("surname"),Xt)}),u(_t,{label:"Отчество (Обязательно, при наличии)",...s("middleName")}),u(_t,{label:"Электронная почта*",...Pt(s("email"),Kt)})]}),p("div",{className:Rt,children:[u(_t,{label:"Имя*",...Pt(s("name"),Xt)}),u(Ht,{label:"Телефон*",...Pt(s("phone"),qt)}),u(hl,{label:"Тип обслуживания*",options:Un,...Pt(s("typeForm"),Kt)})]})]}),p(Mt,{title:"Офис банка",children:[u("div",{className:Rt,children:u(hl,{label:"Регион*",placeholder:"Выберите регион",options:d,...Pt(s("region"),Kt)})}),u("div",{className:Rt,children:u(hl,{className:"w-full",label:"Адрес*",placeholder:"Выберите отделение",options:(h||[]).map((({address:e=""})=>({key:e,text:e}))),...Pt(s("addressBranch"),Kt)})})]}),u(_t,{...s("comment"),placeholder:"Комментарий, удобное время и прочее",isTextarea:!0}),Rl(s("consentDataProcessing"),t,e)]})})),Xn=e=>Un.find((t=>t.key===e)),Yn=g((({name:e,text:t,value:l,checked:n,onChange:a,className:i})=>u("div",{className:i,children:p("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[u("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)}),t?u(Ae,{color:"text-primary-text",children:t}):null]})}))),qn=e=>{const{value:t,onChange:l}=e("vedTypes");return u(Mt,{children:p("div",{className:"gap-xl grid @xl:flex @xl:items-center",children:[u(Yn,{name:"vedTypes",text:"Валютный контроль",value:"currencyControl",checked:"currencyControl"===t,onChange:e=>l&&l(e)}),u(Yn,{name:"vedTypes",text:"Документарные операции",value:"documentOperations",checked:"documentOperations"===t,onChange:e=>l&&l(e)}),u(Yn,{name:"vedTypes",text:"Конверсионные операции",value:"conversionTransactions",checked:"conversionTransactions"===t,onChange:e=>l&&l(e)}),u(Yn,{name:"vedTypes",text:"Иные вопросы ВЭД",value:"otherIssues",checked:"otherIssues"===t,onChange:e=>l&&l(e)})]})})},Gn=({textField:e,text:t,placeholder:l="",error:n})=>p("div",{children:[p("label",{className:"space-y-xs",htmlFor:"textarea",children:[t?u("div",{children:u(Ae,{size:"text-m",font:"font-light",children:t})}):null,u("textarea",{id:"textarea",placeholder:l,className:N("block w-full resize-y min-h-24 p-m outline-none border rounded-md border-gray","hover:border-primary-hover active:focus:border-primary-text focus:border-primary-text"),value:e.value,onInput:t=>e.onChange&&e.onChange(t.target?.value||"")})]}),Vt(n)]}),Jn=({field:e,regions:t})=>{const l="currencyControl"===e("vedTypes").value;return p("div",{className:"space-y-s",children:[l?u(hl,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:t.map((({code:e="",name:t=""})=>({key:e,text:t}))),...Pt(e("region"),Kt)}):null,p("div",{className:"grid @xl:grid-cols-2 @xl:gap-x-lg gap-s",children:[l?u(_t,{label:"ИНН",...Pt(e("inn"),Yt)}):null,u(_t,{label:"Наименование организации",...Pt(e("fullName"),Kt)}),u(_t,{label:"ФИО",...Pt(e("name"),Xt)}),u(Ht,{label:"Телефон",...Pt(e("phone"),qt)}),l?null:u(_t,{label:"Электронная почта",...Pt(e("mail"),Kt)})]})]})},Qn={fullName:"",name:"",phone:"",inn:"",vedTypes:"currencyControl",text:""},Zn={fullName:Kt,name:Xt,phone:qt},ea=kt({...Zn,mail:Kt}),ta=kt({...Zn,inn:Yt,region:Kt}),la=e=>"currencyControl"===e,na=e=>({currencyControl:"currencyControl"===e,documentOperations:"documentOperations"===e,conversionTransactions:"conversionTransactions"===e,otherIssues:"otherIssues"===e}),aa={ApplicationFormBusinessCard:ln,ApplicationFormWed:g((e=>{const{button:t,link:l,onSubmit:n}=e,a=i((e=>{const{fullName:t,name:l,phone:a,mail:i,inn:r,region:s,vedTypes:o,text:c}=e,d={typeForm:"KVED",fullName:t,name:l,phone:wt(a),text:c,vedTypes:na(o),PartnerComments:c,...la(o)?{inn:r,region:s?.text||""}:{mail:i}};Ct((e=>la(e)?ta:ea)(o)(e))&&n(d)}),[n]),[,{field:r,...s}]=Nt(Qn,a),o=el(),c=r("text");return p("form",{className:"container space-y-lg",onSubmit:s.onSubmit,children:[qn(r),u(S,{headingType:"h6",title:"Данные организации",className:"@xl:text-center"}),Jn({field:r,regions:o}),Gn({textField:c,text:"Обращение",placeholder:"Укажите интересующий вас вопрос, место ведения бизнеса и удобное время для телефонного звонка"}),Nl(t),u(It,{link:l}),u(S,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),p("div",{className:"flex gap-xl",children:[p("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:[u(ee,{image:{icon:"PhoneIcon"},width:"24",height:"24"}),u("span",{children:"8 (800) 200-78-70"})]}),p("a",{className:"flex gap-s items-center text-primary-text no-underline","aria-label":"ved@rshb.ru",href:"mailto:ved@rshb.ru",children:[u(ee,{image:{icon:"MailIcon"},width:"24",height:"24"}),u("span",{children:"ved@rshb.ru"})]})]})]})})),ApplicationFormDeposit:Bn,ApplicationFormCredit:Sn,ApplicationFormAcquiring:Cl,ApplicationFormGrantSupport:_n,ApplicationFormIndividuals:Ln,ApplicationFormFeedback:Dn,ApplicationFormAntiFraud:Ql,ApplicationFormCorruption:rn,ApplicationFormSelfCollection:$n,ApplicationFormUltraPremium:Kn},ia=g((({responseType:e})=>{const t="OK"===e;return p("div",{className:`flex items-center p-lg rounded-md space-x-m ${t?"bg-ok":"bg-fail"}`,children:[u(ee,{image:{icon:(t?"ResponseOKIcon":"ResponseFailIcon")?"ResponseOKIcon":"ResponseFailIcon",iconVersion:"normal"},width:"42",height:"42"}),p("div",{children:[u(S,{headingType:"h6",title:t?"Ваша заявка отправлена":"Не удалось отправить заявку",className:"mb-2xs"}),u(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t?"Совсем скоро мы с вами свяжемся":"Пожалуйста, повторите позднее"})]})]})})),ra={send:async function(e,t=!1){const l=t?"/api/v1/lead":"/api/v1/sendcorporatelead";try{const t=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(e)});return t?.ok?await t.json():null}catch(e){return null}}},sa=g((e=>{const{className:t,formBlock:l,...a}=e,[r,s]=n(""),o=i((async(e,t=!1)=>{const l=await ra.send(e,t)?"OK":"Fail";return s(l),l}),[]);return u(k,{className:t,defaultPadding:"p-6xl",...a,children:p("div",{className:"container max-w-[978px] space-y-lg",children:[l?.title?u(S,{headingType:"h3",title:l.title,className:"@xl:text-center"}):null,l?oa(l,o):null,r?u(ia,{responseType:r}):null]})})})),oa=(e,t)=>{const l=e?.formType;if(!l||!(l in aa))return null;return u(aa[l],{...e,onSubmit:t})},ca="text-center",da={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},ma=g((({className:e,defaultIconSize:t=44,iconBgVersion:l="primary",size:n,icon:a,...i})=>{const r=String(n?.width||t);return a?u("div",{style:{width:`${r}px`,height:`${r}px`},className:N("rounded-icon object-fit flex justify-center items-center",da[l],e),children:u(W,{...i,width:"54%",height:"54%",name:a})}):null})),ha=g((({className:e="",title:t,benefitList:l,...n})=>p(k,{className:e,defaultPadding:"p-6xl",...n,children:[t?u(S,{headingType:"h3",as:"h2",className:ca,title:t}):null,l?.length?u("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:l.map(ua)}):null]}))),ua=({label:e,description:t,items:l,icon:n,iconBgVersion:a,isDotted:i=!1},r)=>p("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[n?.icon?u(ma,{className:"shrink-0",defaultIconSize:44,iconBgVersion:a||"",...n}):null,n?.src?u(ee,{className:"shrink-0",image:n}):null,e?p("div",{className:"@sm:h-full space-y-xs",children:[u(S,{headingType:"h6",children:e}),u(Ae,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),u(Ge,{dotClassName:"bg-secondary-text",listItemSize:"S",items:l,isDotted:i})]}):null]},String(r)),pa=e=>({icon:t,title:l,description:n},a)=>p("div",{className:N("flex flex-col gap-1","items-center",n||l?"":"justify-center"),children:[l?u(Ae,{size:"text-h6",font:"font-normal",align:e,children:l}):null,t?u(ee,{image:t,height:"180",className:"w-auto mx-auto"}):null,n?u(Ae,{size:"text-h6",font:"font-normal",align:e,children:n}):null]},String(a)),ga=(e,t,l)=>u("div",{className:`grid gap-2xs ${xa(t)}`,children:e.map(pa(l))}),xa=e=>{switch(e){case"3":return"grid-cols-3";case"4":return"grid-cols-4";default:return"grid-cols-5"}},fa=g((({bonusBenefits:e,cardTextAlign:t="text-center",className:l="",columnsCount:n="4",subtitle:a,title:i,...r})=>p(k,{className:N("space-y-3xl",l),defaultPadding:"p-6xl",...r,children:[u(B,{defaultPadding:"",title:i,description:a,headlineVersion:"M"}),e?.length?ga(e,n,t):null]}))),ba={start:"justify-start",center:"justify-center",end:"justify-end"},ya=g((({buttons:e,className:t="",align:l,...n})=>{const a=l?N("flex",ba[l]):"";return u(k,{className:N("!bg-transparent",a,t),defaultPadding:"p-0",...n,children:He(e)})})),va=(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}]},Na=g((({className:e,disabled:t,...l})=>u(pe,{rounded:!0,className:N("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:u(ee,{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"})}))),wa=g((e=>u(Na,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),ka=g((e=>u(Na,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"})));function Ca({dec:e,inc:t,canDec:l,canInc:n,btnClass:a,className:i=""}){return l||n?p("div",{children:[l?u(Na,{className:N("absolute z-40",a[0],i),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!l}):null,n?u(Na,{className:N("absolute z-40 rotate-180",a[1],i),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!n}):null]}):null}const Sa=g((({className:e,title:t,value:l,fractionDigits:n,fixed:a,prefix:i,postfix:r})=>p("div",{className:N("flex justify-between @xl:flex-col",e),children:[t?u(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t}):null,u("div",l?{children:u(Ae,{size:"text-h3",children:[i,Je(n,{fixed:a})(l),r].filter(Boolean).join(" ")})}:{children:u(Ae,{size:"text-h3",children:"-"})})]}))),Ia=1e4,Ta=5e6,Ba=Math.round(29.5),Pa={minSum:Ia,maxSum:Ta,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Ma={minSum:Ia,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},Ra={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Aa={minSum:5e4,maxSum:5e6,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0},za={minSum:1e3,maxSum:5e5,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Da=e=>e?u(I,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e}):null,Va=g((({rate:e=0,title:t="Ставка",unit:l,fractionDigits:n=2,depositeName:a,isShowDepositeName:i})=>p("div",{children:[u(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t}),p("div",{className:"relative",children:[p("div",{className:"flex justify-start gradient-color-text",children:[u("span",{className:"font-mohave text-title-huge pr-xl -mt-m tracking-[-15px]",children:Je(n,{fixed:!0})(e)}),l?u("span",{className:"text-7xl",children:l}):null]}),a&&i?u("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:a}):null]})]}))),_a=g((({title:e="Ставка",isUnavailableByTerm:t=!1})=>p("div",{className:"space-y-s",children:[u(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),u(W,{className:"w-10 h-10 @5xl:h-auto @5xl:w-40",name:"PercentIcon"}),u("div",{className:"w-64",children:t?p(I,{size:"text-xl",font:"font-light",color:"text-primary-text",children:["Процентная ставка для срока ",u("strong",{children:"1-30 дней"})," устанавливается при обращении в Банк"]}):u(I,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Выберите другую сумму или срок"})})]}))),Fa=({title:e="Ставка",rate:t=0,unit:l="%",fractionDigits:n=2,isUnknownRateShown:a=!0,...i})=>a&&0===t?u(_a,{title:e,...i}):p("div",{children:[u("div",{className:"hidden @xl:block",children:u(Va,{title:e,rate:t,unit:l,fractionDigits:n,...i})}),u("div",{className:"@xl:hidden",children:u(Sa,{title:e,value:t,postfix:l,fractionDigits:n,fixed:!0,...i})})]});function ja({isShowItems:e=!0,step:t=1e3,...l}){const n=[`От ${Je(2)(l.min||0)} ₽`,`До ${Je(2)(l.max||0)} ₽`];return u(yn,{items:e?n:[],step:t,...l})}function La(e){const{data:t}=mt(`/wcms-resources/${e}.json`,pt);return t}const Ea=(e,t)=>{const{travelExpenseValue:l,restExpenseValue:n}=e,a=La(t||"bonus-calculator-data")||Ra,[i,r]=((e,t,l)=>{const{minSumTravel:n,minSumOther:a,maxBonus:i,prefMonthsNum:r,prefTravelBonusRate:s,prefRestBonusRate:o,travelBonusRate:c,restBonusRate:d}=e;if(t===n&&l===a)return[0,0];const m=Math.min(Math.round(s*t)+Math.round(o*l),i);return[m,m*r+Math.min(Math.round(c*t)+Math.round(d*l),i)*(12-r)]})(a,l,n);return{...a,...e,monthBonus:i,yearBonus:r}},Oa=g((({className:e="",sourceBookDir:t,buttons:l,footnote:n})=>{const[a,{field:i}]=Nt({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:r,maxSumTravel:s,minSumOther:o,maxSumOther:c,monthBonus:d,yearBonus:m}=Ea(a,t);return p("section",{className:N("flex flex-col justify-between @5xl:flex-row gap-y-4xl",e),children:[p("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:[ja({title:"Сумма покупок в категории путешествия, ₽",min:r,max:s,step:500,isShowItems:!1,...i("travelExpenseValue")}),ja({title:"Сумма покупок в остальных категориях, ₽",min:o,max:c,step:500,isShowItems:!1,...i("restExpenseValue")})]}),d>=0?Fa({title:"Баллов за месяц",rate:d,fractionDigits:0,isUnknownRateShown:!1,unit:""}):null,p("div",{className:"flex flex-col gap-y-xl @xl:w-96",children:[m>=0?u(Sa,{title:"Баллов за год",value:m}):null,He(l,{isVertical:!0}),Da(n)]})]})})),$a=g((({className:e,inputChildren:t,rateChildren:l,resultChildren:n})=>p("section",{className:N("flex flex-col justify-between @5xl:flex-row gap-m",e),children:[u("div",{className:"flex flex-col gap-y-m sm:max-w-md gap-2xl",children:t}),u("div",{className:"border-b border-main-divider md:hidden"}),l,u("div",{className:"flex flex-col gap-2xl sm:w-96 max-w-full",children:n})]}))),Ua=(e,t=0)=>e?.sum&&e.sum>=Ia&&e.sum<=Ta?e.sum:t,Ha=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,Wa=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,Ka={horizontal:"gap-5xl",vertical:"flex-col gap-s"},Xa=g((({items:e,checkedItem:t,className:l,onChange:n,orientation:a="horizontal"})=>u("div",{className:N(`flex ${Ka[a]}`,l),children:e?.map((({id:e,text:l})=>u(Bl,{isRadio:!0,text:l,value:t===e,onChange:()=>n&&n(e)},String(e))))}))),Ya=({items:e,title:t,mobileTitle:l=t,orientation:n="horizontal",value:a,radioGroupClassName:i,onChange:r})=>p("div",{className:"space-y-s",children:[t?u("div",{className:"hidden @5xl:block",children:u(Ae,{color:"text-secondary-text",font:"font-light",children:t})}):null,l?u("div",{className:"@5xl:hidden",children:u(Ae,{color:"text-secondary-text",font:"font-light",children:l})}):null,u(Xa,{orientation:n,items:e,checkedItem:e[a?0:1].id,className:N("flex-col sm:flex-row",i),onChange:t=>r&&r(t===e[0].id)})]}),qa=e=>Ya({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),Ga=e=>e,Ja=(e=Ga)=>t=>t.reduceRight(((t,l)=>e(t)>e(l)?t:l)),Qa=Ja(),Za=(e=Ga)=>Ja((t=>-e(t))),ei=Za(),ti=([e,t],l,n=[])=>l&&l[e]&&l[t]?{[e]:l[e],[t]:l[t]}:li([e,t],n),li=([e,t],l=[])=>({[e]:l.length?ei(l.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:l.length?Qa(l.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),ni=(e,[t,l],n)=>e>=n[t]&&e<=n[l],ai=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,ii=(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)},ri=g((({className:e="",rateParams:t,buttons:l,footnote:n,bottomFootnote:a,isShowDepositeName:i,defaultParams:r})=>{const[s,{field:o}]=Nt({moneyValue:Ua(r,1e5),daysValue:Ha(r,90),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),c=((e,t)=>{const{daysValue:l,moneyValue:n,isPartialWithdrawal:a,isReplenished:i,isMonthlyInterestPayment:r}=e,s=La(t||"business-calculator-data"),o=i||a,c=l<90||l>730;if(l<=30)return{...za,...e,isDisabledOperatingDeposit:c,isUnavailableByTerm:!0};const d=s?.rateRows?.find((e=>r===e.isMonthlyInterestPayment&&ai(o,e)&&ni(n,["minSum","maxSum"],e)&&ni(l,["minDays","maxDays"],e)))||za,{rate:m}=d,h=ii(m,e),u=n+h,p=s?.rateRows||[za];return{...d,...li(["minSum","maxSum"],p),...li(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:c,income:h,finalSum:u}})(s,t?.rateType&&t.sourceBookDir),{income:d,finalSum:m,rate:h,isUnavailableByTerm:g,depositeName:x}=c;return u($a,{className:e,inputChildren:p("div",{children:[ja({title:"Сумма, ₽",min:c.minSum,max:c.maxSum,...o("moneyValue"),value:c.moneyValue}),(f={title:"Срок, дней",min:c.minDays,max:c.maxDays,...o("daysValue"),value:c.daysValue},u(yn,{items:[`От ${Wa(f.min||0)}`,`До ${Wa(f.max||0)}`],step:1,...f})),p("div",{className:"flex flex-col sm:flex-row gap-y-4 gap-x-14",children:[si(c,o),qa({title:"Выплата процентов",orientation:"vertical",...o("isMonthlyInterestPayment"),radioGroupClassName:"sm:flex-col"})]})]}),rateChildren:Fa({rate:h,depositeName:x,isShowDepositeName:i,isUnavailableByTerm:g}),resultChildren:p("div",{children:[oi(m,d),He(l,{isVertical:!0}),Da(n),Da(a)]})});var f})),si=(e,t)=>p("div",{className:"space-y-s",children:[u(Ae,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),p("div",{className:"flex flex-col gap-y-xl sm:gap-y-s",children:[u(Bl,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),u(Bl,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),oi=(e,t)=>p("div",{className:"flex flex-col gap-2xl sm:gap-0 mb-lg",children:[u(Sa,{title:"Доход в конце срока",value:t,postfix:"₽",prefix:"+"}),u(Sa,{title:"Сумма в конце срока",value:e,postfix:"₽"})]}),ci=({min:e=0,max:t=0,availableMonths:l,...n})=>u(yn,{items:[`От ${di(e)}`,`До ${di(t)}`],step:1,...l?.length?{list:l}:{min:e,max:t},...n}),di=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,mi=e=>Ya({...e,radioGroupClassName:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),hi=e=>ui({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&ui({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&ui({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&ui({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),ui=({row:e,userInputParams:t,paramsViewSettings:l,fieldKey:n,viewSettingFieldKey:a})=>!!l&&!l[a]||t[n]===e[n],pi=(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)},gi=(e,t,l)=>{const{moneyValue:n,monthsValue:a}=e,i=La(t||"credit-calculator-data"),s=i?.rateRows||[Pa],o=(({limitRows:e,userInputParams:t,paramsViewSettings:l})=>e?.find((e=>hi({row:e,userInputParams:t,paramsViewSettings:l}))))({limitRows:i?.limitRows||[],userInputParams:e,paramsViewSettings:l}),{minSum:c,maxSum:d}=ti(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:h}=ti(["minMonths","maxMonths"],o,s),u=(({rateRows:e=[],userInputParams:t,paramsViewSettings:l,moneyValue:n,monthsValue:a})=>e?.find((e=>hi({row:e,userInputParams:t,paramsViewSettings:l})&&ni(n,["minSum","maxSum"],e)&&ni(a,["minMonths","maxMonths"],e)))||Pa)({rateRows:s,userInputParams:e,paramsViewSettings:l,moneyValue:n,monthsValue:a}),{rate:p}=u,g=pi(p,e);return r((()=>({...u,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:h,moneyValue:n,monthsValue:a,monthlyPayment:g})),[e,i])},xi=g((({className:e,sourceBookDir:t,buttons:l,footnote:n,paramsViewSettings:a,defaultParams:i})=>{const[r,{field:s}]=Nt({moneyValue:Ua(i,2e5),monthsValue:Ha(i,Ba),isAnnuity:Boolean(i?.isAnnuity),isInsurance:Boolean(i?.isEnableInsurance),isSalaryClient:Boolean(i?.isEnableSalaryClient),isPensionClient:Boolean(i?.isEnablePensionClient),isStateEmployee:Boolean(i?.isEnableStateEmployee)}),o=gi(r,t,a),c=mi({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...s("isAnnuity")});return u($a,{className:e,inputChildren:p("div",{children:[ja({title:"Сумма кредита, ₽",step:500,min:o.minSum,max:o.maxSum,...s("moneyValue"),value:o.moneyValue}),ci({title:"Срок кредита, месяцев",min:o.minMonths,max:o.maxMonths,...s("monthsValue"),value:o.monthsValue}),fi({...o,...a},s),u("div",{className:"sm:hidden",children:c})]}),rateChildren:Fa({rate:o.rate}),resultChildren:p("div",{children:[u(Sa,{title:"Ежемесячный платёж",value:o.monthlyPayment,postfix:"₽"}),u("div",{className:"hidden sm:block mb-lg",children:c}),He(l,{isVertical:!0}),Da(n)]})})})),fi=(e,t)=>p("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?u(Bl,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?u(Bl,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?u(Bl,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?u(Bl,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),bi=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},yi=(e,t,l)=>{const{moneyValue:n,monthsValue:a}=e,i=La(t||"deposit-calculator-data"),r=i?.rateRows?.[0]?wi(i.rateRows[0].minMonths,i.rateRows[0].maxMonths):0,s=!l?.isShowMonthlyInterestPayment,o=!l?.isShowRemoteRegistration,c=i?.rateRows?.find((t=>Ni({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:s})&&Ni({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:o})&&ni(n,["minSum","maxSum"],t)&&ni(a||r,["minMonths","maxMonths"],t)))||Aa,{rate:d}=c,m=vi(d,e),h=n+m,u=i?.rateRows||[Aa];return{...c,...li(["minSum","maxSum"],u),...li(["minMonths","maxMonths"],u),availableMonths:bi(u.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:r,income:m,finalSum:h}},vi=(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)},Ni=({row:e,userInputParams:t,paramKey:l,isExclude:n})=>n||t[l]===e[l],wi=(e,t)=>e+Math.round((t-e)/2),ki=g((({className:e,sourceBookDir:t,buttons:l,footnote:n,paramsViewSettings:i,defaultParams:r})=>{const[s,{field:o}]=Nt({moneyValue:Ua(r,2e4),monthsValue:Ha(r),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(r?.isRemoteRegistration)}),c=yi(s,t,i),{defaultMonth:d,rate:m,income:h,finalSum:g}=c,{onChange:x}=o("monthsValue");return a((()=>{!s.monthsValue&&x&&x(d)}),[d]),u($a,{className:e,inputChildren:p("div",{children:[ja({title:"Сумма, ₽",min:c.minSum,max:c.maxSum,...o("moneyValue"),value:c.moneyValue}),ci({title:"Срок, месяцев",min:c.minMonths,max:c.maxMonths,availableMonths:c.availableMonths,...o("monthsValue"),value:c.monthsValue}),Ci({...c,...i},o)]}),rateChildren:Fa({rate:m}),resultChildren:p("div",{children:[u(Sa,{title:"Доход в конце срока",value:h,postfix:"₽",prefix:"+"}),u(Sa,{title:"Сумма в конце срока",value:g,postfix:"₽"}),He(l,{isVertical:!0}),Da(n)]})})})),Ci=(e,t)=>{return p("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowMonthlyInterestPayment?qa({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment}):null,e.isShowRemoteRegistration?(l={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration},Ya({...l,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]});var l},Si=e=>Ii({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Ii({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Ii=({row:e,userInputParams:t,paramsViewSettings:l,fieldKey:n,viewSettingFieldKey:a})=>!!l&&!l[a]||t[n]===e[n],Ti=(e,t,l)=>{const{moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:s}=e,o=La(t||"refinancing-calculator-data"),c=o?.rateRows||[Ma],d=(({limitRows:e,userInputParams:t,paramsViewSettings:l})=>e?.find((e=>Si({row:e,userInputParams:t,paramsViewSettings:l}))))({limitRows:o?.limitRows||[],userInputParams:e,paramsViewSettings:l}),{minSum:m,maxSum:h}=ti(["minSum","maxSum"],d,c),{minMonths:u,maxMonths:p}=ti(["minMonths","maxMonths"],d,c),g=(({rateRows:e=[],userInputParams:t,paramsViewSettings:l,moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r})=>e?.find((e=>Si({row:e,userInputParams:t,paramsViewSettings:l})&&ni(n+r,["minSum","maxSum"],e)&&ni(i,["minSumOld","maxSumOld"],e)&&ni(r,["minSumExtra","maxSumExtra"],e)&&ni(a,["minMonths","maxMonths"],e)))||Ma)({rateRows:c,userInputParams:e,paramsViewSettings:l,moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:s}),{rate:x}=g,f=pi(x,e),b=e.oldMonthlyPayment-f;return r((()=>({...g,...e,minSum:m,maxSum:h,minMonths:u,maxMonths:p,moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:s,monthlyPayment:f,benefit:b})),[e,o])},Bi=g((({className:e,sourceBookDir:t,buttons:l,footnote:n,paramsViewSettings:a})=>{const[i,{field:r}]=Nt({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),s=Ti(i,t,a),o=mi({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...r("isAnnuity")});return u($a,{className:e,inputChildren:p("div",{children:[ja({title:"Остаток долга в других банках, ₽ ",step:500,min:s.minSum,max:s.maxSum-s.maxSumExtra,...r("moneyValue"),value:s.moneyValue}),ja({title:"Ежемесячный платёж в других банках, ₽",step:500,min:s.minSumOld,max:s.maxSumOld,...r("oldMonthlyPayment"),value:s.oldMonthlyPayment}),ci({title:"Новый срок кредита, месяцев",min:s.minMonths,max:s.maxMonths,...r("monthsValue"),value:s.monthsValue}),Pi({...s,...a},r),s.isExtraMoney?ja({title:"Дополнительная сумма, ₽ ",step:500,min:s.minSumExtra,max:s.maxSumExtra,...r("moneyExtra"),value:s.moneyExtra}):null,u("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:o})]}),rateChildren:Fa({rate:s.rate,fractionDigits:1}),resultChildren:p("div",{children:[u(Sa,{title:"Ежемесячный платёж",value:s.monthlyPayment,postfix:"₽"}),s.benefit>0?u(Sa,{title:"Выгода в месяц",value:s.benefit,postfix:"₽"}):null,u("div",{className:"hidden sm:block mb-lg",children:o}),He(l,{isVertical:!0}),Da(n)]})})})),Pi=(e,t)=>p("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?u(Bl,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?u(Bl,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,u(Bl,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),Mi={CreditCalculatorForm:xi,DepositCalculatorForm:ki,BusinessDepositCalculatorForm:ri,BonusCalculatorForm:Oa,RefinancingCalculatorForm:Bi},Ri=(e,t)=>{const l=e?.calcType;if(!l||!(l in Mi))return null;const n=Mi[l];return u("section",{className:"box-border relative bg-white flex shrink-0 self-start basis-full",role:"listitem",children:p("div",{className:"box-border p-4xl w-full space-y-xl",children:[e?.title?u(S,{className:"text-center",title:e.title}):null,u(n,{...e})]})},String(t))},Ai=g((({className:e="",tabAlign:t,calculatorTabs:l=[],...a})=>{const r=l.map((e=>e.nav||{})),s=l.map((({calculatorBlock:e})=>e||{})),[o,c]=n(0),d=i((e=>c(e)),[]),[m,h]=va({itemCount:l?.length,visibleItemCount:3});return p(k,{className:N("box-border overflow-hidden relative",e),defaultPadding:"p-0",...a,children:[p("div",{className:"bg-white",children:[r.length>1?zi({activeIndex:m,tabsNav:r,tabAlign:t,slideIndexShift:o,onClick:d}):null,Ca({...h,btnClass:["left-3","right-3"],className:"top-10"})]}),u("div",{className:"flex",style:{transform:`translateX(-${o}00%)`},role:"list",children:s?.length?s.map(Ri):null})]})}));function zi({activeIndex:e,tabsNav:t,tabAlign:l,slideIndexShift:n,onClick:a}){return p("div",{children:[u("div",{style:{transform:`translateX(-${388*e}px)`},className:"flex flex-col justify-end items-center h-32 pt-4xl box-border duration-1000",children:u("div",{className:N("w-full flex flex-nowrap items-end gap-xs",l?ba[l]:""),children:t.map(((e,t)=>function({tab:e,i:t,isActive:l,onClick:n}){const a=l?"w-96 p-m border-none bg-primary-main text-white":"w-96 p-s ease-in duration-300 bg-white text-primary-text",i=l?"text-xl mb-xs":"text-l mb-2xs",r=l?"text-l font-light text-white":"text-m font-light text-secondary-text",s=l?"":"text-primary-main",o=e?.icon?.iconVersion,c=l?"white":"normal";return p("button",{type:"button",onClick:n,"aria-label":e?.title,className:N("box-border relative border border-gray cursor-pointer text-left border-b-0 flex space-x-m min-h-20",a),children:[u(ee,{className:N("h-6 w-6 min-w-6 min-h-6",s),image:{...e?.icon,iconVersion:o??c},width:"24",height:"24"}),p("div",{className:"border-0",children:[u("div",{className:i,children:e?.title}),u("div",{className:r,children:e.description})]})]},String(t))}({tab:e,i:t,isActive:Boolean(t===n),onClick:()=>a(t)})))})}),u("div",{className:"w-full h-2 bg-primary-main"})]})}const Di=g((e=>{const{onChange:t,min:l,max:n,defaultValue:a="0",fractionDigits:r=0,...s}=e,o=un(e,{normalize:(e=a)=>l&&n?String(pn(Number(Vi(e)),l,n)):Vi(e),format:Je(r)}),c=i((e=>t&&t(Vi(e))),[t]);return u(At,{onChange:c,...s,...o})})),Vi=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),_i=g((e=>u(Di,{...e,fractionDigits:2,children:u("div",{className:"absolute right-4 bottom-4",children:u(Ae,{size:"text-xl",font:"font-light",children:"₽"})})}))),Fi={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},ji={amount:1500},Li=g((({className:e="",title:t="Укажите сумму перевода",label:l="Сумма перевода",placeholder:i="1500",button:r,formType:s="private",...o})=>{const[{amount:c},{field:d}]=Nt(ji),[m,h]=n(!1);return a((()=>{h(c<=0)}),[c]),p(k,{className:N("flex flex-col items-center",e),defaultPadding:"p-6xl",...o,children:[t?u(S,{className:"pb-lg xl:pb-4xl self-start xl:self-center",headingType:"h3",title:t}):null,p("form",{className:"w-full xl:max-w-[468px]",method:"POST",action:Fi[s],children:[u(_i,{valid:!m,placeholder:i,label:l,...d("amount",{parse:Number,format:String})}),u("input",{type:"hidden",name:"amount",value:c}),r?.text?u(vl,{className:"w-full mt-lg",type:"submit",disabled:m,children:r.text}):null]})]})})),Ei=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function Oi(e,{sensitivity:t,rootRef:l}={}){const n=s(null),i=r((()=>({threshold:$i(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}function $i(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 Ui=g((({className:e,style:t,idx:l,activeIndex:n,observerOptions:a,children:r,onIntersection:s})=>{const o=Oi(i((e=>{e.length&&s&&s(l||0,e[e.length-1])}),[s,l]),a);return u("div",{className:N("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(l===n),ref:o,children:r})})),Hi=["min-w-full","@lg:min-w-[50%]","@lg:min-w-[33.3%]","@lg:min-w-[25%]"],Wi=g((({className:e,itemClassName:t,containerRef:l,activeIndex:n,visibleItemCount:a=0,gap:r=0,padding:o=0,listType:c="horizontal-list",snapAlign:d="snap-center",minHeight:m,children:h,onVisibleItemsChange:p,onVisibleIndicesChange:g})=>{const x={sensitivity:1,rootRef:l},f=s([]),b=i(((e,t)=>{const l=[...f.current||[]];l[e]=t,f.current=l,p&&p(l),g&&g(Xi(l))}),[p,g]),y=a>0?r*Number(a)-1:0,v="vertical-list"===c,w="horizontal-list"===c,k={...w?Ki(o,y):{},...v?Ei(m):{},gap:`${r}px`};return u("div",{className:N("box-border overflow-auto no-scrollbar",c,e),style:k,ref:l,children:(C=(e,l)=>u(Ui,{className:N(d,a?Hi[a-1]:"",v?"h-full":"",t),style:w?Ki(o/4):{},activeIndex:n,idx:l,observerOptions:x,onIntersection:b,children:e},String(l)),e=>null==e?e:Array.isArray(e)?e.map(C):C(e,0))(h)});var C})),Ki=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Xi=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Yi={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},qi={"horizontal-list":"w-6","vertical-list":"h-6"},Gi=g((({className:e="",containerRef:t,activeIndex:l,dotCount:n=0,listType:a="horizontal-list",version:i})=>n?u("div",{className:N("flex gap-xs",Yi[a],i?"group":"",e),"data-ver":i,children:Array.from({length:n}).fill(null).map(((e,n)=>u("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?qi[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)),Ji=e=>t=>e.scrollWidth/t,Qi=e=>(t,l)=>{e.scrollBy({left:l*Ji(e)(t),behavior:"smooth"})},Zi=({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?[Za()(a),Ja()(a)]:[-1,-1],m=c>0,h=d<e-1,u=i((()=>{var t;l.current&&(m?Qi(l.current)(e,-1):(t=l.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=i((()=>{l.current&&(h?Qi(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}]},er="absolute top-[calc(50%-24px)] z-40",tr="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",lr=g((({scroll:e,activeIndex:t,itemCount:l,arrowsPadded:n,hasEdgeBlocks:a,onScrollLeft:r,onScrollRight:s})=>{const{canScrollLeft:o,canScrollRight:c,scrollLeft:d,scrollRight:m}=e,h=a?t>0:o,g=a?t<l-1:c,x=i((()=>{a?(o&&t!==l-1&&d(),r()):d()}),[d,r,a,o,t,l]),f=i((()=>{a?(c&&0!==t&&m(),s()):m()}),[m,s,a,o,t,l]);return p("div",{className:"hidden @lg:block",children:[nr(e),h?u(wa,{className:N(er,n?"left-1 @lg:left-8":"left-0"),onClick:x}):null,g?u(ka,{className:N(er,n?"right-1 @lg:right-8":"right-0"),onClick:f}):null]})})),nr=e=>p("div",{children:[e.canScrollLeft?u("div",{className:N(tr,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?u("div",{className:N(tr,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),ar=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",ir=({className:e,text:t="ХИТ"}={})=>p("div",{className:N("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[u(W,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),u(I,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),rr="relative h-full",sr={small:"sm:min-w-64",normal:"sm:min-w-96",big:"sm:min-w-[515px]"},or=({noCardBorder:e,activeIndex:t,cardSize:l="normal",...n})=>{const{blocks:a}=n.block||{},i=a?.some(mr);return D({...n,renderProps:(n,a,r)=>p("div",{className:cr(n,{someCardsHighlighted:i}),children:[R(n,a,{className:dr(n,{someCardsHighlighted:i,showBorder:!e,cardSize:l}),blockIndex:r,isActive:r===t}),mr(n)?ir({className:"absolute top-0 -right-4 z-40"}):null]},String(r))})},cr=(e,{someCardsHighlighted:t})=>N(rr,t&&(mr(e)?"pt-3xl":"pt-3xl sm:pt-16")),dr=(e,{someCardsHighlighted:t,showBorder:l,cardSize:n="normal"})=>N(rr,"min-w-80",sr[n],t&&(mr(e)?"pt-3xl sm:pt-16":"pt-3xl"),ar(l),l&&"h-full"),mr=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,hr=g((({className:e,itemCount:t,visibleItemCount:l=1,noCardBorder:n,isAlignCenter:a,arrowsPadded:i=!0,isGap:r=!0,cardSize:s="normal",...o})=>{const{blocks:c=[]}=o.block||{},d=t||c?.length,[m,{inc:h,dec:g}]=va({itemCount:d,visibleItemCount:l},Math.floor(l/2)),[x,f]=Zi({itemCount:d}),[b]=f.visibleIndicesRange,y=c&&"CarouselBankHistoryCard"===c[0]?.type;return p(k,{className:e,defaultPadding:"p-6xl",...o,children:[p("div",{className:N(a?"flex justify-center":"","relative max-w-full"),children:[u(Wi,{containerRef:x,visibleItemCount:l,snapAlign:"snap-start",gap:r?16:void 0,onVisibleIndicesChange:f.handleVisibleIndicesChange,children:or({noCardBorder:n,activeIndex:m,cardSize:s,...o})}),u(lr,{scroll:f,arrowsPadded:i,onScrollLeft:g,onScrollRight:h,hasEdgeBlocks:y,activeIndex:m,itemCount:d})]}),u(Gi,{className:"@5xl:hidden",containerRef:x,activeIndex:b,dotCount:d,listType:"horizontal-list"})]})}));hr.childrenTypes=["CarouselCard","CarouselBankHistoryCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],hr.childSchema=()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}});const ur=g((({className:e,title:t,description:l,blockIndex:n=0,isActive:a,...i})=>u(k,{className:N("relative flex h-[485px]",a?"w-[440px] z-10":"w-[340px]",e),defaultPadding:"p-0",...i,children:u("div",{className:N("basis-full self-center",pr(n)),children:a?u(B,{headlineVersion:"M",title:t,description:l,padding:"p-3xl",align:"text-left",className:"h-96 text-white shadow-dark-blue"}):u("div",{className:"h-[300px] flex justify-center items-center font-mohave text-title-large",children:u("span",{className:gr(n),children:t})})})}))),pr=e=>["bg-primary-main","bg-green-light","bg-yellow-light"][e%3],gr=e=>["gradient-color-text-on-green","gradient-color-text-on-yellow","gradient-color-text-on-yellow"][e%3],xr="z-10 border border-solid w-full h-full",fr=N(xr,"absolute hidden @xl:block border-transparent"),br=g((({className:e,title:t,description:l,button:n,...a})=>u(k,{className:N("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...a,children:p("div",{className:"relative h-full",children:[u("div",{className:N(fr,"top-9 right-12 bg-green-dark")}),u("div",{className:N(fr,"top-6 right-8 bg-green")}),u("div",{className:N(fr,"top-3 right-4 bg-green-light")}),p("div",{className:N(xr,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[u(B,{title:t,description:l,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),He([n],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),yr={black:"bg-black",white:"bg-white"},vr=g((({className:e="",title:t,description:l,image:n,price:a,button:i,colors:r=[],align:s="text-left",padding:o,...c})=>u(k,{className:N("flex flex-col justify-left",e),defaultPadding:"p-2xl",...c,children:p(ye,{className:"h-full",padding:o,title:u(B,{title:t,description:l,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:n?.src?u(ee,{className:"flex justify-center align-center mb-xl",image:n}):null,buttons:He([i],{buttonClassName:"w-full self-end"}),children:[r?.length?p("div",{className:"flex text-secondary-text mb-m",children:[u("div",{className:"mr-xs",children:u(Ae,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(Nr)]}):null,a?p(Ae,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),Nr=(e,t)=>u("div",{role:"figure",className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${yr[e]}`},String(t)),wr="hidden xl:block absolute w-full h-full border border-white",kr=g((({className:e="",...t})=>{const l=ce(),{text:n,href:a,target:i,onClick:r}=l(t);return n?u("div",{className:N("flex relative group/link pl-s pb-s min-w-64 xl:min-w-72",e),children:p("div",{className:"relative min-h-16 w-full",children:[p("a",{className:N("absolute border\n bg-white flex justify-between group-hover/link:text-primary-main","rounded-md lg:rounded-none w-full p-lg whitespace-nowrap z-10"),role:"link",href:a,target:i,onClick:r,children:[u(Ae,{size:"text-l",font:"font-light",color:"text-primary-text",children:n}),u(ee,{className:"group-hover/link:brightness-100 hidden xl:block ml-2xs",image:{icon:"ArrowRightIcon",iconVersion:"black"},imageClassName:"group-hover/link:text-primary-main hidden xl:block",width:"24",height:"24"})]}),u("div",{className:N(wr,"-bottom-1.5 -left-1.5")}),u("div",{className:N(wr,"-bottom-3 -left-3")})]})}):null})),Cr=g((({className:e,additionalDescription:t,description:l,links:n,title:a,...i})=>u(k,{className:N("overflow-hidden",e),...i,children:p("div",{className:"flex flex-col @6xl:flex-row gap-m",children:[p("div",{children:[u(B,{isEmbedded:!0,title:a,description:l,as:"h1",align:"text-left"}),u(B,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),n?.length?Sr(n,"@6xl:min-w-[672px] p-0 justify-self-end"):null]})}))),Sr=(e,t="")=>{const l=Math.ceil(e.length/10);return u(hr,{className:t,version:"secondary",itemCount:l,arrowsPadded:!1,padding:"p-0",children:Array.from({length:l}).fill(null).map(((t,l)=>u("div",{className:N("flex flex-wrap gap-2xs self-start xl:justify-center @5xl:grid @5xl:grid-cols-2"),children:e.slice(10*l,10*(l+1)).map(((e,t)=>u(kr,{...e},String(t))))},String(l))))})},Ir=g((({className:e="",href:t,target:l,isRemote:n=!1,children:a})=>{const i=ce({isRemote:n})({href:t,target:l});return u(t?"a":"div",{className:N("block",e),...t?i:{},children:a})})),Tr=[{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"}}],Br=g((({className:e="",media:t,showButtonText:l,stretched:a,version:i="white",children:r})=>{const[s,o]=n(),c=t?.map((e=>{const{href:t,icon:n,text:a}=e,{iconMapped:r}=(e=>Tr.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),c=Ue(n)?n:r,d=l?{text:a}:{text:""};return!s&&a&&o(!0),{...e,...d,icon:{...c,iconVersion:"color"},version:e?.version??i}})),d=N("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 p("div",{className:N("flex flex-col gap-xs",e),children:[u("div",{className:"flex gap-xs",children:He(c,{className:N(a||s?"basis-full":""),buttonClassName:d})}),r?u(Ae,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),Pr=g((({className:e,padding:t,description:l,additionalDescription:n,href:a,icon:i,items:r=[],isDotted:s,socialMedia:o=[],target:c,title:d,align:m="text-left",benefits:h,imageOptions:{directionRight:g=!0,isImageAlwaysOnRight:x=true,isImageSecondary:f=!1}={},...b})=>u(k,{className:N("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...b,children:u(Ir,{href:a,target:c,className:"h-full",children:p(ye,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:u(B,{title:d,description:l,headlineVersion:"XS",isEmbedded:!0,align:m}),...at(Ue(i)?u(ee,{image:i}):null,g),buttons:o.length?u(Br,{media:o,showButtonText:!0,version:b?.version}):null,isImageAlwaysOnRight:x,isImageSecondary:f,imageAlign:"center",children:[u($e,{benefits:h}),u(Ge,{items:r,isDotted:s,listItemSize:"S"}),Mr(n,m)]})})}))),Mr=(e,t)=>e?u(I,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,Rr=g((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:l=!1,renderFoldableSection:a,renderFoldButton:r})=>{const[s,o]=n(l),c=i((()=>{o((e=>!e))}),[]),d=a({isUnfolded:s,onToggle:c}),m=r?r({isUnfolded:s,onToggle:c}):null;return p("div",t?{className:e,children:[m,d]}:{className:e,children:[d,m]})}));const Ar=g((({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 u("div",{ref:n,className:`transition-max-h duration-300 overflow-hidden ${n.current||!t?"max-h-0":""} `,children:u("div",{className:e,ref:i,children:l})})})),zr=(e,t)=>{const{title:l,description:n,buttons:a}=e;return p("div",{className:"py-lg border-b border-main-divider",children:[l?u("div",{className:"opacity-80",children:u(Ae,{size:"text-m",color:"text-secondary-text",children:l})}):null,n?u("div",{className:"mt-2xs",children:u(Ae,{size:"text-xl",color:"text-primary-text",children:n})}):null,a?.length?u("div",{className:"text-primary-main",children:He(a)}):null]},String(t))},Dr=g((({className:e="",title:t,align:l="text-center",icon:n,button:a,visibleCellsCount:i=1,cardCells:r=[],...s})=>{const o=r.map(zr),[c,d]=i>0?[o.slice(0,i),o.slice(i)]:[o,[]];return p(k,{className:N("flex flex-col",e),defaultPadding:"p-2xl",...s,children:[Ue(n)?u("div",{className:"self-center",children:u(ee,{image:n})}):null,t?u(S,{className:N("pt-xs",l),headingType:"h5",title:t}):null,a?.text?u(pe,{className:"w-full mt-m mb-lg",...a}):null,d.length?u(Rr,{renderFoldableSection:({isUnfolded:e})=>p("div",{children:[c,u(Ar,{isUnfolded:e,children:d})]}),renderFoldButton:r.length>1?Vr:null}):u("div",{children:c})]})})),Vr=({isUnfolded:e,onToggle:t})=>p("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:t,children:[u("div",{children:e?"Скрыть":"Подробнее о тарифе"}),u(W,{className:"text-primary-text",name:e?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),_r="bg-gradient-to-r from-main-gradient-start to-main-gradient-end",Fr="border-gray border-solid border",jr="border-main-divider border-b",Lr="w-52",Er=g((({icon:e,image:t,title:l,link:n})=>p("div",{className:N("w-80 box-border flex flex-col gap-m items-center rounded-t-md border-b-0 p-2xl",Fr,_r),role:"columnheader",children:[e&&!t?.src&&u(ee,{className:"h-16 w-16 min-w-16 min-h-16",image:e,width:"64",height:"64"}),t?.src&&u(ee,{image:t}),l?u(S,{headingType:"h4",as:"h3",className:"text-center text-white",title:l}):null,n?.text&&u("div",{className:"mt-auto w-full",children:u(pe,{href:n.href,target:n.target||"",className:"w-full text-primary-main bg-white hover:bg-secondary-hover active:bg-secondary-active",children:u("div",{className:"py-s",children:u(I,{size:"text-xs",font:"font-medium",children:n.text})})})})]}))),Or={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},$r=g((({children:e,activeIndex:t,columnWidth:l,version:n="comparison"})=>u("div",{className:"flex flex-1 overflow-hidden",children:u("div",{className:Or[n],style:{transform:`translateX(-${t*l}px)`},children:e})}))),Ur=g((({children:e})=>u("div",{className:"self-start flex flex-col",role:"row",children:u("div",{className:"flex gap-xl",children:e})}))),Hr=g((({colHeaders:e,activeIndex:t})=>p(Ur,{children:[u("div",{className:Lr,role:"columnheader"}),u($r,{activeIndex:t,columnWidth:336,children:e.map(((e,t)=>u(Er,{...e},String(t))))})]}))),Wr=g((({cell:e,isFirstRow:t,isLastRow:l,isFillGradient:n})=>{const a=N("w-80 box-border flex flex-col",Fr,l?"border-t-0 rounded-b-md":"border-y-0",n?_r:""),i=N("mx-2xl h-full",jr,n&&t?"border-t":"",l?"border-b-0":"border-solid");return u("div",{className:a,role:"cell",children:u("div",{className:i,children:e?e.map(((e,t)=>Yr(e,t,n))):null})})})),Kr=(e=!1)=>"text-xl m-0 "+(e?"text-white":""),Xr=(e=!1)=>"text-s opacity-80 "+(e?"text-white":"text-secondary-text"),Yr=({label:e,description:t},l,n)=>p("div",{className:"first:pt-2xl pt-xl last:pb-2xl",children:[e?u("h4",{className:Kr(n),children:e}):null,t?u("div",{className:Xr(n),children:t}):null]},String(l)),qr=(e=!1)=>N("py-2xl",jr,Lr,e?"border-b-0":"border-solid"),Gr=g((({row:{header:e,data:t},activeIndex:l,isColoredFirstColumn:n,isFirstRow:a,isLastRow:i})=>p(Ur,{children:[e?.title?u("div",{className:qr(i),children:u(I,{size:"text-s",children:e.title})}):null,t?.length?u($r,{activeIndex:l,columnWidth:336,children:t.map(((e,t)=>u(Wr,{cell:e,isFirstRow:a,isLastRow:i,isFillGradient:n&&0===t},String(t))))}):null]}))),Jr=g((({rowData:e,isColoredFirstColumn:t,activeIndex:l,controls:n})=>{const{isScrollAvailable:a}=n;return p("div",{className:"relative",children:[e.map(((e,n,{length:a})=>u(Gr,{row:e,isFirstRow:0===n,isLastRow:n+1===a,activeIndex:l,isColoredFirstColumn:t},String(n)))),a?Ca({...n,btnClass:["top-28","top-12"],className:"right-7",isDisabled:!0}):null]})})),Qr=g((({columns:e=[],rowHeaders:t,isShowAllRow:l,visibleRowLength:n,isColoredFirstColumn:a})=>{const i=e?.map((({header:e})=>e||{})),r=e?.map((({data:e})=>e))||[],s=t?.map(((e,t)=>({header:e,data:r.map((e=>e?.[t]||[{}]))}))).slice(0,l?t.length:n),[o,c]=va({itemCount:e.length,visibleItemCount:3}),{isScrollAvailable:d}=c;return p("div",{children:[p("div",{role:"table",children:[i?.length?u(Hr,{colHeaders:i,activeIndex:o}):null,s?.length?u(Jr,{rowData:s,isColoredFirstColumn:a,activeIndex:o,controls:c}):null]}),d?u("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),Zr=g((({className:e="",title:t,rowHeaders:l,columns:a,visibleRowLength:r=0,isColoredFirstColumn:s=!1,...o})=>{const[c,d]=n(!r),m=i((()=>d((e=>!e))),[]);return p(k,{className:N("overflow-hidden relative",e),defaultPadding:"p-6xl",...o,children:[u(S,{headingType:"h2",className:"text-center mb-4xl mx-auto",title:t}),u(Qr,{columns:a,rowHeaders:l,isShowAllRow:c,isColoredFirstColumn:s,visibleRowLength:r}),r?es({isShowAllRow:c,onClick:m}):null]})})),es=({isShowAllRow:e,onClick:t})=>u("div",{className:"pr-6xl",children:p("div",{className:"flex gap-m w-full",children:[u("div",{className:Lr}),u("button",{onClick:t,className:"py-xs flex-1 border-gray border-solid border text-primary-text bg-white hover:border-primary-main hover:text-primary-main",children:u(Ae,{size:"text-xs",font:"font-medium",children:e?"Скрыть":"Показать все параметры"})})]})}),ts=g((({className:e,contacts:t,info:l,version:n="secondary",...a})=>p(k,{className:N("flex",e),defaultPadding:"p-6xl",version:n,...a,children:[l?.length?ls(l):null,t?.length?ls(t):null]}))),ls=e=>u("div",{className:"flex gap-5xl grow basis-0",children:e.map(((e,t)=>ns({column:e,index:t})))}),ns=({column:e,index:t})=>e?u("div",{className:"flex flex-col gap-xl grow basis-0",children:e.map((({title:e="",description:t,additionalDescription:l,button:n},a)=>p("div",{children:[u(B,{title:e,description:t,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),l?u("div",{className:"mt-xs opacity-80",children:u(I,{size:"text-m",font:"font-light",children:l})}):null,n?.href?u(pe,{className:"mt-xl",...n}):null]},String(a))))},`col-${String(t)}`):null,as=e=>e%2!=0,is=g((({textNode:e,iconNode:t,tag:l,onClick:n,justifyContent:a="between",className:i,...r})=>p(l,{tag:l,className:N("flex items-center w-full gap-1","between"===a?"justify-between":"justify-center",i),onClick:n,...r,children:[e?u("div",{children:e}):null,t?u("div",{children:t}):null]}))),rs=g((({className:e="",label:t,icon:l,dataTheme:n="",disabled:a=!1,onClick:i})=>u(is,{tag:"button",onClick:i,disabled:a,"data-theme":n,justifyContent:"center",className:N("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:u(Ae,{size:"text-h4",children:t}),iconNode:l?u(ee,{image:{icon:l,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),ss=({isUnfolded:e,onToggle:t})=>u(rs,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),os=g((({title:e,description:t})=>p("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[u(ee,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),u(B,{title:e,description:t,headlineVersion:"S",isEmbedded:!0,align:ca})]}))),cs=["ArrowDownIcon","ArrowUpIcon"],ds="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs border-box",ms=g((({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 p("div",{children:[u("div",{className:N(t.length?"hidden":"block"),children:a?u(os,{...a}):null}),p("div",{className:N("space-y-2xs",t.length?"":"hidden"),children:[p("div",{className:N(ds),children:[z(r,{...i.options,parent:n}),as(r.length)?u(yt,{className:"col-span-6"}):null]}),u(Rr,{renderFoldableSection:({isUnfolded:e})=>p(Ar,{className:N(ds),isUnfolded:e,children:[z(s,{...i.options,parent:n}),as(s.length)?u(yt,{className:"col-span-6"}):null]}),renderFoldButton:({isUnfolded:t,onToggle:n})=>u(rs,{className:N(l<1?"hidden":""),disabled:!s?.length,label:e,icon:cs[Number(t)],dataTheme:i.options?.page?.colorPalette,onClick:n})})]})]})})),hs=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,us=(e,t)=>Object.entries(e).map((([l,n])=>"number"==typeof n?Array.isArray(t[l])?((e,t)=>l=>hs(t[e])||hs(l[e])||l[e]?.includes(t[e]))(l,e):((e,t)=>l=>hs(t[e])||hs(l[e])||ps(t[e])<=ps(l[e]))(l,e):"object"==typeof n&&"min"in n&&"max"in n?((e,t)=>l=>hs(t[e])||hs(l[e])||ps(t[e]?.min)>=ps(l[e]?.min)&&ps(t[e]?.min)<=ps(l[e]?.max))(l,e):Array.isArray(n)?((e,t)=>l=>hs(t[e])||hs(l[e])||t[e]?.some((t=>l[e]?.includes(t))))(l,e):((e,t)=>l=>hs(t[e])||hs(l[e])||t[e]===l[e])(l,e))).every((e=>e(t))),ps=e=>Number(e||0),gs=(e,t)=>(l=vt)=>e&&e.filter((e=>us(t,l(e.content||{})))),xs=g((({value:e,onChange:t,items:l=[],multiple:n})=>l.map((l=>u(gl,{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))))),fs=({field:e,reset:t,filtrationSchema:l,resetButton:n,children:a})=>p("form",{className:"flex flex-col @4xl:flex-row justify-between bg-white p-4xl gap-s @4xl:gap-0",children:[p("div",{className:"flex flex-col @4xl:flex-row gap-5xl",children:[a,Object.entries(l).map(bs(e))]}),n?u("div",{children:u(vl,{className:"w-full @4xl:w-72 @4xl:ml-s",onClick:t,children:n?.text})}):null]}),bs=e=>([t,l])=>{const n=l?.type;return"array"===n?ys(t,e)(l):null},ys=(e,t)=>l=>{const n=l?.items?.enum?.map(((e,t)=>({value:e,title:l?.items?.enumNames?.[t]||""})))||[];return p("div",{children:[l?.title?u("div",{className:"mb-m",children:u(Ae,{size:"text-m",font:"font-light",color:"text-secondary-text",children:l.title})}):null,u(xs,{items:n,multiple:!l?.single,...t(e)})]},e)},vs=(e,t)=>{const l=e[t?.sourceBook];return l?l?.rateRows.map((e=>e.minMonths)).filter((e=>void 0!==e)):[]},Ns=(...e)=>{const t=e.map((e=>ut(e)));return Promise.all(t)};function ws(e,...t){return e.map(((e,l)=>[e,...t.map((e=>e[l]))]))}const ks=e=>Boolean(e&&e.content&&"string"==typeof e.content.sourceBook);function Cs(e){const{dirs:t=[],source:l=[]}=r((()=>{const t=(e=>e?.filter(ks).map((({content:{sourceBook:e}})=>e)))(e);return{dirs:t?.map((e=>`/wcms-resources/${e}.json`)),source:t}}),[e]),{data:n=[]}=mt(t,Ns);return{source:Object.fromEntries(ws(l,n).filter((([,e])=>Boolean(e)))),months:(a=n.flatMap((e=>e?.rateRows||[])).filter((e=>"number"==typeof e.minMonths&&e.minMonths===e.maxMonths)).map((e=>e.minMonths)),[...new Set(a)]).sort(((e,t)=>e-t))||[]};var a}const Ss=1e9,Is={sum:{min:1e4,max:Ss},period:3},Ts=g((({className:e,filtrationSchema:t={},resetButton:l,sumInput:n,periodInput:a,...i})=>{const{source:r,months:s}=Cs(i.block?.blocks),[o,{field:c,reset:d}]=Nt(Is),m=gs(i.block?.blocks,o)((e=>({...e,period:vs(r,e||{})||[]}))),h=p("div",{children:[u(_i,{label:n?.title,min:500,max:Ss,...c("sum",{parse:e=>({min:Number(e),max:Ss}),format:({min:e})=>String(e)})}),u(yn,{title:a?.title,items:["От 3 мес","До 5 лет"],list:s,...c("period")})]});return p(k,{className:N("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...i,children:[fs({field:c,reset:d,filtrationSchema:t,resetButton:l,children:h}),u(ms,{blocksToRender:m,...i})]})})),Bs={type:"string",title:"Адрес справочника"};Ts.childrenTypes=["ProductTile"],Ts.childSchema=e=>({...e?.filtrationSchema||{},sourceBook:Bs});const Ps=[{key:"10"},{key:"50"},{key:"100"}],Ms=({itemCount:e,onItemCountChange:t})=>{const l=i((({key:e})=>t(Number(e))),[]);return p("div",{className:"flex items-center gap-s",children:[u("span",{children:"Показать по"}),u(ol,{className:"min-w-20",onChange:l,value:{key:String(e)},options:Ps,iconVersion:"black"})]})},Rs="py-m px-lg rounded-md cursor-pointer hover:bg-green-more-dark hover:text-white",As=(e,t)=>{const{currentPage:l,onPageChange:n,totalPages:a}=e,i=t+1;return i===l?u("div",{"aria-current":"true",className:"py-m px-lg bg-green-light text-white rounded-md",children:i},String(t)):1!==i&&i!==a&&((e,t,l)=>e<t&&e>=t-2||e<=t+2&&e>t||((e,t,l)=>t<=3&&e<=t+3||t>=l-1&&e>=l-4)(e,t,l))(i,l,a)?u("div",{onClick:()=>n(i),className:Rs,"aria-label":`Страница ${i}`,children:i},String(t)):null},zs={width:"24",height:"24"},Ds=({currentPage:e,onPageChange:t,totalPages:l})=>{const n=r((()=>Array.from({length:l}).fill({currentPage:e,onPageChange:t,totalPages:l})),[l,e]),a=i((()=>{e>1&&t(e-1)}),[e]),s=i((()=>{e<l-1&&t(e+1)}),[e,l]),o=i((()=>t(1)),[]),c=i((()=>t(l)),[l]);return p("div",{className:"flex gap-m items-center",children:[u("div",{onClick:a,children:u(W,{name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Vs(1===e),...zs})}),p("div",{className:"flex gap-xs",children:[e>1?u("div",{onClick:o,className:Rs,"aria-label":"Страница 1",children:"1"}):null,e>4?u("div",{className:"py-m px-s",children:"..."}):null,n.map(As),e<l-3?u("div",{className:"py-m px-s",children:"..."}):null,e<l?u("div",{onClick:c,className:Rs,"aria-label":`Страница ${l}}`,children:l}):null]}),u("div",{onClick:s,children:u(W,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Vs(e===l),...zs})})]})},Vs=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",_s=({currentPage:e,onPageChange:t,totalPages:l,itemCount:n,onItemCountChange:a})=>p("div",{className:"mt-3xl flex justify-between items-center select-none",role:"navigation","aria-label":"Пагинация",children:[u(Ds,{currentPage:e,onPageChange:t,totalPages:l}),n&&a?u(Ms,{itemCount:n,onItemCountChange:a}):null]}),Fs=g((({className:e,value:t,autoFocus:l,onChange:n,onFocus:a,placeholder:r="Поиск по сайту"})=>{const s=i((e=>{n&&n(e.target?.value||"")}),[n]);return p("div",{className:N("font-sans relative",e),role:"form",children:[u("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:u(ee,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),u("input",{className:N("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})]})})),js=g((({field:e,onClearFilter:t,filtrationState:l})=>p("div",{className:"grid grid-cols-12 mb-3xl space-x-xl",children:[u(Fs,{className:"col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),u(Wl,{className:"col-span-3",label:"Период от",maxDate:l.endDate,...e("startDate")}),u(Wl,{className:"col-span-3",label:"Период до",minDate:l.startDate,...e("endDate")}),u("div",{className:"col-span-2 mt-auto",children:u(vl,{className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),Ls=({title:e,timestamp:t,publicId:l})=>{const n=ce({basePath:"/"}),{href:a}=n({href:`/api/v1/depository/${l}/file`});return p("div",{className:"grid grid-cols-12 py-lg border-gray border-opacity-50 border-b",children:[u("div",{className:"col-span-2",children:t?u(Ae,{size:"text-m","font-weight":"font-light",children:Al(t)}):null}),u("div",{className:"col-span-10 text-h6 hover:text-primary-active",children:u("a",{href:a,download:!0,"aria-label":"Скачать",children:e})})]},l)},Es="/api/v1/depository",Os={startDate:void 0,endDate:void 0,query:""},$s=g((({className:e,...t})=>{const[l,a]=n(0),[r,s]=n(10),[o,{field:c,reset:d}]=Nt(Os),{totalPages:m=0,items:h=[]}=(({size:e,page:t,query:l,startDate:n,endDate:a})=>{const i=n?Al(n,!0):"",r=a?Al(a,!0):"",s=new URLSearchParams(Es);s.set("page",String(t)),s.set("size",String(e)),s.set("query",l),s.set("timestampStart",i),s.set("timestampEnd",r);const o=`?${s.toString()}`,{data:c}=mt(Es+o,pt);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:l,...o}),g=i((e=>a(e-1)),[]),x=i((e=>{r!==e?(s(e),a(0)):s(e)}),[]);return p(k,{className:N(e,"container p-6xl"),...t,children:[u(js,{filtrationState:o,field:c,onClearFilter:d}),p("div",{className:"flex flex-col",children:[p("div",{className:"grid grid-cols-12 pb-lg border-gray border-opacity-50 border-b",children:[u("div",{className:"col-span-2",children:u(Ae,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),u("span",{className:"col-span-10",children:u(Ae,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),h.length?h.map((e=>u(Ls,{...e},String(e.publicId)))):u(os,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),u(_s,{currentPage:l+1,onPageChange:g,totalPages:m,itemCount:r,onItemCountChange:x})]})]})})),Us=e=>"Image"===e?.contentType&&e?.image?u(ee,{image:e.image}):"Code"===e?.contentType&&e.code?u("div",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:e.code}):null,Hs=g((({className:e="",title:t,description:l,error:n,button:a,...i})=>p(k,{className:N("flex flex-col justify-center items-center",e),defaultPadding:N("p-6xl"),version:"transparent",...i,children:[u("div",{className:"flex justify-center",children:Us(n)}),u(B,{title:t,description:l,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),a?.text?u(pe,{version:a?.version,text:a?.text,...a}):null]}))),Ws="location";function Ks(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])]})(y,"location",Ys()??{name:e}),r=i((e=>{qs(e),l(e)}),[]),{data:s}=mt(Xs()?null:"/api/v1/region",pt);return a((()=>{s&&!Xs()&&l(s)}),[s]),[t??{name:e},r]}const Xs=()=>Boolean(globalThis.localStorage?.getItem(Ws)),Ys=()=>{try{const e=globalThis.localStorage?.getItem(Ws);return e&&JSON.parse(e)}catch(e){return null}},qs=e=>{try{globalThis.localStorage?.setItem(Ws,JSON.stringify(e))}catch(e){}};var Gs;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD"}(Gs||(Gs={}));const Js=new Intl.NumberFormat("ru",{style:"currency",currency:Gs.RUB}),Qs=e=>e?Js.format(e):"",Zs="text-left text-m font-light text-secondary-text",eo=`${Zs} pl-5xl`,to={USD:"DollarIcon",EUR:"EuroIcon"},lo=g((({className:e,exchangeCurrencyItems:t})=>p("table",{className:`h-fit w-fit ${e}`,children:[u("thead",{children:p("tr",{children:[u("th",{className:Zs,children:u(Ae,{size:"text-m",children:"Валюта"})}),u("th",{className:eo,children:u(Ae,{size:"text-m",children:"Купить"})}),u("th",{className:eo,children:u(Ae,{size:"text-m",children:"Продать"})})]})}),u("tbody",{children:t.map(no)})]}))),no=e=>{const t=e?.currency?.currency;return p("tr",{className:"pb-2xs text-h6",children:[u("td",{className:"pt-m",children:p("div",{className:"flex items-center gap-xs",children:[t?u(ee,{image:{icon:to[t]},width:"24",height:"24"}):null,u(Ae,{size:"text-h6",children:t})]})}),u("td",{className:"pt-m pl-5xl",children:u(Ae,{size:"text-h6",children:Qs(e?.saleExchangeRate)})}),u("td",{className:"pt-m pl-5xl",children:u(Ae,{size:"text-h6",children:Qs(e?.buyExchangeRate)})})]},t)},ao={icon:"GpsIcon"},io=g((({className:e="",address:t})=>p("div",{className:`flex gap-s ${e}`,children:[u(ma,{...ao,iconBgVersion:"primary"}),p("div",{className:"space-y-2xs",children:[t?u(I,{size:"text-l",color:"text-primary-main",children:t}):null,u(I,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),ro=(e,t,l)=>{const n=Number(so(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)},so=e=>e.replace(/[^\d.,]/g,"").replace(",","."),oo=e=>{return(t=[[e=>e.value!==Gs.RUB&&e.oppositeValue!==Gs.RUB,()=>e.handleConvert(e.value,Gs.RUB)],[e=>e.value===Gs.RUB&&e.oppositeValue===Gs.RUB,()=>e.handleConvert(e.value,Gs.USD)],[()=>!0,()=>e.handleConvert(e.value)]],e=>{const[,l]=t.find((([t])=>t(e)))||[];return l})(e)?.();var t};function co(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??""}))),o={key:n,text:n};return p("div",{className:"relative flex",children:[u(At,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:a,onChange:i}),s.length?u(ol,{isBorder:!1,onChange:e=>r(e.key),options:s,value:o}):null]})}const mo=g((({className:e="",currencyRatesBuy:t,currencyRatesSell:l,button:a})=>{const[r,s]=n({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||Gs.RUB,selectBuy:l?.[0]?.currency?.currency||Gs.USD}),o=i((e=>s((t=>({...t,...e})))),[]);return p("div",{className:`grid gap-m pt-2xl ${e}`,children:[co({placeholder:"Хочу продать",rates:l,selected:r.selectSell,setSelected:ho(r,o,l),value:r.inputSell,setValue:e=>po(o,l)(e,r.selectSell,r.selectBuy)}),co({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:uo(r,o,t),value:r.inputBuy,setValue:e=>go(o,t)(e,r.selectBuy,r.selectSell)}),a?.text?u(pe,{text:a.text,version:a?.version,...a}):null]})})),ho=(e,t,l)=>n=>{t({selectSell:n}),oo({value:n,oppositeValue:e.selectBuy,handleConvert:(n=e.selectSell,a=e.selectBuy)=>{po(t,l)(e.inputSell,n,a)}})},uo=(e,t,l)=>n=>{t({selectBuy:n}),oo({value:n,oppositeValue:e.selectSell,handleConvert:(n=e.selectBuy,a=e.selectSell)=>go(t,l)(e.inputBuy,n,a)})},po=(e,t)=>(l,n,a)=>{e({inputSell:so(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(ro(l,i,n===Gs.RUB)||"")})},go=(e,t)=>(l,n,a)=>{e({inputBuy:so(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(ro(l,i,n===Gs.RUB)||"")})};const xo=g((({className:e="",title:t="Курсы обмена валют",button:l,...n})=>{const[a]=Ks(),i=function(e){const t=e?.code||"000",{data:l}=mt(`/api/v1/exchangerates?regionCode=${t}`,pt);return l||{}}(a),r=fo(i?.exchangeRate?.currencies),s=r.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:Gs.RUB}});const o=r.filter((e=>e.saleExchangeRate));return o.push({currency:{currency:Gs.RUB}}),u(k,{className:N("box-border min-h-80",e),...n,children:u(ye,{className:"h-full",title:u(S,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:p("div",{className:"flex gap-6xl flex-wrap",children:[p("div",{children:[r?u(lo,{className:"mb-xl",exchangeCurrencyItems:r}):null,u(io,{address:i?.address})]}),r.length&&s.length&&o.length?u(mo,{className:"grow",currencyRatesBuy:s,currencyRatesSell:o,button:l}):null]})})})})),fo=e=>e?.filter((e=>1===e?.currency?.id||2===e?.currency?.id))||[],bo=e=>ft(d.SITEMAP||"sitemap",{fallback:e}),yo={width:"40",height:"45"},vo={"bg-white":"color",transparent:"white"},No={"bg-white":"text-primary-main",transparent:"text-white"},wo=(e,t,l)=>u(ee,t?.src?{image:t,className:No[e],width:l?.width,height:l?.height}:{image:{icon:t?.icon||"LogoIcon",iconVersion:vo[e]},className:No[e],width:l?.width,height:l?.height}),ko={"bg-white":"text-primary-text",transparent:"text-white"},Co=g((({className:e,href:t="/",logo:l,children:n,targetBlank:a,bgColor:i="bg-white",showTitle:r=!0})=>p("a",{className:N("inline-flex items-center font-sans no-underline",e),href:t,target:a?"_blank":"_self","aria-label":l?.title??"Россельхозбанк",children:[wo(i,l?.image,yo),r?n??u("div",{className:"ml-s",children:u(Ae,{font:"font-medium",color:ko[i],size:"",children:l?.title??"Россельхозбанк"})}):null]}))),So=g((({className:e,onClose:t})=>u("button",{className:N("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",children:u(ee,{image:{icon:"CloseIcon"},width:"24",height:"24"})})));function Io(e,t,l=300){a((()=>{const t=globalThis.setTimeout(e,l);return()=>{globalThis.clearTimeout(t)}}),t)}const To=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 Bo=(e,t)=>(l,n)=>{for(const[a,i]of n)l.set(a,e(l.get(a)||t,i));return l},Po=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),Mo=e=>t=>e.map((([e,l])=>[To(t)(e),l])).filter((([e])=>e>=.8)).map((([e,t])=>Ao(t,e))).reduce(Bo(Math.max,0),new Map),Ro=e=>t=>{return ws(t,t.map((({title:e})=>e)).map((e=>t=>{const l=Po(t||"");return l.length?Te(e.map((e=>Qa(l.map(To(e)))))):0})(e))).sort((n=([,e])=>e,l=(e,t)=>n(e)-n(t),(e,t)=>-l(e,t))).map((([e])=>e));var l,n},Ao=(e,t)=>new Map(e.map((e=>[e,t]))),zo=({basePathList:e,initialQuery:t=""})=>{const[l,i]=n(t||"");a((()=>{null!=t&&i(t)}),[t]);const{data:r}=mt(e?.length?e:null,Do),[s,o]=n(null);return Io((()=>{r&&o(r.map((e=>t=>{const{corpus:l,dictionary:n}=t||{};if(!(e&&l?.length&&n&&Object.keys(n).length))return[];const a=Po(e);if(!a.length)return[];const i=Object.entries(n),r=[...a.map(Mo(i)).reduce(Bo(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*a.length)).map((([e])=>l[e]));return Ro(a)(r)})(l)))}),[r,l]),[s,{value:l,onChange:i}]},Do=async(...e)=>(await Promise.allSettled(e.map((e=>ut(j(e,"/","search.index.json")))))).map((e=>"fulfilled"===e.status?e.value:{})),Vo=g((({className:e,head:t,children:l,onClose:n})=>{const{close:a}=se(),r=i((()=>{a(),n&&n()}),[n]);return p("div",{className:N("relative min-h-full bg-white pt-0 p-5",e),children:[p("div",{className:"sticky py-xl top-0 bg-white z-10",children:[u(So,{className:"absolute top-0 right-0",onClose:r}),u("div",{className:"container",children:t})]}),u("div",{className:"container pb-6xl",children:l})]})})),_o=g((({className:e,topItems:t})=>{const l=ce({isRemote:!0});return u("div",{className:N("flex items-start justify-between",e),children:t?.map(l).map(jo)})})),Fo=["all","footer"],jo=(e,t)=>{const{text:l,items:n=[],href:a,target:i,onClick:r}=e,s=n.filter((e=>!e.displayArea||Fo.includes(e.displayArea.toLowerCase())));return p("div",{className:"flex flex-col gap-s w-1/4",children:[u("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)=>u(Lo,{...e,basePath:o(a),index:t},String(t))))]},String(t))},Lo=g((({text:e,index:t,basePath:l,...n})=>{const a=ce({isRemote:!(!d.BASE_PATH||!l)&&!d.BASE_PATH.startsWith(l),basePath:l}),{href:i,target:r,onClick:s}=a(n);return u("a",{className:N("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}`})})),Eo=g((({initialQuery:e})=>{const{topItems:t}=bo(),l=r((()=>t?.map((e=>e.href||"/"))),[t]),[n,i]=zo({basePathList:l,initialQuery:e}),s=r((()=>Oo(t)(n)),[t,n]);return a((()=>function(e){for(const t of e.filter((({items:e})=>e?.length)))console.group(t.text),console.table(t.items,["text","href"]),console.groupEnd()}(s)),[s]),u(Vo,{head:u(Fs,{autoFocus:!0,...i}),children:u(_o,{topItems:s})})})),Oo=e=>t=>e?.length&&t?.length?ws(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:j("/",t)})))}))):[];const $o=()=>{const{open:e,close:t}=se();return{open:(t={},l={})=>e(u(Eo,{...t}),l),close:t}},Uo=g((({className:e})=>{const[t,l]=n(""),a=i((()=>l("")),[]),{open:r}=$o(),s=i((e=>{l(e),Ho(e)&&r({initialQuery:e},{onClose:a})}),[a]);return p("div",{className:N("relative",e),children:[u(Fs,{value:t,onChange:s}),u(So,{className:"absolute top-0 right-0 sm:hidden",onClose:a})]})})),Ho=e=>e&&e.length>=3,Wo=g((({className:e="",items:t})=>p("div",{className:e,children:[t?.length?t.map(Ko):null,u(pe,{version:"primary",className:"w-full",href:"https://old.rshb.ru/feedback/question/",target:"_blank",ariaLabel:"Обратная связь",text:"Обратная связь"})]}))),Ko=(e,t)=>p("div",{className:"mb-m space-y-m",children:[u("div",{children:u(Ae,{size:"text-l",font:"font-medium",children:e?.title})}),u("div",{className:"space-y-m",children:e.items?.map(Xo)})]},String(t)),Xo=(e,t)=>p("div",{className:"space-y-2xs",children:[u("div",{children:Yo(e.type,e.text)}),u(I,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Yo=(e,t="")=>{switch(e){case"tel":return u("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${qo(t)}`,children:u(Ae,{size:"text-h6",children:t})});case"email":return u("a",{className:"no-underline",href:`mailto:${t}`,children:u(I,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return u("span",{children:t})}},qo=e=>e.replaceAll(/\D/g,""),Go=["split_version","New","Old"],Jo=g((({className:e="",index:t,text:l,...n})=>{const a=ce(),{href:i,target:r,onClick:s}=a(n);return u("a",{className:N("text-secondary-text",e),href:i,target:r,onClick:s,children:l||`Документ ${t}`})})),Qo=g((({className:e="",links:t})=>u("div",{className:e,children:t?.length?u("div",{className:"flex justify-between items-center gap-lg py-lg border-solid border-x-0 border-y border-y-main-divider",children:t.map(((e,t)=>u(Jo,{index:t,className:"text-l font-light max-w-[292px]",...e},String(t))))}):null}))),Zo=g((({className:e="",index:t,...l})=>{const n=ce({isRemote:!0}),{href:a,target:i,text:r,onClick:s}=n(l);return u("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}`})})),ec=g((({className:e="",links:t})=>p("div",{className:N("@container",e),children:[u("div",{className:"pt-lg",children:u(Ae,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} АО «Россельхозбанк» Генеральная лицензия Банка России № 3349 от 12.08.2015 г.`})}),t?.length?u("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)=>u(Zo,{index:t,...e},String(t))))}):null]}))),tc="w-52",lc=g((({className:e,...t})=>{const{topItems:l,logo:n}=bo(t.options?.page?.fallback),{documents:a,relatedEnterprises:r,contacts:s,socialMedia:o,mobileApps:c}=ft(d.FOOTER||"footer",{fallback:t.options?.page?.fallback}),m=i((()=>{const[e,t,l]=Go;((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 p(k,{tag:"footer",className:e,...t,children:[p("div",{className:"flex items-stretch gap-3xl pb-3xl ",children:[u(Co,{className:tc,logo:n}),u(Uo,{className:"grow"})]}),p("div",{className:"flex items-stretch gap-6xl",children:[p("div",{className:N(tc,"flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[u(Wo,{items:s}),u(Br,{media:o,children:"Соцсети"}),u(Br,{media:c,showButtonText:!1,children:"Мобильное приложение"}),u(pe,{version:"link",href:"https://old.rshb.ru",className:"!text-left text-s font-light",onClick:m,children:"Вернуться на прежнюю версию сайта"})]}),u(_o,{className:"flex-grow",topItems:l})]}),u(Qo,{className:"mt-xl",links:r}),u(ec,{links:a})]})})),nc=g((({className:e="",title:t,description:l,calendar:n,...a})=>p(k,{className:N("space-y-m",e),defaultPadding:"p-6xl",...a,children:[u(B,{title:t,description:l,headlineVersion:"M",isEmbedded:!0}),n?ac(n):null]}))),ac=e=>{const t=100/(e.reduce(((e,t)=>t?.month?.length?e+t.month.length:e),0)||1),l=e.filter((e=>e?.month?.length)).map((e=>({...e,flexBasis:`${e?.month?.length?e.month.length*t:""}%`})));return p("div",{className:"w-full flex flex-col justify-center gap-s",children:[u("div",{className:"flex w-full text-h6 text-center",children:l.map((e=>ic(e,t)))}),u("div",{className:"flex gap-s w-full",children:l.map(((e,t)=>p("div",{className:"border-r border-main-divider last:border-r-0 space-y-s",style:{flexBasis:e.flexBasis},children:[u("div",{className:"flex gap-s",children:rc(e)}),p("div",{className:"text-s",children:[u(Ae,{size:"text-s",font:"font-light",color:"text-primary-text",children:e.text})," ",u(Ae,{size:"text-s",font:"font-light",color:"text-primary-main",children:e.greenText})]})]},`monthItem-${t}`)))})]})},ic=(e,t)=>e.month?.map(((e,l)=>u("div",{style:{flexBasis:`${t}%`},children:e.text},`monthName-${l}`))),rc=e=>e.month?.map((e=>e.image?.src?u("div",{className:"h-52 border-r pr-s border-main-divider last:border-r-0",children:u(ee,{image:e.image,className:"flex"})},`monthImage-${e.image.src}`):null)),sc=e=>({href:t})=>!!t&&F(oc(t,e)).startsWith(F(t)),oc=(e,t)=>V(e)?t.href:t.pathname;function cc(e=[]){const t=v(),l=e.findIndex((e=>sc(d.BASE_PATH?{pathname:d.BASE_PATH}:e))(t));return[l,e[l]]}const dc=g((({className:e="",active:t,flat:l,children:n,...a})=>{const i=ce({isRemote:!0}),{href:r,target:s,text:o,onClick:c}=i(a);return u("a",{className:N(mc(t,l),e),href:r,target:s,onClick:c,rel:"noopener noreferrer","aria-label":o,children:u("span",{className:hc(t,l),children:o||n})})})),mc=(e=!1,t=!1)=>N("inline-block border border-solid bg-transparent text-center no-underline",e?"rounded-md border-primary-main group-data-transparent:border-white":"border-transparent",t?"":"px-m py-xs"),hc=(e=!1,t=!1)=>N("font-sans text-s font-light",e?"text-primary-main":N(t?"text-primary-text":"text-secondary-text","hover:text-primary-main"),"group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),uc=e=>e?.length?p("div",{className:"sm:border-t sm:border-main-divider mt-2xs pt-2xs",children:[u("div",{className:"mb-m",children:u(Ae,{size:"text-m",font:"font-light",color:"text-secondary-text",children:"Представительства за рубежом:"})}),u("div",{className:"flex flex-col sm:flex-row gap-5xl",children:e.map(((e,t)=>u(pc,{...e},String(t))))})]}):null,pc=g((({icon:e,...t})=>{const l=ce(),{text:n,target:a,href:i,onClick:r}=l(t);return p("div",{className:"flex gap-s items-center",children:[e?u(ee,{pathPrefix:"/wcms-resources/",image:e}):null,n?u("a",{className:"hover:text-primary-hover",href:i,target:a,onClick:r,children:u(Ae,{size:"text-l",font:"font-light",color:"text-primary-text",children:n})}):null]})})),gc=e=>t=>u("div",{className:"mb-xs sm:mb-2xs",children:u("button",{className:"cursor-pointer hover:text-primary-hover",onClick:()=>{e&&e(t)},children:u(Ae,{size:"text-l",font:"font-light",children:t.name||""})})},t.id),xc=g((({className:e,searchTerm:t,onSearch:l})=>p("form",{className:`font-sans relative ${e}`,children:[u("div",{className:"absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none",children:t?null:u("label",{htmlFor:"search-bar-input",className:"text-secondary-text ",children:"Поиск по филиалам"})}),u("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"})]}))),fc=g((()=>{const{defaultLocation:e,foreignOffices:t}=bo(),[l,a]=Ks(e),[r,s]=n(""),o=yc(el()).sort(((e,t)=>e.name.localeCompare(t.name))),c=((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})(o,bc),{close:d}=se(),m=i((e=>{a(e),d()}),[]);return p(Vo,{className:"pb-20",head:p("div",{children:[u(Ae,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),l?p("div",{className:"mb-s",children:[u(Ae,{size:"text-l",font:"font-light",children:"Сейчас выбран: "}),u("button",{onClick:()=>a(l),children:u(Ae,{color:"text-primary-main",children:l.name})})]}):null,u(xc,{onSearch:s,searchTerm:r})]}),children:[r&&r.length>=3?u("div",{children:o.filter((({name:e})=>e&&To(e.toLowerCase())(r.toLowerCase())>=.8)).map(gc(m))}):u("div",{className:"columns-1 sm:columns-5",children:Array.from(c.entries()).map((h=m,([e,t])=>p("div",{className:"break-inside-avoid mb-2xl w-56",children:[u("div",{className:"mb-s",children:u(Ae,{size:"text-h6",children:e})}),t.map(gc(h))]},e)))}),uc(t)]});var h})),bc=e=>e.name?.charAt(0)||"",yc=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()||""}))),vc={default:"w-6 h-6",large:"w-12 h-12"},Nc=g((({className:e,isRounded:t,buttonSize:l="default",isGrayBg:n=!1,disabled:a,ariaLabel:i,image:r,onClick:s})=>u("button",{className:N("group/btn border-0 flex shrink-0 items-center",n?"p-s rounded-full":"p-0 bg-inherit",n&&!t?"bg-main-divider":"",t?"w-8 h-8 text-secondary-light hover:text-secondary-hove":`${vc[l]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:a,"aria-label":i,onClick:s,children:u(ee,{image:r,className:N("h-full",t?"bg-main-divider/20 rounded-full":""),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),wc=g((({className:e,version:t,officesLink:l,defaultLocation:n})=>{const a="transparent"===t?"white":"black",[r]=Ks(n),s=$o(),o=i((()=>s.open()),[]),c=(()=>{const{open:e,close:t}=se();return{open:(t={})=>e(u(fc,{}),t),close:t}})(),d=i((()=>c.open()),[]);return p("div",{className:N("flex items-center gap-lg",e),children:[u(dc,{flat:!0,href:"#",text:r?.name,onClick:d}),l?u(dc,{flat:!0,href:l,text:"Офисы и банкоматы"}):null,u(Nc,{image:{icon:"LoupeIcon",iconVersion:a},ariaLabel:"Поиск",onClick:o})]})})),kc=g((({className:e="",items:t,activeItem:l})=>{const a=ce(),[r,s]=n(!1),o=i((()=>s((e=>!e))),[]),c=al(i((()=>s(!1)),[]));return p("div",{className:N(r?"bg-white rounded-md shadow-blue-gray":"",e),ref:c,children:[u("button",{className:"group/btn flex justify-between items-center h-6","aria-label":""+(r?"Скрыть другие разделы":"Показать другие разделы"),onClick:o,children:Array(3).fill(null).map(((e,t)=>u("div",{className:"w-[3px] h-[3px] rounded mr-2xs bg-primary-text group-hover/btn:bg-primary-hover group-data-transparent:bg-white"},String(t))))}),u("div",{className:N("absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56",r?"":"hidden"),"aria-hidden":!r,children:t?.map(((e,t)=>{const{text:n,...i}=e,{href:r,target:s,onClick:o}=a(i);return u("a",{className:N("text-l font-light pb-m hover:text-primary-main",e===l?"text-primary-main":""),href:r,target:s,onClick:o,children:n},r||String(t))}))})]})})),Cc=e=>globalThis[e];function Sc(e,t){const[l,r]=n(),s=i((()=>r(Cc(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(!Cc(e))return l.addEventListener("load",s),()=>{l.removeEventListener("load",s)};s()}),[e,t]),l}const Ic={personal:"//chat.mes.rshb.ru/assets/js/webchat_rshb",business:""},Tc=g((e=>{const[t,{setTrue:l}]=tl();return t?u(Bc,{...e}):Pc({...e,onClick:l})})),Bc=g((({chat:e="personal",...t})=>((e=>{a((()=>globalThis.localStorage?.setItem("webchat-keep-open",String(Date.now()))),[]),Sc("chatbot",Ic[e])})(e),Pc(t)))),Pc=({className:e,iconVersion:t,onClick:l})=>u(Nc,{className:N("text-page__btn-chat",e),image:{icon:"HeadphonesIcon",iconVersion:t},ariaLabel:"Чат",onClick:l,buttonSize:"large",isGrayBg:!0}),Mc=g((({className:e="",active:t,dataItemName:l,children:n,...a})=>{const i=ce(),{href:r,target:s,text:o,onClick:c}=i(a);return p("a",{className:N("relative inline-block bg-transparent text-center no-underline",e),href:r,target:s,"data-item-name":l,onClick:c,children:[u("span",{className:Rc(t),children:o||n}),t?u("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-transparent"}):null]})})),Rc=(e=!1)=>N("font-sans text-l font-light",e?"text-primary-main":"text-primary-text hover:text-primary-main","group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),Ac=g((({observerOptions:e,onVisibilityChange:t,children:l,className:n,...a})=>{const r=Oi(i((e=>{if(!e.length||!t)return;const l=e[e.length-1];t(l.isIntersecting)}),[t]),e);return u("span",{ref:r,className:n,children:u(Mc,{...a,children:l})})})),zc={default:"px-lg bg-main-divider rounded hover:text-primary-main",transparent:"text-white hover:text-primary-hover"},Dc=g((({version:e,internetBankUrl:t})=>t?u(pe,{href:t,ariaLabel:"Интернет-банк",target:"_blank",className:N("py-s ml-s text-l font-light whitespace-nowrap hover:text-primary-main",zc["transparent"===e?"transparent":"default"]),children:"Интернет-банк"}):null)),Vc=["all","header"],_c=g((({subItems:e=[],version:t,internetBankUrl:l})=>{const a="transparent"===t?"white":"black",i=v(),o=r((()=>e.filter((e=>!e.displayArea||Vc.includes(e.displayArea.toLowerCase())))),[e]),c=(e=>(t=[])=>{const l=t?.filter(sc(e));return l?.length?Ja((e=>e.href?.length||0))(l):void 0})(i)(e),[m,h]=n(o.length),g=o.slice(m),x=s(null),f={rootRef:x},b=r((()=>o.map(((e,t)=>e=>{h(e?Fc(t):jc(t))}))),[o]);return p("nav",{className:"relative mt-s flex items-center justify-between",children:[u("div",{ref:x,className:"overflow-hidden whitespace-nowrap pb-s mt-xs space-x-3xl",children:o.map(((e,t)=>u(Ac,{className:m-1<t?"invisible":"",active:e===c,observerOptions:f,onVisibilityChange:b[t],...e},String(t))))}),g.length?u(kc,{className:"relative w-auto z-40",items:g,activeItem:c}):null,p("div",{className:"flex",children:[d.CHAT_BOT?u(Tc,{className:"ml-4xl",iconVersion:a,chat:d.CHAT_BOT}):null,u(Dc,{version:t,internetBankUrl:l})]})]})})),Fc=e=>t=>Math.max(t,e+1),jc=e=>t=>Math.min(t,e),Lc={"bg-white":"primary",transparent:"transparent"},Ec=g((({className:e,bgColor:t="bg-white",logo:l,version:n=Lc[t],...a})=>{const{topItems:i,logo:r,officesLink:s,defaultLocation:o}=bo(a.options?.page?.fallback),[,c]=cc(i),{internetBankUrl:m}=ft(d.PORTAL_DATA||"portal-data",{fallback:a.options?.page?.fallback,pathDir:j(d.BASE_PATH,"portal-resources")});return u(k,{tag:"header",className:N("pt-3xl px-20",c?.items?.length?"pb-m":"pb-lg",e),defaultPadding:"",version:n,...a,children:p("div",{className:"container",children:[p("div",{className:"flex items-center",children:[u(Co,{className:"mr-3xl",bgColor:t,logo:l??r}),i?.map(((e,t)=>u(dc,{active:e===c,...e},String(t)))),u(wc,{version:n,className:"ml-auto",officesLink:s,defaultLocation:o})]}),u("div",{className:N("mt-xl h-px bg-main-divider","transparent"===n?"opacity-30":"")}),c?.items?.length?u(_c,{subItems:c.items,version:n,internetBankUrl:m}):null]})})})),Oc={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},$c=g((({className:e="",padding:t="p-0",gap:l="XS",version:n="transparent",isTheme:a=!1,isCardBorder:i,...r})=>u(k,{className:N("relative","grid grid-cols-12",Oc[l],e),padding:t,version:n,isTheme:a,...r,children:D({...r,extraProps:{className:ar(i)}})})));$c.childrenTypes={exclude:["HorizontalLayout"]};const Uc=g((e=>{const{className:t,image:l,...n}=e;return u(k,{className:t,defaultPadding:"p-0",...n,children:u(ee,{image:l})})})),Hc=g((({className:e="",cards:t=[],button:l})=>{const[a,r]=n(0),s=i((e=>r(e)),[]),o=t.length,[c,d]=va({itemCount:o,visibleItemCount:2}),{canDec:m,canInc:h}=d,g=t[c]?.href;return p("section",{role:"listitem",className:`min-w-full text-center ${e}`,children:[p("div",{className:"relative overflow-hidden",children:[o?Wc({activeIndex:c,cards:t,selectedCardIndex:a,onClick:s}):null,Ca({...d,btnClass:["left-12","right-12"],className:"top-16"}),m?u("div",{className:"absolute top-0 left-0 h-full w-32 bg-opacity-from-white"}):null,h?u("div",{className:"absolute top-0 right-0 h-full w-32 bg-opacity-to-white"}):null]}),u(pe,{className:"w-60 text-center",version:"primary",...l,href:g})]})}));function Wc({activeIndex:e,cards:t,selectedCardIndex:l,onClick:n}){const a=460*e,i=t.length>2?"justify-start":"justify-center";return u("div",{style:{transform:`translateX(-${a}px)`},className:"duration-1000 px-6xl",children:u("div",{className:`w-full flex flex-nowrap gap-s pb-6xl ${i}`,children:t.map(((e,t)=>function({slide:e,i:t,isActive:l,onClick:n}){return p("button",{type:"button",onClick:n,className:"p-3xl min-w-fit flex items-center gap-2xl bg-white border-solid border relative "+(l?"shadow-dark-blue border-primary-main":"ease-in duration-300 border-gray"),children:[e?.icon?u(ee,{className:"p-lg rounded-full bg-secondary-light",image:e.icon,width:"108",height:"108"}):null,p("div",{className:"flex gap-s",children:[e?.sum?Kc("страховая сумма",e.sum):null,e?.fee?Kc("страховой взнос",e.fee):null]}),Xc(l)]},String(t))}({slide:e,i:t,isActive:Boolean(t===l),onClick:()=>n(t)})))})})}function Kc(e,t){return p("div",{className:"flex flex-col text-left whitespace-pre",children:[p(Ae,{size:"text-h6",children:[Je(2)(t)," ₽"]}),u("div",{className:"mt-2xs",children:u(Ae,{size:"text-l",color:"text-secondary-text",children:e})})]})}function Xc(e){return e?u(ee,{className:"h-6 w-6 min-w-6 min-h-6 absolute right-4 top-4",image:{icon:"DoneIcon"},width:"24",height:"24"}):null}const Yc=g((({className:e="",title:t,insuranceTabs:l=[],button:a,...r})=>{const[s,o]=n(0),c=i((e=>o(e)),[]);return p(k,{className:N("box-border overflow-hidden relative px-0 space-y-2xl",e),defaultPadding:"p-6xl",...r,children:[t?u(S,{className:"text-center",title:t,headingType:"h3"}):null,l?.length>1?u("div",{className:"p-xs bg-secondary-light w-fit mx-auto rounded-md",children:l.map(((e,t)=>function({title:e,i:t,isActive:l,onClick:n}){return u("button",{type:"button",onClick:n,"aria-label":e,className:"box-border px-m py-s text-m font-light "+(l?"bg-primary-main text-white rounded-md":"text-secondary-text"),children:e},String(t))}({title:e?.title,i:t,isActive:Boolean(t===s),onClick:()=>c(t)})))}):null,u("div",{className:"flex",style:{transform:`translateX(-${s}00%)`},role:"list",children:qc({insuranceTabs:l,button:a})})]})})),qc=({insuranceTabs:e,button:t})=>{const l=e?.map((e=>e.cards));return l?.length?l.map(((e,l)=>u(Hc,{button:t,cards:e},String(l)))):null};const Gc=e=>t=>t.reduce(((t,l,n)=>t.length?t.concat({...e,key:`sep-${n}`},l):[l]),[]),Jc={yellow:"bg-yellow",green:"bg-green","green-light":"bg-green-light","green-dark":"bg-green-dark"},Qc={XS:"h-10",S:"h-16",M:"h-24",L:"h-32",XL:"h-52"},Zc=g((e=>{const{className:t="",items:l,isDotted:n,investmentZeroColumn:a,investmentColumns:i,...r}=e,s=i?[...i]:[];return a&&s.unshift(a),u(k,{className:t,defaultPadding:"p-4xl",...r,children:p("div",{className:"container text-m font-light space-y-4xl",children:[s?.length?p("div",{children:[p("div",{className:"flex items-end relative pl-3xl pr-lg text-white",children:[Gc(u("div",{className:"w-px h-4 bg-gray"}))(s.map(ed)),u("div",{className:"absolute right-3xl w-px h-4 bg-gray"})]}),u("div",{className:"border-t border-gray -mt-xs mx-3xl"}),u("div",{className:"flex justify-between text-primary-text mt-s -mx-5xl",children:s.map(nd)})]}):null,l?.length?u(Ge,{className:"max-w-[657px]",items:l,isDotted:n,listItemSize:"M"}):null]})})})),ed=(e,t,l)=>{const n=1===t,a=t===l.length-1;return u("div",{className:`${td(n,a,e.cells)}`,children:e.cells?.length?u("div",{className:"w-full "+(a?"border-4 border-green-more-dark p-2xs min-w-72":""),children:e.cells.reverse().map(ld)}):null},`column_${t}`)},td=(e,t,l=[])=>[l.length?"flex-1":"flex-0",!l.length||e||t?"":"pl-s",l.length&&!t?"pr-s pb-3xl":"pb-xl"].join(" "),ld=(e,t)=>{const l=e.cellSize||"XS",n=e.cellColor||"green";return e.text?u("div",{className:`flex-1 flex items-center justify-center relative py-xs ${Qc[l]} ${Jc[n]} ${"XS"===l?"px-s":"px-5xl"}`,children:u(Ae,{align:"text-center",children:e.text})},`cell_${t}`):null},nd=(e,t)=>e?.title?u("div",{className:"flex-1 max-w-[180px] text-center px-xs last:pr-3xl",children:e.title},`title_${t}`):null,ad=["байт","Кб","Мб","Гб","Тб","Пб"],id=g((({icon:e,text:t,href:l,target:n,fileFormat:a,fileSize:i})=>{const r=i&&a?",":"",s=i??"",o=a?String(a):"";return p("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",role:"link",href:l,target:n,children:[e,t?p(Ae,{size:"text-l",font:"font-light",children:[t," ",rd(s,o),u(Ae,{color:"text-secondary-text",children:l&&`${s+r+o}`})]}):null]})})),rd=(e,t)=>e||t?u("span",{children:", "}):"",sd={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},od=g((({className:e="",title:t,description:l,align:n="text-center",documents:a,icon:i={icon:"DocIcon"},columnsMode:r="double",...s})=>{const o=v();return p(k,{className:N("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[u(B,{title:t,description:l,align:n,headlineVersion:"M",as:"h2",isEmbedded:!0}),a?.length?u("div",{className:N("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",sd[r]),role:"list",children:a.map(cd(o,i))}):null]})})),cd=(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))} ${ad[l]}`})(l?.attachment?.fileSize||0):l?.fileSize,r="Attachment"===l?.docType?dd(a):l?.fileFormat;return u("div",{role:"listitem",children:u(id,{text:l?.text,target:l?.target,href:a,fileFormat:r,fileSize:i,icon:t?u(ee,{className:"min-w-6 min-h-6",image:t,width:"24",height:"24"}):null})},String(n))},dd=e=>{if(!e)return"";const t=e.lastIndexOf(".");return-1!==t?e.substring(t+1):""},md=g((({className:e,padding:t,align:l="text-left",buttons:n=[],description:a,image:i,items:r,qr:s,additionalDescription:o="",title:c="Мобильное приложение",version:d="primary",...m})=>{const h="secondary"===d?"p-m min-w-32":"min-w-24",g=i?.src?u(ee,{className:"hidden lg:block",image:i}):null;return u(k,{className:N("min-h-80",e),padding:"p-0",version:d,...m,children:p(ye,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:u(S,{headingType:"h3",title:c,className:N("whitespace-pre-wrap",l)}),rightImage:g,buttons:He(n,{className:"flex-wrap"}),children:[a?u(Ae,{size:"text-xl","font-weight":"font-light",children:a}):null,p("div",{className:N("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[u(Ge,{items:r,listItemSize:"M"}),u(Ae,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:o}),s?.src?u("div",{className:N("flex justify-center bg-white rounded-md @xl:-order-1",h),children:u(ee,{className:"w-fit",image:s})}):null,i?.src?u(ee,{className:"lg:hidden",image:i}):null]})]})})})),hd={primary:"bg-white/30",secondary:"bg-main-divider"},ud={primary:"text-white",secondary:"text-secondary-text"},pd=g((({count:e,version:t="secondary"})=>u("div",{className:N("w-6 h-6 rounded-full flex items-center justify-center",hd[t]),children:u(Ae,{size:"text-xs",color:ud[t],children:e})}))),gd=(e=[],t={})=>e.filter((({content:e={}})=>us(t,e))).length,xd=(e,t)=>e===t;const fd=(bd=function(...e){return(t,l)=>e.some((e=>e(t,l)))}(xd,((e=xd)=>(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])=>bd(l,t[e])))));var bd;const yd=[],vd={},Nd={default:"px-xs",underlined:"px-m",rounded:"px-lg rounded-md"},wd={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",rounded:"text-white"},kd={default:"bg-white",underlined:"bg-white",rounded:"bg-transparent"},Cd={default:"sm:bg-primary-main",underlined:"bg-white",rounded:"bg-primary-main"},Sd=g((({tag:e="div",item:t={},isActive:l,type:n="default",onClick:a})=>{const i=e,{text:r,appendRight:s,...o}=t;return u(i,{className:N("h-12","block flex-1","cursor-pointer",Nd[n],l?Cd[n]:kd[n]),role:"tab","aria-selected":l,onClick:a,...o,children:p("div",{className:N("h-full","flex justify-center items-center","text-center whitespace-nowrap",l?wd[n]:"text-secondary-text hover:text-primary-main"),children:[u(Ae,{size:"text-m",children:r}),s?u("div",{className:"ml-xs",children:s}):null]})})})),Id=g((e=>u(e?.item?.href?Td:Bd,{...e}))),Td=g((e=>{const t=ce(),l=i((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:n,...a}=t({...e.item,onClick:l});return u(Sd,{...e,tag:"a",item:a,onClick:n})})),Bd=g((({item:e={},onClick:t,...l})=>{const n=i((()=>{t&&t(e)}),[t,e]);return u(Sd,{item:e,onClick:n,...l})})),Pd=(e,t,l)=>(n,a)=>u(Id,{isActive:n===e,onClick:t,type:l,item:n},String(a)),Md=g((({className:e,tabsType:t="default",items:l=[],value:n,onChange:a})=>u("div",{className:N("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tablist",children:l.map(Pd(n,a,t))}))),Rd={categories:[],extraOptions:[],propertyType:[],stage:[]},Ad=g((({className:e,hotFilters:t,filtrationSchema:l={},resetButton:n,...a})=>{const[s,{field:o,reset:c,update:d}]=Nt(Rd),m=gs(a.block?.blocks,s)(),h=i(((e=Rd)=>d(e)),[]),g=(({hotFilters:e=yd,filtrationState:t=vd,blocks:l=yd,onFiltrationStateChange:n})=>{const a=r((()=>Math.max(0,e.findIndex((e=>fd(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,appendRight:u(pd,{version:t===e[a]?"primary":"secondary",count:gd(l,t.filter)})})))),[e,l,a]),o=i((t=>{n(e[s.indexOf(t)].filter)}),[e,s]);return{value:s[a],items:s,onChange:o}})({hotFilters:t,filtrationState:s,blocks:a.block?.blocks,onFiltrationStateChange:h});return p(k,{className:N("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...a,children:[u(Md,{...g}),fs({field:o,reset:c,filtrationSchema:l,resetButton:n}),u(ms,{blocksToRender:m,...a})]})}));function zd(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)}))}Ad.childrenTypes=["ProductTile"],Ad.childSchema=e=>e?.filtrationSchema||{};const Dd={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"},Vd=(e,t,l)=>u("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(Dd).join(" ")} ${l}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.geoObjects.add(t.geoObjects)}))},children:u(W,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),_d={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"},Fd=g((({yandexMaps:e,direction:t="in"})=>{const l="in"===t?"PlusIcon":"MinusIcon";return u("div",{onClick:()=>{const l=e.current.getZoom(),n="in"===t?l+1:l-1;e.current.setZoom(n,{checkZoomRange:!0})},className:`${Object.values(_d).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:u(W,{name:l,width:"20",height:"16"})})})),jd={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"},Ld=[55.753995,37.614069],Ed=g((({points:e,className:t="",zoom:l=5})=>{const i=s(null),r=Sc("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${d.YANDEX_MAP_API_KEY||""}&lang=ru_RU`),[o,c]=n();if(a((()=>{i?.current?r&&(zd(r,i.current,e),e?.length||i.current.setCenter(Ld)):r?.ready((()=>{i.current||(i.current=new r.Map("map",{center:e?Od(e):Ld,zoom:l,controls:[],suppressMapOpenBlock:!0}),zd(r,i.current,e))}))}),[r,i,e,l]),!r)return null;const m=o?"z-[100000]":"z-10";return p("div",{id:"map",className:N(!o&&"relative","w-full",t),children:[u("div",{className:N(Object.values(jd),m,"right-2 top-4 bg-white"),onClick:()=>{const e=i.current.container;o?e.exitFullscreen():e.enterFullscreen(),c(e.isFullscreen())},children:u(W,{name:"FullScreenIcon",width:"16",height:"16"})}),p("div",{className:N("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",m),children:[u(Fd,{yandexMaps:i}),u(Fd,{yandexMaps:i,direction:"out"})]}),Vd(i.current,r,N("right-2 top-80",m))]})})),Od=e=>[Ud($d(e,0)),Ud($d(e,1))],$d=(e,t)=>e.map((e=>e[t])),Ud=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Hd={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных"},Wd=(e,{field:t,reset:l})=>p("div",{className:"pb-2xl",children:[e?.length?u("div",{className:"flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",children:e.map((e=>u(Bl,{text:Hd[e],...t(e)},e)))}):null,u(pe,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:l,text:"Очистить фильтр",appendRight:u(W,{name:"CloseIcon",width:"16",height:"16"})})]}),Kd=()=>null,Xd=()=>[],Yd=g((({className:e,data:t=[],renderCard:l=Kd,filterItems:n=Xd,initFilterState:a={},descriptionData:i,title:s})=>{const[o,{field:c,reset:d}]=Nt(a),[m,h,g]=r((()=>{const e=n(t,o),l=e.map((e=>[e.gpsLatitude,e.gpsLongitude].filter(Boolean))).filter((e=>e&&2===e.length));return[e,l,e.length]}),[t,o]);return p("div",{className:N("space-y-1",e),children:[p("div",{className:"bg-white",children:[p("div",{className:"pt-6xl px-6xl",children:[p("div",{className:"flex gap-xs pb-2xl",children:[u(S,{headingType:"h2",children:s}),g?u(Ae,{size:"text-h2",color:"text-secondary-text",children:`(${g})`}):null]}),i?qd(i):null,Wd(Object.keys(a),{field:c,reset:d})]}),u("div",{className:"h-[600px]",children:u(b,{children:u(Ed,{points:h,className:"h-full"})})})]}),m.map(l)]})})),qd=({__html:e,list:t})=>e||t?.length?p("div",{className:"p-xl mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?u(Me,{__html:e}):null,t?.length?u("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pt-xs",children:t.map(((e,t)=>p("div",{className:"flex gap-xs items-center",children:[e?.image?u(ee,{image:e.image}):null,e?.text?u(Ae,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,Gd={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"}},Jd=g((({className:e,children:t,color:l="gray"})=>u("div",{className:N("p-s sm:border sm:border-gray rounded-md flex items-center",Gd[l].border,e),children:u(Ae,{size:"text-m",color:Gd[l].text,children:t})}))),Qd=g((({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:Zd({textItems:a,subText:t,children:l,...n})})),Zd=({label:e,labelSize:t="text-m",textItems:l,subColor:n,subText:a,className:i,children:r})=>p("div",{className:N("flex gap-2xs flex-col h-full max-w-[300px]",i),children:[e?u(Ae,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||l.filter(Boolean).map(((e,t)=>u(Ae,{size:"text-l",children:e.trim()},String(t)))),a?u(Ae,{color:n,size:"text-m",children:a}):null]}),em=g((({className:e,children:t})=>u("div",{className:N("sm:flex sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),tm=["ArrowDownIcon","ArrowUpIcon"],lm=["Подробнее","Скрыть"],nm=({isUnfolded:e,onToggle:t})=>p("button",{className:"w-full py-2xl cursor-pointer text-primary-main flex items-center border-b border-solid border-main-divider",onClick:t,children:[u("div",{className:"pr-m",children:lm[Number(e)]}),u(W,{className:"text-primary-text",name:tm[Number(e)],width:"16",height:"16"})]}),am=({location:e,address:t,billAcceptorType:l,terminalType:n,billAcceptorEnable:a,atmCode:i="",atmAccess:r="",workTime:s},o)=>{const c=[{label:"Устройство",value:rm(n)},{label:"Модуль приема наличных",value:a?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===l?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:i}];return p("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[p("div",{className:"sm:flex sm:justify-between",children:[p("div",{children:[u(Ae,{size:"text-h4",children:rm(e)}),t?p("div",{className:"flex pb-xl pt-xs gap-2xs",children:[u(W,{name:"GeolocationIcon",width:"24",height:"24"}),u(Ae,{size:"text-l",children:t})]}):null]}),u(Jd,{color:"green",children:rm(s)})]}),u("div",{className:"hidden sm:block",children:u(em,{className:"flex-wrap",children:c?.map(im)})}),u(Rr,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>u(Ar,{isUnfolded:e,children:u(em,{className:"flex-wrap",children:c?.map(im)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>nm({isUnfolded:e,onToggle:t})})]},String(o))},im=(e,t)=>u(Qd,{...e},String(t)),rm=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",sm=[];const om=async e=>await ut(e,{method:"GET"})||sm,cm={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1},dm={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable)},mm=g((({data:e,className:t})=>{const[l]=Ks(),n=function(e){const{data:t=sm}=mt(`/api/v1/atms?regionCode=${e}`,om);return t}(l?.code??"000");return u(Yd,{className:t,filterItems:hm,data:n,initFilterState:cm,renderCard:am,title:`Банкоматы филиала ${l?.name}`,descriptionData:e})})),hm=(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=>dm[t](e))),l=!n.length||n.some((t=>dm[t](e)));return t&&l}))},um=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=[pm({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:l?"":n}),pm({workTime:l?.workTime,lunchHour:l?.lunchHour,daysOff:n},!0)].filter(Boolean);return u(Qd,{label:"Режим работы",value:a,className:"max-w-none"})},pm=({workTime:e="",lunchHour:t="",daysOff:l=""},n=!1)=>e?[`${n?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",l?`не работает: ${l}`:""].filter(Boolean).join("; "):"",gm=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],xm=e=>gm.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??"")}}))),fm=e=>{if(!e)return null;const t=bm(e);return p(em,{className:"border-none",children:[u(Qd,{label:"Для юридических лиц",labelSize:"text-l",children:u("div",{className:"flex gap-1",children:t.map(ym)})}),u(Qd,{label:"Режим работы",className:"max-w-none",children:u(Ae,{children:e})})]})},bm=e=>{const t=gm.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},ym=({short:e,status:t},l)=>u("div",{className:N("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:u(Ae,{size:"text-xs",children:e})},String(l)),vm=({currency:e,buyExchangeRate:t,saleExchangeRate:l},n)=>p("div",{className:"flex gap-lg h-full",children:[e?.currency?u(Qd,{label:"Валюта",value:e.currency}):null,t?u(Qd,{label:"Купить",value:String(t)}):null,l?u(Qd,{label:"Продать",value:String(l)}):null]},String(n)),Nm=(new Date).getDay(),wm=e=>{const[t]=e?.slice(Nm-1)??[];if(!t)return null;const{lunchHour:l,status:n,workTime:a,hasLunch:i}=t;return n?p("div",{className:"flex gap-s items-start whitespace-nowrap",children:[a?u(Jd,{color:"green",children:a}):null,l&&i?u(Jd,{color:"yellow",children:`перерыв: ${l}`}):null]}):u(Jd,{color:"red",children:"Выходной"})},km=({lunchHour:e,hasLunch:t=!1,status:l=!1})=>l?e&&t?`Перерыв ${e}`:e:"Не работает",Cm=({title:e,status:t,workTime:l,lunchHour:n,hasLunch:a},i)=>u(Qd,{label:e,value:t&&l?l:"",subText:km({lunchHour:n,hasLunch:a,status:t}),subColor:!t||a?"text-error":"text-green-dark"},String(i)),Sm=({name:e,address:t,phone:l,fax:n,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:o,exchangeRate:c},d)=>{if(!o)return null;const m=xm(o);return p("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[p("div",{className:"sm:flex sm:justify-between",children:[p("div",{children:[u(Ae,{size:"text-h4",children:e}),t?p("div",{className:"flex pb-xl pt-xs gap-2xs",children:[u(W,{name:"GeolocationIcon",width:"24",height:"24"}),u(Ae,{size:"text-l",children:t})]}):null]}),wm(m)]}),u("div",{className:"hidden sm:block",children:Im({phone:l,fax:n,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:o,exchangeRate:c})}),u(Rr,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>u(Ar,{isUnfolded:e,children:Im({phone:l,fax:n,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:o,exchangeRate:c})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>nm({isUnfolded:e,onToggle:t})})]},String(d))},Im=({phone:e,fax:t,phoneBusiness:l,phoneNatural:n,phoneCallCentre:a,phoneCurrencyControl:i,workSchedule:r,exchangeRate:s})=>{const o=xm(r),c=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return p("div",{children:[p(em,{className:"flex-wrap",children:[u(Qd,{label:"Факс",value:t}),u(Qd,{label:"Телефон филиала",value:e}),u(Qd,{label:"Для обращений юридических лиц",value:l}),u(Qd,{label:"Обслуживание физических лиц",value:n}),u(Qd,{label:"Для консультаций по валютному контролю",value:i}),u(Qd,{label:"Контакт-центр",value:a})]}),r?.isMatchesPattern?u(em,{children:u(Qd,{label:c,labelSize:"text-l",className:"w-full max-w-none",children:u("div",{className:"flex flex-wrap gap-xs sm:justify-between pt-xs",children:o?.map(Cm)})})}):p(em,{children:[u(Qd,{label:c,labelSize:"text-l",children:u("div",{className:"flex gap-1",children:o?.map(ym)})}),um(o)]}),r?.businessScheduleVisibleTag?fm(r?.businessScheduleDescription):null,s?.currencies?.length?u(em,{className:"flex-wrap",children:s?.currencies?.map(vm)}):null]})},Tm=[];const Bm=async e=>await ut(e,{method:"GET"})||Tm,Pm={workingSaturday:!1},Mm={workingSaturday:e=>Boolean(e.workSchedule?.workingSaturday)},Rm=g((({className:e})=>{const[t]=Ks(),l=function(e){const{data:t=Tm}=mt(`/api/v1/branches?regionCode=${e}`,Bm);return t}(t?.code??"000");return u(Yd,{className:e,filterItems:Am,data:l,initFilterState:Pm,renderCard:Sm,title:`Офисы филиала ${t?.name}`})})),Am=(e,t)=>{const l=Object.keys(t).filter((e=>t[e]));return e.filter((e=>l.every((t=>Mm[t](e)))))},zm=g((({data:e,className:t,...l})=>{const n=e?.dataType??"offices";return u(k,{version:"transparent",className:N(t),defaultPadding:"p-0",...l,children:"offices"===n?u(Rm,{}):u(mm,{data:e})})})),Dm=g((({className:e,size:t})=>u("figure",{className:N("m-0 mt-xl min-w-[80%]",e),children:Vm(t)}))),Vm=(e=3)=>Fm(100,e).map((e=>Math.floor(e))).map(_m),_m=(e,t)=>u("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-light"},String(t)),Fm=(e,t)=>[e].concat(t>0?Fm(e/1.618,t-1):[]),jm=g((({className:e,title:t,description:l="Блок в разработке...",...n})=>p(k,{className:N("box-border",e),...n,children:[u(B,{className:"max-w-[600px]",title:t,description:l,headlineVersion:"L",align:"text-left",isEmbedded:!0}),u(Dm,{})]}))),Lm=g((({className:e="",padding:t,slides:l=[],...a})=>{const[i,r]=n(0);return p(k,{className:N("box-border overflow-hidden",e),defaultPadding:"py-6xl",padding:t,...a,children:[u("div",{className:"flex duration-1000",style:{transform:`translateX(-${100*i}%)`},role:"list",children:l.map((({productBlock:e},t)=>u("div",{className:"box-border grow-0 shrink-0 basis-full",role:"listitem",children:u(nt,{className:"pl-6xl h-full",headlineVersion:"M",isFullWidthTitle:!1,...e,...a})},String(t))))}),u("div",{className:"h-28 px-xs mt-m -mb-m flex gap-xs box-border",children:l.map(Em({activeSlideIndex:i,onClick:r}))})]})})),Em=({activeSlideIndex:e,onClick:t})=>({nav:l},n)=>{const a=n===e,i=a?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:py-xl backdrop-blur",r=a?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=a?"text-secondary-text text-l font-light":"text-secondary-text text-m font-light group-data-secondary:text-white/80";return p("button",{type:"button",onClick:()=>t(n),"aria-label":l?.title,className:N("relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50",i),children:[u("div",{className:r,children:l?.title}),u("div",{className:s,children:l?.description})]},String(n))},Om=g((({address:e,email:t,telephone:l,button:n,className:a="",__html:i,icon:r,title:s,version:o="primary",...c})=>p(k,{className:N("box-border text-left space-y-s",a),version:o,...c,children:[p("div",{className:"w-full flex justify-between flex-row-reverse",children:[Ue(r)?u("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:u(ee,{image:r})}):null,s?u(S,{headingType:"h3",as:"h3",title:s}):null]}),p("div",{className:"w-full space-y-m",children:[i?$m(i):null,Um({label:"Адрес",data:e,iconName:"GeolocationIcon"}),Um({label:"Телефон(факс)",data:l,iconName:"PhoneIcon"}),Um({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),n?.text?He([n]):null]})]}))),$m=e=>u("div",{className:"border-b border-main-divider pb-lg",children:u(Me,{__html:e})}),Um=({label:e,data:t,iconName:l,dataColor:n=""})=>t?p("div",{className:"flex gap-s",children:[u(W,{iconVersion:"black",name:l,width:"24",height:"24"}),p("div",{className:"flex flex-col gap-2xs",children:[u(Ae,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),u(Ae,{size:"text-xl",color:n,children:t})]})]}):null,Hm=g((e=>{const{__html:t,richVersion:l,...n}=e;return u(k,{defaultPadding:"p-0",...n,children:u(Me,{__html:t,richVersion:l})})})),Wm=g((({label:e,labelIconBgVersion:t,icon:l,onToggle:n,labelIcon:a})=>u(is,{tag:"button",className:N("border-none bg-transparent items-center group/button",a?.icon?"py-xs":"py-lg"),onClick:n,textNode:p("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[null,e?u(Ae,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:l?u(W,{name:l,iconVersion:"color",width:"24",height:"24"}):null}))),Km=g((({className:e="",isExpanded:t,isFoldButtonOnTop:l=!0,label:n="Развернуть",labelIcon:a,labelIconBgVersion:i,foldButtonVersion:r="default",version:s,...o})=>u(k,{className:N("w-full","border-0 border-b border-solid border-main-divider last:border-b-0",e),defaultPadding:"p-0",tag:"div",version:"transparent",...o,children:u(Rr,{isFoldButtonOnTop:l,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>u(Ar,{className:N("gap-lg","grid grid-cols-12 [&>*]:pb-m"),isUnfolded:e,children:D({...o,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Xm({foldButtonVersion:r,label:n,labelIcon:a,labelIconBgVersion:i,isUnfolded:e,onToggle:t})})})));Km.childrenTypes={exclude:["RollupItem"]};const Xm=({foldButtonVersion:e,label:t,labelIcon:l,labelIconBgVersion:n,isUnfolded:a,onToggle:i})=>{const r=t||(a?"Скрыть":"Развернуть"),s=((e=!1)=>e?"MinusIcon":"PlusIcon")(a);return"accordion"===e?u(Wm,{label:r,labelIcon:l,labelIconBgVersion:n,icon:s,onToggle:i}):u(rs,{label:r,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:i})},Ym=g((({className:e=""})=>{const[t,l]=n("option2"),a=i((e=>l(e)),[]);return p("div",{className:N("order-4",e),children:[u(Yn,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),u(Yn,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),qm=g((({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]}))),o=s.find((e=>e.key===n));return u(ol,{options:s,label:r,placeholder:a||n,onChange:e=>i(e.key),value:o})})),Gm=g((({regions:e=[],selectedRegion:t,onSelectedRegion:l,branches:n=[],selectedBranch:a,onSelectedBranch:i})=>p("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[u("div",{className:"flex-1 min-w-0",children:u(qm,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:l,label:"Регион"})}),u("div",{className:"flex-1 min-w-0",children:u(qm,{data:n,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:i,label:"Отделение",placeholder:"Выберите отделение"})})]}))),Jm=["От 1 дня","До 365 дней"],Qm=g((({days:e,setDays:t})=>p("div",{className:"order-1",children:[u(Ae,{size:"text-m",font:"font-light",children:"Срок аренды"}),u(yn,{min:1,max:365,value:e,items:Jm,onChange:t})]}))),Zm=g((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:l,safeBoxCases:n=[],selectedBoxSize:a,onSelectedBoxSize:i})=>p("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[u("div",{className:"flex-1 min-w-0",children:u(qm,{data:e,fieldLabel:"volume",selected:t,setSelected:l,label:"Размер",placeholder:"Выберите размер"})}),u("div",{className:"flex-1 min-w-0",children:u(qm,{data:n,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:i,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),eh=g((({regions:e,selectedRegion:t,branches:l,selectedBranch:n,days:a,selectedCaseVolume:i,selectedBoxSize:r,safeBoxCases:s,caseVolumes:o,onChange:c,onClick:d})=>p("div",{className:"contents @xl:block flex-1 space-y-xl",children:[u(Gm,{regions:e,selectedRegion:t,onSelectedRegion:e=>c({selectedRegion:e}),branches:l,selectedBranch:n,onSelectedBranch:th(c)}),u(Qm,{days:a,setDays:e=>c({days:e})}),u(Zm,{caseVolumes:o,selectedCaseVolume:i,onSelectedCaseVolume:lh(c),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>c({selectedBoxSize:e})}),u("div",{className:"order-4",children:u(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:"Тип договора"})}),p("div",{className:"contents @md:flex justify-between items-center gap-m",children:[u(Ym,{}),u(pe,{text:"Офисы на карте",version:"primary",onClick:d,className:"order-6"})]})]}))),th=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},lh=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},nh=g((({days:e,tariffs:t=[]})=>{const l=ih(e,t),n="На рисунке изображена пачка листов\nформата А4";return p("div",{className:"contents @xl:flex flex-col justify-between gap-xl order-2",children:[p("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:[ah("Аренда за",e),ah("Цена",l+" ₽")]}),u("div",{className:"@xl:hidden order-3 mb-xs",children:u(I,{size:"text-s",font:"font-light",color:"text-secondary-text",children:n})}),p("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:[u(ee,{image:{icon:"PackA4Icon"},className:"@xl:h-60"}),u("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:u(I,{size:"text-s",font:"font-light",color:"text-white",children:n})})]})]})})),ah=(e,t)=>p("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[u(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),u("span",{className:"text-l @xl:text-h3 text-primary-text",children:t})]}),ih=(e,t)=>{const l=rh(e);return e*(t?.find((e=>e.tariffType===String(l)))?.tariffValue||0)},rh=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},sh=(e,t)=>e.find((e=>e.branchCode===t)),oh=g((e=>{const{regions:t,data:l,branches:n,onChange:i,onClick:r}=e;a((()=>{i({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[l.selectedRegion,i]);const s=sh(n,l.selectedBranch),o=ch(s?.safeBoxCaseVolumes),c=dh(s?.safeBoxCaseVolumes,l.selectedCaseVolume)?.safeBoxCases,d=mh(c,l.selectedBoxSize);return p("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[u(eh,{...l,regions:t,onClick:r,branches:n,caseVolumes:o,safeBoxCases:c,onChange:i}),u(nh,{days:l.days,tariffs:d})]})})),ch=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],dh=(e,t)=>e?.find((e=>e.volume===t)),mh=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,hh=[];const uh=async e=>await ut(e,{method:"GET"})||hh,ph=g((({title:e,footnote:t,className:l="",...a})=>{const[r,s]=n(!1),o=i((()=>s((e=>!e))),[]),[c,d]=n({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),m=el(),h=gh(c.selectedRegion,m),g=function(e){const{data:t}=mt(e?`/api/v1/safeboxes?regionCode=${e}`:null,uh);return t||hh}(h),x=i((e=>d((t=>({...t,...e})))),[d]),f=(b=sh(g,c.selectedBranch)||g,Array.isArray(b)?b.map((e=>e.gpsLatitude&&e.gpsLongitude?[e.gpsLatitude,e.gpsLongitude]:[])):b?.gpsLatitude&&b?.gpsLongitude?[[b.gpsLatitude,b.gpsLongitude]]:[]);var b;return p(k,{className:l,defaultPadding:"",...a,children:[p("div",{className:"p-4xl space-y-xl",children:[e?u(S,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,u(oh,{regions:m,branches:g,data:{...c,selectedRegion:h},onClick:o,onChange:x}),t?u(I,{size:"text-s",font:"font-light",children:t}):null]}),f.length&&r?u(Ed,{points:f,className:"h-[640px]"}):null]})})),gh=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,xh=({styleMap:e,isMainButton:t,version:l})=>(n,a,i)=>{const{label:r,description:s,button:o,items:c,isDotted:d}=n;return p("div",{className:N("relative flex flex-col items-center text-center justify-between whitespace-pre-line overflow-hidden space-y-3xl",fh(i.length)),children:[p("div",{className:"space-y-xs",children:[r?u(Ae,{size:"text-h6",align:"text-center",children:r}):null,p("div",{className:"flex flex-col items-center gap-3xs",children:[s?u("div",{className:e.description,children:s}):null,u(Ge,{className:e.description,items:c,listItemSize:"M",isDotted:d})]})]}),o?.text&&!t?u(pe,{className:"box-border py-s w-full max-w-60 mt-auto",version:l,...o,children:o?.text}):null]},String(a))},fh=e=>e<5?"w-72":"w-52",bh={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"},yh=g((({buttons:e,className:t="",description:l,showLines:n=!0,size:a="normal",steps:i=[],stepVersion:r="gray",title:s,version:o="primary",...c})=>{const d=i.length>3,m=bh,h=(e=>e?"":"opacity-0")(n),g=(e=>e<5?"px-24":"px-16")(i.length),x=Boolean(e?.every((e=>e?.text)));return p(k,{className:N("box-border flex flex-col items-center overflow-hidden gap-y-3xl",t),defaultPadding:"p-6xl",version:o,...c,children:[u(B,{headlineVersion:"S",title:s,description:l,isEmbedded:!0,className:"w-full",align:ca}),i?.length?p("div",{className:"box-border space-y-lg flex flex-col justify-center",children:[u("div",{className:N("flex items-center",g),children:Gc(u("div",{className:N("h-0.5 w-full bg-secondary-light flex-1",h)}))(i.map(vh(m,a,r)))}),u("div",{className:N("flex justify-between",d?"gap-x-s":"gap-x-20"),children:i.map((f={styleMap:m,isMainButton:x,version:o},(e,t,l)=>{const{type:n}=e;if("default"!==n&&"rte"!==n)return null;switch(n){case"default":return xh(f)(e,t,l);case"rte":return u("div",{className:N("text-center",fh(l.length)),children:u(Me,{__html:e.__html})},String(t));default:return null}}))})]}):null,He(e)]});var f})),vh=(e,t,l)=>({icon:n},a)=>{const i="secondary"===l?"white":"color";return u(k,{defaultPadding:"",className:`${Nh(t)} flex justify-center items-center text-center rounded-full box-border z-10`,version:l,children:Ue(n)?u(ee,{image:{...n,iconVersion:n?.iconVersion||i},width:"48",height:"48"}):u("span",{className:N("text-h4","transparent"===l?e.iconText:(r=l,"secondary"===r?"group-data-primary:text-white":"text-secondary-text")),children:a+1})},String(a));var r},Nh=e=>"normal"===e?"h-24 w-24":"h-16 w-16",wh=g((({className:e,version:t,gap:l=14,padding:n=16,showDots:a=false,minHeight:i,children:r,onVisibleIndicesChange:s,listType:o="horizontal-list"})=>{const c=Array.isArray(r)?r.length:0,[d,m]=Zi({itemCount:c,onVisibleIndicesChange:s}),[h]=m.visibleIndicesRange;return p("div",{className:N(e,"vertical-list"===o?"relative h-full":""),children:[u(Wi,{containerRef:d,activeIndex:h,visibleItemCount:1,gap:l,padding:n,onVisibleIndicesChange:m.handleVisibleIndicesChange,listType:o,minHeight:i,children:r}),a?u(Gi,{containerRef:d,activeIndex:h,dotCount:c,listType:o,version:t}):null]})})),kh=g((({listType:e,showDots:t,options:l,version:n,...a})=>u(k,{version:n,defaultPadding:"p-0",...a,children:u(wh,{listType:e,showDots:t,version:n,children:D({...a,options:l})})})));kh.childrenTypes={exclude:["SwipeListControlBlock"]};const Ch="hidden sm:flex absolute z-40 top-0",Sh=g((({className:e,items:t=[],value:l,onChange:n,tabsType:a})=>{const[i,r]=Zi({itemCount:t?.length||0});return p("div",{className:N("relative overflow-x-auto no-scrollbar",e),role:"tablist",children:[u(Wi,{containerRef:i,snapAlign:"snap-start",onVisibleIndicesChange:r.handleVisibleIndicesChange,children:t.map(Pd(l,n,a))}),r.canScrollLeft?u(wa,{className:N("left-6",Ch),onClick:r.scrollLeft}):null,r.canScrollRight?u(ka,{className:N("right-6",Ch),onClick:r.scrollRight}):null]})})),Ih=({tabsMode:e,...t})=>{switch(e){case"wideScreen":return u(Md,{...t});case"centered":return u("div",{className:"flex",children:u(Md,{className:"m-auto p-xs rounded-md bg-main-gray",tabsType:"rounded",...t})});case"scrollable":return u("div",{className:"flex",children:u(Sh,{className:"m-auto",tabsType:"underlined",...t})});default:return null}},Th="tab",Bh=g((({className:e="",isSticky:t,tabs:l=[],tabsMode:s,...o})=>{const c=v(),{isReady:d}=c,m=r((()=>l.map(Mh)),[l]),[h,p]=n(0);a((()=>{if(!l||!l[0])return;const e=c.query.tab&&l.findIndex((e=>"group"===e.type&&e.ref===c.query.tab))||0,t=l[e]||l[0];p(e),Ph(t)}),[d]),a((()=>{const e=l[h];"group"===e?.type&&y.subject("tab",{type:e.type,label:e.ref,groupName:e.name})}),[l,h]);const g=i((e=>{const t=m.indexOf(e),n=l[t];p(t),Ph(n),"group"===n.type&&(e=>{const t=new URLSearchParams(c.query);e.name?t.set(Th,e.name):t.delete(Th),c.replace(`${c.pathname}?${t}`,"",{scroll:!1})})(e)}),[l,m]);return u(k,{className:N(t?"sticky top-1 z-20":"",e),defaultPadding:"p-0",...o,children:Ih({items:m,value:m[h],tabsMode:s,onChange:g})})})),Ph=e=>{"group"===e.type&&y.fire("tab",{type:e.type,label:e.ref,groupName:e.name}),"link"===e.type&&y.fire("tab",{type:e.type,label:e.href})},Mh=e=>"group"===e?.type?{text:e.title,name:e.ref}:e,Rh={start:"text-start",center:"text-center",end:"text-end"},Ah=g((({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 p("button",{type:"button",onClick:l,"aria-label":e?.title,className:N("border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs",a.btn,t),children:[e?.icon?u(ee,{className:N("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,p("div",{className:"border-0",children:[e?.title?u("div",{className:a.title,children:e.title}):null,e?.description?u("div",{className:a.desc,children:e.description}):null]})]})})),zh=g((({tab:e})=>{const t=ce();return Io((()=>{const{onClick:l}=t(e);l()}),[e],500),u(Dm,{className:"col-span-12 p-xl",size:5})})),Dh=g((({className:e="",tabs:t=[],block:l,tabAlign:i,...r})=>{const[s,o]=n(_h(t)),c=Vh(t[s],s),d=t.length,[m,{inc:h,dec:g}]=va({itemCount:d},s),[x,f]=Zi({itemCount:d});return a((()=>{f.scrollTo(s,{behavior:"auto"})}),[]),p(k,{className:N(e),defaultPadding:"p-0",...r,children:[p("div",{className:"relative border-b-8 border-primary-main",children:[u(Wi,{itemClassName:"flex",containerRef:x,snapAlign:"snap-end",gap:8,onVisibleIndicesChange:f.handleVisibleIndicesChange,children:t.map(Fh(s,o,i))}),u(lr,{scroll:f,arrowsPadded:!0,onScrollLeft:g,onScrollRight:h,activeIndex:m,itemCount:d})]}),u("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:t[s]?.href?u(zh,{tab:t[s]}):z(l?.slots?.[c],{...r?.options,slotName:c})})]})}));Dh.slots=({tabs:e})=>e?.filter((e=>!e.href)).map(Vh)||[],Dh.childrenTypes={exclude:["TabsLayout"]};const Vh=(e,t)=>e?.title||`Слот №${t}`,_h=e=>e.reduce(((e,t,l)=>t.selected?l:e),0),Fh=(e,t,l="start")=>(n,a)=>u(Ah,{className:Rh[l],tab:n,isActive:e===a,onClick:()=>t(a)},String(a)),jh=g((({className:e="",isOpen:t,onClick:l})=>u(pe,{className:e,appendRight:u(ee,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"20",height:"20"}),text:t?"Скрыть":"Показать",version:"gray",onClick:l}))),Lh={Buttons:({buttons:e})=>He(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?u(ee,{image:e}):null,List:({isDotted:e,...t})=>u(Ge,{className:"flex flex-col justify-between items-start text-h6",isDotted:e??!0,...t}),LabelDescription:({label:e,description:t})=>p("div",{className:"space-y-2xs",children:[e?u("div",{children:u(Ae,{size:"text-h6",children:e})}):null,t?u("div",{children:u(Ae,{size:"text-l",color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,dataUrl:l,pdfUrl:n,isOpen:a})=>e?u(jh,{isOpen:a,onClick:()=>{t({dataUrl:l,pdfUrl:n})}}):null},Eh=g((({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 Oh({cell:e,cellProps:{rowIdx:l,cellIdx:i,fieldIdx:t,displayTable:e=>{m(!1),c(i),r(e)},isVisible:d}})})),Oh=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:l,...n}=e;if(!l||!(l in Lh))return null;return u(Lh[l],{...t,...n})},$h=g((({cells:e,rowIdx:t,cellIdx:l,setTableInner:n,tableInner:a,openTableInnerIdx:i,setOpenTableInnerIdx:r})=>u("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>u(Eh,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:l,setTableInner:n,tableInner:a,openTableInnerIdx:i,setOpenTableInnerIdx:r},String(s)))):null}))),Uh=(e,t)=>140*Te(e.slice(0,t).map((e=>e?.cols?.length??1))),Hh=(e,t)=>e?.length>0?u("div",{className:N("flex",0===t?"text-secondary-text":""),children:e.map(((e,t)=>u("div",{className:"w-20 mx-lg",children:u(Ae,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,Wh=g((({rows:e})=>{const t=e?.[0]?.length??0,[l,n]=va({itemCount:t,visibleItemCount:5});return p("div",{children:[e?.map((a=l,(e,t)=>{if(!e?.length)return null;const[l,...n]=e,i=N("flex duration-1000 text-center",0!==t?"font-normal":"font-light");return p("div",{className:"flex border-main-divider border-b border-solid h-full",children:[l?.data?u("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:u(Ae,{size:"text-xl",font:"font-light",children:l.data})}):null,u("div",{className:"flex flex-grow overflow-hidden",children:u("div",{className:i,style:{transform:`translateX(-${Uh(n,a)}px)`},children:n?.map(((e,t)=>p("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?u(Ae,{size:"text-xl",children:e.data}):null,e?.cols?Hh(e.cols,a):null]},`row${t}`)))})})]},String(t))})),Ca({...n,btnClass:["left-3 top-20","right-3 top-20"],className:""})]});var a})),Kh=g((({activeTabIndex:e,items:t})=>u("div",{children:t.map(((t,l)=>{const n=`activeTabIdx:${e}-tableIdx:${l}`;return p("div",{className:"w-full @container",children:[u("div",{className:"flex py-m sm:px-m bg-white @4xl:bg-gray relative",children:u(Ae,{size:"text-xl",align:"text-left",children:t.title})}),u("div",{className:"w-full sm:pl-xs overflow-hidden transition-height duration-500 ease-in-out",children:u("div",{className:"relative",children:u(Wh,{rows:t.rowsData})})})]},n)}))}))),Xh=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Yh=g((({currencies:e,linkToPDF:t,activeTabIndex:l,setActiveTabIndex:n})=>p("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?u("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>u("div",{className:N("rounded-md px-4 py-3 cursor-pointer",t===l?"bg-primary-main":""),onClick:()=>n(t),children:u(Ae,{size:"text-xl",font:"font-light",color:Xh(t===l),children:e||t+1})},e)))}):null,t?u(pe,{className:"text-primary-main",href:t,version:"secondary",target:"_blank",appendLeft:u(W,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]})));async function qh(e){const t=await fetch(e);return await t.json()}const Gh=g((({dataUrl:e,pdfUrl:t,onClick:l})=>{const{tableData:a}=function(e){const{data:t}=mt(function(e){return`/wcms-resources/${e||"tariffs-inner-table-data"}.json`}(e),qh);return t||{}}(e),[r,s]=n(0),o=i((e=>s(e)),[]),c=a?.[r]?.items??[],d=a?.map((e=>e.currency??""));return p("div",a?{className:"bg-white z-10",children:[u(Yh,{currencies:d,activeTabIndex:r,setActiveTabIndex:o,linkToPDF:t}),u(Kh,{activeTabIndex:r,items:c}),u(jh,{className:"mt-xl",onClick:l,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[u(Ae,{size:"text-h6",children:"Данных нет"}),u(jh,{onClick:l,isOpen:!0})]})})),Jh=g((({children:e,tableInner:t,onHideContentClick:l})=>p("div",{className:"self-start flex flex-col",role:"row",children:[u("div",{className:N("@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?u("div",{className:"origin-top animate-expansion",children:u(Gh,{...t,onClick:l})}):null]}))),Qh=g((({row:{header:e,data:t},activeIndex:l,rowIdx:a,...r})=>{const[s,o]=n(void 0),c=i((e=>o(e)),[]),[d,m]=n(void 0),h=i((e=>m(e)),[]);return p(Jh,{onHideContentClick:()=>o(void 0),tableInner:s,...r,children:[u("div",{className:N("text-s","w-80 flex-shrink-0"),children:p("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?u(ee,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?u(Ae,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?u($r,{activeIndex:l,columnWidth:360,version:"tariff",children:t.map(((e,t)=>u($h,{cells:e,rowIdx:a,cellIdx:t,setTableInner:c,tableInner:s,openTableInnerIdx:d,setOpenTableInnerIdx:h,...r},String(t))))}):null]})})),Zh=g((({children:e,controls:t})=>{const{isScrollAvailable:l}=t;return p("div",{role:"table",children:[p("div",{className:"relative space-y-xs",children:[e,Ca({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),l?u("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),eu=g((({className:e="",title:t,description:l,rowHeaders:n,tariffsColumns:a,hiddenRowsNum:i=0,...r})=>{const s=a?.map((({data:e})=>e))||[],o=n?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),c=s.length,[d,m]=va({itemCount:c,visibleItemCount:2}),h=(o||[]).map(((e,t)=>u(Qh,{row:e,activeIndex:d,rowIdx:t,...r},String(t)))),[g,x]=i>0?[h.slice(0,-i),h.slice(-i)]:[h,[]];return p(k,{className:N("overflow-hidden relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...r,children:[u(B,{title:t,description:l,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),u("div",{className:"space-y-m",children:i>0?u(Rr,{renderFoldableSection:({isUnfolded:e})=>p(Zh,{controls:m,children:[g,u(Ar,{isUnfolded:e,children:x})]}),renderFoldButton:ss}):u(Zh,{controls:m,children:h})})]})})),tu=g((({className:e="",title:t,description:l,iconVersion:n,__html:a,...i})=>p(k,{className:N("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...i,children:["small"===n?lu():null,p("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?u(Ae,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,l?nu(l):null,a?u(Me,{__html:a}):null]})]}))),lu=()=>u("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"}),nu=e=>u(I,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),au=g((({prefix:e,unit:t,suffix:l})=>p("div",{className:"w-full flex items-end",children:[e?u("div",{className:"gradient-color-text",children:u(Ae,{size:"text-h2",children:e})}):null,t?u("div",{className:"-mb-6 @xl:-mb-4",children:u("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,l?u("div",{className:"gradient-color-text",children:u(Ae,{size:"text-h2",children:l})}):null]}))),iu=g((e=>{const{prefix:t,unit:l,suffix:n,...a}=e;return u(k,{defaultPadding:"p-0",...a,children:u(au,{prefix:t,unit:l,suffix:n})})})),ru=g((({className:e="",padding:t="p-0",gap:l="",isInnerPadding:n=!0,version:a="transparent",isTheme:i=!1,isCardBorder:r=!1,image:s,...o})=>{const c=v();return u(k,{className:N("relative flex flex-col",Oc[l],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${q(c)(s?.src)})`}}:{},padding:t,version:a,isTheme:i,...o,children:D({...o,extraProps:{className:N("w-full",ar(r)),padding:n?"":"p-0"}})})}));ru.childrenTypes=[];const su=e=>(e=>{const t="col-span-",l=e?.split(/\s+/).find((e=>e.startsWith(t)));return l?parseInt(l.substring(t.length),10):12})(e)<10?"py-xl px-6xl":"py-6xl px-32",ou=g((({className:e,title:t,url:l,previewImg:n,...a})=>{const i=v();return p(k,{className:e,defaultPadding:su(e),...a,children:[u(B,{title:t,headlineVersion:"M"}),l?u("video",{className:"m-auto w-full object-fill",preload:"metadata",poster:$(i)(n?.src),style:{maxHeight:524},controls:!0,children:u("source",{src:$(i)(l)})}):null]})})),cu={AdTile:yt,ApplicationForm:sa,BenefitsBlock:ha,BonusBenefitsBlock:fa,ButtonsBlock:ya,Calculator:Ai,CardTransfer:Li,Carousel:hr,CarouselBankHistoryCard:ur,CarouselCard:br,CarouselCatalogCard:vr,CarouselLinks:Cr,CarouselRecommendationCard:Pr,CarouselTariffsCard:Dr,ComparisonTable:Zr,ContactsBlock:ts,DepositFiltration:Ts,Depository:$s,ErrorBlock:Hs,ExchangeRateTile:xo,Footer:lc,GracePeriod:nc,Header:Ec,Headline:B,HorizontalLayout:$c,ImgBlock:Uc,InsuranceAmountBlock:Yc,InvestmentInfo:Zc,LinkDocs:od,MobileAppTile:md,MortgageFiltration:Ad,OfficesAtmsMap:zm,Placeholder:jm,ProductBlock:rt,ProductGallery:Lm,RepresentativeOfficeInfo:Om,RichTextBlock:Hm,RollupItem:Km,SafeDepositRental:ph,StepsBlock:yh,SwipeListControlBlock:kh,Tabs:Bh,TabsLayout:Dh,TariffsTable:eu,TextBlock:tu,UnitBlock:iu,VerticalLayout:ru,Video:ou},du="cookie",mu=g((({termLink:e,personalDataPolicyLink:t})=>{const[l,{setTrue:n,setFalse:a}]=tl();Io((()=>{globalThis.localStorage?.getItem(du)||n()}),[],3e3);const r=i((()=>{globalThis.localStorage?.setItem(du,"true"),a()}),[]);return l?u("div",{className:"container fixed left-0 right-0 bottom-0 z-50",children:p("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[u("div",{className:"sm:flex-1",children:p(I,{size:"text-s",font:"font-light",color:"text-primary-text",children:["АО «Россельхозбанк» использует",u(Ir,{isRemote:!0,className:hu(e?.href),...e,children:"cookie"}),"(файлы с данными о прошлых посещениях сайта) для персонализации сервисов и удобства пользователей. Вы можете запретить сохранение cookie в настройках своего браузера.",u(Ir,{isRemote:!0,className:hu(t?.href),...t,children:"Обработка Ваших персональных данных"}),"производится в соответствии с требованиями Федерального закона от 27.07.2006 № 152-Ф3 «О персональных данных»."]})}),u("div",{className:"ml-s sm:ml-0 w-24 flex justify-end",children:u(So,{className:"bg-main-gray rounded-md",onClose:r})})]})}):null})),hu=e=>N("inline mx-2xs",e?"text-green-dark":"");function uu(e){throw new Error(e)}const pu=({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((()=>y.subscribe("dialog",(e=>{switch(e.type){case"open":r(e);break;case"close":e.all?c():d();break;default:uu(e)}}))),[c,d]),l},gu=g((()=>{const e=i((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=i((e=>{e?.onClose&&e.onClose()}),[]),l=pu({onCloseAll:e,onClose:t}),{close:n}=se(),r=i((({key:e})=>{"Escape"===e&&n()}),[]);return nl(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?u("div",{className:"fixed inset-0 z-50",role:"dialog",children:l.map((({dialog:e,id:t},n)=>u("div",{className:N("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar",n===l.length-1?"":"hidden"),children:e},String(t||n))))}):null})),xu=g((()=>{const[e,t]=n(null),l=i((()=>{t(null)}),[]);a((()=>y.subscribe("popup",(e=>{switch(e.type){case"open":case"update":t(e);break;case"close":l();break;default:uu(e)}}))),[]);const r=i((({key:e})=>{"Escape"===e&&l()}),[l]);return nl(globalThis.document,"keydown",r),e?u("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})),fu=g((()=>null)),bu=h();const yu=g((({className:e,onClick:t,ariaLabel:l})=>u("button",{type:"button",className:`border-0 w-9 bg-inherit cursor-pointer ${e||""}`,onClick:t,"aria-label":l,children:vu()}))),vu=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[Nu("M21.48 11.95c.5-1.4-.4-2.6-1.9-2.6h-4c-.6 0-1.1-.5-1-1.2l.5-3.2c.2-.9-.4-1.9-1.3-2.2-.8-.3-1.8.1-2.2.7l-4.1 6.1M7.48 18.35l3.1 2.4c.4.4 1.3.6 1.9.6h3.8c1.2 0 2.5-.9 2.8-2.1l1.24-3.77"),Nu("M2.38 18.35v-9.8c0-1.4.6-1.9 2-1.9h1c1.4 0 2 .5 2 1.9v9.8c0 1.4-.6 1.9-2 1.9h-1c-1.4 0-2-.5-2-1.9Z")]}),Nu=e=>u("path",{stroke:"#292D32",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",strokeMiterlimit:"10",d:e}),wu=g((({className:e=""})=>{const t=function(e){const[t,l]=n(0);return a((()=>{(async()=>{const[t]=await bu.getLikeCount(e);l(t?.value||0)})()}),[e]),{likeCount:t,like:i((async()=>{l(await bu.like(e))}),[e]),dislike:i((async()=>{l(await bu.dislike(e))}),[e])}}(v().pathname);return p("div",{className:`border-main border-2 border-solid bg-white flex w-32 items-center justify-center gap-s p-xs font-sans ${e}`,children:[u(yu,{onClick:oe(t.like),ariaLabel:"Поставить отметку «лайк»"}),u(yu,{onClick:oe(t.dislike),className:"rotate-180",ariaLabel:"Поставить отметку «дизлайк»"}),u("span",{className:"select-none",children:t.likeCount})]})})),ku=g((({className:e,blocksRegistry:t,blockDecorator:l,data:n={}})=>{const{style:a,slots:i,likeControl:r,colorPalette:s="pc"}=n,o={key:"",page:n,blocksRegistry:t,blockDecorator:l,parent:n};return p("div",{"data-theme":s,children:[p("section",{className:N("@container relative",a,e),children:[i?.header?u("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:z(i?.header,{...o,slotName:"header"})}):null,p("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[D({block:n,options:o,extraProps:{className:"scroll-mt-12"}}),z(i?.footer,{...o,slotName:"footer"})]}),r?u("div",{className:"flex items-end absolute bottom-0 right-0 h-full pointer-events-none",children:u(wu,{className:"rounded-tl-3xl sticky bottom-0 pointer-events-auto"})}):null]}),u(fu,{options:o}),u(gu,{}),u(xu,{}),u(mu,{termLink:{href:"/pd-policy#cookie",target:"_blank"},personalDataPolicyLink:{href:"/pd-policy",target:"_blank"}})]})}));ku.childrenTypes=[],ku.slots=()=>["header","footer"];e.Blocks=cu,e.ContentPage=ku,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.LikeAPI=h,e.handlerDecorator=oe,e.joinList=Gc,e.packageVersion="0.14.150",e.projectSettings=d,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=L,e.useRouter=v,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniBlocks={})}(this,(function(e){"use strict";let t;const l=e=>(...l)=>t[e](...l),n=l("useState"),a=l("useEffect"),i=l("useCallback"),r=l("useMemo"),s=l("useRef");const o=e=>e&&!e.endsWith("/")?`${e}/`:e,c={PROD_BRANCH:"master"},d=new class{_=c;setup(e){this._=e}get TEST_BRANCH(){return this._.TEST_BRANCH}get RC_BRANCH(){return this._.RC_BRANCH}get PROD_BRANCH(){return this._.PROD_BRANCH||c.PROD_BRANCH}get FORCED_DRAFT_FLOW(){return this._.FORCED_DRAFT_FLOW}get ASSIST_PROJECT_ID(){return this._.ASSIST_PROJECT_ID}get SITEMAP(){return this._.SITEMAP}get STICKY_MOBILE_MENU(){return this._.STICKY_MOBILE_MENU}get FOOTER(){return this._.FOOTER}get PORTAL_DATA(){return this._.PORTAL_DATA}get CHAT_BOT(){return this._.CHAT_BOT}get CDN(){return o(this._.CDN)}get BASE_PATH(){return o(this._.BASE_PATH)}get YANDEX_MAP_API_KEY(){return this._.YANDEX_MAP_API_KEY}get YANDEX_METRIKA_ID(){return this._.YANDEX_METRIKA_ID}},m="likesToken";function h(){async function e(){try{const e=JSON.parse(globalThis.localStorage?.getItem(m)||"");if(e?.token)return e}catch(e){}try{const e=await fetch("/assist/v1/public/auth",{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({prefix:"guest"})}),{token:t,name:l}=await e.json();return globalThis.localStorage?.setItem(m,JSON.stringify({token:t,name:l})),{token:t,name:l}}catch(e){return console.error(e),{}}}return{getLikeCount:async function(...t){if(!t.length)return[];const{token:l}=await e();try{const e=await fetch(`/assist/v1/public/projects/${d.ASSIST_PROJECT_ID}/nodes/likes`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:l},body:JSON.stringify({node_ids:t})}),{likes:n}=await e.json();return n||[]}catch(e){return console.error(e),[]}},like:async function(t){if(!t)return 0;const{token:l,name:n}=await e();try{const e=await fetch(`/assist/v1/public/projects/${d.ASSIST_PROJECT_ID}/nodes/like`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:l,UserID:n},body:JSON.stringify({node_id:t,user_name:n})}),{likes:a}=await e.json();return a||0}catch(e){return console.error(e),0}},dislike:async function(t){if(!t)return 0;const{token:l,name:n}=await e();try{const e=await fetch(`/assist/v1/public/projects/${d.ASSIST_PROJECT_ID}/nodes/unlike`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:l,UserID:n},body:JSON.stringify({node_id:t,user_name:n})}),{likes:a}=await e.json();return a||0}catch(e){return console.error(e),0}}}}const u=(...e)=>globalThis._uni._jsx(...e),p=(...e)=>globalThis._uni._jsxs(...e),g=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:x(e)),t._tmpl},x=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},f=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),b=g((({children:e})=>f?e:null));const y=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 v(){return v._impl()}v._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),v.setup=e=>{v._impl=e};const N=(...e)=>e.flatMap((e=>e)).filter(Boolean).join(" "),w={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","":""},k=g((({className:e,version:t="primary",isTheme:l=!0,defaultPadding:i="p-xl",padding:r,block:s,tag:o="section",role:c,children:d,style:m})=>{const h=o,p=v(),[g,x]=n(!1);a((()=>y.subscribe("tab",(e=>{e.groupName&&e.groupName!==s?.labelGroup||x(Boolean(e.label&&s?.labels?.length&&!s.labels.includes(e.label)))}))),[s,p]);const f=t&&l;return u(h,{className:N("@container font-sans",f?"group":"",w[t],g?"hidden":"",r||i,e),...f?{"data-ver":t}:{},...s?.anchor?{id:s.anchor}:{},role:c,style:m,children:d})})),C={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},S=g((({className:e="",headingType:t="h3",as:l="h3",title:n,children:a})=>u(l,{className:N("font-sans m-0",C[t],e),children:n||a}))),I=g((({children:e,...t})=>u("p",{className:N("font-sans",Object.values(t)),children:e}))),T={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"}},B=g((({className:e,version:t="",headlineVersion:l="XL",title:n,description:a,align:i="text-center",as:r,isEmbedded:s=!1,isTheme:o=!1,...c})=>{const d=T[l],m={marginTop:d.descriptionStyle};return p(k,{className:N(s?"@container-normal":"",e),defaultPadding:s?"":"p-6xl",version:t,isTheme:o,...c,children:[n?u(S,{className:N("whitespace-pre-wrap",i),...d?.title,as:r||d?.title.as,title:n}):null,a?u(I,{size:d.descriptionSize,font:d.descriptionWeight,align:i,...m,children:a}):null]})})),P=({blockClassName:e,block:t,render:l})=>l({blockClassName:e,block:t}),M=[];function R(e,t,{className:l,...n}={}){const{key:a,blockDecorator:i=P,blocksRegistry:r={},ancestors:s=M}=t,{type:o}=e;o&&o in r||console.warn(`No block with "${o}" is registered`);const c=o&&r[o];return i({blockClassName:N(e.style?.length?e.style:"col-span-12",l),block:e,ancestors:s,render:({block:l,blockClassName:i})=>{const{content:r}=l;return c?u(c,{className:i,block:e,options:t,...r,...n},a):null}},a)}const A=[],z=(e,{key:t,ancestors:l=A,slotName:n=null,extraProps:a,renderProps:i=R,...r})=>{const s=a?(e,t)=>R(e,t,a):i;return(e||[]).map(((e,a)=>s(e,{...r,key:`${t||e.type}-${a}`,ancestors:r.parent?[...l||A,[r.parent,n]]:l},a)))};function D({block:e,options:t,children:l,extraProps:n,renderProps:a}){return l||(e&&t?z(e.blocks,{...t,parent:e,extraProps:n,renderProps:a}):null)}const V=e=>Boolean(e?.includes(":")),_=(e,t)=>Boolean(e&&!V(e)&&(!t||"_self"===t)),F=e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),j=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/");var L=Object.freeze({__proto__:null,isURL:V,isLocalURL:_,isHash:e=>Boolean(e?.startsWith("#")),withoutQuery:F,joinPath:j});const E="/api/",O=`${E}v1/storage`,$=e=>(t,l=d.BASE_PATH)=>{if(!t||V(t)||[d.CDN,E].some((e=>U(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 j(U(t,l)?"":l,n?"/":e.pathname?.split("/").slice(0,-1).join("/"),t)},U=(e,t)=>t&&e&&e.startsWith(t),H={normal:"",color:"text-primary-main",black:"text-black",white:"text-black"},W=g((({className:e="",imageClassName:t="",name:l="",alt:n=`Иконка ${l}`,title:a=n,iconVersion:i="color",width:r,height:s})=>{const o=v(),c="normal"===i?`${l}.svg`:`sprites.svg#${l}`,m=$(o)(j(d.CDN,"/icons/",c));return"normal"===i?u("img",{className:e,src:m,alt:n,title:a,"aria-hidden":"true",width:r,height:s,style:K(e,s)}):u(Y,{className:e,children:p("svg",{className:N(X(r),H[i],"white"===i?"invert":"",t),width:r,height:s,"aria-hidden":"true",children:[a?u("title",{children:a}):null,n?u("desc",{children:n}):null,u("use",{href:m,xlinkHref:m})]})})})),K=(e,t)=>{return e?.includes("h-")?{}:{height:(l=t,l&&!/\D/.test(l)?`${t}px`:t),width:"auto"};var l},X=e=>e?"":"w-full h-full",Y=g((({className:e,children:t})=>e?u("div",{className:e,children:t}):t)),q=(e,t)=>l=>l&&!V(l)?$(e)(j(t,l)):l,G=(e,t)=>e?.media&&t?.media?e.media-t.media:0,J=g((({className:e="",image:t,imageClassName:l="",pathPrefix:n})=>{const a=v();return p("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(G).map((({src:e,format:l,media:i},r)=>u("source",{srcSet:q(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:q(a,n)(t.src)},l):null]})})),Q=(e,t="")=>u("img",{src:e.src,className:N("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,ee=g((({className:e="",image:t,imageClassName:l="",pathPrefix:n,...a})=>t?.src||t?.icon?t.icon?u(W,{className:e,imageClassName:l,iconVersion:t?.iconVersion,name:t.icon,...a}):u(J,{className:e,imageClassName:l,image:t,pathPrefix:n}):null)),te={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active",white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",transparent:"",gray:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","":""},le="bg-main-divider text-main-disabled",ne={primary:le,secondary:le,white:le,link:"",transparent:"",gray:le,"":""},ae="text-center font-sans select-none",ie={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","":""},re=({className:e,rounded:t,version:l})=>[ae,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",l?te[l]:"",t?"rounded-full":"rounded-md",e].join(" "),se=()=>({open:(e,t={})=>y.fire("dialog",{type:"open",dialog:e,...t}),close:()=>y.fire("dialog",{type:"close"}),closeAll:()=>y.fire("dialog",{type:"close",all:!0})}),oe=(e,t)=>oe._impl(e,t);function ce(e={}){const{isRemote:t,basePath:l}=e,n=v(),{closeAll:a}=se();return e=>({...e,href:t&&!l?e.href:$(n)(e.href,l),"aria-label":e.text,onClick:oe(i(e),e)});function i({href:e,target:l,onClick:i}){return r=>{i&&i(r),e&&!t&&_(e,l)&&(a(),r?.preventDefault(),n.push(e))}}}oe._impl=e=>e,oe.setup=e=>{oe._impl=e};const de=g((e=>{const{text:t,aboveText:l,appendLeft:n,appendRight:a,version:i="primary"}=e,r=he(e)?"hidden lg:block":"";return p("div",{className:N(me(e),"flex gap-xs"),children:[n?u("div",{className:N(r,ie[i]),children:n}):null,he(e)?p("div",{className:"whitespace-pre",children:[l?u("div",{className:"text-xs font-light text-left",children:l}):null,u("div",{className:"text-left "+(l?"text-s -mt-3xs":"text-l"),children:t})]}):null,a?u("div",{className:N(r,ie[i]),children:a}):null]})})),me=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 N("group/btn items-center justify-center",he(e)?a:"h-12 w-12 m-auto",n?"rounded-full":"")},he=({text:e,aboveText:t,appendLeft:l})=>Boolean(e||t||!l),ue=({className:e,rounded:t,version:l})=>["inline-block",ae,l?ne[l]:"",t?"rounded-full":"rounded-md",e].join(" "),pe=g((({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=ce()({onClick:r,href:n,...a}),o=t??u(de,{...s});return u(e?xe:ge,{...s,children:o})})),ge=g((({className:e="",href:t,rel:l,target:n,ariaLabel:a,version:i,rounded:r,onClick:s,children:o})=>u("a",{className:re({className:e,version:i,rounded:r}),href:t,rel:l,target:n,"aria-label":a,role:t?"link":"button",onClick:s,children:o}))),xe=g((({className:e,ariaLabel:t,version:l,rounded:n,children:a})=>u("div",{role:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:ue({className:e,rounded:n,version:l}),children:a})));function fe(e,t){const l="primary"===e?"white":"black",n="Вернуться назад";return p("div",{className:"hidden sm:flex items-center gap-s",children:[u("div",{className:re({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",version:e,rounded:!0}),onClick:t,children:u(ee,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:l}})}),u(pe,{version:"link",className:"group-data-secondary:text-white/80",text:n,ariaLabel:n,onClick:t})]})}const be={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},ye=g((({className:e,version:t="primary",defaultPadding:l,padding:n="",title:a="",insetTitle:r="",buttons:s,leftImage:o,rightImage:c,imageAlign:d,isImageAlwaysOnRight:m=!1,isImageSecondary:h=!1,backwardButton:g,children:x,...f})=>{const b=v(),y=i((e=>{e?.preventDefault(),b.back()}),[]);return p("div",{className:ve(n,l,e),children:[g?fe(t,y):null,a?u("div",{className:"relative h-full",children:a}):null,p("div",{className:N("grow relative flex flex-col @xl:flex-row gap-3xl w-full",o?"self-start @xl:w-auto":""),children:[Se(o,{imageAlign:d,className:"mx-auto"}),p("div",{className:N("grid gap-3xl",c?"@xl:grid-cols-2":"",o?"":"grow","h-full","auto-rows-[max-content_1fr]"),children:[p("div",{className:"grow space-y-lg min-w-fit",children:[r,x]}),Ce(D({...f,extraProps:{className:"@container-normal"}})),Se(c,{className:N("@xl:justify-self-end @xl:col-start-2",s?Ne(m):"",we(m),Ie(h)),imageAlign:d}),ke(s)]})]})]})})),ve=(e="",t="",l="")=>N("relative flex flex-col gap-3xl overflow-hidden",e||t,l),Ne=e=>e?"row-span-2":"@xl:row-span-2",we=e=>e?"col-start-2 self-center":"",ke=e=>e?u("div",{className:"self-end",children:e}):null,Ce=e=>e&&e?.length?u("div",{className:"flex items-start justify-end",children:e}):null,Se=(e,{className:t,imageAlign:l})=>e?u("div",{className:N("shrink-1/2 justify-self-center",l&&be[l],t),children:e}):null,Ie=e=>e?"hidden @xl:block":"",Te=(e=[])=>e.reduce(((e,t)=>e+t),0),Be=(e=[])=>e?.length?Te(e)/e.length:0,Pe=(e,t="normal")=>e?u("div",{className:N("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:u(ee,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,Me=g((e=>{const{__html:t="",richVersion:l=""}=e;return t.replace(/<\/?[^>]+\/?>/g,"").trim()?u("div",{"data-component":"rich-text-container",children:u("div",{className:N(l,"md-container"),dangerouslySetInnerHTML:{__html:t}})}):null})),Re=(e,t)=>e?u(I,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,Ae=g((({children:e,...t})=>u("span",{className:N("font-sans",Object.values(t)),children:e}))),ze=(e,t)=>e?u(Ae,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,De=(e,t)=>"rte"===e.type&&"__html"in e&&e.__html?u(Me,{...e},`rte-${t}`):["label"in e?ze(e.label,t):null,"description"in e?u("span",{className:e.descriptionClassName,children:Re(e.description,t)},String(t)):null],Ve=g((({className:e,benefitsVersion:t,...l})=>p("div",{className:N("flex gap-m min-w-56 items-center",e),children:["icon"in l?Pe(l.icon,t):null,u("div",{children:De(l)})]}))),_e=e=>"rte"===e.type?e?.__html?.length||0:Math.max(e?.label?.length||0,e?.description?.length||0),Fe=e=>{return((t=e.map(_e))?.length?Math.sqrt(Math.abs(Be(t.map((e=>e**2)))-Be(t)**2)):0)>16;var t},je=e=>e&&"icon"in e&&e.icon&&(e.icon.icon||e.icon.src),Le=e=>!e.some(je),Ee=g((({className:e,benefitsVersion:t="normal",benefits:l})=>l?.length?u("div",{className:N("flex gap-x-m gap-y-s",Fe(l)||Le(l)?"flex-col":"flex-wrap",e),children:l.map(((e,l)=>u(Ve,{benefitsVersion:t,...e},String(l))))}):null)),Oe=g((({className:e,benefits:t})=>t?.length?u("div",{className:N("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),children:t.flatMap(De)}):null)),$e=g((({isTabularBenefits:e,...t})=>u(e?Oe:Ee,{...t}))),Ue=e=>Boolean(e?.src||e?.icon),He=(e,{className:t,buttonClassName:l,isVertical:n}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?u("div",{className:N("flex",n?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m",t),children:e.map(We(l))}):null,We=(e="")=>(t,l)=>{const{text:n,icon:a,iconRight:i,version:r,...s}=t||{},o=Ke(a,r),c=Ke(i,r);return n||a?.icon?u(pe,{className:N("basis-full @lg:basis-auto",e),appendLeft:Xe({...a,iconVersion:o}),appendRight:Xe({...i,iconVersion:c}),version:r,text:n,...s},l?String(l):""):null},Ke=(e,t="secondary")=>{const l="secondary"===t?"color":"white";return e?.iconVersion?e?.iconVersion:l},Xe=e=>Ue(e)?u(ee,{image:e,width:String(e?.size?.width||24),height:String(24)}):null,Ye=g((({className:e,isDotted:t,dotClassName:l,children:n})=>p("div",{className:N("font-sans flex",e),role:"listitem",children:[t?u("div",{className:"shrink-0",children:u("div",{className:N("align-middle inline-block rounded-full group-data-secondary:bg-white",l)})}):null,u("span",{children:n})]}))),qe={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"}},Ge=g((({className:e,isDotted:t=!0,items:l=[],listItemSize:n="M",dotClassName:a=""})=>{const i=qe[n];return l?.length?u("section",{className:N("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)=>u(Ye,{isDotted:t,dotClassName:N(a||"bg-primary-text",i.dotStyle),children:e},String(l))))}):null})),Je=(e=0,{fixed:t}={})=>(l=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(l)||0),Qe=g((({priceList:e})=>e?.length?u("div",{className:"flex flex-wrap xl:flex-nowrap xl:bg-main-divider xl:rounded-md p-xs gap-xl",children:e.map(Ze)}):null)),Ze=({label:e,amount:t})=>p("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",children:[u(Ae,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?p("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[Je(2)(t)," ₽"]}):null]}),et=g((({className:e,tags:t})=>t?.length?u("div",{className:N("flex flex-wrap gap-xs",e),role:"list",children:t.map(tt)}):null)),tt=(e,t)=>u("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:u(Ae,{size:"text-m",font:"font-light",children:e})},String(t)),lt={XXL:"L",XL:"L",L:"M",M:"M",S:"S",XS:"S"},nt=g((({className:e,padding:t,defaultPadding:l,title:n,description:a,headlineVersion:i="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:o,benefits:c,__html:d,isFullWidthTitle:m,items:h,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:S,...I})=>{const T=y?.src?u(ee,{image:y}):null,P=u(B,{title:n,description:a,headlineVersion:i,align:r,isEmbedded:!0}),M=c?.filter((e=>"rte"===e?.type||"label"in e||"description"in e));return u(ye,{className:e,padding:t,defaultPadding:l,...m?{title:P}:{insetTitle:P},...at(T,N),isImageSecondary:k,imageAlign:v,isImageAlwaysOnRight:w,buttons:He(b),backwardButton:C,...I,children:p("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[M?.length?u($e,{benefitsVersion:s,isTabularBenefits:o,benefits:M}):null,d?u(Me,{__html:d}):null,h?.length?u(Ge,{items:h,isDotted:g,listItemSize:lt[i]}):null,S,x?.length?u(Qe,{priceList:x}):null,it(f)]})})})),at=(e,t)=>t?{rightImage:e}:{leftImage:e},it=e=>e?.length?u(et,{tags:e}):null,rt=g((({className:e,padding:t,...l})=>u(k,{className:N("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...l,children:u(nt,{defaultPadding:"p-6xl",padding:t,className:"grow h-full",...l})})));rt.childrenTypes=["UnitBlock"];const st=e=>null!=e,ot=new Map,ct=e=>Boolean(e?.every((e=>Array.isArray(e)?ct(e):!e||"string"==typeof e))),dt=e=>ct(e)?e.toString():"";function mt(e,t,{fallback:l,cache:i}={}){const s=r((()=>ht(e)),[e]),[o,c]=n(void 0),[d,m]=n(void 0);a((()=>{if(!s.some(st))return;let e=!1;const l=(t,l)=>{e||(c(t),m(l))};return(async()=>{try{l(await((e,t=ot)=>l=>{const n=dt(l),a=t.get(n);if(n&&st(a))return a;const i=e(...l);return n&&st(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 ht(e){return Array.isArray(e)?e:e instanceof Function?ht(e()):[e]}async function ut(e,t){try{return e?await pt(e,t):null}catch(e){console.error(e)}return null}const pt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),gt={},xt="/wcms-resources";function ft(e,t={}){const{fallback:l=gt,pathDir:n=xt}=t,{data:a}=mt(e?`${n}/${e}.json`:null,pt,{fallback:l});return a||gt}const bt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),yt=g((e=>{const t=((e="reklamnaya-plitka")=>{const t=ft(e),l=r((()=>bt(0,t?.items?.length)),[t]);return t?.items?.[l]})(e.options?.page?.adSourceBook);return t?u(b,{children:u(rt,{...t,...e})}):null}));const vt=e=>e,Nt=(e,t)=>{const[l,a]=n(e),[r,o]=n(!1),[c,d]=n({}),m=s({}),h=i(((e,t)=>{const{parse:n=vt,format:i=vt}=t||{};return m.current||(m.current={}),m.current[e]||=t=>{a((l=>({...l,[e]:n(t)}))),d((t=>({...t,[e]:!0})))},{value:i(l[e]),isDirty:r||c[e],onChange:m.current[e]}}),[l,r,c]),u=i((e=>{a(e),d(e)}),[]),p=i((()=>{a(e),o(!1),d({})}),[e]),g=i((e=>{e.preventDefault(),o(!0),t&&t(l)}),[t,l]);return[l,{isDirty:r||Object.values(c).some(Boolean),field:h,update:u,reset:p,onSubmit:g}]},wt=e=>e.replace(/[^+\d]/g,""),kt=e=>t=>t&&Object.entries(e).flatMap((([e,l])=>l(t[e])))||[],Ct=e=>!e?.length,St=e=>t=>l=>e(l)?[]:[t],It=g((({text:e,link:t})=>p(I,{size:"text-s",font:"font-light",color:"text-secondary-text",children:[u(Ae,{children:e||"Нажимая кнопку, вы подтверждаете согласие с "}),t?u(pe,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"text-primary-main",children:u(Ae,{children:t.text})}):null]}))),Tt="container space-y-lg",Bt="w-full max-w-xl space-y-s m-auto",Pt=(e,t)=>{const{value:l,isDirty:n}=e,a=n?t(l):[];return{...e,errors:a,error:a[0]}},Mt=g((({title:e,children:t})=>p("fieldset",{className:"grid @xl:flex @xl:justify-between gap-lg border-b border-b-main-divider @xl:border-none",children:[e?u("legend",{className:"w-full",children:u(S,{title:e,headingType:"h6",className:"@xl:text-center"})}):null,t]}))),Rt="@xl:w-1/2 space-y-s",At=g((({key:e,className:t="",id:l,name:n,type:r="text",label:o,placeholder:c,value:d="",valid:m=!0,children:h,onChange:g,onFocus:x,onBlur:f,pattern:b,autoFocus:y=!1,isTextarea:v=!1})=>{const w=s(null),k=i((e=>{g&&g(e.target?.value||"")}),[g]);a((()=>{y&&w.current?.focus()}),[y,w]);const C="w-full border rounded-md text-primary-text outline-none p-m",S=h?"pr-3xl":"",I=Dt(m);return p("div",{className:N("relative",t),children:[p("label",{children:[o?zt(o):null,v?u("textarea",{className:N("block resize-y min-h-24",C,I),id:N("textarea",l),name:n||l,placeholder:c,value:d,onInput:k,onFocus:x,onBlur:f},e):u("input",{type:r,className:N("h-14",C,S,I),ref:w,id:l,name:n||l,placeholder:c,value:d,onInput:k,onFocus:x,onBlur:f,pattern:b},e)]}),h]})})),zt=e=>u("div",{className:"mb-xs",children:u(Ae,{size:"text-m",font:"font-light",children:e})}),Dt=e=>e?"border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text":"border-error",Vt=e=>u("div",{className:"h-4",children:e?u(Ae,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),_t=g((({className:e,label:t,value:l="",placeholder:n,error:a,onChange:i,onBlur:r,isTextarea:s})=>p("div",{className:N("shrink-0 w-full",e),children:[u(At,{type:"text","aria-label":t,label:t,valid:Boolean(!a),value:l,onChange:i,onBlur:r,isTextarea:s,placeholder:n}),Vt(a)]}))),Ft=e=>"_"===e,jt=e=>/\d/.test(e),Lt=e=>Ft(e)||jt(e),Et=[..."+7 (___) ___-__-__"],Ot=Et.findIndex(Ft),$t=Et.map(((e,t)=>Lt(e)?Et.slice(0,t).filter(Lt).length:-1));const Ut=g((({children:e,onChange:t,...l})=>{const n=i((e=>t&&t(function(e){const t=e.replace(/\D/g,""),l=Et.map(((e,l)=>jt(e)?e:t.charAt($t[l])||e)),n=$t.indexOf(t.length-1)+1;return(n?l.slice(0,Math.max(Ot,n)):l).join("")}(e))),[t]);return u(At,{onChange:n,onFocus:e=>n(e?.target?.value||""),...l,children:e})})),Ht=g((({className:e,label:t,value:l,error:n,onChange:a,onBlur:i})=>p("div",{className:N("shrink-0 w-full",e),children:[u(Ut,{"aria-label":t,label:t,valid:Boolean(!n),value:l,onChange:a,onBlur:i,placeholder:"+7 (___) ___-__-__"}),Vt(n)]}))),Wt="Некорректно заполненное поле",Kt=St((e=>null!=e&&""!==e))(Wt),Xt=St((e=>"string"==typeof e&&e.length>1))(Wt),Yt=St((e=>"string"==typeof e&&(10===e.length||12===e.length)))(Wt),qt=(Gt=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,St((e=>"string"==typeof e&&Gt.test(e))))(Wt);var Gt;const Jt=St((e=>"boolean"==typeof e&&e))(Wt),Qt=(e,t)=>p(Mt,{title:t,children:[p("div",{className:Rt,children:[u(_t,{label:"Наименование организации*",...Pt(e("fullName"),Kt)}),u(_t,{label:"Контактное лицо*",...Pt(e("name"),Xt)})]}),p("div",{className:Rt,children:[u(_t,{label:"ИНН*",...Pt(e("inn"),Yt)}),u(Ht,{label:"Телефон*",...Pt(e("phone"),qt)})]})]}),Zt=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}];function el(){const{data:e}=mt("/api/v1/regions",pt);return e||[]}function tl(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 ll=e=>e?.text||e?.key||"";function nl(e,t,l,n){a((()=>{if(e&&l)return e.addEventListener(t,l,n),()=>{e.removeEventListener(t,l,n)}}),[e,t,l])}function al(e){const t=s(null),l=i((l=>{t&&t.current&&l.target instanceof Node&&!t.current.contains(l.target)&&e()}),[e]);return nl(globalThis.document,"click",l),t}const il=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,rl=g((({popupRef:e,options:t,value:l,query:n,onChange:a,iconVersion:i})=>t?.length?u("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md",role:"listbox",ref:e,children:il(t,n).map((e=>p("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"option","aria-selected":e.key===l?.key,onClick:t=>{t.stopPropagation(),a&&a(e)},children:[u("span",{className:"min-h-6",children:ll(e)}),u(W,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:i,className:N("absolute right-4 pt-3xs",e.key===l?.key?"":"hidden")})]},e.key)))}):null));function sl({isOpen:e,options:t,value:l,query:n,onChange:r,onClose:o,iconVersion:c}){const d={open:(e,t)=>y.fire("popup",{type:"open",popup:e,...t}),update:(e,t)=>y.fire("popup",{type:"update",popup:e,...t}),close:()=>y.fire("popup",{type:"close"})},m=i((()=>{d.close(),o&&o()}),[o]),h=i((e=>{m(),r&&r(e)}),[m,r]),p=s(null),g=al(m);return a((()=>{if(!e||!p.current)return;const a=p.current,{top:i,left:r,width:s,height:o}=a.getBoundingClientRect();d.update(u(rl,{popupRef:g,options:t,value:l,query:n,onChange:h,iconVersion:c}),{top:i+window.scrollY+o,left:r,width:s})}),[e,t,l,n,h]),p}const ol=g((({className:e,label:t,options:l=[],value:a,valid:r=!0,isBorder:s=!0,placeholder:o="",isSearch:c=!1,iconVersion:d,onChange:m})=>{const[h,{setFalse:g,setTrue:x}]=tl(),[f,b]=n(""),y=i((()=>{b(""),g()}),[]),v=sl({isOpen:h,options:l,value:a,query:f,onChange:m,onClose:y,iconVersion:d});return p("div",{className:e,children:[cl(t),p("div",{className:N("relative",h?"z-20":"z-10"),ref:v,children:[p("div",{className:N("h-14 text-l flex justify-between items-center text-primary-text cursor-pointer relative z-10",ml(s,r)),onClick:h?y:x,children:[u("p",{className:"p-m pr-8 flex items-center overflow-hidden text-ellipsis",children:ll(a)||o}),dl(h,d)]}),c&&h?u("div",{className:N("absolute top-0 w-full z-20"),children:u(At,{type:"text",autoFocus:!0,value:f,onChange:b})}):null]})]})})),cl=e=>e?u("div",{className:"mb-xs",children:u(Ae,{size:"text-m",color:"text-primary-text",font:"font-light",children:e})}):null,dl=(e,t)=>u(W,{className:N("absolute right-3",e?"":"rotate-180"),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),ml=(e,t)=>N(e?"border rounded-md hover:border-primary-hover":"",t?" border-gray":"border-error"),hl=g((({className:e="",error:t,...l})=>p("div",{className:e,children:[u(ol,{...l,valid:!t}),Vt(t)]}))),ul=g((({field:e})=>{const t=el();return u(hl,{className:"w-full",label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:t.map((({code:e="",name:t=""})=>({key:e,text:t}))),...Pt(e("region"),Kt)})})),pl=({field:e,title:t})=>p(Mt,{title:t,children:[u("div",{className:Rt,children:u(hl,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:Zt,...Pt(e("acquiringType"),Kt)})}),u("div",{className:Rt,children:u(ul,{field:e})})]}),gl=g((({value:e=!1,text:t,type:l="checkbox",onChange:n})=>p("div",{role:l,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>n&&n(!e),children:[u("div",{className:N("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:u("div",{className:N("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?u(Ae,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),xl=e=>p("div",{children:[u(gl,{text:"Хочу купить онлайн-кассу",...e("onlineCheckout")}),u(gl,{text:"Хочу купить POS-терминал",...e("posTerminal")})]});function fl({disabled:e,onClick:t}){return l=>{!e&&t&&t(l)}}const bl={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"},yl={primary:N("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:N("group-data-secondary:text-white group-data-secondary:bg-white/20","group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active")},vl=g((({children:e,...t})=>{const l=e=>({...e,onClick:oe(fl(e),e)}),{className:n,version:a="primary",active:i,disabled:r,type:s="button",rounded:o=!0,role:c,onClick:d}=l(t);return u("button",{className:N("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?"":N(bl[a],yl[a]),o?"rounded-md":"",n),type:s,role:c,onClick:d,children:e})})),Nl=(e,t)=>u(vl,{className:N("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),wl={acquiringType:{key:"trade",text:"Торговый эквайринг"},fullName:"",inn:"",name:"",phone:"",onlineCheckout:!1,posTerminal:!1},kl=kt({acquiringType:Kt,region:Kt,fullName:Kt,inn:Yt,name:Xt,phone:qt}),Cl=g((e=>{const{button:t,link:l,onSubmit:n}=e,a=i((e=>{const{acquiringType:t,region:l,fullName:a,inn:i,name:r,phone:s,onlineCheckout:o,posTerminal:c}=e,d=Sl(t?.key),m=`Вид эквайринга=${t?.text||""}${d?`/Онлайн касса=${o}/POS-терминал=${c}`:"/Онлайн касса=false/POS-терминал=false"}`,h={typeForm:"acqr",region:l?.text||"",partnerComments:m,fullName:a,inn:i,name:r,phone:wt(s)};Ct(kl(e))&&n(h,!1)}),[n]),[,{field:r,...s}]=Nt(wl,a),o=Sl(r("acquiringType").value?.key);return p("form",{className:Tt,onSubmit:s.onSubmit,children:[pl({field:r,title:"Вид эквайринга и регион"}),Qt(r,"Данные организации"),o?xl(r):null,Nl(t),u(It,{link:l})]})})),Sl=e=>"all"===e||"trade"===e,Il=g((({className:e,viewBox:t,fill:l="none",width:n,height:a,paths:i,...r})=>u("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 u("path",{d:e,fill:t||"currentColor",stroke:a.stroke,strokeLinecap:a.strokeLinecap,strokeLinejoin:a.strokeLinejoin,strokeWidth:a.strokeWidth,strokeMiterlimit:a.strokeMiterlimit},n)}))}))),Tl=[{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"}],Bl=g((({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]),o=a?u("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):u(Il,{paths:Tl,className:"absolute left-1 ml-px block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"});return u("div",{className:e,children:p("label",{className:"flex items-center relative cursor-pointer group/box",onClick:s,children:[u("div",{className:N("appearance-none w-5 h-5 border-solid cursor-pointer m-0",a?"rounded-full border-2":Pl(t),t?"border-primary-main":"border-gray",n?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:"checkbox","aria-checked":Boolean(t),"aria-disabled":Boolean(n)}),t?o:null,l?u("div",{className:"ml-s",children:u(Ae,{size:"text-l",font:"font-light",children:l})}):null]})})})),Pl=e=>N("rounded border",e?"bg-primary-main":""),Ml=g((({className:e,text:t,value:l,key:n,disabled:a,error:i,onChange:r})=>p("div",{className:N("shrink-0 w-full",e),children:[u(Bl,{text:t,value:l,disabled:a,onChange:r},n),Vt(i)]}))),Rl=(e,t,l)=>p("div",{className:"flex gap-m flex-col lg:flex-row w-full justify-between items-baseline",children:[p("div",{children:[p("div",{className:"flex gap-3",children:[u(Bl,{...e}),u(It,{text:"Согласен с ",link:t})]}),Vt(Pt(e,Jt).error)]}),Nl(l)]}),Al=(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}`}},zl=()=>{},Dl=({today:e,firstDayOfWeek:t,totalDays:l,currentMonth:n,currentYear:a,min:i,max:r,onDateClick:s})=>{const o=[];let c=1;for(let d=0;d<6;d++){const m=[];for(let o=0;o<7;o++)if(0===d&&o<t)m.push(u("td",{},`empty-${o}`));else if(c>l)m.push(u("td",{},`empty-${o}`));else{const t=new Date(a,n,c),l=Vl(t,e),o=_l(t,i,r);m.push(u("td",{children:u("div",{className:Fl(l,o),onClick:()=>!o&&s(t),children:c})},`day-${c}`)),c++}o.push(u("tr",{children:m},`row-${d}`))}return o},Vl=(e,t)=>t&&e.toDateString()===t.toDateString(),_l=(e,t,l)=>t&&e.getTime()<t.getTime()||l&&e.getTime()>l.getTime(),Fl=(e,t)=>N("p-s text-center rounded-md border",e?"":"border-transparent hover:bg-gray",t?"text-gray hover:bg-transparent":"cursor-pointer"),jl=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Ll=g((({today:e,currentMonth:t,currentYear:l,min:n,max:a,onDateSelect:s=zl})=>{const o=i((e=>s(e)),[]),{firstDayOfWeek:c,totalDays:d}=r((()=>({firstDayOfWeek:new Date(l,t,1).getDay()-1,totalDays:new Date(l,t+1,0).getDate()})),[l,t]);return p("table",{className:"mx-auto",children:[u("thead",{className:"text-gray font-light",children:u("tr",{children:jl.map(((e,t)=>u("th",{className:"p-s",children:e},String(t))))})}),u("tbody",{children:Dl({firstDayOfWeek:c,today:e,totalDays:d,currentYear:l,currentMonth:t,min:n,max:a,onDateClick:o})})]})})),El=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],Ol=El.map((e=>({key:e}))),$l=Array.from({length:(new Date).getFullYear()-1940+1},((e,t)=>1940+t)).reverse().map((e=>({key:String(e)}))),Ul={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Hl={className:"min-w-32",iconVersion:"black",isBorder:!1},Wl=g((({className:e="",label:t="",value:l,valid:a=!0,minDate:r,maxDate:s,onChange:o})=>{const[c,{setValue:d}]=tl(!1),[m,h]=n(l?.getMonth()||(new Date).getMonth()),[g,x]=n(l?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:f,handleNextMonth:b,handleSelectMonth:y,handleSelectYear:v,monthsOptions:w,yearsOptions:k,handleChangeVisibleCalendar:C,ref:S}=(({onShowCalendar:e,showCalendar:t,selectedMonth:l,onMonthSelect:n,onYearSelect:a,selectedYear:r})=>{const s=al(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(El.indexOf(e))),[]),handleSelectYear:i((({key:e})=>a(Number(e))),[]),monthsOptions:Ol,yearsOptions:$l,ref:s}})({onYearSelect:x,onMonthSelect:h,onShowCalendar:d,selectedYear:g,selectedMonth:m,showCalendar:c});return p("div",{className:N(e,"relative"),ref:S,children:[u(Ae,{size:"text-m","font-weight":"font-light",children:t}),Kl(C,l,a),c?p("div",{className:"absolute bg-white z-20 select-none",children:[p("div",{className:"flex gap-s",children:[u("div",{className:"my-auto",onClick:f,children:u(W,{...Ul,className:"-rotate-90 cursor-pointer"})}),u(ol,{onChange:y,value:{key:El[m]},options:w,...Hl}),u(ol,{onChange:v,value:{key:String(g)},options:k,...Hl}),u("div",{className:"my-auto",onClick:b,children:u(W,{...Ul,className:"rotate-90 cursor-pointer"})})]}),u(Ll,{today:l,currentMonth:m,currentYear:g,onDateSelect:o,min:r,max:s})]}):null]})})),Kl=(e,t,l)=>p("div",{onClick:e,className:N("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:[u(I,{children:t&&Al(t)}),u(W,{...Ul,name:"CalendarIcon"})]}),Xl=g((({className:e,label:t,value:l,error:n,onChange:a})=>p("div",{className:N("shrink-0 w-full",e),children:[t?u("div",{className:"mb-xs",children:u(Ae,{size:"text-m",font:"font-light",children:t})}):null,u(Wl,{value:l,onChange:a,valid:Boolean(!n)}),Vt(n)]}))),Yl={surname:"",name:"",middleName:""},ql=(e,t=!0)=>p("div",{className:"space-y-s",children:[u(_t,{label:"Фамилия*",...Pt(e("surname"),Xt)}),u(_t,{label:"Имя*",...Pt(e("name"),Xt)}),u(_t,{label:"Отчество (Обязательно, при наличии)",...e("middleName")}),t?u(Xl,{label:"Дата рождения*",...Pt(e("birthday"),Kt)}):null]}),Gl={...Yl,typeForm:{key:"ANTIFRAUD",text:"Предупреждение о мошенничестве"},phone:"",birthday:void 0,isClient:!1,comment:"",consentDataProcessing:!1},Jl=kt({typeForm:Kt,surname:Kt,name:Xt,birthday:Kt,phone:qt,isClient:Jt,comment:Kt,consentDataProcessing:Jt}),Ql=g((({button:e,link:t,onSubmit:l})=>{const n=i((e=>{const{typeForm:t,phone:n,...a}=e,i={...a,typeForm:t.key,phone:wt(n)};Ct(Jl(e))&&l(i,!0)}),[l]),[,{field:a,...r}]=Nt(Gl,n);return u("form",{className:Tt,onSubmit:r.onSubmit,children:u(Mt,{children:p("div",{className:Bt,children:[ql(a,!0),u(Ht,{label:"Телефон*",...Pt(a("phone"),qt)}),u(Ml,{...Pt(a("isClient"),Jt),text:'Являюсь клиентом банка АО "Россельхозбанк"'}),u(_t,{...Pt(a("comment"),Kt),placeholder:"Комментарий*",isTextarea:!0}),Rl(a("consentDataProcessing"),t,e)]})})})})),Zl=e=>p(Mt,{children:[p("div",{className:Rt,children:[u(_t,{label:"Контактное лицо",...Pt(e("name"),Xt)}),u(_t,{label:"ИНН",...Pt(e("inn"),Yt)})]}),p("div",{className:Rt,children:[u(Ht,{label:"Телефон",...Pt(e("phone"),qt)}),u(_t,{label:"Электронная почта",...Pt(e("mail"),Kt)})]})]}),en={name:"",phone:"",inn:"",mail:""},tn=kt({region:Kt,name:Xt,phone:qt,inn:Yt,mail:Kt}),ln=g((e=>{const{button:t,link:l,onSubmit:n}=e,a=i((e=>{const{region:t,name:l,phone:a,inn:i,mail:r}=e;Ct(tn(e))&&n({typeForm:"bcrd",region:t?.text||"",name:l,inn:i,mail:r,phone:wt(a)})}),[n]),[,{field:r,...s}]=Nt(en,a);return p("form",{className:Tt,onSubmit:s.onSubmit,children:[u(ul,{field:r}),Zl(r),Nl(t),u(It,{link:l})]})})),nn={...Yl,typeForm:{key:"CORRUPTION",text:"Факты коррупции"},phone:"",email:"",comment:"",consentDataProcessing:!1},an=kt({typeForm:Kt,surname:Kt,name:Xt,region:Kt,phone:qt,email:Kt,comment:Kt,consentDataProcessing:Jt}),rn=g((({button:e,link:t,onSubmit:l})=>{const n=i((e=>{const{typeForm:t,phone:n,region:a,...i}=e,r={...i,typeForm:t.key,regionBranch:a?.text,phone:wt(n)};Ct(an(e))&&l(r,!0)}),[l]),[,{field:a,...r}]=Nt(nn,n);return u("form",{className:Tt,onSubmit:r.onSubmit,children:u(Mt,{children:p("div",{className:Bt,children:[ql(a,!1),u(ul,{field:a}),u(Ht,{label:"Телефон*",...Pt(a("phone"),qt)}),u(_t,{label:"Электронная почта*",...Pt(a("email"),Kt)}),u(_t,{...Pt(a("comment"),Kt),placeholder:"Ваше сообщение*",isTextarea:!0}),Rl(a("consentDataProcessing"),t,e)]})})})})),sn=[];function on(e){const{data:t}=mt(e?`/api/v1/branches?regionCode=${e}`:null,cn);return t||sn}const cn=async e=>await ut(e,{method:"GET"})||sn,dn=["От 1 000 ₽","До 1 000 000 000 ₽"],mn=["От 1 мес","До 15 лет"],hn=(e,t)=>p(Mt,{title:t,children:[p("div",{className:Rt,children:[u(_t,{label:"Наименование организации",...Pt(e("fullName"),Kt)}),u(_t,{label:"ИНН",...Pt(e("inn"),Yt)}),u(Ht,{label:"Телефон",...Pt(e("phone"),qt)})]}),p("div",{className:Rt,children:[u(_t,{label:"Годовая выручка, ₽",...Pt(e("annualRevenue"),Kt)}),u(_t,{label:"Контактное лицо",...Pt(e("name"),Xt)}),u(_t,{label:"Электронная почта",...Pt(e("mail"),Kt)})]})]}),un=(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}},pn=(e,t,l)=>Math.max(t,Math.min(e,l));function gn(e){const t=(e||"").replace(/\D/g,""),l=parseInt(t,10);return Number.isNaN(l)?0:l}function xn({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,o={backgroundSize:`${(100*(s>t?s-t:0)/(l-t)).toFixed(2)}% 100%`};return p("div",{children:[e.length?u("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>u("div",{className:N("w-2 h-2 rounded-full",s<=t||i?"bg-gray":"bg-primary-main")},String(t))))}):null,u("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:u("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:o,type:"range",min:t,max:l,step:n,value:s,disabled:i,onInput:t=>{const l=gn(t.target?.value),n=e.length?e[l]:l;r&&r(n||0)}})})]})}const fn=1,bn=100,yn=g((e=>{const{className:t,title:l,items:n=[],list:a=[],min:r=(a.length?0:fn),max:s=(a.length?a.length-1:bn),step:o=1,value:c=a[0]||r,disabled:d=!1,onChange:m}=e,h=un(e,{normalize:(e=0)=>a.length?vn(a)(e):pn(e,r,s),format:Je()}),g=i((e=>{m&&m(gn(e.target?.value))}),[m]);return p("div",{className:t,children:[p("label",{className:"block relative",children:[l?u(Ae,{size:"text-m",font:"font-light",color:"text-primary-text",children:l}):null,u("input",{className:N("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:d,onInput:g,...h}),xn({list:a,min:r,max:s,step:o,disabled:d,value:c,onChange:m})]}),Nn(n)]})})),vn=e=>t=>e.reduce(((e,l)=>Math.abs(l-t)<Math.abs(e-t)?l:e)),Nn=e=>u("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>u(Ae,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),wn=(e,t)=>p(Mt,{title:t,children:[u("div",{className:Rt,children:u(yn,{title:"Сумма, ₽",items:dn,min:1e3,max:1e9,...e("amount")})}),u("div",{className:Rt,children:u(yn,{title:"Срок, месяцев",items:mn,min:1,max:180,...e("term")})})]}),kn={amount:1e3,term:12,fullName:"",inn:"",name:"",phone:"",mail:"",annualRevenue:""},Cn=kt({fullName:Kt,annualRevenue:Kt,inn:Yt,name:Xt,phone:qt,region:Kt,department:Kt}),Sn=g((({button:e,link:t,onSubmit:l})=>{const n=i((e=>{const{amount:t,term:n,fullName:a,inn:i,name:r,phone:s,mail:o,region:c,department:d,annualRevenue:m}=e;Ct(Cn(e))&&l({typeForm:"cred",fullName:a,inn:i,name:r,phone:wt(s),mail:o,region:c?.text||"",department:d?.text||"",partnerComments:`Сумма=${t}/Срок=${n}/Выручка=${m}`})}),[l]),[a,{field:r,...s}]=Nt(kn,n),o=on(a.region?.key).filter((e=>e?.address));return p("form",{className:Tt,onSubmit:s.onSubmit,children:[wn(r,"Параметры"),hn(r,"Данные организации"),p(Mt,{title:"Офис банка",children:[u("div",{className:Rt,children:u(ul,{field:r})}),u("div",{className:Rt,children:u(hl,{label:"Адрес",placeholder:"Выберите адрес",options:o.map((({branchCode:e="",address:t=""})=>({key:e,text:t}))),...Pt(r("department"),Kt)})})]}),Nl(e),u(It,{link:t})]})})),In={name:"",phone:""},Tn=kt({name:Xt,phone:qt}),Bn=g((({button:e,link:t,onSubmit:l})=>{const n=i((e=>{const{name:t,phone:n}=e;Ct(Tn(e))&&l({typeForm:"dpst",name:t,phone:wt(n)})}),[l]),[,{field:a,...r}]=Nt(In,n);return u("form",{className:Tt,onSubmit:r.onSubmit,children:u(Mt,{title:"Оставьте заявку и мы ответим на любые вопросы по депозитам",children:p("div",{className:Bt,children:[u(_t,{label:"Имя",...Pt(a("name"),Xt)}),u(Ht,{label:"Телефон",...Pt(a("phone"),qt)}),Nl(e),u(It,{link:t})]})})})})),Pn=[{text:"Задать вопрос по продуктам и услугам",key:"FEEDBACK"},{text:"Качество обслуживания",key:"FEEDBACK_QS"}],Mn=[{key:"phone",text:"Телефонный звонок"},{key:"mail",text:"Электронное сообщение"}],Rn=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],An={typeForm:Kt,region:Kt,surname:Kt,name:Xt,feedbackMethod:Kt,phone:qt,email:Kt,comment:Kt,consentDataProcessing:Jt},zn={...Yl,typeForm:{key:"FEEDBACK",text:"Задать вопрос по продуктам и услугам"},serviceDirection:{key:"Физическое лицо"},birthday:void 0,feedbackMethod:{key:"Телефонный звонок"},phone:"",email:"",comment:"",consentDataProcessing:!1},Dn=g((({button:e,link:t,onSubmit:l})=>{const n=i((e=>{Vn(e.typeForm.key,e.serviceDirection?.key)?((e,t)=>{const l=kt({...An,addressBranch:Kt,inn:Yt}),n={typeForm:e.typeForm.key,region:e.region?.text,addressBranch:e.addressBranch?.text||"",surname:e.surname,name:e.name,middleName:e.middleName,inn:e.inn,fullName:e.fullName,feedbackMethod:e.feedbackMethod.text,phone:wt(e.phone),secondaryPhoneNumber:e?.secondaryPhone,mail:e.email,bankEmpolee:e.bankEmpolee,applicationDate:e.applicationDate,comment:e.comment,consentDataProcessing:e.consentDataProcessing};Ct(l(e))&&t(n,!1)})(e,l):"FEEDBACK"===e.typeForm.key?((e,t)=>{const l=kt({...An,birthday:Kt}),n={typeForm:e.typeForm.key,regionBranch:e.region?.text,surname:e.surname,name:e.name,middleName:e.middleName,birthday:e.birthday,feedbackMethod:e.feedbackMethod.text,phoneNumber:wt(e.phone),email:e.email,comment:e.comment,consentDataProcessing:e.consentDataProcessing};Ct(l(e))&&t(n,!0)})(e,l):((e,t)=>{const l=kt({...An,addressBranch:Kt}),n={typeForm:e.typeForm.key,regionBranch:e?.region?.text,addressBranch:e.addressBranch?.text||"",surname:e.surname,name:e.name,middleName:e.middleName,feedbackMethod:e.feedbackMethod.text,phoneNumber:wt(e.phone),secondaryPhoneNumber:e.secondaryPhone?.replace(/[^+\d]/g,""),email:e.email,bankEmpolee:e.bankEmpolee,applicationDate:e.applicationDate,comment:e.comment,consentDataProcessing:e.consentDataProcessing};Ct(l(e))&&t(n,!0)})(e,l)}),[l]),[a,{field:r,...s}]=Nt(zn,n),o="FEEDBACK_QS"===r("typeForm").value?.key,c=Vn(r("typeForm").value?.key,r("serviceDirection").value?.key),d=on(a?.region?.key).filter((e=>e?.address));return u("form",{className:Tt,onSubmit:s.onSubmit,children:u(Mt,{children:p("div",{className:Bt,children:[u(hl,{label:"Тема*",placeholder:"Выберите тему",options:Pn,...Pt(r("typeForm"),Kt)}),o?u(hl,{label:"Направление обслуживания*",placeholder:"Выберите направление",options:Rn,...Pt(r("serviceDirection"),Kt)}):null,u(ul,{field:r}),o?u(hl,{label:"Адрес*",placeholder:"Выберите адрес",options:d.map((({branchCode:e="",address:t=""})=>({key:e,text:t}))),...Pt(r("addressBranch"),Kt)}):null,ql(r,!0),c?p("div",{children:[u(_t,{label:"ИНН*",...Pt(r("inn"),Yt)}),u(_t,{label:"Наименование организации",...r("fullName")})]}):null,u(hl,{label:"Способ получения ответа*",options:Mn,...Pt(r("feedbackMethod"),Kt)}),u(Ht,{label:"Телефон*",...Pt(r("phone"),qt)}),o?p("div",{children:[u(Ht,{label:"Дополнительный телефон",...r("secondaryPhone")}),u(_t,{label:"Электронная почта*",...Pt(r("email"),Kt)}),u(_t,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...r("bankEmpolee")}),u(_t,{label:"Дата и время обращения в Банк",...r("applicationDate")})]}):u(_t,{label:"Электронная почта*",...Pt(r("email"),Kt)}),u(_t,{...Pt(r("comment"),Kt),placeholder:"Ваше сообщение*",isTextarea:!0}),Rl(r("consentDataProcessing"),t,e)]})})})})),Vn=(e="",t="")=>"FEEDBACK_QS"===e&&"Юридическое лицо / ИП"===t,_n=g((e=>{const{button:t,sourceBookDir:l}=e,{regions:a}=ft(l||"regions-grant-support"),[i,r]=n({key:""}),s=re({className:"text-white",version:t?.version}),o=a?.find((e=>e.name===i.key))?.href;return p("div",{className:"container space-y-s",children:[a?u(hl,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:a.map((({name:e=""})=>({key:e,text:e}))),value:i,onChange:r}):null,o?u("div",{className:"text-center",children:u(pe,{href:o,target:"_blank",className:N("p-m w-full @xl:w-auto",s),children:t?.text?t.text:"Перейти"})}):null]})})),Fn={...Yl,phone:"",email:"",birthday:void 0,consentDataProcessing:!1},jn=kt({surname:Xt,name:Xt,phone:qt,email:Kt,birthday:Kt}),Ln=g((e=>{const{button:t,link:l,product:n,onSubmit:a}=e,r=i((e=>{const{surname:t,name:l,middleName:i,phone:r,email:s,birthday:o,consentDataProcessing:c}=e;Ct(jn(e))&&a({typeForm:"dpst",surname:t,name:l,middleName:i,email:s,consentDataProcessing:c,phoneNumber:wt(r),birthday:o?.toISOString().slice(0,10)||"",product:n||""},!0)}),[a]),[,{field:s,...o}]=Nt(Fn,r);return p("form",{className:Tt,onSubmit:o.onSubmit,children:[p(Mt,{children:[p("div",{className:Rt,children:[u(_t,{label:"Фамилия",...Pt(s("surname"),Xt)}),u(_t,{label:"Отчество (Обязательно, при наличии)",...s("middleName")}),u(Ht,{label:"Телефон",...Pt(s("phone"),qt)})]}),p("div",{className:Rt,children:[u(_t,{label:"Имя",...Pt(s("name"),Xt)}),u(Xl,{label:"Дата рождения*",...Pt(s("birthday"),Kt)}),u(_t,{label:"Электронная почта",...Pt(s("email"),Kt)})]})]}),Rl(s("consentDataProcessing"),l,t)]})})),En={...Yl,typeForm:{key:"SELFCOLLECTION",text:"Самоинкассация"},fullName:"",phone:""},On=kt({typeForm:Kt,region:Kt,fullName:Kt,phone:qt}),$n=g((({button:e,link:t,onSubmit:l})=>{const n=i((e=>{const{typeForm:t,region:n,fullName:a,phone:i}=e,r={typeForm:t.key,region:n?.text,name:a,phone:wt(i)};Ct(On(e))&&l(r,!0)}),[l]),[,{field:a,...r}]=Nt(En,n);return u("form",{className:Tt,onSubmit:r.onSubmit,children:u(Mt,{children:p("div",{className:Bt,children:[u(_t,{label:"ФИО*",...Pt(a("fullName"),Kt)}),u(ul,{field:a}),u(Ht,{label:"Телефон*",...Pt(a("phone"),qt)}),Nl(e),u(It,{link:t})]})})})}));const Un=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],Hn={typeForm:Un[0],...Yl,email:"",phone:"",comment:"",consentDataProcessing:!1},Wn=kt({typeForm:Kt,surname:Kt,name:Xt,phone:qt,email:Kt,addressBranch:Kt,consentDataProcessing:Jt}),Kn=g((({button:e,link:t,onSubmit:l,defaultType:n="PREMIUMSERVICE"})=>{const a=i((e=>{const{surname:t,name:n,middleName:a,email:i,comment:r,consentDataProcessing:s}=e,o={typeForm:e.typeForm.key,surname:t,name:n,middleName:a,phoneNumber:wt(e.phone),email:i,addressBranch:e.addressBranch?.key,comment:r,consentDataProcessing:s};console.log(o),Ct(Wn(e))&&l(o,!0)}),[l]),[r,{field:s,...o}]=Nt({...Hn,typeForm:Xn(n)},a),c=function(){const{data:e}=mt("/api/v1/premiumBranchesByRegions",pt);return e||[]}(),d=c.map((({region:e})=>({key:e,text:e}))),m=r?.region?.key,h=c.find((e=>e?.region===m))?.branches;return p("form",{className:Tt,onSubmit:o.onSubmit,children:[p(Mt,{title:"Ваши данные",children:[p("div",{className:Rt,children:[u(_t,{label:"Фамилия*",...Pt(s("surname"),Xt)}),u(_t,{label:"Отчество (Обязательно, при наличии)",...s("middleName")}),u(_t,{label:"Электронная почта*",...Pt(s("email"),Kt)})]}),p("div",{className:Rt,children:[u(_t,{label:"Имя*",...Pt(s("name"),Xt)}),u(Ht,{label:"Телефон*",...Pt(s("phone"),qt)}),u(hl,{label:"Тип обслуживания*",options:Un,...Pt(s("typeForm"),Kt)})]})]}),p(Mt,{title:"Офис банка",children:[u("div",{className:Rt,children:u(hl,{label:"Регион*",placeholder:"Выберите регион",options:d,...Pt(s("region"),Kt)})}),u("div",{className:Rt,children:u(hl,{className:"w-full",label:"Адрес*",placeholder:"Выберите отделение",options:(h||[]).map((({address:e=""})=>({key:e,text:e}))),...Pt(s("addressBranch"),Kt)})})]}),u(_t,{...s("comment"),placeholder:"Комментарий, удобное время и прочее",isTextarea:!0}),Rl(s("consentDataProcessing"),t,e)]})})),Xn=e=>Un.find((t=>t.key===e)),Yn=g((({name:e,text:t,value:l,checked:n,onChange:a,className:i})=>u("div",{className:i,children:p("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[u("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)}),t?u(Ae,{color:"text-primary-text",children:t}):null]})}))),qn=e=>{const{value:t,onChange:l}=e("vedTypes");return u(Mt,{children:p("div",{className:"gap-xl grid @xl:flex @xl:items-center",children:[u(Yn,{name:"vedTypes",text:"Валютный контроль",value:"currencyControl",checked:"currencyControl"===t,onChange:e=>l&&l(e)}),u(Yn,{name:"vedTypes",text:"Документарные операции",value:"documentOperations",checked:"documentOperations"===t,onChange:e=>l&&l(e)}),u(Yn,{name:"vedTypes",text:"Конверсионные операции",value:"conversionTransactions",checked:"conversionTransactions"===t,onChange:e=>l&&l(e)}),u(Yn,{name:"vedTypes",text:"Иные вопросы ВЭД",value:"otherIssues",checked:"otherIssues"===t,onChange:e=>l&&l(e)})]})})},Gn=({textField:e,text:t,placeholder:l="",error:n})=>p("div",{children:[p("label",{className:"space-y-xs",htmlFor:"textarea",children:[t?u("div",{children:u(Ae,{size:"text-m",font:"font-light",children:t})}):null,u("textarea",{id:"textarea",placeholder:l,className:N("block w-full resize-y min-h-24 p-m outline-none border rounded-md border-gray","hover:border-primary-hover active:focus:border-primary-text focus:border-primary-text"),value:e.value,onInput:t=>e.onChange&&e.onChange(t.target?.value||"")})]}),Vt(n)]}),Jn=({field:e,regions:t})=>{const l="currencyControl"===e("vedTypes").value;return p("div",{className:"space-y-s",children:[l?u(hl,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:t.map((({code:e="",name:t=""})=>({key:e,text:t}))),...Pt(e("region"),Kt)}):null,p("div",{className:"grid @xl:grid-cols-2 @xl:gap-x-lg gap-s",children:[l?u(_t,{label:"ИНН",...Pt(e("inn"),Yt)}):null,u(_t,{label:"Наименование организации",...Pt(e("fullName"),Kt)}),u(_t,{label:"ФИО",...Pt(e("name"),Xt)}),u(Ht,{label:"Телефон",...Pt(e("phone"),qt)}),l?null:u(_t,{label:"Электронная почта",...Pt(e("mail"),Kt)})]})]})},Qn={fullName:"",name:"",phone:"",inn:"",vedTypes:"currencyControl",text:""},Zn={fullName:Kt,name:Xt,phone:qt},ea=kt({...Zn,mail:Kt}),ta=kt({...Zn,inn:Yt,region:Kt}),la=e=>"currencyControl"===e,na=e=>({currencyControl:"currencyControl"===e,documentOperations:"documentOperations"===e,conversionTransactions:"conversionTransactions"===e,otherIssues:"otherIssues"===e}),aa={ApplicationFormBusinessCard:ln,ApplicationFormWed:g((e=>{const{button:t,link:l,onSubmit:n}=e,a=i((e=>{const{fullName:t,name:l,phone:a,mail:i,inn:r,region:s,vedTypes:o,text:c}=e,d={typeForm:"KVED",fullName:t,name:l,phone:wt(a),text:c,vedTypes:na(o),PartnerComments:c,...la(o)?{inn:r,region:s?.text||""}:{mail:i}};Ct((e=>la(e)?ta:ea)(o)(e))&&n(d)}),[n]),[,{field:r,...s}]=Nt(Qn,a),o=el(),c=r("text");return p("form",{className:"container space-y-lg",onSubmit:s.onSubmit,children:[qn(r),u(S,{headingType:"h6",title:"Данные организации",className:"@xl:text-center"}),Jn({field:r,regions:o}),Gn({textField:c,text:"Обращение",placeholder:"Укажите интересующий вас вопрос, место ведения бизнеса и удобное время для телефонного звонка"}),Nl(t),u(It,{link:l}),u(S,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),p("div",{className:"flex gap-xl",children:[p("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:[u(ee,{image:{icon:"PhoneIcon"},width:"24",height:"24"}),u("span",{children:"8 (800) 200-78-70"})]}),p("a",{className:"flex gap-s items-center text-primary-text no-underline","aria-label":"ved@rshb.ru",href:"mailto:ved@rshb.ru",children:[u(ee,{image:{icon:"MailIcon"},width:"24",height:"24"}),u("span",{children:"ved@rshb.ru"})]})]})]})})),ApplicationFormDeposit:Bn,ApplicationFormCredit:Sn,ApplicationFormAcquiring:Cl,ApplicationFormGrantSupport:_n,ApplicationFormIndividuals:Ln,ApplicationFormFeedback:Dn,ApplicationFormAntiFraud:Ql,ApplicationFormCorruption:rn,ApplicationFormSelfCollection:$n,ApplicationFormUltraPremium:Kn},ia=g((({responseType:e})=>{const t="OK"===e;return p("div",{className:`flex items-center p-lg rounded-md space-x-m ${t?"bg-ok":"bg-fail"}`,children:[u(ee,{image:{icon:(t?"ResponseOKIcon":"ResponseFailIcon")?"ResponseOKIcon":"ResponseFailIcon",iconVersion:"normal"},width:"42",height:"42"}),p("div",{children:[u(S,{headingType:"h6",title:t?"Ваша заявка отправлена":"Не удалось отправить заявку",className:"mb-2xs"}),u(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t?"Совсем скоро мы с вами свяжемся":"Пожалуйста, повторите позднее"})]})]})})),ra={send:async function(e,t=!1){const l=t?"/api/v1/lead":"/api/v1/sendcorporatelead";try{const t=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(e)});return t?.ok?await t.json():null}catch(e){return null}}},sa=g((e=>{const{className:t,formBlock:l,...a}=e,[r,s]=n(""),o=i((async(e,t=!1)=>{const l=await ra.send(e,t)?"OK":"Fail";return s(l),l}),[]);return u(k,{className:t,defaultPadding:"p-6xl",...a,children:p("div",{className:"container max-w-[978px] space-y-lg",children:[l?.title?u(S,{headingType:"h3",title:l.title,className:"@xl:text-center"}):null,l?oa(l,o):null,r?u(ia,{responseType:r}):null]})})})),oa=(e,t)=>{const l=e?.formType;if(!l||!(l in aa))return null;return u(aa[l],{...e,onSubmit:t})},ca="text-center",da={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},ma=g((({className:e,defaultIconSize:t=44,iconBgVersion:l="primary",size:n,icon:a,...i})=>{const r=String(n?.width||t);return a?u("div",{style:{width:`${r}px`,height:`${r}px`},className:N("rounded-icon object-fit flex justify-center items-center",da[l],e),children:u(W,{...i,width:"54%",height:"54%",name:a})}):null})),ha=g((({className:e="",title:t,benefitList:l,...n})=>p(k,{className:e,defaultPadding:"p-6xl",...n,children:[t?u(S,{headingType:"h3",as:"h2",className:ca,title:t}):null,l?.length?u("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:l.map(ua)}):null]}))),ua=({label:e,description:t,items:l,icon:n,iconBgVersion:a,isDotted:i=!1},r)=>p("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[n?.icon?u(ma,{className:"shrink-0",defaultIconSize:44,iconBgVersion:a||"",...n}):null,n?.src?u(ee,{className:"shrink-0",image:n}):null,e?p("div",{className:"@sm:h-full space-y-xs",children:[u(S,{headingType:"h6",children:e}),u(Ae,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),u(Ge,{dotClassName:"bg-secondary-text",listItemSize:"S",items:l,isDotted:i})]}):null]},String(r)),pa=e=>({icon:t,title:l,description:n},a)=>p("div",{className:N("flex flex-col gap-1","items-center",n||l?"":"justify-center"),children:[l?u(Ae,{size:"text-h6",font:"font-normal",align:e,children:l}):null,t?u(ee,{image:t,height:"180",className:"w-auto mx-auto"}):null,n?u(Ae,{size:"text-h6",font:"font-normal",align:e,children:n}):null]},String(a)),ga=(e,t,l)=>u("div",{className:`grid gap-2xs ${xa(t)}`,children:e.map(pa(l))}),xa=e=>{switch(e){case"3":return"grid-cols-3";case"4":return"grid-cols-4";default:return"grid-cols-5"}},fa=g((({bonusBenefits:e,cardTextAlign:t="text-center",className:l="",columnsCount:n="4",subtitle:a,title:i,...r})=>p(k,{className:N("space-y-3xl",l),defaultPadding:"p-6xl",...r,children:[u(B,{defaultPadding:"",title:i,description:a,headlineVersion:"M"}),e?.length?ga(e,n,t):null]}))),ba={start:"justify-start",center:"justify-center",end:"justify-end"},ya=g((({buttons:e,className:t="",align:l,...n})=>{const a=l?N("flex",ba[l]):"";return u(k,{className:N("!bg-transparent",a,t),defaultPadding:"p-0",...n,children:He(e)})})),va=(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}]},Na=g((({className:e,disabled:t,...l})=>u(pe,{rounded:!0,className:N("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:u(ee,{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"})}))),wa=g((e=>u(Na,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),ka=g((e=>u(Na,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"})));function Ca({dec:e,inc:t,canDec:l,canInc:n,btnClass:a,className:i=""}){return l||n?p("div",{children:[l?u(Na,{className:N("absolute z-40",a[0],i),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!l}):null,n?u(Na,{className:N("absolute z-40 rotate-180",a[1],i),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!n}):null]}):null}const Sa=g((({className:e,title:t,value:l,fractionDigits:n,fixed:a,prefix:i,postfix:r})=>p("div",{className:N("flex justify-between @xl:flex-col",e),children:[t?u(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t}):null,u("div",l?{children:u(Ae,{size:"text-h3",children:[i,Je(n,{fixed:a})(l),r].filter(Boolean).join(" ")})}:{children:u(Ae,{size:"text-h3",children:"-"})})]}))),Ia=1e4,Ta=5e6,Ba=Math.round(29.5),Pa={minSum:Ia,maxSum:Ta,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Ma={minSum:Ia,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},Ra={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Aa={minSum:5e4,maxSum:5e6,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0},za={minSum:1e3,maxSum:5e5,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Da=e=>e?u(I,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e}):null,Va=g((({rate:e=0,title:t="Ставка",unit:l,fractionDigits:n=2,depositeName:a,isShowDepositeName:i})=>p("div",{children:[u(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t}),p("div",{className:"relative",children:[p("div",{className:"flex justify-start gradient-color-text",children:[u("span",{className:"font-mohave text-title-huge pr-xl -mt-m tracking-[-15px]",children:Je(n,{fixed:!0})(e)}),l?u("span",{className:"text-7xl",children:l}):null]}),a&&i?u("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:a}):null]})]}))),_a=g((({title:e="Ставка",isUnavailableByTerm:t=!1})=>p("div",{className:"space-y-s",children:[u(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),u(W,{className:"w-10 h-10 @5xl:h-auto @5xl:w-40",name:"PercentIcon"}),u("div",{className:"w-64",children:t?p(I,{size:"text-xl",font:"font-light",color:"text-primary-text",children:["Процентная ставка для срока ",u("strong",{children:"1-30 дней"})," устанавливается при обращении в Банк"]}):u(I,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Выберите другую сумму или срок"})})]}))),Fa=({title:e="Ставка",rate:t=0,unit:l="%",fractionDigits:n=2,isUnknownRateShown:a=!0,...i})=>a&&0===t?u(_a,{title:e,...i}):p("div",{children:[u("div",{className:"hidden @xl:block",children:u(Va,{title:e,rate:t,unit:l,fractionDigits:n,...i})}),u("div",{className:"@xl:hidden",children:u(Sa,{title:e,value:t,postfix:l,fractionDigits:n,fixed:!0,...i})})]});function ja({isShowItems:e=!0,step:t=1e3,...l}){const n=[`От ${Je(2)(l.min||0)} ₽`,`До ${Je(2)(l.max||0)} ₽`];return u(yn,{items:e?n:[],step:t,...l})}function La(e){const{data:t}=mt(`/wcms-resources/${e}.json`,pt);return t}const Ea=(e,t)=>{const{travelExpenseValue:l,restExpenseValue:n}=e,a=La(t||"bonus-calculator-data")||Ra,[i,r]=((e,t,l)=>{const{minSumTravel:n,minSumOther:a,maxBonus:i,prefMonthsNum:r,prefTravelBonusRate:s,prefRestBonusRate:o,travelBonusRate:c,restBonusRate:d}=e;if(t===n&&l===a)return[0,0];const m=Math.min(Math.round(s*t)+Math.round(o*l),i);return[m,m*r+Math.min(Math.round(c*t)+Math.round(d*l),i)*(12-r)]})(a,l,n);return{...a,...e,monthBonus:i,yearBonus:r}},Oa=g((({className:e="",sourceBookDir:t,buttons:l,footnote:n})=>{const[a,{field:i}]=Nt({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:r,maxSumTravel:s,minSumOther:o,maxSumOther:c,monthBonus:d,yearBonus:m}=Ea(a,t);return p("section",{className:N("flex flex-col justify-between @5xl:flex-row gap-y-4xl",e),children:[p("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:[ja({title:"Сумма покупок в категории путешествия, ₽",min:r,max:s,step:500,isShowItems:!1,...i("travelExpenseValue")}),ja({title:"Сумма покупок в остальных категориях, ₽",min:o,max:c,step:500,isShowItems:!1,...i("restExpenseValue")})]}),d>=0?Fa({title:"Баллов за месяц",rate:d,fractionDigits:0,isUnknownRateShown:!1,unit:""}):null,p("div",{className:"flex flex-col gap-y-xl @xl:w-96",children:[m>=0?u(Sa,{title:"Баллов за год",value:m}):null,He(l,{isVertical:!0}),Da(n)]})]})})),$a=g((({className:e,inputChildren:t,rateChildren:l,resultChildren:n})=>p("section",{className:N("flex flex-col justify-between @5xl:flex-row gap-m",e),children:[u("div",{className:"flex flex-col gap-y-m sm:max-w-md gap-2xl",children:t}),u("div",{className:"border-b border-main-divider md:hidden"}),l,u("div",{className:"flex flex-col gap-2xl sm:w-96 max-w-full",children:n})]}))),Ua=(e,t=0)=>e?.sum&&e.sum>=Ia&&e.sum<=Ta?e.sum:t,Ha=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,Wa=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,Ka={horizontal:"gap-5xl",vertical:"flex-col gap-s"},Xa=g((({items:e,checkedItem:t,className:l,onChange:n,orientation:a="horizontal"})=>u("div",{className:N(`flex ${Ka[a]}`,l),children:e?.map((({id:e,text:l})=>u(Bl,{isRadio:!0,text:l,value:t===e,onChange:()=>n&&n(e)},String(e))))}))),Ya=({items:e,title:t,mobileTitle:l=t,orientation:n="horizontal",value:a,radioGroupClassName:i,onChange:r})=>p("div",{className:"space-y-s",children:[t?u("div",{className:"hidden @5xl:block",children:u(Ae,{color:"text-secondary-text",font:"font-light",children:t})}):null,l?u("div",{className:"@5xl:hidden",children:u(Ae,{color:"text-secondary-text",font:"font-light",children:l})}):null,u(Xa,{orientation:n,items:e,checkedItem:e[a?0:1].id,className:N("flex-col sm:flex-row",i),onChange:t=>r&&r(t===e[0].id)})]}),qa=e=>Ya({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),Ga=e=>e,Ja=(e=Ga)=>t=>t.reduceRight(((t,l)=>e(t)>e(l)?t:l)),Qa=Ja(),Za=(e=Ga)=>Ja((t=>-e(t))),ei=Za(),ti=([e,t],l,n=[])=>l&&l[e]&&l[t]?{[e]:l[e],[t]:l[t]}:li([e,t],n),li=([e,t],l=[])=>({[e]:l.length?ei(l.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:l.length?Qa(l.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),ni=(e,[t,l],n)=>e>=n[t]&&e<=n[l],ai=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,ii=(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)},ri=g((({className:e="",rateParams:t,buttons:l,footnote:n,bottomFootnote:a,isShowDepositeName:i,defaultParams:r})=>{const[s,{field:o}]=Nt({moneyValue:Ua(r,1e5),daysValue:Ha(r,90),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),c=((e,t)=>{const{daysValue:l,moneyValue:n,isPartialWithdrawal:a,isReplenished:i,isMonthlyInterestPayment:r}=e,s=La(t||"business-calculator-data"),o=i||a,c=l<90||l>730;if(l<=30)return{...za,...e,isDisabledOperatingDeposit:c,isUnavailableByTerm:!0};const d=s?.rateRows?.find((e=>r===e.isMonthlyInterestPayment&&ai(o,e)&&ni(n,["minSum","maxSum"],e)&&ni(l,["minDays","maxDays"],e)))||za,{rate:m}=d,h=ii(m,e),u=n+h,p=s?.rateRows||[za];return{...d,...li(["minSum","maxSum"],p),...li(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:c,income:h,finalSum:u}})(s,t?.rateType&&t.sourceBookDir),{income:d,finalSum:m,rate:h,isUnavailableByTerm:g,depositeName:x}=c;return u($a,{className:e,inputChildren:p("div",{children:[ja({title:"Сумма, ₽",min:c.minSum,max:c.maxSum,...o("moneyValue"),value:c.moneyValue}),(f={title:"Срок, дней",min:c.minDays,max:c.maxDays,...o("daysValue"),value:c.daysValue},u(yn,{items:[`От ${Wa(f.min||0)}`,`До ${Wa(f.max||0)}`],step:1,...f})),p("div",{className:"flex flex-col sm:flex-row gap-y-4 gap-x-14",children:[si(c,o),qa({title:"Выплата процентов",orientation:"vertical",...o("isMonthlyInterestPayment"),radioGroupClassName:"sm:flex-col"})]})]}),rateChildren:Fa({rate:h,depositeName:x,isShowDepositeName:i,isUnavailableByTerm:g}),resultChildren:p("div",{children:[oi(m,d),He(l,{isVertical:!0}),Da(n),Da(a)]})});var f})),si=(e,t)=>p("div",{className:"space-y-s",children:[u(Ae,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),p("div",{className:"flex flex-col gap-y-xl sm:gap-y-s",children:[u(Bl,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),u(Bl,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),oi=(e,t)=>p("div",{className:"flex flex-col gap-2xl sm:gap-0 mb-lg",children:[u(Sa,{title:"Доход в конце срока",value:t,postfix:"₽",prefix:"+"}),u(Sa,{title:"Сумма в конце срока",value:e,postfix:"₽"})]}),ci=({min:e=0,max:t=0,availableMonths:l,...n})=>u(yn,{items:[`От ${di(e)}`,`До ${di(t)}`],step:1,...l?.length?{list:l}:{min:e,max:t},...n}),di=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,mi=e=>Ya({...e,radioGroupClassName:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),hi=e=>ui({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&ui({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&ui({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&ui({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),ui=({row:e,userInputParams:t,paramsViewSettings:l,fieldKey:n,viewSettingFieldKey:a})=>!!l&&!l[a]||t[n]===e[n],pi=(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)},gi=(e,t,l)=>{const{moneyValue:n,monthsValue:a}=e,i=La(t||"credit-calculator-data"),s=i?.rateRows||[Pa],o=(({limitRows:e,userInputParams:t,paramsViewSettings:l})=>e?.find((e=>hi({row:e,userInputParams:t,paramsViewSettings:l}))))({limitRows:i?.limitRows||[],userInputParams:e,paramsViewSettings:l}),{minSum:c,maxSum:d}=ti(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:h}=ti(["minMonths","maxMonths"],o,s),u=(({rateRows:e=[],userInputParams:t,paramsViewSettings:l,moneyValue:n,monthsValue:a})=>e?.find((e=>hi({row:e,userInputParams:t,paramsViewSettings:l})&&ni(n,["minSum","maxSum"],e)&&ni(a,["minMonths","maxMonths"],e)))||Pa)({rateRows:s,userInputParams:e,paramsViewSettings:l,moneyValue:n,monthsValue:a}),{rate:p}=u,g=pi(p,e);return r((()=>({...u,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:h,moneyValue:n,monthsValue:a,monthlyPayment:g})),[e,i])},xi=g((({className:e,sourceBookDir:t,buttons:l,footnote:n,paramsViewSettings:a,defaultParams:i})=>{const[r,{field:s}]=Nt({moneyValue:Ua(i,2e5),monthsValue:Ha(i,Ba),isAnnuity:Boolean(i?.isAnnuity),isInsurance:Boolean(i?.isEnableInsurance),isSalaryClient:Boolean(i?.isEnableSalaryClient),isPensionClient:Boolean(i?.isEnablePensionClient),isStateEmployee:Boolean(i?.isEnableStateEmployee)}),o=gi(r,t,a),c=mi({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...s("isAnnuity")});return u($a,{className:e,inputChildren:p("div",{children:[ja({title:"Сумма кредита, ₽",step:500,min:o.minSum,max:o.maxSum,...s("moneyValue"),value:o.moneyValue}),ci({title:"Срок кредита, месяцев",min:o.minMonths,max:o.maxMonths,...s("monthsValue"),value:o.monthsValue}),fi({...o,...a},s),u("div",{className:"sm:hidden",children:c})]}),rateChildren:Fa({rate:o.rate}),resultChildren:p("div",{children:[u(Sa,{title:"Ежемесячный платёж",value:o.monthlyPayment,postfix:"₽"}),u("div",{className:"hidden sm:block mb-lg",children:c}),He(l,{isVertical:!0}),Da(n)]})})})),fi=(e,t)=>p("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?u(Bl,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?u(Bl,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?u(Bl,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?u(Bl,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),bi=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},yi=(e,t,l)=>{const{moneyValue:n,monthsValue:a}=e,i=La(t||"deposit-calculator-data"),r=i?.rateRows?.[0]?wi(i.rateRows[0].minMonths,i.rateRows[0].maxMonths):0,s=!l?.isShowMonthlyInterestPayment,o=!l?.isShowRemoteRegistration,c=i?.rateRows?.find((t=>Ni({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:s})&&Ni({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:o})&&ni(n,["minSum","maxSum"],t)&&ni(a||r,["minMonths","maxMonths"],t)))||Aa,{rate:d}=c,m=vi(d,e),h=n+m,u=i?.rateRows||[Aa];return{...c,...li(["minSum","maxSum"],u),...li(["minMonths","maxMonths"],u),availableMonths:bi(u.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:r,income:m,finalSum:h}},vi=(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)},Ni=({row:e,userInputParams:t,paramKey:l,isExclude:n})=>n||t[l]===e[l],wi=(e,t)=>e+Math.round((t-e)/2),ki=g((({className:e,sourceBookDir:t,buttons:l,footnote:n,paramsViewSettings:i,defaultParams:r})=>{const[s,{field:o}]=Nt({moneyValue:Ua(r,2e4),monthsValue:Ha(r),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(r?.isRemoteRegistration)}),c=yi(s,t,i),{defaultMonth:d,rate:m,income:h,finalSum:g}=c,{onChange:x}=o("monthsValue");return a((()=>{!s.monthsValue&&x&&x(d)}),[d]),u($a,{className:e,inputChildren:p("div",{children:[ja({title:"Сумма, ₽",min:c.minSum,max:c.maxSum,...o("moneyValue"),value:c.moneyValue}),ci({title:"Срок, месяцев",min:c.minMonths,max:c.maxMonths,availableMonths:c.availableMonths,...o("monthsValue"),value:c.monthsValue}),Ci({...c,...i},o)]}),rateChildren:Fa({rate:m}),resultChildren:p("div",{children:[u(Sa,{title:"Доход в конце срока",value:h,postfix:"₽",prefix:"+"}),u(Sa,{title:"Сумма в конце срока",value:g,postfix:"₽"}),He(l,{isVertical:!0}),Da(n)]})})})),Ci=(e,t)=>{return p("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowMonthlyInterestPayment?qa({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment}):null,e.isShowRemoteRegistration?(l={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration},Ya({...l,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]});var l},Si=e=>Ii({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Ii({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Ii=({row:e,userInputParams:t,paramsViewSettings:l,fieldKey:n,viewSettingFieldKey:a})=>!!l&&!l[a]||t[n]===e[n],Ti=(e,t,l)=>{const{moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:s}=e,o=La(t||"refinancing-calculator-data"),c=o?.rateRows||[Ma],d=(({limitRows:e,userInputParams:t,paramsViewSettings:l})=>e?.find((e=>Si({row:e,userInputParams:t,paramsViewSettings:l}))))({limitRows:o?.limitRows||[],userInputParams:e,paramsViewSettings:l}),{minSum:m,maxSum:h}=ti(["minSum","maxSum"],d,c),{minMonths:u,maxMonths:p}=ti(["minMonths","maxMonths"],d,c),g=(({rateRows:e=[],userInputParams:t,paramsViewSettings:l,moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r})=>e?.find((e=>Si({row:e,userInputParams:t,paramsViewSettings:l})&&ni(n+r,["minSum","maxSum"],e)&&ni(i,["minSumOld","maxSumOld"],e)&&ni(r,["minSumExtra","maxSumExtra"],e)&&ni(a,["minMonths","maxMonths"],e)))||Ma)({rateRows:c,userInputParams:e,paramsViewSettings:l,moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:s}),{rate:x}=g,f=pi(x,e),b=e.oldMonthlyPayment-f;return r((()=>({...g,...e,minSum:m,maxSum:h,minMonths:u,maxMonths:p,moneyValue:n,monthsValue:a,oldMonthlyPayment:i,moneyExtra:s,monthlyPayment:f,benefit:b})),[e,o])},Bi=g((({className:e,sourceBookDir:t,buttons:l,footnote:n,paramsViewSettings:a})=>{const[i,{field:r}]=Nt({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),s=Ti(i,t,a),o=mi({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...r("isAnnuity")});return u($a,{className:e,inputChildren:p("div",{children:[ja({title:"Остаток долга в других банках, ₽ ",step:500,min:s.minSum,max:s.maxSum-s.maxSumExtra,...r("moneyValue"),value:s.moneyValue}),ja({title:"Ежемесячный платёж в других банках, ₽",step:500,min:s.minSumOld,max:s.maxSumOld,...r("oldMonthlyPayment"),value:s.oldMonthlyPayment}),ci({title:"Новый срок кредита, месяцев",min:s.minMonths,max:s.maxMonths,...r("monthsValue"),value:s.monthsValue}),Pi({...s,...a},r),s.isExtraMoney?ja({title:"Дополнительная сумма, ₽ ",step:500,min:s.minSumExtra,max:s.maxSumExtra,...r("moneyExtra"),value:s.moneyExtra}):null,u("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:o})]}),rateChildren:Fa({rate:s.rate,fractionDigits:1}),resultChildren:p("div",{children:[u(Sa,{title:"Ежемесячный платёж",value:s.monthlyPayment,postfix:"₽"}),s.benefit>0?u(Sa,{title:"Выгода в месяц",value:s.benefit,postfix:"₽"}):null,u("div",{className:"hidden sm:block mb-lg",children:o}),He(l,{isVertical:!0}),Da(n)]})})})),Pi=(e,t)=>p("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?u(Bl,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?u(Bl,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,u(Bl,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),Mi={CreditCalculatorForm:xi,DepositCalculatorForm:ki,BusinessDepositCalculatorForm:ri,BonusCalculatorForm:Oa,RefinancingCalculatorForm:Bi},Ri=(e,t)=>{const l=e?.calcType;if(!l||!(l in Mi))return null;const n=Mi[l];return u("section",{className:"box-border relative bg-white flex shrink-0 self-start basis-full",role:"listitem",children:p("div",{className:"box-border p-4xl w-full space-y-xl",children:[e?.title?u(S,{className:"text-center",title:e.title}):null,u(n,{...e})]})},String(t))},Ai=g((({className:e="",tabAlign:t,calculatorTabs:l=[],...a})=>{const r=l.map((e=>e.nav||{})),s=l.map((({calculatorBlock:e})=>e||{})),[o,c]=n(0),d=i((e=>c(e)),[]),[m,h]=va({itemCount:l?.length,visibleItemCount:3});return p(k,{className:N("box-border overflow-hidden relative",e),defaultPadding:"p-0",...a,children:[p("div",{className:"bg-white",children:[r.length>1?zi({activeIndex:m,tabsNav:r,tabAlign:t,slideIndexShift:o,onClick:d}):null,Ca({...h,btnClass:["left-3","right-3"],className:"top-10"})]}),u("div",{className:"flex",style:{transform:`translateX(-${o}00%)`},role:"list",children:s?.length?s.map(Ri):null})]})}));function zi({activeIndex:e,tabsNav:t,tabAlign:l,slideIndexShift:n,onClick:a}){return p("div",{children:[u("div",{style:{transform:`translateX(-${388*e}px)`},className:"flex flex-col justify-end items-center h-32 pt-4xl box-border duration-1000",children:u("div",{className:N("w-full flex flex-nowrap items-end gap-xs",l?ba[l]:""),children:t.map(((e,t)=>function({tab:e,i:t,isActive:l,onClick:n}){const a=l?"w-96 p-m border-none bg-primary-main text-white":"w-96 p-s ease-in duration-300 bg-white text-primary-text",i=l?"text-xl mb-xs":"text-l mb-2xs",r=l?"text-l font-light text-white":"text-m font-light text-secondary-text",s=l?"":"text-primary-main",o=e?.icon?.iconVersion,c=l?"white":"normal";return p("button",{type:"button",onClick:n,"aria-label":e?.title,className:N("box-border relative border border-gray cursor-pointer text-left border-b-0 flex space-x-m min-h-20",a),children:[u(ee,{className:N("h-6 w-6 min-w-6 min-h-6",s),image:{...e?.icon,iconVersion:o??c},width:"24",height:"24"}),p("div",{className:"border-0",children:[u("div",{className:i,children:e?.title}),u("div",{className:r,children:e.description})]})]},String(t))}({tab:e,i:t,isActive:Boolean(t===n),onClick:()=>a(t)})))})}),u("div",{className:"w-full h-2 bg-primary-main"})]})}const Di=g((e=>{const{onChange:t,min:l,max:n,defaultValue:a="0",fractionDigits:r=0,...s}=e,o=un(e,{normalize:(e=a)=>l&&n?String(pn(Number(Vi(e)),l,n)):Vi(e),format:Je(r)}),c=i((e=>t&&t(Vi(e))),[t]);return u(At,{onChange:c,...s,...o})})),Vi=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),_i=g((e=>u(Di,{...e,fractionDigits:2,children:u("div",{className:"absolute right-4 bottom-4",children:u(Ae,{size:"text-xl",font:"font-light",children:"₽"})})}))),Fi={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},ji={amount:1500},Li=g((({className:e="",title:t="Укажите сумму перевода",label:l="Сумма перевода",placeholder:i="1500",button:r,formType:s="private",...o})=>{const[{amount:c},{field:d}]=Nt(ji),[m,h]=n(!1);return a((()=>{h(c<=0)}),[c]),p(k,{className:N("flex flex-col items-center",e),defaultPadding:"p-6xl",...o,children:[t?u(S,{className:"pb-lg xl:pb-4xl self-start xl:self-center",headingType:"h3",title:t}):null,p("form",{className:"w-full xl:max-w-[468px]",method:"POST",action:Fi[s],children:[u(_i,{valid:!m,placeholder:i,label:l,...d("amount",{parse:Number,format:String})}),u("input",{type:"hidden",name:"amount",value:c}),r?.text?u(vl,{className:"w-full mt-lg",type:"submit",disabled:m,children:r.text}):null]})]})})),Ei=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function Oi(e,{sensitivity:t,rootRef:l}={}){const n=s(null),i=r((()=>({threshold:$i(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}function $i(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 Ui=g((({className:e,style:t,idx:l,activeIndex:n,observerOptions:a,children:r,onIntersection:s})=>{const o=Oi(i((e=>{e.length&&s&&s(l||0,e[e.length-1])}),[s,l]),a);return u("div",{className:N("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(l===n),ref:o,children:r})})),Hi=["min-w-full","@lg:min-w-[50%]","@lg:min-w-[33.3%]","@lg:min-w-[25%]"],Wi=g((({className:e,itemClassName:t,containerRef:l,activeIndex:n,visibleItemCount:a=0,gap:r=0,padding:o=0,listType:c="horizontal-list",snapAlign:d="snap-center",minHeight:m,children:h,onVisibleItemsChange:p,onVisibleIndicesChange:g})=>{const x={sensitivity:1,rootRef:l},f=s([]),b=i(((e,t)=>{const l=[...f.current||[]];l[e]=t,f.current=l,p&&p(l),g&&g(Xi(l))}),[p,g]),y=a>0?r*Number(a)-1:0,v="vertical-list"===c,w="horizontal-list"===c,k={...w?Ki(o,y):{},...v?Ei(m):{},gap:`${r}px`};return u("div",{className:N("box-border overflow-auto no-scrollbar",c,e),style:k,ref:l,children:(C=(e,l)=>u(Ui,{className:N(d,a?Hi[a-1]:"",v?"h-full":"",t),style:w?Ki(o/4):{},activeIndex:n,idx:l,observerOptions:x,onIntersection:b,children:e},String(l)),e=>null==e?e:Array.isArray(e)?e.map(C):C(e,0))(h)});var C})),Ki=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Xi=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Yi={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},qi={"horizontal-list":"w-6","vertical-list":"h-6"},Gi=g((({className:e="",containerRef:t,activeIndex:l,dotCount:n=0,listType:a="horizontal-list",version:i})=>n?u("div",{className:N("flex gap-xs",Yi[a],i?"group":"",e),"data-ver":i,children:Array.from({length:n}).fill(null).map(((e,n)=>u("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?qi[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)),Ji=e=>t=>e.scrollWidth/t,Qi=e=>(t,l)=>{e.scrollBy({left:l*Ji(e)(t),behavior:"smooth"})},Zi=({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?[Za()(a),Ja()(a)]:[-1,-1],m=c>0,h=d<e-1,u=i((()=>{var t;l.current&&(m?Qi(l.current)(e,-1):(t=l.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=i((()=>{l.current&&(h?Qi(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}]},er="absolute top-[calc(50%-24px)] z-40",tr="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",lr=g((({scroll:e,activeIndex:t,itemCount:l,arrowsPadded:n,hasEdgeBlocks:a,onScrollLeft:r,onScrollRight:s})=>{const{canScrollLeft:o,canScrollRight:c,scrollLeft:d,scrollRight:m}=e,h=a?t>0:o,g=a?t<l-1:c,x=i((()=>{a?(o&&t!==l-1&&d(),r()):d()}),[d,r,a,o,t,l]),f=i((()=>{a?(c&&0!==t&&m(),s()):m()}),[m,s,a,o,t,l]);return p("div",{className:"hidden @lg:block",children:[nr(e),h?u(wa,{className:N(er,n?"left-1 @lg:left-8":"left-0"),onClick:x}):null,g?u(ka,{className:N(er,n?"right-1 @lg:right-8":"right-0"),onClick:f}):null]})})),nr=e=>p("div",{children:[e.canScrollLeft?u("div",{className:N(tr,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?u("div",{className:N(tr,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),ar=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",ir=({className:e,text:t="ХИТ"}={})=>p("div",{className:N("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[u(W,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),u(I,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),rr="relative h-full",sr={small:"sm:min-w-64",normal:"sm:min-w-96",big:"sm:min-w-[515px]"},or=({noCardBorder:e,activeIndex:t,cardSize:l="normal",...n})=>{const{blocks:a}=n.block||{},i=a?.some(mr);return D({...n,renderProps:(n,a,r)=>p("div",{className:cr(n,{someCardsHighlighted:i}),children:[R(n,a,{className:dr(n,{someCardsHighlighted:i,showBorder:!e,cardSize:l}),blockIndex:r,isActive:r===t}),mr(n)?ir({className:"absolute top-0 -right-4 z-40"}):null]},String(r))})},cr=(e,{someCardsHighlighted:t})=>N(rr,t&&(mr(e)?"pt-3xl":"pt-3xl sm:pt-16")),dr=(e,{someCardsHighlighted:t,showBorder:l,cardSize:n="normal"})=>N(rr,"min-w-80",sr[n],t&&(mr(e)?"pt-3xl sm:pt-16":"pt-3xl"),ar(l),l&&"h-full"),mr=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,hr=g((({className:e,itemCount:t,visibleItemCount:l=1,noCardBorder:n,isAlignCenter:a,arrowsPadded:i=!0,isGap:r=!0,cardSize:s="normal",...o})=>{const{blocks:c=[]}=o.block||{},d=t||c?.length,[m,{inc:h,dec:g}]=va({itemCount:d,visibleItemCount:l},Math.floor(l/2)),[x,f]=Zi({itemCount:d}),[b]=f.visibleIndicesRange,y=c&&"CarouselBankHistoryCard"===c[0]?.type;return p(k,{className:e,defaultPadding:"p-6xl",...o,children:[p("div",{className:N(a?"flex justify-center":"","relative max-w-full"),children:[u(Wi,{containerRef:x,visibleItemCount:l,snapAlign:"snap-start",gap:r?16:void 0,onVisibleIndicesChange:f.handleVisibleIndicesChange,children:or({noCardBorder:n,activeIndex:m,cardSize:s,...o})}),u(lr,{scroll:f,arrowsPadded:i,onScrollLeft:g,onScrollRight:h,hasEdgeBlocks:y,activeIndex:m,itemCount:d})]}),u(Gi,{className:"@5xl:hidden",containerRef:x,activeIndex:b,dotCount:d,listType:"horizontal-list"})]})}));hr.childrenTypes=["CarouselCard","CarouselBankHistoryCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],hr.childSchema=()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}});const ur=g((({className:e,title:t,description:l,blockIndex:n=0,isActive:a,...i})=>u(k,{className:N("relative flex h-[485px]",a?"w-[440px] z-10":"w-[340px]",e),defaultPadding:"p-0",...i,children:u("div",{className:N("basis-full self-center",pr(n)),children:a?u(B,{headlineVersion:"M",title:t,description:l,padding:"p-3xl",align:"text-left",className:"h-96 text-white shadow-dark-blue"}):u("div",{className:"h-[300px] flex justify-center items-center font-mohave text-title-large",children:u("span",{className:gr(n),children:t})})})}))),pr=e=>["bg-primary-main","bg-green-light","bg-yellow-light"][e%3],gr=e=>["gradient-color-text-on-green","gradient-color-text-on-yellow","gradient-color-text-on-yellow"][e%3],xr="z-10 border border-solid w-full h-full",fr=N(xr,"absolute hidden @xl:block border-transparent"),br=g((({className:e,title:t,description:l,button:n,...a})=>u(k,{className:N("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...a,children:p("div",{className:"relative h-full",children:[u("div",{className:N(fr,"top-9 right-12 bg-green-dark")}),u("div",{className:N(fr,"top-6 right-8 bg-green")}),u("div",{className:N(fr,"top-3 right-4 bg-green-light")}),p("div",{className:N(xr,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[u(B,{title:t,description:l,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),He([n],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),yr={black:"bg-black",white:"bg-white"},vr=g((({className:e="",title:t,description:l,image:n,price:a,button:i,colors:r=[],align:s="text-left",padding:o,...c})=>u(k,{className:N("flex flex-col justify-left",e),defaultPadding:"p-2xl",...c,children:p(ye,{className:"h-full",padding:o,title:u(B,{title:t,description:l,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:n?.src?u(ee,{className:"flex justify-center align-center mb-xl",image:n}):null,buttons:He([i],{buttonClassName:"w-full self-end"}),children:[r?.length?p("div",{className:"flex text-secondary-text mb-m",children:[u("div",{className:"mr-xs",children:u(Ae,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(Nr)]}):null,a?p(Ae,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),Nr=(e,t)=>u("div",{role:"figure",className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${yr[e]}`},String(t)),wr="hidden xl:block absolute w-full h-full border border-white",kr=g((({className:e="",...t})=>{const l=ce(),{text:n,href:a,target:i,onClick:r}=l(t);return n?u("div",{className:N("flex relative group/link pl-s pb-s min-w-64 xl:min-w-72",e),children:p("div",{className:"relative min-h-16 w-full",children:[p("a",{className:N("absolute border\n bg-white flex justify-between group-hover/link:text-primary-main","rounded-md lg:rounded-none w-full p-lg whitespace-nowrap z-10"),role:"link",href:a,target:i,onClick:r,children:[u(Ae,{size:"text-l",font:"font-light",color:"text-primary-text",children:n}),u(ee,{className:"group-hover/link:brightness-100 hidden xl:block ml-2xs",image:{icon:"ArrowRightIcon",iconVersion:"black"},imageClassName:"group-hover/link:text-primary-main hidden xl:block",width:"24",height:"24"})]}),u("div",{className:N(wr,"-bottom-1.5 -left-1.5")}),u("div",{className:N(wr,"-bottom-3 -left-3")})]})}):null})),Cr=g((({className:e,additionalDescription:t,description:l,links:n,title:a,...i})=>u(k,{className:N("overflow-hidden",e),...i,children:p("div",{className:"flex flex-col @6xl:flex-row gap-m",children:[p("div",{children:[u(B,{isEmbedded:!0,title:a,description:l,as:"h1",align:"text-left"}),u(B,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),n?.length?Sr(n,"@6xl:min-w-[672px] p-0 justify-self-end"):null]})}))),Sr=(e,t="")=>{const l=Math.ceil(e.length/10);return u(hr,{className:t,version:"secondary",itemCount:l,arrowsPadded:!1,padding:"p-0",children:Array.from({length:l}).fill(null).map(((t,l)=>u("div",{className:N("flex flex-wrap gap-2xs self-start xl:justify-center @5xl:grid @5xl:grid-cols-2"),children:e.slice(10*l,10*(l+1)).map(((e,t)=>u(kr,{...e},String(t))))},String(l))))})},Ir=g((({className:e="",href:t,target:l,isRemote:n=!1,children:a})=>{const i=ce({isRemote:n})({href:t,target:l});return u(t?"a":"div",{className:N("block",e),...t?i:{},children:a})})),Tr=[{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"}}],Br=g((({className:e="",media:t,showButtonText:l,stretched:a,version:i="white",children:r})=>{const[s,o]=n(),c=t?.map((e=>{const{href:t,icon:n,text:a}=e,{iconMapped:r}=(e=>Tr.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),c=Ue(n)?n:r,d=l?{text:a}:{text:""};return!s&&a&&o(!0),{...e,...d,icon:{...c,iconVersion:"color"},version:e?.version??i}})),d=N("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 p("div",{className:N("flex flex-col gap-xs",e),children:[u("div",{className:"flex gap-xs",children:He(c,{className:N(a||s?"basis-full":""),buttonClassName:d})}),r?u(Ae,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),Pr=g((({className:e,padding:t,description:l,additionalDescription:n,href:a,icon:i,items:r=[],isDotted:s,socialMedia:o=[],target:c,title:d,align:m="text-left",benefits:h,imageOptions:{directionRight:g=!0,isImageAlwaysOnRight:x=true,isImageSecondary:f=!1}={},...b})=>u(k,{className:N("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...b,children:u(Ir,{href:a,target:c,className:"h-full",children:p(ye,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:u(B,{title:d,description:l,headlineVersion:"XS",isEmbedded:!0,align:m}),...at(Ue(i)?u(ee,{image:i}):null,g),buttons:o.length?u(Br,{media:o,showButtonText:!0,version:b?.version}):null,isImageAlwaysOnRight:x,isImageSecondary:f,imageAlign:"center",children:[u($e,{benefits:h}),u(Ge,{items:r,isDotted:s,listItemSize:"S"}),Mr(n,m)]})})}))),Mr=(e,t)=>e?u(I,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,Rr=g((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:l=!1,renderFoldableSection:a,renderFoldButton:r})=>{const[s,o]=n(l),c=i((()=>{o((e=>!e))}),[]),d=a({isUnfolded:s,onToggle:c}),m=r?r({isUnfolded:s,onToggle:c}):null;return p("div",t?{className:e,children:[m,d]}:{className:e,children:[d,m]})}));const Ar=g((({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 u("div",{ref:n,className:`transition-max-h duration-300 overflow-hidden ${n.current||!t?"max-h-0":""} `,children:u("div",{className:e,ref:i,children:l})})})),zr=(e,t)=>{const{title:l,description:n,buttons:a}=e;return p("div",{className:"py-lg border-b border-main-divider",children:[l?u("div",{className:"opacity-80",children:u(Ae,{size:"text-m",color:"text-secondary-text",children:l})}):null,n?u("div",{className:"mt-2xs",children:u(Ae,{size:"text-xl",color:"text-primary-text",children:n})}):null,a?.length?u("div",{className:"text-primary-main",children:He(a)}):null]},String(t))},Dr=g((({className:e="",title:t,align:l="text-center",icon:n,button:a,visibleCellsCount:i=1,cardCells:r=[],...s})=>{const o=r.map(zr),[c,d]=i>0?[o.slice(0,i),o.slice(i)]:[o,[]];return p(k,{className:N("flex flex-col",e),defaultPadding:"p-2xl",...s,children:[Ue(n)?u("div",{className:"self-center",children:u(ee,{image:n})}):null,t?u(S,{className:N("pt-xs",l),headingType:"h5",title:t}):null,a?.text?u(pe,{className:"w-full mt-m mb-lg",...a}):null,d.length?u(Rr,{renderFoldableSection:({isUnfolded:e})=>p("div",{children:[c,u(Ar,{isUnfolded:e,children:d})]}),renderFoldButton:r.length>1?Vr:null}):u("div",{children:c})]})})),Vr=({isUnfolded:e,onToggle:t})=>p("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:t,children:[u("div",{children:e?"Скрыть":"Подробнее о тарифе"}),u(W,{className:"text-primary-text",name:e?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),_r="bg-gradient-to-r from-main-gradient-start to-main-gradient-end",Fr="border-gray border-solid border",jr="border-main-divider border-b",Lr="w-52",Er=g((({icon:e,image:t,title:l,link:n})=>p("div",{className:N("w-80 box-border flex flex-col gap-m items-center rounded-t-md border-b-0 p-2xl",Fr,_r),role:"columnheader",children:[e&&!t?.src&&u(ee,{className:"h-16 w-16 min-w-16 min-h-16",image:e,width:"64",height:"64"}),t?.src&&u(ee,{image:t}),l?u(S,{headingType:"h4",as:"h3",className:"text-center text-white",title:l}):null,n?.text&&u("div",{className:"mt-auto w-full",children:u(pe,{href:n.href,target:n.target||"",className:"w-full text-primary-main bg-white hover:bg-secondary-hover active:bg-secondary-active",children:u("div",{className:"py-s",children:u(I,{size:"text-xs",font:"font-medium",children:n.text})})})})]}))),Or={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},$r=g((({children:e,activeIndex:t,columnWidth:l,version:n="comparison"})=>u("div",{className:"flex flex-1 overflow-hidden",children:u("div",{className:Or[n],style:{transform:`translateX(-${t*l}px)`},children:e})}))),Ur=g((({children:e})=>u("div",{className:"self-start flex flex-col",role:"row",children:u("div",{className:"flex gap-xl",children:e})}))),Hr=g((({colHeaders:e,activeIndex:t})=>p(Ur,{children:[u("div",{className:Lr,role:"columnheader"}),u($r,{activeIndex:t,columnWidth:336,children:e.map(((e,t)=>u(Er,{...e},String(t))))})]}))),Wr=g((({cell:e,isFirstRow:t,isLastRow:l,isFillGradient:n})=>{const a=N("w-80 box-border flex flex-col",Fr,l?"border-t-0 rounded-b-md":"border-y-0",n?_r:""),i=N("mx-2xl h-full",jr,n&&t?"border-t":"",l?"border-b-0":"border-solid");return u("div",{className:a,role:"cell",children:u("div",{className:i,children:e?e.map(((e,t)=>Yr(e,t,n))):null})})})),Kr=(e=!1)=>"text-xl m-0 "+(e?"text-white":""),Xr=(e=!1)=>"text-s opacity-80 "+(e?"text-white":"text-secondary-text"),Yr=({label:e,description:t},l,n)=>p("div",{className:"first:pt-2xl pt-xl last:pb-2xl",children:[e?u("h4",{className:Kr(n),children:e}):null,t?u("div",{className:Xr(n),children:t}):null]},String(l)),qr=(e=!1)=>N("py-2xl",jr,Lr,e?"border-b-0":"border-solid"),Gr=g((({row:{header:e,data:t},activeIndex:l,isColoredFirstColumn:n,isFirstRow:a,isLastRow:i})=>p(Ur,{children:[e?.title?u("div",{className:qr(i),children:u(I,{size:"text-s",children:e.title})}):null,t?.length?u($r,{activeIndex:l,columnWidth:336,children:t.map(((e,t)=>u(Wr,{cell:e,isFirstRow:a,isLastRow:i,isFillGradient:n&&0===t},String(t))))}):null]}))),Jr=g((({rowData:e,isColoredFirstColumn:t,activeIndex:l,controls:n})=>{const{isScrollAvailable:a}=n;return p("div",{className:"relative",children:[e.map(((e,n,{length:a})=>u(Gr,{row:e,isFirstRow:0===n,isLastRow:n+1===a,activeIndex:l,isColoredFirstColumn:t},String(n)))),a?Ca({...n,btnClass:["top-28","top-12"],className:"right-7",isDisabled:!0}):null]})})),Qr=g((({columns:e=[],rowHeaders:t,isShowAllRow:l,visibleRowLength:n,isColoredFirstColumn:a})=>{const i=e?.map((({header:e})=>e||{})),r=e?.map((({data:e})=>e))||[],s=t?.map(((e,t)=>({header:e,data:r.map((e=>e?.[t]||[{}]))}))).slice(0,l?t.length:n),[o,c]=va({itemCount:e.length,visibleItemCount:3}),{isScrollAvailable:d}=c;return p("div",{children:[p("div",{role:"table",children:[i?.length?u(Hr,{colHeaders:i,activeIndex:o}):null,s?.length?u(Jr,{rowData:s,isColoredFirstColumn:a,activeIndex:o,controls:c}):null]}),d?u("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),Zr=g((({className:e="",title:t,rowHeaders:l,columns:a,visibleRowLength:r=0,isColoredFirstColumn:s=!1,...o})=>{const[c,d]=n(!r),m=i((()=>d((e=>!e))),[]);return p(k,{className:N("overflow-hidden relative",e),defaultPadding:"p-6xl",...o,children:[u(S,{headingType:"h2",className:"text-center mb-4xl mx-auto",title:t}),u(Qr,{columns:a,rowHeaders:l,isShowAllRow:c,isColoredFirstColumn:s,visibleRowLength:r}),r?es({isShowAllRow:c,onClick:m}):null]})})),es=({isShowAllRow:e,onClick:t})=>u("div",{className:"pr-6xl",children:p("div",{className:"flex gap-m w-full",children:[u("div",{className:Lr}),u("button",{onClick:t,className:"py-xs flex-1 border-gray border-solid border text-primary-text bg-white hover:border-primary-main hover:text-primary-main",children:u(Ae,{size:"text-xs",font:"font-medium",children:e?"Скрыть":"Показать все параметры"})})]})}),ts=g((({className:e,contacts:t,info:l,version:n="secondary",...a})=>p(k,{className:N("flex",e),defaultPadding:"p-6xl",version:n,...a,children:[l?.length?ls(l):null,t?.length?ls(t):null]}))),ls=e=>u("div",{className:"flex gap-5xl grow basis-0",children:e.map(((e,t)=>ns({column:e,index:t})))}),ns=({column:e,index:t})=>e?u("div",{className:"flex flex-col gap-xl grow basis-0",children:e.map((({title:e="",description:t,additionalDescription:l,button:n},a)=>p("div",{children:[u(B,{title:e,description:t,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),l?u("div",{className:"mt-xs opacity-80",children:u(I,{size:"text-m",font:"font-light",children:l})}):null,n?.href?u(pe,{className:"mt-xl",...n}):null]},String(a))))},`col-${String(t)}`):null,as=e=>e%2!=0,is=g((({textNode:e,iconNode:t,tag:l,onClick:n,justifyContent:a="between",className:i,...r})=>p(l,{tag:l,className:N("flex items-center w-full gap-1","between"===a?"justify-between":"justify-center",i),onClick:n,...r,children:[e?u("div",{children:e}):null,t?u("div",{children:t}):null]}))),rs=g((({className:e="",label:t,icon:l,dataTheme:n="",disabled:a=!1,onClick:i})=>u(is,{tag:"button",onClick:i,disabled:a,"data-theme":n,justifyContent:"center",className:N("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:u(Ae,{size:"text-h4",children:t}),iconNode:l?u(ee,{image:{icon:l,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),ss=({isUnfolded:e,onToggle:t})=>u(rs,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),os=g((({title:e,description:t})=>p("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[u(ee,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),u(B,{title:e,description:t,headlineVersion:"S",isEmbedded:!0,align:ca})]}))),cs=["ArrowDownIcon","ArrowUpIcon"],ds="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs border-box",ms=g((({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 p("div",{children:[u("div",{className:N(t.length?"hidden":"block"),children:a?u(os,{...a}):null}),p("div",{className:N("space-y-2xs",t.length?"":"hidden"),children:[p("div",{className:N(ds),children:[z(r,{...i.options,parent:n}),as(r.length)?u(yt,{className:"col-span-6"}):null]}),u(Rr,{renderFoldableSection:({isUnfolded:e})=>p(Ar,{className:N(ds),isUnfolded:e,children:[z(s,{...i.options,parent:n}),as(s.length)?u(yt,{className:"col-span-6"}):null]}),renderFoldButton:({isUnfolded:t,onToggle:n})=>u(rs,{className:N(l<1?"hidden":""),disabled:!s?.length,label:e,icon:cs[Number(t)],dataTheme:i.options?.page?.colorPalette,onClick:n})})]})]})})),hs=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,us=(e,t)=>Object.entries(e).map((([l,n])=>"number"==typeof n?Array.isArray(t[l])?((e,t)=>l=>hs(t[e])||hs(l[e])||l[e]?.includes(t[e]))(l,e):((e,t)=>l=>hs(t[e])||hs(l[e])||ps(t[e])<=ps(l[e]))(l,e):"object"==typeof n&&"min"in n&&"max"in n?((e,t)=>l=>hs(t[e])||hs(l[e])||ps(t[e]?.min)>=ps(l[e]?.min)&&ps(t[e]?.min)<=ps(l[e]?.max))(l,e):Array.isArray(n)?((e,t)=>l=>hs(t[e])||hs(l[e])||t[e]?.some((t=>l[e]?.includes(t))))(l,e):((e,t)=>l=>hs(t[e])||hs(l[e])||t[e]===l[e])(l,e))).every((e=>e(t))),ps=e=>Number(e||0),gs=(e,t)=>(l=vt)=>e&&e.filter((e=>us(t,l(e.content||{})))),xs=g((({value:e,onChange:t,items:l=[],multiple:n})=>l.map((l=>u(gl,{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))))),fs=({field:e,reset:t,filtrationSchema:l,resetButton:n,children:a})=>p("form",{className:"flex flex-col @4xl:flex-row justify-between bg-white p-4xl gap-s @4xl:gap-0",children:[p("div",{className:"flex flex-col @4xl:flex-row gap-5xl",children:[a,Object.entries(l).map(bs(e))]}),n?u("div",{children:u(vl,{className:"w-full @4xl:w-72 @4xl:ml-s",onClick:t,children:n?.text})}):null]}),bs=e=>([t,l])=>{const n=l?.type;return"array"===n?ys(t,e)(l):null},ys=(e,t)=>l=>{const n=l?.items?.enum?.map(((e,t)=>({value:e,title:l?.items?.enumNames?.[t]||""})))||[];return p("div",{children:[l?.title?u("div",{className:"mb-m",children:u(Ae,{size:"text-m",font:"font-light",color:"text-secondary-text",children:l.title})}):null,u(xs,{items:n,multiple:!l?.single,...t(e)})]},e)},vs=(e,t)=>{const l=e[t?.sourceBook];return l?l?.rateRows.map((e=>e.minMonths)).filter((e=>void 0!==e)):[]},Ns=(...e)=>{const t=e.map((e=>ut(e)));return Promise.all(t)};function ws(e,...t){return e.map(((e,l)=>[e,...t.map((e=>e[l]))]))}const ks=e=>Boolean(e&&e.content&&"string"==typeof e.content.sourceBook);function Cs(e){const{dirs:t=[],source:l=[]}=r((()=>{const t=(e=>e?.filter(ks).map((({content:{sourceBook:e}})=>e)))(e);return{dirs:t?.map((e=>`/wcms-resources/${e}.json`)),source:t}}),[e]),{data:n=[]}=mt(t,Ns);return{source:Object.fromEntries(ws(l,n).filter((([,e])=>Boolean(e)))),months:(a=n.flatMap((e=>e?.rateRows||[])).filter((e=>"number"==typeof e.minMonths&&e.minMonths===e.maxMonths)).map((e=>e.minMonths)),[...new Set(a)]).sort(((e,t)=>e-t))||[]};var a}const Ss=1e9,Is={sum:{min:1e4,max:Ss},period:3},Ts=g((({className:e,filtrationSchema:t={},resetButton:l,sumInput:n,periodInput:a,...i})=>{const{source:r,months:s}=Cs(i.block?.blocks),[o,{field:c,reset:d}]=Nt(Is),m=gs(i.block?.blocks,o)((e=>({...e,period:vs(r,e||{})||[]}))),h=p("div",{children:[u(_i,{label:n?.title,min:500,max:Ss,...c("sum",{parse:e=>({min:Number(e),max:Ss}),format:({min:e})=>String(e)})}),u(yn,{title:a?.title,items:["От 3 мес","До 5 лет"],list:s,...c("period")})]});return p(k,{className:N("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...i,children:[fs({field:c,reset:d,filtrationSchema:t,resetButton:l,children:h}),u(ms,{blocksToRender:m,...i})]})})),Bs={type:"string",title:"Адрес справочника"};Ts.childrenTypes=["ProductTile"],Ts.childSchema=e=>({...e?.filtrationSchema||{},sourceBook:Bs});const Ps=[{key:"10"},{key:"50"},{key:"100"}],Ms=({itemCount:e,onItemCountChange:t})=>{const l=i((({key:e})=>t(Number(e))),[]);return p("div",{className:"flex items-center gap-s",children:[u("span",{children:"Показать по"}),u(ol,{className:"min-w-20",onChange:l,value:{key:String(e)},options:Ps,iconVersion:"black"})]})},Rs="py-m px-lg rounded-md cursor-pointer hover:bg-green-more-dark hover:text-white",As=(e,t)=>{const{currentPage:l,onPageChange:n,totalPages:a}=e,i=t+1;return i===l?u("div",{"aria-current":"true",className:"py-m px-lg bg-green-light text-white rounded-md",children:i},String(t)):1!==i&&i!==a&&((e,t,l)=>e<t&&e>=t-2||e<=t+2&&e>t||((e,t,l)=>t<=3&&e<=t+3||t>=l-1&&e>=l-4)(e,t,l))(i,l,a)?u("div",{onClick:()=>n(i),className:Rs,"aria-label":`Страница ${i}`,children:i},String(t)):null},zs={width:"24",height:"24"},Ds=({currentPage:e,onPageChange:t,totalPages:l})=>{const n=r((()=>Array.from({length:l}).fill({currentPage:e,onPageChange:t,totalPages:l})),[l,e]),a=i((()=>{e>1&&t(e-1)}),[e]),s=i((()=>{e<l-1&&t(e+1)}),[e,l]),o=i((()=>t(1)),[]),c=i((()=>t(l)),[l]);return p("div",{className:"flex gap-m items-center",children:[u("div",{onClick:a,children:u(W,{name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Vs(1===e),...zs})}),p("div",{className:"flex gap-xs",children:[e>1?u("div",{onClick:o,className:Rs,"aria-label":"Страница 1",children:"1"}):null,e>4?u("div",{className:"py-m px-s",children:"..."}):null,n.map(As),e<l-3?u("div",{className:"py-m px-s",children:"..."}):null,e<l?u("div",{onClick:c,className:Rs,"aria-label":`Страница ${l}}`,children:l}):null]}),u("div",{onClick:s,children:u(W,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Vs(e===l),...zs})})]})},Vs=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",_s=({currentPage:e,onPageChange:t,totalPages:l,itemCount:n,onItemCountChange:a})=>p("div",{className:"mt-3xl flex justify-between items-center select-none",role:"navigation","aria-label":"Пагинация",children:[u(Ds,{currentPage:e,onPageChange:t,totalPages:l}),n&&a?u(Ms,{itemCount:n,onItemCountChange:a}):null]}),Fs=g((({className:e,value:t,autoFocus:l,onChange:n,onFocus:a,placeholder:r="Поиск по сайту"})=>{const s=i((e=>{n&&n(e.target?.value||"")}),[n]);return p("div",{className:N("font-sans relative",e),role:"form",children:[u("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:u(ee,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),u("input",{className:N("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})]})})),js=g((({field:e,onClearFilter:t,filtrationState:l})=>p("div",{className:"grid grid-cols-12 mb-3xl space-x-xl",children:[u(Fs,{className:"col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),u(Wl,{className:"col-span-3",label:"Период от",maxDate:l.endDate,...e("startDate")}),u(Wl,{className:"col-span-3",label:"Период до",minDate:l.startDate,...e("endDate")}),u("div",{className:"col-span-2 mt-auto",children:u(vl,{className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),Ls=({title:e,timestamp:t,publicId:l})=>{const n=ce({basePath:"/"}),{href:a}=n({href:`/api/v1/depository/${l}/file`});return p("div",{className:"grid grid-cols-12 py-lg border-gray border-opacity-50 border-b",children:[u("div",{className:"col-span-2",children:t?u(Ae,{size:"text-m","font-weight":"font-light",children:Al(t)}):null}),u("div",{className:"col-span-10 text-h6 hover:text-primary-active",children:u("a",{href:a,download:!0,"aria-label":"Скачать",children:e})})]},l)},Es="/api/v1/depository",Os={startDate:void 0,endDate:void 0,query:""},$s=g((({className:e,...t})=>{const[l,a]=n(0),[r,s]=n(10),[o,{field:c,reset:d}]=Nt(Os),{totalPages:m=0,items:h=[]}=(({size:e,page:t,query:l,startDate:n,endDate:a})=>{const i=n?Al(n,!0):"",r=a?Al(a,!0):"",s=new URLSearchParams(Es);s.set("page",String(t)),s.set("size",String(e)),s.set("query",l),s.set("timestampStart",i),s.set("timestampEnd",r);const o=`?${s.toString()}`,{data:c}=mt(Es+o,pt);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:l,...o}),g=i((e=>a(e-1)),[]),x=i((e=>{r!==e?(s(e),a(0)):s(e)}),[]);return p(k,{className:N(e,"container p-6xl"),...t,children:[u(js,{filtrationState:o,field:c,onClearFilter:d}),p("div",{className:"flex flex-col",children:[p("div",{className:"grid grid-cols-12 pb-lg border-gray border-opacity-50 border-b",children:[u("div",{className:"col-span-2",children:u(Ae,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),u("span",{className:"col-span-10",children:u(Ae,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),h.length?h.map((e=>u(Ls,{...e},String(e.publicId)))):u(os,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),u(_s,{currentPage:l+1,onPageChange:g,totalPages:m,itemCount:r,onItemCountChange:x})]})]})})),Us=e=>"Image"===e?.contentType&&e?.image?u(ee,{image:e.image}):"Code"===e?.contentType&&e.code?u("div",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:e.code}):null,Hs=g((({className:e="",title:t,description:l,error:n,button:a,...i})=>p(k,{className:N("flex flex-col justify-center items-center",e),defaultPadding:N("p-6xl"),version:"transparent",...i,children:[u("div",{className:"flex justify-center",children:Us(n)}),u(B,{title:t,description:l,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),a?.text?u(pe,{version:a?.version,text:a?.text,...a}):null]}))),Ws="location";function Ks(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])]})(y,"location",Ys()??{name:e}),r=i((e=>{qs(e),l(e)}),[]),{data:s}=mt(Xs()?null:"/api/v1/region",pt);return a((()=>{s&&!Xs()&&l(s)}),[s]),[t??{name:e},r]}const Xs=()=>Boolean(globalThis.localStorage?.getItem(Ws)),Ys=()=>{try{const e=globalThis.localStorage?.getItem(Ws);return e&&JSON.parse(e)}catch(e){return null}},qs=e=>{try{globalThis.localStorage?.setItem(Ws,JSON.stringify(e))}catch(e){}};var Gs;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD"}(Gs||(Gs={}));const Js=new Intl.NumberFormat("ru",{style:"currency",currency:Gs.RUB}),Qs=e=>e?Js.format(e):"",Zs="text-left text-m font-light text-secondary-text",eo=`${Zs} pl-5xl`,to={USD:"DollarIcon",EUR:"EuroIcon"},lo=g((({className:e,exchangeCurrencyItems:t})=>p("table",{className:`h-fit w-fit ${e}`,children:[u("thead",{children:p("tr",{children:[u("th",{className:Zs,children:u(Ae,{size:"text-m",children:"Валюта"})}),u("th",{className:eo,children:u(Ae,{size:"text-m",children:"Купить"})}),u("th",{className:eo,children:u(Ae,{size:"text-m",children:"Продать"})})]})}),u("tbody",{children:t.map(no)})]}))),no=e=>{const t=e?.currency?.currency;return p("tr",{className:"pb-2xs text-h6",children:[u("td",{className:"pt-m",children:p("div",{className:"flex items-center gap-xs",children:[t?u(ee,{image:{icon:to[t]},width:"24",height:"24"}):null,u(Ae,{size:"text-h6",children:t})]})}),u("td",{className:"pt-m pl-5xl",children:u(Ae,{size:"text-h6",children:Qs(e?.saleExchangeRate)})}),u("td",{className:"pt-m pl-5xl",children:u(Ae,{size:"text-h6",children:Qs(e?.buyExchangeRate)})})]},t)},ao={icon:"GpsIcon"},io=g((({className:e="",address:t})=>p("div",{className:`flex gap-s ${e}`,children:[u(ma,{...ao,iconBgVersion:"primary"}),p("div",{className:"space-y-2xs",children:[t?u(I,{size:"text-l",color:"text-primary-main",children:t}):null,u(I,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),ro=(e,t,l)=>{const n=Number(so(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)},so=e=>e.replace(/[^\d.,]/g,"").replace(",","."),oo=e=>{return(t=[[e=>e.value!==Gs.RUB&&e.oppositeValue!==Gs.RUB,()=>e.handleConvert(e.value,Gs.RUB)],[e=>e.value===Gs.RUB&&e.oppositeValue===Gs.RUB,()=>e.handleConvert(e.value,Gs.USD)],[()=>!0,()=>e.handleConvert(e.value)]],e=>{const[,l]=t.find((([t])=>t(e)))||[];return l})(e)?.();var t};function co(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??""}))),o={key:n,text:n};return p("div",{className:"relative flex",children:[u(At,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:a,onChange:i}),s.length?u(ol,{isBorder:!1,onChange:e=>r(e.key),options:s,value:o}):null]})}const mo=g((({className:e="",currencyRatesBuy:t,currencyRatesSell:l,button:a})=>{const[r,s]=n({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||Gs.RUB,selectBuy:l?.[0]?.currency?.currency||Gs.USD}),o=i((e=>s((t=>({...t,...e})))),[]);return p("div",{className:`grid gap-m pt-2xl ${e}`,children:[co({placeholder:"Хочу продать",rates:l,selected:r.selectSell,setSelected:ho(r,o,l),value:r.inputSell,setValue:e=>po(o,l)(e,r.selectSell,r.selectBuy)}),co({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:uo(r,o,t),value:r.inputBuy,setValue:e=>go(o,t)(e,r.selectBuy,r.selectSell)}),a?.text?u(pe,{text:a.text,version:a?.version,...a}):null]})})),ho=(e,t,l)=>n=>{t({selectSell:n}),oo({value:n,oppositeValue:e.selectBuy,handleConvert:(n=e.selectSell,a=e.selectBuy)=>{po(t,l)(e.inputSell,n,a)}})},uo=(e,t,l)=>n=>{t({selectBuy:n}),oo({value:n,oppositeValue:e.selectSell,handleConvert:(n=e.selectBuy,a=e.selectSell)=>go(t,l)(e.inputBuy,n,a)})},po=(e,t)=>(l,n,a)=>{e({inputSell:so(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(ro(l,i,n===Gs.RUB)||"")})},go=(e,t)=>(l,n,a)=>{e({inputBuy:so(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(ro(l,i,n===Gs.RUB)||"")})};const xo=g((({className:e="",title:t="Курсы обмена валют",button:l,...n})=>{const[a]=Ks(),i=function(e){const t=e?.code||"000",{data:l}=mt(`/api/v1/exchangerates?regionCode=${t}`,pt);return l||{}}(a),r=fo(i?.exchangeRate?.currencies),s=r.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:Gs.RUB}});const o=r.filter((e=>e.saleExchangeRate));return o.push({currency:{currency:Gs.RUB}}),u(k,{className:N("box-border min-h-80",e),...n,children:u(ye,{className:"h-full",title:u(S,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:p("div",{className:"flex gap-6xl flex-wrap",children:[p("div",{children:[r?u(lo,{className:"mb-xl",exchangeCurrencyItems:r}):null,u(io,{address:i?.address})]}),r.length&&s.length&&o.length?u(mo,{className:"grow",currencyRatesBuy:s,currencyRatesSell:o,button:l}):null]})})})})),fo=e=>e?.filter((e=>1===e?.currency?.id||2===e?.currency?.id))||[],bo=e=>ft(d.SITEMAP||"sitemap",{fallback:e}),yo={width:"40",height:"45"},vo={"bg-white":"color",transparent:"white"},No={"bg-white":"text-primary-main",transparent:"text-white"},wo=(e,t,l)=>u(ee,t?.src?{image:t,className:No[e],width:l?.width,height:l?.height}:{image:{icon:t?.icon||"LogoIcon",iconVersion:vo[e]},className:No[e],width:l?.width,height:l?.height}),ko={"bg-white":"text-primary-text",transparent:"text-white"},Co=g((({className:e,href:t="/",logo:l,children:n,targetBlank:a,bgColor:i="bg-white",showTitle:r=!0})=>p("a",{className:N("inline-flex items-center font-sans no-underline",e),href:t,target:a?"_blank":"_self","aria-label":l?.title??"Россельхозбанк",children:[wo(i,l?.image,yo),r?n??u("div",{className:"ml-s",children:u(Ae,{font:"font-medium",color:ko[i],size:"",children:l?.title??"Россельхозбанк"})}):null]}))),So=g((({className:e,onClose:t})=>u("button",{className:N("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",children:u(ee,{image:{icon:"CloseIcon"},width:"24",height:"24"})})));function Io(e,t,l=300){a((()=>{const t=globalThis.setTimeout(e,l);return()=>{globalThis.clearTimeout(t)}}),t)}const To=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 Bo=(e,t)=>(l,n)=>{for(const[a,i]of n)l.set(a,e(l.get(a)||t,i));return l},Po=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),Mo=e=>t=>e.map((([e,l])=>[To(t)(e),l])).filter((([e])=>e>=.8)).map((([e,t])=>Ao(t,e))).reduce(Bo(Math.max,0),new Map),Ro=e=>t=>{return ws(t,t.map((({title:e})=>e)).map((e=>t=>{const l=Po(t||"");return l.length?Te(e.map((e=>Qa(l.map(To(e)))))):0})(e))).sort((n=([,e])=>e,l=(e,t)=>n(e)-n(t),(e,t)=>-l(e,t))).map((([e])=>e));var l,n},Ao=(e,t)=>new Map(e.map((e=>[e,t]))),zo=({basePathList:e,initialQuery:t=""})=>{const[l,i]=n(t||"");a((()=>{null!=t&&i(t)}),[t]);const{data:r}=mt(e?.length?e:null,Do),[s,o]=n(null);return Io((()=>{r&&o(r.map((e=>t=>{const{corpus:l,dictionary:n}=t||{};if(!(e&&l?.length&&n&&Object.keys(n).length))return[];const a=Po(e);if(!a.length)return[];const i=Object.entries(n),r=[...a.map(Mo(i)).reduce(Bo(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*a.length)).map((([e])=>l[e]));return Ro(a)(r)})(l)))}),[r,l]),[s,{value:l,onChange:i}]},Do=async(...e)=>(await Promise.allSettled(e.map((e=>ut(j(e,"/","search.index.json")))))).map((e=>"fulfilled"===e.status?e.value:{})),Vo=g((({className:e,head:t,children:l,onClose:n})=>{const{close:a}=se(),r=i((()=>{a(),n&&n()}),[n]);return p("div",{className:N("relative min-h-full bg-white pt-0 p-5",e),children:[p("div",{className:"sticky py-xl top-0 bg-white z-10",children:[u(So,{className:"absolute top-0 right-0",onClose:r}),u("div",{className:"container",children:t})]}),u("div",{className:"container pb-6xl",children:l})]})})),_o=g((({className:e,topItems:t})=>{const l=ce({isRemote:!0});return u("div",{className:N("flex items-start justify-between",e),children:t?.map(l).map(jo)})})),Fo=["all","footer"],jo=(e,t)=>{const{text:l,items:n=[],href:a,target:i,onClick:r}=e,s=n.filter((e=>!e.displayArea||Fo.includes(e.displayArea.toLowerCase())));return p("div",{className:"flex flex-col gap-s w-1/4",children:[u("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)=>u(Lo,{...e,basePath:o(a),index:t},String(t))))]},String(t))},Lo=g((({text:e,index:t,basePath:l,...n})=>{const a=ce({isRemote:!(!d.BASE_PATH||!l)&&!d.BASE_PATH.startsWith(l),basePath:l}),{href:i,target:r,onClick:s}=a(n);return u("a",{className:N("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}`})})),Eo=g((({initialQuery:e})=>{const{topItems:t}=bo(),l=r((()=>t?.map((e=>e.href||"/"))),[t]),[n,i]=zo({basePathList:l,initialQuery:e}),s=r((()=>Oo(t)(n)),[t,n]);return a((()=>function(e){for(const t of e.filter((({items:e})=>e?.length)))console.group(t.text),console.table(t.items,["text","href"]),console.groupEnd()}(s)),[s]),u(Vo,{head:u(Fs,{autoFocus:!0,...i}),children:u(_o,{topItems:s})})})),Oo=e=>t=>e?.length&&t?.length?ws(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:j("/",t)})))}))):[];const $o=()=>{const{open:e,close:t}=se();return{open:(t={},l={})=>e(u(Eo,{...t}),l),close:t}},Uo=g((({className:e})=>{const[t,l]=n(""),a=i((()=>l("")),[]),{open:r}=$o(),s=i((e=>{l(e),Ho(e)&&r({initialQuery:e},{onClose:a})}),[a]);return p("div",{className:N("relative",e),children:[u(Fs,{value:t,onChange:s}),u(So,{className:"absolute top-0 right-0 sm:hidden",onClose:a})]})})),Ho=e=>e&&e.length>=3,Wo=g((({className:e="",items:t})=>p("div",{className:e,children:[t?.length?t.map(Ko):null,u(pe,{version:"primary",className:"w-full",href:"https://old.rshb.ru/feedback/question/",target:"_blank",ariaLabel:"Обратная связь",text:"Обратная связь"})]}))),Ko=(e,t)=>p("div",{className:"mb-m space-y-m",children:[u("div",{children:u(Ae,{size:"text-l",font:"font-medium",children:e?.title})}),u("div",{className:"space-y-m",children:e.items?.map(Xo)})]},String(t)),Xo=(e,t)=>p("div",{className:"space-y-2xs",children:[u("div",{children:Yo(e.type,e.text)}),u(I,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Yo=(e,t="")=>{switch(e){case"tel":return u("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${qo(t)}`,children:u(Ae,{size:"text-h6",children:t})});case"email":return u("a",{className:"no-underline",href:`mailto:${t}`,children:u(I,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return u("span",{children:t})}},qo=e=>e.replaceAll(/\D/g,""),Go=["split_version","New","Old"],Jo=g((({className:e="",index:t,text:l,...n})=>{const a=ce(),{href:i,target:r,onClick:s}=a(n);return u("a",{className:N("text-secondary-text",e),href:i,target:r,onClick:s,children:l||`Документ ${t}`})})),Qo=g((({className:e="",links:t})=>u("div",{className:e,children:t?.length?u("div",{className:"flex justify-between items-center gap-lg py-lg border-solid border-x-0 border-y border-y-main-divider",children:t.map(((e,t)=>u(Jo,{index:t,className:"text-l font-light max-w-[292px]",...e},String(t))))}):null}))),Zo=g((({className:e="",index:t,...l})=>{const n=ce({isRemote:!0}),{href:a,target:i,text:r,onClick:s}=n(l);return u("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}`})})),ec=g((({className:e="",links:t})=>p("div",{className:N("@container",e),children:[u("div",{className:"pt-lg",children:u(Ae,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} АО «Россельхозбанк» Генеральная лицензия Банка России № 3349 от 12.08.2015 г.`})}),t?.length?u("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)=>u(Zo,{index:t,...e},String(t))))}):null]}))),tc="w-52",lc=g((({className:e,...t})=>{const{topItems:l,logo:n}=bo(t.options?.page?.fallback),{documents:a,relatedEnterprises:r,contacts:s,socialMedia:o,mobileApps:c}=ft(d.FOOTER||"footer",{fallback:t.options?.page?.fallback}),m=i((()=>{const[e,t,l]=Go;((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 p(k,{tag:"footer",className:e,...t,children:[p("div",{className:"flex items-stretch gap-3xl pb-3xl ",children:[u(Co,{className:tc,logo:n}),u(Uo,{className:"grow"})]}),p("div",{className:"flex items-stretch gap-6xl",children:[p("div",{className:N(tc,"flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[u(Wo,{items:s}),u(Br,{media:o,children:"Соцсети"}),u(Br,{media:c,showButtonText:!1,children:"Мобильное приложение"}),u(pe,{version:"link",href:"https://old.rshb.ru",className:"!text-left text-s font-light",onClick:m,children:"Вернуться на прежнюю версию сайта"})]}),u(_o,{className:"flex-grow",topItems:l})]}),u(Qo,{className:"mt-xl",links:r}),u(ec,{links:a})]})})),nc=g((({className:e="",title:t,description:l,calendar:n,...a})=>p(k,{className:N("space-y-m",e),defaultPadding:"p-6xl",...a,children:[u(B,{title:t,description:l,headlineVersion:"M",isEmbedded:!0}),n?ac(n):null]}))),ac=e=>{const t=100/(e.reduce(((e,t)=>t?.month?.length?e+t.month.length:e),0)||1),l=e.filter((e=>e?.month?.length)).map((e=>({...e,flexBasis:`${e?.month?.length?e.month.length*t:""}%`})));return p("div",{className:"w-full flex flex-col justify-center gap-s",children:[u("div",{className:"flex w-full text-h6 text-center",children:l.map((e=>ic(e,t)))}),u("div",{className:"flex gap-s w-full",children:l.map(((e,t)=>p("div",{className:"border-r border-main-divider last:border-r-0 space-y-s",style:{flexBasis:e.flexBasis},children:[u("div",{className:"flex gap-s",children:rc(e)}),p("div",{className:"text-s",children:[u(Ae,{size:"text-s",font:"font-light",color:"text-primary-text",children:e.text})," ",u(Ae,{size:"text-s",font:"font-light",color:"text-primary-main",children:e.greenText})]})]},`monthItem-${t}`)))})]})},ic=(e,t)=>e.month?.map(((e,l)=>u("div",{style:{flexBasis:`${t}%`},children:e.text},`monthName-${l}`))),rc=e=>e.month?.map((e=>e.image?.src?u("div",{className:"h-52 border-r pr-s border-main-divider last:border-r-0",children:u(ee,{image:e.image,className:"flex"})},`monthImage-${e.image.src}`):null)),sc=e=>({href:t})=>!!t&&F(oc(t,e)).startsWith(F(t)),oc=(e,t)=>V(e)?t.href:t.pathname;function cc(e=[]){const t=v(),l=e.findIndex((e=>sc(d.BASE_PATH?{pathname:d.BASE_PATH}:e))(t));return[l,e[l]]}const dc=g((({className:e="",active:t,flat:l,children:n,...a})=>{const i=ce({isRemote:!0}),{href:r,target:s,text:o,onClick:c}=i(a);return u("a",{className:N(mc(t,l),e),href:r,target:s,onClick:c,rel:"noopener noreferrer","aria-label":o,children:u("span",{className:hc(t,l),children:o||n})})})),mc=(e=!1,t=!1)=>N("inline-block border border-solid bg-transparent text-center no-underline",e?"rounded-md border-primary-main group-data-transparent:border-white":"border-transparent",t?"":"px-m py-xs"),hc=(e=!1,t=!1)=>N("font-sans text-s font-light",e?"text-primary-main":N(t?"text-primary-text":"text-secondary-text","hover:text-primary-main"),"group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),uc=e=>e?.length?p("div",{className:"sm:border-t sm:border-main-divider mt-2xs pt-2xs",children:[u("div",{className:"mb-m",children:u(Ae,{size:"text-m",font:"font-light",color:"text-secondary-text",children:"Представительства за рубежом:"})}),u("div",{className:"flex flex-col sm:flex-row gap-5xl",children:e.map(((e,t)=>u(pc,{...e},String(t))))})]}):null,pc=g((({icon:e,...t})=>{const l=ce(),{text:n,target:a,href:i,onClick:r}=l(t);return p("div",{className:"flex gap-s items-center",children:[e?u(ee,{pathPrefix:"/wcms-resources/",image:e}):null,n?u("a",{className:"hover:text-primary-hover",href:i,target:a,onClick:r,children:u(Ae,{size:"text-l",font:"font-light",color:"text-primary-text",children:n})}):null]})})),gc=e=>t=>u("div",{className:"mb-xs sm:mb-2xs",children:u("button",{className:"cursor-pointer hover:text-primary-hover",onClick:()=>{e&&e(t)},children:u(Ae,{size:"text-l",font:"font-light",children:t.name||""})})},t.id),xc=g((({className:e,searchTerm:t,onSearch:l})=>p("form",{className:`font-sans relative ${e}`,children:[u("div",{className:"absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none",children:t?null:u("label",{htmlFor:"search-bar-input",className:"text-secondary-text ",children:"Поиск по филиалам"})}),u("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"})]}))),fc=g((()=>{const{defaultLocation:e,foreignOffices:t}=bo(),[l,a]=Ks(e),[r,s]=n(""),o=yc(el()).sort(((e,t)=>e.name.localeCompare(t.name))),c=((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})(o,bc),{close:d}=se(),m=i((e=>{a(e),d()}),[]);return p(Vo,{className:"pb-20",head:p("div",{children:[u(Ae,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),l?p("div",{className:"mb-s",children:[u(Ae,{size:"text-l",font:"font-light",children:"Сейчас выбран: "}),u("button",{onClick:()=>a(l),children:u(Ae,{color:"text-primary-main",children:l.name})})]}):null,u(xc,{onSearch:s,searchTerm:r})]}),children:[r&&r.length>=3?u("div",{children:o.filter((({name:e})=>e&&To(e.toLowerCase())(r.toLowerCase())>=.8)).map(gc(m))}):u("div",{className:"columns-1 sm:columns-5",children:Array.from(c.entries()).map((h=m,([e,t])=>p("div",{className:"break-inside-avoid mb-2xl w-56",children:[u("div",{className:"mb-s",children:u(Ae,{size:"text-h6",children:e})}),t.map(gc(h))]},e)))}),uc(t)]});var h})),bc=e=>e.name?.charAt(0)||"",yc=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()||""}))),vc={default:"w-6 h-6",large:"w-12 h-12"},Nc=g((({className:e,isRounded:t,buttonSize:l="default",isGrayBg:n=!1,disabled:a,ariaLabel:i,image:r,onClick:s})=>u("button",{className:N("group/btn border-0 flex shrink-0 items-center",n?"p-s rounded-full":"p-0 bg-inherit",n&&!t?"bg-main-divider":"",t?"w-8 h-8 text-secondary-light hover:text-secondary-hove":`${vc[l]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:a,"aria-label":i,onClick:s,children:u(ee,{image:r,className:N("h-full",t?"bg-main-divider/20 rounded-full":""),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),wc=g((({className:e,version:t,officesLink:l,defaultLocation:n})=>{const a="transparent"===t?"white":"black",[r]=Ks(n),s=$o(),o=i((()=>s.open()),[]),c=(()=>{const{open:e,close:t}=se();return{open:(t={})=>e(u(fc,{}),t),close:t}})(),d=i((()=>c.open()),[]);return p("div",{className:N("flex items-center gap-lg",e),children:[u(dc,{flat:!0,href:"#",text:r?.name,onClick:d}),l?u(dc,{flat:!0,href:l,text:"Офисы и банкоматы"}):null,u(Nc,{image:{icon:"LoupeIcon",iconVersion:a},ariaLabel:"Поиск",onClick:o})]})})),kc=g((({className:e="",items:t,activeItem:l})=>{const a=ce(),[r,s]=n(!1),o=i((()=>s((e=>!e))),[]),c=al(i((()=>s(!1)),[]));return p("div",{className:N(r?"bg-white rounded-md shadow-blue-gray":"",e),ref:c,children:[u("button",{className:"group/btn flex justify-between items-center h-6","aria-label":""+(r?"Скрыть другие разделы":"Показать другие разделы"),onClick:o,children:Array(3).fill(null).map(((e,t)=>u("div",{className:"w-[3px] h-[3px] rounded mr-2xs bg-primary-text group-hover/btn:bg-primary-hover group-data-transparent:bg-white"},String(t))))}),u("div",{className:N("absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56",r?"":"hidden"),"aria-hidden":!r,children:t?.map(((e,t)=>{const{text:n,...i}=e,{href:r,target:s,onClick:o}=a(i);return u("a",{className:N("text-l font-light pb-m hover:text-primary-main",e===l?"text-primary-main":""),href:r,target:s,onClick:o,children:n},r||String(t))}))})]})})),Cc=e=>globalThis[e];function Sc(e,t){const[l,r]=n(),s=i((()=>r(Cc(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(!Cc(e))return l.addEventListener("load",s),()=>{l.removeEventListener("load",s)};s()}),[e,t]),l}const Ic={personal:"//chat.mes.rshb.ru/assets/js/webchat_rshb",business:""},Tc=g((e=>{const[t,{setTrue:l}]=tl();return t?u(Bc,{...e}):Pc({...e,onClick:l})})),Bc=g((({chat:e="personal",...t})=>((e=>{a((()=>globalThis.localStorage?.setItem("webchat-keep-open",String(Date.now()))),[]),Sc("chatbot",Ic[e])})(e),Pc(t)))),Pc=({className:e,iconVersion:t,onClick:l})=>u(Nc,{className:N("text-page__btn-chat",e),image:{icon:"HeadphonesIcon",iconVersion:t},ariaLabel:"Чат",onClick:l,buttonSize:"large",isGrayBg:!0}),Mc=g((({className:e="",active:t,dataItemName:l,children:n,...a})=>{const i=ce(),{href:r,target:s,text:o,onClick:c}=i(a);return p("a",{className:N("relative inline-block bg-transparent text-center no-underline",e),href:r,target:s,"data-item-name":l,onClick:c,children:[u("span",{className:Rc(t),children:o||n}),t?u("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-transparent"}):null]})})),Rc=(e=!1)=>N("font-sans text-l font-light",e?"text-primary-main":"text-primary-text hover:text-primary-main","group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),Ac=g((({observerOptions:e,onVisibilityChange:t,children:l,className:n,...a})=>{const r=Oi(i((e=>{if(!e.length||!t)return;const l=e[e.length-1];t(l.isIntersecting)}),[t]),e);return u("span",{ref:r,className:n,children:u(Mc,{...a,children:l})})})),zc={default:"px-lg bg-main-divider rounded hover:text-primary-main",transparent:"text-white hover:text-primary-hover"},Dc=g((({version:e,internetBankUrl:t})=>t?u(pe,{href:t,ariaLabel:"Интернет-банк",target:"_blank",className:N("py-s ml-s text-l font-light whitespace-nowrap hover:text-primary-main",zc["transparent"===e?"transparent":"default"]),children:"Интернет-банк"}):null)),Vc=["all","header"],_c=g((({subItems:e=[],version:t,internetBankUrl:l})=>{const a="transparent"===t?"white":"black",i=v(),o=r((()=>e.filter((e=>!e.displayArea||Vc.includes(e.displayArea.toLowerCase())))),[e]),c=(e=>(t=[])=>{const l=t?.filter(sc(e));return l?.length?Ja((e=>e.href?.length||0))(l):void 0})(i)(e),[m,h]=n(o.length),g=o.slice(m),x=s(null),f={rootRef:x},b=r((()=>o.map(((e,t)=>e=>{h(e?Fc(t):jc(t))}))),[o]);return p("nav",{className:"relative mt-s flex items-center justify-between",children:[u("div",{ref:x,className:"overflow-hidden whitespace-nowrap pb-s mt-xs space-x-3xl",children:o.map(((e,t)=>u(Ac,{className:m-1<t?"invisible":"",active:e===c,observerOptions:f,onVisibilityChange:b[t],...e},String(t))))}),g.length?u(kc,{className:"relative w-auto z-40",items:g,activeItem:c}):null,p("div",{className:"flex",children:[d.CHAT_BOT?u(Tc,{className:"ml-4xl",iconVersion:a,chat:d.CHAT_BOT}):null,u(Dc,{version:t,internetBankUrl:l})]})]})})),Fc=e=>t=>Math.max(t,e+1),jc=e=>t=>Math.min(t,e),Lc={"bg-white":"primary",transparent:"transparent"},Ec=g((({className:e,bgColor:t="bg-white",logo:l,version:n=Lc[t],...a})=>{const{topItems:i,logo:r,officesLink:s,defaultLocation:o}=bo(a.options?.page?.fallback),[,c]=cc(i),{internetBankUrl:m}=ft(d.PORTAL_DATA||"portal-data",{fallback:a.options?.page?.fallback,pathDir:j(d.BASE_PATH,"portal-resources")});return u(k,{tag:"header",className:N("pt-3xl px-20",c?.items?.length?"pb-m":"pb-lg",e),defaultPadding:"",version:n,...a,children:p("div",{className:"container",children:[p("div",{className:"flex items-center",children:[u(Co,{className:"mr-3xl",bgColor:t,logo:l??r}),i?.map(((e,t)=>u(dc,{active:e===c,...e},String(t)))),u(wc,{version:n,className:"ml-auto",officesLink:s,defaultLocation:o})]}),u("div",{className:N("mt-xl h-px bg-main-divider","transparent"===n?"opacity-30":"")}),c?.items?.length?u(_c,{subItems:c.items,version:n,internetBankUrl:m}):null]})})})),Oc={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},$c=g((({className:e="",padding:t="p-0",gap:l="XS",version:n="transparent",isTheme:a=!1,isCardBorder:i,...r})=>u(k,{className:N("relative","grid grid-cols-12",Oc[l],e),padding:t,version:n,isTheme:a,...r,children:D({...r,extraProps:{className:ar(i)}})})));$c.childrenTypes={exclude:["HorizontalLayout"]};const Uc=g((e=>{const{className:t,image:l,...n}=e;return u(k,{className:t,defaultPadding:"p-0",...n,children:u(ee,{image:l})})})),Hc=g((({className:e="",cards:t=[],button:l})=>{const[a,r]=n(0),s=i((e=>r(e)),[]),o=t.length,[c,d]=va({itemCount:o,visibleItemCount:2}),{canDec:m,canInc:h}=d,g=t[c]?.href;return p("section",{role:"listitem",className:`min-w-full text-center ${e}`,children:[p("div",{className:"relative overflow-hidden",children:[o?Wc({activeIndex:c,cards:t,selectedCardIndex:a,onClick:s}):null,Ca({...d,btnClass:["left-12","right-12"],className:"top-16"}),m?u("div",{className:"absolute top-0 left-0 h-full w-32 bg-opacity-from-white"}):null,h?u("div",{className:"absolute top-0 right-0 h-full w-32 bg-opacity-to-white"}):null]}),u(pe,{className:"w-60 text-center",version:"primary",...l,href:g})]})}));function Wc({activeIndex:e,cards:t,selectedCardIndex:l,onClick:n}){const a=460*e,i=t.length>2?"justify-start":"justify-center";return u("div",{style:{transform:`translateX(-${a}px)`},className:"duration-1000 px-6xl",children:u("div",{className:`w-full flex flex-nowrap gap-s pb-6xl ${i}`,children:t.map(((e,t)=>function({slide:e,i:t,isActive:l,onClick:n}){return p("button",{type:"button",onClick:n,className:"p-3xl min-w-fit flex items-center gap-2xl bg-white border-solid border relative "+(l?"shadow-dark-blue border-primary-main":"ease-in duration-300 border-gray"),children:[e?.icon?u(ee,{className:"p-lg rounded-full bg-secondary-light",image:e.icon,width:"108",height:"108"}):null,p("div",{className:"flex gap-s",children:[e?.sum?Kc("страховая сумма",e.sum):null,e?.fee?Kc("страховой взнос",e.fee):null]}),Xc(l)]},String(t))}({slide:e,i:t,isActive:Boolean(t===l),onClick:()=>n(t)})))})})}function Kc(e,t){return p("div",{className:"flex flex-col text-left whitespace-pre",children:[p(Ae,{size:"text-h6",children:[Je(2)(t)," ₽"]}),u("div",{className:"mt-2xs",children:u(Ae,{size:"text-l",color:"text-secondary-text",children:e})})]})}function Xc(e){return e?u(ee,{className:"h-6 w-6 min-w-6 min-h-6 absolute right-4 top-4",image:{icon:"DoneIcon"},width:"24",height:"24"}):null}const Yc=g((({className:e="",title:t,insuranceTabs:l=[],button:a,...r})=>{const[s,o]=n(0),c=i((e=>o(e)),[]);return p(k,{className:N("box-border overflow-hidden relative px-0 space-y-2xl",e),defaultPadding:"p-6xl",...r,children:[t?u(S,{className:"text-center",title:t,headingType:"h3"}):null,l?.length>1?u("div",{className:"p-xs bg-secondary-light w-fit mx-auto rounded-md",children:l.map(((e,t)=>function({title:e,i:t,isActive:l,onClick:n}){return u("button",{type:"button",onClick:n,"aria-label":e,className:"box-border px-m py-s text-m font-light "+(l?"bg-primary-main text-white rounded-md":"text-secondary-text"),children:e},String(t))}({title:e?.title,i:t,isActive:Boolean(t===s),onClick:()=>c(t)})))}):null,u("div",{className:"flex",style:{transform:`translateX(-${s}00%)`},role:"list",children:qc({insuranceTabs:l,button:a})})]})})),qc=({insuranceTabs:e,button:t})=>{const l=e?.map((e=>e.cards));return l?.length?l.map(((e,l)=>u(Hc,{button:t,cards:e},String(l)))):null};const Gc=e=>t=>t.reduce(((t,l,n)=>t.length?t.concat({...e,key:`sep-${n}`},l):[l]),[]),Jc={yellow:"bg-yellow",green:"bg-green","green-light":"bg-green-light","green-dark":"bg-green-dark"},Qc={XS:"h-10",S:"h-16",M:"h-24",L:"h-32",XL:"h-52"},Zc=g((e=>{const{className:t="",items:l,isDotted:n,investmentZeroColumn:a,investmentColumns:i,...r}=e,s=i?[...i]:[];return a&&s.unshift(a),u(k,{className:t,defaultPadding:"p-4xl",...r,children:p("div",{className:"container text-m font-light space-y-4xl",children:[s?.length?p("div",{children:[p("div",{className:"flex items-end relative pl-3xl pr-lg text-white",children:[Gc(u("div",{className:"w-px h-4 bg-gray"}))(s.map(ed)),u("div",{className:"absolute right-3xl w-px h-4 bg-gray"})]}),u("div",{className:"border-t border-gray -mt-xs mx-3xl"}),u("div",{className:"flex justify-between text-primary-text mt-s -mx-5xl",children:s.map(nd)})]}):null,l?.length?u(Ge,{className:"max-w-[657px]",items:l,isDotted:n,listItemSize:"M"}):null]})})})),ed=(e,t,l)=>{const n=1===t,a=t===l.length-1;return u("div",{className:`${td(n,a,e.cells)}`,children:e.cells?.length?u("div",{className:"w-full "+(a?"border-4 border-green-more-dark p-2xs min-w-72":""),children:e.cells.reverse().map(ld)}):null},`column_${t}`)},td=(e,t,l=[])=>[l.length?"flex-1":"flex-0",!l.length||e||t?"":"pl-s",l.length&&!t?"pr-s pb-3xl":"pb-xl"].join(" "),ld=(e,t)=>{const l=e.cellSize||"XS",n=e.cellColor||"green";return e.text?u("div",{className:`flex-1 flex items-center justify-center relative py-xs ${Qc[l]} ${Jc[n]} ${"XS"===l?"px-s":"px-5xl"}`,children:u(Ae,{align:"text-center",children:e.text})},`cell_${t}`):null},nd=(e,t)=>e?.title?u("div",{className:"flex-1 max-w-[180px] text-center px-xs last:pr-3xl",children:e.title},`title_${t}`):null,ad=["байт","Кб","Мб","Гб","Тб","Пб"],id=g((({icon:e,text:t,href:l,target:n,fileFormat:a,fileSize:i})=>{const r=i&&a?",":"",s=i??"",o=a?String(a):"";return p("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",role:"link",href:l,target:n,children:[e,t?p(Ae,{size:"text-l",font:"font-light",children:[t," ",rd(s,o),u(Ae,{color:"text-secondary-text",children:l&&`${s+r+o}`})]}):null]})})),rd=(e,t)=>e||t?u("span",{children:", "}):"",sd={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},od=g((({className:e="",title:t,description:l,align:n="text-center",documents:a,icon:i={icon:"DocIcon"},columnsMode:r="double",...s})=>{const o=v();return p(k,{className:N("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[u(B,{title:t,description:l,align:n,headlineVersion:"M",as:"h2",isEmbedded:!0}),a?.length?u("div",{className:N("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",sd[r]),role:"list",children:a.map(cd(o,i))}):null]})})),cd=(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))} ${ad[l]}`})(l?.attachment?.fileSize||0):l?.fileSize,r="Attachment"===l?.docType?dd(a):l?.fileFormat;return u("div",{role:"listitem",children:u(id,{text:l?.text,target:l?.target,href:a,fileFormat:r,fileSize:i,icon:t?u(ee,{className:"min-w-6 min-h-6",image:t,width:"24",height:"24"}):null})},String(n))},dd=e=>{if(!e)return"";const t=e.lastIndexOf(".");return-1!==t?e.substring(t+1):""},md=g((({className:e,padding:t,align:l="text-left",buttons:n=[],description:a,image:i,items:r,qr:s,additionalDescription:o="",title:c="Мобильное приложение",version:d="primary",...m})=>{const h="secondary"===d?"p-m min-w-32":"min-w-24",g=i?.src?u(ee,{className:"hidden lg:block",image:i}):null;return u(k,{className:N("min-h-80",e),padding:"p-0",version:d,...m,children:p(ye,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:u(S,{headingType:"h3",title:c,className:N("whitespace-pre-wrap",l)}),rightImage:g,buttons:He(n,{className:"flex-wrap"}),children:[a?u(Ae,{size:"text-xl","font-weight":"font-light",children:a}):null,p("div",{className:N("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[u(Ge,{items:r,listItemSize:"M"}),u(Ae,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:o}),s?.src?u("div",{className:N("flex justify-center bg-white rounded-md @xl:-order-1",h),children:u(ee,{className:"w-fit",image:s})}):null,i?.src?u(ee,{className:"lg:hidden",image:i}):null]})]})})})),hd={primary:"bg-white/30",secondary:"bg-main-divider"},ud={primary:"text-white",secondary:"text-secondary-text"},pd=g((({count:e,version:t="secondary"})=>u("div",{className:N("w-6 h-6 rounded-full flex items-center justify-center",hd[t]),children:u(Ae,{size:"text-xs",color:ud[t],children:e})}))),gd=(e=[],t={})=>e.filter((({content:e={}})=>us(t,e))).length,xd=(e,t)=>e===t;const fd=(bd=function(...e){return(t,l)=>e.some((e=>e(t,l)))}(xd,((e=xd)=>(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])=>bd(l,t[e])))));var bd;const yd=[],vd={},Nd={default:"px-xs",underlined:"px-m",rounded:"px-lg rounded-md"},wd={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",rounded:"text-white"},kd={default:"bg-white",underlined:"bg-white",rounded:"bg-transparent"},Cd={default:"sm:bg-primary-main",underlined:"bg-white",rounded:"bg-primary-main"},Sd=g((({tag:e="div",item:t={},isActive:l,type:n="default",onClick:a})=>{const i=e,{text:r,appendRight:s,...o}=t;return u(i,{className:N("h-12","block flex-1","cursor-pointer",Nd[n],l?Cd[n]:kd[n]),role:"tab","aria-selected":l,onClick:a,...o,children:p("div",{className:N("h-full","flex justify-center items-center","text-center whitespace-nowrap",l?wd[n]:"text-secondary-text hover:text-primary-main"),children:[u(Ae,{size:"text-m",children:r}),s?u("div",{className:"ml-xs",children:s}):null]})})})),Id=g((e=>u(e?.item?.href?Td:Bd,{...e}))),Td=g((e=>{const t=ce(),l=i((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:n,...a}=t({...e.item,onClick:l});return u(Sd,{...e,tag:"a",item:a,onClick:n})})),Bd=g((({item:e={},onClick:t,...l})=>{const n=i((()=>{t&&t(e)}),[t,e]);return u(Sd,{item:e,onClick:n,...l})})),Pd=(e,t,l)=>(n,a)=>u(Id,{isActive:n===e,onClick:t,type:l,item:n},String(a)),Md=g((({className:e,tabsType:t="default",items:l=[],value:n,onChange:a})=>u("div",{className:N("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tablist",children:l.map(Pd(n,a,t))}))),Rd={categories:[],extraOptions:[],propertyType:[],stage:[]},Ad=g((({className:e,hotFilters:t,filtrationSchema:l={},resetButton:n,...a})=>{const[s,{field:o,reset:c,update:d}]=Nt(Rd),m=gs(a.block?.blocks,s)(),h=i(((e=Rd)=>d(e)),[]),g=(({hotFilters:e=yd,filtrationState:t=vd,blocks:l=yd,onFiltrationStateChange:n})=>{const a=r((()=>Math.max(0,e.findIndex((e=>fd(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,appendRight:u(pd,{version:t===e[a]?"primary":"secondary",count:gd(l,t.filter)})})))),[e,l,a]),o=i((t=>{n(e[s.indexOf(t)].filter)}),[e,s]);return{value:s[a],items:s,onChange:o}})({hotFilters:t,filtrationState:s,blocks:a.block?.blocks,onFiltrationStateChange:h});return p(k,{className:N("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...a,children:[u(Md,{...g}),fs({field:o,reset:c,filtrationSchema:l,resetButton:n}),u(ms,{blocksToRender:m,...a})]})}));function zd(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)}))}Ad.childrenTypes=["ProductTile"],Ad.childSchema=e=>e?.filtrationSchema||{};const Dd={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"},Vd=(e,t,l)=>u("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(Dd).join(" ")} ${l}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.geoObjects.add(t.geoObjects)}))},children:u(W,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),_d={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"},Fd=g((({yandexMaps:e,direction:t="in"})=>{const l="in"===t?"PlusIcon":"MinusIcon";return u("div",{onClick:()=>{const l=e.current.getZoom(),n="in"===t?l+1:l-1;e.current.setZoom(n,{checkZoomRange:!0})},className:`${Object.values(_d).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:u(W,{name:l,width:"20",height:"16"})})})),jd={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"},Ld=[55.753995,37.614069],Ed=g((({points:e,className:t="",zoom:l=5})=>{const i=s(null),r=Sc("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${d.YANDEX_MAP_API_KEY||""}&lang=ru_RU`),[o,c]=n();if(a((()=>{i?.current?r&&(zd(r,i.current,e),e?.length||i.current.setCenter(Ld)):r?.ready((()=>{i.current||(i.current=new r.Map("map",{center:e?Od(e):Ld,zoom:l,controls:[],suppressMapOpenBlock:!0}),zd(r,i.current,e))}))}),[r,i,e,l]),!r)return null;const m=o?"z-[100000]":"z-10";return p("div",{id:"map",className:N(!o&&"relative","w-full",t),children:[u("div",{className:N(Object.values(jd),m,"right-2 top-4 bg-white"),onClick:()=>{const e=i.current.container;o?e.exitFullscreen():e.enterFullscreen(),c(e.isFullscreen())},children:u(W,{name:"FullScreenIcon",width:"16",height:"16"})}),p("div",{className:N("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",m),children:[u(Fd,{yandexMaps:i}),u(Fd,{yandexMaps:i,direction:"out"})]}),Vd(i.current,r,N("right-2 top-80",m))]})})),Od=e=>[Ud($d(e,0)),Ud($d(e,1))],$d=(e,t)=>e.map((e=>e[t])),Ud=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Hd={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных"},Wd=(e,{field:t,reset:l})=>p("div",{className:"pb-2xl",children:[e?.length?u("div",{className:"flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",children:e.map((e=>u(Bl,{text:Hd[e],...t(e)},e)))}):null,u(pe,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:l,text:"Очистить фильтр",appendRight:u(W,{name:"CloseIcon",width:"16",height:"16"})})]}),Kd=()=>null,Xd=()=>[],Yd=g((({className:e,data:t=[],renderCard:l=Kd,filterItems:n=Xd,initFilterState:a={},descriptionData:i,title:s})=>{const[o,{field:c,reset:d}]=Nt(a),[m,h,g]=r((()=>{const e=n(t,o),l=e.map((e=>[e.gpsLatitude,e.gpsLongitude].filter(Boolean))).filter((e=>e&&2===e.length));return[e,l,e.length]}),[t,o]);return p("div",{className:N("space-y-1",e),children:[p("div",{className:"bg-white",children:[p("div",{className:"pt-6xl px-6xl",children:[p("div",{className:"flex gap-xs pb-2xl",children:[u(S,{headingType:"h2",children:s}),g?u(Ae,{size:"text-h2",color:"text-secondary-text",children:`(${g})`}):null]}),i?qd(i):null,Wd(Object.keys(a),{field:c,reset:d})]}),u("div",{className:"h-[600px]",children:u(b,{children:u(Ed,{points:h,className:"h-full"})})})]}),m.map(l)]})})),qd=({__html:e,list:t})=>e||t?.length?p("div",{className:"p-xl mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?u(Me,{__html:e}):null,t?.length?u("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pt-xs",children:t.map(((e,t)=>p("div",{className:"flex gap-xs items-center",children:[e?.image?u(ee,{image:e.image}):null,e?.text?u(Ae,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,Gd={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"}},Jd=g((({className:e,children:t,color:l="gray"})=>u("div",{className:N("p-s sm:border sm:border-gray rounded-md flex items-center",Gd[l].border,e),children:u(Ae,{size:"text-m",color:Gd[l].text,children:t})}))),Qd=g((({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:Zd({textItems:a,subText:t,children:l,...n})})),Zd=({label:e,labelSize:t="text-m",textItems:l,subColor:n,subText:a,className:i,children:r})=>p("div",{className:N("flex gap-2xs flex-col h-full max-w-[300px]",i),children:[e?u(Ae,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||l.filter(Boolean).map(((e,t)=>u(Ae,{size:"text-l",children:e.trim()},String(t)))),a?u(Ae,{color:n,size:"text-m",children:a}):null]}),em=g((({className:e,children:t})=>u("div",{className:N("sm:flex sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),tm=["ArrowDownIcon","ArrowUpIcon"],lm=["Подробнее","Скрыть"],nm=({isUnfolded:e,onToggle:t})=>p("button",{className:"w-full py-2xl cursor-pointer text-primary-main flex items-center border-b border-solid border-main-divider",onClick:t,children:[u("div",{className:"pr-m",children:lm[Number(e)]}),u(W,{className:"text-primary-text",name:tm[Number(e)],width:"16",height:"16"})]}),am=({location:e,address:t,billAcceptorType:l,terminalType:n,billAcceptorEnable:a,atmCode:i="",atmAccess:r="",workTime:s},o)=>{const c=[{label:"Устройство",value:rm(n)},{label:"Модуль приема наличных",value:a?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===l?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:i}];return p("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[p("div",{className:"sm:flex sm:justify-between",children:[p("div",{children:[u(Ae,{size:"text-h4",children:rm(e)}),t?p("div",{className:"flex pb-xl pt-xs gap-2xs",children:[u(W,{name:"GeolocationIcon",width:"24",height:"24"}),u(Ae,{size:"text-l",children:t})]}):null]}),u(Jd,{color:"green",children:rm(s)})]}),u("div",{className:"hidden sm:block",children:u(em,{className:"flex-wrap",children:c?.map(im)})}),u(Rr,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>u(Ar,{isUnfolded:e,children:u(em,{className:"flex-wrap",children:c?.map(im)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>nm({isUnfolded:e,onToggle:t})})]},String(o))},im=(e,t)=>u(Qd,{...e},String(t)),rm=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",sm=[];const om=async e=>await ut(e,{method:"GET"})||sm,cm={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1},dm={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable)},mm=g((({data:e,className:t})=>{const[l]=Ks(),n=function(e){const{data:t=sm}=mt(`/api/v1/atms?regionCode=${e}`,om);return t}(l?.code??"000");return u(Yd,{className:t,filterItems:hm,data:n,initFilterState:cm,renderCard:am,title:`Банкоматы филиала ${l?.name}`,descriptionData:e})})),hm=(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=>dm[t](e))),l=!n.length||n.some((t=>dm[t](e)));return t&&l}))},um=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=[pm({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:l?"":n}),pm({workTime:l?.workTime,lunchHour:l?.lunchHour,daysOff:n},!0)].filter(Boolean);return u(Qd,{label:"Режим работы",value:a,className:"max-w-none"})},pm=({workTime:e="",lunchHour:t="",daysOff:l=""},n=!1)=>e?[`${n?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",l?`не работает: ${l}`:""].filter(Boolean).join("; "):"",gm=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],xm=e=>gm.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??"")}}))),fm=e=>{if(!e)return null;const t=bm(e);return p(em,{className:"border-none",children:[u(Qd,{label:"Для юридических лиц",labelSize:"text-l",children:u("div",{className:"flex gap-1",children:t.map(ym)})}),u(Qd,{label:"Режим работы",className:"max-w-none",children:u(Ae,{children:e})})]})},bm=e=>{const t=gm.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},ym=({short:e,status:t},l)=>u("div",{className:N("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:u(Ae,{size:"text-xs",children:e})},String(l)),vm=({currency:e,buyExchangeRate:t,saleExchangeRate:l},n)=>p("div",{className:"flex gap-lg h-full",children:[e?.currency?u(Qd,{label:"Валюта",value:e.currency}):null,t?u(Qd,{label:"Купить",value:String(t)}):null,l?u(Qd,{label:"Продать",value:String(l)}):null]},String(n)),Nm=(new Date).getDay(),wm=e=>{const[t]=e?.slice(Nm-1)??[];if(!t)return null;const{lunchHour:l,status:n,workTime:a,hasLunch:i}=t;return n?p("div",{className:"flex gap-s items-start whitespace-nowrap",children:[a?u(Jd,{color:"green",children:a}):null,l&&i?u(Jd,{color:"yellow",children:`перерыв: ${l}`}):null]}):u(Jd,{color:"red",children:"Выходной"})},km=({lunchHour:e,hasLunch:t=!1,status:l=!1})=>l?e&&t?`Перерыв ${e}`:e:"Не работает",Cm=({title:e,status:t,workTime:l,lunchHour:n,hasLunch:a},i)=>u(Qd,{label:e,value:t&&l?l:"",subText:km({lunchHour:n,hasLunch:a,status:t}),subColor:!t||a?"text-error":"text-green-dark"},String(i)),Sm=({name:e,address:t,phone:l,fax:n,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:o,exchangeRate:c},d)=>{if(!o)return null;const m=xm(o);return p("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[p("div",{className:"sm:flex sm:justify-between",children:[p("div",{children:[u(Ae,{size:"text-h4",children:e}),t?p("div",{className:"flex pb-xl pt-xs gap-2xs",children:[u(W,{name:"GeolocationIcon",width:"24",height:"24"}),u(Ae,{size:"text-l",children:t})]}):null]}),wm(m)]}),u("div",{className:"hidden sm:block",children:Im({phone:l,fax:n,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:o,exchangeRate:c})}),u(Rr,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>u(Ar,{isUnfolded:e,children:Im({phone:l,fax:n,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:o,exchangeRate:c})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>nm({isUnfolded:e,onToggle:t})})]},String(d))},Im=({phone:e,fax:t,phoneBusiness:l,phoneNatural:n,phoneCallCentre:a,phoneCurrencyControl:i,workSchedule:r,exchangeRate:s})=>{const o=xm(r),c=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return p("div",{children:[p(em,{className:"flex-wrap",children:[u(Qd,{label:"Факс",value:t}),u(Qd,{label:"Телефон филиала",value:e}),u(Qd,{label:"Для обращений юридических лиц",value:l}),u(Qd,{label:"Обслуживание физических лиц",value:n}),u(Qd,{label:"Для консультаций по валютному контролю",value:i}),u(Qd,{label:"Контакт-центр",value:a})]}),r?.isMatchesPattern?u(em,{children:u(Qd,{label:c,labelSize:"text-l",className:"w-full max-w-none",children:u("div",{className:"flex flex-wrap gap-xs sm:justify-between pt-xs",children:o?.map(Cm)})})}):p(em,{children:[u(Qd,{label:c,labelSize:"text-l",children:u("div",{className:"flex gap-1",children:o?.map(ym)})}),um(o)]}),r?.businessScheduleVisibleTag?fm(r?.businessScheduleDescription):null,s?.currencies?.length?u(em,{className:"flex-wrap",children:s?.currencies?.map(vm)}):null]})},Tm=[];const Bm=async e=>await ut(e,{method:"GET"})||Tm,Pm={workingSaturday:!1},Mm={workingSaturday:e=>Boolean(e.workSchedule?.workingSaturday)},Rm=g((({className:e})=>{const[t]=Ks(),l=function(e){const{data:t=Tm}=mt(`/api/v1/branches?regionCode=${e}`,Bm);return t}(t?.code??"000");return u(Yd,{className:e,filterItems:Am,data:l,initFilterState:Pm,renderCard:Sm,title:`Офисы филиала ${t?.name}`})})),Am=(e,t)=>{const l=Object.keys(t).filter((e=>t[e]));return e.filter((e=>l.every((t=>Mm[t](e)))))},zm=g((({data:e,className:t,...l})=>{const n=e?.dataType??"offices";return u(k,{version:"transparent",className:N(t),defaultPadding:"p-0",...l,children:"offices"===n?u(Rm,{}):u(mm,{data:e})})})),Dm=g((({className:e,size:t})=>u("figure",{className:N("m-0 mt-xl min-w-[80%]",e),children:Vm(t)}))),Vm=(e=3)=>Fm(100,e).map((e=>Math.floor(e))).map(_m),_m=(e,t)=>u("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-light"},String(t)),Fm=(e,t)=>[e].concat(t>0?Fm(e/1.618,t-1):[]),jm=g((({className:e,title:t,description:l="Блок в разработке...",...n})=>p(k,{className:N("box-border",e),...n,children:[u(B,{className:"max-w-[600px]",title:t,description:l,headlineVersion:"L",align:"text-left",isEmbedded:!0}),u(Dm,{})]}))),Lm=g((({className:e="",padding:t,slides:l=[],...a})=>{const[i,r]=n(0);return p(k,{className:N("box-border overflow-hidden",e),defaultPadding:"py-6xl",padding:t,...a,children:[u("div",{className:"flex duration-1000",style:{transform:`translateX(-${100*i}%)`},role:"list",children:l.map((({productBlock:e},t)=>u("div",{className:"box-border grow-0 shrink-0 basis-full",role:"listitem",children:u(nt,{className:"pl-6xl h-full",headlineVersion:"M",isFullWidthTitle:!1,...e,...a})},String(t))))}),u("div",{className:"h-28 px-xs mt-m -mb-m flex gap-xs box-border",children:l.map(Em({activeSlideIndex:i,onClick:r}))})]})})),Em=({activeSlideIndex:e,onClick:t})=>({nav:l},n)=>{const a=n===e,i=a?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:py-xl backdrop-blur",r=a?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=a?"text-secondary-text text-l font-light":"text-secondary-text text-m font-light group-data-secondary:text-white/80";return p("button",{type:"button",onClick:()=>t(n),"aria-label":l?.title,className:N("relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50",i),children:[u("div",{className:r,children:l?.title}),u("div",{className:s,children:l?.description})]},String(n))},Om=g((({address:e,email:t,telephone:l,button:n,className:a="",__html:i,icon:r,title:s,version:o="primary",...c})=>p(k,{className:N("box-border text-left space-y-s",a),version:o,...c,children:[p("div",{className:"w-full flex justify-between flex-row-reverse",children:[Ue(r)?u("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:u(ee,{image:r})}):null,s?u(S,{headingType:"h3",as:"h3",title:s}):null]}),p("div",{className:"w-full space-y-m",children:[i?$m(i):null,Um({label:"Адрес",data:e,iconName:"GeolocationIcon"}),Um({label:"Телефон(факс)",data:l,iconName:"PhoneIcon"}),Um({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),n?.text?He([n]):null]})]}))),$m=e=>u("div",{className:"border-b border-main-divider pb-lg",children:u(Me,{__html:e})}),Um=({label:e,data:t,iconName:l,dataColor:n=""})=>t?p("div",{className:"flex gap-s",children:[u(W,{iconVersion:"black",name:l,width:"24",height:"24"}),p("div",{className:"flex flex-col gap-2xs",children:[u(Ae,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),u(Ae,{size:"text-xl",color:n,children:t})]})]}):null,Hm=g((e=>{const{__html:t,richVersion:l,...n}=e;return u(k,{defaultPadding:"p-0",...n,children:u(Me,{__html:t,richVersion:l})})})),Wm=g((({label:e,labelIconBgVersion:t,icon:l,onToggle:n,labelIcon:a})=>u(is,{tag:"button",className:N("border-none bg-transparent items-center group/button",a?.icon?"py-xs":"py-lg"),onClick:n,textNode:p("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[null,e?u(Ae,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:l?u(W,{name:l,iconVersion:"color",width:"24",height:"24"}):null}))),Km=g((({className:e="",isExpanded:t,isFoldButtonOnTop:l=!0,label:n="Развернуть",labelIcon:a,labelIconBgVersion:i,foldButtonVersion:r="default",version:s,...o})=>u(k,{className:N("w-full","border-0 border-b border-solid border-main-divider last:border-b-0",e),defaultPadding:"p-0",tag:"div",version:"transparent",...o,children:u(Rr,{isFoldButtonOnTop:l,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>u(Ar,{className:N("gap-lg","grid grid-cols-12 [&>*]:pb-m"),isUnfolded:e,children:D({...o,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Xm({foldButtonVersion:r,label:n,labelIcon:a,labelIconBgVersion:i,isUnfolded:e,onToggle:t})})})));Km.childrenTypes={exclude:["RollupItem"]};const Xm=({foldButtonVersion:e,label:t,labelIcon:l,labelIconBgVersion:n,isUnfolded:a,onToggle:i})=>{const r=t||(a?"Скрыть":"Развернуть"),s=((e=!1)=>e?"MinusIcon":"PlusIcon")(a);return"accordion"===e?u(Wm,{label:r,labelIcon:l,labelIconBgVersion:n,icon:s,onToggle:i}):u(rs,{label:r,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:i})},Ym=g((({className:e=""})=>{const[t,l]=n("option2"),a=i((e=>l(e)),[]);return p("div",{className:N("order-4",e),children:[u(Yn,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),u(Yn,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),qm=g((({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]}))),o=s.find((e=>e.key===n));return u(ol,{options:s,label:r,placeholder:a||n,onChange:e=>i(e.key),value:o})})),Gm=g((({regions:e=[],selectedRegion:t,onSelectedRegion:l,branches:n=[],selectedBranch:a,onSelectedBranch:i})=>p("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[u("div",{className:"flex-1 min-w-0",children:u(qm,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:l,label:"Регион"})}),u("div",{className:"flex-1 min-w-0",children:u(qm,{data:n,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:i,label:"Отделение",placeholder:"Выберите отделение"})})]}))),Jm=["От 1 дня","До 365 дней"],Qm=g((({days:e,setDays:t})=>p("div",{className:"order-1",children:[u(Ae,{size:"text-m",font:"font-light",children:"Срок аренды"}),u(yn,{min:1,max:365,value:e,items:Jm,onChange:t})]}))),Zm=g((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:l,safeBoxCases:n=[],selectedBoxSize:a,onSelectedBoxSize:i})=>p("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[u("div",{className:"flex-1 min-w-0",children:u(qm,{data:e,fieldLabel:"volume",selected:t,setSelected:l,label:"Размер",placeholder:"Выберите размер"})}),u("div",{className:"flex-1 min-w-0",children:u(qm,{data:n,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:i,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),eh=g((({regions:e,selectedRegion:t,branches:l,selectedBranch:n,days:a,selectedCaseVolume:i,selectedBoxSize:r,safeBoxCases:s,caseVolumes:o,onChange:c,onClick:d})=>p("div",{className:"contents @xl:block flex-1 space-y-xl",children:[u(Gm,{regions:e,selectedRegion:t,onSelectedRegion:e=>c({selectedRegion:e}),branches:l,selectedBranch:n,onSelectedBranch:th(c)}),u(Qm,{days:a,setDays:e=>c({days:e})}),u(Zm,{caseVolumes:o,selectedCaseVolume:i,onSelectedCaseVolume:lh(c),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>c({selectedBoxSize:e})}),u("div",{className:"order-4",children:u(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:"Тип договора"})}),p("div",{className:"contents @md:flex justify-between items-center gap-m",children:[u(Ym,{}),u(pe,{text:"Офисы на карте",version:"primary",onClick:d,className:"order-6"})]})]}))),th=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},lh=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},nh=g((({days:e,tariffs:t=[]})=>{const l=ih(e,t),n="На рисунке изображена пачка листов\nформата А4";return p("div",{className:"contents @xl:flex flex-col justify-between gap-xl order-2",children:[p("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:[ah("Аренда за",e),ah("Цена",l+" ₽")]}),u("div",{className:"@xl:hidden order-3 mb-xs",children:u(I,{size:"text-s",font:"font-light",color:"text-secondary-text",children:n})}),p("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:[u(ee,{image:{icon:"PackA4Icon"},className:"@xl:h-60"}),u("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:u(I,{size:"text-s",font:"font-light",color:"text-white",children:n})})]})]})})),ah=(e,t)=>p("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[u(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),u("span",{className:"text-l @xl:text-h3 text-primary-text",children:t})]}),ih=(e,t)=>{const l=rh(e);return e*(t?.find((e=>e.tariffType===String(l)))?.tariffValue||0)},rh=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},sh=(e,t)=>e.find((e=>e.branchCode===t)),oh=g((e=>{const{regions:t,data:l,branches:n,onChange:i,onClick:r}=e;a((()=>{i({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[l.selectedRegion,i]);const s=sh(n,l.selectedBranch),o=ch(s?.safeBoxCaseVolumes),c=dh(s?.safeBoxCaseVolumes,l.selectedCaseVolume)?.safeBoxCases,d=mh(c,l.selectedBoxSize);return p("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[u(eh,{...l,regions:t,onClick:r,branches:n,caseVolumes:o,safeBoxCases:c,onChange:i}),u(nh,{days:l.days,tariffs:d})]})})),ch=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],dh=(e,t)=>e?.find((e=>e.volume===t)),mh=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,hh=[];const uh=async e=>await ut(e,{method:"GET"})||hh,ph=g((({title:e,footnote:t,className:l="",...a})=>{const[r,s]=n(!1),o=i((()=>s((e=>!e))),[]),[c,d]=n({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),m=el(),h=gh(c.selectedRegion,m),g=function(e){const{data:t}=mt(e?`/api/v1/safeboxes?regionCode=${e}`:null,uh);return t||hh}(h),x=i((e=>d((t=>({...t,...e})))),[d]),f=(b=sh(g,c.selectedBranch)||g,Array.isArray(b)?b.map((e=>e.gpsLatitude&&e.gpsLongitude?[e.gpsLatitude,e.gpsLongitude]:[])):b?.gpsLatitude&&b?.gpsLongitude?[[b.gpsLatitude,b.gpsLongitude]]:[]);var b;return p(k,{className:l,defaultPadding:"",...a,children:[p("div",{className:"p-4xl space-y-xl",children:[e?u(S,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,u(oh,{regions:m,branches:g,data:{...c,selectedRegion:h},onClick:o,onChange:x}),t?u(I,{size:"text-s",font:"font-light",children:t}):null]}),f.length&&r?u(Ed,{points:f,className:"h-[640px]"}):null]})})),gh=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,xh=({styleMap:e,isMainButton:t,version:l})=>(n,a,i)=>{const{label:r,description:s,button:o,items:c,isDotted:d}=n;return p("div",{className:N("relative flex flex-col items-center text-center justify-between whitespace-pre-line overflow-hidden space-y-3xl",fh(i.length)),children:[p("div",{className:"space-y-xs",children:[r?u(Ae,{size:"text-h6",align:"text-center",children:r}):null,p("div",{className:"flex flex-col items-center gap-3xs",children:[s?u("div",{className:e.description,children:s}):null,u(Ge,{className:e.description,items:c,listItemSize:"M",isDotted:d})]})]}),o?.text&&!t?u(pe,{className:"box-border py-s w-full max-w-60 mt-auto",version:l,...o,children:o?.text}):null]},String(a))},fh=e=>e<5?"w-72":"w-52",bh={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"},yh=g((({buttons:e,className:t="",description:l,showLines:n=!0,size:a="normal",steps:i=[],stepVersion:r="gray",title:s,version:o="primary",...c})=>{const d=i.length>3,m=bh,h=(e=>e?"":"opacity-0")(n),g=(e=>e<5?"px-24":"px-16")(i.length),x=Boolean(e?.every((e=>e?.text)));return p(k,{className:N("box-border flex flex-col items-center overflow-hidden gap-y-3xl",t),defaultPadding:"p-6xl",version:o,...c,children:[u(B,{headlineVersion:"S",title:s,description:l,isEmbedded:!0,className:"w-full",align:ca}),i?.length?p("div",{className:"box-border space-y-lg flex flex-col justify-center",children:[u("div",{className:N("flex items-center",g),children:Gc(u("div",{className:N("h-0.5 w-full bg-secondary-light flex-1",h)}))(i.map(vh(m,a,r)))}),u("div",{className:N("flex justify-between",d?"gap-x-s":"gap-x-20"),children:i.map((f={styleMap:m,isMainButton:x,version:o},(e,t,l)=>{const{type:n}=e;if("default"!==n&&"rte"!==n)return null;switch(n){case"default":return xh(f)(e,t,l);case"rte":return u("div",{className:N("text-center",fh(l.length)),children:u(Me,{__html:e.__html})},String(t));default:return null}}))})]}):null,He(e)]});var f})),vh=(e,t,l)=>({icon:n},a)=>{const i="secondary"===l?"white":"color";return u(k,{defaultPadding:"",className:`${Nh(t)} flex justify-center items-center text-center rounded-full box-border z-10`,version:l,children:Ue(n)?u(ee,{image:{...n,iconVersion:n?.iconVersion||i},width:"48",height:"48"}):u("span",{className:N("text-h4","transparent"===l?e.iconText:(r=l,"secondary"===r?"group-data-primary:text-white":"text-secondary-text")),children:a+1})},String(a));var r},Nh=e=>"normal"===e?"h-24 w-24":"h-16 w-16",wh=g((({className:e,version:t,gap:l=14,padding:n=16,showDots:a=false,minHeight:i,children:r,onVisibleIndicesChange:s,listType:o="horizontal-list"})=>{const c=Array.isArray(r)?r.length:0,[d,m]=Zi({itemCount:c,onVisibleIndicesChange:s}),[h]=m.visibleIndicesRange;return p("div",{className:N(e,"vertical-list"===o?"relative h-full":""),children:[u(Wi,{containerRef:d,activeIndex:h,visibleItemCount:1,gap:l,padding:n,onVisibleIndicesChange:m.handleVisibleIndicesChange,listType:o,minHeight:i,children:r}),a?u(Gi,{containerRef:d,activeIndex:h,dotCount:c,listType:o,version:t}):null]})})),kh=g((({listType:e,showDots:t,options:l,version:n,...a})=>u(k,{version:n,defaultPadding:"p-0",...a,children:u(wh,{listType:e,showDots:t,version:n,children:D({...a,options:l})})})));kh.childrenTypes={exclude:["SwipeListControlBlock"]};const Ch="hidden sm:flex absolute z-40 top-0",Sh=g((({className:e,items:t=[],value:l,onChange:n,tabsType:a})=>{const[i,r]=Zi({itemCount:t?.length||0});return p("div",{className:N("relative overflow-x-auto no-scrollbar",e),role:"tablist",children:[u(Wi,{containerRef:i,snapAlign:"snap-start",onVisibleIndicesChange:r.handleVisibleIndicesChange,children:t.map(Pd(l,n,a))}),r.canScrollLeft?u(wa,{className:N("left-6",Ch),onClick:r.scrollLeft}):null,r.canScrollRight?u(ka,{className:N("right-6",Ch),onClick:r.scrollRight}):null]})})),Ih=({tabsMode:e,...t})=>{switch(e){case"wideScreen":return u(Md,{...t});case"centered":return u("div",{className:"flex",children:u(Md,{className:"m-auto p-xs rounded-md bg-main-gray",tabsType:"rounded",...t})});case"scrollable":return u("div",{className:"flex",children:u(Sh,{className:"m-auto",tabsType:"underlined",...t})});default:return null}},Th="tab",Bh=g((({className:e="",isSticky:t,tabs:l=[],tabsMode:s,...o})=>{const c=v(),{isReady:d}=c,m=r((()=>l.map(Mh)),[l]),[h,p]=n(0);a((()=>{if(!l||!l[0])return;const e=c.query.tab&&l.findIndex((e=>"group"===e.type&&e.ref===c.query.tab))||0,t=l[e]||l[0];p(e),Ph(t)}),[d]),a((()=>{const e=l[h];"group"===e?.type&&y.subject("tab",{type:e.type,label:e.ref,groupName:e.name})}),[l,h]);const g=i((e=>{const t=m.indexOf(e),n=l[t];p(t),Ph(n),"group"===n.type&&(e=>{const t=new URLSearchParams(c.query);e.name?t.set(Th,e.name):t.delete(Th),c.replace(`${c.pathname}?${t}`,"",{scroll:!1})})(e)}),[l,m]);return u(k,{className:N(t?"sticky top-1 z-20":"",e),defaultPadding:"p-0",...o,children:Ih({items:m,value:m[h],tabsMode:s,onChange:g})})})),Ph=e=>{"group"===e.type&&y.fire("tab",{type:e.type,label:e.ref,groupName:e.name}),"link"===e.type&&y.fire("tab",{type:e.type,label:e.href})},Mh=e=>"group"===e?.type?{text:e.title,name:e.ref}:e,Rh={start:"text-start",center:"text-center",end:"text-end"},Ah=g((({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 p("button",{type:"button",onClick:l,"aria-label":e?.title,className:N("border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs",a.btn,t),children:[e?.icon?u(ee,{className:N("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,p("div",{className:"border-0",children:[e?.title?u("div",{className:a.title,children:e.title}):null,e?.description?u("div",{className:a.desc,children:e.description}):null]})]})})),zh=g((({tab:e})=>{const t=ce();return Io((()=>{const{onClick:l}=t(e);l()}),[e],500),u(Dm,{className:"col-span-12 p-xl",size:5})})),Dh=g((({className:e="",tabs:t=[],block:l,tabAlign:i,...r})=>{const[s,o]=n(_h(t)),c=Vh(t[s],s),d=t.length,[m,{inc:h,dec:g}]=va({itemCount:d},s),[x,f]=Zi({itemCount:d});return a((()=>{f.scrollTo(s,{behavior:"auto"})}),[]),p(k,{className:N(e),defaultPadding:"p-0",...r,children:[p("div",{className:"relative border-b-8 border-primary-main",children:[u(Wi,{itemClassName:"flex",containerRef:x,snapAlign:"snap-end",gap:8,onVisibleIndicesChange:f.handleVisibleIndicesChange,children:t.map(Fh(s,o,i))}),u(lr,{scroll:f,arrowsPadded:!0,onScrollLeft:g,onScrollRight:h,activeIndex:m,itemCount:d})]}),u("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:t[s]?.href?u(zh,{tab:t[s]}):z(l?.slots?.[c],{...r?.options,slotName:c})})]})}));Dh.slots=({tabs:e})=>e?.filter((e=>!e.href)).map(Vh)||[],Dh.childrenTypes={exclude:["TabsLayout"]};const Vh=(e,t)=>e?.title||`Слот №${t}`,_h=e=>e.reduce(((e,t,l)=>t.selected?l:e),0),Fh=(e,t,l="start")=>(n,a)=>u(Ah,{className:Rh[l],tab:n,isActive:e===a,onClick:()=>t(a)},String(a)),jh=g((({className:e="",isOpen:t,onClick:l})=>u(pe,{className:e,appendRight:u(ee,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"20",height:"20"}),text:t?"Скрыть":"Показать",version:"gray",onClick:l}))),Lh={Buttons:({buttons:e})=>He(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?u(ee,{image:e}):null,List:({isDotted:e,...t})=>u(Ge,{className:"flex flex-col justify-between items-start text-h6",isDotted:e??!0,...t}),LabelDescription:({label:e,description:t})=>p("div",{className:"space-y-2xs",children:[e?u("div",{children:u(Ae,{size:"text-h6",children:e})}):null,t?u("div",{children:u(Ae,{size:"text-l",color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,dataUrl:l,pdfUrl:n,isOpen:a})=>e?u(jh,{isOpen:a,onClick:()=>{t({dataUrl:l,pdfUrl:n})}}):null},Eh=g((({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 Oh({cell:e,cellProps:{rowIdx:l,cellIdx:i,fieldIdx:t,displayTable:e=>{m(!1),c(i),r(e)},isVisible:d}})})),Oh=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:l,...n}=e;if(!l||!(l in Lh))return null;return u(Lh[l],{...t,...n})},$h=g((({cells:e,rowIdx:t,cellIdx:l,setTableInner:n,tableInner:a,openTableInnerIdx:i,setOpenTableInnerIdx:r})=>u("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>u(Eh,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:l,setTableInner:n,tableInner:a,openTableInnerIdx:i,setOpenTableInnerIdx:r},String(s)))):null}))),Uh=(e,t)=>140*Te(e.slice(0,t).map((e=>e?.cols?.length??1))),Hh=(e,t)=>e?.length>0?u("div",{className:N("flex",0===t?"text-secondary-text":""),children:e.map(((e,t)=>u("div",{className:"w-20 mx-lg",children:u(Ae,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,Wh=g((({rows:e})=>{const t=e?.[0]?.length??0,[l,n]=va({itemCount:t,visibleItemCount:5});return p("div",{children:[e?.map((a=l,(e,t)=>{if(!e?.length)return null;const[l,...n]=e,i=N("flex duration-1000 text-center",0!==t?"font-normal":"font-light");return p("div",{className:"flex border-main-divider border-b border-solid h-full",children:[l?.data?u("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:u(Ae,{size:"text-xl",font:"font-light",children:l.data})}):null,u("div",{className:"flex flex-grow overflow-hidden",children:u("div",{className:i,style:{transform:`translateX(-${Uh(n,a)}px)`},children:n?.map(((e,t)=>p("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?u(Ae,{size:"text-xl",children:e.data}):null,e?.cols?Hh(e.cols,a):null]},`row${t}`)))})})]},String(t))})),Ca({...n,btnClass:["left-3 top-20","right-3 top-20"],className:""})]});var a})),Kh=g((({activeTabIndex:e,items:t})=>u("div",{children:t.map(((t,l)=>{const n=`activeTabIdx:${e}-tableIdx:${l}`;return p("div",{className:"w-full @container",children:[u("div",{className:"flex py-m sm:px-m bg-white @4xl:bg-gray relative",children:u(Ae,{size:"text-xl",align:"text-left",children:t.title})}),u("div",{className:"w-full sm:pl-xs overflow-hidden transition-height duration-500 ease-in-out",children:u("div",{className:"relative",children:u(Wh,{rows:t.rowsData})})})]},n)}))}))),Xh=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Yh=g((({currencies:e,linkToPDF:t,activeTabIndex:l,setActiveTabIndex:n})=>p("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?u("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>u("div",{className:N("rounded-md px-4 py-3 cursor-pointer",t===l?"bg-primary-main":""),onClick:()=>n(t),children:u(Ae,{size:"text-xl",font:"font-light",color:Xh(t===l),children:e||t+1})},e)))}):null,t?u(pe,{className:"text-primary-main",href:t,version:"secondary",target:"_blank",appendLeft:u(W,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]})));async function qh(e){const t=await fetch(e);return await t.json()}const Gh=g((({dataUrl:e,pdfUrl:t,onClick:l})=>{const{tableData:a}=function(e){const{data:t}=mt(function(e){return`/wcms-resources/${e||"tariffs-inner-table-data"}.json`}(e),qh);return t||{}}(e),[r,s]=n(0),o=i((e=>s(e)),[]),c=a?.[r]?.items??[],d=a?.map((e=>e.currency??""));return p("div",a?{className:"bg-white z-10",children:[u(Yh,{currencies:d,activeTabIndex:r,setActiveTabIndex:o,linkToPDF:t}),u(Kh,{activeTabIndex:r,items:c}),u(jh,{className:"mt-xl",onClick:l,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[u(Ae,{size:"text-h6",children:"Данных нет"}),u(jh,{onClick:l,isOpen:!0})]})})),Jh=g((({children:e,tableInner:t,onHideContentClick:l})=>p("div",{className:"self-start flex flex-col",role:"row",children:[u("div",{className:N("@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?u("div",{className:"origin-top animate-expansion",children:u(Gh,{...t,onClick:l})}):null]}))),Qh=g((({row:{header:e,data:t},activeIndex:l,rowIdx:a,...r})=>{const[s,o]=n(void 0),c=i((e=>o(e)),[]),[d,m]=n(void 0),h=i((e=>m(e)),[]);return p(Jh,{onHideContentClick:()=>o(void 0),tableInner:s,...r,children:[u("div",{className:N("text-s","w-80 flex-shrink-0"),children:p("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?u(ee,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?u(Ae,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?u($r,{activeIndex:l,columnWidth:360,version:"tariff",children:t.map(((e,t)=>u($h,{cells:e,rowIdx:a,cellIdx:t,setTableInner:c,tableInner:s,openTableInnerIdx:d,setOpenTableInnerIdx:h,...r},String(t))))}):null]})})),Zh=g((({children:e,controls:t})=>{const{isScrollAvailable:l}=t;return p("div",{role:"table",children:[p("div",{className:"relative space-y-xs",children:[e,Ca({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),l?u("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),eu=g((({className:e="",title:t,description:l,rowHeaders:n,tariffsColumns:a,hiddenRowsNum:i=0,...r})=>{const s=a?.map((({data:e})=>e))||[],o=n?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),c=s.length,[d,m]=va({itemCount:c,visibleItemCount:2}),h=(o||[]).map(((e,t)=>u(Qh,{row:e,activeIndex:d,rowIdx:t,...r},String(t)))),[g,x]=i>0?[h.slice(0,-i),h.slice(-i)]:[h,[]];return p(k,{className:N("overflow-hidden relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...r,children:[u(B,{title:t,description:l,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),u("div",{className:"space-y-m",children:i>0?u(Rr,{renderFoldableSection:({isUnfolded:e})=>p(Zh,{controls:m,children:[g,u(Ar,{isUnfolded:e,children:x})]}),renderFoldButton:ss}):u(Zh,{controls:m,children:h})})]})})),tu=g((({className:e="",title:t,description:l,iconVersion:n,__html:a,...i})=>p(k,{className:N("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...i,children:["small"===n?lu():null,p("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?u(Ae,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,l?nu(l):null,a?u(Me,{__html:a}):null]})]}))),lu=()=>u("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"}),nu=e=>u(I,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),au=g((({prefix:e,unit:t,suffix:l})=>p("div",{className:"w-full flex items-end",children:[e?u("div",{className:"gradient-color-text",children:u(Ae,{size:"text-h2",children:e})}):null,t?u("div",{className:"-mb-6 @xl:-mb-4",children:u("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,l?u("div",{className:"gradient-color-text",children:u(Ae,{size:"text-h2",children:l})}):null]}))),iu=g((e=>{const{prefix:t,unit:l,suffix:n,...a}=e;return u(k,{defaultPadding:"p-0",...a,children:u(au,{prefix:t,unit:l,suffix:n})})})),ru=g((({className:e="",padding:t="p-0",gap:l="",isInnerPadding:n=!0,version:a="transparent",isTheme:i=!1,isCardBorder:r=!1,image:s,...o})=>{const c=v();return u(k,{className:N("relative flex flex-col",Oc[l],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${q(c)(s?.src)})`}}:{},padding:t,version:a,isTheme:i,...o,children:D({...o,extraProps:{className:N("w-full",ar(r)),padding:n?"":"p-0"}})})}));ru.childrenTypes=[];const su=e=>(e=>{const t="col-span-",l=e?.split(/\s+/).find((e=>e.startsWith(t)));return l?parseInt(l.substring(t.length),10):12})(e)<10?"py-xl px-6xl":"py-6xl px-32",ou=g((({className:e,title:t,url:l,previewImg:n,...a})=>{const i=v();return p(k,{className:e,defaultPadding:su(e),...a,children:[u(B,{title:t,headlineVersion:"M"}),l?u("video",{className:"m-auto w-full object-fill",preload:"metadata",poster:$(i)(n?.src),style:{maxHeight:524},controls:!0,children:u("source",{src:$(i)(l)})}):null]})})),cu={AdTile:yt,ApplicationForm:sa,BenefitsBlock:ha,BonusBenefitsBlock:fa,ButtonsBlock:ya,Calculator:Ai,CardTransfer:Li,Carousel:hr,CarouselBankHistoryCard:ur,CarouselCard:br,CarouselCatalogCard:vr,CarouselLinks:Cr,CarouselRecommendationCard:Pr,CarouselTariffsCard:Dr,ComparisonTable:Zr,ContactsBlock:ts,DepositFiltration:Ts,Depository:$s,ErrorBlock:Hs,ExchangeRateTile:xo,Footer:lc,GracePeriod:nc,Header:Ec,Headline:B,HorizontalLayout:$c,ImgBlock:Uc,InsuranceAmountBlock:Yc,InvestmentInfo:Zc,LinkDocs:od,MobileAppTile:md,MortgageFiltration:Ad,OfficesAtmsMap:zm,Placeholder:jm,ProductBlock:rt,ProductGallery:Lm,RepresentativeOfficeInfo:Om,RichTextBlock:Hm,RollupItem:Km,SafeDepositRental:ph,StepsBlock:yh,SwipeListControlBlock:kh,Tabs:Bh,TabsLayout:Dh,TariffsTable:eu,TextBlock:tu,UnitBlock:iu,VerticalLayout:ru,Video:ou},du="cookie",mu=g((({termLink:e,personalDataPolicyLink:t})=>{const[l,{setTrue:n,setFalse:a}]=tl();Io((()=>{globalThis.localStorage?.getItem(du)||n()}),[],3e3);const r=i((()=>{globalThis.localStorage?.setItem(du,"true"),a()}),[]);return l?u("div",{className:"container fixed left-0 right-0 bottom-0 z-50",children:p("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[u("div",{className:"sm:flex-1",children:p(I,{size:"text-s",font:"font-light",color:"text-primary-text",children:["АО «Россельхозбанк» использует",u(Ir,{isRemote:!0,className:hu(e?.href),...e,children:"cookie"}),"(файлы с данными о прошлых посещениях сайта) для персонализации сервисов и удобства пользователей. Вы можете запретить сохранение cookie в настройках своего браузера.",u(Ir,{isRemote:!0,className:hu(t?.href),...t,children:"Обработка Ваших персональных данных"}),"производится в соответствии с требованиями Федерального закона от 27.07.2006 № 152-Ф3 «О персональных данных»."]})}),u("div",{className:"ml-s sm:ml-0 w-24 flex justify-end",children:u(So,{className:"bg-main-gray rounded-md",onClose:r})})]})}):null})),hu=e=>N("inline mx-2xs",e?"text-green-dark":"");function uu(e){throw new Error(e)}const pu=({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((()=>y.subscribe("dialog",(e=>{switch(e.type){case"open":r(e);break;case"close":e.all?c():d();break;default:uu(e)}}))),[c,d]),l},gu=g((()=>{const e=i((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=i((e=>{e?.onClose&&e.onClose()}),[]),l=pu({onCloseAll:e,onClose:t}),{close:n}=se(),r=i((({key:e})=>{"Escape"===e&&n()}),[]);return nl(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?u("div",{className:"fixed inset-0 z-50",role:"dialog",children:l.map((({dialog:e,id:t},n)=>u("div",{className:N("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar",n===l.length-1?"":"hidden"),children:e},String(t||n))))}):null})),xu=g((()=>{const[e,t]=n(null),l=i((()=>{t(null)}),[]);a((()=>y.subscribe("popup",(e=>{switch(e.type){case"open":case"update":t(e);break;case"close":l();break;default:uu(e)}}))),[]);const r=i((({key:e})=>{"Escape"===e&&l()}),[l]);return nl(globalThis.document,"keydown",r),e?u("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})),fu=g((()=>null)),bu=h();const yu=g((({className:e,onClick:t,ariaLabel:l})=>u("button",{type:"button",className:`border-0 w-9 bg-inherit cursor-pointer ${e||""}`,onClick:t,"aria-label":l,children:vu()}))),vu=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[Nu("M21.48 11.95c.5-1.4-.4-2.6-1.9-2.6h-4c-.6 0-1.1-.5-1-1.2l.5-3.2c.2-.9-.4-1.9-1.3-2.2-.8-.3-1.8.1-2.2.7l-4.1 6.1M7.48 18.35l3.1 2.4c.4.4 1.3.6 1.9.6h3.8c1.2 0 2.5-.9 2.8-2.1l1.24-3.77"),Nu("M2.38 18.35v-9.8c0-1.4.6-1.9 2-1.9h1c1.4 0 2 .5 2 1.9v9.8c0 1.4-.6 1.9-2 1.9h-1c-1.4 0-2-.5-2-1.9Z")]}),Nu=e=>u("path",{stroke:"#292D32",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",strokeMiterlimit:"10",d:e}),wu=g((({className:e=""})=>{const t=function(e){const[t,l]=n(0);return a((()=>{(async()=>{const[t]=await bu.getLikeCount(e);l(t?.value||0)})()}),[e]),{likeCount:t,like:i((async()=>{l(await bu.like(e))}),[e]),dislike:i((async()=>{l(await bu.dislike(e))}),[e])}}(v().pathname);return p("div",{className:`border-main border-2 border-solid bg-white flex w-32 items-center justify-center gap-s p-xs font-sans ${e}`,children:[u(yu,{onClick:oe(t.like),ariaLabel:"Поставить отметку «лайк»"}),u(yu,{onClick:oe(t.dislike),className:"rotate-180",ariaLabel:"Поставить отметку «дизлайк»"}),u("span",{className:"select-none",children:t.likeCount})]})})),ku=g((({className:e,blocksRegistry:t,blockDecorator:l,data:n={}})=>{const{style:a,slots:i,likeControl:r,colorPalette:s="pc"}=n,o={key:"",page:n,blocksRegistry:t,blockDecorator:l,parent:n};return p("div",{"data-theme":s,children:[p("section",{className:N("@container relative",a,e),children:[i?.header?u("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:z(i?.header,{...o,slotName:"header"})}):null,p("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[D({block:n,options:o,extraProps:{className:"scroll-mt-12"}}),z(i?.footer,{...o,slotName:"footer"})]}),r?u("div",{className:"flex items-end absolute bottom-0 right-0 h-full pointer-events-none",children:u(wu,{className:"rounded-tl-3xl sticky bottom-0 pointer-events-auto"})}):null]}),u(fu,{options:o}),u(gu,{}),u(xu,{}),u(mu,{termLink:{href:"/pd-policy#cookie",target:"_blank"},personalDataPolicyLink:{href:"/pd-policy",target:"_blank"}})]})}));ku.childrenTypes=[],ku.slots=()=>["header","footer"];e.Blocks=cu,e.ContentPage=ku,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.LikeAPI=h,e.handlerDecorator=oe,e.joinList=Gc,e.packageVersion="0.14.151",e.projectSettings=d,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=L,e.useRouter=v,Object.defineProperty(e,"__esModule",{value:!0})}));