@redneckz/wildless-cms-uni-blocks 0.14.676 → 0.14.677
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/api/RetailAPI/updateRefreshToken.d.ts +1 -1
- package/bundle/bundle.umd.js +23 -12
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/hooks/useNavigator.d.ts +8 -0
- package/bundle/index.d.ts +1 -0
- package/dist/api/RetailAPI/updateRefreshToken.d.ts +1 -1
- package/dist/api/RetailAPI/updateRefreshToken.js +6 -10
- package/dist/api/RetailAPI/updateRefreshToken.js.map +1 -1
- package/dist/components/CreditCardForm/CreditCardForm.js +4 -1
- package/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/dist/components/CreditForm/CreditForm.js +4 -1
- package/dist/components/CreditForm/CreditForm.js.map +1 -1
- package/dist/hooks/useNavigator.d.ts +8 -0
- package/dist/hooks/useNavigator.js +13 -0
- package/dist/hooks/useNavigator.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/lib/api/RetailAPI/updateRefreshToken.d.ts +1 -1
- package/lib/api/RetailAPI/updateRefreshToken.js +6 -10
- package/lib/api/RetailAPI/updateRefreshToken.js.map +1 -1
- package/lib/components/CreditCardForm/CreditCardForm.js +4 -1
- package/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/lib/components/CreditForm/CreditForm.js +4 -1
- package/lib/components/CreditForm/CreditForm.js.map +1 -1
- package/lib/hooks/useNavigator.d.ts +8 -0
- package/lib/hooks/useNavigator.js +10 -0
- package/lib/hooks/useNavigator.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/mobile/bundle/api/RetailAPI/updateRefreshToken.d.ts +1 -1
- package/mobile/bundle/bundle.umd.js +23 -12
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/hooks/useNavigator.d.ts +8 -0
- package/mobile/bundle/index.d.ts +1 -0
- package/mobile/dist/api/RetailAPI/updateRefreshToken.d.ts +1 -1
- package/mobile/dist/api/RetailAPI/updateRefreshToken.js +6 -10
- package/mobile/dist/api/RetailAPI/updateRefreshToken.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/CreditCardForm.js +4 -1
- package/mobile/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditForm.js +4 -1
- package/mobile/dist/components/CreditForm/CreditForm.js.map +1 -1
- package/mobile/dist/hooks/useNavigator.d.ts +8 -0
- package/mobile/dist/hooks/useNavigator.js +13 -0
- package/mobile/dist/hooks/useNavigator.js.map +1 -0
- package/mobile/dist/index.d.ts +1 -0
- package/mobile/dist/index.js +3 -1
- package/mobile/dist/index.js.map +1 -1
- package/mobile/lib/api/RetailAPI/updateRefreshToken.d.ts +1 -1
- package/mobile/lib/api/RetailAPI/updateRefreshToken.js +6 -10
- package/mobile/lib/api/RetailAPI/updateRefreshToken.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardForm.js +4 -1
- package/mobile/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditForm.js +4 -1
- package/mobile/lib/components/CreditForm/CreditForm.js.map +1 -1
- package/mobile/lib/hooks/useNavigator.d.ts +8 -0
- package/mobile/lib/hooks/useNavigator.js +10 -0
- package/mobile/lib/hooks/useNavigator.js.map +1 -0
- package/mobile/lib/index.d.ts +1 -0
- package/mobile/lib/index.js +1 -0
- package/mobile/lib/index.js.map +1 -1
- package/mobile/src/api/RetailAPI/updateRefreshToken.ts +6 -12
- package/mobile/src/components/CreditCardForm/CreditCardForm.tsx +6 -1
- package/mobile/src/components/CreditForm/CreditForm.tsx +6 -1
- package/mobile/src/hooks/useNavigator.ts +15 -0
- package/mobile/src/index.ts +1 -0
- package/package.json +1 -1
- package/src/api/RetailAPI/updateRefreshToken.ts +6 -12
- package/src/components/CreditCardForm/CreditCardForm.tsx +6 -1
- package/src/components/CreditForm/CreditForm.tsx +6 -1
- package/src/hooks/useNavigator.ts +15 -0
- package/src/index.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniMobileBlocks={})}(this,(function(e){"use strict";let t;const n=e=>(...n)=>t[e](...n),i=n("useState"),a=n("useEffect"),l=n("useCallback"),r=n("useMemo"),s=n("useRef"),o=(...e)=>globalThis._uni._jsx(...e),c=(...e)=>globalThis._uni._jsxs(...e),d=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:m(e)),t._tmpl},m=e=>{function t(t,n){const{children:i,...a}=t||{},l=n?.slots?.default,r=i||l&&l();return e(Object.assign(a,r&&{children:r}),n)}return t.inheritAttrs=!1,t},u=(...e)=>e.map((e=>h(e)?Object.entries(e).filter((([,e])=>e)).map((([e])=>e)):e)).flatMap((e=>e)).filter(Boolean).join(" "),h=e=>Boolean(e&&"object"==typeof e&&!Array.isArray(e)),p={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white",gray:"bg-main-divider text-primary-text",transparent:"bg-transparent text-primary-text","":""},g=d((({className:e,version:t="primary",isTheme:n=!0,defaultPadding:i="p-xl",padding:a,block:l,tag:r="section",role:s,children:c,style:d})=>{const m=t&&n;return o(r,{className:u("@container font-sans",{group:m},p[t],a||i,e),...m?{"data-ver":t}:{},...l?.anchor?{id:l.anchor}:{},role:s,style:d,children:c})})),f=d((({className:e,size:t})=>o("figure",{className:u("m-0 mt-xl min-w-[80%]",e),children:x(t)}))),x=(e=3)=>b(100,e).map((e=>Math.floor(e))).map(y),y=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),b=(e,t)=>[e].concat(t>0?b(e/1.618,t-1):[]),v={h1:"h1",h2:"h1",h3:"h2",h4:"h2",h5:"h3",h6:"h3"},N={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},w=d((({className:e="",headingType:t="h3",as:n="h3",title:i,children:a})=>{const l=v[n]||"h3";return o(l,{role:"heading",className:u("font-sans m-0",N[t],e),children:i||a})})),C=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),S={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"}},k=d((({className:e,version:t="",headlineVersion:n="XL",title:i,description:a,align:l="text-center",as:r,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=S[n],p={marginTop:h.descriptionStyle};return c(g,{className:u({"@container-normal":s},e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[i?o(w,{className:u("whitespace-pre-wrap",l),...h?.title,as:r||h?.title.as,title:i}):null,a?o(C,{size:h.descriptionSize,font:h.descriptionWeight,align:l,...p,children:a}):null]})})),I=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),T=[];function B(e,t,{className:n,...i}={}){const{key:a,blockDecorator:l=I,blocksRegistry:r={},ancestors:s=T}=t,{type:c}=e;c&&c in r||console.warn(`No block with "${c}" is registered`);const d=c&&r[c];return l({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:l})=>{const{content:r}=n;return d?o(d,{className:l,block:e,options:t,...r,...i},a):null}},a)}const P=[],R=(e,{key:t,ancestors:n=P,slotName:i=null,extraProps:a,renderProps:l=B,...r})=>{const s=a?(e,t)=>B(e,t,a):l;return(e||[]).map(((e,a)=>s(e,{...r,key:`${t||e.type}-${a}`,ancestors:r.parent?[...n||P,[r.parent,i]]:n},a)))};function D({block:e,options:t,children:n,extraProps:i,renderProps:a}){return n||(e&&t?R(e.blocks,{...t,parent:e,extraProps:i,renderProps:a}):null)}function M(){return M._impl()}M._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),M.setup=e=>{M._impl=e};const _=["CDN","BASE_PATH"],A=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return _.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),E=e=>Boolean(e?.includes(":")),z=(e,t)=>Boolean(e&&!E(e)&&(!t||"_self"===t)),F=e=>Boolean(e?.startsWith("#")),V=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),O=(e,t)=>!(!e||!t)&&(!!e.startsWith(t)&&["/"===t,e===t,"/"===e[t.length]].some(Boolean));var L=Object.freeze({__proto__:null,isURL:E,isLocalURL:z,isHash:F,withoutQuery:e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),joinPath:V,hasPrefix:O});const j="/api/",q=`${j}v1/storage`,$=e=>(t,n)=>{if([!t,E(t),F(t),[A.CDN,j].some((e=>O(t,e)))].some(Boolean))return t;if(((e="")=>/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}(\/revs\/[0-9]{1,20})?$/.test(e))(t))return`${q}/${t}/attachment`;const i=t?.startsWith("/");return V(O(t,n)?"":n,i?"/":e.pathname?.split("/").slice(0,-1).join("/"),t)},U={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},W=d((({className:e="",imageClassName:t="",name:n="",alt:i=`Иконка ${n}`,title:a=i,iconVersion:l="color",width:r,height:s})=>{const d=M(),m="normal"===l?`${n}.svg`:`sprites.svg#${n}`,h=$(d)(V(A.CDN,"/icons/",m));return"normal"===l?o("img",{className:e,src:h,alt:i,title:a,"aria-hidden":"true",width:r,height:s,style:H(e,s)}):o(K,{className:e,children:c("svg",{className:u(Y(r),U[l],{invert:"white"===l},t),width:r,height:s,"aria-hidden":"true",children:[a?o("title",{children:a}):null,i?o("desc",{children:i}):null,o("use",{href:h,xlinkHref:h})]})})})),H=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},Y=e=>e?"":"w-full h-full",K=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),G=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function X(e=""){try{return new URL(e).pathname}catch(e){return""}}const J=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":X(G.SITE_URL);return t&&!E(t)?$(e)(t,n):t},Z=(e,t)=>e?.media&&t?.media?e.media-t.media:0,Q=d((({className:e="",image:t,imageClassName:n=""})=>{const i=M();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(Z).map((({src:e,format:n,media:a},l)=>o("source",{srcSet:J(i)(e),type:te(n),media:a?`(max-width: ${a}px)`:"",width:t?.size?.width,height:t?.size?.height},`${l}_${e}`))):null,t?.src?ee({...t,src:J(i)(t.src)},n):null]})})),ee=(e,t="")=>o("img",{src:e.src,className:u("object-contain",t),alt:e?.alt||e?.title||"",title:e?.title||"",style:{width:e?.size?.width?`${e.size?.width}px`:"100%",height:e?.size?.height?`${e.size?.height}px`:"auto"},width:e?.size?.width,height:e?.size?.height}),te=e=>e?`image/${String(e)}`:void 0,ne=d((({className:e="",image:t,imageClassName:n="",...i})=>t?.src||t?.icon?t.icon?o(W,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...i}):o(Q,{className:e,imageClassName:n,image:t}):null)),ie={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active",white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",transparent:"",gray:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","":""},ae="bg-main-divider text-main-disabled",le={primary:ae,secondary:ae,white:ae,link:"",transparent:"",gray:ae,"":""},re="text-center font-sans select-none",se={primary:"group-hover/btn:brightness-0 group-hover/btn:invert",secondary:"group-hover/btn:brightness-0 group-hover/btn:invert",white:"group-hover/btn:brightness-0 group-hover/btn:invert",link:"text-primary-main",transparent:"",gray:"group-hover/btn:brightness-0 group-hover/btn:invert","":""},oe=({className:e,rounded:t,version:n})=>[re,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",n?ie[n]:"",t?"rounded-full":"rounded-md",e].join(" ");class ce{watchers=new Set;subscribersMap={};subjectsStateMap={};emitter=this;observable=this;watch(e){return this.watchers.add(e),()=>{this.watchers.delete(e)}}subscribe(e,t){this.subscribersMap[e]||=new Set,this.subscribersMap[e]?.add(t);const n=this.subjectsStateMap[e];return n&&t(n),()=>{this.subscribersMap[e]?.delete(t)}}fire(e,t){e in this.subjectsStateMap?this.subject(e,t):this.fireSubscribers(e,t)}subject(e,t){return this.subjectsStateMap[e]!==t&&(this.subjectsStateMap[e]=t??void 0,this.fireSubscribers(e,t)),()=>{delete this.subjectsStateMap[e]}}fireSubscribers(e,t){for(const n of this.subscribersMap[e]??[])n(t??null);for(const n of this.watchers)n({type:e,event:t??null})}}const de=new ce,me=()=>({open:(e,t={})=>de.fire("dialog",{type:"open",dialog:e,...t}),close:()=>de.fire("dialog",{type:"close"}),closeAll:()=>de.fire("dialog",{type:"close",all:!0})}),ue=e=>ue._impl(e);function he(){const e=X(G.SITE_URL),t=M(),{closeAll:n}=me();return e=>{const n=$(t)(e.href);return{...e,href:n,"aria-label":e.text,onClick:ue(i({...e,href:n}))}};function i({href:i,target:a,onClick:l}){return r=>{l?.(r),pe(i,a,e)||(n(),r?.preventDefault(),t.push(((e,t="")=>e?.replace(t,"")||"/")(i,e)))}}}ue._impl=e=>e,ue.setup=e=>{ue._impl=e};const pe=(e,t,n)=>{if(!z(e,t))return!0;const i=G.SUB_PORTALS?.split(",");return!!i?.some((t=>O(e,t)))||!O(e,n||"/")},ge=e=>{if(!Array.isArray(e)||!e.length)return{};try{return{"data-aspects":JSON.stringify(e)}}catch(e){return{}}},fe=d((e=>{const{text:t,aboveText:n,appendLeft:i,appendRight:a,version:l="primary"}=e,r=ye(e)&&"hidden lg:block";return c("div",{className:u(xe(e),"flex gap-xs"),children:[i?o("div",{className:u(r,se[l]),children:i}):null,ye(e)?c("div",{className:"whitespace-pre",children:[n?o("div",{className:"text-xs font-light text-left",children:n}):null,o("div",{className:"text-left "+(n?"text-s -mt-3xs":"text-l"),children:t})]}):null,a?o("div",{className:u(r,se[l]),children:a}):null]})})),xe=e=>{const{version:t,aboveText:n,rounded:i}=e;if("link"===t)return"";const a=""+(n?"py-2.5 px-9":"py-4 px-9");return u("group/btn items-center justify-center",ye(e)?a:"h-12 w-12 m-auto",{"rounded-full":i})},ye=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),be=({className:e,rounded:t,version:n})=>["inline-block",re,n?le[n]:"",t?"rounded-full":"rounded-md",e].join(" "),ve=d((({disabled:e,children:t,method:n="LINK",href:i,...a})=>{const r=(({method:e,href:t})=>l((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:i,pathname:a,searchParams:l}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[i,a].join(""));for(const[e,t]of l.entries()){const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),r.appendChild(n)}document.body.appendChild(r),r.submit()}),[]))({method:n,href:i}),s=he()({onClick:r,href:i,...a}),c=t??o(fe,{...s});return o(e?we:Ne,{...s,children:c})})),Ne=d((({className:e="",href:t,rel:n,target:i,ariaLabel:a,version:l,rounded:r,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:oe({className:e,version:l,rounded:r}),href:t,rel:n,target:i,"aria-label":a||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...ge(d),children:m}))),we=d((({className:e,ariaLabel:t,version:n,rounded:i,children:a})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:be({className:e,rounded:i,version:n}),children:a})));function Ce({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:i=!1}){if(!n)return null;const a="primary"===e?"white":"black",l="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(i?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:u(oe({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",rounded:!0}),l),onClick:t,children:o(ne,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:a}})}),o(ve,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const Se=()=>{const[e,t]=i(true);return a((()=>{const e=globalThis.matchMedia?.("(max-width: 1024px)"),n=()=>{t(Boolean(e?.matches))};return e?.addEventListener("change",n),e?.matches&&t(Boolean(e.matches)),()=>{e?.removeEventListener("change",n)}}),[]),e},ke={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Ie=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&ke[n],t),children:e}):null,Te=d((({className:e,version:t="primary",defaultPadding:n,padding:i="",title:a,buttons:r,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:x,...y})=>{const b=Se(),v=M(),N=l((()=>v.back()),[]),w=y.options?.page?.common?.backwardButton,C=f&&!b;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",i||n,e),children:[C&&Ce({version:t,handleClick:N,text:w}),a?o("div",{className:"relative h-full",children:a}):null,c("div",{className:u("grow relative flex flex-col @xl:flex-row gap-3xl w-full",{"self-start @xl:w-auto":s}),children:[Ie(s,{imageAlign:m,className:"mx-auto"}),c("div",{className:u("grid gap-3xl items-center md:items-stretch",{"@xl:grid-cols-2 auto-cols-fr":d,grow:!s},"h-full","auto-rows-[max-content_1fr]"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[h,x]}),Pe(D({...y,extraProps:{className:"@container-normal"}})),Ie(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Be(p)]:r,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),r?o("div",{className:"self-end",children:r}):null]})]})]})})),Be=e=>u(e?"row-span-2":"@xl:row-span-2"),Pe=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Re=(e,t="normal")=>e?.icon||e?.src?o("div",{className:u("sm:w-12 sm:h-12 sm:min-w-12 w-11 h-11 min-w-11 box-border flex items-center justify-center rounded-icon","normal"===t?"bg-secondary-light text-primary-main":"bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black"),children:o(ne,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,De=d((e=>{const{__html:t="",richVersion:n="",itemSize:i="list-m",isDotted:a=!0}=e,l=a?"":"without-dots";return t&&"<p><br></p>"!==t.replace(/<\/?[^>]+\/?>/g,"").trim()?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(n,i,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",l),dangerouslySetInnerHTML:{__html:t}})}):null})),Me=(e,t)=>e?o(C,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,_e=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),Ae=(e,t)=>e?o(_e,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,Ee=(e,t)=>["label"in e?Ae(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Me(e.description,t)},String(t)):null,"__html"in e?o(De,{...e},`rte-${t}`):null],ze=d((({className:e,benefitsVersion:t,...n})=>c("div",{className:u("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in n?Re(n.icon,t):null,o("div",{children:Ee(n)})]}))),Fe=d((({className:e,benefitsVersion:t="normal",benefits:n})=>n?.length?o("div",{className:u("flex gap-x-m gap-y-s flex-col",e),role:"list",children:n.map(((e,n)=>o(ze,{benefitsVersion:t,...e},String(n))))}):null)),Ve=d((({className:e,benefits:t})=>t?.length?o("div",{className:u("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap(Ee)}):null)),Oe=d((({isTabularBenefits:e,...t})=>o(e?Ve:Fe,{...t}))),Le=e=>Boolean(e?.src||e?.icon),je=(e,{className:t,buttonClassName:n,isVertical:i}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",i?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m w-full @lg:w-auto",t),role:"group",children:e.map(qe(n))}):null,qe=(e="")=>(t,n)=>{const{text:i,icon:a,iconRight:l,version:r,...s}=t||{},c=$e(a,r),d=$e(l,r);return i||a?.icon?o(ve,{className:u("basis-full @lg:basis-auto",e),appendLeft:Ue({...a,iconVersion:c}),appendRight:Ue({...l,iconVersion:d}),version:r,text:i,...s},n?String(n):""):null},$e=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},Ue=e=>Le(e)&&o(ne,{image:e,width:String(e?.size?.width||24),height:String(24)}),We=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),He=d((({priceList:e})=>e?.length?o("div",{className:"flex flex-wrap xl:flex-nowrap xl:bg-main-divider xl:rounded-md p-xs gap-xl",role:"list",children:e.map(Ye)}):null)),Ye=({label:e,amount:t,unit:n},i)=>c("div",{className:"basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg sm:rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(_e,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?c("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[We(2)(t)," ",n||"₽"]}):null]},String(i)),Ke=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(Ge)}):null)),Ge=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(_e,{size:"text-m",font:"font-light",children:e})},String(t)),Xe={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},Je=d((({className:e,padding:t,defaultPadding:n,title:i,description:a,headlineVersion:l="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:d,isDotted:m=!0,benefits:u,__html:h,richVersion:p,isFullWidthTitle:g,priceList:f=[],tags:x=[],buttons:y,image:b,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:C=!1}={},backwardButton:S,children:I,...T})=>{const B=b?.src?o(ne,{image:b}):null,P=o(k,{title:i,description:a,headlineVersion:l,align:r,isEmbedded:!0}),R=u?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Te,{className:e,padding:t,defaultPadding:n,...g?{title:P}:{insetTitle:P},...Ze(B,N),isImageSecondary:C,imageAlign:v,isImageAlwaysOnRight:w,buttons:je(y),backwardButton:S,...T,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[R?.length?o(Oe,{benefitsVersion:s,isTabularBenefits:d,benefits:R}):null,h?o(De,{richVersion:p,__html:h,isDotted:m,itemSize:Xe[l]}):null,I,f?.length?o(He,{priceList:f}):null,Qe(x)]})})})),Ze=(e,t)=>t?{rightImage:e}:{leftImage:e},Qe=e=>e?.length?o(Ke,{tags:e}):null;class et{_;constructor(e){this._=e}of(e){return new this.constructor(e instanceof et?e._:e)}filter(e){return this.from(this.entries().filter(e))}map(e){return this.from(this.entries().map(e))}flatMap(e){return this.from(this.entries().flatMap(e))}reduce(e,t){return this.entries().reduce(e.bind(this),t)}}const tt=()=>!0,nt=(e,t)=>(...n)=>e(...n)&&t(...n),it=(...e)=>(...t)=>{const[,n]=function(e){if(!e)throw new Error("Value should be fulfilled");return e}(e.find((([e])=>e(...t))));return n(...t)};const at=e=>Boolean(e&&Array.isArray(e)),lt=e=>Boolean(e&&"object"==typeof e&&!at(e)),rt=e=>e;function st(e){return e instanceof et?e._:e}class ot extends et{from(e){return this.of(e.map(((e=rt)=>([,t])=>e(t))(st)))}entries(){return(this._??[]).map(((e,t)=>[t,this.of(e)]))}size(){return this._?.length??0}get(e){return this.of("number"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of(at(this._)?Array.from({length:Math.max(this._.length,Number(e)+1)},((n,i)=>i===e?t:this._[i])):Array.from({length:Number(e)+1},((n,i)=>i===e?t:void 0)))}}class ct extends et{from(){return this}entries(){return[]}size(){return 0}get(e){return this.of(void 0!==e?void 0:this._)}set(e,t){return this.of(t)}}class dt extends et{from(e){return this.of(Object.fromEntries(e.map((([e,t])=>[e,st(t)]))))}entries(){return Object.entries(this._??{}).map((([e,t])=>[e,this.of(t)]))}size(){return Object.keys(this._??{}).length}get(e){return this.of("string"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of({...this._,[e]:t})}}class mt extends et{proto=it([e=>at(this._)||"number"==typeof e,()=>ot.prototype],[e=>lt(this._)||"string"==typeof e,()=>dt.prototype],[tt,()=>ct.prototype]);from(e){return this.proto(void 0).from.call(this,e)}entries(){return this.proto(void 0).entries.call(this)}size(){return this.proto(void 0).size.call(this)}get(e){return this.proto(e).get.call(this,e)}set(e,t){return this.proto(e).set.call(this,e,t)}}const ut=e=>e instanceof et?e:new mt(e),ht=e=>{const t=(t,...n)=>st(e(ut(t),...n));return t.fn=e,t},pt=[],gt=e=>e instanceof Function?e:t=>e===t,ft=e=>(t,n,i=pt)=>ut(t).entries().reduce(((t,[n,a])=>ft(e)(a,t,i.concat(n))),e(n,[i,ut(t)])),xt=ht(((e,[t,n])=>{const[i,...a]=t;return e.set(i,a.length?xt(e.get(i),[a,n]):n)})),yt=ht(((e,t)=>t.reduce(xt.fn,e))),bt=e=>ft(((e,[t,n])=>vt(n)?[...e,[t,st(n)]]:e))(e,[]),vt=e=>0===e.size();ht(((e,t=pt)=>t.reduce(((e,t)=>e.get(t)),e)));const Nt=ht(((e,[t,...n])=>n.length?e.set(t,Nt(e.get(t),n)):e.filter((([e])=>e!==t)))),wt=(Ct=["$ref"]).map(((e,t)=>n=>gt(e)(n[t+n.length-Ct.length]))).reduceRight(nt,tt);var Ct;const St=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(kt,e),kt=it([at,(e,t)=>e[parseInt(t,10)]],[lt,(e,t)=>e[t]],[tt,rt]),It=(e,t)=>((e,t={})=>n=>yt(t,bt(n).map((t=>e(t)))))((([e,n])=>{return wt(e)?[(i=e,i.slice(0,-1)),St(t(n),n)]:[e,n];var i}))(e),Tt=e=>bt(e).filter(((e=rt)=>([t])=>e(t))(wt)),Bt=e=>{return t=Tt(e).map((([,e])=>e)),[...new Set(t)];var t};async function Pt(e,t){try{return e?await Rt(e,t):null}catch(e){console.error(e)}return null}const Rt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),Dt=e=>[...new Set(e)],Mt={},_t=["/portal-resources"],At=(e,t)=>It(e,(e=>t?.[e])),Et=(e,t)=>{const n=Bt(e),[l,r]=i({});return a((()=>{n.length&&(async e=>Object.fromEntries((await Promise.allSettled(Dt(e).filter((e=>!_t.some((t=>e.startsWith(t))))).map((async e=>[e,Mt[e]||=await Rt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(n).then(r)}),[n.join()]),n.length?At(e,{...t,...l}):e};function zt(e,t={}){const n=d((t=>{const n=Et((({block:e,options:t,className:n,defaultPadding:i,padding:a,isTheme:l,version:r,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const Ft=zt((({className:e,padding:t,defaultPadding:n,...i})=>o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...i,children:o(Je,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...i})})),{childrenTypes:["UnitBlock"]}),Vt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>Ot(0,t?.length)),[t]),i=t?.[n];return i?o(Ft,{suppressHydrationWarning:!0,...i,...e}):o(g,{...e,children:o(f,{})})})),Ot=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),Lt=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),i=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getFullYear());return t?`${a}-${i}-${n}`:`${n}.${i}.${a}`}},jt=e=>e?.replace(/[^+\d]/g,"");const qt=e=>e?{phone:jt(e)}:{},$t=(e,t="birthday")=>e?{[t]:Lt(e)}:{},Ut=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),Wt=(e,t=!0)=>({[t?"email":"mail"]:e}),Ht=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:jt(e)}:{},Yt=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:i,params:a}of e)t[i??""]?.(n,a)},Kt="rshb-query-params";function Gt(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(Kt)||"";return e&&globalThis.sessionStorage?.setItem(Kt,e),e}function Xt(e){if(!e)throw new Error("Value should be fulfilled");return e}const Jt=e=>t=>{const[,n]=Xt(e.find((([e])=>e(t))));return n(t)},Zt=e=>Jt(e.map((([e,t])=>[e,()=>t])));Zt.if=e=>new Qt(void 0,e);class Qt{parent;predicate;unit;get entry(){return[Xt(this.predicate),Xt(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new Qt(this,e)}then(e){return new Qt(this.parent,this.predicate,e)}else(e){return Jt([...en(this),[()=>!0,e]])}}const en=e=>[...e?.parent?en(e.parent):[],e.entry],tn=e=>{const t=e.target?.closest("a");if(E(t?.href)&&!t?.href?.startsWith(globalThis.location?.origin)){e.preventDefault(),e.stopPropagation();const n=(e=>{const t=Gt();if(!E(e)||!t)return e;const n=new URL(e);for(const[e,i]of new URLSearchParams(t))n.searchParams.set(e,i);return n.toString()})(t?.href)||t?.href;if(n){nn(t?.target)?.(n)}}},nn=Zt([[e=>"_blank"===e,e=>globalThis.open(e,"_blank")],[e=>"_parent"===e,e=>globalThis.parent&&(globalThis.parent.location.href=e)],[e=>"_top"===e,e=>{globalThis.top&&(globalThis.top.location.href=e)}],[()=>!0,e=>globalThis.location&&(globalThis.location.href=e)]]);function an(){return an._impl()}an._impl=()=>({forwardQuery:tn}),an.setup=e=>{an._impl=e};const ln=e=>e,rn=(e,{resetOnSubmit:t,onSubmit:n,normalize:r}={})=>{const[s,o]=i(e),c=l(r?e=>o(e instanceof Function?t=>{const n=r(e(t));return sn(t,n)?t:n}:r(e)):o,[r]);a((()=>{r&&o(r)}),[r]);const[d,m]=i(!1),[u,h]=i({}),p=l(((e,t)=>{const{parse:n=ln,format:i=ln}=t||{};return{value:i(s[e]),isDirty:d||u[e],onChange:t=>{c((i=>({...i,[e]:n(t)}))),h((t=>({...t,[e]:!0})))}}}),[c,d,u]),g=l((e=>{c(e),h(e)}),[]),f=l((()=>{c(e),m(!1),h({})}),[e]),x=l((e=>(e.preventDefault(),t?f():m(!0),n&&n(s,e),s)),[n,s]);return[s,{isDirty:d||Object.values(u).some(Boolean),field:p,update:g,reset:f,onSubmit:x}]},sn=(e,t)=>e&&t&&Object.keys({...e,...t}).every((n=>e[n]===t[n])),on=d((e=>{const{className:t,title:n,children:i,...a}=e;return o(g,{className:t,defaultPadding:"p-6xl",...a,children:c("div",{className:"container max-w-[978px] space-y-lg",children:[n?o(w,{headingType:"h3",title:n,className:"@xl:text-center"}):null,i]})})})),cn=e=>"OUTSERVICE"===e?"/api/v1/outservice/outserviceregions":void 0;function dn(e=!1){const[t,n]=i(e),a=l((()=>n(!0)),[]),r=l((()=>n(!1)),[]),s=l((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:a,setFalse:r,toggle:s}]}function mn(e,t,n,i){a((()=>{if(e&&n)return e.addEventListener(t,n,i),()=>{e.removeEventListener(t,n,i)}}),[e,t,n])}function un(e){const t=s(null),n=l((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return mn(globalThis.document,"click",n),t}const hn=({label:e,errors:t})=>e&&t?`${e}*`:e,pn=()=>{},gn="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",fn=e=>e?o(_e,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,xn=d((({key:e,className:t="",id:n,name:i,type:r="text",label:d,placeholder:m,value:h="",valid:p=!0,children:g,onChange:f,onFocus:x,onBlur:y,pattern:b,autoFocus:v=!1,isTextarea:N=!1,disabled:w=!1})=>{const C=s(null),S=l((e=>{const t=(e.target?.value||"").trimStart();f&&f(t)}),[f]);a((()=>{v&&C.current?.focus()}),[v,C]);const k=g?"pr-3xl":"",I=yn(p);return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[fn(d),N?o("textarea",{className:u("block resize-y min-h-24",bn,I),id:u("textarea",n),name:i||n,placeholder:m,value:h,onChange:S,onFocus:x,onBlur:y,disabled:w},e):o("input",{type:r,className:u("h-14",bn,k,I),ref:C,id:n,name:i||n,placeholder:m,value:h,onChange:S,onFocus:x,onBlur:y,pattern:b,disabled:w},e)]}),g]})})),yn=e=>e?gn:"border-error",bn="w-full border rounded-md text-primary-text outline-none p-m",vn=e=>o("div",{className:"h-6",children:e?o(_e,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),Nn=e=>e?.value||"",wn={url:"suggest/address"},Cn={name:{url:"suggest/fio",requestData:{parts:["NAME"],gender:"UNKNOWN"}},surname:{url:"suggest/fio",requestData:{parts:["SURNAME"],gender:"UNKNOWN"}},middleName:{url:"suggest/fio",requestData:{parts:["PATRONYMIC"],gender:"UNKNOWN"}},email:{url:"suggest/email"},dulSubdivisionCode:{url:"suggest/fms_unit",responseItemHandler:e=>e?.data?.code?.replace("-","")||""},dulIssuedBy:{url:"suggest/fms_unit"},organizationName:{url:"suggest/party"},inn:{url:"suggest/party",responseItemHandler:e=>e?.data?.inn||""},addressRegistration:wn,addressFact:wn,organizationAddress:wn,addressCourier:wn},Sn=()=>({open:(e,t)=>de.fire("popup",{type:"open",popup:e,...t}),update:(e,t)=>de.fire("popup",{type:"update",popup:e,...t}),close:()=>de.fire("popup",{type:"close"})}),kn=d((({options:e,onChange:t})=>o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",children:e?.map(((e,n)=>o("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem",onMouseDown:()=>t(e),children:o("span",{className:"min-h-6",children:e.processedValue})},n.toString())))})));function In({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=i([]),f=Sn(),x=Cn[n],y=l((()=>{h.current=t,f.close()}),[t]),b=l((e=>{y(),h.current=e.processedValue,c&&c(e.processedValue),d&&d(e)}),[y,c]),v=s(null),N=r((()=>async e=>{if(!x)return;const t=await(e=>{const{url:t,query:n,queryPrefix:i,requestData:a={},responseItemHandler:l=Nn}=e,r=(s=l,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${i?`${i}, `:""}${n}`;return fetch(`/api/v1/suggestions/${t}`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:10,...a,query:o})}).then((e=>e.json())).then(r)})({url:x.url,responseItemHandler:x.responseItemHandler,requestData:{...x?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=r((()=>((e,t=600)=>{let n;const i=(...a)=>{i.dispose(),n=setTimeout((()=>{e(...a)}),t)};return i.dispose=()=>{n&&clearTimeout(n)},i})(N,300)),[N]);return a((()=>{if(!e||!v.current||h.current===t)return void y();const n=v.current,{top:i,left:a,width:l,height:r}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.update(o(kn,{options:p,value:t,onChange:b}),{top:i+globalThis.scrollY+r,left:a,width:l})}),[e,p,t,b]),v}const Tn=d((({className:e,label:t,value:n="",placeholder:i,error:a,errors:r,onChange:s=pn,onDaDataChange:d,onBlur:m,isTextarea:h,type:p,name:g="",daDataQueryPrefix:f,maxLength:x,dadata:y=!1,disabled:b=!1})=>{const[v,{setFalse:N,setTrue:w}]=dn(),C=un(N),S=l((e=>{y&&!v&&w(),x?e.length<=x&&s(e):s(e)}),[y,v,s]),k=In({isOpen:v&&y,name:g,value:n,daDataQueryPrefix:f,onChange:s,onDaDataChange:d});return c("div",{className:u("shrink-0 w-full",e),ref:C,onBlur:N,onFocus:w,children:[o("div",{ref:k,children:o(xn,{disabled:b,type:p||"text","aria-label":t,label:hn({label:t,errors:r}),valid:Boolean(!a),value:n,onChange:S,onBlur:m,isTextarea:h,placeholder:Bn(i,r,t)})}),vn(a)]})})),Bn=(e,t,n)=>t&&!n?`${e}*`:e,Pn=e=>e?.text||e?.key||"",Rn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Dn=d((({popupRef:e,options:t,value:n,query:i,onChange:a,iconVersion:l})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",ref:e,children:Rn(t,i).map((e=>c("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem","aria-selected":e.key===n?.key,onClick:t=>{t.stopPropagation(),a&&a(e)},children:[o("span",{className:"min-h-6",children:Pn(e)}),o(W,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:l,className:u("absolute right-4 pt-3xs",{hidden:e.key!==n?.key})})]},e.key)))}):null));const Mn=d((({className:e,label:t,options:n=[],value:r,valid:d=!0,isBorder:m=!0,placeholder:h="",isSearch:p=!1,iconVersion:g="black",onChange:f,disabled:x=!1})=>{const[y,{setFalse:b,setTrue:v}]=dn(),[N,w]=i(""),C=En(x,n.length),S=y&&!C,k=l((()=>{w(""),b()}),[]),I=function({isOpen:e,options:t,value:n,query:i,onChange:r,onClose:c,iconVersion:d}){const m=Sn(),u=l((()=>{m.close(),c&&c()}),[c]),h=l((e=>{u(),r&&r(e)}),[u,r]),p=s(null),g=un(u);return a((()=>{if(!e||!p.current)return;const a=p.current,{top:l,left:r,width:s,height:c}=a.getBoundingClientRect();m.update(o(Dn,{popupRef:g,options:t,value:n,query:i,onChange:h,iconVersion:d}),{top:l+window.scrollY+c,left:r,width:s})}),[e,t,n,i,h]),p}({isOpen:y,options:n,value:r,query:N,onChange:f,onClose:k,iconVersion:g});return c("div",{className:u("space-y-xs",e),children:[fn(t),c("div",{className:u("relative",S?"z-20":"z-10"),ref:I,children:[c("div",{className:u("h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden",An(m,d,C)),onClick:S?k:v,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:Pn(r)||h}),_n(S,g)]}),p&&S?o("div",{className:u("absolute top-0 w-full z-20"),children:o(xn,{type:"text",autoFocus:!0,value:N,onChange:w})}):null]})]})})),_n=(e,t)=>o(W,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),An=(e,t,n)=>u(e?"border rounded-md ":"",e&&!n?"hover:border-primary-hover":"",n?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),En=(e,t)=>e||0===t,zn=d((({className:e="",label:t,error:n,errors:i,...a})=>c("div",{className:e,children:[o(Mn,{...a,valid:!n,label:hn({label:t,errors:i})}),vn(n)]}))),Fn=e=>!e?.length,Vn=e=>t=>n=>e(n)?[]:[t],On=Vn((e=>null!=e&&""!==e)),Ln="Некорректно заполненное поле",jn="Укажите регион, город/населенный пункт, улицу, дом",qn=e=>On(e??Ln),$n=e=>Vn((e=>e?.key&&""!==e?.key))(e??Ln),Un=e=>Vn((e=>"string"==typeof e&&e.length>0&&e.length<=2))(e??Ln),Wn=e=>Vn((e=>"string"==typeof e&&e.length>1&&ei(e)))(e??Ln),Hn=(e,t)=>Vn((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??Ln),Yn=e=>Vn((e=>"string"==typeof e&&6===e.length))(e),Kn=e=>{return(t=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,Vn((e=>"string"==typeof e&&t.test(e))))(e);var t},Gn=Vn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),Xn=e=>{const t=String(e).replace(/[^0-9]+/g,"");if(11===t.length){let e=0;for(let n=0;n<9;n++)e+=parseInt(t.charAt(n))*(9-n);return e>101&&(e%=101),100!==e&&101!==e||(e=0),e===parseInt(t.substr(9))}return!1},Jn=e=>Boolean(e.region&&e.city&&e.house),Zn=()=>Vn(Jn)(jn),Qn=/^[\u0400-\u04FF\d]+$/u,ei=(e="")=>Qn.test(e),ti={typeForm:qn(),surname:Wn("Укажите свою фамилию"),name:Wn("Укажите своё имя"),middleName:Wn("Укажите своё отчество"),region:$n(),addressBranch:$n(),phone:Kn("Укажите номер телефона"),secondaryPhone:Kn("Укажите номер телефона"),organizationPhone:Kn("Укажите номер телефона"),birthday:qn("Укажите дату рождения"),birthPlace:qn("Укажите место рождения"),education:qn("Выберите ваше образование"),housing:qn("Выберите тип жилья"),employment:qn("Выберите информацию о трудоустройстве"),organization:qn("Выберите тип организации"),amountWorkers:qn("Выберите информацию о количестве сотрудников"),employerActivities:qn("Выберите вид деятельности организации"),employerOrganization:qn("Выберите вид организации"),positionOrganization:qn("Выберите вашу должность"),dulSerie:(ni="Укажите серию паспорта",Vn((e=>"string"==typeof e&&4===e.length))(ni)),dulNumber:Yn("Укажите номер паспорта"),dulIssueDateField:qn("Укажите дату выдачи паспорта"),dulSubdivisionCode:Yn("Укажите код подразделения"),dulIssuedBy:qn("Укажите организацию, выдавшую паспорт"),email:(e=>Vn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(e))("Укажите электронную почту"),fullName:Wn(),inn:(e=>Vn((e=>"string"==typeof e&&(10===e.length||12===e.length)))(e))("Укажите ИНН"),legalForm:qn("Укажите ОПФ"),organizationName:qn("Укажите наименование организации"),generalSeniority:Un("Укажите количество лет стажа"),lastJobExperience:Un("Укажите стаж на последнем месте работы"),experience5Years:Un("Укажите общий стаж за последние 5 лет"),jobsNumber:Un("Укажите количество мест работы за последние 5 лет"),beginDate:qn("Укажите дату заключения трудового договора"),addressFact:Zn(),partnerComments:qn(),collectionCount:qn(),comment:qn(),acquiringType:$n(),feedbackMethod:$n(),serviceType:$n(),serviceDirection:$n(),regionRetail:$n("Выберите регион"),meetingDay:qn(),product:qn(),localities:qn(),consentDataProcessing:Gn,annualRevenue:qn(),consentToReceiveMaterials:Gn,processPersonalDataFlg:Gn,consentProviderFlg:Gn,consentPfrFlg:Gn,consentOthersFlg:Gn,consentInformFlg:Gn,familyStatus:qn("Выберите семейное положение"),children:Hn(2,"Укажите количество детей"),familyMembers:Hn(2,"Укажите количество членов семьи"),dependents:Hn(2,"Укажите количество иждивенцев"),totalIncome:Hn(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:Hn(10,"Укажите сумму обязательных выплат"),snils:(e=>Vn(Xn)(e))("Некорректный номер СНИЛС"),conscription:qn(),armyIdFlg:Gn,sex:qn("Укажите свой пол"),addressRegistration:Zn(),organizationAddress:Vn((e=>Boolean(e.fiasCode&&e.city&&e.house)))(jn),participantDateRegistration:qn("Укажите дату регистрации"),retirementIncome:qn(),otherIncome:qn(),wages:qn(),mandatoryPayments:qn(),disablePeopleFlg:qn(),bankruptcyFlg:qn(),shareholderFlg:qn(),legalEntityName:qn(),bankEmployeeCode:qn(),partInBusiness:qn(),addressRetail:$n("Выберите адрес банка"),addressMatch:qn(),codeWord:(e=>Vn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&ei(e)))(e??Ln))("Необходимо ввести кодовое слово"),confirmationIncome:qn(),deliveryDate:qn("Укажите дату доставки"),addressCourier:Zn()};var ni;const ii=e=>{const t=(e=>Object.values(e.filter((e=>e)))?.map((e=>e.name)))(e.filter((e=>Boolean(e?.required))));return Object.fromEntries(t.map((e=>[e,ti?.[e||""]])).filter((([,e])=>e)))},ai=(e,t)=>{const{value:n,isDirty:i}=e,a=i?t(n):[];return{...e,errors:a,error:a[0]}},li=(e,t,n=!1)=>n&&t?ai(e,t):e,ri=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],si=d((({field:e,input:t})=>o(zn,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:ri,...li(e("acquiringType"),ti.acquiringType,t?.required)}))),oi=(e="")=>Boolean("trade"===e||"all"===e),ci=e=>null!=e,di=new Map,mi=e=>Boolean(e?.every((e=>Array.isArray(e)?mi(e):!e||"string"==typeof e))),ui=e=>mi(e)?e.toString():"";function hi(e,t,{fallback:n,cache:l}={}){const s=r((()=>pi(e)),[e]),[o,c]=i(void 0),[d,m]=i(void 0);a((()=>{if(!s.some(ci))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await((e,t=di)=>n=>{const i=ui(n),a=t.get(i);if(i&&ci(a))return a;const l=e(...n);return i&&ci(l)&&t.set(i,Promise.resolve(l)),l})(t,l)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,l,s]);const u=n&&(e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]))(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function pi(e){return Array.isArray(e)?e:e instanceof Function?pi(e()):[e]}const gi=[];const fi=async e=>await Pt(e,{method:"GET"})||gi;function xi(e=!1){const{data:t}=hi("/api/v1"+(e?"/premiumBranchesByRegions":"/branchesByRegions"),Rt);return Array.isArray(t)?t:[]}const yi=d((({field:e,input:t,isPremium:n=!1})=>{const i=e("region"),l=i?.value?.key,r=i?.value?.text,s=n?xi(n)?.find((e=>e?.region===r))?.branches:function(e){const{data:t}=hi(e?`/api/v1/branches?regionCode=${e}`:null,fi);return t||gi}(l)?.filter((e=>e?.address));return a((()=>{""!==i?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[i?.value]),o(zn,{label:"Отделение",placeholder:"Выберите отделение",options:(s||[]).map((({address:e=""})=>({key:e,text:e}))),...li(e("addressBranch"),ti.addressBranch,t?.required),isSearch:!0})})),bi=d((({field:e,input:t})=>{const n="addressFact",i=e(n).value,{value:r}=e("addressMatch");a((()=>{r&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[r,e("addressRegistration").value]);const s=l((t=>{e?.(n)?.onChange?.({apartment:t?.data?.flat,city:t?.data?.city,district:t?.data?.area_with_type,fullAddress:t?.value,fiasCode:t?.data?.fias_id,house:t?.data?.house,locality:t?.data?.settlement_with_type,okatoRegionCode:t?.data?.okato,postcode:t?.data?.postal_code,region:t?.data?.region,regionCode:t?.data?.region_kladr_id?t?.data?.region_kladr_id.substring(0,2):"",street:t?.data?.house,qc:t?.data?.qc,qcComplete:t?.data?.qc_complete,qcHouse:t?.data?.qc_house})}),[]),c=l((t=>{e?.(n)?.onChange?.({...e(n).value,fullAddress:t})}),[]);return o(Tn,{label:"Адрес",disabled:r,...li(e(n),ti[n],t?.required),value:i.fullAddress,onChange:c,...t,onDaDataChange:s})})),vi=(e,t)=>Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t).value,Ni=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",i=e(n).value,a=l((t=>{e?.(n)?.onChange?.({apartment:t?.data?.flat,city:t?.data?.city,district:t?.data?.area_with_type,fullAddress:t?.value,fiasCode:t?.data?.fias_id,house:t?.data?.house,locality:t?.data?.settlement_with_type,okatoRegionCode:t?.data?.okato,postcode:t?.data?.postal_code,region:t?.data?.region,regionCode:t?.data?.region_kladr_id?t?.data?.region_kladr_id.substring(0,2):"",street:t?.data?.house,qc:t?.data?.qc,qcComplete:t?.data?.qc_complete,qcHouse:t?.data?.qc_house})}),[]),r=l((t=>{e?.(n)?.onChange?.({...e(n).value,fullAddress:t})}),[]);return o(Tn,{disabled:t?.filledByEsia&&vi(e,n),label:"Адрес",...li(e(n),ti[n],t?.required),value:i.fullAddress,onChange:r,...t,onDaDataChange:a})})),wi=d((({className:e,viewBox:t,fill:n="none",width:i,height:a,paths:l,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:i,height:a,children:l.map((({d:e,fill:t,...n},i)=>{const a={...r,...n};return o("path",{d:e,fill:t||"currentColor",stroke:a.stroke,strokeLinecap:a.strokeLinecap,strokeLinejoin:a.strokeLinejoin,strokeWidth:a.strokeWidth,strokeMiterlimit:a.strokeMiterlimit},i)}))}))),Ci="appearance-none w-5 h-5 border-solid flex-none",Si=[{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"}],ki=d((({className:e,value:t,text:n,disabled:i,isRadio:a,onChange:r})=>{const s=l((e=>{i||(e.preventDefault(),r&&r(!t))}),[r,i,t]),d=a?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(wi,{paths:Si,className:"absolute left-1 ml-px block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"});return o("div",{className:e,children:c("label",{className:u("flex items-center relative group/box",Ti(i)),onClick:s,children:[o("div",{className:u(Ci,"m-0",a?"rounded-full border-2":Pi(t),!i&&t?"border-primary-main":"border-gray",i?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:Bi(a),"aria-checked":Boolean(t),"aria-disabled":Boolean(i),"aria-label":n}),t?d:null,Ii(n)]})})})),Ii=e=>e?o("div",{className:"ml-s",children:o(_e,{size:"text-l",font:"font-light",children:e})}):null,Ti=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",Bi=(e=!1)=>e?"radio":"checkbox",Pi=(e=!1)=>u("rounded border",{"bg-primary-main":e}),Ri=d((({className:e,text:t,value:n,key:i,disabled:a,error:l,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(ki,{text:t,value:n,disabled:a,onChange:r},i),vn(l)]}))),Di=d((({field:e,input:t})=>o(Ri,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...li(e("addressMatch"),ti.addressMatch,t?.required)}))),Mi=d((({color:e="text-primary-main",position:t="absolute",blur:n=!0})=>o("div",{className:u("flex justify-center items-center h-full w-full z-50",t,{"backdrop-blur":n}),children:o("div",{className:u("inline-block h-28 w-28","animate-spin rounded-full","border-8 border-solid border-current","border-r-transparent",e),role:"status"})}))),_i="/icons/MapMarkerClusterIcon.svg",Ai="/icons/MapMarkerClusterYellowIcon.svg";function Ei({yandexMaps:e,map:t,points:n,isLoad:i}){if(i||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const a=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),l=zi("offices",e,a);if(n.length&&n.every((e=>"type"in e))){const i=zi("workplaces",e,a),r=Fi(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=Fi(n.filter((e=>"offices"===e.type)),"offices",e);l.add(s),i.add(r),t.geoObjects.add(i),t.geoObjects.add(l)}else{const i=Fi(n,"offices",e);l.add(i),t.geoObjects.add(l)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const zi=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?_i:Ai,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),Fi=(e,t,n)=>e.map((({coords:e,content:i})=>new n.Placemark(e,{balloonContentHeader:i?.header,balloonContentBody:i?.body,balloonContentFooter:i?.footer,hintContent:i?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?_i:Ai,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),Vi={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},Oi={...Vi,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},Li=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(Oi).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(W,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),ji=e=>globalThis[e];function qi(e,t,n=!0){const[l,r]=i(void 0);return a((()=>{let i=!0;return((e,t)=>{const n=document.getElementById(t);if(n){const t=ji(e);return t?Promise.resolve(t):new Promise((t=>{n.addEventListener("load",(()=>{t(ji(e))}))}))}return new Promise(((n,i)=>{const a=document.createElement("script");a.src=t,a.async=!0,a.id=t,a.addEventListener("load",(()=>{n(ji(e))})),a.addEventListener("error",(e=>{i(e)})),document.head.appendChild(a)}))})(e,t).then((e=>{i&&r(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(i=!1,n){const e=document.getElementById(t);e&&document.head.removeChild(e),r(void 0)}}}),[e,t,n]),l}const $i={...Vi,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},Ui=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),i="in"===t?n+1:n-1;e.current.setZoom(i,{checkZoomRange:!0})},className:`${Object.values($i).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(W,{name:n,width:"20",height:"16"})})})),Wi=[55.753995,37.614069],Hi=d((({points:e,className:t="",zoom:n=5,isLoad:i,selectedAddress:l})=>{const r=s(null),d=s(null),m=qi("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${A.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1);if(a((()=>{r.current?Ei({yandexMaps:m,map:r.current,points:e,isLoad:i}):m?.ready((()=>{r.current||(r.current=new m.Map(d.current,{center:Yi(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),Ei({yandexMaps:m,map:r.current,points:e,isLoad:i})})),r.current&&l&&m?.geocode(l).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();r.current.setCenter(t),r.current.setZoom(18)}))}),[m,e,n,i,l]),!m)return null;const h="z-10";return c("div",{ref:d,className:u("relative","w-full",t),children:[i?o(Mi,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(Ui,{yandexMaps:r}),o(Ui,{yandexMaps:r,direction:"out"})]}),Li(r,m,u("right-2 top-80",h))]})})),Yi=e=>{const t=[Gi(Ki(e,0)),Gi(Ki(e,1))];return t.every((e=>e))?t:Wi},Ki=(e,t)=>e.map((e=>e.coords?.[t])),Gi=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Xi=async(e,t,n)=>{try{return(await Ji(e,t,n)).json()}catch(e){return console.error(e),null}};async function Ji(e,t,n){return globalThis?.fetch?.(`/api/v1${e}`,{method:t,headers:{"Content-Type":"application/json",...Zi()},credentials:"include",body:n?JSON.stringify(n):null})}const Zi=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},Qi=e=>Number(e.toString().replace(",",".")),ea=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:n=!1,renderFoldableSection:a,renderFoldButton:r})=>{const[s,o]=i(n),d=l((()=>{o((e=>!e))}),[]),m=a({isUnfolded:s,onToggle:d}),u=r?r({isUnfolded:s,onToggle:d}):null;return c("div",t?{className:e,role:"group",children:[u,m]}:{className:e,role:"group",children:[m,u]})}));const ta=d((({className:e="",isUnfolded:t,children:n})=>{const i=s(null),l=function(e,t){const n=s(null);return a((()=>{const t=n?.current;if(!t)return;const i=new ResizeObserver((n=>{e(t,n[0])}));return i.observe(t),()=>{i.disconnect()}}),[e,...t]),n}((e=>{i.current&&(i.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:i,className:`transition-max-h duration-300 overflow-hidden ${i.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:l,children:n})})})),na=d((({value:e,subText:t,children:n,isPhone:i,...a})=>{const l=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[l.length,n,t].every((e=>!e))?null:ia({textItems:l,subText:t,children:n,isPhone:i,...a})})),ia=({label:e,labelSize:t="text-m",textItems:n,subColor:i,subText:a,className:l,children:r,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",l),children:[e?o(_e,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||aa(n,s),a?o(_e,{color:i,size:"text-m",children:a}):null]}),aa=(e,t)=>e.filter(Boolean).map(((e,n)=>o(_e,{size:"text-l",children:t?o("a",{href:`tel:${la(e)}`,children:e.trim()}):e.trim()},String(n)))),la=e=>e.replace(/\D/g,""),ra=d((({className:e,children:t})=>o("div",{className:u("flex flex-col sm:flex-row sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),sa=e=>{const t=ca(e);return o(na,{label:"Режим работы",value:t,className:"max-w-none"})},oa=({workTime:e="",lunchHour:t="",daysOff:n=""},i=!1)=>e?[`${i?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",ca=e=>{const t=e.find((e=>"workingSaturday"!==e.key&&Boolean(e.status)&&Boolean(e.workTime))),n=e.find((e=>"workingSaturday"===e.key&&Boolean(e.status)&&Boolean(e.workTime))),i=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[oa({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":i}),oa({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:i},!0)].filter(Boolean)},da=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],ma=e=>da.map((([t,n,i])=>({key:t,title:i,short:n,status:Boolean(e?.[t]),get workTime(){return"workingSaturday"===t?e?.workTimeSaturday:e?.workTime},get lunchHour(){return"workingSaturday"===t?e?.lunchHourSaturday:e?.lunchHour},get hasLunch(){return/\d+/.test(this.lunchHour??"")}}))),ua=e=>{if(!e)return null;const t=ha(e);return c(ra,{className:"border-none",children:[o(na,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(pa)})}),o(na,{label:"Режим работы",className:"max-w-none",children:o(_e,{children:e})})]})},ha=e=>{const t=da.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],i=n[n.length-1]?.toLowerCase();return i?.includes("выходной")?t.map((e=>({...e,status:!i?.includes(e.short.toLowerCase())}))):t},pa=({short:e,status:t},n)=>o("div",{className:u("w-9 h-9 rounded-md flex items-center justify-center",t?"bg-green-more-light text-green-dark":"bg-error/30 text-error"),children:o(_e,{size:"text-xs",children:e})},String(n)),ga=({currency:e,buyExchangeRate:t,saleExchangeRate:n},i)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(na,{label:"Валюта",value:e.currency}):null,t?o(na,{label:"Купить",value:String(t)}):null,n?o(na,{label:"Продать",value:String(n)}):null]},String(i)),fa={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"}},xa=d((({className:e,children:t,color:n="gray"})=>c("div",{className:u("sm:p-s sm:border sm:border-green rounded-md flex items-center h-fit",fa[n].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ne,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(_e,{size:"text-m",color:fa[n].text,children:t})]}))),ya=(new Date).getDay(),ba=e=>{const[t]=e?.slice(ya-1)??[];if(!t)return null;const{lunchHour:n,status:i,workTime:a,hasLunch:l}=t;return i?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[a?o(xa,{color:"green",children:a}):null,n&&l?o(xa,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(xa,{color:"red",children:"Выходной"})},va=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Na=({title:e,status:t,workTime:n,lunchHour:i,hasLunch:a},l)=>o(na,{label:e,value:t&&n?n:"",subText:va({lunchHour:i,hasLunch:a,status:t}),subColor:!t||a?"text-error":"text-green-dark"},String(l)),wa=["ArrowDownIcon","ArrowUpIcon"],Ca=["Подробнее","Скрыть"],Sa=({isUnfolded:e,onToggle:t})=>c("button",{className:"w-full py-2xl cursor-pointer text-primary-main flex items-center border-b border-solid border-main-divider",onClick:t,type:"button",children:[o("div",{className:"pr-m",children:Ca[Number(e)]}),o(W,{className:"text-primary-text",name:wa[Number(e)],width:"16",height:"16"})]}),ka=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,Ia=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,Ta=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,Ba=({name:e,address:t,phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},u)=>{if(!d)return null;const h=ma(d);return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(_e,{size:"text-h4",children:e}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(_e,{size:"text-l",children:t})]}):null]}),ba(h)]}),o("div",{className:"hidden sm:block",children:Pa({phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(ea,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ta,{isUnfolded:e,children:Pa({phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Sa({isUnfolded:e,onToggle:t})})]},String(u))},Pa=({phone:e,fax:t,phoneBusiness:n,phoneNatural:i,phoneCallCentre:a,phoneCurrencyControl:l,workSchedule:r,exchangeRate:s})=>{const d=ma(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(ra,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(na,{label:"Факс",value:t,isPhone:!0}),o(na,{label:"Телефон филиала",value:e,isPhone:!0}),o(na,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(na,{label:"Обслуживание физических лиц",value:i,isPhone:!0}),o(na,{label:"Для консультаций по валютному контролю",value:l,isPhone:!0}),o(na,{label:"Контакт-центр",value:a,isPhone:!0})]}),r?.isMatchesPattern?o(ra,{children:o(na,{label:m,labelSize:"text-l",className:"w-full max-w-none",children:o("div",{className:"flex flex-wrap gap-xs sm:justify-between pt-xs",children:d?.map(Na)})})}):c(ra,{children:[o(na,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(pa)})}),sa(d)]}),r?.businessScheduleVisibleTag?ua(r?.businessScheduleDescription):null,s?.currencies?.length?o(ra,{className:"flex-wrap",children:s?.currencies?.map(ga)}):null]})},Ra=({name:e="",address:t="",workSchedule:n})=>{const i=(a=e)?`${a?.charAt(0)?.toUpperCase()}${a?.slice(1)}`:"";var a;const l=`${t} ${(e=>{const t=ma(e),n=e?ca(t):"",i=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?ka(n):Ta(n,i):Ia(n):""})(n)}`;return{header:i,body:l}},Da=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),Ma=d((({children:e})=>Da?e:null)),_a={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},Aa={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},Ea={workingSaturday:e=>Boolean("workSchedule"in e&&e.workSchedule?.workingSaturday),premiumService:e=>Boolean("premiumService"in e&&e.premiumService),privateBanking:e=>Boolean("privateBanking"in e&&e.privateBanking),remoteWorkplace:e=>Boolean("workScheduleDescription"in e),serviceDisabledPeople:e=>Boolean("serviceDisabledPeople"in e&&e.serviceDisabledPeople),sellingCoins:e=>Boolean("sellingCoins"in e&&e.sellingCoins),buyingCoins:e=>Boolean("buyingCoins"in e&&e.buyingCoins),bullionOperations:e=>Boolean("bullionOperations"in e&&e.bullionOperations),preciousMetalsOperations:e=>Boolean("preciousMetalsOperations"in e&&e.preciousMetalsOperations),transferringDataToBiometricSystem:e=>Boolean("transferringDataToBiometricSystem"in e&&e.transferringDataToBiometricSystem)};function za({disabled:e,onClick:t}){return n=>{!e&&t&&t(n)}}const Fa={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"},Va={primary:u("group-data-secondary:text-primary-main group-data-secondary:bg-white","group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active"),secondary:u("group-data-secondary:text-white group-data-secondary:bg-white/20","group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active")},Oa=d((({children:e,...t})=>{const n=e=>({...e,onClick:ue(za(e))}),{className:i,version:a="primary",active:l,disabled:r,type:s="button",rounded:c=!0,role:d,onClick:m}=n(t);return o("button",{className:u("font-sans px-9 py-4","flex justify-center items-center gap-xs",{"text-white bg-primary-active":l,"bg-main-gray text-main-disabled cursor-not-allowed":r,"rounded-md":c},l||r?"":u(Fa[a],Va[a]),i),type:s,role:d,onClick:m,children:e})})),La=(e,t)=>e&&"underlined"!==t?"primary":"secondary",ja=(e,t,n)=>{const i=La("all"===t),a=La("business"===t),l=(e,t,i)=>{const a=e.currentTarget===e.target&&"business"===t?r(i):i;return n(t),a},r=e=>e.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription));return c("div",{className:"flex gap-lg flex-col sm:flex-row pb-lg",children:[o(Oa,{"data-id":"all",onClick:t=>l(t,"all",e),version:i,children:"Для физических лиц"}),o(Oa,{"data-id":"business",onClick:t=>l(t,"business",e),version:a,children:"Для юридических лиц"})]})},qa=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o(De,{__html:e,richVersion:n})}):null,t?.length?o("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl",children:t.map(((e,t)=>c("div",{className:"flex gap-xs items-center",children:[e?.image?o(ne,{image:e.image}):null,e?.text?o(_e,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,$a="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",Ua=({filters:e,field:{field:t,reset:n},onlyOffice:i,labels:a})=>{const l=i?5:6,r=(e||[]).map((e=>o(ki,{text:a[e],...t(e)},e))),[s,d]=l>0?[r.slice(0,l),r.slice(l)]:[r,[]];return o("div",{children:e?.length?o("div",{children:o(ea,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:$a,children:s}),o(ta,{className:$a,isUnfolded:e,children:d})]}),renderFoldButton:Wa(n,i)})}):null})},Wa=(e,t=!1)=>({isUnfolded:n,onToggle:i})=>c("div",{className:"flex space-x-lg",children:[t?o(ve,{version:"transparent",className:"text-secondary-text [&>*]:p-0",appendRight:o(W,{name:["ArrowDownIcon","ArrowUpIcon"][Number(n)],width:"16",height:"16"}),text:["Больше фильтров","Меньше фильтров"][Number(n)],onClick:i}):null,o(ve,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:e,children:Ha()})]}),Ha=()=>c("div",{className:"flex items-center",children:["Очистить фильтр",o(W,{name:"CloseIcon",width:"16",height:"16",className:"ml-2xs"})]}),Ya=(e,t)=>o("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:c(w,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(_e,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),Ka=()=>{},Ga=e=>"all"===e?"block":"hidden",Xa=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:a=[],renderCard:l=Ka,renderRemoteWorkplaceCard:r=Ka,getBalloon:s=Ka,getBalloonRemoteWorkplaces:d=Ka,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=rn(_a),{filteredItems:y,points:b,filteredRemoteWorkplaces:v,lengthItems:N}=el({data:t,remoteWorkplaces:a,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=i("all"),S={filters:Za([...t,...a]),field:{field:f,reset:x},onlyOffice:p,labels:Aa};return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[Ya(h,N),m?qa(m):null,p&&ja(t,w,C),o("div",{className:u("pb-3xl",Ga(w)),children:Ua(S)})]}),o("div",{className:"h-[600px]",children:o(Ma,{children:o(Hi,{points:b,isLoad:n,className:"h-full"})})})]}),c(Ma,{children:[y.map(l),v.map(r)]})]})})),Ja=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>Ea[t](e)))))},Za=e=>Object.keys(_a).filter((t=>e.filter((e=>Ea[t](e))).length)),Qa=()=>{},el=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:i=Qa,getBalloonRemoteWorkplaces:a=Qa})=>{const[l,s,o,c]=r((()=>{const l=Ja(e,n),r=Ja(t,n),s=[...l.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:i(e)}))),...r.map((e=>({type:"workplaces",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a({address:e.address,workScheduleDescription:e.workScheduleDescription})})))].filter((e=>e.coords&&2===e.coords.length));return[l,s,r,l.length+r?.length]}),[e,t,n,i,a]);return{filteredItems:l,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},tl=e=>{const{data:t,error:n}=hi(`/api/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,nl);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},nl=async e=>await Pt(e,{method:"POST"})||[],il=d((({field:e,input:t})=>{const[n,l]=i([]),{data:r}=tl("REGION_RF"),s=e("regionRetail")?.value||{},d=e("addressRetail");a((()=>{(async()=>{const e=await(async e=>(await Xi("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0}))?.offices?.map((e=>({...e,gpsLatitude:Qi(e.latitude??Wi[0]),gpsLongitude:Qi(e.longitude??Wi[1])})))||[])(s?.key??"");l(e)})(),s?.key&&e?.("addressRetail")?.onChange?.("")}),[s.key]);const{points:m}=el({data:n,filtrationState:{},getBalloon:Ra}),u=Boolean(s?.key);return c("div",{children:[o(zn,{label:"Адрес отделения",placeholder:"Выберите отделение",options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...li(e("addressRetail"),ti.addressRetail,t?.required&&u),isSearch:!0}),o("div",{className:"h-[600px]",children:o(Ma,{children:o(Hi,{points:m,isLoad:!r,className:"h-full",selectedAddress:d?.value?.text})})})]})})),al=(e,{normalize:t,format:n})=>{const{value:a,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=i(!1),m=l((e=>{d(!0),r&&r(e)}),[]),u=l((()=>{d(!1),o&&o(t(a)),s&&s()}),[o,a]);return{value:c||!n?a:n(a),onFocus:m,onBlur:u}},ll=(e,t,n)=>Math.max(t,Math.min(e,n));function rl(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function sl({list:e=[],min:t,max:n,step:i,value:a=e[0]||t,disabled:l,onChange:r}){const s=e.length?e.indexOf(a):a,d={backgroundSize:`${(100*(s>t?s-t:0)/(n-t)).toFixed(2)}% 100%`};return c("div",{children:[e.length?o("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>o("div",{className:u("w-2 h-2 rounded-full",s<=t||l?"bg-gray":"bg-primary-main")},String(t))))}):null,o("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:o("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:d,type:"range",min:t,max:n,step:i,value:s,disabled:l,onChange:t=>{const n=rl(t.target?.value),i=e.length?e[n]:n;r&&r(i||0)}})})]})}const ol=1,cl=100,dl=d((e=>{const{className:t,title:n,items:i=[],list:a=[],min:r=(a.length?0:ol),max:s=(a.length?a.length-1:cl),step:d=1,value:m=a[0]||r,disabled:h=!1,onChange:p}=e,g=al(e,{normalize:(e=0)=>a.length?ml(a)(e):ll(e,r,s),format:We()}),f=l((e=>{p&&p(rl(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(_e,{size:"text-m",font:"font-light",color:"text-primary-text",children:n}):null,o("input",{className:u("text-h3 w-full h-14","pl-m mt-xs box-border","text-primary-text",gn,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),sl({list:a,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),ul(i)]})})),ml=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),ul=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(_e,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),hl=["От 1 000 ₽","До 1 000 000 000 ₽"],pl=d((({field:e})=>o(dl,{title:"Сумма, ₽",items:hl,min:1e3,max:1e9,...e("amount")}))),gl=zt((({field:e,source:t,label:n,fieldName:i,input:a,placeholder:l="Выберите из списка",isSearch:r=!1})=>{const s=t&&t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(zn,{placeholder:l,label:n,options:s,isSearch:r,...li(e(i),ti[i],a?.required)})})),fl=d((({field:e,input:t})=>{const{data:n}=tl("EMPLOYEES_NUMBER");return o(gl,{field:e,source:n,label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),xl=d((({field:e,input:t})=>o(Tn,{label:"Годовая выручка, ₽",...li(e("annualRevenue"),ti.annualRevenue,t?.required)}))),yl=d((({field:e,input:t})=>o(Ri,{text:"Наличие военного билета",...li(e("armyIdFlg"),ti.armyIdFlg,t?.required)}))),bl=d((({field:e,input:t})=>o(Tn,{label:"Код представителя Банка",placeholder:"Введите код",type:"number",...li(e("bankEmployeeCode"),ti.bankEmployeeCode,t?.required),...t}))),vl=d((({field:e})=>o(Tn,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e("bankEmpolee")}))),Nl=d((({field:e,input:t})=>o(Ri,{text:"В отношении меня ведётся производство по делу о банкротстве",...li(e("bankruptcyFlg"),ti.bankruptcyFlg,t?.required)}))),wl=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:i,currentYear:a,min:l,max:r,onDateClick:s})=>{const c=[];let d=1;for(let m=0;m<6;m++){const u=[];for(let c=0;c<7;c++)if(0===m&&c<t)u.push(o("td",{},`empty-${c}`));else if(d>n)u.push(o("td",{},`empty-${c}`));else{const t=new Date(a,i,d),n=Cl(t,e),c=Sl(t,l,r);u.push(o("td",{children:o("div",{className:kl(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},Cl=(e,t)=>t&&e.toDateString()===t.toDateString(),Sl=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),kl=(e=!1,t=!1)=>u("p-s text-center rounded-md border",{"border-transparent hover:bg-gray":!e},t?"text-gray hover:bg-transparent":"cursor-pointer"),Il=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Tl=d((({today:e,currentMonth:t,currentYear:n,min:i,max:a,onDateSelect:s=pn,setValue:d=pn})=>{const m=l((e=>{s(e),d(!1)}),[]),{firstDayOfWeek:u,totalDays:h}=r((()=>({firstDayOfWeek:new Date(n,t,1).getDay()-1,totalDays:new Date(n,t+1,0).getDate()})),[n,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:Il.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:wl({firstDayOfWeek:u,today:e,totalDays:h,currentYear:n,currentMonth:t,min:i,max:a,onDateClick:m})})]})})),Bl=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function Pl(e,t){const n=e.replace(/\D/g,"");if(""===n||e?.length===t.length)return e;const i=[...t],a=i.findIndex(Rl),l=i.map(((e,t)=>Ml(e)?i.slice(0,t).filter(Ml).length:-1)),r=i.map(((e,t)=>Dl(e)?e:n.charAt(l[t])||e)),s=l.indexOf(n.length-1)+1;return r.slice(0,Math.max(a,s)).join("")}const Rl=e=>"_"===e,Dl=e=>/\d/.test(e),Ml=e=>Rl(e)||Dl(e),_l=1940,Al={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},El=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:l,disabled:r,onChange:d,onClick:m})=>{const h=s(null),[p,g]=i(l||"");return a((()=>{g(l||"")}),[l]),c("div",{onClick:()=>{null!==h.current&&h.current.focus(),m?.()},className:u("relative",n),children:[o("input",{ref:h,className:"h-full w-full px-m text-l text-black focus-visible:outline-none",value:p,type:"text",onChange:e=>{const t=e.target?.value;"string"==typeof t&&t?.length<11&&g(Pl(t,"__.__.____"))},onBlur:()=>{if(zl(p)){const[n,i,a]=p.split(".");d?.(new Date(Number(a),Number(i)-1,Number(n))),e(Number(i)-1),t(Number(a))}else g(l||"")},disabled:r}),r?null:o(W,{className:"mr-s",...Al})]})})),zl=e=>{const[t,n,i]=e.split(".");if((e=>Number(e)>=_l&&Number(e)<=(new Date).getFullYear())(i)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(i),Number(n)-1,1);let a=0;for(;e.getMonth()===Number(n)-1;)e.setDate(e.getDate()+1),a++;if(Number(t)>0&&Number(t)<=a)return!0}return!1},Fl=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:i,setSelectedMonth:a,setSelectedYear:l,disabled:r=!1})=>o(El,{onChange:i,disabled:r,onClick:e,value:t&&Lt(t),setSelectedMonth:a,setSelectedYear:l,className:u("flex justify-between items-center h-14 border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",n?"border-gray":"border-error")}),Vl=Bl.map((e=>({key:e}))),Ol=Array.from({length:(new Date).getFullYear()-_l+1},((e,t)=>_l+t)).reverse().map((e=>({key:String(e)}))),Ll=(e,t)=>{const n=new Date(e,t,1);let i=0;for(;n.getMonth()===t;)i++,n.setDate(n.getDate()+1);return i},jl=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:i,onChange:a})=>{i&&a?.(new Date(t,n,Math.min(e,i.getDate())))},ql={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},$l={className:"min-w-32",iconVersion:"black",isBorder:!1},Ul=d((({className:e="",label:t="",value:n,valid:r=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g}]=dn(!1),[f,x]=i(n?.getMonth()||(new Date).getMonth()),[y,b]=i(n?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:v,handleNextMonth:N,handleSelectMonth:w,handleSelectYear:C,monthsOptions:S,yearsOptions:k,handleChangeVisibleCalendar:I,ref:T}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:i,onYearSelect:a,selectedYear:r,onChange:s,value:o})=>{const c=un(l((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:l((()=>e(!t)),[t]),handleNextMonth:l((()=>{n+1<=11?i(n+1):(i(0),a(r+1))}),[n]),handlePrevMonth:l((()=>{n-1>=0?i(n-1):(i(11),a(r-1))}),[n]),handleSelectMonth:l((({key:e})=>{i(Bl.indexOf(e));const t=Ll(r,Bl.indexOf(e));jl({maxDateOfMonth:t,selectedYear:r,selectedMonth:Bl.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:l((({key:e})=>{a(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:Vl,yearsOptions:Ol,ref:c}})({onYearSelect:b,onMonthSelect:x,onShowCalendar:g,selectedYear:y,selectedMonth:f,showCalendar:p,onChange:h,value:n}),B=((e,t)=>{const[n,l]=i(!1);return a((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();l(n>t)}};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e]),n})(T,370);return c("div",{className:u("space-y-xs",e),ref:T,children:[fn(t),c("div",{className:"relative",children:[Fl({handleChangeVisibleCalendar:I,value:n,valid:r,onChange:h,disabled:m,setSelectedMonth:x,setSelectedYear:b}),p&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":B}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:v,children:o(W,{...ql,className:"-rotate-90 cursor-pointer"})}),o(Mn,{onChange:w,value:{key:Bl[f]},options:S,...$l}),o(Mn,{onChange:C,value:{key:String(y)},options:k,...$l}),o("div",{className:"my-auto",onClick:N,children:o(W,{...ql,className:"rotate-90 cursor-pointer"})})]}),o(Tl,{today:n,currentMonth:f,currentYear:y,onDateSelect:h,min:s,max:d,setValue:g})]}):null]})]})})),Wl=d((({className:e,label:t,error:n,errors:i,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Ul,{label:hn({label:t,errors:i}),valid:Boolean(!n),...a}),vn(n)]}))),Hl=d((({field:e,input:t})=>o(Wl,{label:"Дата начала работы на текущем месте",...li(e("beginDate"),ti.beginDate,t?.required),...t}))),Yl="birthday",Kl=d((({field:e,input:t,isRetailForm:n=!1})=>{const{value:i}=e(Yl);return o(Wl,{label:"Дата рождения",...li(e(Yl),ti.birthday,t?.required),error:n&&i&&!Gl(i)?"Допустимый возраст заёмщика - от 23 до 75 лет":"",disabled:t?.filledByEsia&&vi(e,Yl)})})),Gl=e=>{const t=new Date,n=new Date(t.getFullYear()-23,t.getMonth(),t.getDate()),i=new Date(t.getFullYear()-75,t.getMonth(),t.getDate());return!(!e||e>n||e<i)},Xl=d((({field:e,input:t})=>o(Tn,{label:"Место рождения",...li(e("birthPlace"),ti.birthPlace,t?.required),...t,disabled:t?.filledByEsia&&vi(e,"birthPlace")}))),Jl=d((({field:e,input:t})=>{const[n,l]=i([]),r=e("paymentSystem").value;return a((()=>{(async()=>{const e=await(async e=>{const t=await Ji("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemType:e,creditProgramId:13}});return await(t?.json())})(r);l(e)})()}),[r]),o(gl,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t})})),Zl=d((({field:e,input:t})=>o(Tn,{label:"Количество детей до 18 лет",placeholder:"Введите значение",type:"number",...li(e("children"),ti.children,t?.required),...t}))),Ql=d((({field:e,input:t})=>o(Tn,{label:"Кодовое слово",...li(e("codeWord"),ti.codeWord,t?.required),...t}))),er=d((({field:e,input:t})=>o(Tn,{label:"Количество объектов инкассации",type:"number",...li(e("collectionCount"),ti.collectionCount,t?.required)}))),tr=d((({field:e,input:t})=>o(Tn,{className:"col-span-2",...li(e("comment"),ti.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),nr=d((({field:e,input:t})=>{const{data:n}=tl("INCOME_CERT_UNITED");return o(gl,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),ir=d((({field:e,input:t})=>{const{data:n}=tl("MILITARY_STATUS");return o(gl,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),ar={processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3},consentToReceiveMaterials:{text:"Согласен на получение информационных и аналитических материалов по электронной почте"}},lr=async(e,t=!1)=>{const n=await(async(e,t=!1)=>{const n=await Ji(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return n?await n.blob():new Blob})(e,t);return URL.createObjectURL(n)},rr=d((({className:e,onClose:t})=>o("button",{className:u("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",type:"button",children:o(W,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),sr=d((({className:e,head:t,children:n,onClose:i,onClick:a})=>{const{close:r}=me(),s=l((()=>{r(),i&&i()}),[i]);return c("div",{onClick:a,className:u("relative min-h-full bg-white pt-0 p-lg",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(rr,{className:"absolute top-0 right-0",onClose:s}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})})),or=async(e,t,n=!1)=>{const i=await lr(t,n);e(o(sr,{className:"my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0",children:n?o("img",{src:i}):o("iframe",{src:`${i}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"})}))},cr=d((({className:e,error:t,docId:n,...i})=>{const{open:a}=me(),l=Se();return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(ki,{...i}),n?o(ve,{className:"text-primary-main",onClick:()=>or(a,n,l),children:o(_e,{children:"Ознакомиться"})}):null]}),vn(t)]})})),dr=d((({field:e,input:t})=>t&&t.name?o(cr,{text:ar[t.name]?.text,docId:ar[t.name]?.docId,...li(e(t.name),ti[t.name],t?.required)}):null)),mr=d((({field:e,input:t})=>{const{data:n}=tl("CREDIT_IN_RSHB");return o(gl,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком / \n вкладчиком с долей участия более 20% уставного капитала руководителем, \n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t})})),ur={horizontal:"@lg:flex-row",vertical:""},hr=d((({label:e,items:t,value:n,className:i,onChange:a,disabled:l=!1,orientation:r="horizontal"})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(_e,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",ur[r],i),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(ki,{isRadio:!0,text:t,value:n===e,onChange:()=>a&&a(e),disabled:l},String(e))))})]}))),pr=d((({className:e,label:t,onChange:n,error:i,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(hr,{label:hn({label:t,errors:a?.errors}),onChange:e=>n&&n(e),...a}),vn(i)]}))),gr=[{id:"rub",text:"Рубль"}],fr=d((({field:e,input:t})=>{const{value:n,onChange:i}=e("currency");return o(pr,{label:"Валюта",orientation:"horizontal",items:gr,value:n,onChange:e=>i?.(e),...li(e("currency"),ti.currency,t?.required)})})),xr=d((({field:e,input:t})=>o(Wl,{label:"Дата доставки",...li(e("deliveryDate"),ti.deliveryDate,t?.required)}))),yr=d((({field:e,input:t})=>o(Tn,{label:"Количество иждивенцев",placeholder:"За исключение детей до 18 лет",type:"number",maxLength:2,...li(e("dependents"),ti.dependents,t?.required),...t}))),br=d((({field:e,input:t})=>o(Wl,{label:"Желаемая дата встречи",...li(e("desiredMeetingDate"),ti.meetingDay,t?.required)}))),vr=d((({field:e,input:t})=>o(Ri,{text:"Являюсь инвалидом",...li(e("disablePeopleFlg"),ti.disablePeopleFlg,t?.required)}))),Nr="dulIssueDateField",wr=d((({field:e,input:t})=>o(Wl,{label:"Дата выдачи",...li(e(Nr),ti.dulIssueDateField,t?.required),disabled:t?.filledByEsia&&vi(e,Nr)}))),Cr="dulIssuedBy",Sr=d((({field:e,input:t})=>{const{value:n,onChange:i}=e("dulSubdivisionCode"),a=l((e=>{i?.(e?.data?.code?.replace("-",""))}),[]);return o(Tn,{disabled:t?.filledByEsia&&vi(e,Cr),label:"Кем выдан",...t,...li(e(Cr),ti.dulIssuedBy,t?.required),onDaDataChange:a,daDataQueryPrefix:n})})),kr=d((({field:e,input:t})=>o(Tn,{disabled:t?.filledByEsia&&vi(e,"dulNumber"),label:"Номер документа",type:"number",maxLength:6,...li(e("dulNumber"),ti.dulNumber,t?.required)}))),Ir=d((({field:e,input:t})=>o(Tn,{disabled:t?.filledByEsia&&vi(e,"dulSerie"),label:"Серия документа",type:"number",maxLength:4,...li(e("dulSerie"),ti.dulSerie,t?.required)}))),Tr="dulSubdivisionCode",Br=d((({field:e,input:t})=>{const n=l((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(Tn,{disabled:t?.filledByEsia&&vi(e,Tr),label:"Код подразделения",type:"number",maxLength:6,...t,...li(e(Tr),ti.dulSubdivisionCode,t?.required),onDaDataChange:n})})),Pr=d((({field:e,input:t})=>{const{data:n}=tl("EDUCATION_LEVEL");return o(gl,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),Rr=d((({field:e,input:t})=>{const{required:n,...i}=t;return o(Tn,{label:"Электронная почта",...li(e("email"),ti.email,n),...i})})),Dr=d((({field:e,input:t})=>{const{data:n}=tl("ORGANIZATION_ACTIVITY_TYPE");return o(gl,{field:e,source:n,label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),Mr=d((({field:e,input:t})=>{const{data:n}=tl("ORGANIZATION_KIND");return o(gl,{field:e,source:n,label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),_r=d((({field:e,input:t})=>{const{data:n}=tl("EMPLOYMENT_INFO_UNITED");return o(gl,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),Ar=d((({field:e,input:t})=>o(Tn,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",type:"number",...li(e("expenses"),ti.expenses,t?.required),...t}))),Er=d((({field:e,input:t})=>o(Tn,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",maxLength:2,...li(e("experience5Years"),ti.experience5Years,t?.required),...t}))),zr=d((({field:e})=>{const{value:t,onChange:n}=e("familyMembers"),i=e("familyStatus")?.value?.key,l="MARRIED"===i?2:1,r=Number(e("children")?.value),s=Number(e("dependents")?.value),c=l+r+s;return a((()=>{e?.("familyMembers")?.onChange?.(c)}),[i,r,s]),o(Tn,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:t,onChange:e=>n?.(e)})})),Fr=d((({field:e,input:t})=>{const{data:n}=tl("MARITAL_STATUS");return o(gl,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),Vr=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],Or=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],Lr=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],jr=d((({field:e,input:t})=>o(zn,{label:"Способ получения ответа",options:Lr,...li(e("feedbackMethod"),ti.feedbackMethod,t?.required)}))),qr=d((({field:e,input:t})=>o(Tn,{label:"ФИО",...li(e("fullName"),ti.fullName,t?.required),...t}))),$r=d((({field:e,input:t})=>o(Tn,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...li(e("generalSeniority"),ti.generalSeniority,t?.required),...t}))),Ur=d((({field:e,input:t})=>{const{data:n}=tl("HOUSE_TYPE");return o(gl,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Wr=d((({field:e,input:t})=>{const n=l((t=>{e?.("organizationName")?.onChange?.(t.data?.name?.short_with_opf),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(Tn,{label:"ИНН",type:"number",maxLength:12,...t,...li(e("inn"),ti.inn,t?.required),onDaDataChange:n})})),Hr=d((({field:e})=>o(Ri,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),Yr=d((({field:e,input:t})=>o(Tn,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",type:"number",maxLength:2,...li(e("jobsNumber"),ti.jobsNumber,t?.required),...t}))),Kr=d((({field:e,input:t})=>o(Tn,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...li(e("lastJobExperience"),ti.lastJobExperience,t?.required),...t}))),Gr=d((({field:e,input:t})=>o(Tn,{label:"Наименование юридического лица",...t,...li(e("legalEntityName"),ti.legalEntityName,t?.required)}))),Xr=d((({field:e,input:t})=>o(Tn,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...li(e("legalForm"),ti.legalForm,t?.required),...t}))),Jr=[];async function Zr(){const e=await Pt("/api/v1/outservice/outserviceregions");return e&&Array.isArray(e)?e:Jr}const Qr=d((({field:e,input:t})=>{const n=e("region")?.value?.key,{data:i}=hi("outServiceRegions",Zr),l=i?.find((e=>e.code===n))?.localities?.map((e=>({key:e,text:e})));return a((()=>{""!==n&&e?.("localities")?.onChange?.("")}),[n]),o(zn,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:l,...li(e("localities"),ti.localities,t?.required),isSearch:!0})})),es=d((({field:e,input:t})=>o(Tn,{label:"Обязательные выплаты",placeholder:"Введите значение",type:"number",...li(e("mandatoryPayments"),ti.mandatoryPayments,t?.required),...t}))),ts=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],ns=d((({field:e,input:t})=>o(pr,{orientation:"horizontal",items:ts,...li(e("methodObtain"),ti.methodObtain,t?.required)}))),is="middleName",as=d((({field:e,input:t})=>o(Tn,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&vi(e,is),...li(e(is),ti.middleName,t?.required),...t}))),ls=d((({field:e,input:t})=>o(Tn,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&vi(e,t.name??""),...li(e("name"),ti.name,t?.required),...t}))),rs=d((({value:e=!1,text:t,type:n="checkbox",onChange:i})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>i&&i(!e),children:[o("div",{className:u("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:o("div",{className:u("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(_e,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),ss=d((({field:e})=>oi(e("acquiringType")?.value?.key)?o(rs,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),os=d((({field:e,input:t})=>{const{data:n}=tl("ORGANIZATION_TYPE");return o(gl,{field:e,source:n,label:"Тип организации",fieldName:"organization",input:t})})),cs=d((({field:e,input:t})=>{const n=l((t=>{e?.("inn")?.onChange?.(t.data?.inn),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(Tn,{label:"Наименование организации",...t,...li(e("organizationName"),ti.organizationName,t?.required),onDaDataChange:n})})),ds=d((({field:e,input:t})=>o(Tn,{label:"Иные доходы",placeholder:"Введите значение",type:"number",...li(e("otherIncome"),ti.otherIncome,t?.required),...t}))),ms=d((({field:e,input:t})=>o(Wl,{label:"Дата регистрации по месту жительства",...li(e("participantDateRegistration"),ti.participantDateRegistration,t?.required)}))),us=d((({field:e,input:t})=>{const n="BUSINESS_OWNER"===e("positionOrganization")?.value?.key,i={...li(e("partInBusiness"),ti.partInBusiness,t?.required)};return o(Tn,{label:"Доля участия в бизнесе",placeholder:"в %",type:"number",maxLength:3,...i,...t,onChange:e=>i?.onChange&&i?.onChange(String(Number(e)>100?100:Number(e)||"")),value:n?i?.value:"",disabled:!n})})),hs=d((({field:e,input:t})=>{const{required:n,...i}=t;return o(Tn,{...li(e("partnerComments"),ti.partnerComments,n),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...i})})),ps=d((({field:e,input:t})=>{const{value:n,onChange:l}=e("paymentSystem"),[r,s]=i([]);return a((()=>{(async()=>{const e=await(async()=>{const e=await Ji("/public-data/creditProgramConditions","POST",{creditProgramId:13});return(await(e?.json()))?.paymentSystems?.map((e=>({id:e.type,text:e.name})))})();s(e||[])})()}),[]),o(pr,{label:"Платежная система",orientation:"horizontal",items:r,value:n,onChange:e=>l?.(e),...li(e("paymentSystem"),ti.paymentSystem,t?.required)})})),gs=e=>"_"===e,fs=e=>/\d/.test(e),xs=e=>gs(e)||fs(e),ys=[..."+7 (___) ___-__-__"],bs=ys.findIndex(gs),vs=ys.map(((e,t)=>xs(e)?ys.slice(0,t).filter(xs).length:-1));function Ns(e){const t=e.replace(/\D/g,""),n=ys.map(((e,n)=>fs(e)?e:t.charAt(vs[n])||e)),i=vs.indexOf(t.length-1)+1;return(i?n.slice(0,Math.max(bs,i)):n).join("")}const ws=d((({children:e,onChange:t,...n})=>{const i=l((e=>t&&t(Ns(e))),[t]),a=l((e=>{"+7 ("===e&&t&&t("")}),[]);return o(xn,{...n,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>a(e?.target?.value||""),children:e})})),Cs=d((({className:e,label:t,error:n,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ws,{"aria-label":t,label:hn({label:t,errors:i?.errors}),valid:Boolean(!n),placeholder:"+7 (___) ___-__-__",...i}),vn(n)]}))),Ss=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(Cs,{label:"Телефон",...li(e(n),ti.phone,t?.required),disabled:t?.filledByEsia&&vi(e,n),...t})})),ks=d((({field:e,input:t})=>{const{data:n}=tl("POSITION");return o(gl,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),Is=d((({field:e})=>oi(e("acquiringType")?.value?.key)?o(rs,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),Ts=zt((({field:e,source:t})=>o(zn,{placeholder:"Выберите продукт",label:"Продукт",options:Bs(t?.productList),...ai(e("product"),ti.product)}))),Bs=e=>(e??[]).map((e=>({key:e,value:e}))),Ps=[];function Rs(e="/api/v1/regions"){const{data:t}=hi(e,Rt);return Array.isArray(t)?t:Ps}const Ds=d((({field:e,input:t,url:n})=>{const i=Rs(n);return o(zn,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...li(e("region"),ti.region,t?.required)})})),Ms=d((({field:e,input:t})=>{const n=xi(!0),i=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(zn,{label:"Регион",placeholder:"Выберите регион",options:i,...li(e("region"),ti.region,t?.required)})})),_s=d((({field:e,input:t})=>{const{data:n}=tl("REGION_RF"),i=n?.map((({key:e,value:t})=>({key:e,text:t})));return o(zn,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:i,...li(e("regionRetail"),ti.regionRetail,t?.required)})})),As=d((({field:e,input:t})=>{const n=e("wages")?.value,i=l((t=>{const i=Number(t)+Number(n||0);e("retirementIncome")?.onChange?.(t),e("incomeAverage")?.onChange?.(String(i))}),[n]);return o(Tn,{label:"Пенсионные доходы",placeholder:"Введите значение",type:"number",...li(e("retirementIncome"),ti.retirementIncome,t?.required),...t,onChange:i})})),Es=d((({field:e})=>{const t=e("secondaryPhone");return o(Cs,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?ai(t,ti.secondaryPhone):t})})),zs=d((({field:e,input:t})=>o(zn,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Or,...li(e("serviceDirection"),ti.serviceDirection,t?.required)}))),Fs=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],Vs=d((({field:e,input:t})=>o(pr,{label:"Пол",orientation:"horizontal",items:Fs,...li(e("sex"),ti.sex,t?.required)}))),Os=d((({field:e,input:t})=>o(Ri,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...li(e("shareholderFlg"),ti.shareholderFlg,t?.required)}))),Ls=d((({children:e,onChange:t,...n})=>{const i=l((e=>t&&t(Pl(e,"___-___-___ __"))),[t]),a=l((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(xn,{...n,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>a(e?.target?.value||""),children:e})})),js=d((({className:e,label:t,value:n,error:i,onChange:a,onBlur:l,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Ls,{"aria-label":t,label:hn({label:t,errors:r?.errors}),valid:Boolean(!i),value:n,onChange:a,onBlur:l,placeholder:"___-___-___ __"}),vn(i)]}))),qs=d((({field:e,input:t})=>{const n=e("consentPfrFlg")?.value;return o(js,{label:"СНИЛС",...li(e("snils"),ti.snils,!!n&&t?.required),...t})})),$s=d((({field:e,input:t})=>o(Tn,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&vi(e,"surname"),...li(e("surname"),ti.surname,t?.required),...t}))),Us=["От 1 мес","До 15 лет"],Ws=d((({field:e})=>o(dl,{title:"Срок, месяцев",items:Us,min:1,max:180,...e("term")}))),Hs=d((({field:e,input:t})=>o(Tn,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",...li(e("totalIncome"),ti.totalIncome,t?.required),...t}))),Ys=d((({field:e,input:t})=>o(zn,{label:"Тип обслуживания",options:Vr,...li(e("serviceType"),ti.serviceType,t?.required)}))),Ks=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],Gs=d((({field:e})=>{const{value:t,onChange:n}=e("vedTypes");return a((()=>{"currencyControl"!==t&&(e?.("inn")?.onChange?.(""),e?.("region")?.onChange?.(""))}),[t]),o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(hr,{className:"whitespace-normal",orientation:"horizontal",items:Ks,value:t,onChange:e=>n&&n(e)})})})),Xs=d((({field:e,input:t})=>{const n=e("retirementIncome")?.value,i=l((t=>{const i=Number(t)+Number(n||0);e("wages")?.onChange?.(t),e("incomeAverage")?.onChange?.(String(i))}),[n]);return o(Tn,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",...li(e("wages"),ti.wages,t?.required),...t,onChange:i})}));const Js={$ref:"/wcms-resources/outservice-productlist.json"},Zs=(e,t,n=!1)=>(i,a)=>{const l="ULTRASERVICE"===t||"PREMIUMSERVICE"===t,r={surname:o($s,{field:e,input:i}),name:o(ls,{field:e,input:i}),middleName:o(as,{field:e,input:i}),phone:o(Ss,{field:e,input:i}),organizationPhone:o(Ss,{field:e,input:i}),email:o(Rr,{field:e,input:i}),fullName:o(qr,{field:e,input:i}),inn:o(Wr,{field:e,input:i}),legalForm:o(Xr,{field:e,input:i}),organizationName:o(cs,{field:e,input:i}),generalSeniority:o($r,{field:e,input:i}),lastJobExperience:o(Kr,{field:e,input:i}),experience5Years:o(Er,{field:e,input:i}),jobsNumber:o(Yr,{field:e,input:i}),beginDate:o(Hl,{field:e,input:i}),addressFact:o(bi,{field:e,input:i}),organizationAddress:o(Ni,{field:e,input:i}),comment:o(tr,{field:e,input:i}),addressBranch:o(yi,{field:e,input:i,isPremium:l}),sex:o(Vs,{field:e,input:i}),birthday:o(Kl,{field:e,input:i,isRetailForm:n}),birthPlace:o(Xl,{field:e,input:i}),desiredMeetingDate:o(br,{field:e,input:i}),product:o(Ts,{field:e,source:Js}),localities:o(Qr,{field:e,input:i}),isClient:o(Hr,{field:e}),partnerComments:o(hs,{field:e,input:i}),collectionCount:o(er,{field:e,input:i}),acquiringType:o(si,{field:e,input:i}),onlineCheckout:o(ss,{field:e}),posTerminal:o(Is,{field:e}),serviceType:o(Ys,{field:e,input:i}),term:o(Ws,{field:e}),amount:o(pl,{field:e}),annualRevenue:o(xl,{field:e,input:i}),vedTypes:o(Gs,{field:e}),feedbackMethod:o(jr,{field:e,input:i}),serviceDirection:o(zs,{field:e,input:i}),bankEmpolee:o(vl,{field:e}),secondaryPhone:o(Es,{field:e}),consentToReceiveMaterials:o(dr,{field:e,input:i}),processPersonalDataFlg:o(dr,{field:e,input:i}),consentProviderFlg:o(dr,{field:e,input:i}),consentOthersFlg:o(dr,{field:e,input:i}),consentInformFlg:o(dr,{field:e,input:i}),consentPfrFlg:o(dr,{field:e,input:i}),applicationDate:o(Tn,{label:"Дата и время обращения в Банк",...e("applicationDate")}),region:l?o(Ms,{field:e}):o(Ds,{field:e,input:i,url:cn(t)}),education:o(Pr,{field:e,input:i}),housing:o(Ur,{field:e,input:i}),employment:o(_r,{field:e,input:i}),organization:o(os,{field:e,input:i}),amountWorkers:o(fl,{field:e,input:i}),employerActivities:o(Dr,{field:e,input:i}),employerOrganization:o(Mr,{field:e,input:i}),positionOrganization:o(ks,{field:e,input:i}),familyStatus:o(Fr,{field:e,input:i}),children:o(Zl,{field:e,input:i}),familyMembers:o(zr,{field:e,input:i}),dependents:o(yr,{field:e,input:i}),totalIncome:o(Hs,{field:e,input:i}),expenses:o(Ar,{field:e,input:i}),snils:o(qs,{field:e,input:i}),conscription:o(ir,{field:e,input:i}),armyIdFlg:o(yl,{field:e,input:i}),dulSerie:o(Ir,{field:e,input:i}),dulNumber:o(kr,{field:e,input:i}),dulIssueDateField:o(wr,{field:e,input:i}),dulSubdivisionCode:o(Br,{field:e,input:i}),dulIssuedBy:o(Sr,{field:e,input:i}),addressRegistration:o(Ni,{field:e,input:i}),addressCourier:o(Ni,{field:e,input:i}),participantDateRegistration:o(ms,{field:e,input:i}),retirementIncome:o(As,{field:e,input:i}),otherIncome:o(ds,{field:e,input:i}),wages:o(Xs,{field:e,input:i}),mandatoryPayments:o(es,{field:e,input:i}),disablePeopleFlg:o(vr,{field:e,input:i}),bankruptcyFlg:o(Nl,{field:e,input:i}),shareholderFlg:o(Os,{field:e,input:i}),legalEntityName:o(Gr,{field:e,input:i}),creditInRshbCd:o(mr,{field:e,input:i}),bankEmployeeCode:o(bl,{field:e,input:i}),partInBusiness:o(us,{field:e,input:i}),regionRetail:o(_s,{field:e,input:i}),addressRetail:o(il,{field:e,input:i}),addressMatch:o(Di,{field:e,input:i}),paymentSystem:o(ps,{field:e,input:i}),currency:o(fr,{field:e,input:i}),cardCategory:o(Jl,{field:e,input:i}),codeWord:o(Ql,{field:e,input:i}),confirmationIncome:o(nr,{field:e,input:i}),methodObtain:o(ns,{field:e,input:i}),deliveryDate:o(xr,{field:e,input:i})};return function({input:e,field:t}){const{condition:n}=e,{value:i}=t(n?.name||"");return!n||n?.values?.find((e=>e===(i?.key??i)))}({input:i,field:e})?o("div",{children:r[i?.name||""]},String(a)):null},Qs=e=>2===e?"@xl:grid-cols-2":"",eo=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(_e,{size:"text-h6",children:e})}):null,to=d((function({responseType:e,typeForm:t}){const n="OK"===e,i=n?"ResponseOKIcon":"ResponseFailIcon",{close:a}=me(),r=l((()=>{a()}),[]),s="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(sr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto ",children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ne,{image:{icon:i,iconVersion:"normal"},width:"136",height:"136"}),o(k,{className:"w-full",title:n?"Ваша заявка отправлена":"Не удалось отправить заявку",description:n?s:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(Oa,{type:"button",onClick:r,children:"Хорошо"})]})})})),no=e=>{const{open:t,close:n}=me();return{open:(n,i={})=>t(o(to,{...e,...n}),i),close:n}},io=e=>t=>t&&Object.entries(e).flatMap((([e,n])=>n(t[e])))||[],ao=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:i,amount:a,term:l,annualRevenue:r,serviceType:s,vedTypes:o,region:c,...d}=e,m=t||r?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:i=!1,term:a,amount:l,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${oi(t?.key)?`/Онлайн касса=${n}/POS-терминал=${i}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${l}/Срок=${a}/Выручка=${r}`})(e):null,u={...d,...ro(o),...lo(c),...m?{partnerComments:m}:{},...s?{typeForm:s}:{}};return Object.fromEntries(Object.entries(u)?.map((([e,t])=>[e,t?.key||t])))},lo=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},ro=e=>e?{vedTypes:Object.fromEntries(Ks.map((({id:t})=>[t,t===e])))}:{},so={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:ri[0],serviceType:Vr[0],feedbackMethod:Lr[0],serviceDirection:Or[0],vedTypes:Ks[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},oo=d((({text:e,link:t})=>c(C,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(_e,{children:e}):null,t?o(ve,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"!text-left text-primary-main",children:o(_e,{children:t.text})}):null]}))),co=(e,t)=>o(Oa,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),mo=(e,t,n)=>c("div",{className:"flex col-span-2 gap-xs flex-col w-full items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3 items-center",children:[o(ki,{...e}),o(oo,{link:t})]}),vn(ai(e,Gn).error)]}):o(oo,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),co(n)]}),uo={send:async function(e,t=!1){const{typeForm:n,region:i,phone:a="",email:l,birthday:r,desiredMeetingDate:s,inn:o,addressBranch:c,secondaryPhone:d="",bankEmpolee:m,applicationDate:u,serviceDirection:h,...p}=e,g=t&&"Юридическое лицо / ИП"!==h,f="/api/v1"+(g?"/lead":"/sendcorporatelead"),x={typeForm:n,...Ut(i,g),...Wt(l,g),...qt(a),...$t(s,"desiredMeetingDate"),...g?$t(r):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...Ht(d)},...p};try{const e=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(x)});return e?.ok?await e.json():null}catch(e){return null}}},ho=d((({className:e,title:t,typeForm:n="",sections:r=[],button:s,link:d,endpoint:m,additionalParams:h,isContacts:p,data:g,...f})=>{const x=r?.flatMap((e=>e?.inputs))||[],y=((e,t="")=>{const n=Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||so[e.name||""]])));return n?.serviceType&&"PREMIUMSERVICE"===t&&(n.serviceType=Vr[1]),{...n,typeForm:{key:t,text:""}}})(x,n),[b,v]=i(""),N=no({typeForm:n}),C=l((async(e,t)=>{const n=po(x,e),i=io(ii(n));if(!Fn(i(e)))return console.warn("validation fail");const a=ao({...e,...h}),l=await uo.send(a,"lead"===m)?"OK":"Fail";if(v(l),l&&N.open({responseType:l}),"OK"===l&&g){const e=an();Yt({aspectsAttributes:g,aspects:e,ev:t})}return l}),[]),[,{field:S,onSubmit:k,reset:I}]=rn(y,{onSubmit:C}),T=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(x)?.name;return a((()=>{"OK"===b&&(v(""),I())}),[b]),c(on,{className:u("container space-y-m",e),title:t,...f,children:[c("form",{onSubmit:k,children:[r.map(((e,t)=>c("div",{className:u(Qs(e.columns),"grid gap-x-m"),children:[eo(e.title),(e?.inputs||[])?.map(Zs(S,n))]},`section-${t}`))),mo(T?S("consentDataProcessing"):void 0,d,s)]}),p?c("div",{className:"space-y-m",children:[o(w,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex sm:justify-center gap-xl",children:[c("a",{className:"flex gap-s items-center text-primary-text no-underline",href:"tel:8 (800) 200-78-70","aria-label":"телефон 8 (800) 200-78-70",children:[o(ne,{image:{icon:"PhoneIcon"},width:"24",height:"24"}),o("span",{children:"8 (800) 200-78-70"})]}),c("a",{className:"flex gap-s items-center text-primary-text no-underline","aria-label":"почта ved@rshb.ru",href:"mailto:ved@rshb.ru",children:[o(ne,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),po=(e,t)=>e.filter((e=>"secondaryPhone"===e?.name?Boolean(t.secondaryPhone):e)).filter((e=>!e?.condition||e?.condition.values.find((n=>{const i=t?.[e?.condition?.name??""];return n===(i?.key??i)}))));function go(e){const[t,n]=i(JSON.parse(globalThis.localStorage?.getItem(e)||"null"));return[t,l((t=>{globalThis.localStorage?.setItem(e,JSON.stringify(t)),n(t)}),[e,globalThis.localStorage])]}const fo=d((({inputs:e=[],typeForm:t="",field:n,key:i})=>{const a=e.every((e=>Boolean(n(e.name).value))),l=r((()=>e?.filter((e=>e.required))?.some((e=>Boolean(ai(n(e?.name),ti[e?.name]).error)))),[e]);return o("div",{className:"w-fit",children:o(ea,{isFoldButtonOnTop:!0,unfoldedByDefault:!0,renderFoldableSection:({isUnfolded:i})=>o(ta,{isUnfolded:i,className:"flex flex-col pl-2xl",children:e.map(Zs(n,t))}),renderFoldButton:xo(c("div",{children:[o(ki,{value:a,onChange:t=>{for(const i of e){const e=n(i.name);e?.onChange&&e.onChange(t)}},text:"Согласие на все документы"},i),vn(l?"Отметьте все обязательные соглашения":"")]}))})})})),xo=e=>t=>c("div",{className:"flex items-start",children:[e,o("button",{onClick:t.onToggle,className:"px-m py-2xs",type:"button",children:o(W,{className:"text-primary-text",name:t.isUnfolded?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})})]}),yo=({field:e,typeForm:t="",inputs:n,isRetailForm:i=!1})=>{const{consentInputs:a,restInputs:l}=bo(n||[]);return a.length>2?c("div",{children:[l.map(Zs(e,t,i)),o(fo,{inputs:a,field:e})]}):(n||[])?.map(Zs(e,t,i))},bo=e=>({consentInputs:e?.filter((e=>Object.keys(ar).includes(e.name||"")))||[],restInputs:e?.filter((e=>!Object.keys(ar).includes(e.name||"")))||[]}),vo={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",organizationPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:ri[0],serviceType:Vr[0],feedbackMethod:Lr[0],serviceDirection:Or[0],vedTypes:Ks[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,addressRegistration:"",participantDateRegistration:void 0,currency:"",paymentSystem:"",cardCategory:{key:"",text:""},codeWord:"",addressRetail:{key:"",text:""}},No=(e,t,n="")=>{if(t){const e={...t};return e.birthday=new Date(e?.birthday||0),e}return{...Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||vo[e.name||""]]))),typeForm:{key:n,text:""}}},wo=(e,t)=>o(Oa,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Co=e=>Xi("/user-data/updateUserProfile","PUT",e),So=e=>Xi("/user-data/updateUserTask","PUT",e),ko=(e,t)=>Boolean(e)&&"string"!=typeof e&&Boolean(e?.errorMessage.startsWith(`Too many request for phoneNumber [${t}]`)),Io={width:"103",height:"21"},To={"bg-white":"color",transparent:"white"},Bo={"bg-white":"text-primary-main",transparent:"text-white"},Po=(e,t,n)=>o(ne,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:To[e]},className:Bo[e],width:n?.width,height:n?.height}),Ro={"bg-white":"text-primary-text",transparent:"text-white"},Do=d((({className:e,href:t="/",logo:n,children:i,targetBlank:a,bgColor:l="bg-white",showTitle:r=!0,data:s})=>c("a",{className:u("inline-flex items-center font-sans no-underline",e),href:n?.href??t,target:a?"_blank":"_self","aria-label":n?.title??"Россельхозбанк",...ge(s),children:[Po(l,n?.image,Io),r?i??o("div",{className:"ml-s",children:o(_e,{font:"font-medium",color:Ro[l],size:"text-s",children:n?.title??"Россельхозбанк"})}):null]}))),Mo=d((({phoneNumber:e,close:t,sendCode:n,onClose:r})=>{const[s,d]=i(""),[m,u]=i(""),[h,p]=i(!1),g=l((async()=>{const e=await(i={captchaText:m},Ji("/sms/checkCaptcha","POST",i).then((e=>e.text())).then((e=>"ERROR"!==e)));var i;e?(n?.(),t?.()):p(e)}),[]),f=l((()=>{(async()=>{d(URL.createObjectURL(await(e=>Ji(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?await e.blob():new Blob)))(e)))})()}),[]);return a(f,[]),o(sr,{head:o(Do,{}),onClose:r,className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex h-36 w-72",children:[o("img",{className:"grow",src:s}),o("div",{onClick:f,className:"flex w-8 items-center justify-center cursor-pointer",children:o(W,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(xn,{className:"w-[300px]",onChange:u,value:m,placeholder:"Введите код с картинки"}),h?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-[310px] justify-between",children:[o(Oa,{onClick:t,version:"secondary",children:"Вернуться"}),o(Oa,{type:"submit",disabled:!m,onClick:g,version:"secondary",children:"Отправить"})]})]})})})),_o=d((({time:e,setTime:t,className:n})=>(a((()=>{const n=setInterval((()=>{t(e-1)}),1e3);return 0===e&&clearInterval(n),()=>{clearInterval(n)}}),[e]),o("span",{className:n,children:Ao(e)})))),Ao=e=>`${`${Math.floor(e/60)}`.padStart(2,"0")}:${(""+e%60).padStart(2,"0")}`,Eo=d((({values:e,setValues:t,hasError:n,errorText:r})=>{const[d,m]=i(0),u=s([]);a((()=>{u.current?.[d]?.focus()}),[d]);const h=l((n=>i=>{const{value:a}=i.currentTarget,l=a.slice(0,1);t(e.map(((e,t)=>t===n?l:e))),m(n+1)}),[e]),p=l((n=>i=>{const{key:a}=i;if("Backspace"===a&&!e[n]){const i=n>0?n-1:e.length-1,a=e.map(((e,t)=>t===i?"":e));t(a),m(i)}}),[e]),g=l((n=>{n.preventDefault();const i=n.clipboardData.getData("text"),a=e.map(((e,t)=>t<i.length?i[t]:e));t(a),m(a.length-1)}),[e]);return c("div",{className:"flex flex-col gap-2 text-center",children:[o("div",{children:e.map(((t,i)=>o("input",{type:"number",maxLength:1,value:t,onChange:h(i),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[i]=e},onFocus:e=>e.target.select(),onKeyDown:p(i),className:zo(i,e,n)},i)))}),n?o("div",{className:"text-error",children:r}):null]})})),zo=(e,t,n=!1)=>{const i=!t[e];return`w-20 h-24 text-5xl text-center p-lg m-2 border ${n&&i?"border-error":"border-gray"} rounded-md caret-transparent outline-none`},Fo=d((({isDisabled:e,onClick:t,text:n})=>o(Oa,{type:"button",onClick:t,disabled:e,children:o(_e,{font:"font-normal",children:n})}))),Vo=e=>{e&&(globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token))},Oo=({close:e,values:t})=>{const[n,s]=i(!1),[o,c]=i(""),[d,m]=i(!1),[u,h]=i(0),[p,g]=i(!1),[f,x]=i(0),y=l((()=>{s(!1),c("")}),[]),b=r((()=>0===u&&p),[u,p]),v=r((()=>f>2||!t.every(Boolean)||b),[t]),N=l((async()=>{try{g(!1),h(0),x(f+1),m(!0),await(async e=>Xi("/sms/checkCode","POST",e).then(Vo))({smsText:t.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),y(),e&&e(t.join(""))}catch{m(!1),c(f>1?"Исчерпан лимит ввода смс-кода":"Неверный код"),s(!0)}}),[t,f]);return a((()=>{b?(s(!0),c("Код просрочен")):s(!1)}),[b]),{handleSubmit:N,hasError:n,errorText:o,isLoading:d,timeNextReq:u,isSubmitButtonDisabled:v,setTimeNextReq:h,setIsTimerStarted:g,setAttemps:x}},Lo=d((({close:e=pn,onClose:t=pn,title:n,description:r,__html:s,code:d=!0,codeLength:m=4,textButton:u="",phoneNumber:h="+79999999999"})=>{const[p,g]=i(Array(m).fill("")),{handleSubmit:f,hasError:x,errorText:y,isLoading:b,timeNextReq:v,isSubmitButtonDisabled:N,setTimeNextReq:w,setIsTimerStarted:C,setAttemps:S}=Oo({values:p,close:e}),I=l((async()=>{var e;await(e={phoneNumber:h,smsCodesSetName:{key:"AUTHENTICATION"}},Xi("/sms/sendCode","POST",e).then((t=>!ko(t,e.phoneNumber))))?(S(0),w(180),C(!0)):T.open()}),[]),T=((e,t)=>{const{open:n,close:i,closeAll:a}=me();return{open:()=>n(o(Mo,{close:i,onClose:t,...e})),close:i,closeAll:a}})({phoneNumber:h,sendCode:I},t);return a((()=>{I()}),[]),o(sr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl px-5xl py-0",children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[o(k,{className:"w-full",title:n,description:r,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),d?o(Eo,{values:p,setValues:g,errorText:y,hasError:x}):null,qo(v,w,I),o(De,{itemSize:"list-s",__html:s}),jo(u,N,f),b?o(Mi,{blur:!1}):null]})})})),jo=(e,t,n)=>e?o(Fo,{isDisabled:t,onClick:n,text:e}):null,qo=(e,t,n)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(_o,{className:"text-base ml-1",time:e,setTime:t})]}):o(ve,{onClick:n,className:"text-primary-main",children:"Получить новый код"}),$o=()=>{const{open:e,close:t}=me();return{open:(n,i)=>e(o(Lo,{onClose:t,close:n,...i})),close:t}},Uo={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},Wo={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},Ho=d((function({handleSubmit:e=pn,onClose:t=pn}){const[n,a]=i(""),[r,s]=i(!1),{open:d,close:m}=me(),u=Se(),h=l((()=>{m(),e(n)}),[n]),p=l((e=>{a(e),"REFUSE"===e&&s(!0)}),[]),g=r?Wo:Uo;return o(sr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:t,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o("div",{role:"button",onClick:()=>or(d,Ko,u),children:o(w,{className:"text-center text-balance",headingType:"h2",title:g.title})}),o(C,{align:"text-center",children:g.description}),o(hr,{className:"whitespace-normal",orientation:"horizontal",items:Yo,value:n,onChange:p}),o(Oa,{disabled:!n,type:"button",onClick:h,children:"Продолжить"})]})})})),Yo=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],Ko=2,Go=e=>{const{open:t,close:n}=me(),i=$o(),a=(t,a)=>async l=>{n(),"SIGNED"===l&&t?i.open((t=>async n=>{t&&await Co({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()})(a),Xo(t)):e()};return{open:(n,i)=>t(o(Ho,{handleSubmit:a(n,i),onClose:e}))}},Xo=e=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:jt(e),textButton:"Отправить",__html:"<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>\n <ul><li>согласие на запрос информации в БКИ</li></ul>"}),Jo=d((function({handleClose:e}){const t=l((async()=>{const e=await(t={redirectUri:globalThis.location.href},Xi("/esia/getLink","POST",t));var t;e&&(globalThis.location.href=e.link)}),[]);return o(sr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",onClose:e,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex items-center justify-around w-full",children:[c("ul",{className:"list-disc",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ne,{image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"70"})]}),c("div",{className:"flex items-center justify-between w-full m-0",children:[o(Oa,{type:"button",onClick:t,children:"Заполнить через Госуслуги"}),o(Oa,{type:"button",version:"secondary",onClick:e,children:"Пропустить"})]})]})})})),Zo={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},Qo={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK"},ec={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},tc=e=>Object.entries(e).reduce(((e,[t,n])=>t in Zo?[...e,{contactTypeCd:{key:Zo[t]},value:n}]:e),[]),nc=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in Qo){const i=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:Qo[t]},...i}]}return e}),[]),ic=e=>Object.entries(e).reduce(((e,[t,n])=>t in ec?[...e,{incomeTypeCd:{key:ec[t]},value:Number(n||0)}]:e),[]),ac=({inputs:e,programId:t,nextStepLink:n,saveForm:a})=>{const[r,s]=i(""),[,c]=go("taskId"),[,d]=go("profileId"),[,m]=go("participantId"),u=(e=>{const{open:t,close:n}=me(),i=l((()=>{n(),globalThis.location.href=e}),[]);return{open:(e={})=>t(o(Jo,{handleClose:i}),e),close:n}})(n),h=Go(u.open),p=$o(),g=l(((e,t,n)=>{m(e),c(t),d(n)}),[]);return{handleSubmit:l((async n=>{const i=io(ii(e));if(!Fn(i(n)))return console.warn("validation fail");try{const e=await(l={profile:{phone:jt(n.phone)}},Xi("/public-data/createUserProfile","POST",l).then((e=>e?.profile?.id||null)));if(e&&n?.phone){const i=async()=>{try{await lc({programId:t,profileId:e,formData:n,saveUserData:g,saveForm:a}),p.close(),h.open(n.phone,e)}catch{s("Fail")}},l=Object.keys(ar).filter((e=>n[e])).map((e=>ar[e]?.text));p.open(i,rc(n?.phone,l))}}catch{s("Fail")}var l}),[]),responseStatus:r}},lc=async({programId:e,profileId:t,formData:n,saveUserData:i,saveForm:a})=>{const l=oc(n);await Co(((e,t)=>{const{name:n="",surname:i="",middleName:a="",birthday:l="",phone:r="",email:s="",processPersonalDataFlg:o,consentProviderFlg:c,consentPfrFlg:d,consentPhotoFlg:m,consentAssignmentClaimsFlg:u,consentCollectionFlg:h,consentInformFlg:p}=t;return{profile:{id:e,name:n,surname:i,midname:a,birthDate:l&&Lt(l,!0),email:s,phone:jt(r),processPersonalDataFlg:Boolean(o),consentProviderFlg:Boolean(c),consentPfrFlg:Boolean(d),consentPhotoFlg:Boolean(m),consentAssignmentClaimsFlg:Boolean(u),consentCollectionFlg:Boolean(h),consentInformFlg:Boolean(p)}}})(t,l));const{taskId:r,participantId:s}=await(async e=>await Xi("/user-data/createDraftTask","POST",e)||{})({profileId:t,programId:e});await So((({participantId:e,taskId:t,profileId:n,formData:i})=>{const{name:a,surname:l,middleName:r,birthday:s,phone:o,email:c}=i;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:globalThis.location.origin,id:t,participants:[{birthDate:s&&Lt(s,!0),id:e,midname:r,name:a,surname:l,profile:{id:n},participantContacts:tc({phone:o&&jt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}]}}})({participantId:s,taskId:r,profileId:t,formData:l})),i(s,r,t),a(n)},rc=(e,t)=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:jt(e),textButton:"Оформить",__html:`<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>${sc(t)}`}),sc=e=>`<ul>${e?.map((e=>"<li>"+e+"</li>")).join("")}</ul>`,oc=e=>{const{consentOthersFlg:t,...n}=e;return{...n,consentCollectionFlg:t,consentAssignmentClaimsFlg:t,consentPhotoFlg:t}},cc=e=>{const{profile:t,addInfo:n,document:i,addressRegistration:a,addressFact:l}=e;return{name:t?.name,surname:t?.surname,middleName:t?.midname,birthday:t?.birthDate,phone:Ns(t?.phone),email:t?.email,dulIssueDateField:i?.dulIssueDate,dulIssuedBy:i?.dulIssuedBy,dulNumber:i?.dulNumber,dulSerie:i?.dulSerie,dulSubdivisionCode:i?.dulSubdivisionCode,snils:n?.snils,birthPlace:n?.birthPlace,addressRegistration:dc(a),addressFact:dc(l),esiaAccountTypeCd:t?.esiaAccountType}},dc=e=>{const{postcode:t,region:n,regionCode:i,locality:a,city:l,street:r,house:s,building:o,block:c,apartment:d}=e,m=[t,n,a||l,r?`ул ${r}`:void 0,s?`д ${s}`:void 0,c?`к ${c}`:void 0,o?`стр ${o}`:void 0,d?`кв ${d}`:void 0].reduce(((e,t)=>t?e?`${e}, ${t}`:t:e),"");return{...e,regionCode:i?.key,fullAddress:m}},mc=e=>{const[t,n]=i(!1),[r]=go("profileId"),[s,o]=go("leadForm"),c=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),d=c.get("code"),m=c.get("state"),u=l((async()=>{if(r&&d&&m){const n=await(t={profileId:r,code:d,state:m,redirectUri:globalThis.location?.href},Xi("/esia/updateProfileEsia","POST",t));n&&o({...s,...cc(n)}),globalThis.location.href=e}var t}),[]);return a((()=>{d?(n(!0),u()):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),{isLoading:t}},uc=d((({className:e,title:t,programId:n="",nextStepLink:l="/credit-lead",sections:r=[],button:s,...d})=>{const m=r?.flatMap((e=>e?.inputs))||[],[h,p]=i(""),{isLoading:g}=mc(l),[f,x]=go("leadForm"),y=No(m,f),{handleSubmit:b,responseStatus:v}=ac({inputs:m,programId:n,nextStepLink:l,saveForm:x});if(v){no({responseType:v}).open()}const[,{field:N,onSubmit:w,reset:C}]=rn(y,{onSubmit:b});return a((()=>{"OK"===h&&(p(""),C())}),[h]),o(on,{className:u("container space-y-m",e),title:t,...d,children:c("form",{onSubmit:w,className:"space-y-m relative",children:[g?o(Mi,{blur:!1}):null,r.map(((e,t)=>c("div",{className:u(Qs(e.columns),"grid gap-x-m"),children:[eo(e.title),yo({field:N,inputs:e?.inputs,isRetailForm:!0})]},`section-${t}`))),wo(s)]})})})),hc=d((({title:e,description:t})=>{const n=Se();return c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ne,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),o(k,{title:e,description:t,headlineVersion:n?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),pc=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",gc=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function fc(e=0){const t=Math.round(10*e);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const xc=d((({className:e,style:t,idx:n,activeIndex:i,observerOptions:c,children:d,onIntersection:m})=>{const h=function(e,{sensitivity:t,rootRef:n}={}){const i=s(null),l=r((()=>({threshold:fc(t),root:n?.current})),[t,n?.current]);return a((()=>{if(!i.current)return;const t=new IntersectionObserver(e,l);return t.observe(i.current),()=>{t.disconnect()}}),[e,l]),i}(l((e=>{e.length&&m&&m(n||0,e[e.length-1])}),[m,n]),c);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===i),ref:h,role:"listitem",children:d})})),yc=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],bc=d((({className:e,itemClassName:t,containerRef:n,activeIndex:i,visibleItemCount:a=0,gap:r=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:p,onVisibleItemsChange:g,onVisibleIndicesChange:f})=>{const x={sensitivity:1,rootRef:n},y=s([]),b=l(((e,t)=>{const n=[...y.current||[]];n[e]=t,y.current=n,g&&g(n),f&&f(Nc(n))}),[g,f]),v=a>0?r*Number(a)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?vc(c,v):{},...N?gc(h):{},gap:`${r}px`};return o("div",{className:u("box-border overflow-auto no-scrollbar",d,e),style:C,ref:n,role:"list",children:(S=(e,n)=>o(xc,{className:u(m,a?yc[a-1]:"",{"h-full":N},t),style:w?vc(c/4):{},activeIndex:i,idx:n,observerOptions:x,onIntersection:b,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(S):S(e,0))(p)});var S})),vc=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Nc=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),wc={"horizontal-list":"w-6","vertical-list":"h-6"},Cc=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(i,a)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",a===e?wc[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(a)},String(a)),Sc=({activeIndex:e,onClick:t})=>(n,i)=>{const a=i===e,l=a?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=a?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=a?"text-l":"text-m group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(i),"aria-label":n?.title,className:u("max-h-28 mt-xs ml-xs relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50 whitespace-nowrap",l),children:[o("div",{className:r,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(i))},kc=e=>e,Ic=(e=kc)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),Tc=Ic(),Bc=(e=kc)=>Ic((t=>-e(t))),Pc=Bc(),Rc=e=>t=>e.scrollWidth/t,Dc=e=>(t,n)=>{e.scrollBy({left:n*Rc(e)(t),behavior:"smooth"})},Mc=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[a,r]=i([]),o=l((e=>{r((t=>{return(n=t)===(i=e)||Boolean(n&&i&&n?.length===i?.length&&n.every(((e,t)=>e===i[t])))?t:e;var n,i})),t&&t(e)}),[t]),[c,d]=a.length?[Bc()(a),Ic()(a)]:[-1,-1],m=c>0,u=d<e-1,h=l((()=>{var t;n.current&&(m?Dc(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=l((()=>{n.current&&(u?Dc(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=l(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{n?.current&&n.current.children[e]?.scrollIntoView(t)}),[n]);return[n,{scrollLeft:h,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:u,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},_c={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},Ac=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:i="horizontal-list",version:r,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=Se(),[h,p]=Mc({itemCount:s.length}),g=Ec(Boolean(s?.length));a((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=l((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(bc,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(Sc({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",_c[i],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(Cc({activeIndex:t,onClick:f,listType:i}))}):null})),Ec=(e=!1)=>({behavior:e?"auto":"smooth"}),zc=d((({className:e,disabled:t,...n})=>o(ve,{rounded:!0,className:u("group/btn w-12 h-12 min-h-12 max-h-12 flex items-center justify-center shadow-main-black",t?"bg-secondary-light text-secondary-text":"bg-white text-primary-text hover:text-primary-main",e),disabled:t,...n,children:o(ne,{className:"w-4 h-4 min-w-4 min-h-4 rounded-full box-border",image:{icon:"ArrowLeftIcon",iconVersion:"black"},imageClassName:"group-hover/btn:text-primary-main",width:"16",height:"16"})}))),Fc=d((e=>o(zc,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),Vc=d((e=>o(zc,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),Oc="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",Lc=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:i,isBottom:a})=>{const{canScrollLeft:l,canScrollRight:r,scrollLeft:s,scrollRight:d}=t,m=i&&!a;return c("div",{className:e,children:[n?jc(t):null,l?o(Fc,{className:u(qc(a),m?"left-1":"left-0"),onClick:s}):null,r?o(Vc,{className:u(qc(a),m?"right-1":"right-0"),onClick:d}):null]})})),jc=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(Oc,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(Oc,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),qc=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),$c=d((({className:e,version:t,gap:n=14,padding:i=16,visibleItemCount:a=1,listType:l="horizontal-list",snapAlign:r,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:x})=>{const y=Array.isArray(g)?g.length:0,[b,v]=Mc({itemCount:y,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===l?"relative h-full":""),children:[o(bc,{containerRef:b,activeIndex:N,visibleItemCount:a,gap:n,padding:i,listType:l,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(Lc,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(Ac,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:y,listType:l,version:t,navButtons:x,containerRef:b,containerScroll:v})]})})),Uc=({blocksToRender:e,...t})=>o($c,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:R(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",pc(!0)),children:B(e,t)},String(n))})}),Wc=e=>e%2!=0,Hc=d((({textNode:e,iconNode:t,tag:n,onClick:i,justifyContent:a="between",className:l,role:r,...s})=>c(n,{tag:n,className:u("flex items-center w-full gap-1","between"===a?"justify-between":"justify-center",l),onClick:i,role:r,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),Yc=d((({className:e="",label:t,icon:n,dataTheme:i="pc",disabled:a=!1,onClick:l})=>o(Hc,{tag:"button",onClick:l,disabled:a,"data-theme":i,justifyContent:"center",role:"button",className:u("py-4 border border-transparent outline-none focus:border-primary-text space-x-s",a?"bg-main-divider text-main-disabled hover:bg-main-divider":"bg-primary-main text-white hover:bg-primary-hove",e),textNode:o(_e,{size:"text-h4",children:t}),iconNode:n?o(ne,{image:{icon:n,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),Kc=({isUnfolded:e,onToggle:t})=>o(Yc,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Gc=["ArrowDownIcon","ArrowUpIcon"],Xc="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",Jc=({topItemsCount:e=0,label:t="",block:n,blocksToRender:i=[],...a})=>{const[l,r]=e>0?[i.slice(0,e),i.slice(e)]:[i,[]];return c("div",{className:u("space-y-2xs",{hidden:!i.length}),children:[c("div",{className:u(Xc),children:[R(l,{...a.options,parent:n}),Wc(l.length)?o(Vt,{className:"col-span-6",...a}):null]}),o(ea,{renderFoldableSection:({isUnfolded:e})=>c(ta,{className:u(Xc),isUnfolded:e,children:[R(r,{...a.options,parent:n}),Wc(r.length)?o(Vt,{className:"col-span-6",...a}):null]}),renderFoldButton:({isUnfolded:n,onToggle:i})=>o(Yc,{className:u({hidden:e<1}),disabled:!r?.length,label:t,icon:Gc[Number(n)],dataTheme:a.options?.page?.colorPalette,onClick:i})})]})},Zc=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...i})=>{switch(e?.view){case"grid":return c("div",{children:[Qc(n,t),Jc({...e,...i,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[Qc(n,t),Uc({...i,blocksToRender:t})]});default:return null}})),Qc=(e,t)=>e&&!t.length?o(hc,{...e}):null,ed=e=>t=>t.reduce(((t,n,i)=>t.length?t.concat({...e,key:`sep-${i}`},n):[n]),[]),td=d((({value:e,onChange:t,items:n=[],multiple:i})=>n.map((n=>o(rs,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const a=e?.includes(n);t(i?a?(e||[]).filter((e=>e!==n)):[...e||[],n]:a?[]:[n])})(n.value),type:i?"checkbox":"radio"},n.value))))),nd=d((({children:e,filtrationSchema:t,resetButton:n,field:i,reset:a})=>c("form",{className:"flex flex-col @4xl:flex-row justify-between bg-white p-4xl gap-s @4xl:gap-0",children:[c("div",{className:"flex flex-col @4xl:flex-row gap-xl",children:[e,ed(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(id(i)).filter(Boolean))]}),n?o("div",{children:o(Oa,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:a,children:n?.text})}):null]}))),id=e=>([t,n])=>{const i=n?.type;return"array"===i?ad(t,e)(n):null},ad=(e,t)=>n=>{const i=n?.items?.enum?.map(((e,t)=>({value:e,title:n?.items?.enumNames?.[t]||""})))||[];return c("div",{className:"flex-1",children:[n?.title?o("div",{className:"mb-m",children:o(_e,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(td,{items:i,multiple:!n?.single,...t(e)})]},e)};function ld(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const rd=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,sd=(e,t)=>Object.entries(e).map((([n,i])=>"number"==typeof i?Array.isArray(t[n])?((e,t)=>n=>rd(t[e])||rd(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>rd(t[e])||rd(n[e])||od(t[e])<=od(n[e]))(n,e):"object"==typeof i&&"min"in i&&"max"in i?((e,t)=>n=>rd(t[e])||rd(n[e])||od(t[e]?.min)>=od(n[e]?.min)&&od(t[e]?.min)<=od(n[e]?.max))(n,e):Array.isArray(i)?((e,t)=>n=>rd(t[e])||rd(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>rd(t[e])||rd(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),od=e=>Number(e||0),cd=(e,{block:t,page:n,normalize:i=ln})=>{const a=t?.blocks||[],[l,{field:s,reset:o,update:c}]=rn(e),d=r((()=>ld(a,a.map((e=>At(e.content,n?.fallback))))),[a,n?.fallback]),m=l===e?a:((e,t)=>(n=ln)=>e?.filter((([,e])=>sd(t,n(e)||{}))).map((([e])=>e)))(d,l)(i);return[l,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},dd={},md={},ud=zt((({className:e,filtrationSchema:t=dd,consumerField:n={},resetButton:i,...a})=>{const[,{blocksToRender:l},{field:r,reset:s}]=cd(md,{block:a.block,page:a.options?.page}),d=o(Mn,{className:"w-64",label:n?.title,options:hd(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>hd(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...a,children:[o(nd,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(Oa,{type:"reset",className:"mt-lg w-64",onClick:s,version:i?.version,children:i?.text})})]})}),o(Zc,{blocksToRender:l,...a})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),hd=e=>ld(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),pd=(e=!1)=>e?"text-left":"text-center",gd={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},fd=d((({className:e,defaultIconSize:t=44,iconBgVersion:n="primary",size:i,icon:a,...l})=>{const r=String(i?.width||t);return a?o("div",{style:{width:`${r}px`,height:`${r}px`},className:u("rounded-icon object-fit flex justify-center items-center",gd[n],e),children:o(W,{...l,width:"54%",height:"54%",name:a})}):null})),xd=d((({className:e="",title:t,benefitList:n,...i})=>{const a=Se();return c(g,{className:e,defaultPadding:"p-6xl",...i,children:[t?o(w,{headingType:"h3",as:"h2",className:pd(a),title:t}):null,n?.length?o("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:n.map(yd)}):null]})})),yd=({label:e,description:t,__html:n,icon:i,isDotted:a=!1,iconBgVersion:l},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[i?.icon?o(fd,{className:"shrink-0",iconBgVersion:l,...i}):null,i?.src?o(ne,{className:"shrink-0",image:i}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(w,{headingType:"h6",children:e}),o(_e,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(De,{__html:n,isDotted:a,itemSize:"list-s"}):null]}):null]},String(r)),bd=(e,t,n)=>{return o($c,{children:e.map((i=n,({icon:e,title:t,description:n},a)=>c("div",{className:u("flex flex-col gap-1","justify-between p-m h-full border border-gray",{"justify-center":!n&&!t}),children:[t?o(_e,{size:"text-h6",font:"font-normal",align:i,children:t}):null,e?o(ne,{image:e,height:"180",className:"w-auto mx-auto"}):null,n?o(_e,{size:"text-h6",font:"font-normal",align:i,children:n}):null]},String(a))))});var i},vd=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:i="4",subtitle:a,title:l,...r})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...r,children:[o(k,{defaultPadding:"",title:l,description:a,headlineVersion:"M"}),e?.length?bd(e,0,t):null]}))),Nd={start:"justify-start",center:"justify-center",end:"justify-end"},wd=d((({buttons:e,className:t="",align:n,...i})=>{const a=n&&u("flex",Nd[n]);return o(g,{className:u("!bg-transparent",a,t),defaultPadding:"p-0",...i,children:je(e)})})),Cd=d((({className:e,title:t,children:n,...i})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...i,children:[t?o(w,{className:"text-center",title:t}):null,n]}))),Sd="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",kd="flex flex-col lg:max-w-80 lg:w-1/2 gap-2xl",Id="flex flex-col gap-y-xl min-w-52",Td=d((({value:e,fractionDigits:t,fixed:n,prefix:i,postfix:a})=>o(_e,{size:"text-h3",children:"number"==typeof e?[i,We(t,{fixed:n})(e),a].filter(Boolean).join(" "):e}))),Bd=d((({className:e,title:t,value:n,color:i="text-secondary-text",...a})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(_e,{size:"text-l",font:"font-light",color:i,children:t}):null,n?o(Td,{value:n,...a}):o(_e,{size:"text-h3",children:"-"})]}))),Pd=(e,t)=>e?o(C,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,Rd=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:i=2,depositeName:a,isShowDepositeName:l,color:r="text-secondary-text"})=>c("div",{children:[o(_e,{size:"text-l",font:"font-light",color:r,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children:We(i,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),a&&l?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:a}):null]})]}))),Dd=d((({title:e="Ставка"})=>c("div",{className:"space-y-s min-w-96",children:[o(_e,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(W,{className:"w-10 h-auto lg:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Процентная ставка не найдена, выберите другие параметры"})})]}))),Md=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:i=2,color:a="text-secondary-text",children:l,...r})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(Rd,{title:e,rate:t,unit:n,fractionDigits:i,color:a,...r})}),o(Bd,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:i,fixed:!0,color:a,...r}),l]}):o(Dd,{title:e,...r}),_d=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...i})=>o(dl,{items:e?[`От ${We(1)(i.min||0)} ${n}`,`До ${We(1)(i.max||0)} ${n}`]:[],step:t,...i}),Ad={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Ed={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},zd=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:i}=e,[a,l]=((e,t,n)=>{const{maxBonus:i=5e3,prefMonthsNum:a=Ad.prefMonthsNum,prefTravelBonusRate:l=Ad.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(l*t)+Math.round(r*n),i);return[c,c*a+Math.min(Math.round(s*t)+Math.round(o*n),i)*(12-a)]})(t||Ed,n,i);return{...t,...e,monthBonus:a,yearBonus:l}},Fd=zt((({className:e="",title:t,calcSource:n,buttons:i,footnote:a,...l})=>{const[r,{field:s}]=rn({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=zd(r,n);return o(Cd,{className:e,title:t,...l,children:c("section",{className:u(Sd,e),children:[c("div",{className:kd,children:[_d({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),_d({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?Md({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:Id,children:[f>=0?o(Bd,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,je(i,{isVertical:!0}),Pd(a)]})]})})})),Vd=Math.round(29.5),Od=(e,t=0)=>e?.sum?e.sum:t,Ld=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,jd=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,qd=({items:e,title:t,mobileTitle:n=t,orientation:i="horizontal",value:a,onChange:l,...r})=>c("div",{className:"grid gap-s whitespace-nowrap",children:[t?o("div",{className:"hidden @5xl:block",role:"radiogroup","aria-label":t,children:o(_e,{color:"text-secondary-text",font:"font-light",children:t})}):null,n?o("div",{className:"@5xl:hidden",role:"radiogroup","aria-label":n,children:o(_e,{color:"text-secondary-text",font:"font-light",children:n})}):null,o(hr,{orientation:i,items:e,value:e[a?0:1].id,onChange:t=>l&&l(t===e[0].id),...r})]}),$d=e=>qd({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),Ud=" (c капитализацией)",Wd=({income:e,finalSum:t,postfix:n="₽",buttons:i=[],footnotes:a=[],isCapitalization:l=!1})=>c("div",{className:Id,children:[o(Bd,{title:`Доход в конце срока${l?Ud:""}`,value:e,postfix:n,prefix:"+"}),o(Bd,{title:`Сумма в конце срока${l?Ud:""}`,value:t,postfix:n}),je(i,{isVertical:!0}),a?.map(Pd)]}),Hd=([e,t],n,i=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:Yd([e,t],i),Yd=([e,t],n=[])=>({[e]:n.length?Pc(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?Tc(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),Kd=(e,[t,n],i)=>e>=i[t]&&e<=i[n],Gd={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const Xd={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Jd=(e,t)=>{const{daysValue:n,moneyValue:i,isPartialWithdrawal:a,isReplenished:l,isMonthlyInterestPayment:r}=e,s=l||a,o=n<90||n>730,c=function(e){const t=e?.rateType?Gd[e?.rateType]:"",{data:n}=hi(t?`/api/v1/depositrates/${t}`:null,Rt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&Zd(s,e)&&Kd(i,["minSum","maxSum"],e)&&Kd(n,["minDays","maxDays"],e)))||Xd,{rate:m}=d,u=Qd(m,e),h=i+u,p=c||[Xd];return{...d,...Yd(["minSum","maxSum"],p),...Yd(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},Zd=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Qd=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:i,daysValue:a}=t;return n?Math.round(i*Math.pow((1200+e)/1200,a/30)-i):Math.round(i*e*a/365/100)},em=zt((({className:e="",title:t,buttons:n,footnote:i,bottomFootnote:a,isShowDepositeName:l,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=rn({moneyValue:Od(r,1e5),daysValue:Ld(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=Jd(m,s),{income:g,finalSum:f,rate:x,depositeName:y}=p;return o(Cd,{className:e,title:t,...d,children:c("section",{className:u(Sd,e),children:[c("div",{className:kd,children:[_d({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(b={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(dl,{items:[`От ${jd(b.min||0)}`,`До ${jd(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[tm(p,h),$d({title:"Выплата процентов",orientation:"vertical",...h("isMonthlyInterestPayment"),className:"sm:flex-col"})]})]}),Md({rate:x,depositeName:y,isShowDepositeName:l}),Wd({income:g,finalSum:f,buttons:n,footnotes:[i,a]})]})});var b})),tm=(e,t)=>c("div",{className:"space-y-s",children:[o(_e,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(ki,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(ki,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),nm=(e=[],t=!1)=>im([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),im=(e,t)=>{if(!t?.length)return;const n=t?.reduce(((t,n)=>e[0](n.rate,t[0].rate)?[n]:n.rate===t[0].rate?[...t,n]:t),[t[0]]);return n.length>1?n.reduce(((t,n)=>e[1](n,t)?n:t),n[0]):n[0]},am=({min:e=0,max:t=0,availableMonths:n,...i})=>o(dl,{items:[`От ${lm(e)}`,`До ${lm(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...i}),lm=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,rm=e=>qd({...e,className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),sm=({field:e,defParams:t,calcParams:n,map:i,monthsValue:a="maxMonths"})=>{Object.entries(i).forEach((([n,i])=>{e?.(n)?.onChange?.(t?.[i])})),e?.("monthsValue")?.onChange?.(ll(t?.[a],n.minMonths,n.maxMonths))},om=(e,t)=>{const{isAnnuity:n,moneyValue:i,monthsValue:a,moneyExtra:l}=t;if(0===e)return 0;if(n){const t=e/1200;return l?(i+l)*(t+t/(Math.pow(1+t,a)-1)):i*(t+t/(Math.pow(1+t,a)-1))}return Math.round(i/a)+i*(e/1200)},cm={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},dm=e=>mm({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&mm({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&mm({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&mm({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),mm=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:i,viewSettingFieldKey:a})=>!!n&&!n[a]||t[i]===e[i],um=(e,t,n)=>{const{moneyValue:i,monthsValue:a}=e,l=t?.rateRows||[cm],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>dm({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Hd(["minSum","maxSum"],r,l),{minMonths:c,maxMonths:d}=Hd(["minMonths","maxMonths"],r,l),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:i,monthsValue:a})=>e?.find((e=>dm({row:e,userInputParams:t,paramsViewSettings:n})&&Kd(i,["minSum","maxSum"],e)&&Kd(a,["minMonths","maxMonths"],e)))||cm)({rateRows:l,userInputParams:e,paramsViewSettings:n,moneyValue:i,monthsValue:a}),{rate:u}=m,h=om(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:i,monthsValue:a,monthlyPayment:h}},hm=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),pm={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},gm=zt((({className:e,title:t,calcSource:n,buttons:i,footnote:l,paramsViewSettings:r,defaultParams:s,registerSubmit:d,...m})=>{const h=(p=n?.rateRows,im([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],p));var p;const[g,{field:f,onSubmit:x}]=rn({moneyValue:Od(s,2e5),monthsValue:Ld(s,Vd),isAnnuity:Boolean(s?.isAnnuity),isInsurance:Boolean(s?.isEnableInsurance),isSalaryClient:Boolean(s?.isEnableSalaryClient),isPensionClient:Boolean(s?.isEnablePensionClient),isStateEmployee:Boolean(s?.isEnableStateEmployee)});d?.(x);const y=um(g,n,r),b=rm({title:"Тип платежа",orientation:"vertical",...f("isAnnuity")}),{onChange:v}=f("moneyValue"),{onChange:N}=f("monthsValue");return a((()=>{v&&v(ll(g.moneyValue,y.minSum,y.maxSum))}),[y.minSum,y.maxSum]),a((()=>{N&&N(ll(g.monthsValue,y.minMonths,y.maxMonths))}),[y.minMonths,y.maxMonths]),a((()=>{!hm(s)&&h&&sm({field:f,defParams:h,calcParams:y,map:pm,monthsValue:"minMonths"})}),[n,s]),o(Cd,{className:e,title:t,...m,children:c("section",{className:u(Sd,e),children:[c("div",{className:kd,children:[_d({title:"Сумма кредита, ₽",step:500,min:y.minSum,max:y.maxSum,...f("moneyValue"),value:y.moneyValue}),am({title:"Срок кредита, месяцев",min:y.minMonths,max:y.maxMonths,...f("monthsValue"),value:y.monthsValue}),fm({...y,...r},f),o("div",{className:"sm:hidden",children:b})]}),c("div",{className:u(Id,"@4xl:w-1/2"),children:[o(Bd,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(Bd,{title:"Ставка",value:y?.rate,fractionDigits:2,postfix:"%"}),o(Bd,{title:"Ежемесячный платёж",value:y.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:b}),je(i,{isVertical:!0}),Pd(l)]})]})})})),fm=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(ki,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(ki,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(ki,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(ki,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),xm=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,i]=t[n-1],[a,l]=t[n];i>=a?t.splice(n-1,2,[e,Math.max(i,l)]):n++}return t},ym={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},bm=(e,t,n)=>{const{moneyValue:i,monthsValue:a}=e,l=t?.[0]?wm(t[0].minMonths,t[0].maxMonths):0,r=!n?.isShowMonthlyInterestPayment,s=!n?.isShowRemoteRegistration,o=!n?.isShowReplenish,c=!n?.isShowWithdrawn,d=!n?.isShowNewClient,m=t?.find((t=>[Nm({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),Nm({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),Nm({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),Nm({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,Kd(i,["minSum","maxSum"],t),Kd(a||l,["minMonths","maxMonths"],t)].every(Boolean)))||ym,{rate:u}=m,h=vm(u,e),p=i+h,g=t||[ym];return{...m,...Yd(["minSum","maxSum"],g),...Yd(["minMonths","maxMonths"],g),availableMonths:xm(g.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((i,a)=>t>=e?e+a*n:e-a*n)))(e,t))),...e,defaultMonth:l,income:h,finalSum:p}},vm=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:i,monthsValue:a}=t;return n?Math.round(i*Math.pow((1200+e)/1200,a)-i):Math.round(i*e*30*a/365/100)},Nm=({row:e,userInputParams:t,paramKey:n,isExclude:i})=>i||t[n]===e[n],wm=(e,t)=>e+Math.round((t-e)/2),Cm=(e="rub")=>"rub"===e,Sm=(e,t)=>{const{minMonths:n,maxMonths:i}=Yd(["minMonths","maxMonths"],Bm(t,e?.currency)),a=e.monthsValue||Math.round((n+i)/2);return{monthsValue:ll(a,n,i)}},km=(e,t)=>{const{minSum:n,maxSum:i}=Yd(["minSum","maxSum"],Bm(t,e?.currency)),a=e.moneyValue||n;return{moneyValue:ll(a,n,i)}},Im=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),Tm=e=>{const t=Cm(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},Bm=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},Pm=(e,t)=>{const n="rub"!==e?.currency?.key;return c("div",{className:"grid gap-lg",children:[c("div",{className:"flex gap-lg",children:[e.isShowReplenish?qd({title:"Пополнение",...t("isReplenish"),value:e.isReplenish,orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,e.isShowWithdrawn?qd({title:"Снятие",...t("isWithdrawn"),value:e.isWithdrawn,orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null]}),Rm(e.isShowReplenish||e.isShowWithdrawn),c("div",{className:"flex gap-lg",children:[e.isShowMonthlyInterestPayment?$d({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment,orientation:"vertical"}):null,e.isShowRemoteRegistration?(i={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration,orientation:"vertical"},qd({...i,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]}),Rm(e.isShowNewClient),e.isShowNewClient?o(ki,{text:"Новый вкладчик",...t("isNewClient")}):null]});var i},Rm=(e=!1)=>e?o("div",{className:"border-b border-main-divider w-full"}):null,Dm={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum"},Mm={text:"₽",key:"rub"},_m=zt((({className:e,title:t,calcSource:n,buttons:i=[],footnote:r="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[Mm],g=l((e=>t=>e?{...t,...Tm(t),...km(t,e),...Sm(t,e),...Im(t,e)}:t)(h),[h]),[f,{field:x}]=rn({moneyValue:Od(d,2e4),monthsValue:Ld(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:Mm},{normalize:g}),y=x?.("currency")?.value??Mm,b=x?.("isNewClient")?.value,v=Bm(h,y),N=bm(f,v,s),{rate:w,income:C,finalSum:S,type:k=""}=N,I=l((()=>{sm({field:x,defParams:nm(v,b),calcParams:N,monthsValue:"minMonths",map:Dm})}),[x,h]);a((()=>{!hm(d)&&v&&I()}),[d,h]);const T=w===nm(v,b)?.rate;return o(Cd,{className:e,title:t,...m,children:c("section",{className:u(Sd,e),children:[c("div",{className:kd,children:[c("div",{className:"flex gap-m",children:[_d({className:"w-full",title:`Сумма, ${y?.text}`,min:N.minSum,max:N.maxSum,...x("moneyValue"),value:N.moneyValue,postfix:y?.text,step:Am(y?.key)}),h&&h?.length>1?o(zn,{label:"Валюта",options:p,...x("currency")}):null]}),am({title:"Срок, месяцев",min:N.minMonths,max:N.maxMonths,availableMonths:N.availableMonths,...x("monthsValue"),value:N.monthsValue}),Pm({...N,...s},x)]}),Md({rate:w,children:zm(I,T)}),Wd({income:C,finalSum:S,buttons:[...i,Em(n?.buttons,k)],footnotes:[r],postfix:y?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),Am=(e="")=>Cm(e)?1e3:100,Em=(e=[],t="")=>{const{type:n,...i}=e.find((e=>e.type===t))??{};return i},zm=(e,t=!1)=>t?null:o(Oa,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),Fm=e=>Vm({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Vm({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Vm=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:i,viewSettingFieldKey:a})=>!!n&&!n[a]||t[i]===e[i],Om={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},Lm=(e,t,n)=>{const{moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r}=e,s=t?.rateRows||[Om],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Fm({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Hd(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Hd(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r})=>e?.find((e=>Fm({row:e,userInputParams:t,paramsViewSettings:n})&&Kd(i+r,["minSum","maxSum"],e)&&Kd(l,["minSumOld","maxSumOld"],e)&&Kd(r,["minSumExtra","maxSumExtra"],e)&&Kd(a,["minMonths","maxMonths"],e)))||Om)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r}),{rate:p}=h,g=om(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r,monthlyPayment:g,benefit:f}},jm=zt((({className:e="",title:t,calcSource:n,buttons:i,footnote:a,paramsViewSettings:l,...r})=>{const[s,{field:d}]=rn({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),m=Lm(s,n,l),h=rm({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")});return o(Cd,{className:e,title:t,...r,children:c("section",{className:u(Sd,e),children:[c("div",{className:kd,children:[_d({title:"Остаток долга в других банках, ₽ ",step:500,min:m.minSum,max:m.maxSum-m.maxSumExtra,...d("moneyValue"),value:m.moneyValue}),_d({title:"Ежемесячный платёж в других банках, ₽",step:500,min:m.minSumOld,max:m.maxSumOld,...d("oldMonthlyPayment"),value:m.oldMonthlyPayment}),am({title:"Новый срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),qm({...m,...l},d),m.isExtraMoney?_d({title:"Дополнительная сумма, ₽ ",step:500,min:m.minSumExtra,max:m.maxSumExtra,...d("moneyExtra"),value:m.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:h})]}),c("div",{className:u(Id,"@4xl:w-1/2"),children:[o(Bd,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(Bd,{title:"Ставка",value:m?.rate,fractionDigits:2,postfix:"%"}),o(Bd,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),m.benefit>0?o(Bd,{title:"Выгода в месяц",value:m.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:h}),je(i,{isVertical:!0}),Pd(a)]})]})})})),qm=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(ki,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(ki,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(ki,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),$m=d((e=>{const{onChange:t,min:n,max:i,defaultValue:a="0",fractionDigits:r=0,...s}=e,c=al(e,{normalize:(e=a)=>n&&i?String(ll(Number(Um(e)),n,i)):Um(e),format:We(r)}),d=l((e=>t&&t(Um(e))),[t]);return o(xn,{onChange:d,...s,...c})})),Um=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Wm=d((e=>o($m,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(_e,{size:"text-xl",font:"font-light",children:"₽"})})}))),Hm={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},Ym={amount:1500},Km=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:l,formType:r="private",...s})=>{const[{amount:d},{field:m}]=rn(Ym),[h,p]=i(!1);return a((()=>{p(d<=0)}),[d]),c(g,{className:u("flex flex-col items-center",e),defaultPadding:"p-6xl",...s,children:[t?o(w,{className:"pb-lg xl:pb-4xl self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-[468px]",method:"POST",action:Hm[r],children:[o(Wm,{valid:!h,label:n,max:3e5,min:1,...m("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:d}),l?.text?o(Oa,{className:"w-full mt-lg",type:"submit",disabled:h,children:l.text}):null]})]})})),Gm=({className:e,text:t="ХИТ"}={})=>c("div",{className:u("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(W,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(C,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),Xm="relative h-full",Jm={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},Zm=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...i})=>{const{blocks:a}=i.block||{},l=a?.some(tu),r=n?{defaultPadding:"p-6xl pb-m"}:{};return D({...i,renderProps:(n,i,a)=>c("div",{className:Qm(n,{someCardsHighlighted:l}),children:[B(n,i,{className:eu(n,{someCardsHighlighted:l,showBorder:!e,cardSize:t}),...r,blockIndex:a}),tu(n)?Gm({className:"absolute top-0 -right-4 z-40"}):null]},String(a))})},Qm=(e,{someCardsHighlighted:t})=>u(Xm,t&&(tu(e)?"pt-3xl":"pt-3xl sm:pt-16")),eu=(e,{someCardsHighlighted:t,showBorder:n,cardSize:i="normal"})=>u(Xm,"min-w-80",Jm[i],t&&(tu(e)?"pt-3xl sm:pt-16":"pt-3xl"),pc(n),n&&"h-full"),tu=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,nu=zt((({className:e,visibleItemCount:t=0,noCardBorder:n,arrowsPadded:i=!0,isGap:a=!0,cardSize:l="normal",isNavButtons:r=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o($c,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:a?16:0,padding:0,arrowsPadded:i,navButtons:r?iu(s?.block?.blocks):[],hasBlur:!0,children:Zm({noCardBorder:n,cardSize:l,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),iu=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],au="z-10 border border-solid w-full h-full",lu=u(au,"absolute hidden @xl:block border-transparent"),ru=d((({className:e,title:t,description:n,button:i,...a})=>o(g,{className:u("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...a,children:c("div",{className:"relative h-full",children:[o("div",{className:u(lu,"top-9 right-12 bg-green-dark")}),o("div",{className:u(lu,"top-6 right-8 bg-green")}),o("div",{className:u(lu,"top-3 right-4 bg-green-light")}),c("div",{className:u(au,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(k,{title:t,description:n,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),je([i],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),su={black:"bg-black",white:"bg-white"},ou=d((({className:e="",title:t,description:n,image:i,price:a,button:l,colors:r=[],align:s="text-left",padding:d,...m})=>o(g,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Te,{className:"h-full",padding:d,title:o(k,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:i?.src?o(ne,{className:"flex justify-center align-center mb-xl",image:i}):null,buttons:je([l],{buttonClassName:"w-full self-end"}),children:[r?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(_e,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(cu)]}):null,a?c(_e,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),cu=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${su[e]}`},String(t)),du=d((({icon:e,...t})=>{const n=he(),{text:i,href:a,target:l,onClick:r}=n(t);return i?o("div",{className:u("p-3 rounded-lg bg-white text-secondary-text flex justify-center"),children:o("a",{role:"link",href:a,target:l,onClick:r,children:c("div",{className:"flex flex-col items-center gap-3 break-words max-w-[150px]",children:[e?o(ne,{className:"w-7 h-7 md:w-12 md:h-12",image:{...e,iconVersion:e?.iconVersion},alt:i}):null,o("div",{className:"font-light md:font-normal text-primary-text text-center text-xs md:text-sm whitespace-wrap",children:i})]})})}):null})),mu=d((({className:e,additionalDescription:t,description:n,links:i,title:a,...l})=>o(g,{defaultPadding:"p-5xl",className:u("overflow-hidden",e),...l,children:c("div",{className:"flex flex-col lg:flex-row gap-5 justify-between",children:[c("div",{className:"flex-1",children:[o(k,{isEmbedded:!0,title:a,description:n,as:"h1",align:"text-left",headlineVersion:"XL"}),o(k,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),i?.length?uu(i):null]})}))),uu=e=>o("div",{className:u("lg:grid-cols-9 lg:[&>*]:col-span-2 lg:[&>*:nth-child(14n+2)]:col-span-3 lg:[&>*:nth-child(7n+5)]:col-span-3","lg:[&>*:nth-child(7n+6)]:col-span-3 lg:[&>*:nth-child(7n+7)]:col-span-3 lg:[&>*:nth-child(14n+10)]:col-span-3 lg:w-3/6","grid-cols-3 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+3)]:col-span-2 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+4)]:col-span-2","grid gap-3 lg:gap-5"),children:e.map(((e,t)=>o(du,{...e},String(t))))}),hu=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"mindboxEvent"===e?{...n,eventJson:t}:n}))),pu=d((({className:e="",href:t,target:n,onClick:i,data:a,children:l})=>{const r=he()({href:t,target:n,onClick:i});return o(t?"a":"div",{className:u("block",e),...t?r:{},role:t?"link":"none",...ge(a),children:l})})),gu=[{origins:["t.me","telegram.org"],iconMapped:{icon:"TelegramIcon"}},{origins:["vk.com"],iconMapped:{icon:"VKIcon"}},{origins:["ok.ru"],iconMapped:{icon:"OkIcon"}},{origins:["apps.apple.com"],iconMapped:{icon:"AppleIcon"}},{origins:["play.google.com"],iconMapped:{icon:"PlayMarketIcon"}},{origins:["appgallery.huawei.com"],iconMapped:{icon:"HuaweiIcon"}},{origins:["youtube.com"],iconMapped:{icon:"YoutubeIcon"}},{origins:["rutube.ru"],iconMapped:{icon:"RutubeIcon"}},{origins:["dzen.ru"],iconMapped:{icon:"DzenIcon"}},{origins:["rustore.ru"],iconMapped:{icon:"RustoreIcon"}}],fu=d((({className:e="",media:t,showButtonText:n,stretched:a,version:l="white",children:r})=>{if(!t?.length)return null;const[s,d]=i(),m=t?.map((e=>{const{href:t,icon:i,text:a}=e,{iconMapped:r}=(e=>gu.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=Le(i)?i:r,c=n?{text:a}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&a&&d(!0),{...e,...c,icon:{...o,iconVersion:m},version:e?.version??l}})),h=u("border border-solid hover:border-transparent border-main-divider","group-data-primary:border-main-divider group-data-gray:border-green group/media",{"basis-auto":!n&&!s},xu(a));return c("div",{className:u("flex flex-col gap-m xl:gap-xs",e),"aria-label":"Социальные сети",children:[o("div",{className:"flex gap-xs",children:je(m,{className:yu(s??!1,a??!1,n),buttonClassName:h})}),r?o(_e,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),xu=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",yu=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),bu=d((({className:e,padding:t,description:n,additionalDescription:i,href:a,icon:l,isDotted:r,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:x=!0,isImageAlwaysOnRight:y=false,isImageSecondary:b=!1}={},data:v,...N})=>o(g,{className:u("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...N,children:o(pu,{href:a,target:m,className:"h-full",data:hu(v),children:c(Te,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(k,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...Ze(Le(l)?o(ne,{image:l}):null,x),buttons:d.length?o(fu,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:y,isImageSecondary:b,imageAlign:"center",children:[o(Oe,{benefits:f}),s?o(De,{__html:s,isDotted:r,itemSize:"list-s"}):null,vu(i,p)]})})}))),vu=(e,t)=>e?o(C,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,Nu=(e,t)=>{const{title:n,description:i,buttons:a}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(_e,{size:"text-m",color:"text-secondary-text",children:n})}):null,i?o("div",{className:"mt-2xs",children:o(_e,{size:"text-xl",color:"text-primary-text",children:i})}):null,a?.length?o("div",{className:"text-primary-main",children:je(a)}):null]},String(t))},wu=d((({className:e="",title:t,align:n="text-center",icon:l,button:r,visibleCellsCount:s=1,cardCells:d=[],options:m,data:h,...p})=>{const f=d.map(Nu),[x,y]=s>0?[f.slice(0,s),f.slice(s)]:[f,[]],[b,v]=i(!1);return a((()=>de.subscribe("fold",(e=>{e&&void 0!==m?.parent&&e.parent===m?.parent&&v(e.isUnfolded)}))),[m?.parent]),c(g,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...p,children:[Le(l)?o("div",{className:"self-center",children:o(ne,{image:l})}):null,t?o(w,{className:u("pt-xs",n),headingType:"h5",title:t}):null,r?.text?o(ve,{className:"w-full mt-m mb-lg",...r}):null,y.length?o(ea,{renderFoldableSection:()=>c("div",{children:[x,o(ta,{isUnfolded:b,children:y})]}),renderFoldButton:d.length>=s?Cu(m?.parent,h,b):null}):o("div",{children:x})]})})),Cu=(e,t,n=!1)=>()=>c("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:()=>{void 0!==e&&de.fire("fold",{type:"fold",isUnfolded:!n,parent:e})},type:"button",...n?ge(t):{},children:[o("div",{children:n?"Скрыть":"Подробнее о тарифе"}),o(W,{className:"text-primary-text",name:n?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),Su=()=>{const e=globalThis.sessionStorage?.getItem("refreshToken"),t=globalThis.sessionStorage?.getItem("accessToken"),n=globalThis.localStorage.getItem("taskId");if(!t||!e||!n)return globalThis.location.href="/",()=>null;const i=async()=>{const n=await Ji("/auth/refresh","POST",{refresh_token:e,access_token:t});if(n){ku(n.status);const e=await n.json();globalThis.sessionStorage.setItem("refreshToken",e.refresh_token),globalThis.sessionStorage.setItem("accessToken",e.access_token)}};i();const a=setInterval(i,24e4);return()=>clearInterval(a)},ku=e=>{401==e&&(globalThis.location.href="/")},Iu=d((({step:e=10,description:t,showPercentage:n=!0})=>c("div",{children:[o("div",{className:"h-4 w-full bg-gray relative",children:o("div",{className:"h-4 bg-green",style:{width:`${e}%`}})}),c("div",{className:"relative",children:[n?c("div",{className:"absolute left-2/4 text-green",children:[e,"%"]}):null,t?o("div",{className:"text-right mr-4 text-gray",children:t}):null]})]}))),Tu=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const i=r((()=>(e+1)/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e+1," из ",t,"."]}),n[e]||null,o(Iu,{step:i,showPercentage:!1})]})})}));var Bu;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.rework="REVISION"}(Bu||(Bu={}));const Pu=e=>Xi("/user-data/getTaskStatus","POST",e),Ru=e=>Ji("/user-data/sendSignalToProcess","POST",e),Du=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black",link:i})=>c("div",{className:"flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m",children:[o("div",{className:"rounded-full bg-white p-xs",children:o(W,{name:t,width:"24",height:"24",iconVersion:n})}),c("div",{className:"",children:[o(De,{__html:e}),i?.text?o(ve,{className:"text-primary-main",children:i.text}):null]})]}))),Mu=d((({interval:e=0,intervalExpireAction:t=(()=>null),title:n,__html:a})=>{const[l,r]=i(e),s=100-(e-l)/e*100;return c("div",{children:[n?o(k,{title:n,headlineVersion:"S"}):null,c("div",{className:"flex justify-center items-center flex-col",children:[c("div",{className:u("relative flex items-center justify-center w-24 h-24 rounded-full bg-gray text-transparent mb-5"),children:[o("div",{className:"absolute inset-0 rounded-full",style:{background:`conic-gradient(rgb(66, 171, 68) ${s}%, rgb(125, 126, 127) 0deg)`}}),o("div",{className:"z-10 flex items-center justify-center px-4 py-2 rounded-full w-20 h-20 bg-white text-primary-text text-m",children:o(_o,{interval:e,time:l,setTime:e=>{0===e&&t(),r(e)}})})]}),a?o(De,{__html:a}):null]})]})})),_u=d((({title:e,description:t,infoCard:n,sectionInfoTitle:i,sectionInfo:a,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(Mu,{interval:d}):null]}),o(Au,{title:i,items:a}),o(Au,{title:l,items:r,countColumns:!0}),n?.__html?o(Du,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(ve,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),Au=({title:e,items:t,countColumns:n=!1})=>{const i=Se();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(_e,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",Qs(n||i?1:2)),children:t.map(((e,t)=>o("div",{children:Eu(e)},t)))}):null]})]}):null},Eu=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(_e,{color:"text-secondary-text",size:"text-l",children:e}),o(_e,{color:"text-primary-text",size:"text-xl",children:t})]}),zu=d((()=>o(_u,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Fu=d((()=>{const[e]=go("leadForm");return o(_u,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:e?.cardCategory?.text}]})})),Vu=d((()=>{const[e]=go("leadForm");return o(_u,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Ou=d((()=>{const[e]=go("leadForm");return o(_u,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),Lu=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],ju=d((()=>{const[e,t]=i(Bu.process),[n]=go("taskId");return a((()=>{(async()=>{for(const e of Lu)await Ru({signalType:e,taskId:n})})();const e=l((async()=>{const e=await Pu({taskId:n});e&&e?.statusCd!==Bu.process&&(clearInterval(i),t(e.statusCd))}),[]),i=setInterval(e,3e4)}),[]),qu(e)})),qu=e=>({IN_PROCESS:o(Fu,{}),CANCELLED:o(zu,{}),APPROVED:o(Ou,{}),REVISION:o(Vu,{})}[e]||null),$u=[{paymentSystem:"",currency:"rub",codeWord:""},{surname:"",name:"",middleName:"",sex:"",birthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0,methodObtain:"office",addressCourier:{fullAddress:"",fiasCode:""}},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:"",addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:"office",deliveryDate:void 0}],Uu=e=>{if(e)try{return new Date(e)}catch(e){return}},Wu=e=>(t,n)=>t.filter((e=>e)).map((t=>[Hu(n,e),Yu(t,e),Ku(t,e),Gu(t,e),Xu(t,e),Ju(t,e)].some(Boolean)?{...t,required:!1}:t)),Hu=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Yu=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Ku=({name:e},t)=>"snils"===e&&!t("consentPfrFlg"),Gu=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Xu=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Ju=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const i=t(e?.name);return n!==(i?.key??i)})),Zu=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(Du,{__html:e},`${t}_${n}`))):null},Qu=({field:e,inputs:t})=>t.map(Zs(e,"")),eh=({sections:e,field:t,step:n})=>e?.map((({inputs:e=[],columns:i,title:a},l)=>{const r=Wu(th(t))(e,n),s=r.filter((e=>!Ju(e,th(t))));return c("div",{className:u(Qs(i),"grid gap-x-m"),children:[Zu(s),eo(a),Qu({field:t,inputs:r})]},`section-${l}`)})),th=e=>t=>e(t)?.value,nh=d((({step:e,onPrevStep:t})=>{const n=6===e;return c("div",{className:"flex justify-between gap-m",children:[o(Oa,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(Oa,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),ih=e=>{const{methodObtain:t,deliveryDate:n=""}=e;return{courierDeliveryFlg:"courier"===t,deliveryDate:(i=n,i?new Date(i).toISOString().split(".")[0]:""),deliveryTimeCd:{value:"TIME_2"}};var i},ah=(e,t)=>{switch(e){case 0:return(e=>{const{currency:t,paymentSystem:n,cardCategory:i,codeWord:a}=e;return{currencyCode:t,paymentSystemTypeCd:n,classCard:i,codeWord:a}})(t);case 1:return(e=>{const{name:t,surname:n,middleName:i,birthday:a="",phone:l="",email:r,sex:s,birthPlace:o,dulIssueDateField:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:y}=e;return{birthDate:Lt(a,!0),midname:i,name:t,surname:n,birthPlace:o,dulIssueDate:Lt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:Lt(g,!0),houseTypeCd:f,participantContacts:tc({phone:jt(l),email:r}),participantAddresses:nc({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{employment:t,organizationName:n,inn:i,legalForm:a,organization:l,amountWorkers:r,employerActivities:s,employerOrganization:o,generalSeniority:c,lastJobExperience:d,experience5Years:m,jobsNumber:u,organizationPhone:h,organizationAddress:p,positionOrganization:g}=e;return{employmentTypeCd:t,organizationName:n,organizationInn:i,organizationActivityTypeCd:s,organizationTypeCd:l,organizationKindCd:o,employeesNumberCd:r,opf:a,seniority:c,generalSeniority:m,jobsNumber:u,lastWorkDuration:d,payrollCardRshbFlg:!0,positionCd:g,participantContacts:tc({organizationPhone:h&&jt(h)}),participantAddresses:nc({organizationAddress:p})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:i,wages:a,mandatoryPayments:l,incomeAverage:r,additionalIncome:s,otherIncome:o,otherPayments:c,rentalIncome:d,retirementIncome:m,snils:u,armyIdFlg:h}=e;return{maritalStatusCd:t,totalDependents:i,otherDependents:n,participantIncomes:ic({wages:a,mandatoryPayments:l,incomeAverage:r,additionalIncome:s,otherIncome:o,otherPayments:c,rentalIncome:d,retirementIncome:m}),snils:u?.replaceAll(" ",""),armyIdFlg:h}})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:i,creditInRshbCd:a}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:i,creditInRshbCd:a}})(t);case 5:return(e=>{const{addressCourier:t}=e;return{participantAddresses:nc({addressCourier:t})}})(t);default:return{}}},lh=({step:e,inputs:t,onNextStep:n,saveStep:i,finishForm:a})=>{const[r]=go("taskId"),[s]=go("profileId"),[o]=go("participantId"),c=l((async l=>{const c=io(ii(Wu(rh(l))(t,e)));if(console.log(ii(Wu(rh(l))(t,e))),!Fn(c(l)))return console.warn("validation fail");i(l);try{r&&s&&o&&await So((({participantId:e,taskId:t,profileId:n,formData:i,step:a=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:globalThis.location.origin,id:t,office:{id:"650"},authorizedAgentId:i?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...ah(a,i)}],...ih(i)}}))({participantId:o,taskId:r,profileId:s,step:e,formData:l}))}catch(e){return"Fail"}return n(),5===e&&a?.(!0),"OK"}),[]);return{handleSubmit:c}},rh=e=>t=>e[t],sh=d((({step:e,sections:t,onPrevStep:n,onNextStep:i,isFormFinished:a,finishForm:r})=>{const[d,m]=go("leadForm"),u=((e,t)=>({...$u[e],...t,birthday:Uu(t?.birthday),dulIssueDateField:Uu(t?.dulIssueDateField),participantDateRegistration:Uu(t?.participantDateRegistration),beginDate:Uu(t?.beginDate),deliveryDate:Uu(t?.deliveryDate)}))(e,d),h=s(void 0),p=t?.flatMap((e=>e?.inputs))||[],g=l((e=>{h.current=e}),[]),{handleSubmit:f}=lh({step:e,inputs:p,onNextStep:i,saveStep:m,finishForm:r}),[,{field:x,onSubmit:y}]=rn(u,{onSubmit:(e,t)=>{f({...e,...h.current?.(t)})}});return a?o(ju,{}):c("form",{onSubmit:y,className:"space-y-m",children:[eh({sections:t,field:x,step:e,registerSubmit:g}),o(nh,{step:e,onPrevStep:n})]})})),oh=[[{title:"Параметры карты",inputs:[]},{inputs:[{fieldType:"common",name:"currency",required:!0},{fieldType:"common",name:"paymentSystem",required:!0},{fieldType:"common",name:"cardCategory",required:!0},{fieldType:"common",name:"codeWord",required:!0}]}],[{title:"Персональные данные",columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"name",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"middleName",dadata:!0,filledByEsia:!0},{fieldType:"common",name:"sex",required:!0},{fieldType:"common",name:"birthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0},{fieldType:"common",name:"phone",required:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{fieldType:"common",name:"dulSerie",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulNumber",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulIssueDateField",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{fieldType:"common",name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"addressMatch"}]},{columns:2,inputs:[{fieldType:"common",name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{fieldType:"common",name:"housing",required:!0}]},{inputs:[{fieldType:"common",name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{fieldType:"info",text:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{fieldType:"common",name:"employment"},{fieldType:"common",name:"organizationName",required:!0,dadata:!0}]},{columns:2,inputs:[{fieldType:"common",name:"inn",required:!0,dadata:!0},{fieldType:"common",name:"legalForm",required:!0}]},{inputs:[{fieldType:"common",name:"organization",required:!1},{fieldType:"common",name:"amountWorkers",required:!1}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!1},{fieldType:"common",name:"employerOrganization",required:!1},{fieldType:"common",name:"generalSeniority",required:!0},{fieldType:"common",name:"lastJobExperience",required:!0},{fieldType:"common",name:"experience5Years",required:!0},{fieldType:"common",name:"jobsNumber",required:!0}]},{inputs:[{fieldType:"common",name:"organizationPhone",label:"Телефон работодателя",required:!0},{fieldType:"common",name:"beginDate",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"positionOrganization",required:!1},{fieldType:"common",name:"partInBusiness",required:!0}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{fieldType:"common",name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{fieldType:"common",name:"familyStatus",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"dependents",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"familyMembers"},{fieldType:"common",name:"children",required:!0}]},{title:"Совокупный доход"},{inputs:[{fieldType:"info",text:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{fieldType:"common",name:"wages",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"snils",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"conscription",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"disablePeopleFlg"}]},{inputs:[{fieldType:"common",name:"bankruptcyFlg"}]},{inputs:[{fieldType:"common",name:"shareholderFlg"}]},{inputs:[{fieldType:"common",name:"legalEntityName"}]},{inputs:[{fieldType:"common",name:"creditInRshbCd"}]}],[{title:"Способ получения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"methodObtain"}]},{title:"Адрес",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0,condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]},{inputs:[{fieldType:"info",text:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код",condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"bankEmployeeCode",condition:{name:"methodObtain",values:["office"]}}]}]],ch=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],dh=d((({className:e,...t})=>{const[n,d]=i(0),m=s(null),h=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);a(Su,[]);const p=l((()=>{d((e=>Math.min(e+1,6))),h()}),[]),f=l((()=>{d((e=>Math.max(e-1,0))),h()}),[]),x=r((()=>oh[n]),[n]),[y,b]=i(!1);return o(g,{className:u("bg-transparent",e),defaultPadding:"p-0",...t,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[y?null:o(Tu,{stepsTitles:ch,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(sh,{step:n,sections:x,onNextStep:p,onPrevStep:f,isFormFinished:y,finishForm:b},String(n))})]})})})),mh=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const i=r((()=>e/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e," из ",t,"."]}),n[e]||null,o(Iu,{step:i,showPercentage:!1})]})})})),uh=d((({title:e,description:t,infoCard:n,sectionInfoTitle:i,sectionInfo:a,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,intervalExpireAction:m=(()=>{}),...u})=>c(g,{...u,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(Mu,{interval:d,intervalExpireAction:m}):null]}),o(hh,{title:i,items:a}),o(hh,{title:l,items:r,countColumns:!0}),n?.__html?o(Du,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(ve,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),hh=({title:e,items:t,countColumns:n=!1})=>{const i=Se();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(_e,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",Qs(n||i?1:2)),children:t.map(((e,t)=>o("div",{children:ph(e)},t)))}):null]})]}):null},ph=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(_e,{color:"text-secondary-text",size:"text-l",children:e}),o(_e,{color:"text-primary-text",size:"text-xl",children:t})]}),gh=d((()=>o(uh,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),fh=d((({handleExpireTimer:e})=>{const[t]=go("leadForm");return o(uh,{interval:300,intervalExpireAction:e,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:t?.moneyValue?.toLocaleString()+" ₽"},{label:"Срок кредита",description:t?.monthsValue+" мес"},{label:"Тип платежа",description:t?.isAnnuity?"Аннуитетный":"Дифференцированный"}]})})),xh=d((()=>{const[e]=go("leadForm");return o(uh,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),yh=d((()=>{const[e]=go("leadForm");return o(uh,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),bh=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],vh=d((()=>{const[e,t]=i(Bu.process),[n]=go("taskId");a((()=>{(async()=>{for(const e of bh)await Ru({signalType:e,taskId:n})})();const e=setInterval((()=>n&&Pu({taskId:n}).then((n=>{n?.statusCd&&n.statusCd!==Bu.process&&(clearInterval(e),t(n.statusCd))}))),3e4);return()=>clearInterval(e)}),[]);return Nh(e,(()=>t(Bu.rework)))})),Nh=(e,t)=>({IN_PROCESS:o(fh,{handleExpireTimer:t}),CANCELLED:o(gh,{}),APPROVED:o(yh,{}),REVISION:o(xh,{})}[e]||null),wh=[{moneyValue:0,monthsValue:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1},{surname:"",name:"",middleName:"",sex:"",birthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:"",addressRetail:void 0,bankEmployeeCode:void 0}],Ch=e=>{if(e)try{return new Date(e)}catch(e){return}},Sh=e=>(t,n)=>t.filter((e=>e)).map((t=>[kh(n,e),Ih(t,e),Th(t,e),Bh(t,e),Ph(t,e),Rh(t,e)].some(Boolean)?{...t,required:!1}:t)),kh=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Ih=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Th=({name:e},t)=>"snils"===e&&!t("consentPfrFlg"),Bh=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Ph=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Rh=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const i=t(e?.name);return n!==(i?.key??i)})),Dh=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(Du,{__html:e},`${t}_${n}`))):null},Mh=({field:e,inputs:t})=>t.map(Zs(e,"")),_h=({sections:e,field:t,step:n})=>e?.map((({inputs:e=[],columns:i,title:a},l)=>{const r=Sh(Ah(t))(e,n);return c("div",{className:u(Qs(i),"grid gap-x-m"),children:[Dh(r),eo(a),Mh({field:t,inputs:r})]},`section-${l}`)})),Ah=e=>t=>e(t)?.value,Eh=d((({step:e,onPrevStep:t})=>{const n=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Oa,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(Oa,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),zh=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},Fh={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},Vh=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:i}=e;return{loanAmount:t,creditPeriod:n,paymentTypeCd:Fh[i?"annuity":"differential"]}},Oh=(e,t)=>{switch(e){case 0:default:return{};case 1:return(e=>{const{name:t,surname:n,middleName:i,birthday:a="",phone:l="",email:r,sex:s,birthPlace:o,dulIssueDateField:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:y}=e;return{birthDate:Lt(a,!0),midname:i,name:t,surname:n,birthPlace:o,dulIssueDate:Lt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:Lt(g,!0),houseTypeCd:f,participantContacts:tc({phone:jt(l),email:r}),participantAddresses:nc({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{employment:t,organizationName:n,inn:i,legalForm:a,organization:l,amountWorkers:r,employerActivities:s,employerOrganization:o,generalSeniority:c,lastJobExperience:d,experience5Years:m,jobsNumber:u,organizationPhone:h,organizationAddress:p,positionOrganization:g}=e;return{employmentTypeCd:t,organizationName:n,organizationInn:i,organizationActivityTypeCd:s,organizationTypeCd:l,organizationKindCd:o,employeesNumberCd:r,opf:a,seniority:c,generalSeniority:m,jobsNumber:u,lastWorkDuration:d,payrollCardRshbFlg:!0,positionCd:g,participantContacts:tc({organizationPhone:h&&jt(h)}),participantAddresses:nc({organizationAddress:p})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:i,confirmationIncome:a,wages:l,mandatoryPayments:r,incomeAverage:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u,snils:h,armyIdFlg:p}=e;return{maritalStatusCd:t,totalDependents:i,incomeCertificateCd:a,otherDependents:n,participantIncomes:ic({wages:l,mandatoryPayments:r,incomeAverage:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u}),snils:h?.replaceAll(" ",""),armyIdFlg:p}})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:i,creditInRshbCd:a}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:i,creditInRshbCd:a}})(t)}},Lh=({step:e,inputs:t,onNextStep:n,saveStep:i,finishForm:a})=>{const[r]=go("taskId"),[s]=go("profileId"),[o]=go("participantId"),c=l((async l=>{const c=io(ii(Sh(jh(l))(t,e)));if(!Fn(c(l)))return console.warn("validation fail");i(l);try{r&&s&&o&&await So((({participantId:e,taskId:t,profileId:n,formData:i,step:a=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:globalThis.location.origin,id:t,office:{id:""},authorizedAgentId:i?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Oh(a,i)}],...Vh(i),...zh(i),esiaAccountTypeCd:{key:i?.esiaAccountTypeCd?.key}}}))({participantId:o,taskId:r,profileId:s,step:e,formData:l}))}catch(e){return"Fail"}return n(),5===e&&a?.(!0),"OK"}),[]);return{handleSubmit:c}},jh=e=>t=>e[t],qh=d((({step:e,sections:t,onPrevStep:n,onNextStep:i,renderStep:a=_h,isFormFinished:r,finishForm:d})=>{const[m,u]=go("leadForm"),h=((e,t)=>({...wh[e],...t,birthday:Ch(t?.birthday),dulIssueDateField:Ch(t?.dulIssueDateField),participantDateRegistration:Ch(t?.participantDateRegistration),beginDate:Ch(t?.beginDate),deliveryDate:Ch(t?.deliveryDate)}))(e,m),p=s(void 0),g=t?.flatMap((e=>e?.inputs))||[],f=l((e=>{p.current=e}),[]),{handleSubmit:x}=Lh({step:e,inputs:g,onNextStep:i,saveStep:u,finishForm:d}),[,{field:y,onSubmit:b}]=rn(h,{onSubmit:(e,t)=>{x({...e,...p.current?.(t)})}});return r?o(vh,{}):c("form",{onSubmit:b,className:"space-y-m",children:[a({sections:t,field:y,step:e,registerSubmit:f}),o(Eh,{step:e,onPrevStep:n})]})})),$h=[[],[{title:"Персональные данные",columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"name",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"middleName",dadata:!0,filledByEsia:!0},{fieldType:"common",name:"sex",required:!0},{fieldType:"common",name:"birthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0,filledByEsia:!0},{fieldType:"common",name:"phone",required:!0,filledByEsia:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{fieldType:"common",name:"dulSerie",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulNumber",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulIssueDateField",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{fieldType:"common",name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"addressMatch"}]},{columns:2,inputs:[{fieldType:"common",name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{fieldType:"common",name:"housing",required:!0}]},{inputs:[{fieldType:"common",name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{fieldType:"info",text:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{fieldType:"common",name:"employment"},{fieldType:"common",name:"organizationName",required:!0,dadata:!0}]},{columns:2,inputs:[{fieldType:"common",name:"inn",required:!0,dadata:!0},{fieldType:"common",name:"legalForm",required:!0}]},{inputs:[{fieldType:"common",name:"organization",required:!1},{fieldType:"common",name:"amountWorkers",required:!1}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!1},{fieldType:"common",name:"employerOrganization",required:!1},{fieldType:"common",name:"generalSeniority",required:!0},{fieldType:"common",name:"lastJobExperience",required:!0},{fieldType:"common",name:"experience5Years",required:!0},{fieldType:"common",name:"jobsNumber",required:!0}]},{inputs:[{fieldType:"common",name:"organizationPhone",label:"Телефон работодателя",required:!0},{fieldType:"common",name:"beginDate",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"positionOrganization",required:!1},{fieldType:"common",name:"partInBusiness",required:!0}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{fieldType:"common",name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{fieldType:"common",name:"familyStatus",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"dependents",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"familyMembers"},{fieldType:"common",name:"children",required:!0}]},{title:"Совокупный доход"},{inputs:[{fieldType:"info",text:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{fieldType:"common",name:"confirmationIncome",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"wages",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"snils",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"conscription",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"disablePeopleFlg"}]},{inputs:[{fieldType:"common",name:"bankruptcyFlg"}]},{inputs:[{fieldType:"common",name:"shareholderFlg"}]},{inputs:[{fieldType:"common",name:"legalEntityName"}]},{inputs:[{fieldType:"common",name:"creditInRshbCd"}]}],[{title:"Отделение Банка",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0}]},{inputs:[{fieldType:"common",name:"addressRetail",required:!0}]},{title:"Код представителя Банка",columns:1,inputs:[]},{inputs:[{fieldType:"info",text:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{inputs:[{fieldType:"common",name:"bankEmployeeCode"}]}]],Uh=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Отделение Банка"],Wh=d((({className:e,...t})=>{const[n,d]=i(0),m=s(null),h=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);a(Su,[]);const p=l((()=>{d((e=>Math.min(e+1,5))),h()}),[]),f=l((()=>{d((e=>Math.max(e-1,0))),h()}),[]),x=r((()=>$h[n]),[n]),y=0===n,[b,v]=i(!1);return o(g,{className:u("bg-transparent",e),defaultPadding:"p-0",...t,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[y||b?null:o(mh,{stepsTitles:Uh,step:n,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(qh,{step:n,sections:x,onNextStep:p,onPrevStep:f,isFormFinished:b,finishForm:v,renderStep:y?({registerSubmit:e,field:t})=>o(gm,{defaultParams:{sum:t("moneyValue").value,period:t("monthsValue").value,isAnnuity:t("isAnnuity").value},title:"Калькулятор кредита",footnote:"Расчёт является предварительным. Точные условия будут предоставлены в отделении Банка.",calcSource:{$ref:"/wcms-resources/credit-calculator-data.json"},registerSubmit:e}):void 0},String(n))})]})})})),Hh=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,Yh=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),Kh=1e9,Gh={sum:{min:1e4,max:Kh},period:3},Xh=zt((({className:e,filtrationSchema:t={},resetButton:n,sumInput:i,periodInput:a,...l})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=cd(Gh,{block:l.block,page:l.options?.page,normalize:e=>({...e,period:Jh(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=Zh(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...l,children:[o(nd,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(Wm,{label:i?.title,min:500,max:Kh,...d("sum",{parse:e=>({min:Number(e),max:Kh}),format:({min:e})=>String(e)})}),o(dl,{title:a?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(Zc,{blocksToRender:r,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),Jh=e=>Dt((e?.paramsSource?.rateRows||[]).filter(Hh).flatMap((e=>Yh(e.minMonths,e.maxMonths)))),Zh=e=>Dt(e.flatMap((e=>e||[])).filter(Hh).flatMap((e=>Yh(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],Qh=[{key:"10"},{key:"50"},{key:"100"}],ep=({itemCount:e,onItemCountChange:t})=>{const n=l((({key:e})=>t(Number(e))),[]);return c("div",{className:"mt-2 @lg:mt-0 items-center gap-s hidden @lg:flex",children:[o("span",{children:"Показать по"}),o(Mn,{className:"min-w-20",onChange:n,value:{key:String(e)},options:Qh,iconVersion:"black"})]})},tp="py-m @lg:px-lg px-m rounded-md cursor-pointer text-center min-w-10 @lg:min-w-0 hover:bg-primary-hover hover:text-white",np=(e,t)=>{const{currentPage:n,onPageChange:i,totalPages:a}=e,l=t+1;return l===n?o("div",{"aria-current":"true",className:"py-m @lg:px-lg px-m bg-primary-main text-center min-w-10 @lg:min-w-0 text-white rounded-md",children:l},String(t)):1!==l&&l!==a&&((e,t,n)=>e<t&&e>=t-1||e<=t+1&&e>t||((e,t,n)=>t<=2&&e<=t+2||t>=n-1&&e>=n-3)(e,t,n))(l,n,a)?o("div",{onClick:()=>i(l),className:tp,"aria-label":`Страница ${l}`,children:l},String(t)):null},ip={width:"24",height:"24"},ap=({currentPage:e,onPageChange:t,totalPages:n})=>{const i=r((()=>Array.from({length:n}).fill({currentPage:e,onPageChange:t,totalPages:n})),[n,e]),a=l((()=>{e>1&&t(e-1)}),[e]),s=l((()=>{e<n&&t(e+1)}),[e,n]),d=l((()=>t(1)),[]),m=l((()=>t(n)),[n]);return c("div",{className:"flex gap-m items-center",children:[o("div",{onClick:a,children:o(W,{name:"ArrowLeftIcon",iconVersion:"black",imageClassName:lp(1===e),...ip})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:tp,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,i.map(np),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:tp,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(W,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:lp(e===n),...ip})})]})},lp=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",rp=({currentPage:e,onPageChange:t,totalPages:n,itemCount:i,onItemCountChange:a})=>c("div",{className:"mt-3xl flex justify-between flex-col @lg:flex-row items-center select-none",role:"navigation","aria-label":"Пагинация",children:[o(ap,{currentPage:e,onPageChange:t,totalPages:n}),i&&a?o(ep,{itemCount:i,onItemCountChange:a}):null]}),sp=d((({className:e,value:t,autoFocus:n,onChange:i,onFocus:a,placeholder:r="Поиск по сайту"})=>{const s=l((e=>{i&&i(e.target?.value||"")}),[i]);return c("div",{className:u("relative",e),role:"form",children:[o("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:o(ne,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),o("input",{className:u("h-14 w-full px-10 text-l text-black box-border rounded-md",gn),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:n,onChange:s,onFocus:a})]})})),op=d((({field:e,onClearFilter:t,filtrationState:n})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(sp,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(Ul,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(Ul,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период до",minDate:n.startDate,...e("endDate")}),o("div",{className:"col-span-12 @lg:col-span-2 mt-8 @lg:mt-auto",children:o(Oa,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),cp=(e,t)=>o(fd,{...e,iconBgVersion:t,className:"shrink-0"}),dp=({title:e,timestamp:t,publicId:n})=>{const i=he(),{href:a}=i({href:`/api/v1/depository/${n}/file`});return c("div",{className:"flex gap-3 items-center py-lg border-gray border-opacity-50 border-b",children:[cp({icon:"DocDownloadIcon",iconVersion:"black"}),c("div",{className:"flex flex-col gap-x-6xl lg:flex-row lg:items-center",children:[t?o(_e,{size:"text-m","font-weight":"font-light",children:Lt(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:a,download:!0,"aria-label":"Скачать",children:e})]})]},n)},mp="/api/v1/depository",up={startDate:void 0,endDate:void 0,query:""},hp=zt((({className:e,...t})=>{const[n,a]=i(0),[r,s]=i(10),[d,{field:m,reset:h}]=rn(up),{totalPages:p=0,items:f=[]}=(({size:e,page:t,query:n,startDate:i,endDate:a})=>{const l=i?Lt(i,!0):"",r=a?Lt(a,!0):"",s=new URLSearchParams(mp);s.set("page",String(t)),s.set("size",String(e)),s.set("query",n),s.set("timestampStart",l),s.set("timestampEnd",r);const o=`?${s.toString()}`,{data:c}=hi(mp+o,Rt);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:n,...d}),x=l((e=>a(e-1)),[]),y=l((e=>{r!==e?(s(e),a(0)):s(e)}),[]);return c(g,{className:u(e,"container p-6xl"),...t,children:[o(op,{filtrationState:d,field:m,onClearFilter:h}),c("div",{className:"flex flex-col",children:[c("div",{className:"grid grid-cols-12 pb-lg border-gray border-opacity-50 border-b",children:[o("div",{className:"col-span-4 @lg:col-span-2 hidden @lg:block",children:o(_e,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(_e,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),f.length?f.map((e=>o(dp,{...e},String(e.publicId)))):o(hc,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(rp,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:y})]})]})})),pp=e=>"Image"===e?.contentType&&e?.image?o(ne,{image:e.image}):"Code"===e?.contentType&&e.code?o("div",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:e.code}):null,gp=d((({className:e="",title:t,description:n,error:i,button:a,...l})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...l,children:[o("div",{className:"flex justify-center",children:pp(i)}),o(k,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),a?.text?o(ve,{version:a?.version,text:a?.text,...a}):null]})));function fp(e,t){for(const[n,i]of e.entries())null!=i?t.setItem(n,i):t.removeItem(n)}const xp={};function yp(e,t=xp){const n=s(null),o=function(){const[,e]=i(0);return l((()=>e((e=>(e+1)%65536))),[])}();return a((()=>e.bus.watch((e=>{n.current?.has(String(e.type))&&o()}))),[e,o]),r((()=>new Proxy(t,{get:(t,i)=>(n.current||=new Set,n.current.add(i),e.getItem(i)),has:(t,i)=>(n.current||=new Set,n.current.add(i),e.hasItem(i)),set:(t,n,i)=>(e.setItem(n,i),!0),deleteProperty:(t,n)=>(e.removeItem(n),!0)})),[e])}const bp=new class{bus;store=new Map;get size(){return this.store.size}constructor(e=new ce){this.bus=e}hasItem(e){return this.store.has(e)}getItem(e){return this.store.get(e)}entries(){return this.store.entries()}setItem(e,t){this.store.set(e,t),this.bus.subject(e,t)}removeItem(e){this.store.delete(e),this.bus.subject(e,null)}};var vp,Np;function wp(e){return yp(bp,e)}vp=bp,Np=new class{storage;bus;get size(){return this.storage?.length??0}constructor(e,t=new ce){this.storage=e,this.bus=t}hasItem(e){return Boolean(this.storage?.getItem(String(e)))}getItem(e){const t=this.storage?.getItem(String(e))??null;try{return JSON.parse(String(t))}catch(e){return null}}entries(){return Array.from({length:this.size},((e,t)=>{const n=String(this.storage?.key(t));return[n,this.getItem(n)]}))}setItem(e,t){null!==t?this.storage?.setItem(String(e),JSON.stringify(t)):this.storage?.removeItem(String(e)),this.bus?.subject(e,t)}removeItem(e){this.storage?.removeItem(String(e)),this.bus?.subject(e,null)}}(globalThis?.localStorage),fp(vp,Np),fp(Np,vp),vp.bus.watch((({type:e,event:t})=>{null!=t?Np.setItem(e,t):Np.removeItem(e)}));const Cp="/api/v1/region";function Sp(e="Москва"){return wp().location??{name:e}}function kp(e="Москва"){const t=wp(),n=l((async()=>{if(!t.location){const n=await Pt(Cp);t.location=n??{name:e}}}),[t,e]);return hi(Cp,n),t}var Ip;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(Ip||(Ip={}));const Tp=new Intl.NumberFormat("ru",{style:"currency",currency:Ip.RUB}),Bp=e=>e?Tp.format(e):"",Pp="text-m font-light text-secondary-text ",Rp=`${Pp} text-left`,Dp=`${Pp} pl-5xl text-center`,Mp=`${Pp} pl-5xl text-right`,_p={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},Ap=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:Rp,children:o(_e,{size:"text-m",children:"Валюта"})}),o("th",{className:Dp,children:o(_e,{size:"text-m",children:"Купить"})}),o("th",{className:Mp,children:o(_e,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(Ep)})]}))),Ep=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m m-auto flex text-left",children:c("div",{className:"flex items-center gap-xs",children:[t?o(ne,{image:{icon:_p[t]},width:"24",height:"24"}):null,o(_e,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(_e,{size:"text-h6",children:Bp(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(_e,{size:"text-h6",children:Bp(e?.buyExchangeRate)})})]},t)},zp={icon:"GpsIcon"},Fp=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(fd,{...zp,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(C,{size:"text-l",color:"text-primary-main",children:t}):null,o(C,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),Vp=(e,t,n)=>{const i=Number(Op(e))*Math.pow(t,n?-1:1);return Number.isInteger(i)?i:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(i)},Op=e=>e.replace(/[^\d.,]/g,"").replace(",","."),Lp=e=>Zt([[e=>e.value!==Ip.RUB&&e.oppositeValue!==Ip.RUB,()=>e.handleConvert(e.value,Ip.RUB)],[e=>e.value===Ip.RUB&&e.oppositeValue===Ip.RUB,()=>e.handleConvert(e.value,Ip.USD)],[e=>e.value===Ip.RUB&&e.oppositeValue===Ip.RUB,()=>e.handleConvert(e.value,Ip.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function jp(e){const{placeholder:t,rates:n,selected:i,value:a,setValue:l,setSelected:r}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:i,text:i};return c("div",{className:"relative flex",children:[o(xn,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:a,onChange:l}),s.length?o(Mn,{className:"absolute right-0",isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const qp=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:a})=>{const[r,s]=i({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||Ip.RUB,selectBuy:n?.[0]?.currency?.currency||Ip.USD}),d=l((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[t&&n?c("div",{className:"grid gap-m",children:[jp({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:$p(r,d,n),value:r.inputSell,setValue:e=>Wp(d,n)(e,r.selectSell,r.selectBuy)}),jp({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:Up(r,d,t),value:r.inputBuy,setValue:e=>Hp(d,t)(e,r.selectBuy,r.selectSell)})]}):null,a?.text?o(ve,{text:a.text,version:a?.version,...a}):null]})})),$p=(e,t,n)=>i=>{t({selectSell:i}),Lp({value:i,oppositeValue:e.selectBuy,handleConvert:(i=e.selectSell,a=e.selectBuy)=>{Wp(t,n)(e.inputSell,i,a)}})},Up=(e,t,n)=>i=>{t({selectBuy:i}),Lp({value:i,oppositeValue:e.selectSell,handleConvert:(i=e.selectBuy,a=e.selectSell)=>Hp(t,n)(e.inputBuy,i,a)})},Wp=(e,t)=>(n,i,a)=>{e({inputSell:Op(n),selectBuy:a});const l=t.find((e=>e.currency?.currency===a))?.buyExchangeRate||t.find((e=>e.currency?.currency===i))?.buyExchangeRate;l&&e({inputBuy:String(Vp(n,l,i===Ip.RUB)||"")})},Hp=(e,t)=>(n,i,a)=>{e({inputBuy:Op(n),selectSell:a});const l=t.find((e=>e.currency?.currency===a))?.saleExchangeRate||t.find((e=>e.currency?.currency===i))?.saleExchangeRate;l&&e({inputSell:String(Vp(n,l,i===Ip.RUB)||"")})};const Yp=d((({className:e="",title:t="Курсы обмена валют",button:n,...i})=>{const a=function(e){const t=e?.code||"000",{data:n}=hi(`/api/v1/exchangerates?regionCode=${t}`,Rt);return n||{}}(Sp()),l=Kp(a?.exchangeRate?.currencies),r=l.filter((e=>e.buyExchangeRate));r.unshift({currency:{currency:Ip.RUB}});const s=l.filter((e=>e.saleExchangeRate));return s.push({currency:{currency:Ip.RUB}}),o(g,{className:u("box-border min-h-80",e),...i,children:o(Te,{className:"h-full",title:o(w,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap @lg:flex-nowrap",children:[c("div",{className:"w-full @2xl:w-auto @5xl:w-1/2",children:[l?o(Ap,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(Fp,{address:a?.address})]}),o(qp,{className:"grow w-1/2",currencyRatesBuy:r,currencyRatesSell:s,button:n})]})})})})),Kp=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],Gp=d((({className:e="",items:t})=>{const n=he();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(Xp(n))})})),Xp=e=>({dataFooter:t,...n},i)=>{const{text:a,href:l,target:r,onClick:s}=e(n);return a?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:l,target:r||"_self",onClick:s,...ge(t),children:a||null})},String(i)):null},Jp=d((({label:e,labelIconBgVersion:t,icon:n,onToggle:i,labelIcon:a})=>o(Hc,{tag:"button",className:u("border-none bg-transparent items-center group/button",a?.icon?"py-xs":"py-lg"),onClick:i,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[cp(a,t),e?o(_e,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:n?o(W,{name:n,iconVersion:"color",width:"24",height:"24"}):null}))),Zp=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",Qp=(e=!1)=>e?"MinusIcon":"PlusIcon",eg=(e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon",tg=zt((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,label:i="Развернуть",labelIcon:a,labelIconBgVersion:l,foldButtonVersion:r="default",version:s,role:c,...d})=>{const m=Se();return o(g,{className:u("w-full border-0 border-b border-solid border-main-divider last:border-b-0",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:c,...d,children:o(ea,{isFoldButtonOnTop:n,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(ta,{className:u("gap-lg",Zp(m)),isUnfolded:e,children:D({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>ng({foldButtonVersion:r,label:i,labelIcon:a,labelIconBgVersion:l,isUnfolded:e,onToggle:t,isMobile:m})})})}),{childrenTypes:{exclude:["RollupItem"]}}),ng=({foldButtonVersion:e,label:t,labelIcon:n,labelIconBgVersion:i,isUnfolded:a,onToggle:l,isMobile:r=!1})=>{const s=t||(a?"Скрыть":"Развернуть"),c=((e=!1,t=!1)=>t?eg(e):Qp(e))(a,r);return"accordion"===e?o(Jp,{label:s,labelIcon:n,labelIconBgVersion:i,icon:c,onToggle:l}):o(Yc,{label:s,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:l})},ig=d((({navigationItems:e})=>o("div",{className:"w-full",role:"menu",children:ag(e)}))),ag=e=>e?.filter((e=>e.icon?.icon)).map(((e,t)=>o(tg,{foldButtonVersion:"accordion",label:e?.text,labelIcon:e?.icon,role:"menuitem",children:e.items?o(Gp,{items:e.items}):null},String(t)))),lg=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(rg)}):null)),rg=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(_e,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(sg)})]},String(t)),sg=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:og(e.type,e.text)}),o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),og=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${cg(t)}`,children:o(_e,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},cg=e=>e.replaceAll(/\D/g,""),dg=d((({className:e="",index:t,text:n,...i})=>{const a=he(),{href:l,target:r,onClick:s}=a(i);return o("a",{className:u("text-secondary-text",e),href:l,target:r,onClick:s,children:n||`Документ ${t}`})})),mg=d((({className:e="",title:t,links:n})=>o("div",{className:e,children:n?.length?c("div",{className:"flex justify-between lg:items-center flex-col lg:flex-row gap-lg py-lg border-y border-y-main-divider",children:[o("div",{className:"lg:hidden",children:o(_e,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(dg,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),ug=d((({className:e="",index:t,...n})=>{const i=he(),{href:a,target:l,text:r,onClick:s}=i(n);return o("a",{className:u("text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px]",e),href:a,target:l,onClick:s,children:r||`Документ ${t}`})})),hg=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(_e,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} ${n}`})}):null,t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs",children:t.map(((e,t)=>o(ug,{index:t,...e},String(t))))}):null]}))),pg=zt((({className:e,footer:t,...n})=>{const{navigationItems:i}=n.options?.page?.navigation??{};n.options?.page?.common;const{documents:a,relatedEnterprises:l,contacts:r,mediaLinks:s=[],horizontalNavigationTitle:d,feedbackButton:m,license:h,otherLinks:p=[]}=t??{};return c(g,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...n,children:[null,c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(ig,{navigationItems:i}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u("w-full lg:w-52","flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(lg,{items:r}),m?o(ve,{className:"w-full",version:"primary",...m}):null,s.map(((e,t)=>o(fu,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),p.map(((e,t)=>o(ve,{className:"!text-left text-s font-light",version:"link",...e,children:e?.text},String(t))))]})]}),o(mg,{title:d,links:l}),o(hg,{links:a,license:h})]})})),gg=zt((({className:e,title:t,button:n,regionSource:a,data:l,...r})=>{const[s,d]=i({key:""}),m=a?.regions??[],h=oe({className:"text-white",version:n?.version||"primary"}),p=m?.find((e=>e.name===s.key))?.href,f=n?.text?n.text:"Перейти";return o(g,{className:e,defaultPadding:"p-6xl",...r,children:c("div",{className:"container max-w-[978px] space-y-m",children:[t?o(w,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(zn,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,p?o("div",{className:"text-center",children:o(ve,{href:p,target:"_blank",className:u("p-m w-full @xl:w-auto",h),data:hu(l,s?.key),children:f})}):null]})})})),fg={default:"bg-main-divider text-primary-main rounded hover:text-primary-main",transparent:"backdrop-opacity-30 bg-white/30 hover:text-primary-hover text-white"},xg=d((({version:e,text:t,mobileText:n,...i})=>{const a=Se()?n:t;return a?o(ve,{className:u("py-s px-lg font-light whitespace-nowrap",fg["transparent"===e?"transparent":"default"]),...i,children:a}):null})),yg=d((({bgColor:e,logo:t,alwaysShowLogo:n,internetBankButton:i,version:a,backwardButton:r})=>{const s=M(),d="/"===s.pathname,{dataFooter:m,dataHeader:u,...h}=t??{},p=l((()=>{s.back()}),[s]);return c("div",{className:"flex items-center justify-between w-full",children:[n||d?o("div",{children:o(Do,{className:"my-2xs",bgColor:e,logo:h,data:u,showTitle:!1})}):bg(p,r),o(xg,{version:a,...i})]})})),bg=(e,t)=>t?c("button",{className:"flex items-center text-l my-2xs",onClick:e,type:"button","aria-label":"Кнопка назад",children:[o(W,{name:"ChevronLeftIcon",iconVersion:"black",width:"24",height:"24"}),t]}):null,vg={"bg-white":"primary",transparent:"transparent"},Ng=zt((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:n=vg[e],portal:i,logo:a={},...l})=>{const{backwardButton:r,logo:s={}}=l.options?.page?.common??{},{internetBankButton:c}=i||{},d=a.image?.icon||a.image?.src?a:s;return o(g,{tag:"header",defaultPadding:"",version:n,...l,children:o("div",{className:"container px-lg py-2xs box-border",children:o(yg,{bgColor:e,logo:d,alwaysShowLogo:t,internetBankButton:c,version:n,backwardButton:r,...l})})})})),wg=(e=!1)=>e?{}:{padding:"p-0"},Cg={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},Sg=zt((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:i=!0,version:a="transparent",isTheme:l=!1,isCardBorder:r=!1,image:s,...c})=>{const d=M();return o(g,{className:u("relative flex flex-col",Cg[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${J(d)(s?.src)})`}}:{},padding:t,version:a,isTheme:l,...c,children:D({...c,extraProps:{className:u("w-full",pc(r)),...wg(i)}})})}),{childrenTypes:[]}),kg=zt((e=>o(Sg,{...e})),{childrenTypes:[]}),Ig=d((e=>{const{className:t,align:n,image:i,...a}=e,l=n?u("flex",Nd[n]):"";return o(g,{className:u(l,t),defaultPadding:"p-0",...a,children:o(ne,{image:i})})})),Tg=["байт","Кб","Мб","Гб","Тб","Пб"],Bg=d((({icon:e,text:t,href:n,target:i,fileFormat:a,data:l,fileSize:r})=>{const s=r&&a?",":"",d=r??"",m=a?String(a):"";return c("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",href:n,target:i,...ge(l),children:[e,t?c(_e,{size:"text-l",font:"font-light",children:[t," ",Pg(d,m),o(_e,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),Pg=(e,t)=>e||t?o("span",{children:", "}):"",Rg=(e,t)=>(n,i)=>{const a=$(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),l="Attachment"===n?.docType?((e,t=2)=>{if(0===e)return"";const n=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,n)).toFixed(t))} ${Tg[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?Mg(a):n?.fileFormat;return c("div",{role:"listitem",children:[o(Bg,{text:n?.text,target:n?.target,href:a,fileFormat:r,fileSize:l,icon:Dg(t),data:n?.data}),o(De,{__html:n?.__html})]},String(i))},Dg=e=>e?o(ne,{className:"min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md",image:e,width:"24",height:"24"}):null,Mg=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),i=-1!==t?e.substring(t+1):"";return i.includes("/")?i.replace(n,""):i},_g=d((({href:e,__html:t,target:n})=>{const{close:i}=me(),a=M(),r=$(a)(e),s=l((()=>{i()}),[]);return c(sr,{className:"my-6xl min-h-fit w-fit mx-auto",children:[t?o(De,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(ve,{text:"Я согласен",version:"primary",target:n,href:r,onClick:s}),o(Oa,{type:"button",version:"secondary",onClick:s,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]})})),Ag=d((({text:e,href:t,target:n,__html:i,icon:a})=>{if(!e&&!i)return null;const r=(e=>{const{open:t,close:n}=me();return{open:(n={})=>t(o(_g,{...e}),n),close:n}})({__html:i,href:t,target:n}),s=l((()=>r.open()),[r]);return c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[Dg(a),o(_e,{font:"font-light",children:e})]})})),Eg={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},zg=zt((({className:e="",title:t,description:n,align:i="text-center",documents:a,icon:l={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=M();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(k,{title:t,description:n,align:i,headlineVersion:"M",as:"h2",isEmbedded:!0}),a?.length?o("div",{className:u("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",Eg[r]),role:"list",children:a.map(Fg(d,l))}):null]})})),Fg=(e,t)=>(n,i)=>{const a=n?.docType;return""===a?null:"reportSource"in n&&n?.reportSource?.__html?Vg(t)(n,i):Rg(e,t)(n,i)},Vg=e=>(t,n)=>{const i={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(Ag,{...i,icon:e,href:Og(t)?t?.href:t?.attachment?.src}),o(De,{__html:t?.__html})]},String(n)):null},Og=e=>"href"in e,Lg=zt((({className:e,padding:t,align:n="text-left",buttons:i=[],description:a,image:l,__html:r,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const x="secondary"===p?"p-m min-w-32":"min-w-24",y=l?.src?o(ne,{className:"hidden lg:block",image:l}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:p,...f,children:c(Te,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(w,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:y,buttons:je(i,{className:"flex-wrap"}),children:[a?o(_e,{size:"text-xl","font-weight":"font-light",children:a}):null,c("div",{className:u("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[r?o(De,{__html:r,itemSize:"list-m"}):null,o(_e,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),d?.src?o("div",{className:u("flex justify-center bg-white rounded-md @xl:-order-1",x),children:o(ne,{className:"w-fit",image:d})}):null,l?.src?o(ne,{className:"lg:hidden",image:l}):null]})]})})})),jg=(e=[],t={})=>e.filter((({content:e={}})=>sd(t,e))).length,qg=(e,t)=>e===t;const $g=(e=>(t,n)=>t===n||Boolean(t&&n&&Object.keys(t).length===Object.keys(n).length&&Object.entries(t).every((([t,i])=>e(i,n[t])))))(function(...e){return(t,n)=>e.some((e=>e(t,n)))}(qg,((e=qg)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,i)=>e(t,n[i])))))())),Ug=[],Wg={},Hg={primary:"bg-white/30",secondary:"bg-main-divider"},Yg={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},Kg=d((({count:e,version:t="secondary"})=>{const n=Se(),i=n?"bg-main-divider":Hg[t],a=Yg[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",i),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(_e,{size:"text-xs",color:a,children:e})})})),Gg=({text:e,description:t,icon:n,isActive:i,type:a})=>{const l=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white"),text:e?"mb-xs text-xl":"mb-2xs text-l text-primary-text",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal",oldText:"text-m text-center",oldDesc:"text-m-light"}))(i);return c("div",{className:u("cursor-pointer text-left border-b-0 flex gap-2xs"),"aria-label":e,"aria-labelledby":`${e}-label`,children:[n?o(ne,{className:u("h-6 w-6 min-w-6 min-h-6",l.icon),image:{...n,iconVersion:n?.iconVersion??l.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===a?l.text:l.oldText,children:e}),o("div",{className:"animated"===a?l.desc:l.oldDesc,children:t})]})]})},Xg={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},Jg={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},Zg={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},Qg={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},ef=d((({tag:e="div",item:t={},isActive:n=!1,type:i="default",onClick:a})=>{const l=e,{text:r,description:s,icon:d,count:m,tabName:h,...p}=t;return o(l,{className:u("h-12","block flex-1","cursor-pointer",Xg[i],n?Qg[i]:Zg[i]),role:"tablist","aria-label":"Список табов",onClick:a,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?Jg[i]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[Gg({text:r,description:s,icon:d,isActive:n,type:i}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(Kg,{count:m,version:La(n,i)})}):null]})})})),tf=d((e=>o(e?.item?.href?nf:af,{...e}))),nf=d((e=>{const t=he(),n=l((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:i,...a}=t({...e.item,onClick:n});return o(ef,{...e,tag:"a",item:a,onClick:i})})),af=d((({item:e={},onClick:t,...n})=>{const i=l((()=>{t&&t(e)}),[t,e]);return o(ef,{item:e,onClick:i,...n})})),lf=(e,t,n)=>(i,a)=>o(tf,{isActive:i===e,onClick:t,type:n,item:i},String(a)),rf=d((({className:e,tabsType:t="default",items:n=[],activeItem:i,onChange:a})=>o("div",{className:u("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tabpanel","aria-label":"Панель управления табами",children:n.map(lf(i,a,t))}))),sf={categories:[],extraOptions:[],propertyType:[],stage:[]},of=zt((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:i,...a})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=cd(sf,{block:a.block,page:a.options?.page}),f=l(((e=sf)=>p(e)),[]),x=(({hotFilters:e=Ug,filtrationState:t=Wg,blocks:n=Ug,onFiltrationStateChange:i})=>{const a=r((()=>Math.max(0,e.findIndex((e=>$g(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:jg(n,t.filter),version:La(t===e[a])})))),[e,n,a]),o=l((t=>{i(e[s.indexOf(t)].filter)}),[e,s]);return{activeItem:s[a],items:s,onChange:o}})({hotFilters:t,filtrationState:s,blocks:a.block?.blocks,onFiltrationStateChange:f});return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...a,children:[o(rf,{...x}),o(nd,{filtrationSchema:n,resetButton:i,field:m,reset:h}),o(Zc,{blocksToRender:d,...a})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),cf=({location:e,address:t,billAcceptorType:n,terminalType:i,billAcceptorEnable:a,atmCode:l="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:uf(i)},{label:"Модуль приема наличных",value:a?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:l}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(_e,{size:"text-h4",children:uf(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(_e,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(xa,{color:"green",children:uf(s)})})]}),o("div",{className:"hidden sm:block",children:o(ra,{className:"flex-wrap",children:m?.map(mf)})}),o(ea,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ta,{isUnfolded:e,children:o(ra,{className:"flex-wrap",children:m?.map(mf)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Sa({isUnfolded:e,onToggle:t})})]},String(d))},df=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${uf(t)} №${n}`,body:e.toUpperCase()}),mf=(e,t)=>o(na,{...e},String(t)),uf=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",hf=[];const pf=async e=>{const t=await Pt(e,{method:"GET"});return Array.isArray(t)?t:hf},gf={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},ff={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},xf=d((({descriptionData:e,className:t})=>{const n=Sp(),i=n?.code??"000",{data:a,isLoad:l}=function(e){const{data:t,error:n}=hi(`/api/v1/atms?regionCode=${e}`,pf);return{data:t||hf,isLoad:!t&&!n}}(i);return o(Xa,{className:t,filterItems:yf,data:a,isLoad:l,initFilterState:gf,renderCard:cf,getBalloon:df,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),yf=(e,t)=>{const n=Object.keys(t).filter((e=>t[e])),i=n.filter((e=>e.startsWith("terminalType"))),a=n.filter((e=>!i.includes(e)));return e.filter((e=>{const t=a.every((t=>ff[t](e))),n=!i.length||i.some((t=>ff[t](e)));return t&&n}))},bf=({address:e,workScheduleDescription:t},n)=>t?c("div",{className:"bg-white col-span-12 p-3xl sm:border-yellow sm:border",children:[o("div",{className:"sm:flex sm:justify-between",children:c("div",{children:[o(_e,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(_e,{size:"text-l",children:e})]}):null]})}),o("div",{className:"hidden sm:block",children:vf({workScheduleDescription:t})}),o(ea,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ta,{isUnfolded:e,children:vf({workScheduleDescription:t})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Sa({isUnfolded:e,onToggle:t})})]},String(n)):null,vf=({workScheduleDescription:e})=>c("div",{children:[c(ra,{className:"flex",children:[o(na,{label:"Операции для физических лиц",children:o(_e,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(na,{label:"Операции для физических лиц",children:o(_e,{children:"Оформление и обслуживание банковских карт"})}),o(na,{label:"Операции для физических лиц",children:o(_e,{children:"Инвестиционное и накопительное страхование"})}),o(na,{label:"Операции для физических лиц",children:o(_e,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(na,{label:"Режим работы",className:"max-w-none",children:o(_e,{children:e})})]}),Nf=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),wf={branches:[],remoteWorkplaces:[]};const Cf=async e=>await Pt(e,{method:"GET"})||wf,Sf=d((({className:e})=>{const t=Sp(),n=t?.code??"000",{data:i,isLoad:a}=function(e="000"){const{data:t,error:n}=hi(`/api/v1/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,Cf);return{data:t||wf,isLoad:!t&&!n}}(n);return o(Xa,{className:e,data:i?.branches,isLoad:a,remoteWorkplaces:i?.remoteWorkplaces,renderCard:Ba,renderRemoteWorkplaceCard:bf,getBalloon:Ra,getBalloonRemoteWorkplaces:Nf,title:`Офисы филиала ${t?.name}`})})),kf=d((({data:e,className:t,...n})=>{const i=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===i?o(Sf,{}):o(xf,{descriptionData:e})})})),If=d((({className:e,title:t,description:n="Блок в разработке...",...i})=>c(g,{className:u("box-border",e),...i,children:[o(k,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(f,{})]}))),Tf=d((({className:e,padding:t,slides:n=[],...i})=>o(g,{className:u("overflow-hidden relative",e),padding:t,...i,children:o($c,{gap:0,padding:0,children:n.map((e=>e.productBlock)).map(((e,t)=>o("div",{className:"box-border h-full",children:o(Je,{className:"px-5 h-full",headlineVersion:"L",...e,...i})},String(t))))})}))),Bf=d((({address:e,email:t,telephone:n,button:i,className:a="",__html:l,richVersion:r,icon:s,title:d,version:m="primary",...h})=>c(g,{className:u("box-border text-left space-y-s",a),version:m,...h,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[Le(s)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ne,{image:s})}):null,d?o(w,{headingType:"h3",as:"h3",title:d}):null]}),c("div",{className:"w-full space-y-m",children:[l?Pf({__html:l,richVersion:r}):null,Rf({label:"Адрес",data:e,iconName:"GeolocationIcon"}),Rf({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),Rf({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),i?.text?je([i]):null]})]}))),Pf=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(De,{...e,itemSize:"list-s"})}),Rf=({label:e,data:t,iconName:n,dataColor:i=""})=>t?c("div",{className:"flex gap-s",children:[o(W,{iconVersion:"black",name:n,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(_e,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(_e,{size:"text-xl",color:i,children:t})]})]}):null,Df=d((e=>{const{__html:t,richVersion:n="",...i}=e;return o(g,{defaultPadding:"p-0",...i,children:o(De,{__html:t,richVersion:n})})})),Mf=d((({name:e,text:t,value:n,checked:i,onChange:a,className:l})=>o("div",{className:l,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:u(gn.split(" ").filter((e=>"rounded"!==e)),Ci,"flex justify-center items-center after:block after:w-2.5 after:h-2.5 after:rounded-full rounded-full","checked:border-2 checked:!border-primary-main focus:checked:border-primary-main checked:after:bg-primary-main"),type:"radio",value:n,name:e,checked:i,onChange:e=>a?.(e.target.value),role:"radio"}),t?o(_e,{color:"text-primary-text",children:t}):null]})}))),_f=d((({className:e=""})=>{const[t,n]=i("option2"),a=l((e=>n(e)),[]);return c("div",{className:u("order-4",e),role:"radiogroup",children:[o(Mf,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),o(Mf,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),Af=d((({data:e,fieldLabel:t,fieldValue:n,selected:i,placeholder:a="",setSelected:l,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[n||t],text:e?.[t]}))),c=s.find((e=>e.key===i));return o(Mn,{options:s,label:r,placeholder:a||i,onChange:e=>l(e.key),value:c})})),Ef=d((({regions:e=[],selectedRegion:t,onSelectedRegion:n,branches:i=[],selectedBranch:a,onSelectedBranch:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Af,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(Af,{data:i,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:l,label:"Отделение",placeholder:"Выберите отделение"})})]}))),zf=["От 1 дня","До 365 дней"],Ff=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(_e,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(dl,{min:1,max:365,value:e,items:zf,onChange:t})]}))),Vf=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:n,safeBoxCases:i=[],selectedBoxSize:a,onSelectedBoxSize:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Af,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(Af,{data:i,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:l,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),Of=d((({regions:e,selectedRegion:t,branches:n,selectedBranch:i,days:a,selectedCaseVolume:l,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:u})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(Ef,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:i,onSelectedBranch:Lf(m)}),o(Ff,{days:a,setDays:e=>m({days:e})}),o(Vf,{caseVolumes:d,selectedCaseVolume:l,onSelectedCaseVolume:jf(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(_e,{size:"text-l",font:"font-light",color:"text-secondary-text",children:"Тип договора"})}),c("div",{className:"contents @md:flex justify-between items-center gap-m",children:[o(_f,{}),o(ve,{text:"Офисы на карте",version:"primary",onClick:u,className:"order-6"})]})]}))),Lf=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},jf=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},qf=d((({days:e,tariffs:t=[]})=>{const n=Uf(e,t),i="На рисунке изображена пачка листов\nформата А4";return c("div",{className:"contents @xl:flex flex-col justify-between gap-xl order-2",children:[c("div",{className:"flex flex-col @xl:flex-row gap-x-6xl gap-y-2xl order-5 @xl:order-none py-2xl @xl:py-0 border-t border-main-divider @xl:border-none",children:[$f("Аренда за",e),$f("Цена",n+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:i})}),c("div",{className:"flex flex-col items-center gap-s order-3 @xl:order-none mb-xl @xl:mb-0 bg-primary-main py-s @xl:p-3xl text-center",children:[o(ne,{image:{icon:"PackA4Icon"},className:"@xl:h-60"}),o("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:o(C,{size:"text-s",font:"font-light",color:"text-white",children:i})})]})]})})),$f=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(_e,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o("span",{className:"text-l @xl:text-h3 text-primary-text",children:t})]}),Uf=(e,t)=>{const n=Wf(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},Wf=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},Hf=(e,t)=>e.find((e=>e.branchCode===t)),Yf=d((e=>{const{regions:t,data:n,branches:i,onChange:l,onClick:r}=e;a((()=>{l({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,l]);const s=Hf(i,n.selectedBranch),d=Kf(s?.safeBoxCaseVolumes),m=Gf(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=Xf(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(Of,{...n,regions:t,onClick:r,branches:i,caseVolumes:d,safeBoxCases:m,onChange:l}),o(qf,{days:n.days,tariffs:u})]})})),Kf=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Gf=(e,t)=>e?.find((e=>e.volume===t)),Xf=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Jf=[];const Zf=async e=>await Pt(e,{method:"GET"})||Jf,Qf=d((({title:e,footnote:t,className:n="",...a})=>{const[r,s]=i(!1),d=l((()=>s((e=>!e))),[]),[m,u]=i({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),h=Rs(),p=ex(m.selectedRegion,h),f=function(e){const{data:t}=hi(e?`/api/v1/safeboxes?regionCode=${e}`:null,Zf);return t||Jf}(p),x=l((e=>u((t=>({...t,...e})))),[u]),y=(b=Hf(f,m.selectedBranch)||f,Array.isArray(b)?b.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)].filter(Boolean),content:void 0}))).filter((e=>e.coords&&2===e.coords.length)):b?.gpsLatitude&&b?.gpsLongitude?[{coords:[b.gpsLatitude,b.gpsLongitude]}]:[]);var b;return c(g,{className:n,defaultPadding:"",...a,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(w,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(Yf,{regions:h,branches:f,data:{...m,selectedRegion:p},onClick:d,onChange:x}),t?o(C,{size:"text-s",font:"font-light",children:t}):null]}),y.length&&r?o(Hi,{points:y,className:"h-[640px]"}):null]})})),ex=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,tx={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"},nx=(e,t,n)=>(i,a)=>{const{button:l}=i;return o("div",{className:"contents",children:c("div",{className:"flex items-center relative flex-row",children:[o("div",{className:"overflow-hidden flex flex-shrink-0 items-center",children:ix(e,n)(i,a)}),c("div",{className:u("flex flex-col justify-center h-fit w-full",{"min-h-6xl":e}),children:[ax(i),l?.text?o(ve,{className:"box-border py-s w-full max-w-60 mt-lg",version:t,...l,children:l?.text}):null]})]})},String(a))},ix=(e,t)=>(n,i)=>{const a="secondary"===t?"white":"color",l=Boolean(n?.icon?.src),r=lx(e,l),s=l?"transparent"===t:t;return o(g,{className:u("z-10 mr-s flex justify-center content-center rounded-md",r),defaultPadding:"",version:s,children:o("div",{className:"flex max-w-full max-h-full items-center justify-center",children:rx({step:n,iconVersion:a,i:i,stepVersion:t})})})},ax=e=>c("div",{children:[e?.label?o(C,{size:"text-l",align:"text-left",children:e.label}):null,e?.description?o("div",{className:u("text-s font-light text-left",tx.description),children:e.description}):null,o(De,{__html:e.__html})]}),lx=(e,t)=>e&&t?"h-14 w-14":"h-11 w-11",rx=({step:e,iconVersion:t,i:n,stepVersion:i})=>{return Le(e?.icon)?o(ne,{image:{...e.icon,iconVersion:e.icon?.iconVersion||t},imageClassName:"max-w-full max-h-full",width:"24",height:"24"}):o("span",{className:u("text-h4","transparent"===i?tx.iconText:(a=i,"secondary"===a?"group-data-primary:text-white":"text-secondary-text")),children:n+1});var a},sx=d((({className:e="",title:t,description:n,steps:i=[],buttons:a,stepVersion:l="gray",version:r="primary",...s})=>{const d=i.length>3;return c(g,{className:u("box-border flex flex-col gap-xl",e),defaultPadding:"p-6xl",version:r,...s,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-left"}),i?.length?o("div",{className:"flex flex-col gap-6xl justify-between box-border",children:i.map(nx(d,r,l))}):null,je(a,{isVertical:!0})]})})),ox=d((({isActive:e,item:t,onClick:n})=>c("div",{className:u(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),title:t?.title||"",onClick:n,children:[o(W,{className:"w-6 h-6",name:t?.icon?.icon,iconVersion:e?"color":"black"}),t?.title||""]}))),cx=d((({className:e,head:t,children:n,onClose:i,onClick:a})=>{const{close:r}=me(),s=l((()=>{r(),i&&i()}),[i]);return c("div",{onClick:a,className:u("relative min-h-full bg-white p-0 rounded-xl top-32",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 rounded-xl bg-white z-10",children:[o(rr,{className:"absolute top-1.5 right-0",onClose:s}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})})),dx=({menuRef:e,dialogRef:t,closeDialog:n,openDialog:i,leftItems:a,rightItems:l})=>[{openBottomMenuItemDialog:(r,s)=>{const c="left"===s?a:l,d=e?.current?.getBoundingClientRect();i(o(cx,{onClick:e=>e.stopPropagation(),onClose:n,className:"mt-[20%] border-t border-current",head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:c[r].description||c[r].title})}),children:o("div",{className:"bg-white pb-20 pt-1 text-l",ref:t,children:o("iframe",{id:"iframe-dialog",onLoad:()=>(()=>{const e=document.getElementsByTagName("iframe")["iframe-dialog"];e.style.height=String(e?.contentWindow?.document.body.offsetHeight)+"px"})(),src:c[r]?.src,width:d?.width||0})})}),{id:"left"===s?a[r].title:l[r].title})}}];function mx(e){throw new Error(e)}const ux=({onCloseAll:e,onClose:t}={})=>{const[n,{push:r,pop:s,clear:o}]=function(e=[]){const[t,n]=i(e),a=l((e=>n((t=>[...t,e]))),[]),r=l((()=>n((e=>e.slice(0,-1)))),[]),s=l((e=>n((t=>t.filter((t=>t!==e))))),[]),o=l((()=>n([])),[]);return[t,{setList:n,push:a,pop:r,remove:s,clear:o}]}(),c=l((()=>{e&&e(n),o()}),[n,e]),d=l((()=>{t&&t(n[n.length-1]),s()}),[n,t]);return a((()=>de.subscribe("dialog",(e=>{if(e)switch(e.type){case"open":r(e);break;case"close":e.all?c():d();break;default:mx(e)}}))),[c,d]),n},hx=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:i,s2Matches:a}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),i=Array.from({length:e.length}),a=Array.from({length:t.length});let l=0;for(let r=0;r<e.length;r++){const s=Math.max(0,r-n),o=Math.min(r+n,t.length-1);for(let n=s;n<=o;n++)i[r]||a[n]||e[r]!==t[n]||(l++,i[r]=!0,a[n]=!0)}return{m:l,s1Matches:i,s2Matches:a}}(e,t);if(0===n)return 0;const l=function(e,t,{s1Matches:n,s2Matches:i}){let a=0;for(let l=0,r=0;l<e.length;l++){if(!n[l])continue;let s=r;for(;s<t.length;s++)if(i[s]){r=s+1;break}e[l]!==t[s]&&a++}return a}(e,t,{s1Matches:i,s2Matches:a}),r=(n/e.length+n/t.length+(n-l/2)/n)/3,s=r>.7?.1*function(e,t){let n=0;for(;e[n]===t[n]&&n<4;)n++;return n}(e,t):0;return r+s*(1-r)};const px=e=>e?.length?c("div",{className:"sm:border-t sm:border-main-divider mt-2xs pt-2xs",children:[o("div",{className:"mb-m",children:o(_e,{size:"text-m",font:"font-light",color:"text-secondary-text",children:"Представительства за рубежом:"})}),o("div",{className:"flex flex-col sm:flex-row gap-5xl",children:e.map(((e,t)=>o(gx,{...e},String(t))))})]}):null,gx=d((({icon:e,...t})=>{const n=he(),{text:i,target:a,href:l,onClick:r}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ne,{image:e}):null,i?o("a",{className:"hover:text-primary-hover",href:l,target:a,onClick:r,children:o(_e,{size:"text-l",font:"font-light",color:"text-primary-text",children:i})}):null]})})),fx=(e,t)=>n=>n.name?o(pu,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:hu(e,n.name),children:o(_e,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,xx=d((({className:e,searchTerm:t,onSearch:n})=>c("form",{className:`font-sans relative ${e}`,children:[o("div",{className:"absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none",children:t?null:o("label",{htmlFor:"search-bar-input",className:"text-secondary-text ",children:"Поиск по филиалам"})}),o("input",{id:"search-bar-input",className:u(gn,"h-12 pl-m w-full peer text-l text-black rounded-md box-border"),value:t,onChange:e=>n(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),yx=d((({defaultLocation:e})=>{const t=Sp(e),n=he(),{href:i}=n({href:`/branches/${t.slug}`});return t?o("div",{className:"mb-s",children:c(C,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(pu,{href:i,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),bx=d((({foreignOffices:e,branches:t})=>{const n=kp(t?.default),[a,s]=i(""),d=Rs(),m=r((()=>Nx(d).sort(((e,t)=>e.name.localeCompare(t.name)))),[d]),u=r((()=>((e,t)=>{const n=new Map;for(const i of e){const e=t(i),a=n.get(e)||[];n.set(e,[...a,i])}return n})(m,vx)),[m]),{close:h}=me(),p=l((e=>{n.location=e,h()}),[n]);return c(sr,{className:"pb-20",head:c("div",{children:[o(_e,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(yx,{defaultLocation:t?.default}),o(xx,{onSearch:s,searchTerm:a})]}),children:[a&&a.length>=3?o("div",{children:m.filter((({name:e})=>e&&hx(e.toLowerCase())(a.toLowerCase())>=.8)).map(fx(t?.dataSelect,p))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(u.entries()).map((g=p,f=t?.dataSelect,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(_e,{size:"text-h6",children:e})}),t.map(fx(f,g))]},e)))}),px(e)]});var g,f})),vx=e=>e.name?.charAt(0)??"",Nx=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),wx=d((({menuRef:e,menuItem:t,locationDialogProps:n,closeAll:i})=>{const l=(e=>{const{open:t,close:n}=me();return{open:(n={})=>t(o(bx,{...e}),n),close:n}})(n||{}),{name:r}=Sp(),s=e?.current?.getBoundingClientRect(),c=X(G.SITE_URL);return a((()=>{globalThis.frames["burger-menu-iframe"].postMessage({type:"currentLocation",data:r},"*")}),[r]),a((()=>{const e=e=>{if("location"===e.data.type&&l.open(),"reload"===e.data.type&&i(),"resize"===e.data.type){const t=document.getElementsByTagName("iframe")["iframe-dialog"];t&&t.style&&(t.style.height=String(e.data.data)+"px")}};return globalThis.addEventListener("message",e),()=>{globalThis.removeEventListener("message",e)}}),[]),o(cx,{onClick:e=>e.stopPropagation(),head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:t?.title,className:"font-medium"})}),children:o("div",{className:"bg-white pb-20 pt-1 text-l",children:o("iframe",{id:"iframe-dialog",name:"burger-menu-iframe",onLoad:()=>(()=>{const e=globalThis.frames["burger-menu-iframe"],t=document.getElementsByTagName("iframe")["iframe-dialog"];t.style.height=String(t?.contentWindow?.document.body.offsetHeight)+"px",e.postMessage({type:"currentTab",data:c?.slice(1)},"*"),e.postMessage({type:"currentLocation",data:r},"*")})(),src:t?.src,width:s?.width||0})})})})),Cx="burgerMenuDialog",Sx=({menuRef:e,centralMenuItem:t,closeAll:n,openDialog:i,locationDialogProps:a})=>{const l=ux(),r=((e,t)=>Boolean(t.find((t=>t.id===e),e)))(Cx,l);return[r,{toggle:()=>{r?n():i(o(wx,{locationDialogProps:a,menuRef:e,menuItem:t,closeAll:n}),{id:Cx})}}]},kx=[],Ix=zt((({sticky:e,...t})=>{const{menuItems:n=kx}=e??{},a=n.find((e=>"Меню"===e.title)),r=n.filter((e=>"Меню"!==e.title)),d=Math.floor(r.length/2),m=r.slice(0,d),u=r.slice(d),[h,p]=i(-1),[f,x]=i(""),{open:y,closeAll:b}=me(),v=l((()=>{p(-1),x(""),b()}),[b]),N=un(v),w=s(null),[C,{toggle:S}]=Sx({menuRef:w,centralMenuItem:a,closeAll:b,openDialog:y,locationDialogProps:t.header}),[{openBottomMenuItemDialog:k}]=dx({menuRef:w,dialogRef:N,closeDialog:v,openDialog:y,leftItems:m,rightItems:u}),I=l((e=>{v(),e.stopPropagation(),S()}),[v,S]),T=l(((e,t)=>{x(t),p(e),b(),k(e,t)}),[b,k]);return o(g,{className:"h-[74px] z-[100] relative",defaultPadding:"p-0",...t,children:c("div",{ref:w,className:"ml-auto container bg-white flex justify-center shadow-blue-gray",children:[m.map(Tx(T,"left",{activeIndex:h,currentItemPosition:f})),o(ox,{item:a,isActive:C,onClick:e=>I(e)}),u.map(Tx(T,"right",{activeIndex:h,currentItemPosition:f}))]})})})),Tx=(e,t,n)=>(i,a,l)=>o(ox,{item:i,isActive:l[n.activeIndex]?.title===i?.title&&n.currentItemPosition===t,onClick:r=>{l[n.activeIndex]?.title===i?.title&&n.currentItemPosition===t||r.stopPropagation(),e(a,t)}},i.title||String(a)),Bx="hidden sm:flex absolute z-40",Px={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},Rx=d((({className:e,items:t=[],activeItem:n,onChange:i,tabsType:l="default"})=>{const[r,s]=Mc({itemCount:t?.length||0});return a((()=>Dx(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(bc,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:Px[l].item,gap:Px[l].gap,children:t.map(lf(n,i,l))}),s.canScrollLeft?o(Fc,{className:u("left-6",Bx,Px[l].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(Vc,{className:u("right-6",Bx,Px[l].buttonTop),onClick:s.scrollRight}):null]})})),Dx=(e,t,n)=>{const i=t.findIndex((e=>e===n));e&&i>0&&e.scrollTo({left:e?.children[i]?.offsetLeft,behavior:"smooth"})},Mx={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},_x=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(Mx[t].wrapper,e),children:o(Rx,{className:Mx[t].component,tabsType:t,...n})}):null,Ax=zt((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=Ex(n??{}),p=M(),f=t.every((e=>"link"===e?.type)),x=s?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,{isReady:y}=p,[b,v]=i(Vx(x,((e="")=>{const t=globalThis?.location?.href;return t?new URL(t).searchParams.get(e):null})(h))),N=x[b],w=x.findIndex((e=>Boolean(e.selected)));a((()=>{const e=p.query[h]?x.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===p.query[h])):w;v(-1===e?0:e)}),[y,w,h]);const C=Fx(x[b],b),S=l((e=>{const t=x.indexOf(e),n=x[t];v(t),"group"===n.type&&((e,t)=>{const n=new URLSearchParams(p.query);e.text?n.set(h,e?.tabName??String(t)):n.delete(h),p.replace(`${p.pathname}?${n}`,"",{scroll:!1})})(e,t)}),[x]);return c(g,{className:u({"sticky top-1 z-20":d&&f},e),defaultPadding:"p-0",block:n,...m,children:[_x({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:zx(t,x),activeItem:N,tabsType:r,onChange:S}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:Object.entries(n?.slots??{}).map((([e,t])=>R(t,{...m?.options,slotName:C,parent:n,extraProps:{className:e===C?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(Fx)?.filter(Boolean)||[]}),Ex=({__id:e,anchor:t})=>t??e??"tabs",zx=(e,t)=>t?.length?t:e,Fx=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",Vx=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),Ox={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},Lx=d((({children:e,activeIndex:t,columnWidth:n,version:i="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:Ox[i],style:{transform:`translateX(-${t*n}px)`},children:e})}))),jx=d((({className:e="",isOpen:t,onClick:n})=>o(ve,{className:e,appendRight:o(ne,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"24",height:"24"}),text:t?"Скрыть":"Показать",version:"gray",onClick:n}))),qx={Buttons:({buttons:e})=>je(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ne,{image:e}):null,RichText:({__html:e,isDotted:t=!0})=>o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(De,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(_e,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(_e,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:i,isOpen:a})=>e?o(jx,{className:"w-fit",isOpen:a,onClick:()=>{t({tableSource:n,pdfUrl:i})}}):null},$x=d((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:l,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=i(!0);a((()=>{l===o&&s||m(!0)}),[s,o]);return Ux({cell:e,cellProps:{rowIdx:n,cellIdx:l,fieldIdx:t,displayTable:e=>{m(!1),c(l),r(e)},isVisible:d}})})),Ux=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...i}=e;if(!n||!(n in qx))return null;return o(qx[n],{...t,...i})},Wx=d((({cells:e,rowIdx:t,cellIdx:n,setTableInner:i,tableInner:a,openTableInnerIdx:l,setOpenTableInnerIdx:r})=>o("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>o($x,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:i,tableInner:a,openTableInnerIdx:l,setOpenTableInnerIdx:r},String(s)))):null}))),Hx=(e,t)=>140*((e=[])=>e.reduce(((e,t)=>e+t),0))(e.slice(0,t).map((e=>e?.cols?.length??1))),Yx=(e,t)=>e?.length>0?o("div",{className:u("flex",{"text-secondary-text":0===t}),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(_e,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,Kx=d((({rows:e})=>{return o(bc,{visibleItemCount:0,snapAlign:"snap-start",children:o("div",{children:e?.map((t=0,(e,n)=>{if(!e?.length)return null;const[i,...a]=e,l=u("flex duration-1000 text-center",0!==n?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[i?.data?o("div",{className:"whitespace-pre-wrap sm:whitespace-normal w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(_e,{size:"text-xl",font:"font-light",children:i.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:l,style:{transform:`translateX(-${Hx(a,t)}px)`},children:a?.map(((e,n)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(_e,{size:"text-xl",children:e.data}):null,e?.cols?Yx(e.cols,t):null]},`row${n}`)))})})]},String(n))}))})});var t})),Gx=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const i=`activeTabIdx:${e}-tableIdx:${n}`;return c("div",{className:"w-full @container",children:[o("div",{className:"flex py-m sm:px-m bg-white @4xl:bg-gray relative",children:o(_e,{size:"text-xl",align:"text-left",children:t.title})}),o("div",{className:"w-full sm:pl-xs overflow-hidden transition-height duration-500 ease-in-out",children:o("div",{className:"relative",children:o(Kx,{rows:t.rowsData})})})]},i)}))}))),Xx=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Jx=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:i})=>c("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?o("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>o("div",{className:u("rounded-md px-4 py-3 cursor-pointer",{"bg-primary-main":t===n}),onClick:()=>i(t),children:o(_e,{size:"text-xl",font:"font-light",color:Xx(t===n),children:e||t+1})},e)))}):null,t?o(ve,{className:"text-primary-main",href:t,version:"link",target:"_blank",appendLeft:o(W,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),Zx=zt((({tableSource:e,pdfUrl:t,onClick:n})=>{const a=e?.tableData,[r,s]=i(0),d=l((e=>s(e)),[]),m=a?.[r]?.items??[],u=a?.map((e=>e.currency??""));return c("div",a?{className:"bg-white z-10",children:[o(Jx,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(Gx,{activeTabIndex:r,items:m}),o(jx,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(_e,{size:"text-h6",children:"Данных нет"}),o(jx,{onClick:n,isOpen:!0})]})})),Qx=d((({children:e,tableInner:t,onHideContentClick:n})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:u("@4xl:border-main-divider @4xl:border-b","flex flex-col @4xl:flex-row gap-y-xs gap-x-5xl pb-lg @4xl:pt-lg"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(Zx,{...t,onClick:n})}):null]}))),ey=d((({row:{header:e,data:t},activeIndex:n,rowIdx:a,...r})=>{const[s,d]=i(void 0),m=l((e=>d(e)),[]),[h,p]=i(void 0),g=l((e=>p(e)),[]);return c(Qx,{onHideContentClick:()=>d(void 0),tableInner:s,...r,children:[o("div",{className:u("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(ne,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(_e,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(Lx,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(Wx,{cells:e,rowIdx:a,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})}));function ty({dec:e,inc:t,canDec:n,canInc:i,btnClass:a,className:l=""}){return n||i?c("div",{children:[n?o(zc,{className:u("absolute z-40",a[0],l),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!n}):null,i?o(zc,{className:u("absolute z-40 rotate-180",a[1],l),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!i}):null]}):null}const ny=d((({children:e,controls:t})=>{const{isScrollAvailable:n}=t;return c("div",{role:"table",className:"overflow-x-auto w-auto grid md:block",children:[c("div",{className:"relative space-y-xs",children:[e,ty({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),n?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),iy=d((({className:e="",title:t,description:n,rowHeaders:a,tariffsColumns:r,hiddenRowsNum:s=0,...d})=>{const m=r?.map((({data:e})=>e))||[],h=a?.map(((e,t)=>({header:e,data:m.map((e=>e?.[t]||[]))}))),p=m.length,[f,x]=((e,t=0)=>{const{itemCount:n,visibleItemCount:a}=e,[r,s]=i(t),o=l((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=l((()=>s((e=>Math.max(e-1,0)))),[n]),d=a?n>a&&r<n-a:r<n-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]})({itemCount:p,visibleItemCount:2}),y=(h||[]).map(((e,t)=>o(ey,{row:e,activeIndex:f,rowIdx:t,...d},String(t)))),[b,v]=s>0?[y.slice(0,-s),y.slice(-s)]:[y,[]];return c(g,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...d,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:s>0?o(ea,{renderFoldableSection:({isUnfolded:e})=>c(ny,{controls:x,children:[b,o(ta,{isUnfolded:e,children:v})]}),renderFoldButton:Kc}):o(ny,{controls:x,children:y})})]})})),ay=d((({className:e="",title:t,description:n,iconVersion:i,__html:a,richVersion:l,...r})=>c(g,{className:u("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...r,children:["small"===i?ly():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(_e,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?ry(n):null,a?o(De,{richVersion:l,__html:a}):null]})]}))),ly=()=>o("div",{className:"rounded-full h-4 w-4 text-center text-xs font-light bg-primary-main text-white group-data-secondary:bg-white group-data-secondary:text-primary-main",children:"i"}),ry=e=>o(C,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),sy=d((({prefix:e,unit:t,suffix:n})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(_e,{size:"text-h2",children:e})}):null,t?o("div",{className:"-mb-6 @xl:-mb-4",children:o("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,n?o("div",{className:"gradient-color-text",children:o(_e,{size:"text-h2",children:n})}):null]}))),oy=d((e=>{const{prefix:t,unit:n,suffix:i,...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(sy,{prefix:t,unit:n,suffix:i})})})),cy={AdTile:Vt,ApplicationForm:ho,ApplicationLeadForm:uc,BankAccountFiltration:ud,BenefitsBlock:xd,BonusBenefitsBlock:vd,ButtonsBlock:wd,CalculatorBonus:Fd,CalculatorBusinessDeposit:em,CalculatorCredit:gm,CalculatorDeposit:_m,CalculatorRefinancing:jm,CardTransfer:Km,Carousel:nu,CarouselCard:ru,CarouselCatalogCard:ou,CarouselLinks:mu,CarouselRecommendationCard:bu,CarouselTariffsCard:wu,CreditCardForm:dh,CreditForm:Wh,DepositFiltration:Xh,Depository:hp,ErrorBlock:gp,ExchangeRateTile:Yp,Footer:pg,GrantSupport:gg,Header:Ng,Headline:k,HorizontalLayout:kg,ImgBlock:Ig,LinkDocs:zg,MobileAppTile:Lg,MortgageFiltration:of,OfficesAtmsMap:kf,Placeholder:If,ProductBlock:Ft,ProductGallery:Tf,RepresentativeOfficeInfo:Bf,RichTextBlock:Df,RollupItem:tg,SafeDepositRental:Qf,StepsBlock:sx,StickyBottomMenu:Ix,TabsLayout:Ax,TariffsTable:iy,TextBlock:ay,UnitBlock:oy,VerticalLayout:Sg},dy=ue((()=>{a((()=>{Gt()}),[]);const e=an();mn(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const i=JSON.parse(n?.dataset?.aspects??"[]");Yt({aspectsAttributes:i,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))}));const my="cookie",uy=d((({__html:e})=>{const[t,{setTrue:n,setFalse:i}]=dn();!function(e,t,n=300){a((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}((()=>{globalThis.localStorage?.getItem(my)||n()}),[],3e3);const r=l((()=>{globalThis.localStorage?.setItem(my,"true"),i()}),[]);return t&&e?o("div",{className:"container fixed left-0 right-0 bottom-0 z-50",role:"dialog",children:c("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[o("div",{className:"sm:flex-1",children:o(De,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(rr,{className:"bg-main-gray rounded-md w-11 h-11",onClose:r})})]})}):null})),hy=d((()=>{const e=l((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=l((e=>{e?.onClose&&e.onClose()}),[]),n=ux({onCloseAll:e,onClose:t}),{close:i}=me(),r=l((({key:e})=>{"Escape"===e&&i()}),[]);return mn(globalThis.document,"keydown",r),a((()=>{n.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"))}),[n]),n.length?o("div",{className:"fixed inset-0 z-50",role:"dialog",children:n.map((({dialog:e,id:t},i)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:i!==n.length-1}),children:e},String(t||i))))}):null})),py=d((()=>{const[e,t]=i(null),n=l((()=>{t(null)}),[]);a((()=>de.subscribe("popup",(e=>{if(e)switch(e.type){case"open":case"update":t(e);break;case"close":n();break;default:mx(e)}}))),[]);const r=l((({key:e})=>{"Escape"===e&&n()}),[n]);return mn(globalThis.document,"keydown",r),e?o("div",{className:u("z-50",e.fixed?"fixed":"absolute"),style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",children:e.popup}):null})),gy="header",fy="footer",xy="sticky-footer",yy={},by=d((({className:e,data:t=yy,blocksRegistry:n,blockDecorator:i})=>{const{slots:a,blocks:l,fallback:r,...s}=t,d=Et(s,r);dy(),kp();const m={key:"",page:{slots:a,blocks:l,fallback:r,...d},blocksRegistry:n,blockDecorator:i,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:u("@container relative",t.style,e),children:[a?.header?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:R(a?.header,{...m,slotName:gy})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[D({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),R(a?.footer,{...m,slotName:fy})]})]}),a?.["sticky-footer"]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:R(a?.["sticky-footer"],{...m,slotName:xy})}):null,o(hy,{}),o(py,{}),o(uy,{__html:d?.cookieContent?.__html})]})}));Object.assign(by,{childrenTypes:[],slots:()=>[gy,fy,xy]});e.Blocks=cy,e.ContentPage=by,e.handlerDecorator=ue,e.joinList=ed,e.packageVersion="0.14.675",e.projectSettings=A,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=L,e.useRouter=M,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniMobileBlocks={})}(this,(function(e){"use strict";let t;const n=e=>(...n)=>t[e](...n),i=n("useState"),a=n("useEffect"),l=n("useCallback"),r=n("useMemo"),s=n("useRef"),o=(...e)=>globalThis._uni._jsx(...e),c=(...e)=>globalThis._uni._jsxs(...e),d=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:m(e)),t._tmpl},m=e=>{function t(t,n){const{children:i,...a}=t||{},l=n?.slots?.default,r=i||l&&l();return e(Object.assign(a,r&&{children:r}),n)}return t.inheritAttrs=!1,t},u=(...e)=>e.map((e=>h(e)?Object.entries(e).filter((([,e])=>e)).map((([e])=>e)):e)).flatMap((e=>e)).filter(Boolean).join(" "),h=e=>Boolean(e&&"object"==typeof e&&!Array.isArray(e)),p={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white",gray:"bg-main-divider text-primary-text",transparent:"bg-transparent text-primary-text","":""},g=d((({className:e,version:t="primary",isTheme:n=!0,defaultPadding:i="p-xl",padding:a,block:l,tag:r="section",role:s,children:c,style:d})=>{const m=t&&n;return o(r,{className:u("@container font-sans",{group:m},p[t],a||i,e),...m?{"data-ver":t}:{},...l?.anchor?{id:l.anchor}:{},role:s,style:d,children:c})})),f=d((({className:e,size:t})=>o("figure",{className:u("m-0 mt-xl min-w-[80%]",e),children:x(t)}))),x=(e=3)=>b(100,e).map((e=>Math.floor(e))).map(y),y=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),b=(e,t)=>[e].concat(t>0?b(e/1.618,t-1):[]),v={h1:"h1",h2:"h1",h3:"h2",h4:"h2",h5:"h3",h6:"h3"},N={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},w=d((({className:e="",headingType:t="h3",as:n="h3",title:i,children:a})=>{const l=v[n]||"h3";return o(l,{role:"heading",className:u("font-sans m-0",N[t],e),children:i||a})})),C=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),S={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"}},k=d((({className:e,version:t="",headlineVersion:n="XL",title:i,description:a,align:l="text-center",as:r,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=S[n],p={marginTop:h.descriptionStyle};return c(g,{className:u({"@container-normal":s},e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[i?o(w,{className:u("whitespace-pre-wrap",l),...h?.title,as:r||h?.title.as,title:i}):null,a?o(C,{size:h.descriptionSize,font:h.descriptionWeight,align:l,...p,children:a}):null]})})),I=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),T=[];function B(e,t,{className:n,...i}={}){const{key:a,blockDecorator:l=I,blocksRegistry:r={},ancestors:s=T}=t,{type:c}=e;c&&c in r||console.warn(`No block with "${c}" is registered`);const d=c&&r[c];return l({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:l})=>{const{content:r}=n;return d?o(d,{className:l,block:e,options:t,...r,...i},a):null}},a)}const P=[],R=(e,{key:t,ancestors:n=P,slotName:i=null,extraProps:a,renderProps:l=B,...r})=>{const s=a?(e,t)=>B(e,t,a):l;return(e||[]).map(((e,a)=>s(e,{...r,key:`${t||e.type}-${a}`,ancestors:r.parent?[...n||P,[r.parent,i]]:n},a)))};function D({block:e,options:t,children:n,extraProps:i,renderProps:a}){return n||(e&&t?R(e.blocks,{...t,parent:e,extraProps:i,renderProps:a}):null)}function M(){return M._impl()}M._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),M.setup=e=>{M._impl=e};const _=["CDN","BASE_PATH"],A=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return _.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),E=e=>Boolean(e?.includes(":")),z=(e,t)=>Boolean(e&&!E(e)&&(!t||"_self"===t)),F=e=>Boolean(e?.startsWith("#")),V=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),O=(e,t)=>!(!e||!t)&&(!!e.startsWith(t)&&["/"===t,e===t,"/"===e[t.length]].some(Boolean));var L=Object.freeze({__proto__:null,isURL:E,isLocalURL:z,isHash:F,withoutQuery:e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),joinPath:V,hasPrefix:O});const j="/api/",q=`${j}v1/storage`,$=e=>(t,n)=>{if([!t,E(t),F(t),[A.CDN,j].some((e=>O(t,e)))].some(Boolean))return t;if(((e="")=>/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}(\/revs\/[0-9]{1,20})?$/.test(e))(t))return`${q}/${t}/attachment`;const i=t?.startsWith("/");return V(O(t,n)?"":n,i?"/":e.pathname?.split("/").slice(0,-1).join("/"),t)},U={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},W=d((({className:e="",imageClassName:t="",name:n="",alt:i=`Иконка ${n}`,title:a=i,iconVersion:l="color",width:r,height:s})=>{const d=M(),m="normal"===l?`${n}.svg`:`sprites.svg#${n}`,h=$(d)(V(A.CDN,"/icons/",m));return"normal"===l?o("img",{className:e,src:h,alt:i,title:a,"aria-hidden":"true",width:r,height:s,style:H(e,s)}):o(K,{className:e,children:c("svg",{className:u(Y(r),U[l],{invert:"white"===l},t),width:r,height:s,"aria-hidden":"true",children:[a?o("title",{children:a}):null,i?o("desc",{children:i}):null,o("use",{href:h,xlinkHref:h})]})})})),H=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},Y=e=>e?"":"w-full h-full",K=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),G=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function X(e=""){try{return new URL(e).pathname}catch(e){return""}}const J=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":X(G.SITE_URL);return t&&!E(t)?$(e)(t,n):t},Z=(e,t)=>e?.media&&t?.media?e.media-t.media:0,Q=d((({className:e="",image:t,imageClassName:n=""})=>{const i=M();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(Z).map((({src:e,format:n,media:a},l)=>o("source",{srcSet:J(i)(e),type:te(n),media:a?`(max-width: ${a}px)`:"",width:t?.size?.width,height:t?.size?.height},`${l}_${e}`))):null,t?.src?ee({...t,src:J(i)(t.src)},n):null]})})),ee=(e,t="")=>o("img",{src:e.src,className:u("object-contain",t),alt:e?.alt||e?.title||"",title:e?.title||"",style:{width:e?.size?.width?`${e.size?.width}px`:"100%",height:e?.size?.height?`${e.size?.height}px`:"auto"},width:e?.size?.width,height:e?.size?.height}),te=e=>e?`image/${String(e)}`:void 0,ne=d((({className:e="",image:t,imageClassName:n="",...i})=>t?.src||t?.icon?t.icon?o(W,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...i}):o(Q,{className:e,imageClassName:n,image:t}):null)),ie={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active",white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",transparent:"",gray:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","":""},ae="bg-main-divider text-main-disabled",le={primary:ae,secondary:ae,white:ae,link:"",transparent:"",gray:ae,"":""},re="text-center font-sans select-none",se={primary:"group-hover/btn:brightness-0 group-hover/btn:invert",secondary:"group-hover/btn:brightness-0 group-hover/btn:invert",white:"group-hover/btn:brightness-0 group-hover/btn:invert",link:"text-primary-main",transparent:"",gray:"group-hover/btn:brightness-0 group-hover/btn:invert","":""},oe=({className:e,rounded:t,version:n})=>[re,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",n?ie[n]:"",t?"rounded-full":"rounded-md",e].join(" ");class ce{watchers=new Set;subscribersMap={};subjectsStateMap={};emitter=this;observable=this;watch(e){return this.watchers.add(e),()=>{this.watchers.delete(e)}}subscribe(e,t){this.subscribersMap[e]||=new Set,this.subscribersMap[e]?.add(t);const n=this.subjectsStateMap[e];return n&&t(n),()=>{this.subscribersMap[e]?.delete(t)}}fire(e,t){e in this.subjectsStateMap?this.subject(e,t):this.fireSubscribers(e,t)}subject(e,t){return this.subjectsStateMap[e]!==t&&(this.subjectsStateMap[e]=t??void 0,this.fireSubscribers(e,t)),()=>{delete this.subjectsStateMap[e]}}fireSubscribers(e,t){for(const n of this.subscribersMap[e]??[])n(t??null);for(const n of this.watchers)n({type:e,event:t??null})}}const de=new ce,me=()=>({open:(e,t={})=>de.fire("dialog",{type:"open",dialog:e,...t}),close:()=>de.fire("dialog",{type:"close"}),closeAll:()=>de.fire("dialog",{type:"close",all:!0})}),ue=e=>ue._impl(e);function he(){const e=X(G.SITE_URL),t=M(),{closeAll:n}=me();return e=>{const n=$(t)(e.href);return{...e,href:n,"aria-label":e.text,onClick:ue(i({...e,href:n}))}};function i({href:i,target:a,onClick:l}){return r=>{l?.(r),pe(i,a,e)||(n(),r?.preventDefault(),t.push(((e,t="")=>e?.replace(t,"")||"/")(i,e)))}}}ue._impl=e=>e,ue.setup=e=>{ue._impl=e};const pe=(e,t,n)=>{if(!z(e,t))return!0;const i=G.SUB_PORTALS?.split(",");return!!i?.some((t=>O(e,t)))||!O(e,n||"/")},ge=e=>{if(!Array.isArray(e)||!e.length)return{};try{return{"data-aspects":JSON.stringify(e)}}catch(e){return{}}},fe=d((e=>{const{text:t,aboveText:n,appendLeft:i,appendRight:a,version:l="primary"}=e,r=ye(e)&&"hidden lg:block";return c("div",{className:u(xe(e),"flex gap-xs"),children:[i?o("div",{className:u(r,se[l]),children:i}):null,ye(e)?c("div",{className:"whitespace-pre",children:[n?o("div",{className:"text-xs font-light text-left",children:n}):null,o("div",{className:"text-left "+(n?"text-s -mt-3xs":"text-l"),children:t})]}):null,a?o("div",{className:u(r,se[l]),children:a}):null]})})),xe=e=>{const{version:t,aboveText:n,rounded:i}=e;if("link"===t)return"";const a=""+(n?"py-2.5 px-9":"py-4 px-9");return u("group/btn items-center justify-center",ye(e)?a:"h-12 w-12 m-auto",{"rounded-full":i})},ye=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),be=({className:e,rounded:t,version:n})=>["inline-block",re,n?le[n]:"",t?"rounded-full":"rounded-md",e].join(" "),ve=d((({disabled:e,children:t,method:n="LINK",href:i,...a})=>{const r=(({method:e,href:t})=>l((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:i,pathname:a,searchParams:l}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[i,a].join(""));for(const[e,t]of l.entries()){const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),r.appendChild(n)}document.body.appendChild(r),r.submit()}),[]))({method:n,href:i}),s=he()({onClick:r,href:i,...a}),c=t??o(fe,{...s});return o(e?we:Ne,{...s,children:c})})),Ne=d((({className:e="",href:t,rel:n,target:i,ariaLabel:a,version:l,rounded:r,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:oe({className:e,version:l,rounded:r}),href:t,rel:n,target:i,"aria-label":a||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...ge(d),children:m}))),we=d((({className:e,ariaLabel:t,version:n,rounded:i,children:a})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:be({className:e,rounded:i,version:n}),children:a})));function Ce({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:i=!1}){if(!n)return null;const a="primary"===e?"white":"black",l="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(i?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:u(oe({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",rounded:!0}),l),onClick:t,children:o(ne,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:a}})}),o(ve,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const Se=()=>{const[e,t]=i(true);return a((()=>{const e=globalThis.matchMedia?.("(max-width: 1024px)"),n=()=>{t(Boolean(e?.matches))};return e?.addEventListener("change",n),e?.matches&&t(Boolean(e.matches)),()=>{e?.removeEventListener("change",n)}}),[]),e},ke={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Ie=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&ke[n],t),children:e}):null,Te=d((({className:e,version:t="primary",defaultPadding:n,padding:i="",title:a,buttons:r,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:x,...y})=>{const b=Se(),v=M(),N=l((()=>v.back()),[]),w=y.options?.page?.common?.backwardButton,C=f&&!b;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",i||n,e),children:[C&&Ce({version:t,handleClick:N,text:w}),a?o("div",{className:"relative h-full",children:a}):null,c("div",{className:u("grow relative flex flex-col @xl:flex-row gap-3xl w-full",{"self-start @xl:w-auto":s}),children:[Ie(s,{imageAlign:m,className:"mx-auto"}),c("div",{className:u("grid gap-3xl items-center md:items-stretch",{"@xl:grid-cols-2 auto-cols-fr":d,grow:!s},"h-full","auto-rows-[max-content_1fr]"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[h,x]}),Pe(D({...y,extraProps:{className:"@container-normal"}})),Ie(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Be(p)]:r,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),r?o("div",{className:"self-end",children:r}):null]})]})]})})),Be=e=>u(e?"row-span-2":"@xl:row-span-2"),Pe=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Re=(e,t="normal")=>e?.icon||e?.src?o("div",{className:u("sm:w-12 sm:h-12 sm:min-w-12 w-11 h-11 min-w-11 box-border flex items-center justify-center rounded-icon","normal"===t?"bg-secondary-light text-primary-main":"bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black"),children:o(ne,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,De=d((e=>{const{__html:t="",richVersion:n="",itemSize:i="list-m",isDotted:a=!0}=e,l=a?"":"without-dots";return t&&"<p><br></p>"!==t.replace(/<\/?[^>]+\/?>/g,"").trim()?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(n,i,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",l),dangerouslySetInnerHTML:{__html:t}})}):null})),Me=(e,t)=>e?o(C,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,_e=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),Ae=(e,t)=>e?o(_e,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,Ee=(e,t)=>["label"in e?Ae(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Me(e.description,t)},String(t)):null,"__html"in e?o(De,{...e},`rte-${t}`):null],ze=d((({className:e,benefitsVersion:t,...n})=>c("div",{className:u("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in n?Re(n.icon,t):null,o("div",{children:Ee(n)})]}))),Fe=d((({className:e,benefitsVersion:t="normal",benefits:n})=>n?.length?o("div",{className:u("flex gap-x-m gap-y-s flex-col",e),role:"list",children:n.map(((e,n)=>o(ze,{benefitsVersion:t,...e},String(n))))}):null)),Ve=d((({className:e,benefits:t})=>t?.length?o("div",{className:u("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap(Ee)}):null)),Oe=d((({isTabularBenefits:e,...t})=>o(e?Ve:Fe,{...t}))),Le=e=>Boolean(e?.src||e?.icon),je=(e,{className:t,buttonClassName:n,isVertical:i}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",i?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m w-full @lg:w-auto",t),role:"group",children:e.map(qe(n))}):null,qe=(e="")=>(t,n)=>{const{text:i,icon:a,iconRight:l,version:r,...s}=t||{},c=$e(a,r),d=$e(l,r);return i||a?.icon?o(ve,{className:u("basis-full @lg:basis-auto",e),appendLeft:Ue({...a,iconVersion:c}),appendRight:Ue({...l,iconVersion:d}),version:r,text:i,...s},n?String(n):""):null},$e=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},Ue=e=>Le(e)&&o(ne,{image:e,width:String(e?.size?.width||24),height:String(24)}),We=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),He=d((({priceList:e})=>e?.length?o("div",{className:"flex flex-wrap xl:flex-nowrap xl:bg-main-divider xl:rounded-md p-xs gap-xl",role:"list",children:e.map(Ye)}):null)),Ye=({label:e,amount:t,unit:n},i)=>c("div",{className:"basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg sm:rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(_e,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?c("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[We(2)(t)," ",n||"₽"]}):null]},String(i)),Ke=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(Ge)}):null)),Ge=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(_e,{size:"text-m",font:"font-light",children:e})},String(t)),Xe={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},Je=d((({className:e,padding:t,defaultPadding:n,title:i,description:a,headlineVersion:l="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:d,isDotted:m=!0,benefits:u,__html:h,richVersion:p,isFullWidthTitle:g,priceList:f=[],tags:x=[],buttons:y,image:b,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:C=!1}={},backwardButton:S,children:I,...T})=>{const B=b?.src?o(ne,{image:b}):null,P=o(k,{title:i,description:a,headlineVersion:l,align:r,isEmbedded:!0}),R=u?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Te,{className:e,padding:t,defaultPadding:n,...g?{title:P}:{insetTitle:P},...Ze(B,N),isImageSecondary:C,imageAlign:v,isImageAlwaysOnRight:w,buttons:je(y),backwardButton:S,...T,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[R?.length?o(Oe,{benefitsVersion:s,isTabularBenefits:d,benefits:R}):null,h?o(De,{richVersion:p,__html:h,isDotted:m,itemSize:Xe[l]}):null,I,f?.length?o(He,{priceList:f}):null,Qe(x)]})})})),Ze=(e,t)=>t?{rightImage:e}:{leftImage:e},Qe=e=>e?.length?o(Ke,{tags:e}):null;class et{_;constructor(e){this._=e}of(e){return new this.constructor(e instanceof et?e._:e)}filter(e){return this.from(this.entries().filter(e))}map(e){return this.from(this.entries().map(e))}flatMap(e){return this.from(this.entries().flatMap(e))}reduce(e,t){return this.entries().reduce(e.bind(this),t)}}const tt=()=>!0,nt=(e,t)=>(...n)=>e(...n)&&t(...n),it=(...e)=>(...t)=>{const[,n]=function(e){if(!e)throw new Error("Value should be fulfilled");return e}(e.find((([e])=>e(...t))));return n(...t)};const at=e=>Boolean(e&&Array.isArray(e)),lt=e=>Boolean(e&&"object"==typeof e&&!at(e)),rt=e=>e;function st(e){return e instanceof et?e._:e}class ot extends et{from(e){return this.of(e.map(((e=rt)=>([,t])=>e(t))(st)))}entries(){return(this._??[]).map(((e,t)=>[t,this.of(e)]))}size(){return this._?.length??0}get(e){return this.of("number"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of(at(this._)?Array.from({length:Math.max(this._.length,Number(e)+1)},((n,i)=>i===e?t:this._[i])):Array.from({length:Number(e)+1},((n,i)=>i===e?t:void 0)))}}class ct extends et{from(){return this}entries(){return[]}size(){return 0}get(e){return this.of(void 0!==e?void 0:this._)}set(e,t){return this.of(t)}}class dt extends et{from(e){return this.of(Object.fromEntries(e.map((([e,t])=>[e,st(t)]))))}entries(){return Object.entries(this._??{}).map((([e,t])=>[e,this.of(t)]))}size(){return Object.keys(this._??{}).length}get(e){return this.of("string"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of({...this._,[e]:t})}}class mt extends et{proto=it([e=>at(this._)||"number"==typeof e,()=>ot.prototype],[e=>lt(this._)||"string"==typeof e,()=>dt.prototype],[tt,()=>ct.prototype]);from(e){return this.proto(void 0).from.call(this,e)}entries(){return this.proto(void 0).entries.call(this)}size(){return this.proto(void 0).size.call(this)}get(e){return this.proto(e).get.call(this,e)}set(e,t){return this.proto(e).set.call(this,e,t)}}const ut=e=>e instanceof et?e:new mt(e),ht=e=>{const t=(t,...n)=>st(e(ut(t),...n));return t.fn=e,t},pt=[],gt=e=>e instanceof Function?e:t=>e===t,ft=e=>(t,n,i=pt)=>ut(t).entries().reduce(((t,[n,a])=>ft(e)(a,t,i.concat(n))),e(n,[i,ut(t)])),xt=ht(((e,[t,n])=>{const[i,...a]=t;return e.set(i,a.length?xt(e.get(i),[a,n]):n)})),yt=ht(((e,t)=>t.reduce(xt.fn,e))),bt=e=>ft(((e,[t,n])=>vt(n)?[...e,[t,st(n)]]:e))(e,[]),vt=e=>0===e.size();ht(((e,t=pt)=>t.reduce(((e,t)=>e.get(t)),e)));const Nt=ht(((e,[t,...n])=>n.length?e.set(t,Nt(e.get(t),n)):e.filter((([e])=>e!==t)))),wt=(Ct=["$ref"]).map(((e,t)=>n=>gt(e)(n[t+n.length-Ct.length]))).reduceRight(nt,tt);var Ct;const St=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(kt,e),kt=it([at,(e,t)=>e[parseInt(t,10)]],[lt,(e,t)=>e[t]],[tt,rt]),It=(e,t)=>((e,t={})=>n=>yt(t,bt(n).map((t=>e(t)))))((([e,n])=>{return wt(e)?[(i=e,i.slice(0,-1)),St(t(n),n)]:[e,n];var i}))(e),Tt=e=>bt(e).filter(((e=rt)=>([t])=>e(t))(wt)),Bt=e=>{return t=Tt(e).map((([,e])=>e)),[...new Set(t)];var t};async function Pt(e,t){try{return e?await Rt(e,t):null}catch(e){console.error(e)}return null}const Rt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),Dt=e=>[...new Set(e)],Mt={},_t=["/portal-resources"],At=(e,t)=>It(e,(e=>t?.[e])),Et=(e,t)=>{const n=Bt(e),[l,r]=i({});return a((()=>{n.length&&(async e=>Object.fromEntries((await Promise.allSettled(Dt(e).filter((e=>!_t.some((t=>e.startsWith(t))))).map((async e=>[e,Mt[e]||=await Rt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(n).then(r)}),[n.join()]),n.length?At(e,{...t,...l}):e};function zt(e,t={}){const n=d((t=>{const n=Et((({block:e,options:t,className:n,defaultPadding:i,padding:a,isTheme:l,version:r,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const Ft=zt((({className:e,padding:t,defaultPadding:n,...i})=>o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...i,children:o(Je,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...i})})),{childrenTypes:["UnitBlock"]}),Vt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>Ot(0,t?.length)),[t]),i=t?.[n];return i?o(Ft,{suppressHydrationWarning:!0,...i,...e}):o(g,{...e,children:o(f,{})})})),Ot=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),Lt=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),i=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getFullYear());return t?`${a}-${i}-${n}`:`${n}.${i}.${a}`}},jt=e=>e?.replace(/[^+\d]/g,"");const qt=e=>e?{phone:jt(e)}:{},$t=(e,t="birthday")=>e?{[t]:Lt(e)}:{},Ut=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),Wt=(e,t=!0)=>({[t?"email":"mail"]:e}),Ht=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:jt(e)}:{},Yt=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:i,params:a}of e)t[i??""]?.(n,a)},Kt="rshb-query-params";function Gt(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(Kt)||"";return e&&globalThis.sessionStorage?.setItem(Kt,e),e}function Xt(e){if(!e)throw new Error("Value should be fulfilled");return e}const Jt=e=>t=>{const[,n]=Xt(e.find((([e])=>e(t))));return n(t)},Zt=e=>Jt(e.map((([e,t])=>[e,()=>t])));Zt.if=e=>new Qt(void 0,e);class Qt{parent;predicate;unit;get entry(){return[Xt(this.predicate),Xt(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new Qt(this,e)}then(e){return new Qt(this.parent,this.predicate,e)}else(e){return Jt([...en(this),[()=>!0,e]])}}const en=e=>[...e?.parent?en(e.parent):[],e.entry],tn=e=>{const t=e.target?.closest("a");if(E(t?.href)&&!t?.href?.startsWith(globalThis.location?.origin)){e.preventDefault(),e.stopPropagation();const n=(e=>{const t=Gt();if(!E(e)||!t)return e;const n=new URL(e);for(const[e,i]of new URLSearchParams(t))n.searchParams.set(e,i);return n.toString()})(t?.href)||t?.href;if(n){nn(t?.target)?.(n)}}},nn=Zt([[e=>"_blank"===e,e=>globalThis.open(e,"_blank")],[e=>"_parent"===e,e=>globalThis.parent&&(globalThis.parent.location.href=e)],[e=>"_top"===e,e=>{globalThis.top&&(globalThis.top.location.href=e)}],[()=>!0,e=>globalThis.location&&(globalThis.location.href=e)]]);function an(){return an._impl()}an._impl=()=>({forwardQuery:tn}),an.setup=e=>{an._impl=e};const ln=e=>e,rn=(e,{resetOnSubmit:t,onSubmit:n,normalize:r}={})=>{const[s,o]=i(e),c=l(r?e=>o(e instanceof Function?t=>{const n=r(e(t));return sn(t,n)?t:n}:r(e)):o,[r]);a((()=>{r&&o(r)}),[r]);const[d,m]=i(!1),[u,h]=i({}),p=l(((e,t)=>{const{parse:n=ln,format:i=ln}=t||{};return{value:i(s[e]),isDirty:d||u[e],onChange:t=>{c((i=>({...i,[e]:n(t)}))),h((t=>({...t,[e]:!0})))}}}),[c,d,u]),g=l((e=>{c(e),h(e)}),[]),f=l((()=>{c(e),m(!1),h({})}),[e]),x=l((e=>(e.preventDefault(),t?f():m(!0),n&&n(s,e),s)),[n,s]);return[s,{isDirty:d||Object.values(u).some(Boolean),field:p,update:g,reset:f,onSubmit:x}]},sn=(e,t)=>e&&t&&Object.keys({...e,...t}).every((n=>e[n]===t[n])),on=d((e=>{const{className:t,title:n,children:i,...a}=e;return o(g,{className:t,defaultPadding:"p-6xl",...a,children:c("div",{className:"container max-w-[978px] space-y-lg",children:[n?o(w,{headingType:"h3",title:n,className:"@xl:text-center"}):null,i]})})})),cn=e=>"OUTSERVICE"===e?"/api/v1/outservice/outserviceregions":void 0;function dn(e=!1){const[t,n]=i(e),a=l((()=>n(!0)),[]),r=l((()=>n(!1)),[]),s=l((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:a,setFalse:r,toggle:s}]}function mn(e,t,n,i){a((()=>{if(e&&n)return e.addEventListener(t,n,i),()=>{e.removeEventListener(t,n,i)}}),[e,t,n])}function un(e){const t=s(null),n=l((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return mn(globalThis.document,"click",n),t}const hn=({label:e,errors:t})=>e&&t?`${e}*`:e,pn=()=>{},gn="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",fn=e=>e?o(_e,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,xn=d((({key:e,className:t="",id:n,name:i,type:r="text",label:d,placeholder:m,value:h="",valid:p=!0,children:g,onChange:f,onFocus:x,onBlur:y,pattern:b,autoFocus:v=!1,isTextarea:N=!1,disabled:w=!1})=>{const C=s(null),S=l((e=>{const t=(e.target?.value||"").trimStart();f&&f(t)}),[f]);a((()=>{v&&C.current?.focus()}),[v,C]);const k=g?"pr-3xl":"",I=yn(p);return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[fn(d),N?o("textarea",{className:u("block resize-y min-h-24",bn,I),id:u("textarea",n),name:i||n,placeholder:m,value:h,onChange:S,onFocus:x,onBlur:y,disabled:w},e):o("input",{type:r,className:u("h-14",bn,k,I),ref:C,id:n,name:i||n,placeholder:m,value:h,onChange:S,onFocus:x,onBlur:y,pattern:b,disabled:w},e)]}),g]})})),yn=e=>e?gn:"border-error",bn="w-full border rounded-md text-primary-text outline-none p-m",vn=e=>o("div",{className:"h-6",children:e?o(_e,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),Nn=e=>e?.value||"",wn={url:"suggest/address"},Cn={name:{url:"suggest/fio",requestData:{parts:["NAME"],gender:"UNKNOWN"}},surname:{url:"suggest/fio",requestData:{parts:["SURNAME"],gender:"UNKNOWN"}},middleName:{url:"suggest/fio",requestData:{parts:["PATRONYMIC"],gender:"UNKNOWN"}},email:{url:"suggest/email"},dulSubdivisionCode:{url:"suggest/fms_unit",responseItemHandler:e=>e?.data?.code?.replace("-","")||""},dulIssuedBy:{url:"suggest/fms_unit"},organizationName:{url:"suggest/party"},inn:{url:"suggest/party",responseItemHandler:e=>e?.data?.inn||""},addressRegistration:wn,addressFact:wn,organizationAddress:wn,addressCourier:wn},Sn=()=>({open:(e,t)=>de.fire("popup",{type:"open",popup:e,...t}),update:(e,t)=>de.fire("popup",{type:"update",popup:e,...t}),close:()=>de.fire("popup",{type:"close"})}),kn=d((({options:e,onChange:t})=>o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",children:e?.map(((e,n)=>o("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem",onMouseDown:()=>t(e),children:o("span",{className:"min-h-6",children:e.processedValue})},n.toString())))})));function In({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=i([]),f=Sn(),x=Cn[n],y=l((()=>{h.current=t,f.close()}),[t]),b=l((e=>{y(),h.current=e.processedValue,c&&c(e.processedValue),d&&d(e)}),[y,c]),v=s(null),N=r((()=>async e=>{if(!x)return;const t=await(e=>{const{url:t,query:n,queryPrefix:i,requestData:a={},responseItemHandler:l=Nn}=e,r=(s=l,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${i?`${i}, `:""}${n}`;return fetch(`/api/v1/suggestions/${t}`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:10,...a,query:o})}).then((e=>e.json())).then(r)})({url:x.url,responseItemHandler:x.responseItemHandler,requestData:{...x?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=r((()=>((e,t=600)=>{let n;const i=(...a)=>{i.dispose(),n=setTimeout((()=>{e(...a)}),t)};return i.dispose=()=>{n&&clearTimeout(n)},i})(N,300)),[N]);return a((()=>{if(!e||!v.current||h.current===t)return void y();const n=v.current,{top:i,left:a,width:l,height:r}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.update(o(kn,{options:p,value:t,onChange:b}),{top:i+globalThis.scrollY+r,left:a,width:l})}),[e,p,t,b]),v}const Tn=d((({className:e,label:t,value:n="",placeholder:i,error:a,errors:r,onChange:s=pn,onDaDataChange:d,onBlur:m,isTextarea:h,type:p,name:g="",daDataQueryPrefix:f,maxLength:x,dadata:y=!1,disabled:b=!1})=>{const[v,{setFalse:N,setTrue:w}]=dn(),C=un(N),S=l((e=>{y&&!v&&w(),x?e.length<=x&&s(e):s(e)}),[y,v,s]),k=In({isOpen:v&&y,name:g,value:n,daDataQueryPrefix:f,onChange:s,onDaDataChange:d});return c("div",{className:u("shrink-0 w-full",e),ref:C,onBlur:N,onFocus:w,children:[o("div",{ref:k,children:o(xn,{disabled:b,type:p||"text","aria-label":t,label:hn({label:t,errors:r}),valid:Boolean(!a),value:n,onChange:S,onBlur:m,isTextarea:h,placeholder:Bn(i,r,t)})}),vn(a)]})})),Bn=(e,t,n)=>t&&!n?`${e}*`:e,Pn=e=>e?.text||e?.key||"",Rn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Dn=d((({popupRef:e,options:t,value:n,query:i,onChange:a,iconVersion:l})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",ref:e,children:Rn(t,i).map((e=>c("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem","aria-selected":e.key===n?.key,onClick:t=>{t.stopPropagation(),a&&a(e)},children:[o("span",{className:"min-h-6",children:Pn(e)}),o(W,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:l,className:u("absolute right-4 pt-3xs",{hidden:e.key!==n?.key})})]},e.key)))}):null));const Mn=d((({className:e,label:t,options:n=[],value:r,valid:d=!0,isBorder:m=!0,placeholder:h="",isSearch:p=!1,iconVersion:g="black",onChange:f,disabled:x=!1})=>{const[y,{setFalse:b,setTrue:v}]=dn(),[N,w]=i(""),C=En(x,n.length),S=y&&!C,k=l((()=>{w(""),b()}),[]),I=function({isOpen:e,options:t,value:n,query:i,onChange:r,onClose:c,iconVersion:d}){const m=Sn(),u=l((()=>{m.close(),c&&c()}),[c]),h=l((e=>{u(),r&&r(e)}),[u,r]),p=s(null),g=un(u);return a((()=>{if(!e||!p.current)return;const a=p.current,{top:l,left:r,width:s,height:c}=a.getBoundingClientRect();m.update(o(Dn,{popupRef:g,options:t,value:n,query:i,onChange:h,iconVersion:d}),{top:l+window.scrollY+c,left:r,width:s})}),[e,t,n,i,h]),p}({isOpen:y,options:n,value:r,query:N,onChange:f,onClose:k,iconVersion:g});return c("div",{className:u("space-y-xs",e),children:[fn(t),c("div",{className:u("relative",S?"z-20":"z-10"),ref:I,children:[c("div",{className:u("h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden",An(m,d,C)),onClick:S?k:v,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:Pn(r)||h}),_n(S,g)]}),p&&S?o("div",{className:u("absolute top-0 w-full z-20"),children:o(xn,{type:"text",autoFocus:!0,value:N,onChange:w})}):null]})]})})),_n=(e,t)=>o(W,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),An=(e,t,n)=>u(e?"border rounded-md ":"",e&&!n?"hover:border-primary-hover":"",n?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),En=(e,t)=>e||0===t,zn=d((({className:e="",label:t,error:n,errors:i,...a})=>c("div",{className:e,children:[o(Mn,{...a,valid:!n,label:hn({label:t,errors:i})}),vn(n)]}))),Fn=e=>!e?.length,Vn=e=>t=>n=>e(n)?[]:[t],On=Vn((e=>null!=e&&""!==e)),Ln="Некорректно заполненное поле",jn="Укажите регион, город/населенный пункт, улицу, дом",qn=e=>On(e??Ln),$n=e=>Vn((e=>e?.key&&""!==e?.key))(e??Ln),Un=e=>Vn((e=>"string"==typeof e&&e.length>0&&e.length<=2))(e??Ln),Wn=e=>Vn((e=>"string"==typeof e&&e.length>1&&ei(e)))(e??Ln),Hn=(e,t)=>Vn((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??Ln),Yn=e=>Vn((e=>"string"==typeof e&&6===e.length))(e),Kn=e=>{return(t=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,Vn((e=>"string"==typeof e&&t.test(e))))(e);var t},Gn=Vn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),Xn=e=>{const t=String(e).replace(/[^0-9]+/g,"");if(11===t.length){let e=0;for(let n=0;n<9;n++)e+=parseInt(t.charAt(n))*(9-n);return e>101&&(e%=101),100!==e&&101!==e||(e=0),e===parseInt(t.substr(9))}return!1},Jn=e=>Boolean(e.region&&e.city&&e.house),Zn=()=>Vn(Jn)(jn),Qn=/^[\u0400-\u04FF\d]+$/u,ei=(e="")=>Qn.test(e),ti={typeForm:qn(),surname:Wn("Укажите свою фамилию"),name:Wn("Укажите своё имя"),middleName:Wn("Укажите своё отчество"),region:$n(),addressBranch:$n(),phone:Kn("Укажите номер телефона"),secondaryPhone:Kn("Укажите номер телефона"),organizationPhone:Kn("Укажите номер телефона"),birthday:qn("Укажите дату рождения"),birthPlace:qn("Укажите место рождения"),education:qn("Выберите ваше образование"),housing:qn("Выберите тип жилья"),employment:qn("Выберите информацию о трудоустройстве"),organization:qn("Выберите тип организации"),amountWorkers:qn("Выберите информацию о количестве сотрудников"),employerActivities:qn("Выберите вид деятельности организации"),employerOrganization:qn("Выберите вид организации"),positionOrganization:qn("Выберите вашу должность"),dulSerie:(ni="Укажите серию паспорта",Vn((e=>"string"==typeof e&&4===e.length))(ni)),dulNumber:Yn("Укажите номер паспорта"),dulIssueDateField:qn("Укажите дату выдачи паспорта"),dulSubdivisionCode:Yn("Укажите код подразделения"),dulIssuedBy:qn("Укажите организацию, выдавшую паспорт"),email:(e=>Vn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(e))("Укажите электронную почту"),fullName:Wn(),inn:(e=>Vn((e=>"string"==typeof e&&(10===e.length||12===e.length)))(e))("Укажите ИНН"),legalForm:qn("Укажите ОПФ"),organizationName:qn("Укажите наименование организации"),generalSeniority:Un("Укажите количество лет стажа"),lastJobExperience:Un("Укажите стаж на последнем месте работы"),experience5Years:Un("Укажите общий стаж за последние 5 лет"),jobsNumber:Un("Укажите количество мест работы за последние 5 лет"),beginDate:qn("Укажите дату заключения трудового договора"),addressFact:Zn(),partnerComments:qn(),collectionCount:qn(),comment:qn(),acquiringType:$n(),feedbackMethod:$n(),serviceType:$n(),serviceDirection:$n(),regionRetail:$n("Выберите регион"),meetingDay:qn(),product:qn(),localities:qn(),consentDataProcessing:Gn,annualRevenue:qn(),consentToReceiveMaterials:Gn,processPersonalDataFlg:Gn,consentProviderFlg:Gn,consentPfrFlg:Gn,consentOthersFlg:Gn,consentInformFlg:Gn,familyStatus:qn("Выберите семейное положение"),children:Hn(2,"Укажите количество детей"),familyMembers:Hn(2,"Укажите количество членов семьи"),dependents:Hn(2,"Укажите количество иждивенцев"),totalIncome:Hn(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:Hn(10,"Укажите сумму обязательных выплат"),snils:(e=>Vn(Xn)(e))("Некорректный номер СНИЛС"),conscription:qn(),armyIdFlg:Gn,sex:qn("Укажите свой пол"),addressRegistration:Zn(),organizationAddress:Vn((e=>Boolean(e.fiasCode&&e.city&&e.house)))(jn),participantDateRegistration:qn("Укажите дату регистрации"),retirementIncome:qn(),otherIncome:qn(),wages:qn(),mandatoryPayments:qn(),disablePeopleFlg:qn(),bankruptcyFlg:qn(),shareholderFlg:qn(),legalEntityName:qn(),bankEmployeeCode:qn(),partInBusiness:qn(),addressRetail:$n("Выберите адрес банка"),addressMatch:qn(),codeWord:(e=>Vn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&ei(e)))(e??Ln))("Необходимо ввести кодовое слово"),confirmationIncome:qn(),deliveryDate:qn("Укажите дату доставки"),addressCourier:Zn()};var ni;const ii=e=>{const t=(e=>Object.values(e.filter((e=>e)))?.map((e=>e.name)))(e.filter((e=>Boolean(e?.required))));return Object.fromEntries(t.map((e=>[e,ti?.[e||""]])).filter((([,e])=>e)))},ai=(e,t)=>{const{value:n,isDirty:i}=e,a=i?t(n):[];return{...e,errors:a,error:a[0]}},li=(e,t,n=!1)=>n&&t?ai(e,t):e,ri=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],si=d((({field:e,input:t})=>o(zn,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:ri,...li(e("acquiringType"),ti.acquiringType,t?.required)}))),oi=(e="")=>Boolean("trade"===e||"all"===e),ci=e=>null!=e,di=new Map,mi=e=>Boolean(e?.every((e=>Array.isArray(e)?mi(e):!e||"string"==typeof e))),ui=e=>mi(e)?e.toString():"";function hi(e,t,{fallback:n,cache:l}={}){const s=r((()=>pi(e)),[e]),[o,c]=i(void 0),[d,m]=i(void 0);a((()=>{if(!s.some(ci))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await((e,t=di)=>n=>{const i=ui(n),a=t.get(i);if(i&&ci(a))return a;const l=e(...n);return i&&ci(l)&&t.set(i,Promise.resolve(l)),l})(t,l)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,l,s]);const u=n&&(e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]))(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function pi(e){return Array.isArray(e)?e:e instanceof Function?pi(e()):[e]}const gi=[];const fi=async e=>await Pt(e,{method:"GET"})||gi;function xi(e=!1){const{data:t}=hi("/api/v1"+(e?"/premiumBranchesByRegions":"/branchesByRegions"),Rt);return Array.isArray(t)?t:[]}const yi=d((({field:e,input:t,isPremium:n=!1})=>{const i=e("region"),l=i?.value?.key,r=i?.value?.text,s=n?xi(n)?.find((e=>e?.region===r))?.branches:function(e){const{data:t}=hi(e?`/api/v1/branches?regionCode=${e}`:null,fi);return t||gi}(l)?.filter((e=>e?.address));return a((()=>{""!==i?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[i?.value]),o(zn,{label:"Отделение",placeholder:"Выберите отделение",options:(s||[]).map((({address:e=""})=>({key:e,text:e}))),...li(e("addressBranch"),ti.addressBranch,t?.required),isSearch:!0})})),bi=d((({field:e,input:t})=>{const n="addressFact",i=e(n).value,{value:r}=e("addressMatch");a((()=>{r&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[r,e("addressRegistration").value]);const s=l((t=>{e?.(n)?.onChange?.({apartment:t?.data?.flat,city:t?.data?.city,district:t?.data?.area_with_type,fullAddress:t?.value,fiasCode:t?.data?.fias_id,house:t?.data?.house,locality:t?.data?.settlement_with_type,okatoRegionCode:t?.data?.okato,postcode:t?.data?.postal_code,region:t?.data?.region,regionCode:t?.data?.region_kladr_id?t?.data?.region_kladr_id.substring(0,2):"",street:t?.data?.house,qc:t?.data?.qc,qcComplete:t?.data?.qc_complete,qcHouse:t?.data?.qc_house})}),[]),c=l((t=>{e?.(n)?.onChange?.({...e(n).value,fullAddress:t})}),[]);return o(Tn,{label:"Адрес",disabled:r,...li(e(n),ti[n],t?.required),value:i.fullAddress,onChange:c,...t,onDaDataChange:s})})),vi=(e,t)=>Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t).value,Ni=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",i=e(n).value,a=l((t=>{e?.(n)?.onChange?.({apartment:t?.data?.flat,city:t?.data?.city,district:t?.data?.area_with_type,fullAddress:t?.value,fiasCode:t?.data?.fias_id,house:t?.data?.house,locality:t?.data?.settlement_with_type,okatoRegionCode:t?.data?.okato,postcode:t?.data?.postal_code,region:t?.data?.region,regionCode:t?.data?.region_kladr_id?t?.data?.region_kladr_id.substring(0,2):"",street:t?.data?.house,qc:t?.data?.qc,qcComplete:t?.data?.qc_complete,qcHouse:t?.data?.qc_house})}),[]),r=l((t=>{e?.(n)?.onChange?.({...e(n).value,fullAddress:t})}),[]);return o(Tn,{disabled:t?.filledByEsia&&vi(e,n),label:"Адрес",...li(e(n),ti[n],t?.required),value:i.fullAddress,onChange:r,...t,onDaDataChange:a})})),wi=d((({className:e,viewBox:t,fill:n="none",width:i,height:a,paths:l,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:i,height:a,children:l.map((({d:e,fill:t,...n},i)=>{const a={...r,...n};return o("path",{d:e,fill:t||"currentColor",stroke:a.stroke,strokeLinecap:a.strokeLinecap,strokeLinejoin:a.strokeLinejoin,strokeWidth:a.strokeWidth,strokeMiterlimit:a.strokeMiterlimit},i)}))}))),Ci="appearance-none w-5 h-5 border-solid flex-none",Si=[{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"}],ki=d((({className:e,value:t,text:n,disabled:i,isRadio:a,onChange:r})=>{const s=l((e=>{i||(e.preventDefault(),r&&r(!t))}),[r,i,t]),d=a?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(wi,{paths:Si,className:"absolute left-1 ml-px block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"});return o("div",{className:e,children:c("label",{className:u("flex items-center relative group/box",Ti(i)),onClick:s,children:[o("div",{className:u(Ci,"m-0",a?"rounded-full border-2":Pi(t),!i&&t?"border-primary-main":"border-gray",i?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:Bi(a),"aria-checked":Boolean(t),"aria-disabled":Boolean(i),"aria-label":n}),t?d:null,Ii(n)]})})})),Ii=e=>e?o("div",{className:"ml-s",children:o(_e,{size:"text-l",font:"font-light",children:e})}):null,Ti=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",Bi=(e=!1)=>e?"radio":"checkbox",Pi=(e=!1)=>u("rounded border",{"bg-primary-main":e}),Ri=d((({className:e,text:t,value:n,key:i,disabled:a,error:l,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(ki,{text:t,value:n,disabled:a,onChange:r},i),vn(l)]}))),Di=d((({field:e,input:t})=>o(Ri,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...li(e("addressMatch"),ti.addressMatch,t?.required)}))),Mi=d((({color:e="text-primary-main",position:t="absolute",blur:n=!0})=>o("div",{className:u("flex justify-center items-center h-full w-full z-50",t,{"backdrop-blur":n}),children:o("div",{className:u("inline-block h-28 w-28","animate-spin rounded-full","border-8 border-solid border-current","border-r-transparent",e),role:"status"})}))),_i="/icons/MapMarkerClusterIcon.svg",Ai="/icons/MapMarkerClusterYellowIcon.svg";function Ei({yandexMaps:e,map:t,points:n,isLoad:i}){if(i||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const a=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),l=zi("offices",e,a);if(n.length&&n.every((e=>"type"in e))){const i=zi("workplaces",e,a),r=Fi(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=Fi(n.filter((e=>"offices"===e.type)),"offices",e);l.add(s),i.add(r),t.geoObjects.add(i),t.geoObjects.add(l)}else{const i=Fi(n,"offices",e);l.add(i),t.geoObjects.add(l)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const zi=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?_i:Ai,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),Fi=(e,t,n)=>e.map((({coords:e,content:i})=>new n.Placemark(e,{balloonContentHeader:i?.header,balloonContentBody:i?.body,balloonContentFooter:i?.footer,hintContent:i?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?_i:Ai,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),Vi={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},Oi={...Vi,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},Li=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(Oi).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(W,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),ji=e=>globalThis[e];function qi(e,t,n=!0){const[l,r]=i(void 0);return a((()=>{let i=!0;return((e,t)=>{const n=document.getElementById(t);if(n){const t=ji(e);return t?Promise.resolve(t):new Promise((t=>{n.addEventListener("load",(()=>{t(ji(e))}))}))}return new Promise(((n,i)=>{const a=document.createElement("script");a.src=t,a.async=!0,a.id=t,a.addEventListener("load",(()=>{n(ji(e))})),a.addEventListener("error",(e=>{i(e)})),document.head.appendChild(a)}))})(e,t).then((e=>{i&&r(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(i=!1,n){const e=document.getElementById(t);e&&document.head.removeChild(e),r(void 0)}}}),[e,t,n]),l}const $i={...Vi,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},Ui=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),i="in"===t?n+1:n-1;e.current.setZoom(i,{checkZoomRange:!0})},className:`${Object.values($i).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(W,{name:n,width:"20",height:"16"})})})),Wi=[55.753995,37.614069],Hi=d((({points:e,className:t="",zoom:n=5,isLoad:i,selectedAddress:l})=>{const r=s(null),d=s(null),m=qi("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${A.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1);if(a((()=>{r.current?Ei({yandexMaps:m,map:r.current,points:e,isLoad:i}):m?.ready((()=>{r.current||(r.current=new m.Map(d.current,{center:Yi(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),Ei({yandexMaps:m,map:r.current,points:e,isLoad:i})})),r.current&&l&&m?.geocode(l).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();r.current.setCenter(t),r.current.setZoom(18)}))}),[m,e,n,i,l]),!m)return null;const h="z-10";return c("div",{ref:d,className:u("relative","w-full",t),children:[i?o(Mi,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(Ui,{yandexMaps:r}),o(Ui,{yandexMaps:r,direction:"out"})]}),Li(r,m,u("right-2 top-80",h))]})})),Yi=e=>{const t=[Gi(Ki(e,0)),Gi(Ki(e,1))];return t.every((e=>e))?t:Wi},Ki=(e,t)=>e.map((e=>e.coords?.[t])),Gi=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Xi=async(e,t,n)=>{try{return(await Ji(e,t,n)).json()}catch(e){return console.error(e),null}};async function Ji(e,t,n){return globalThis?.fetch?.(`/api/v1${e}`,{method:t,headers:{"Content-Type":"application/json",...Zi()},credentials:"include",body:n?JSON.stringify(n):null})}const Zi=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},Qi=e=>Number(e.toString().replace(",",".")),ea=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:n=!1,renderFoldableSection:a,renderFoldButton:r})=>{const[s,o]=i(n),d=l((()=>{o((e=>!e))}),[]),m=a({isUnfolded:s,onToggle:d}),u=r?r({isUnfolded:s,onToggle:d}):null;return c("div",t?{className:e,role:"group",children:[u,m]}:{className:e,role:"group",children:[m,u]})}));const ta=d((({className:e="",isUnfolded:t,children:n})=>{const i=s(null),l=function(e,t){const n=s(null);return a((()=>{const t=n?.current;if(!t)return;const i=new ResizeObserver((n=>{e(t,n[0])}));return i.observe(t),()=>{i.disconnect()}}),[e,...t]),n}((e=>{i.current&&(i.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:i,className:`transition-max-h duration-300 overflow-hidden ${i.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:l,children:n})})})),na=d((({value:e,subText:t,children:n,isPhone:i,...a})=>{const l=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[l.length,n,t].every((e=>!e))?null:ia({textItems:l,subText:t,children:n,isPhone:i,...a})})),ia=({label:e,labelSize:t="text-m",textItems:n,subColor:i,subText:a,className:l,children:r,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",l),children:[e?o(_e,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||aa(n,s),a?o(_e,{color:i,size:"text-m",children:a}):null]}),aa=(e,t)=>e.filter(Boolean).map(((e,n)=>o(_e,{size:"text-l",children:t?o("a",{href:`tel:${la(e)}`,children:e.trim()}):e.trim()},String(n)))),la=e=>e.replace(/\D/g,""),ra=d((({className:e,children:t})=>o("div",{className:u("flex flex-col sm:flex-row sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),sa=e=>{const t=ca(e);return o(na,{label:"Режим работы",value:t,className:"max-w-none"})},oa=({workTime:e="",lunchHour:t="",daysOff:n=""},i=!1)=>e?[`${i?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",ca=e=>{const t=e.find((e=>"workingSaturday"!==e.key&&Boolean(e.status)&&Boolean(e.workTime))),n=e.find((e=>"workingSaturday"===e.key&&Boolean(e.status)&&Boolean(e.workTime))),i=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[oa({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":i}),oa({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:i},!0)].filter(Boolean)},da=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],ma=e=>da.map((([t,n,i])=>({key:t,title:i,short:n,status:Boolean(e?.[t]),get workTime(){return"workingSaturday"===t?e?.workTimeSaturday:e?.workTime},get lunchHour(){return"workingSaturday"===t?e?.lunchHourSaturday:e?.lunchHour},get hasLunch(){return/\d+/.test(this.lunchHour??"")}}))),ua=e=>{if(!e)return null;const t=ha(e);return c(ra,{className:"border-none",children:[o(na,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(pa)})}),o(na,{label:"Режим работы",className:"max-w-none",children:o(_e,{children:e})})]})},ha=e=>{const t=da.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],i=n[n.length-1]?.toLowerCase();return i?.includes("выходной")?t.map((e=>({...e,status:!i?.includes(e.short.toLowerCase())}))):t},pa=({short:e,status:t},n)=>o("div",{className:u("w-9 h-9 rounded-md flex items-center justify-center",t?"bg-green-more-light text-green-dark":"bg-error/30 text-error"),children:o(_e,{size:"text-xs",children:e})},String(n)),ga=({currency:e,buyExchangeRate:t,saleExchangeRate:n},i)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(na,{label:"Валюта",value:e.currency}):null,t?o(na,{label:"Купить",value:String(t)}):null,n?o(na,{label:"Продать",value:String(n)}):null]},String(i)),fa={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"}},xa=d((({className:e,children:t,color:n="gray"})=>c("div",{className:u("sm:p-s sm:border sm:border-green rounded-md flex items-center h-fit",fa[n].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ne,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(_e,{size:"text-m",color:fa[n].text,children:t})]}))),ya=(new Date).getDay(),ba=e=>{const[t]=e?.slice(ya-1)??[];if(!t)return null;const{lunchHour:n,status:i,workTime:a,hasLunch:l}=t;return i?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[a?o(xa,{color:"green",children:a}):null,n&&l?o(xa,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(xa,{color:"red",children:"Выходной"})},va=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Na=({title:e,status:t,workTime:n,lunchHour:i,hasLunch:a},l)=>o(na,{label:e,value:t&&n?n:"",subText:va({lunchHour:i,hasLunch:a,status:t}),subColor:!t||a?"text-error":"text-green-dark"},String(l)),wa=["ArrowDownIcon","ArrowUpIcon"],Ca=["Подробнее","Скрыть"],Sa=({isUnfolded:e,onToggle:t})=>c("button",{className:"w-full py-2xl cursor-pointer text-primary-main flex items-center border-b border-solid border-main-divider",onClick:t,type:"button",children:[o("div",{className:"pr-m",children:Ca[Number(e)]}),o(W,{className:"text-primary-text",name:wa[Number(e)],width:"16",height:"16"})]}),ka=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,Ia=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,Ta=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,Ba=({name:e,address:t,phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},u)=>{if(!d)return null;const h=ma(d);return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(_e,{size:"text-h4",children:e}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(_e,{size:"text-l",children:t})]}):null]}),ba(h)]}),o("div",{className:"hidden sm:block",children:Pa({phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(ea,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ta,{isUnfolded:e,children:Pa({phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Sa({isUnfolded:e,onToggle:t})})]},String(u))},Pa=({phone:e,fax:t,phoneBusiness:n,phoneNatural:i,phoneCallCentre:a,phoneCurrencyControl:l,workSchedule:r,exchangeRate:s})=>{const d=ma(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(ra,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(na,{label:"Факс",value:t,isPhone:!0}),o(na,{label:"Телефон филиала",value:e,isPhone:!0}),o(na,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(na,{label:"Обслуживание физических лиц",value:i,isPhone:!0}),o(na,{label:"Для консультаций по валютному контролю",value:l,isPhone:!0}),o(na,{label:"Контакт-центр",value:a,isPhone:!0})]}),r?.isMatchesPattern?o(ra,{children:o(na,{label:m,labelSize:"text-l",className:"w-full max-w-none",children:o("div",{className:"flex flex-wrap gap-xs sm:justify-between pt-xs",children:d?.map(Na)})})}):c(ra,{children:[o(na,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(pa)})}),sa(d)]}),r?.businessScheduleVisibleTag?ua(r?.businessScheduleDescription):null,s?.currencies?.length?o(ra,{className:"flex-wrap",children:s?.currencies?.map(ga)}):null]})},Ra=({name:e="",address:t="",workSchedule:n})=>{const i=(a=e)?`${a?.charAt(0)?.toUpperCase()}${a?.slice(1)}`:"";var a;const l=`${t} ${(e=>{const t=ma(e),n=e?ca(t):"",i=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?ka(n):Ta(n,i):Ia(n):""})(n)}`;return{header:i,body:l}},Da=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),Ma=d((({children:e})=>Da?e:null)),_a={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},Aa={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},Ea={workingSaturday:e=>Boolean("workSchedule"in e&&e.workSchedule?.workingSaturday),premiumService:e=>Boolean("premiumService"in e&&e.premiumService),privateBanking:e=>Boolean("privateBanking"in e&&e.privateBanking),remoteWorkplace:e=>Boolean("workScheduleDescription"in e),serviceDisabledPeople:e=>Boolean("serviceDisabledPeople"in e&&e.serviceDisabledPeople),sellingCoins:e=>Boolean("sellingCoins"in e&&e.sellingCoins),buyingCoins:e=>Boolean("buyingCoins"in e&&e.buyingCoins),bullionOperations:e=>Boolean("bullionOperations"in e&&e.bullionOperations),preciousMetalsOperations:e=>Boolean("preciousMetalsOperations"in e&&e.preciousMetalsOperations),transferringDataToBiometricSystem:e=>Boolean("transferringDataToBiometricSystem"in e&&e.transferringDataToBiometricSystem)};function za({disabled:e,onClick:t}){return n=>{!e&&t&&t(n)}}const Fa={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"},Va={primary:u("group-data-secondary:text-primary-main group-data-secondary:bg-white","group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active"),secondary:u("group-data-secondary:text-white group-data-secondary:bg-white/20","group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active")},Oa=d((({children:e,...t})=>{const n=e=>({...e,onClick:ue(za(e))}),{className:i,version:a="primary",active:l,disabled:r,type:s="button",rounded:c=!0,role:d,onClick:m}=n(t);return o("button",{className:u("font-sans px-9 py-4","flex justify-center items-center gap-xs",{"text-white bg-primary-active":l,"bg-main-gray text-main-disabled cursor-not-allowed":r,"rounded-md":c},l||r?"":u(Fa[a],Va[a]),i),type:s,role:d,onClick:m,children:e})})),La=(e,t)=>e&&"underlined"!==t?"primary":"secondary",ja=(e,t,n)=>{const i=La("all"===t),a=La("business"===t),l=(e,t,i)=>{const a=e.currentTarget===e.target&&"business"===t?r(i):i;return n(t),a},r=e=>e.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription));return c("div",{className:"flex gap-lg flex-col sm:flex-row pb-lg",children:[o(Oa,{"data-id":"all",onClick:t=>l(t,"all",e),version:i,children:"Для физических лиц"}),o(Oa,{"data-id":"business",onClick:t=>l(t,"business",e),version:a,children:"Для юридических лиц"})]})},qa=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o(De,{__html:e,richVersion:n})}):null,t?.length?o("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl",children:t.map(((e,t)=>c("div",{className:"flex gap-xs items-center",children:[e?.image?o(ne,{image:e.image}):null,e?.text?o(_e,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,$a="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",Ua=({filters:e,field:{field:t,reset:n},onlyOffice:i,labels:a})=>{const l=i?5:6,r=(e||[]).map((e=>o(ki,{text:a[e],...t(e)},e))),[s,d]=l>0?[r.slice(0,l),r.slice(l)]:[r,[]];return o("div",{children:e?.length?o("div",{children:o(ea,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:$a,children:s}),o(ta,{className:$a,isUnfolded:e,children:d})]}),renderFoldButton:Wa(n,i)})}):null})},Wa=(e,t=!1)=>({isUnfolded:n,onToggle:i})=>c("div",{className:"flex space-x-lg",children:[t?o(ve,{version:"transparent",className:"text-secondary-text [&>*]:p-0",appendRight:o(W,{name:["ArrowDownIcon","ArrowUpIcon"][Number(n)],width:"16",height:"16"}),text:["Больше фильтров","Меньше фильтров"][Number(n)],onClick:i}):null,o(ve,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:e,children:Ha()})]}),Ha=()=>c("div",{className:"flex items-center",children:["Очистить фильтр",o(W,{name:"CloseIcon",width:"16",height:"16",className:"ml-2xs"})]}),Ya=(e,t)=>o("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:c(w,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(_e,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),Ka=()=>{},Ga=e=>"all"===e?"block":"hidden",Xa=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:a=[],renderCard:l=Ka,renderRemoteWorkplaceCard:r=Ka,getBalloon:s=Ka,getBalloonRemoteWorkplaces:d=Ka,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=rn(_a),{filteredItems:y,points:b,filteredRemoteWorkplaces:v,lengthItems:N}=el({data:t,remoteWorkplaces:a,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=i("all"),S={filters:Za([...t,...a]),field:{field:f,reset:x},onlyOffice:p,labels:Aa};return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[Ya(h,N),m?qa(m):null,p&&ja(t,w,C),o("div",{className:u("pb-3xl",Ga(w)),children:Ua(S)})]}),o("div",{className:"h-[600px]",children:o(Ma,{children:o(Hi,{points:b,isLoad:n,className:"h-full"})})})]}),c(Ma,{children:[y.map(l),v.map(r)]})]})})),Ja=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>Ea[t](e)))))},Za=e=>Object.keys(_a).filter((t=>e.filter((e=>Ea[t](e))).length)),Qa=()=>{},el=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:i=Qa,getBalloonRemoteWorkplaces:a=Qa})=>{const[l,s,o,c]=r((()=>{const l=Ja(e,n),r=Ja(t,n),s=[...l.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:i(e)}))),...r.map((e=>({type:"workplaces",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a({address:e.address,workScheduleDescription:e.workScheduleDescription})})))].filter((e=>e.coords&&2===e.coords.length));return[l,s,r,l.length+r?.length]}),[e,t,n,i,a]);return{filteredItems:l,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},tl=e=>{const{data:t,error:n}=hi(`/api/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,nl);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},nl=async e=>await Pt(e,{method:"POST"})||[],il=d((({field:e,input:t})=>{const[n,l]=i([]),{data:r}=tl("REGION_RF"),s=e("regionRetail")?.value||{},d=e("addressRetail");a((()=>{(async()=>{const e=await(async e=>(await Xi("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0}))?.offices?.map((e=>({...e,gpsLatitude:Qi(e.latitude??Wi[0]),gpsLongitude:Qi(e.longitude??Wi[1])})))||[])(s?.key??"");l(e)})(),s?.key&&e?.("addressRetail")?.onChange?.("")}),[s.key]);const{points:m}=el({data:n,filtrationState:{},getBalloon:Ra}),u=Boolean(s?.key);return c("div",{children:[o(zn,{label:"Адрес отделения",placeholder:"Выберите отделение",options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...li(e("addressRetail"),ti.addressRetail,t?.required&&u),isSearch:!0}),o("div",{className:"h-[600px]",children:o(Ma,{children:o(Hi,{points:m,isLoad:!r,className:"h-full",selectedAddress:d?.value?.text})})})]})})),al=(e,{normalize:t,format:n})=>{const{value:a,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=i(!1),m=l((e=>{d(!0),r&&r(e)}),[]),u=l((()=>{d(!1),o&&o(t(a)),s&&s()}),[o,a]);return{value:c||!n?a:n(a),onFocus:m,onBlur:u}},ll=(e,t,n)=>Math.max(t,Math.min(e,n));function rl(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function sl({list:e=[],min:t,max:n,step:i,value:a=e[0]||t,disabled:l,onChange:r}){const s=e.length?e.indexOf(a):a,d={backgroundSize:`${(100*(s>t?s-t:0)/(n-t)).toFixed(2)}% 100%`};return c("div",{children:[e.length?o("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>o("div",{className:u("w-2 h-2 rounded-full",s<=t||l?"bg-gray":"bg-primary-main")},String(t))))}):null,o("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:o("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:d,type:"range",min:t,max:n,step:i,value:s,disabled:l,onChange:t=>{const n=rl(t.target?.value),i=e.length?e[n]:n;r&&r(i||0)}})})]})}const ol=1,cl=100,dl=d((e=>{const{className:t,title:n,items:i=[],list:a=[],min:r=(a.length?0:ol),max:s=(a.length?a.length-1:cl),step:d=1,value:m=a[0]||r,disabled:h=!1,onChange:p}=e,g=al(e,{normalize:(e=0)=>a.length?ml(a)(e):ll(e,r,s),format:We()}),f=l((e=>{p&&p(rl(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(_e,{size:"text-m",font:"font-light",color:"text-primary-text",children:n}):null,o("input",{className:u("text-h3 w-full h-14","pl-m mt-xs box-border","text-primary-text",gn,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),sl({list:a,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),ul(i)]})})),ml=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),ul=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(_e,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),hl=["От 1 000 ₽","До 1 000 000 000 ₽"],pl=d((({field:e})=>o(dl,{title:"Сумма, ₽",items:hl,min:1e3,max:1e9,...e("amount")}))),gl=zt((({field:e,source:t,label:n,fieldName:i,input:a,placeholder:l="Выберите из списка",isSearch:r=!1})=>{const s=t&&t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(zn,{placeholder:l,label:n,options:s,isSearch:r,...li(e(i),ti[i],a?.required)})})),fl=d((({field:e,input:t})=>{const{data:n}=tl("EMPLOYEES_NUMBER");return o(gl,{field:e,source:n,label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),xl=d((({field:e,input:t})=>o(Tn,{label:"Годовая выручка, ₽",...li(e("annualRevenue"),ti.annualRevenue,t?.required)}))),yl=d((({field:e,input:t})=>o(Ri,{text:"Наличие военного билета",...li(e("armyIdFlg"),ti.armyIdFlg,t?.required)}))),bl=d((({field:e,input:t})=>o(Tn,{label:"Код представителя Банка",placeholder:"Введите код",type:"number",...li(e("bankEmployeeCode"),ti.bankEmployeeCode,t?.required),...t}))),vl=d((({field:e})=>o(Tn,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e("bankEmpolee")}))),Nl=d((({field:e,input:t})=>o(Ri,{text:"В отношении меня ведётся производство по делу о банкротстве",...li(e("bankruptcyFlg"),ti.bankruptcyFlg,t?.required)}))),wl=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:i,currentYear:a,min:l,max:r,onDateClick:s})=>{const c=[];let d=1;for(let m=0;m<6;m++){const u=[];for(let c=0;c<7;c++)if(0===m&&c<t)u.push(o("td",{},`empty-${c}`));else if(d>n)u.push(o("td",{},`empty-${c}`));else{const t=new Date(a,i,d),n=Cl(t,e),c=Sl(t,l,r);u.push(o("td",{children:o("div",{className:kl(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},Cl=(e,t)=>t&&e.toDateString()===t.toDateString(),Sl=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),kl=(e=!1,t=!1)=>u("p-s text-center rounded-md border",{"border-transparent hover:bg-gray":!e},t?"text-gray hover:bg-transparent":"cursor-pointer"),Il=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Tl=d((({today:e,currentMonth:t,currentYear:n,min:i,max:a,onDateSelect:s=pn,setValue:d=pn})=>{const m=l((e=>{s(e),d(!1)}),[]),{firstDayOfWeek:u,totalDays:h}=r((()=>({firstDayOfWeek:new Date(n,t,1).getDay()-1,totalDays:new Date(n,t+1,0).getDate()})),[n,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:Il.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:wl({firstDayOfWeek:u,today:e,totalDays:h,currentYear:n,currentMonth:t,min:i,max:a,onDateClick:m})})]})})),Bl=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function Pl(e,t){const n=e.replace(/\D/g,"");if(""===n||e?.length===t.length)return e;const i=[...t],a=i.findIndex(Rl),l=i.map(((e,t)=>Ml(e)?i.slice(0,t).filter(Ml).length:-1)),r=i.map(((e,t)=>Dl(e)?e:n.charAt(l[t])||e)),s=l.indexOf(n.length-1)+1;return r.slice(0,Math.max(a,s)).join("")}const Rl=e=>"_"===e,Dl=e=>/\d/.test(e),Ml=e=>Rl(e)||Dl(e),_l=1940,Al={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},El=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:l,disabled:r,onChange:d,onClick:m})=>{const h=s(null),[p,g]=i(l||"");return a((()=>{g(l||"")}),[l]),c("div",{onClick:()=>{null!==h.current&&h.current.focus(),m?.()},className:u("relative",n),children:[o("input",{ref:h,className:"h-full w-full px-m text-l text-black focus-visible:outline-none",value:p,type:"text",onChange:e=>{const t=e.target?.value;"string"==typeof t&&t?.length<11&&g(Pl(t,"__.__.____"))},onBlur:()=>{if(zl(p)){const[n,i,a]=p.split(".");d?.(new Date(Number(a),Number(i)-1,Number(n))),e(Number(i)-1),t(Number(a))}else g(l||"")},disabled:r}),r?null:o(W,{className:"mr-s",...Al})]})})),zl=e=>{const[t,n,i]=e.split(".");if((e=>Number(e)>=_l&&Number(e)<=(new Date).getFullYear())(i)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(i),Number(n)-1,1);let a=0;for(;e.getMonth()===Number(n)-1;)e.setDate(e.getDate()+1),a++;if(Number(t)>0&&Number(t)<=a)return!0}return!1},Fl=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:i,setSelectedMonth:a,setSelectedYear:l,disabled:r=!1})=>o(El,{onChange:i,disabled:r,onClick:e,value:t&&Lt(t),setSelectedMonth:a,setSelectedYear:l,className:u("flex justify-between items-center h-14 border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",n?"border-gray":"border-error")}),Vl=Bl.map((e=>({key:e}))),Ol=Array.from({length:(new Date).getFullYear()-_l+1},((e,t)=>_l+t)).reverse().map((e=>({key:String(e)}))),Ll=(e,t)=>{const n=new Date(e,t,1);let i=0;for(;n.getMonth()===t;)i++,n.setDate(n.getDate()+1);return i},jl=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:i,onChange:a})=>{i&&a?.(new Date(t,n,Math.min(e,i.getDate())))},ql={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},$l={className:"min-w-32",iconVersion:"black",isBorder:!1},Ul=d((({className:e="",label:t="",value:n,valid:r=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g}]=dn(!1),[f,x]=i(n?.getMonth()||(new Date).getMonth()),[y,b]=i(n?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:v,handleNextMonth:N,handleSelectMonth:w,handleSelectYear:C,monthsOptions:S,yearsOptions:k,handleChangeVisibleCalendar:I,ref:T}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:i,onYearSelect:a,selectedYear:r,onChange:s,value:o})=>{const c=un(l((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:l((()=>e(!t)),[t]),handleNextMonth:l((()=>{n+1<=11?i(n+1):(i(0),a(r+1))}),[n]),handlePrevMonth:l((()=>{n-1>=0?i(n-1):(i(11),a(r-1))}),[n]),handleSelectMonth:l((({key:e})=>{i(Bl.indexOf(e));const t=Ll(r,Bl.indexOf(e));jl({maxDateOfMonth:t,selectedYear:r,selectedMonth:Bl.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:l((({key:e})=>{a(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:Vl,yearsOptions:Ol,ref:c}})({onYearSelect:b,onMonthSelect:x,onShowCalendar:g,selectedYear:y,selectedMonth:f,showCalendar:p,onChange:h,value:n}),B=((e,t)=>{const[n,l]=i(!1);return a((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();l(n>t)}};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e]),n})(T,370);return c("div",{className:u("space-y-xs",e),ref:T,children:[fn(t),c("div",{className:"relative",children:[Fl({handleChangeVisibleCalendar:I,value:n,valid:r,onChange:h,disabled:m,setSelectedMonth:x,setSelectedYear:b}),p&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":B}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:v,children:o(W,{...ql,className:"-rotate-90 cursor-pointer"})}),o(Mn,{onChange:w,value:{key:Bl[f]},options:S,...$l}),o(Mn,{onChange:C,value:{key:String(y)},options:k,...$l}),o("div",{className:"my-auto",onClick:N,children:o(W,{...ql,className:"rotate-90 cursor-pointer"})})]}),o(Tl,{today:n,currentMonth:f,currentYear:y,onDateSelect:h,min:s,max:d,setValue:g})]}):null]})]})})),Wl=d((({className:e,label:t,error:n,errors:i,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Ul,{label:hn({label:t,errors:i}),valid:Boolean(!n),...a}),vn(n)]}))),Hl=d((({field:e,input:t})=>o(Wl,{label:"Дата начала работы на текущем месте",...li(e("beginDate"),ti.beginDate,t?.required),...t}))),Yl="birthday",Kl=d((({field:e,input:t,isRetailForm:n=!1})=>{const{value:i}=e(Yl);return o(Wl,{label:"Дата рождения",...li(e(Yl),ti.birthday,t?.required),error:n&&i&&!Gl(i)?"Допустимый возраст заёмщика - от 23 до 75 лет":"",disabled:t?.filledByEsia&&vi(e,Yl)})})),Gl=e=>{const t=new Date,n=new Date(t.getFullYear()-23,t.getMonth(),t.getDate()),i=new Date(t.getFullYear()-75,t.getMonth(),t.getDate());return!(!e||e>n||e<i)},Xl=d((({field:e,input:t})=>o(Tn,{label:"Место рождения",...li(e("birthPlace"),ti.birthPlace,t?.required),...t,disabled:t?.filledByEsia&&vi(e,"birthPlace")}))),Jl=d((({field:e,input:t})=>{const[n,l]=i([]),r=e("paymentSystem").value;return a((()=>{(async()=>{const e=await(async e=>{const t=await Ji("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemType:e,creditProgramId:13}});return await(t?.json())})(r);l(e)})()}),[r]),o(gl,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t})})),Zl=d((({field:e,input:t})=>o(Tn,{label:"Количество детей до 18 лет",placeholder:"Введите значение",type:"number",...li(e("children"),ti.children,t?.required),...t}))),Ql=d((({field:e,input:t})=>o(Tn,{label:"Кодовое слово",...li(e("codeWord"),ti.codeWord,t?.required),...t}))),er=d((({field:e,input:t})=>o(Tn,{label:"Количество объектов инкассации",type:"number",...li(e("collectionCount"),ti.collectionCount,t?.required)}))),tr=d((({field:e,input:t})=>o(Tn,{className:"col-span-2",...li(e("comment"),ti.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),nr=d((({field:e,input:t})=>{const{data:n}=tl("INCOME_CERT_UNITED");return o(gl,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),ir=d((({field:e,input:t})=>{const{data:n}=tl("MILITARY_STATUS");return o(gl,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),ar={processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3},consentToReceiveMaterials:{text:"Согласен на получение информационных и аналитических материалов по электронной почте"}},lr=async(e,t=!1)=>{const n=await(async(e,t=!1)=>{const n=await Ji(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return n?await n.blob():new Blob})(e,t);return URL.createObjectURL(n)},rr=d((({className:e,onClose:t})=>o("button",{className:u("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",type:"button",children:o(W,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),sr=d((({className:e,head:t,children:n,onClose:i,onClick:a})=>{const{close:r}=me(),s=l((()=>{r(),i&&i()}),[i]);return c("div",{onClick:a,className:u("relative min-h-full bg-white pt-0 p-lg",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(rr,{className:"absolute top-0 right-0",onClose:s}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})})),or=async(e,t,n=!1)=>{const i=await lr(t,n);e(o(sr,{className:"my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0",children:n?o("img",{src:i}):o("iframe",{src:`${i}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"})}))},cr=d((({className:e,error:t,docId:n,...i})=>{const{open:a}=me(),l=Se();return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(ki,{...i}),n?o(ve,{className:"text-primary-main",onClick:()=>or(a,n,l),children:o(_e,{children:"Ознакомиться"})}):null]}),vn(t)]})})),dr=d((({field:e,input:t})=>t&&t.name?o(cr,{text:ar[t.name]?.text,docId:ar[t.name]?.docId,...li(e(t.name),ti[t.name],t?.required)}):null)),mr=d((({field:e,input:t})=>{const{data:n}=tl("CREDIT_IN_RSHB");return o(gl,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком / \n вкладчиком с долей участия более 20% уставного капитала руководителем, \n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t})})),ur={horizontal:"@lg:flex-row",vertical:""},hr=d((({label:e,items:t,value:n,className:i,onChange:a,disabled:l=!1,orientation:r="horizontal"})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(_e,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",ur[r],i),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(ki,{isRadio:!0,text:t,value:n===e,onChange:()=>a&&a(e),disabled:l},String(e))))})]}))),pr=d((({className:e,label:t,onChange:n,error:i,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(hr,{label:hn({label:t,errors:a?.errors}),onChange:e=>n&&n(e),...a}),vn(i)]}))),gr=[{id:"rub",text:"Рубль"}],fr=d((({field:e,input:t})=>{const{value:n,onChange:i}=e("currency");return o(pr,{label:"Валюта",orientation:"horizontal",items:gr,value:n,onChange:e=>i?.(e),...li(e("currency"),ti.currency,t?.required)})})),xr=d((({field:e,input:t})=>o(Wl,{label:"Дата доставки",...li(e("deliveryDate"),ti.deliveryDate,t?.required)}))),yr=d((({field:e,input:t})=>o(Tn,{label:"Количество иждивенцев",placeholder:"За исключение детей до 18 лет",type:"number",maxLength:2,...li(e("dependents"),ti.dependents,t?.required),...t}))),br=d((({field:e,input:t})=>o(Wl,{label:"Желаемая дата встречи",...li(e("desiredMeetingDate"),ti.meetingDay,t?.required)}))),vr=d((({field:e,input:t})=>o(Ri,{text:"Являюсь инвалидом",...li(e("disablePeopleFlg"),ti.disablePeopleFlg,t?.required)}))),Nr="dulIssueDateField",wr=d((({field:e,input:t})=>o(Wl,{label:"Дата выдачи",...li(e(Nr),ti.dulIssueDateField,t?.required),disabled:t?.filledByEsia&&vi(e,Nr)}))),Cr="dulIssuedBy",Sr=d((({field:e,input:t})=>{const{value:n,onChange:i}=e("dulSubdivisionCode"),a=l((e=>{i?.(e?.data?.code?.replace("-",""))}),[]);return o(Tn,{disabled:t?.filledByEsia&&vi(e,Cr),label:"Кем выдан",...t,...li(e(Cr),ti.dulIssuedBy,t?.required),onDaDataChange:a,daDataQueryPrefix:n})})),kr=d((({field:e,input:t})=>o(Tn,{disabled:t?.filledByEsia&&vi(e,"dulNumber"),label:"Номер документа",type:"number",maxLength:6,...li(e("dulNumber"),ti.dulNumber,t?.required)}))),Ir=d((({field:e,input:t})=>o(Tn,{disabled:t?.filledByEsia&&vi(e,"dulSerie"),label:"Серия документа",type:"number",maxLength:4,...li(e("dulSerie"),ti.dulSerie,t?.required)}))),Tr="dulSubdivisionCode",Br=d((({field:e,input:t})=>{const n=l((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(Tn,{disabled:t?.filledByEsia&&vi(e,Tr),label:"Код подразделения",type:"number",maxLength:6,...t,...li(e(Tr),ti.dulSubdivisionCode,t?.required),onDaDataChange:n})})),Pr=d((({field:e,input:t})=>{const{data:n}=tl("EDUCATION_LEVEL");return o(gl,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),Rr=d((({field:e,input:t})=>{const{required:n,...i}=t;return o(Tn,{label:"Электронная почта",...li(e("email"),ti.email,n),...i})})),Dr=d((({field:e,input:t})=>{const{data:n}=tl("ORGANIZATION_ACTIVITY_TYPE");return o(gl,{field:e,source:n,label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),Mr=d((({field:e,input:t})=>{const{data:n}=tl("ORGANIZATION_KIND");return o(gl,{field:e,source:n,label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),_r=d((({field:e,input:t})=>{const{data:n}=tl("EMPLOYMENT_INFO_UNITED");return o(gl,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),Ar=d((({field:e,input:t})=>o(Tn,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",type:"number",...li(e("expenses"),ti.expenses,t?.required),...t}))),Er=d((({field:e,input:t})=>o(Tn,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",maxLength:2,...li(e("experience5Years"),ti.experience5Years,t?.required),...t}))),zr=d((({field:e})=>{const{value:t,onChange:n}=e("familyMembers"),i=e("familyStatus")?.value?.key,l="MARRIED"===i?2:1,r=Number(e("children")?.value),s=Number(e("dependents")?.value),c=l+r+s;return a((()=>{e?.("familyMembers")?.onChange?.(c)}),[i,r,s]),o(Tn,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:t,onChange:e=>n?.(e)})})),Fr=d((({field:e,input:t})=>{const{data:n}=tl("MARITAL_STATUS");return o(gl,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),Vr=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],Or=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],Lr=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],jr=d((({field:e,input:t})=>o(zn,{label:"Способ получения ответа",options:Lr,...li(e("feedbackMethod"),ti.feedbackMethod,t?.required)}))),qr=d((({field:e,input:t})=>o(Tn,{label:"ФИО",...li(e("fullName"),ti.fullName,t?.required),...t}))),$r=d((({field:e,input:t})=>o(Tn,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...li(e("generalSeniority"),ti.generalSeniority,t?.required),...t}))),Ur=d((({field:e,input:t})=>{const{data:n}=tl("HOUSE_TYPE");return o(gl,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Wr=d((({field:e,input:t})=>{const n=l((t=>{e?.("organizationName")?.onChange?.(t.data?.name?.short_with_opf),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(Tn,{label:"ИНН",type:"number",maxLength:12,...t,...li(e("inn"),ti.inn,t?.required),onDaDataChange:n})})),Hr=d((({field:e})=>o(Ri,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),Yr=d((({field:e,input:t})=>o(Tn,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",type:"number",maxLength:2,...li(e("jobsNumber"),ti.jobsNumber,t?.required),...t}))),Kr=d((({field:e,input:t})=>o(Tn,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...li(e("lastJobExperience"),ti.lastJobExperience,t?.required),...t}))),Gr=d((({field:e,input:t})=>o(Tn,{label:"Наименование юридического лица",...t,...li(e("legalEntityName"),ti.legalEntityName,t?.required)}))),Xr=d((({field:e,input:t})=>o(Tn,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...li(e("legalForm"),ti.legalForm,t?.required),...t}))),Jr=[];async function Zr(){const e=await Pt("/api/v1/outservice/outserviceregions");return e&&Array.isArray(e)?e:Jr}const Qr=d((({field:e,input:t})=>{const n=e("region")?.value?.key,{data:i}=hi("outServiceRegions",Zr),l=i?.find((e=>e.code===n))?.localities?.map((e=>({key:e,text:e})));return a((()=>{""!==n&&e?.("localities")?.onChange?.("")}),[n]),o(zn,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:l,...li(e("localities"),ti.localities,t?.required),isSearch:!0})})),es=d((({field:e,input:t})=>o(Tn,{label:"Обязательные выплаты",placeholder:"Введите значение",type:"number",...li(e("mandatoryPayments"),ti.mandatoryPayments,t?.required),...t}))),ts=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],ns=d((({field:e,input:t})=>o(pr,{orientation:"horizontal",items:ts,...li(e("methodObtain"),ti.methodObtain,t?.required)}))),is="middleName",as=d((({field:e,input:t})=>o(Tn,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&vi(e,is),...li(e(is),ti.middleName,t?.required),...t}))),ls=d((({field:e,input:t})=>o(Tn,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&vi(e,t.name??""),...li(e("name"),ti.name,t?.required),...t}))),rs=d((({value:e=!1,text:t,type:n="checkbox",onChange:i})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>i&&i(!e),children:[o("div",{className:u("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:o("div",{className:u("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(_e,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),ss=d((({field:e})=>oi(e("acquiringType")?.value?.key)?o(rs,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),os=d((({field:e,input:t})=>{const{data:n}=tl("ORGANIZATION_TYPE");return o(gl,{field:e,source:n,label:"Тип организации",fieldName:"organization",input:t})})),cs=d((({field:e,input:t})=>{const n=l((t=>{e?.("inn")?.onChange?.(t.data?.inn),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(Tn,{label:"Наименование организации",...t,...li(e("organizationName"),ti.organizationName,t?.required),onDaDataChange:n})})),ds=d((({field:e,input:t})=>o(Tn,{label:"Иные доходы",placeholder:"Введите значение",type:"number",...li(e("otherIncome"),ti.otherIncome,t?.required),...t}))),ms=d((({field:e,input:t})=>o(Wl,{label:"Дата регистрации по месту жительства",...li(e("participantDateRegistration"),ti.participantDateRegistration,t?.required)}))),us=d((({field:e,input:t})=>{const n="BUSINESS_OWNER"===e("positionOrganization")?.value?.key,i={...li(e("partInBusiness"),ti.partInBusiness,t?.required)};return o(Tn,{label:"Доля участия в бизнесе",placeholder:"в %",type:"number",maxLength:3,...i,...t,onChange:e=>i?.onChange&&i?.onChange(String(Number(e)>100?100:Number(e)||"")),value:n?i?.value:"",disabled:!n})})),hs=d((({field:e,input:t})=>{const{required:n,...i}=t;return o(Tn,{...li(e("partnerComments"),ti.partnerComments,n),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...i})})),ps=d((({field:e,input:t})=>{const{value:n,onChange:l}=e("paymentSystem"),[r,s]=i([]);return a((()=>{(async()=>{const e=await(async()=>{const e=await Ji("/public-data/creditProgramConditions","POST",{creditProgramId:13});return(await(e?.json()))?.paymentSystems?.map((e=>({id:e.type,text:e.name})))})();s(e||[])})()}),[]),o(pr,{label:"Платежная система",orientation:"horizontal",items:r,value:n,onChange:e=>l?.(e),...li(e("paymentSystem"),ti.paymentSystem,t?.required)})})),gs=e=>"_"===e,fs=e=>/\d/.test(e),xs=e=>gs(e)||fs(e),ys=[..."+7 (___) ___-__-__"],bs=ys.findIndex(gs),vs=ys.map(((e,t)=>xs(e)?ys.slice(0,t).filter(xs).length:-1));function Ns(e){const t=e.replace(/\D/g,""),n=ys.map(((e,n)=>fs(e)?e:t.charAt(vs[n])||e)),i=vs.indexOf(t.length-1)+1;return(i?n.slice(0,Math.max(bs,i)):n).join("")}const ws=d((({children:e,onChange:t,...n})=>{const i=l((e=>t&&t(Ns(e))),[t]),a=l((e=>{"+7 ("===e&&t&&t("")}),[]);return o(xn,{...n,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>a(e?.target?.value||""),children:e})})),Cs=d((({className:e,label:t,error:n,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ws,{"aria-label":t,label:hn({label:t,errors:i?.errors}),valid:Boolean(!n),placeholder:"+7 (___) ___-__-__",...i}),vn(n)]}))),Ss=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(Cs,{label:"Телефон",...li(e(n),ti.phone,t?.required),disabled:t?.filledByEsia&&vi(e,n),...t})})),ks=d((({field:e,input:t})=>{const{data:n}=tl("POSITION");return o(gl,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),Is=d((({field:e})=>oi(e("acquiringType")?.value?.key)?o(rs,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),Ts=zt((({field:e,source:t})=>o(zn,{placeholder:"Выберите продукт",label:"Продукт",options:Bs(t?.productList),...ai(e("product"),ti.product)}))),Bs=e=>(e??[]).map((e=>({key:e,value:e}))),Ps=[];function Rs(e="/api/v1/regions"){const{data:t}=hi(e,Rt);return Array.isArray(t)?t:Ps}const Ds=d((({field:e,input:t,url:n})=>{const i=Rs(n);return o(zn,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...li(e("region"),ti.region,t?.required)})})),Ms=d((({field:e,input:t})=>{const n=xi(!0),i=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(zn,{label:"Регион",placeholder:"Выберите регион",options:i,...li(e("region"),ti.region,t?.required)})})),_s=d((({field:e,input:t})=>{const{data:n}=tl("REGION_RF"),i=n?.map((({key:e,value:t})=>({key:e,text:t})));return o(zn,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:i,...li(e("regionRetail"),ti.regionRetail,t?.required)})})),As=d((({field:e,input:t})=>{const n=e("wages")?.value,i=l((t=>{const i=Number(t)+Number(n||0);e("retirementIncome")?.onChange?.(t),e("incomeAverage")?.onChange?.(String(i))}),[n]);return o(Tn,{label:"Пенсионные доходы",placeholder:"Введите значение",type:"number",...li(e("retirementIncome"),ti.retirementIncome,t?.required),...t,onChange:i})})),Es=d((({field:e})=>{const t=e("secondaryPhone");return o(Cs,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?ai(t,ti.secondaryPhone):t})})),zs=d((({field:e,input:t})=>o(zn,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Or,...li(e("serviceDirection"),ti.serviceDirection,t?.required)}))),Fs=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],Vs=d((({field:e,input:t})=>o(pr,{label:"Пол",orientation:"horizontal",items:Fs,...li(e("sex"),ti.sex,t?.required)}))),Os=d((({field:e,input:t})=>o(Ri,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...li(e("shareholderFlg"),ti.shareholderFlg,t?.required)}))),Ls=d((({children:e,onChange:t,...n})=>{const i=l((e=>t&&t(Pl(e,"___-___-___ __"))),[t]),a=l((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(xn,{...n,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>a(e?.target?.value||""),children:e})})),js=d((({className:e,label:t,value:n,error:i,onChange:a,onBlur:l,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Ls,{"aria-label":t,label:hn({label:t,errors:r?.errors}),valid:Boolean(!i),value:n,onChange:a,onBlur:l,placeholder:"___-___-___ __"}),vn(i)]}))),qs=d((({field:e,input:t})=>{const n=e("consentPfrFlg")?.value;return o(js,{label:"СНИЛС",...li(e("snils"),ti.snils,!!n&&t?.required),...t})})),$s=d((({field:e,input:t})=>o(Tn,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&vi(e,"surname"),...li(e("surname"),ti.surname,t?.required),...t}))),Us=["От 1 мес","До 15 лет"],Ws=d((({field:e})=>o(dl,{title:"Срок, месяцев",items:Us,min:1,max:180,...e("term")}))),Hs=d((({field:e,input:t})=>o(Tn,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",...li(e("totalIncome"),ti.totalIncome,t?.required),...t}))),Ys=d((({field:e,input:t})=>o(zn,{label:"Тип обслуживания",options:Vr,...li(e("serviceType"),ti.serviceType,t?.required)}))),Ks=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],Gs=d((({field:e})=>{const{value:t,onChange:n}=e("vedTypes");return a((()=>{"currencyControl"!==t&&(e?.("inn")?.onChange?.(""),e?.("region")?.onChange?.(""))}),[t]),o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(hr,{className:"whitespace-normal",orientation:"horizontal",items:Ks,value:t,onChange:e=>n&&n(e)})})})),Xs=d((({field:e,input:t})=>{const n=e("retirementIncome")?.value,i=l((t=>{const i=Number(t)+Number(n||0);e("wages")?.onChange?.(t),e("incomeAverage")?.onChange?.(String(i))}),[n]);return o(Tn,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",...li(e("wages"),ti.wages,t?.required),...t,onChange:i})}));const Js={$ref:"/wcms-resources/outservice-productlist.json"},Zs=(e,t,n=!1)=>(i,a)=>{const l="ULTRASERVICE"===t||"PREMIUMSERVICE"===t,r={surname:o($s,{field:e,input:i}),name:o(ls,{field:e,input:i}),middleName:o(as,{field:e,input:i}),phone:o(Ss,{field:e,input:i}),organizationPhone:o(Ss,{field:e,input:i}),email:o(Rr,{field:e,input:i}),fullName:o(qr,{field:e,input:i}),inn:o(Wr,{field:e,input:i}),legalForm:o(Xr,{field:e,input:i}),organizationName:o(cs,{field:e,input:i}),generalSeniority:o($r,{field:e,input:i}),lastJobExperience:o(Kr,{field:e,input:i}),experience5Years:o(Er,{field:e,input:i}),jobsNumber:o(Yr,{field:e,input:i}),beginDate:o(Hl,{field:e,input:i}),addressFact:o(bi,{field:e,input:i}),organizationAddress:o(Ni,{field:e,input:i}),comment:o(tr,{field:e,input:i}),addressBranch:o(yi,{field:e,input:i,isPremium:l}),sex:o(Vs,{field:e,input:i}),birthday:o(Kl,{field:e,input:i,isRetailForm:n}),birthPlace:o(Xl,{field:e,input:i}),desiredMeetingDate:o(br,{field:e,input:i}),product:o(Ts,{field:e,source:Js}),localities:o(Qr,{field:e,input:i}),isClient:o(Hr,{field:e}),partnerComments:o(hs,{field:e,input:i}),collectionCount:o(er,{field:e,input:i}),acquiringType:o(si,{field:e,input:i}),onlineCheckout:o(ss,{field:e}),posTerminal:o(Is,{field:e}),serviceType:o(Ys,{field:e,input:i}),term:o(Ws,{field:e}),amount:o(pl,{field:e}),annualRevenue:o(xl,{field:e,input:i}),vedTypes:o(Gs,{field:e}),feedbackMethod:o(jr,{field:e,input:i}),serviceDirection:o(zs,{field:e,input:i}),bankEmpolee:o(vl,{field:e}),secondaryPhone:o(Es,{field:e}),consentToReceiveMaterials:o(dr,{field:e,input:i}),processPersonalDataFlg:o(dr,{field:e,input:i}),consentProviderFlg:o(dr,{field:e,input:i}),consentOthersFlg:o(dr,{field:e,input:i}),consentInformFlg:o(dr,{field:e,input:i}),consentPfrFlg:o(dr,{field:e,input:i}),applicationDate:o(Tn,{label:"Дата и время обращения в Банк",...e("applicationDate")}),region:l?o(Ms,{field:e}):o(Ds,{field:e,input:i,url:cn(t)}),education:o(Pr,{field:e,input:i}),housing:o(Ur,{field:e,input:i}),employment:o(_r,{field:e,input:i}),organization:o(os,{field:e,input:i}),amountWorkers:o(fl,{field:e,input:i}),employerActivities:o(Dr,{field:e,input:i}),employerOrganization:o(Mr,{field:e,input:i}),positionOrganization:o(ks,{field:e,input:i}),familyStatus:o(Fr,{field:e,input:i}),children:o(Zl,{field:e,input:i}),familyMembers:o(zr,{field:e,input:i}),dependents:o(yr,{field:e,input:i}),totalIncome:o(Hs,{field:e,input:i}),expenses:o(Ar,{field:e,input:i}),snils:o(qs,{field:e,input:i}),conscription:o(ir,{field:e,input:i}),armyIdFlg:o(yl,{field:e,input:i}),dulSerie:o(Ir,{field:e,input:i}),dulNumber:o(kr,{field:e,input:i}),dulIssueDateField:o(wr,{field:e,input:i}),dulSubdivisionCode:o(Br,{field:e,input:i}),dulIssuedBy:o(Sr,{field:e,input:i}),addressRegistration:o(Ni,{field:e,input:i}),addressCourier:o(Ni,{field:e,input:i}),participantDateRegistration:o(ms,{field:e,input:i}),retirementIncome:o(As,{field:e,input:i}),otherIncome:o(ds,{field:e,input:i}),wages:o(Xs,{field:e,input:i}),mandatoryPayments:o(es,{field:e,input:i}),disablePeopleFlg:o(vr,{field:e,input:i}),bankruptcyFlg:o(Nl,{field:e,input:i}),shareholderFlg:o(Os,{field:e,input:i}),legalEntityName:o(Gr,{field:e,input:i}),creditInRshbCd:o(mr,{field:e,input:i}),bankEmployeeCode:o(bl,{field:e,input:i}),partInBusiness:o(us,{field:e,input:i}),regionRetail:o(_s,{field:e,input:i}),addressRetail:o(il,{field:e,input:i}),addressMatch:o(Di,{field:e,input:i}),paymentSystem:o(ps,{field:e,input:i}),currency:o(fr,{field:e,input:i}),cardCategory:o(Jl,{field:e,input:i}),codeWord:o(Ql,{field:e,input:i}),confirmationIncome:o(nr,{field:e,input:i}),methodObtain:o(ns,{field:e,input:i}),deliveryDate:o(xr,{field:e,input:i})};return function({input:e,field:t}){const{condition:n}=e,{value:i}=t(n?.name||"");return!n||n?.values?.find((e=>e===(i?.key??i)))}({input:i,field:e})?o("div",{children:r[i?.name||""]},String(a)):null},Qs=e=>2===e?"@xl:grid-cols-2":"",eo=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(_e,{size:"text-h6",children:e})}):null,to=d((function({responseType:e,typeForm:t}){const n="OK"===e,i=n?"ResponseOKIcon":"ResponseFailIcon",{close:a}=me(),r=l((()=>{a()}),[]),s="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(sr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto ",children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ne,{image:{icon:i,iconVersion:"normal"},width:"136",height:"136"}),o(k,{className:"w-full",title:n?"Ваша заявка отправлена":"Не удалось отправить заявку",description:n?s:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(Oa,{type:"button",onClick:r,children:"Хорошо"})]})})})),no=e=>{const{open:t,close:n}=me();return{open:(n,i={})=>t(o(to,{...e,...n}),i),close:n}},io=e=>t=>t&&Object.entries(e).flatMap((([e,n])=>n(t[e])))||[],ao=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:i,amount:a,term:l,annualRevenue:r,serviceType:s,vedTypes:o,region:c,...d}=e,m=t||r?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:i=!1,term:a,amount:l,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${oi(t?.key)?`/Онлайн касса=${n}/POS-терминал=${i}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${l}/Срок=${a}/Выручка=${r}`})(e):null,u={...d,...ro(o),...lo(c),...m?{partnerComments:m}:{},...s?{typeForm:s}:{}};return Object.fromEntries(Object.entries(u)?.map((([e,t])=>[e,t?.key||t])))},lo=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},ro=e=>e?{vedTypes:Object.fromEntries(Ks.map((({id:t})=>[t,t===e])))}:{},so={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:ri[0],serviceType:Vr[0],feedbackMethod:Lr[0],serviceDirection:Or[0],vedTypes:Ks[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},oo=d((({text:e,link:t})=>c(C,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(_e,{children:e}):null,t?o(ve,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"!text-left text-primary-main",children:o(_e,{children:t.text})}):null]}))),co=(e,t)=>o(Oa,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),mo=(e,t,n)=>c("div",{className:"flex col-span-2 gap-xs flex-col w-full items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3 items-center",children:[o(ki,{...e}),o(oo,{link:t})]}),vn(ai(e,Gn).error)]}):o(oo,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),co(n)]}),uo={send:async function(e,t=!1){const{typeForm:n,region:i,phone:a="",email:l,birthday:r,desiredMeetingDate:s,inn:o,addressBranch:c,secondaryPhone:d="",bankEmpolee:m,applicationDate:u,serviceDirection:h,...p}=e,g=t&&"Юридическое лицо / ИП"!==h,f="/api/v1"+(g?"/lead":"/sendcorporatelead"),x={typeForm:n,...Ut(i,g),...Wt(l,g),...qt(a),...$t(s,"desiredMeetingDate"),...g?$t(r):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...Ht(d)},...p};try{const e=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(x)});return e?.ok?await e.json():null}catch(e){return null}}},ho=d((({className:e,title:t,typeForm:n="",sections:r=[],button:s,link:d,endpoint:m,additionalParams:h,isContacts:p,data:g,...f})=>{const x=r?.flatMap((e=>e?.inputs))||[],y=((e,t="")=>{const n=Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||so[e.name||""]])));return n?.serviceType&&"PREMIUMSERVICE"===t&&(n.serviceType=Vr[1]),{...n,typeForm:{key:t,text:""}}})(x,n),[b,v]=i(""),N=no({typeForm:n}),C=l((async(e,t)=>{const n=po(x,e),i=io(ii(n));if(!Fn(i(e)))return console.warn("validation fail");const a=ao({...e,...h}),l=await uo.send(a,"lead"===m)?"OK":"Fail";if(v(l),l&&N.open({responseType:l}),"OK"===l&&g){const e=an();Yt({aspectsAttributes:g,aspects:e,ev:t})}return l}),[]),[,{field:S,onSubmit:k,reset:I}]=rn(y,{onSubmit:C}),T=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(x)?.name;return a((()=>{"OK"===b&&(v(""),I())}),[b]),c(on,{className:u("container space-y-m",e),title:t,...f,children:[c("form",{onSubmit:k,children:[r.map(((e,t)=>c("div",{className:u(Qs(e.columns),"grid gap-x-m"),children:[eo(e.title),(e?.inputs||[])?.map(Zs(S,n))]},`section-${t}`))),mo(T?S("consentDataProcessing"):void 0,d,s)]}),p?c("div",{className:"space-y-m",children:[o(w,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex sm:justify-center gap-xl",children:[c("a",{className:"flex gap-s items-center text-primary-text no-underline",href:"tel:8 (800) 200-78-70","aria-label":"телефон 8 (800) 200-78-70",children:[o(ne,{image:{icon:"PhoneIcon"},width:"24",height:"24"}),o("span",{children:"8 (800) 200-78-70"})]}),c("a",{className:"flex gap-s items-center text-primary-text no-underline","aria-label":"почта ved@rshb.ru",href:"mailto:ved@rshb.ru",children:[o(ne,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),po=(e,t)=>e.filter((e=>"secondaryPhone"===e?.name?Boolean(t.secondaryPhone):e)).filter((e=>!e?.condition||e?.condition.values.find((n=>{const i=t?.[e?.condition?.name??""];return n===(i?.key??i)}))));function go(e){const[t,n]=i(JSON.parse(globalThis.localStorage?.getItem(e)||"null"));return[t,l((t=>{globalThis.localStorage?.setItem(e,JSON.stringify(t)),n(t)}),[e,globalThis.localStorage])]}const fo=d((({inputs:e=[],typeForm:t="",field:n,key:i})=>{const a=e.every((e=>Boolean(n(e.name).value))),l=r((()=>e?.filter((e=>e.required))?.some((e=>Boolean(ai(n(e?.name),ti[e?.name]).error)))),[e]);return o("div",{className:"w-fit",children:o(ea,{isFoldButtonOnTop:!0,unfoldedByDefault:!0,renderFoldableSection:({isUnfolded:i})=>o(ta,{isUnfolded:i,className:"flex flex-col pl-2xl",children:e.map(Zs(n,t))}),renderFoldButton:xo(c("div",{children:[o(ki,{value:a,onChange:t=>{for(const i of e){const e=n(i.name);e?.onChange&&e.onChange(t)}},text:"Согласие на все документы"},i),vn(l?"Отметьте все обязательные соглашения":"")]}))})})})),xo=e=>t=>c("div",{className:"flex items-start",children:[e,o("button",{onClick:t.onToggle,className:"px-m py-2xs",type:"button",children:o(W,{className:"text-primary-text",name:t.isUnfolded?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})})]}),yo=({field:e,typeForm:t="",inputs:n,isRetailForm:i=!1})=>{const{consentInputs:a,restInputs:l}=bo(n||[]);return a.length>2?c("div",{children:[l.map(Zs(e,t,i)),o(fo,{inputs:a,field:e})]}):(n||[])?.map(Zs(e,t,i))},bo=e=>({consentInputs:e?.filter((e=>Object.keys(ar).includes(e.name||"")))||[],restInputs:e?.filter((e=>!Object.keys(ar).includes(e.name||"")))||[]}),vo={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",organizationPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:ri[0],serviceType:Vr[0],feedbackMethod:Lr[0],serviceDirection:Or[0],vedTypes:Ks[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,addressRegistration:"",participantDateRegistration:void 0,currency:"",paymentSystem:"",cardCategory:{key:"",text:""},codeWord:"",addressRetail:{key:"",text:""}},No=(e,t,n="")=>{if(t){const e={...t};return e.birthday=new Date(e?.birthday||0),e}return{...Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||vo[e.name||""]]))),typeForm:{key:n,text:""}}},wo=(e,t)=>o(Oa,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Co=e=>Xi("/user-data/updateUserProfile","PUT",e),So=e=>Xi("/user-data/updateUserTask","PUT",e),ko=(e,t)=>Boolean(e)&&"string"!=typeof e&&Boolean(e?.errorMessage.startsWith(`Too many request for phoneNumber [${t}]`)),Io={width:"103",height:"21"},To={"bg-white":"color",transparent:"white"},Bo={"bg-white":"text-primary-main",transparent:"text-white"},Po=(e,t,n)=>o(ne,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:To[e]},className:Bo[e],width:n?.width,height:n?.height}),Ro={"bg-white":"text-primary-text",transparent:"text-white"},Do=d((({className:e,href:t="/",logo:n,children:i,targetBlank:a,bgColor:l="bg-white",showTitle:r=!0,data:s})=>c("a",{className:u("inline-flex items-center font-sans no-underline",e),href:n?.href??t,target:a?"_blank":"_self","aria-label":n?.title??"Россельхозбанк",...ge(s),children:[Po(l,n?.image,Io),r?i??o("div",{className:"ml-s",children:o(_e,{font:"font-medium",color:Ro[l],size:"text-s",children:n?.title??"Россельхозбанк"})}):null]}))),Mo=d((({phoneNumber:e,close:t,sendCode:n,onClose:r})=>{const[s,d]=i(""),[m,u]=i(""),[h,p]=i(!1),g=l((async()=>{const e=await(i={captchaText:m},Ji("/sms/checkCaptcha","POST",i).then((e=>e.text())).then((e=>"ERROR"!==e)));var i;e?(n?.(),t?.()):p(e)}),[]),f=l((()=>{(async()=>{d(URL.createObjectURL(await(e=>Ji(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?await e.blob():new Blob)))(e)))})()}),[]);return a(f,[]),o(sr,{head:o(Do,{}),onClose:r,className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex h-36 w-72",children:[o("img",{className:"grow",src:s}),o("div",{onClick:f,className:"flex w-8 items-center justify-center cursor-pointer",children:o(W,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(xn,{className:"w-[300px]",onChange:u,value:m,placeholder:"Введите код с картинки"}),h?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-[310px] justify-between",children:[o(Oa,{onClick:t,version:"secondary",children:"Вернуться"}),o(Oa,{type:"submit",disabled:!m,onClick:g,version:"secondary",children:"Отправить"})]})]})})})),_o=d((({time:e,setTime:t,className:n})=>(a((()=>{const n=setInterval((()=>{t(e-1)}),1e3);return 0===e&&clearInterval(n),()=>{clearInterval(n)}}),[e]),o("span",{className:n,children:Ao(e)})))),Ao=e=>`${`${Math.floor(e/60)}`.padStart(2,"0")}:${(""+e%60).padStart(2,"0")}`,Eo=d((({values:e,setValues:t,hasError:n,errorText:r})=>{const[d,m]=i(0),u=s([]);a((()=>{u.current?.[d]?.focus()}),[d]);const h=l((n=>i=>{const{value:a}=i.currentTarget,l=a.slice(0,1);t(e.map(((e,t)=>t===n?l:e))),m(n+1)}),[e]),p=l((n=>i=>{const{key:a}=i;if("Backspace"===a&&!e[n]){const i=n>0?n-1:e.length-1,a=e.map(((e,t)=>t===i?"":e));t(a),m(i)}}),[e]),g=l((n=>{n.preventDefault();const i=n.clipboardData.getData("text"),a=e.map(((e,t)=>t<i.length?i[t]:e));t(a),m(a.length-1)}),[e]);return c("div",{className:"flex flex-col gap-2 text-center",children:[o("div",{children:e.map(((t,i)=>o("input",{type:"number",maxLength:1,value:t,onChange:h(i),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[i]=e},onFocus:e=>e.target.select(),onKeyDown:p(i),className:zo(i,e,n)},i)))}),n?o("div",{className:"text-error",children:r}):null]})})),zo=(e,t,n=!1)=>{const i=!t[e];return`w-20 h-24 text-5xl text-center p-lg m-2 border ${n&&i?"border-error":"border-gray"} rounded-md caret-transparent outline-none`},Fo=d((({isDisabled:e,onClick:t,text:n})=>o(Oa,{type:"button",onClick:t,disabled:e,children:o(_e,{font:"font-normal",children:n})}))),Vo=e=>{e&&(globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token))},Oo=({close:e,values:t})=>{const[n,s]=i(!1),[o,c]=i(""),[d,m]=i(!1),[u,h]=i(0),[p,g]=i(!1),[f,x]=i(0),y=l((()=>{s(!1),c("")}),[]),b=r((()=>0===u&&p),[u,p]),v=r((()=>f>2||!t.every(Boolean)||b),[t]),N=l((async()=>{try{g(!1),h(0),x(f+1),m(!0),await(async e=>Xi("/sms/checkCode","POST",e).then(Vo))({smsText:t.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),y(),e&&e(t.join(""))}catch{m(!1),c(f>1?"Исчерпан лимит ввода смс-кода":"Неверный код"),s(!0)}}),[t,f]);return a((()=>{b?(s(!0),c("Код просрочен")):s(!1)}),[b]),{handleSubmit:N,hasError:n,errorText:o,isLoading:d,timeNextReq:u,isSubmitButtonDisabled:v,setTimeNextReq:h,setIsTimerStarted:g,setAttemps:x}},Lo=d((({close:e=pn,onClose:t=pn,title:n,description:r,__html:s,code:d=!0,codeLength:m=4,textButton:u="",phoneNumber:h="+79999999999"})=>{const[p,g]=i(Array(m).fill("")),{handleSubmit:f,hasError:x,errorText:y,isLoading:b,timeNextReq:v,isSubmitButtonDisabled:N,setTimeNextReq:w,setIsTimerStarted:C,setAttemps:S}=Oo({values:p,close:e}),I=l((async()=>{var e;await(e={phoneNumber:h,smsCodesSetName:{key:"AUTHENTICATION"}},Xi("/sms/sendCode","POST",e).then((t=>!ko(t,e.phoneNumber))))?(S(0),w(180),C(!0)):T.open()}),[]),T=((e,t)=>{const{open:n,close:i,closeAll:a}=me();return{open:()=>n(o(Mo,{close:i,onClose:t,...e})),close:i,closeAll:a}})({phoneNumber:h,sendCode:I},t);return a((()=>{I()}),[]),o(sr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl px-5xl py-0",children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[o(k,{className:"w-full",title:n,description:r,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),d?o(Eo,{values:p,setValues:g,errorText:y,hasError:x}):null,qo(v,w,I),o(De,{itemSize:"list-s",__html:s}),jo(u,N,f),b?o(Mi,{blur:!1}):null]})})})),jo=(e,t,n)=>e?o(Fo,{isDisabled:t,onClick:n,text:e}):null,qo=(e,t,n)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(_o,{className:"text-base ml-1",time:e,setTime:t})]}):o(ve,{onClick:n,className:"text-primary-main",children:"Получить новый код"}),$o=()=>{const{open:e,close:t}=me();return{open:(n,i)=>e(o(Lo,{onClose:t,close:n,...i})),close:t}},Uo={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},Wo={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},Ho=d((function({handleSubmit:e=pn,onClose:t=pn}){const[n,a]=i(""),[r,s]=i(!1),{open:d,close:m}=me(),u=Se(),h=l((()=>{m(),e(n)}),[n]),p=l((e=>{a(e),"REFUSE"===e&&s(!0)}),[]),g=r?Wo:Uo;return o(sr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:t,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o("div",{role:"button",onClick:()=>or(d,Ko,u),children:o(w,{className:"text-center text-balance",headingType:"h2",title:g.title})}),o(C,{align:"text-center",children:g.description}),o(hr,{className:"whitespace-normal",orientation:"horizontal",items:Yo,value:n,onChange:p}),o(Oa,{disabled:!n,type:"button",onClick:h,children:"Продолжить"})]})})})),Yo=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],Ko=2,Go=e=>{const{open:t,close:n}=me(),i=$o(),a=(t,a)=>async l=>{n(),"SIGNED"===l&&t?i.open((t=>async n=>{t&&await Co({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()})(a),Xo(t)):e()};return{open:(n,i)=>t(o(Ho,{handleSubmit:a(n,i),onClose:e}))}},Xo=e=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:jt(e),textButton:"Отправить",__html:"<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>\n <ul><li>согласие на запрос информации в БКИ</li></ul>"}),Jo=d((function({handleClose:e}){const t=l((async()=>{const e=await(t={redirectUri:globalThis.location.href},Xi("/esia/getLink","POST",t));var t;e&&(globalThis.location.href=e.link)}),[]);return o(sr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",onClose:e,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex items-center justify-around w-full",children:[c("ul",{className:"list-disc",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ne,{image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"70"})]}),c("div",{className:"flex items-center justify-between w-full m-0",children:[o(Oa,{type:"button",onClick:t,children:"Заполнить через Госуслуги"}),o(Oa,{type:"button",version:"secondary",onClick:e,children:"Пропустить"})]})]})})})),Zo={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},Qo={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK"},ec={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},tc=e=>Object.entries(e).reduce(((e,[t,n])=>t in Zo?[...e,{contactTypeCd:{key:Zo[t]},value:n}]:e),[]),nc=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in Qo){const i=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:Qo[t]},...i}]}return e}),[]),ic=e=>Object.entries(e).reduce(((e,[t,n])=>t in ec?[...e,{incomeTypeCd:{key:ec[t]},value:Number(n||0)}]:e),[]),ac=({inputs:e,programId:t,nextStepLink:n,saveForm:a})=>{const[r,s]=i(""),[,c]=go("taskId"),[,d]=go("profileId"),[,m]=go("participantId"),u=(e=>{const{open:t,close:n}=me(),i=l((()=>{n(),globalThis.location.href=e}),[]);return{open:(e={})=>t(o(Jo,{handleClose:i}),e),close:n}})(n),h=Go(u.open),p=$o(),g=l(((e,t,n)=>{m(e),c(t),d(n)}),[]);return{handleSubmit:l((async n=>{const i=io(ii(e));if(!Fn(i(n)))return console.warn("validation fail");try{const e=await(l={profile:{phone:jt(n.phone)}},Xi("/public-data/createUserProfile","POST",l).then((e=>e?.profile?.id||null)));if(e&&n?.phone){const i=async()=>{try{await lc({programId:t,profileId:e,formData:n,saveUserData:g,saveForm:a}),p.close(),h.open(n.phone,e)}catch{s("Fail")}},l=Object.keys(ar).filter((e=>n[e])).map((e=>ar[e]?.text));p.open(i,rc(n?.phone,l))}}catch{s("Fail")}var l}),[]),responseStatus:r}},lc=async({programId:e,profileId:t,formData:n,saveUserData:i,saveForm:a})=>{const l=oc(n);await Co(((e,t)=>{const{name:n="",surname:i="",middleName:a="",birthday:l="",phone:r="",email:s="",processPersonalDataFlg:o,consentProviderFlg:c,consentPfrFlg:d,consentPhotoFlg:m,consentAssignmentClaimsFlg:u,consentCollectionFlg:h,consentInformFlg:p}=t;return{profile:{id:e,name:n,surname:i,midname:a,birthDate:l&&Lt(l,!0),email:s,phone:jt(r),processPersonalDataFlg:Boolean(o),consentProviderFlg:Boolean(c),consentPfrFlg:Boolean(d),consentPhotoFlg:Boolean(m),consentAssignmentClaimsFlg:Boolean(u),consentCollectionFlg:Boolean(h),consentInformFlg:Boolean(p)}}})(t,l));const{taskId:r,participantId:s}=await(async e=>await Xi("/user-data/createDraftTask","POST",e)||{})({profileId:t,programId:e});await So((({participantId:e,taskId:t,profileId:n,formData:i})=>{const{name:a,surname:l,middleName:r,birthday:s,phone:o,email:c}=i;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:globalThis.location.origin,id:t,participants:[{birthDate:s&&Lt(s,!0),id:e,midname:r,name:a,surname:l,profile:{id:n},participantContacts:tc({phone:o&&jt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}]}}})({participantId:s,taskId:r,profileId:t,formData:l})),i(s,r,t),a(n)},rc=(e,t)=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:jt(e),textButton:"Оформить",__html:`<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>${sc(t)}`}),sc=e=>`<ul>${e?.map((e=>"<li>"+e+"</li>")).join("")}</ul>`,oc=e=>{const{consentOthersFlg:t,...n}=e;return{...n,consentCollectionFlg:t,consentAssignmentClaimsFlg:t,consentPhotoFlg:t}},cc=e=>{const{profile:t,addInfo:n,document:i,addressRegistration:a,addressFact:l}=e;return{name:t?.name,surname:t?.surname,middleName:t?.midname,birthday:t?.birthDate,phone:Ns(t?.phone),email:t?.email,dulIssueDateField:i?.dulIssueDate,dulIssuedBy:i?.dulIssuedBy,dulNumber:i?.dulNumber,dulSerie:i?.dulSerie,dulSubdivisionCode:i?.dulSubdivisionCode,snils:n?.snils,birthPlace:n?.birthPlace,addressRegistration:dc(a),addressFact:dc(l),esiaAccountTypeCd:t?.esiaAccountType}},dc=e=>{const{postcode:t,region:n,regionCode:i,locality:a,city:l,street:r,house:s,building:o,block:c,apartment:d}=e,m=[t,n,a||l,r?`ул ${r}`:void 0,s?`д ${s}`:void 0,c?`к ${c}`:void 0,o?`стр ${o}`:void 0,d?`кв ${d}`:void 0].reduce(((e,t)=>t?e?`${e}, ${t}`:t:e),"");return{...e,regionCode:i?.key,fullAddress:m}},mc=e=>{const[t,n]=i(!1),[r]=go("profileId"),[s,o]=go("leadForm"),c=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),d=c.get("code"),m=c.get("state"),u=l((async()=>{if(r&&d&&m){const n=await(t={profileId:r,code:d,state:m,redirectUri:globalThis.location?.href},Xi("/esia/updateProfileEsia","POST",t));n&&o({...s,...cc(n)}),globalThis.location.href=e}var t}),[]);return a((()=>{d?(n(!0),u()):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),{isLoading:t}},uc=d((({className:e,title:t,programId:n="",nextStepLink:l="/credit-lead",sections:r=[],button:s,...d})=>{const m=r?.flatMap((e=>e?.inputs))||[],[h,p]=i(""),{isLoading:g}=mc(l),[f,x]=go("leadForm"),y=No(m,f),{handleSubmit:b,responseStatus:v}=ac({inputs:m,programId:n,nextStepLink:l,saveForm:x});if(v){no({responseType:v}).open()}const[,{field:N,onSubmit:w,reset:C}]=rn(y,{onSubmit:b});return a((()=>{"OK"===h&&(p(""),C())}),[h]),o(on,{className:u("container space-y-m",e),title:t,...d,children:c("form",{onSubmit:w,className:"space-y-m relative",children:[g?o(Mi,{blur:!1}):null,r.map(((e,t)=>c("div",{className:u(Qs(e.columns),"grid gap-x-m"),children:[eo(e.title),yo({field:N,inputs:e?.inputs,isRetailForm:!0})]},`section-${t}`))),wo(s)]})})})),hc=d((({title:e,description:t})=>{const n=Se();return c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ne,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),o(k,{title:e,description:t,headlineVersion:n?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),pc=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",gc=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function fc(e=0){const t=Math.round(10*e);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const xc=d((({className:e,style:t,idx:n,activeIndex:i,observerOptions:c,children:d,onIntersection:m})=>{const h=function(e,{sensitivity:t,rootRef:n}={}){const i=s(null),l=r((()=>({threshold:fc(t),root:n?.current})),[t,n?.current]);return a((()=>{if(!i.current)return;const t=new IntersectionObserver(e,l);return t.observe(i.current),()=>{t.disconnect()}}),[e,l]),i}(l((e=>{e.length&&m&&m(n||0,e[e.length-1])}),[m,n]),c);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===i),ref:h,role:"listitem",children:d})})),yc=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],bc=d((({className:e,itemClassName:t,containerRef:n,activeIndex:i,visibleItemCount:a=0,gap:r=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:p,onVisibleItemsChange:g,onVisibleIndicesChange:f})=>{const x={sensitivity:1,rootRef:n},y=s([]),b=l(((e,t)=>{const n=[...y.current||[]];n[e]=t,y.current=n,g&&g(n),f&&f(Nc(n))}),[g,f]),v=a>0?r*Number(a)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?vc(c,v):{},...N?gc(h):{},gap:`${r}px`};return o("div",{className:u("box-border overflow-auto no-scrollbar",d,e),style:C,ref:n,role:"list",children:(S=(e,n)=>o(xc,{className:u(m,a?yc[a-1]:"",{"h-full":N},t),style:w?vc(c/4):{},activeIndex:i,idx:n,observerOptions:x,onIntersection:b,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(S):S(e,0))(p)});var S})),vc=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Nc=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),wc={"horizontal-list":"w-6","vertical-list":"h-6"},Cc=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(i,a)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",a===e?wc[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(a)},String(a)),Sc=({activeIndex:e,onClick:t})=>(n,i)=>{const a=i===e,l=a?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=a?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=a?"text-l":"text-m group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(i),"aria-label":n?.title,className:u("max-h-28 mt-xs ml-xs relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50 whitespace-nowrap",l),children:[o("div",{className:r,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(i))},kc=e=>e,Ic=(e=kc)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),Tc=Ic(),Bc=(e=kc)=>Ic((t=>-e(t))),Pc=Bc(),Rc=e=>t=>e.scrollWidth/t,Dc=e=>(t,n)=>{e.scrollBy({left:n*Rc(e)(t),behavior:"smooth"})},Mc=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[a,r]=i([]),o=l((e=>{r((t=>{return(n=t)===(i=e)||Boolean(n&&i&&n?.length===i?.length&&n.every(((e,t)=>e===i[t])))?t:e;var n,i})),t&&t(e)}),[t]),[c,d]=a.length?[Bc()(a),Ic()(a)]:[-1,-1],m=c>0,u=d<e-1,h=l((()=>{var t;n.current&&(m?Dc(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=l((()=>{n.current&&(u?Dc(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=l(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{n?.current&&n.current.children[e]?.scrollIntoView(t)}),[n]);return[n,{scrollLeft:h,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:u,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},_c={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},Ac=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:i="horizontal-list",version:r,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=Se(),[h,p]=Mc({itemCount:s.length}),g=Ec(Boolean(s?.length));a((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=l((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(bc,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(Sc({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",_c[i],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(Cc({activeIndex:t,onClick:f,listType:i}))}):null})),Ec=(e=!1)=>({behavior:e?"auto":"smooth"}),zc=d((({className:e,disabled:t,...n})=>o(ve,{rounded:!0,className:u("group/btn w-12 h-12 min-h-12 max-h-12 flex items-center justify-center shadow-main-black",t?"bg-secondary-light text-secondary-text":"bg-white text-primary-text hover:text-primary-main",e),disabled:t,...n,children:o(ne,{className:"w-4 h-4 min-w-4 min-h-4 rounded-full box-border",image:{icon:"ArrowLeftIcon",iconVersion:"black"},imageClassName:"group-hover/btn:text-primary-main",width:"16",height:"16"})}))),Fc=d((e=>o(zc,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),Vc=d((e=>o(zc,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),Oc="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",Lc=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:i,isBottom:a})=>{const{canScrollLeft:l,canScrollRight:r,scrollLeft:s,scrollRight:d}=t,m=i&&!a;return c("div",{className:e,children:[n?jc(t):null,l?o(Fc,{className:u(qc(a),m?"left-1":"left-0"),onClick:s}):null,r?o(Vc,{className:u(qc(a),m?"right-1":"right-0"),onClick:d}):null]})})),jc=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(Oc,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(Oc,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),qc=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),$c=d((({className:e,version:t,gap:n=14,padding:i=16,visibleItemCount:a=1,listType:l="horizontal-list",snapAlign:r,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:x})=>{const y=Array.isArray(g)?g.length:0,[b,v]=Mc({itemCount:y,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===l?"relative h-full":""),children:[o(bc,{containerRef:b,activeIndex:N,visibleItemCount:a,gap:n,padding:i,listType:l,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(Lc,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(Ac,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:y,listType:l,version:t,navButtons:x,containerRef:b,containerScroll:v})]})})),Uc=({blocksToRender:e,...t})=>o($c,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:R(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",pc(!0)),children:B(e,t)},String(n))})}),Wc=e=>e%2!=0,Hc=d((({textNode:e,iconNode:t,tag:n,onClick:i,justifyContent:a="between",className:l,role:r,...s})=>c(n,{tag:n,className:u("flex items-center w-full gap-1","between"===a?"justify-between":"justify-center",l),onClick:i,role:r,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),Yc=d((({className:e="",label:t,icon:n,dataTheme:i="pc",disabled:a=!1,onClick:l})=>o(Hc,{tag:"button",onClick:l,disabled:a,"data-theme":i,justifyContent:"center",role:"button",className:u("py-4 border border-transparent outline-none focus:border-primary-text space-x-s",a?"bg-main-divider text-main-disabled hover:bg-main-divider":"bg-primary-main text-white hover:bg-primary-hove",e),textNode:o(_e,{size:"text-h4",children:t}),iconNode:n?o(ne,{image:{icon:n,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),Kc=({isUnfolded:e,onToggle:t})=>o(Yc,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Gc=["ArrowDownIcon","ArrowUpIcon"],Xc="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",Jc=({topItemsCount:e=0,label:t="",block:n,blocksToRender:i=[],...a})=>{const[l,r]=e>0?[i.slice(0,e),i.slice(e)]:[i,[]];return c("div",{className:u("space-y-2xs",{hidden:!i.length}),children:[c("div",{className:u(Xc),children:[R(l,{...a.options,parent:n}),Wc(l.length)?o(Vt,{className:"col-span-6",...a}):null]}),o(ea,{renderFoldableSection:({isUnfolded:e})=>c(ta,{className:u(Xc),isUnfolded:e,children:[R(r,{...a.options,parent:n}),Wc(r.length)?o(Vt,{className:"col-span-6",...a}):null]}),renderFoldButton:({isUnfolded:n,onToggle:i})=>o(Yc,{className:u({hidden:e<1}),disabled:!r?.length,label:t,icon:Gc[Number(n)],dataTheme:a.options?.page?.colorPalette,onClick:i})})]})},Zc=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...i})=>{switch(e?.view){case"grid":return c("div",{children:[Qc(n,t),Jc({...e,...i,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[Qc(n,t),Uc({...i,blocksToRender:t})]});default:return null}})),Qc=(e,t)=>e&&!t.length?o(hc,{...e}):null,ed=e=>t=>t.reduce(((t,n,i)=>t.length?t.concat({...e,key:`sep-${i}`},n):[n]),[]),td=d((({value:e,onChange:t,items:n=[],multiple:i})=>n.map((n=>o(rs,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const a=e?.includes(n);t(i?a?(e||[]).filter((e=>e!==n)):[...e||[],n]:a?[]:[n])})(n.value),type:i?"checkbox":"radio"},n.value))))),nd=d((({children:e,filtrationSchema:t,resetButton:n,field:i,reset:a})=>c("form",{className:"flex flex-col @4xl:flex-row justify-between bg-white p-4xl gap-s @4xl:gap-0",children:[c("div",{className:"flex flex-col @4xl:flex-row gap-xl",children:[e,ed(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(id(i)).filter(Boolean))]}),n?o("div",{children:o(Oa,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:a,children:n?.text})}):null]}))),id=e=>([t,n])=>{const i=n?.type;return"array"===i?ad(t,e)(n):null},ad=(e,t)=>n=>{const i=n?.items?.enum?.map(((e,t)=>({value:e,title:n?.items?.enumNames?.[t]||""})))||[];return c("div",{className:"flex-1",children:[n?.title?o("div",{className:"mb-m",children:o(_e,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(td,{items:i,multiple:!n?.single,...t(e)})]},e)};function ld(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const rd=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,sd=(e,t)=>Object.entries(e).map((([n,i])=>"number"==typeof i?Array.isArray(t[n])?((e,t)=>n=>rd(t[e])||rd(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>rd(t[e])||rd(n[e])||od(t[e])<=od(n[e]))(n,e):"object"==typeof i&&"min"in i&&"max"in i?((e,t)=>n=>rd(t[e])||rd(n[e])||od(t[e]?.min)>=od(n[e]?.min)&&od(t[e]?.min)<=od(n[e]?.max))(n,e):Array.isArray(i)?((e,t)=>n=>rd(t[e])||rd(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>rd(t[e])||rd(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),od=e=>Number(e||0),cd=(e,{block:t,page:n,normalize:i=ln})=>{const a=t?.blocks||[],[l,{field:s,reset:o,update:c}]=rn(e),d=r((()=>ld(a,a.map((e=>At(e.content,n?.fallback))))),[a,n?.fallback]),m=l===e?a:((e,t)=>(n=ln)=>e?.filter((([,e])=>sd(t,n(e)||{}))).map((([e])=>e)))(d,l)(i);return[l,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},dd={},md={},ud=zt((({className:e,filtrationSchema:t=dd,consumerField:n={},resetButton:i,...a})=>{const[,{blocksToRender:l},{field:r,reset:s}]=cd(md,{block:a.block,page:a.options?.page}),d=o(Mn,{className:"w-64",label:n?.title,options:hd(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>hd(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...a,children:[o(nd,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(Oa,{type:"reset",className:"mt-lg w-64",onClick:s,version:i?.version,children:i?.text})})]})}),o(Zc,{blocksToRender:l,...a})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),hd=e=>ld(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),pd=(e=!1)=>e?"text-left":"text-center",gd={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},fd=d((({className:e,defaultIconSize:t=44,iconBgVersion:n="primary",size:i,icon:a,...l})=>{const r=String(i?.width||t);return a?o("div",{style:{width:`${r}px`,height:`${r}px`},className:u("rounded-icon object-fit flex justify-center items-center",gd[n],e),children:o(W,{...l,width:"54%",height:"54%",name:a})}):null})),xd=d((({className:e="",title:t,benefitList:n,...i})=>{const a=Se();return c(g,{className:e,defaultPadding:"p-6xl",...i,children:[t?o(w,{headingType:"h3",as:"h2",className:pd(a),title:t}):null,n?.length?o("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:n.map(yd)}):null]})})),yd=({label:e,description:t,__html:n,icon:i,isDotted:a=!1,iconBgVersion:l},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[i?.icon?o(fd,{className:"shrink-0",iconBgVersion:l,...i}):null,i?.src?o(ne,{className:"shrink-0",image:i}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(w,{headingType:"h6",children:e}),o(_e,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(De,{__html:n,isDotted:a,itemSize:"list-s"}):null]}):null]},String(r)),bd=(e,t,n)=>{return o($c,{children:e.map((i=n,({icon:e,title:t,description:n},a)=>c("div",{className:u("flex flex-col gap-1","justify-between p-m h-full border border-gray",{"justify-center":!n&&!t}),children:[t?o(_e,{size:"text-h6",font:"font-normal",align:i,children:t}):null,e?o(ne,{image:e,height:"180",className:"w-auto mx-auto"}):null,n?o(_e,{size:"text-h6",font:"font-normal",align:i,children:n}):null]},String(a))))});var i},vd=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:i="4",subtitle:a,title:l,...r})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...r,children:[o(k,{defaultPadding:"",title:l,description:a,headlineVersion:"M"}),e?.length?bd(e,0,t):null]}))),Nd={start:"justify-start",center:"justify-center",end:"justify-end"},wd=d((({buttons:e,className:t="",align:n,...i})=>{const a=n&&u("flex",Nd[n]);return o(g,{className:u("!bg-transparent",a,t),defaultPadding:"p-0",...i,children:je(e)})})),Cd=d((({className:e,title:t,children:n,...i})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...i,children:[t?o(w,{className:"text-center",title:t}):null,n]}))),Sd="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",kd="flex flex-col lg:max-w-80 lg:w-1/2 gap-2xl",Id="flex flex-col gap-y-xl min-w-52",Td=d((({value:e,fractionDigits:t,fixed:n,prefix:i,postfix:a})=>o(_e,{size:"text-h3",children:"number"==typeof e?[i,We(t,{fixed:n})(e),a].filter(Boolean).join(" "):e}))),Bd=d((({className:e,title:t,value:n,color:i="text-secondary-text",...a})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(_e,{size:"text-l",font:"font-light",color:i,children:t}):null,n?o(Td,{value:n,...a}):o(_e,{size:"text-h3",children:"-"})]}))),Pd=(e,t)=>e?o(C,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,Rd=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:i=2,depositeName:a,isShowDepositeName:l,color:r="text-secondary-text"})=>c("div",{children:[o(_e,{size:"text-l",font:"font-light",color:r,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children:We(i,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),a&&l?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:a}):null]})]}))),Dd=d((({title:e="Ставка"})=>c("div",{className:"space-y-s min-w-96",children:[o(_e,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(W,{className:"w-10 h-auto lg:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Процентная ставка не найдена, выберите другие параметры"})})]}))),Md=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:i=2,color:a="text-secondary-text",children:l,...r})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(Rd,{title:e,rate:t,unit:n,fractionDigits:i,color:a,...r})}),o(Bd,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:i,fixed:!0,color:a,...r}),l]}):o(Dd,{title:e,...r}),_d=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...i})=>o(dl,{items:e?[`От ${We(1)(i.min||0)} ${n}`,`До ${We(1)(i.max||0)} ${n}`]:[],step:t,...i}),Ad={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Ed={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},zd=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:i}=e,[a,l]=((e,t,n)=>{const{maxBonus:i=5e3,prefMonthsNum:a=Ad.prefMonthsNum,prefTravelBonusRate:l=Ad.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(l*t)+Math.round(r*n),i);return[c,c*a+Math.min(Math.round(s*t)+Math.round(o*n),i)*(12-a)]})(t||Ed,n,i);return{...t,...e,monthBonus:a,yearBonus:l}},Fd=zt((({className:e="",title:t,calcSource:n,buttons:i,footnote:a,...l})=>{const[r,{field:s}]=rn({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=zd(r,n);return o(Cd,{className:e,title:t,...l,children:c("section",{className:u(Sd,e),children:[c("div",{className:kd,children:[_d({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),_d({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?Md({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:Id,children:[f>=0?o(Bd,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,je(i,{isVertical:!0}),Pd(a)]})]})})})),Vd=Math.round(29.5),Od=(e,t=0)=>e?.sum?e.sum:t,Ld=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,jd=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,qd=({items:e,title:t,mobileTitle:n=t,orientation:i="horizontal",value:a,onChange:l,...r})=>c("div",{className:"grid gap-s whitespace-nowrap",children:[t?o("div",{className:"hidden @5xl:block",role:"radiogroup","aria-label":t,children:o(_e,{color:"text-secondary-text",font:"font-light",children:t})}):null,n?o("div",{className:"@5xl:hidden",role:"radiogroup","aria-label":n,children:o(_e,{color:"text-secondary-text",font:"font-light",children:n})}):null,o(hr,{orientation:i,items:e,value:e[a?0:1].id,onChange:t=>l&&l(t===e[0].id),...r})]}),$d=e=>qd({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),Ud=" (c капитализацией)",Wd=({income:e,finalSum:t,postfix:n="₽",buttons:i=[],footnotes:a=[],isCapitalization:l=!1})=>c("div",{className:Id,children:[o(Bd,{title:`Доход в конце срока${l?Ud:""}`,value:e,postfix:n,prefix:"+"}),o(Bd,{title:`Сумма в конце срока${l?Ud:""}`,value:t,postfix:n}),je(i,{isVertical:!0}),a?.map(Pd)]}),Hd=([e,t],n,i=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:Yd([e,t],i),Yd=([e,t],n=[])=>({[e]:n.length?Pc(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?Tc(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),Kd=(e,[t,n],i)=>e>=i[t]&&e<=i[n],Gd={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const Xd={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Jd=(e,t)=>{const{daysValue:n,moneyValue:i,isPartialWithdrawal:a,isReplenished:l,isMonthlyInterestPayment:r}=e,s=l||a,o=n<90||n>730,c=function(e){const t=e?.rateType?Gd[e?.rateType]:"",{data:n}=hi(t?`/api/v1/depositrates/${t}`:null,Rt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&Zd(s,e)&&Kd(i,["minSum","maxSum"],e)&&Kd(n,["minDays","maxDays"],e)))||Xd,{rate:m}=d,u=Qd(m,e),h=i+u,p=c||[Xd];return{...d,...Yd(["minSum","maxSum"],p),...Yd(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},Zd=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Qd=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:i,daysValue:a}=t;return n?Math.round(i*Math.pow((1200+e)/1200,a/30)-i):Math.round(i*e*a/365/100)},em=zt((({className:e="",title:t,buttons:n,footnote:i,bottomFootnote:a,isShowDepositeName:l,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=rn({moneyValue:Od(r,1e5),daysValue:Ld(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=Jd(m,s),{income:g,finalSum:f,rate:x,depositeName:y}=p;return o(Cd,{className:e,title:t,...d,children:c("section",{className:u(Sd,e),children:[c("div",{className:kd,children:[_d({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(b={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(dl,{items:[`От ${jd(b.min||0)}`,`До ${jd(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[tm(p,h),$d({title:"Выплата процентов",orientation:"vertical",...h("isMonthlyInterestPayment"),className:"sm:flex-col"})]})]}),Md({rate:x,depositeName:y,isShowDepositeName:l}),Wd({income:g,finalSum:f,buttons:n,footnotes:[i,a]})]})});var b})),tm=(e,t)=>c("div",{className:"space-y-s",children:[o(_e,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(ki,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(ki,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),nm=(e=[],t=!1)=>im([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),im=(e,t)=>{if(!t?.length)return;const n=t?.reduce(((t,n)=>e[0](n.rate,t[0].rate)?[n]:n.rate===t[0].rate?[...t,n]:t),[t[0]]);return n.length>1?n.reduce(((t,n)=>e[1](n,t)?n:t),n[0]):n[0]},am=({min:e=0,max:t=0,availableMonths:n,...i})=>o(dl,{items:[`От ${lm(e)}`,`До ${lm(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...i}),lm=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,rm=e=>qd({...e,className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),sm=({field:e,defParams:t,calcParams:n,map:i,monthsValue:a="maxMonths"})=>{Object.entries(i).forEach((([n,i])=>{e?.(n)?.onChange?.(t?.[i])})),e?.("monthsValue")?.onChange?.(ll(t?.[a],n.minMonths,n.maxMonths))},om=(e,t)=>{const{isAnnuity:n,moneyValue:i,monthsValue:a,moneyExtra:l}=t;if(0===e)return 0;if(n){const t=e/1200;return l?(i+l)*(t+t/(Math.pow(1+t,a)-1)):i*(t+t/(Math.pow(1+t,a)-1))}return Math.round(i/a)+i*(e/1200)},cm={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},dm=e=>mm({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&mm({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&mm({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&mm({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),mm=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:i,viewSettingFieldKey:a})=>!!n&&!n[a]||t[i]===e[i],um=(e,t,n)=>{const{moneyValue:i,monthsValue:a}=e,l=t?.rateRows||[cm],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>dm({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Hd(["minSum","maxSum"],r,l),{minMonths:c,maxMonths:d}=Hd(["minMonths","maxMonths"],r,l),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:i,monthsValue:a})=>e?.find((e=>dm({row:e,userInputParams:t,paramsViewSettings:n})&&Kd(i,["minSum","maxSum"],e)&&Kd(a,["minMonths","maxMonths"],e)))||cm)({rateRows:l,userInputParams:e,paramsViewSettings:n,moneyValue:i,monthsValue:a}),{rate:u}=m,h=om(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:i,monthsValue:a,monthlyPayment:h}},hm=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),pm={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},gm=zt((({className:e,title:t,calcSource:n,buttons:i,footnote:l,paramsViewSettings:r,defaultParams:s,registerSubmit:d,...m})=>{const h=(p=n?.rateRows,im([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],p));var p;const[g,{field:f,onSubmit:x}]=rn({moneyValue:Od(s,2e5),monthsValue:Ld(s,Vd),isAnnuity:Boolean(s?.isAnnuity),isInsurance:Boolean(s?.isEnableInsurance),isSalaryClient:Boolean(s?.isEnableSalaryClient),isPensionClient:Boolean(s?.isEnablePensionClient),isStateEmployee:Boolean(s?.isEnableStateEmployee)});d?.(x);const y=um(g,n,r),b=rm({title:"Тип платежа",orientation:"vertical",...f("isAnnuity")}),{onChange:v}=f("moneyValue"),{onChange:N}=f("monthsValue");return a((()=>{v&&v(ll(g.moneyValue,y.minSum,y.maxSum))}),[y.minSum,y.maxSum]),a((()=>{N&&N(ll(g.monthsValue,y.minMonths,y.maxMonths))}),[y.minMonths,y.maxMonths]),a((()=>{!hm(s)&&h&&sm({field:f,defParams:h,calcParams:y,map:pm,monthsValue:"minMonths"})}),[n,s]),o(Cd,{className:e,title:t,...m,children:c("section",{className:u(Sd,e),children:[c("div",{className:kd,children:[_d({title:"Сумма кредита, ₽",step:500,min:y.minSum,max:y.maxSum,...f("moneyValue"),value:y.moneyValue}),am({title:"Срок кредита, месяцев",min:y.minMonths,max:y.maxMonths,...f("monthsValue"),value:y.monthsValue}),fm({...y,...r},f),o("div",{className:"sm:hidden",children:b})]}),c("div",{className:u(Id,"@4xl:w-1/2"),children:[o(Bd,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(Bd,{title:"Ставка",value:y?.rate,fractionDigits:2,postfix:"%"}),o(Bd,{title:"Ежемесячный платёж",value:y.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:b}),je(i,{isVertical:!0}),Pd(l)]})]})})})),fm=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(ki,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(ki,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(ki,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(ki,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),xm=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,i]=t[n-1],[a,l]=t[n];i>=a?t.splice(n-1,2,[e,Math.max(i,l)]):n++}return t},ym={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},bm=(e,t,n)=>{const{moneyValue:i,monthsValue:a}=e,l=t?.[0]?wm(t[0].minMonths,t[0].maxMonths):0,r=!n?.isShowMonthlyInterestPayment,s=!n?.isShowRemoteRegistration,o=!n?.isShowReplenish,c=!n?.isShowWithdrawn,d=!n?.isShowNewClient,m=t?.find((t=>[Nm({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),Nm({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),Nm({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),Nm({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,Kd(i,["minSum","maxSum"],t),Kd(a||l,["minMonths","maxMonths"],t)].every(Boolean)))||ym,{rate:u}=m,h=vm(u,e),p=i+h,g=t||[ym];return{...m,...Yd(["minSum","maxSum"],g),...Yd(["minMonths","maxMonths"],g),availableMonths:xm(g.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((i,a)=>t>=e?e+a*n:e-a*n)))(e,t))),...e,defaultMonth:l,income:h,finalSum:p}},vm=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:i,monthsValue:a}=t;return n?Math.round(i*Math.pow((1200+e)/1200,a)-i):Math.round(i*e*30*a/365/100)},Nm=({row:e,userInputParams:t,paramKey:n,isExclude:i})=>i||t[n]===e[n],wm=(e,t)=>e+Math.round((t-e)/2),Cm=(e="rub")=>"rub"===e,Sm=(e,t)=>{const{minMonths:n,maxMonths:i}=Yd(["minMonths","maxMonths"],Bm(t,e?.currency)),a=e.monthsValue||Math.round((n+i)/2);return{monthsValue:ll(a,n,i)}},km=(e,t)=>{const{minSum:n,maxSum:i}=Yd(["minSum","maxSum"],Bm(t,e?.currency)),a=e.moneyValue||n;return{moneyValue:ll(a,n,i)}},Im=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),Tm=e=>{const t=Cm(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},Bm=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},Pm=(e,t)=>{const n="rub"!==e?.currency?.key;return c("div",{className:"grid gap-lg",children:[c("div",{className:"flex gap-lg",children:[e.isShowReplenish?qd({title:"Пополнение",...t("isReplenish"),value:e.isReplenish,orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,e.isShowWithdrawn?qd({title:"Снятие",...t("isWithdrawn"),value:e.isWithdrawn,orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null]}),Rm(e.isShowReplenish||e.isShowWithdrawn),c("div",{className:"flex gap-lg",children:[e.isShowMonthlyInterestPayment?$d({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment,orientation:"vertical"}):null,e.isShowRemoteRegistration?(i={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration,orientation:"vertical"},qd({...i,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]}),Rm(e.isShowNewClient),e.isShowNewClient?o(ki,{text:"Новый вкладчик",...t("isNewClient")}):null]});var i},Rm=(e=!1)=>e?o("div",{className:"border-b border-main-divider w-full"}):null,Dm={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum"},Mm={text:"₽",key:"rub"},_m=zt((({className:e,title:t,calcSource:n,buttons:i=[],footnote:r="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[Mm],g=l((e=>t=>e?{...t,...Tm(t),...km(t,e),...Sm(t,e),...Im(t,e)}:t)(h),[h]),[f,{field:x}]=rn({moneyValue:Od(d,2e4),monthsValue:Ld(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:Mm},{normalize:g}),y=x?.("currency")?.value??Mm,b=x?.("isNewClient")?.value,v=Bm(h,y),N=bm(f,v,s),{rate:w,income:C,finalSum:S,type:k=""}=N,I=l((()=>{sm({field:x,defParams:nm(v,b),calcParams:N,monthsValue:"minMonths",map:Dm})}),[x,h]);a((()=>{!hm(d)&&v&&I()}),[d,h]);const T=w===nm(v,b)?.rate;return o(Cd,{className:e,title:t,...m,children:c("section",{className:u(Sd,e),children:[c("div",{className:kd,children:[c("div",{className:"flex gap-m",children:[_d({className:"w-full",title:`Сумма, ${y?.text}`,min:N.minSum,max:N.maxSum,...x("moneyValue"),value:N.moneyValue,postfix:y?.text,step:Am(y?.key)}),h&&h?.length>1?o(zn,{label:"Валюта",options:p,...x("currency")}):null]}),am({title:"Срок, месяцев",min:N.minMonths,max:N.maxMonths,availableMonths:N.availableMonths,...x("monthsValue"),value:N.monthsValue}),Pm({...N,...s},x)]}),Md({rate:w,children:zm(I,T)}),Wd({income:C,finalSum:S,buttons:[...i,Em(n?.buttons,k)],footnotes:[r],postfix:y?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),Am=(e="")=>Cm(e)?1e3:100,Em=(e=[],t="")=>{const{type:n,...i}=e.find((e=>e.type===t))??{};return i},zm=(e,t=!1)=>t?null:o(Oa,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),Fm=e=>Vm({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Vm({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Vm=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:i,viewSettingFieldKey:a})=>!!n&&!n[a]||t[i]===e[i],Om={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},Lm=(e,t,n)=>{const{moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r}=e,s=t?.rateRows||[Om],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Fm({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Hd(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Hd(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r})=>e?.find((e=>Fm({row:e,userInputParams:t,paramsViewSettings:n})&&Kd(i+r,["minSum","maxSum"],e)&&Kd(l,["minSumOld","maxSumOld"],e)&&Kd(r,["minSumExtra","maxSumExtra"],e)&&Kd(a,["minMonths","maxMonths"],e)))||Om)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r}),{rate:p}=h,g=om(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r,monthlyPayment:g,benefit:f}},jm=zt((({className:e="",title:t,calcSource:n,buttons:i,footnote:a,paramsViewSettings:l,...r})=>{const[s,{field:d}]=rn({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),m=Lm(s,n,l),h=rm({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")});return o(Cd,{className:e,title:t,...r,children:c("section",{className:u(Sd,e),children:[c("div",{className:kd,children:[_d({title:"Остаток долга в других банках, ₽ ",step:500,min:m.minSum,max:m.maxSum-m.maxSumExtra,...d("moneyValue"),value:m.moneyValue}),_d({title:"Ежемесячный платёж в других банках, ₽",step:500,min:m.minSumOld,max:m.maxSumOld,...d("oldMonthlyPayment"),value:m.oldMonthlyPayment}),am({title:"Новый срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),qm({...m,...l},d),m.isExtraMoney?_d({title:"Дополнительная сумма, ₽ ",step:500,min:m.minSumExtra,max:m.maxSumExtra,...d("moneyExtra"),value:m.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:h})]}),c("div",{className:u(Id,"@4xl:w-1/2"),children:[o(Bd,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(Bd,{title:"Ставка",value:m?.rate,fractionDigits:2,postfix:"%"}),o(Bd,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),m.benefit>0?o(Bd,{title:"Выгода в месяц",value:m.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:h}),je(i,{isVertical:!0}),Pd(a)]})]})})})),qm=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(ki,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(ki,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(ki,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),$m=d((e=>{const{onChange:t,min:n,max:i,defaultValue:a="0",fractionDigits:r=0,...s}=e,c=al(e,{normalize:(e=a)=>n&&i?String(ll(Number(Um(e)),n,i)):Um(e),format:We(r)}),d=l((e=>t&&t(Um(e))),[t]);return o(xn,{onChange:d,...s,...c})})),Um=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Wm=d((e=>o($m,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(_e,{size:"text-xl",font:"font-light",children:"₽"})})}))),Hm={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},Ym={amount:1500},Km=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:l,formType:r="private",...s})=>{const[{amount:d},{field:m}]=rn(Ym),[h,p]=i(!1);return a((()=>{p(d<=0)}),[d]),c(g,{className:u("flex flex-col items-center",e),defaultPadding:"p-6xl",...s,children:[t?o(w,{className:"pb-lg xl:pb-4xl self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-[468px]",method:"POST",action:Hm[r],children:[o(Wm,{valid:!h,label:n,max:3e5,min:1,...m("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:d}),l?.text?o(Oa,{className:"w-full mt-lg",type:"submit",disabled:h,children:l.text}):null]})]})})),Gm=({className:e,text:t="ХИТ"}={})=>c("div",{className:u("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(W,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(C,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),Xm="relative h-full",Jm={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},Zm=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...i})=>{const{blocks:a}=i.block||{},l=a?.some(tu),r=n?{defaultPadding:"p-6xl pb-m"}:{};return D({...i,renderProps:(n,i,a)=>c("div",{className:Qm(n,{someCardsHighlighted:l}),children:[B(n,i,{className:eu(n,{someCardsHighlighted:l,showBorder:!e,cardSize:t}),...r,blockIndex:a}),tu(n)?Gm({className:"absolute top-0 -right-4 z-40"}):null]},String(a))})},Qm=(e,{someCardsHighlighted:t})=>u(Xm,t&&(tu(e)?"pt-3xl":"pt-3xl sm:pt-16")),eu=(e,{someCardsHighlighted:t,showBorder:n,cardSize:i="normal"})=>u(Xm,"min-w-80",Jm[i],t&&(tu(e)?"pt-3xl sm:pt-16":"pt-3xl"),pc(n),n&&"h-full"),tu=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,nu=zt((({className:e,visibleItemCount:t=0,noCardBorder:n,arrowsPadded:i=!0,isGap:a=!0,cardSize:l="normal",isNavButtons:r=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o($c,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:a?16:0,padding:0,arrowsPadded:i,navButtons:r?iu(s?.block?.blocks):[],hasBlur:!0,children:Zm({noCardBorder:n,cardSize:l,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),iu=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],au="z-10 border border-solid w-full h-full",lu=u(au,"absolute hidden @xl:block border-transparent"),ru=d((({className:e,title:t,description:n,button:i,...a})=>o(g,{className:u("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...a,children:c("div",{className:"relative h-full",children:[o("div",{className:u(lu,"top-9 right-12 bg-green-dark")}),o("div",{className:u(lu,"top-6 right-8 bg-green")}),o("div",{className:u(lu,"top-3 right-4 bg-green-light")}),c("div",{className:u(au,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(k,{title:t,description:n,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),je([i],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),su={black:"bg-black",white:"bg-white"},ou=d((({className:e="",title:t,description:n,image:i,price:a,button:l,colors:r=[],align:s="text-left",padding:d,...m})=>o(g,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Te,{className:"h-full",padding:d,title:o(k,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:i?.src?o(ne,{className:"flex justify-center align-center mb-xl",image:i}):null,buttons:je([l],{buttonClassName:"w-full self-end"}),children:[r?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(_e,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(cu)]}):null,a?c(_e,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),cu=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${su[e]}`},String(t)),du=d((({icon:e,...t})=>{const n=he(),{text:i,href:a,target:l,onClick:r}=n(t);return i?o("div",{className:u("p-3 rounded-lg bg-white text-secondary-text flex justify-center"),children:o("a",{role:"link",href:a,target:l,onClick:r,children:c("div",{className:"flex flex-col items-center gap-3 break-words max-w-[150px]",children:[e?o(ne,{className:"w-7 h-7 md:w-12 md:h-12",image:{...e,iconVersion:e?.iconVersion},alt:i}):null,o("div",{className:"font-light md:font-normal text-primary-text text-center text-xs md:text-sm whitespace-wrap",children:i})]})})}):null})),mu=d((({className:e,additionalDescription:t,description:n,links:i,title:a,...l})=>o(g,{defaultPadding:"p-5xl",className:u("overflow-hidden",e),...l,children:c("div",{className:"flex flex-col lg:flex-row gap-5 justify-between",children:[c("div",{className:"flex-1",children:[o(k,{isEmbedded:!0,title:a,description:n,as:"h1",align:"text-left",headlineVersion:"XL"}),o(k,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),i?.length?uu(i):null]})}))),uu=e=>o("div",{className:u("lg:grid-cols-9 lg:[&>*]:col-span-2 lg:[&>*:nth-child(14n+2)]:col-span-3 lg:[&>*:nth-child(7n+5)]:col-span-3","lg:[&>*:nth-child(7n+6)]:col-span-3 lg:[&>*:nth-child(7n+7)]:col-span-3 lg:[&>*:nth-child(14n+10)]:col-span-3 lg:w-3/6","grid-cols-3 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+3)]:col-span-2 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+4)]:col-span-2","grid gap-3 lg:gap-5"),children:e.map(((e,t)=>o(du,{...e},String(t))))}),hu=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"mindboxEvent"===e?{...n,eventJson:t}:n}))),pu=d((({className:e="",href:t,target:n,onClick:i,data:a,children:l})=>{const r=he()({href:t,target:n,onClick:i});return o(t?"a":"div",{className:u("block",e),...t?r:{},role:t?"link":"none",...ge(a),children:l})})),gu=[{origins:["t.me","telegram.org"],iconMapped:{icon:"TelegramIcon"}},{origins:["vk.com"],iconMapped:{icon:"VKIcon"}},{origins:["ok.ru"],iconMapped:{icon:"OkIcon"}},{origins:["apps.apple.com"],iconMapped:{icon:"AppleIcon"}},{origins:["play.google.com"],iconMapped:{icon:"PlayMarketIcon"}},{origins:["appgallery.huawei.com"],iconMapped:{icon:"HuaweiIcon"}},{origins:["youtube.com"],iconMapped:{icon:"YoutubeIcon"}},{origins:["rutube.ru"],iconMapped:{icon:"RutubeIcon"}},{origins:["dzen.ru"],iconMapped:{icon:"DzenIcon"}},{origins:["rustore.ru"],iconMapped:{icon:"RustoreIcon"}}],fu=d((({className:e="",media:t,showButtonText:n,stretched:a,version:l="white",children:r})=>{if(!t?.length)return null;const[s,d]=i(),m=t?.map((e=>{const{href:t,icon:i,text:a}=e,{iconMapped:r}=(e=>gu.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=Le(i)?i:r,c=n?{text:a}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&a&&d(!0),{...e,...c,icon:{...o,iconVersion:m},version:e?.version??l}})),h=u("border border-solid hover:border-transparent border-main-divider","group-data-primary:border-main-divider group-data-gray:border-green group/media",{"basis-auto":!n&&!s},xu(a));return c("div",{className:u("flex flex-col gap-m xl:gap-xs",e),"aria-label":"Социальные сети",children:[o("div",{className:"flex gap-xs",children:je(m,{className:yu(s??!1,a??!1,n),buttonClassName:h})}),r?o(_e,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),xu=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",yu=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),bu=d((({className:e,padding:t,description:n,additionalDescription:i,href:a,icon:l,isDotted:r,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:x=!0,isImageAlwaysOnRight:y=false,isImageSecondary:b=!1}={},data:v,...N})=>o(g,{className:u("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...N,children:o(pu,{href:a,target:m,className:"h-full",data:hu(v),children:c(Te,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(k,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...Ze(Le(l)?o(ne,{image:l}):null,x),buttons:d.length?o(fu,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:y,isImageSecondary:b,imageAlign:"center",children:[o(Oe,{benefits:f}),s?o(De,{__html:s,isDotted:r,itemSize:"list-s"}):null,vu(i,p)]})})}))),vu=(e,t)=>e?o(C,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,Nu=(e,t)=>{const{title:n,description:i,buttons:a}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(_e,{size:"text-m",color:"text-secondary-text",children:n})}):null,i?o("div",{className:"mt-2xs",children:o(_e,{size:"text-xl",color:"text-primary-text",children:i})}):null,a?.length?o("div",{className:"text-primary-main",children:je(a)}):null]},String(t))},wu=d((({className:e="",title:t,align:n="text-center",icon:l,button:r,visibleCellsCount:s=1,cardCells:d=[],options:m,data:h,...p})=>{const f=d.map(Nu),[x,y]=s>0?[f.slice(0,s),f.slice(s)]:[f,[]],[b,v]=i(!1);return a((()=>de.subscribe("fold",(e=>{e&&void 0!==m?.parent&&e.parent===m?.parent&&v(e.isUnfolded)}))),[m?.parent]),c(g,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...p,children:[Le(l)?o("div",{className:"self-center",children:o(ne,{image:l})}):null,t?o(w,{className:u("pt-xs",n),headingType:"h5",title:t}):null,r?.text?o(ve,{className:"w-full mt-m mb-lg",...r}):null,y.length?o(ea,{renderFoldableSection:()=>c("div",{children:[x,o(ta,{isUnfolded:b,children:y})]}),renderFoldButton:d.length>=s?Cu(m?.parent,h,b):null}):o("div",{children:x})]})})),Cu=(e,t,n=!1)=>()=>c("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:()=>{void 0!==e&&de.fire("fold",{type:"fold",isUnfolded:!n,parent:e})},type:"button",...n?ge(t):{},children:[o("div",{children:n?"Скрыть":"Подробнее о тарифе"}),o(W,{className:"text-primary-text",name:n?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),Su=e=>{const t=globalThis.sessionStorage?.getItem("refreshToken"),n=globalThis.sessionStorage?.getItem("accessToken"),i=globalThis.localStorage.getItem("taskId");if(!n||!t||!i)return e(),()=>null;const a=async()=>{const i=await Ji("/auth/refresh","POST",{refresh_token:t,access_token:n});if(401==i?.status&&e(),i?.ok){const e=await i.json();globalThis.sessionStorage.setItem("refreshToken",e.refresh_token),globalThis.sessionStorage.setItem("accessToken",e.access_token)}};a();const l=setInterval(a,24e4);return()=>clearInterval(l)};function ku(){return ku._impl()}ku._impl=()=>({assign:e=>globalThis.location.assign(e)}),ku.setup=e=>{ku._impl=e};const Iu=d((({step:e=10,description:t,showPercentage:n=!0})=>c("div",{children:[o("div",{className:"h-4 w-full bg-gray relative",children:o("div",{className:"h-4 bg-green",style:{width:`${e}%`}})}),c("div",{className:"relative",children:[n?c("div",{className:"absolute left-2/4 text-green",children:[e,"%"]}):null,t?o("div",{className:"text-right mr-4 text-gray",children:t}):null]})]}))),Tu=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const i=r((()=>(e+1)/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e+1," из ",t,"."]}),n[e]||null,o(Iu,{step:i,showPercentage:!1})]})})}));var Bu;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.rework="REVISION"}(Bu||(Bu={}));const Pu=e=>Xi("/user-data/getTaskStatus","POST",e),Ru=e=>Ji("/user-data/sendSignalToProcess","POST",e),Du=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black",link:i})=>c("div",{className:"flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m",children:[o("div",{className:"rounded-full bg-white p-xs",children:o(W,{name:t,width:"24",height:"24",iconVersion:n})}),c("div",{className:"",children:[o(De,{__html:e}),i?.text?o(ve,{className:"text-primary-main",children:i.text}):null]})]}))),Mu=d((({interval:e=0,intervalExpireAction:t=(()=>null),title:n,__html:a})=>{const[l,r]=i(e),s=100-(e-l)/e*100;return c("div",{children:[n?o(k,{title:n,headlineVersion:"S"}):null,c("div",{className:"flex justify-center items-center flex-col",children:[c("div",{className:u("relative flex items-center justify-center w-24 h-24 rounded-full bg-gray text-transparent mb-5"),children:[o("div",{className:"absolute inset-0 rounded-full",style:{background:`conic-gradient(rgb(66, 171, 68) ${s}%, rgb(125, 126, 127) 0deg)`}}),o("div",{className:"z-10 flex items-center justify-center px-4 py-2 rounded-full w-20 h-20 bg-white text-primary-text text-m",children:o(_o,{interval:e,time:l,setTime:e=>{0===e&&t(),r(e)}})})]}),a?o(De,{__html:a}):null]})]})})),_u=d((({title:e,description:t,infoCard:n,sectionInfoTitle:i,sectionInfo:a,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(Mu,{interval:d}):null]}),o(Au,{title:i,items:a}),o(Au,{title:l,items:r,countColumns:!0}),n?.__html?o(Du,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(ve,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),Au=({title:e,items:t,countColumns:n=!1})=>{const i=Se();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(_e,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",Qs(n||i?1:2)),children:t.map(((e,t)=>o("div",{children:Eu(e)},t)))}):null]})]}):null},Eu=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(_e,{color:"text-secondary-text",size:"text-l",children:e}),o(_e,{color:"text-primary-text",size:"text-xl",children:t})]}),zu=d((()=>o(_u,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Fu=d((()=>{const[e]=go("leadForm");return o(_u,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:e?.cardCategory?.text}]})})),Vu=d((()=>{const[e]=go("leadForm");return o(_u,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Ou=d((()=>{const[e]=go("leadForm");return o(_u,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),Lu=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],ju=d((()=>{const[e,t]=i(Bu.process),[n]=go("taskId");return a((()=>{(async()=>{for(const e of Lu)await Ru({signalType:e,taskId:n})})();const e=l((async()=>{const e=await Pu({taskId:n});e&&e?.statusCd!==Bu.process&&(clearInterval(i),t(e.statusCd))}),[]),i=setInterval(e,3e4)}),[]),qu(e)})),qu=e=>({IN_PROCESS:o(Fu,{}),CANCELLED:o(zu,{}),APPROVED:o(Ou,{}),REVISION:o(Vu,{})}[e]||null),$u=[{paymentSystem:"",currency:"rub",codeWord:""},{surname:"",name:"",middleName:"",sex:"",birthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0,methodObtain:"office",addressCourier:{fullAddress:"",fiasCode:""}},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:"",addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:"office",deliveryDate:void 0}],Uu=e=>{if(e)try{return new Date(e)}catch(e){return}},Wu=e=>(t,n)=>t.filter((e=>e)).map((t=>[Hu(n,e),Yu(t,e),Ku(t,e),Gu(t,e),Xu(t,e),Ju(t,e)].some(Boolean)?{...t,required:!1}:t)),Hu=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Yu=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Ku=({name:e},t)=>"snils"===e&&!t("consentPfrFlg"),Gu=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Xu=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Ju=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const i=t(e?.name);return n!==(i?.key??i)})),Zu=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(Du,{__html:e},`${t}_${n}`))):null},Qu=({field:e,inputs:t})=>t.map(Zs(e,"")),eh=({sections:e,field:t,step:n})=>e?.map((({inputs:e=[],columns:i,title:a},l)=>{const r=Wu(th(t))(e,n),s=r.filter((e=>!Ju(e,th(t))));return c("div",{className:u(Qs(i),"grid gap-x-m"),children:[Zu(s),eo(a),Qu({field:t,inputs:r})]},`section-${l}`)})),th=e=>t=>e(t)?.value,nh=d((({step:e,onPrevStep:t})=>{const n=6===e;return c("div",{className:"flex justify-between gap-m",children:[o(Oa,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(Oa,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),ih=e=>{const{methodObtain:t,deliveryDate:n=""}=e;return{courierDeliveryFlg:"courier"===t,deliveryDate:(i=n,i?new Date(i).toISOString().split(".")[0]:""),deliveryTimeCd:{value:"TIME_2"}};var i},ah=(e,t)=>{switch(e){case 0:return(e=>{const{currency:t,paymentSystem:n,cardCategory:i,codeWord:a}=e;return{currencyCode:t,paymentSystemTypeCd:n,classCard:i,codeWord:a}})(t);case 1:return(e=>{const{name:t,surname:n,middleName:i,birthday:a="",phone:l="",email:r,sex:s,birthPlace:o,dulIssueDateField:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:y}=e;return{birthDate:Lt(a,!0),midname:i,name:t,surname:n,birthPlace:o,dulIssueDate:Lt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:Lt(g,!0),houseTypeCd:f,participantContacts:tc({phone:jt(l),email:r}),participantAddresses:nc({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{employment:t,organizationName:n,inn:i,legalForm:a,organization:l,amountWorkers:r,employerActivities:s,employerOrganization:o,generalSeniority:c,lastJobExperience:d,experience5Years:m,jobsNumber:u,organizationPhone:h,organizationAddress:p,positionOrganization:g}=e;return{employmentTypeCd:t,organizationName:n,organizationInn:i,organizationActivityTypeCd:s,organizationTypeCd:l,organizationKindCd:o,employeesNumberCd:r,opf:a,seniority:c,generalSeniority:m,jobsNumber:u,lastWorkDuration:d,payrollCardRshbFlg:!0,positionCd:g,participantContacts:tc({organizationPhone:h&&jt(h)}),participantAddresses:nc({organizationAddress:p})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:i,wages:a,mandatoryPayments:l,incomeAverage:r,additionalIncome:s,otherIncome:o,otherPayments:c,rentalIncome:d,retirementIncome:m,snils:u,armyIdFlg:h}=e;return{maritalStatusCd:t,totalDependents:i,otherDependents:n,participantIncomes:ic({wages:a,mandatoryPayments:l,incomeAverage:r,additionalIncome:s,otherIncome:o,otherPayments:c,rentalIncome:d,retirementIncome:m}),snils:u?.replaceAll(" ",""),armyIdFlg:h}})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:i,creditInRshbCd:a}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:i,creditInRshbCd:a}})(t);case 5:return(e=>{const{addressCourier:t}=e;return{participantAddresses:nc({addressCourier:t})}})(t);default:return{}}},lh=({step:e,inputs:t,onNextStep:n,saveStep:i,finishForm:a})=>{const[r]=go("taskId"),[s]=go("profileId"),[o]=go("participantId"),c=l((async l=>{const c=io(ii(Wu(rh(l))(t,e)));if(console.log(ii(Wu(rh(l))(t,e))),!Fn(c(l)))return console.warn("validation fail");i(l);try{r&&s&&o&&await So((({participantId:e,taskId:t,profileId:n,formData:i,step:a=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:globalThis.location.origin,id:t,office:{id:"650"},authorizedAgentId:i?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...ah(a,i)}],...ih(i)}}))({participantId:o,taskId:r,profileId:s,step:e,formData:l}))}catch(e){return"Fail"}return n(),5===e&&a?.(!0),"OK"}),[]);return{handleSubmit:c}},rh=e=>t=>e[t],sh=d((({step:e,sections:t,onPrevStep:n,onNextStep:i,isFormFinished:a,finishForm:r})=>{const[d,m]=go("leadForm"),u=((e,t)=>({...$u[e],...t,birthday:Uu(t?.birthday),dulIssueDateField:Uu(t?.dulIssueDateField),participantDateRegistration:Uu(t?.participantDateRegistration),beginDate:Uu(t?.beginDate),deliveryDate:Uu(t?.deliveryDate)}))(e,d),h=s(void 0),p=t?.flatMap((e=>e?.inputs))||[],g=l((e=>{h.current=e}),[]),{handleSubmit:f}=lh({step:e,inputs:p,onNextStep:i,saveStep:m,finishForm:r}),[,{field:x,onSubmit:y}]=rn(u,{onSubmit:(e,t)=>{f({...e,...h.current?.(t)})}});return a?o(ju,{}):c("form",{onSubmit:y,className:"space-y-m",children:[eh({sections:t,field:x,step:e,registerSubmit:g}),o(nh,{step:e,onPrevStep:n})]})})),oh=[[{title:"Параметры карты",inputs:[]},{inputs:[{fieldType:"common",name:"currency",required:!0},{fieldType:"common",name:"paymentSystem",required:!0},{fieldType:"common",name:"cardCategory",required:!0},{fieldType:"common",name:"codeWord",required:!0}]}],[{title:"Персональные данные",columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"name",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"middleName",dadata:!0,filledByEsia:!0},{fieldType:"common",name:"sex",required:!0},{fieldType:"common",name:"birthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0},{fieldType:"common",name:"phone",required:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{fieldType:"common",name:"dulSerie",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulNumber",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulIssueDateField",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{fieldType:"common",name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"addressMatch"}]},{columns:2,inputs:[{fieldType:"common",name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{fieldType:"common",name:"housing",required:!0}]},{inputs:[{fieldType:"common",name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{fieldType:"info",text:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{fieldType:"common",name:"employment"},{fieldType:"common",name:"organizationName",required:!0,dadata:!0}]},{columns:2,inputs:[{fieldType:"common",name:"inn",required:!0,dadata:!0},{fieldType:"common",name:"legalForm",required:!0}]},{inputs:[{fieldType:"common",name:"organization",required:!1},{fieldType:"common",name:"amountWorkers",required:!1}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!1},{fieldType:"common",name:"employerOrganization",required:!1},{fieldType:"common",name:"generalSeniority",required:!0},{fieldType:"common",name:"lastJobExperience",required:!0},{fieldType:"common",name:"experience5Years",required:!0},{fieldType:"common",name:"jobsNumber",required:!0}]},{inputs:[{fieldType:"common",name:"organizationPhone",label:"Телефон работодателя",required:!0},{fieldType:"common",name:"beginDate",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"positionOrganization",required:!1},{fieldType:"common",name:"partInBusiness",required:!0}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{fieldType:"common",name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{fieldType:"common",name:"familyStatus",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"dependents",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"familyMembers"},{fieldType:"common",name:"children",required:!0}]},{title:"Совокупный доход"},{inputs:[{fieldType:"info",text:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{fieldType:"common",name:"wages",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"snils",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"conscription",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"disablePeopleFlg"}]},{inputs:[{fieldType:"common",name:"bankruptcyFlg"}]},{inputs:[{fieldType:"common",name:"shareholderFlg"}]},{inputs:[{fieldType:"common",name:"legalEntityName"}]},{inputs:[{fieldType:"common",name:"creditInRshbCd"}]}],[{title:"Способ получения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"methodObtain"}]},{title:"Адрес",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0,condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]},{inputs:[{fieldType:"info",text:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код",condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"bankEmployeeCode",condition:{name:"methodObtain",values:["office"]}}]}]],ch=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],dh=d((({className:e,...t})=>{const[n,d]=i(0),m=s(null),h=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]),p=ku();a((()=>Su((()=>p.assign("/")))),[]);const f=l((()=>{d((e=>Math.min(e+1,6))),h()}),[]),x=l((()=>{d((e=>Math.max(e-1,0))),h()}),[]),y=r((()=>oh[n]),[n]),[b,v]=i(!1);return o(g,{className:u("bg-transparent",e),defaultPadding:"p-0",...t,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[b?null:o(Tu,{stepsTitles:ch,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(sh,{step:n,sections:y,onNextStep:f,onPrevStep:x,isFormFinished:b,finishForm:v},String(n))})]})})})),mh=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const i=r((()=>e/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e," из ",t,"."]}),n[e]||null,o(Iu,{step:i,showPercentage:!1})]})})})),uh=d((({title:e,description:t,infoCard:n,sectionInfoTitle:i,sectionInfo:a,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,intervalExpireAction:m=(()=>{}),...u})=>c(g,{...u,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(Mu,{interval:d,intervalExpireAction:m}):null]}),o(hh,{title:i,items:a}),o(hh,{title:l,items:r,countColumns:!0}),n?.__html?o(Du,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(ve,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),hh=({title:e,items:t,countColumns:n=!1})=>{const i=Se();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(_e,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",Qs(n||i?1:2)),children:t.map(((e,t)=>o("div",{children:ph(e)},t)))}):null]})]}):null},ph=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(_e,{color:"text-secondary-text",size:"text-l",children:e}),o(_e,{color:"text-primary-text",size:"text-xl",children:t})]}),gh=d((()=>o(uh,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),fh=d((({handleExpireTimer:e})=>{const[t]=go("leadForm");return o(uh,{interval:300,intervalExpireAction:e,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:t?.moneyValue?.toLocaleString()+" ₽"},{label:"Срок кредита",description:t?.monthsValue+" мес"},{label:"Тип платежа",description:t?.isAnnuity?"Аннуитетный":"Дифференцированный"}]})})),xh=d((()=>{const[e]=go("leadForm");return o(uh,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),yh=d((()=>{const[e]=go("leadForm");return o(uh,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),bh=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],vh=d((()=>{const[e,t]=i(Bu.process),[n]=go("taskId");a((()=>{(async()=>{for(const e of bh)await Ru({signalType:e,taskId:n})})();const e=setInterval((()=>n&&Pu({taskId:n}).then((n=>{n?.statusCd&&n.statusCd!==Bu.process&&(clearInterval(e),t(n.statusCd))}))),3e4);return()=>clearInterval(e)}),[]);return Nh(e,(()=>t(Bu.rework)))})),Nh=(e,t)=>({IN_PROCESS:o(fh,{handleExpireTimer:t}),CANCELLED:o(gh,{}),APPROVED:o(yh,{}),REVISION:o(xh,{})}[e]||null),wh=[{moneyValue:0,monthsValue:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1},{surname:"",name:"",middleName:"",sex:"",birthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:"",addressRetail:void 0,bankEmployeeCode:void 0}],Ch=e=>{if(e)try{return new Date(e)}catch(e){return}},Sh=e=>(t,n)=>t.filter((e=>e)).map((t=>[kh(n,e),Ih(t,e),Th(t,e),Bh(t,e),Ph(t,e),Rh(t,e)].some(Boolean)?{...t,required:!1}:t)),kh=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Ih=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Th=({name:e},t)=>"snils"===e&&!t("consentPfrFlg"),Bh=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Ph=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Rh=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const i=t(e?.name);return n!==(i?.key??i)})),Dh=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(Du,{__html:e},`${t}_${n}`))):null},Mh=({field:e,inputs:t})=>t.map(Zs(e,"")),_h=({sections:e,field:t,step:n})=>e?.map((({inputs:e=[],columns:i,title:a},l)=>{const r=Sh(Ah(t))(e,n);return c("div",{className:u(Qs(i),"grid gap-x-m"),children:[Dh(r),eo(a),Mh({field:t,inputs:r})]},`section-${l}`)})),Ah=e=>t=>e(t)?.value,Eh=d((({step:e,onPrevStep:t})=>{const n=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Oa,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(Oa,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),zh=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},Fh={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},Vh=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:i}=e;return{loanAmount:t,creditPeriod:n,paymentTypeCd:Fh[i?"annuity":"differential"]}},Oh=(e,t)=>{switch(e){case 0:default:return{};case 1:return(e=>{const{name:t,surname:n,middleName:i,birthday:a="",phone:l="",email:r,sex:s,birthPlace:o,dulIssueDateField:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:y}=e;return{birthDate:Lt(a,!0),midname:i,name:t,surname:n,birthPlace:o,dulIssueDate:Lt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:Lt(g,!0),houseTypeCd:f,participantContacts:tc({phone:jt(l),email:r}),participantAddresses:nc({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{employment:t,organizationName:n,inn:i,legalForm:a,organization:l,amountWorkers:r,employerActivities:s,employerOrganization:o,generalSeniority:c,lastJobExperience:d,experience5Years:m,jobsNumber:u,organizationPhone:h,organizationAddress:p,positionOrganization:g}=e;return{employmentTypeCd:t,organizationName:n,organizationInn:i,organizationActivityTypeCd:s,organizationTypeCd:l,organizationKindCd:o,employeesNumberCd:r,opf:a,seniority:c,generalSeniority:m,jobsNumber:u,lastWorkDuration:d,payrollCardRshbFlg:!0,positionCd:g,participantContacts:tc({organizationPhone:h&&jt(h)}),participantAddresses:nc({organizationAddress:p})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:i,confirmationIncome:a,wages:l,mandatoryPayments:r,incomeAverage:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u,snils:h,armyIdFlg:p}=e;return{maritalStatusCd:t,totalDependents:i,incomeCertificateCd:a,otherDependents:n,participantIncomes:ic({wages:l,mandatoryPayments:r,incomeAverage:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u}),snils:h?.replaceAll(" ",""),armyIdFlg:p}})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:i,creditInRshbCd:a}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:i,creditInRshbCd:a}})(t)}},Lh=({step:e,inputs:t,onNextStep:n,saveStep:i,finishForm:a})=>{const[r]=go("taskId"),[s]=go("profileId"),[o]=go("participantId"),c=l((async l=>{const c=io(ii(Sh(jh(l))(t,e)));if(!Fn(c(l)))return console.warn("validation fail");i(l);try{r&&s&&o&&await So((({participantId:e,taskId:t,profileId:n,formData:i,step:a=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:globalThis.location.origin,id:t,office:{id:""},authorizedAgentId:i?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Oh(a,i)}],...Vh(i),...zh(i),esiaAccountTypeCd:{key:i?.esiaAccountTypeCd?.key}}}))({participantId:o,taskId:r,profileId:s,step:e,formData:l}))}catch(e){return"Fail"}return n(),5===e&&a?.(!0),"OK"}),[]);return{handleSubmit:c}},jh=e=>t=>e[t],qh=d((({step:e,sections:t,onPrevStep:n,onNextStep:i,renderStep:a=_h,isFormFinished:r,finishForm:d})=>{const[m,u]=go("leadForm"),h=((e,t)=>({...wh[e],...t,birthday:Ch(t?.birthday),dulIssueDateField:Ch(t?.dulIssueDateField),participantDateRegistration:Ch(t?.participantDateRegistration),beginDate:Ch(t?.beginDate),deliveryDate:Ch(t?.deliveryDate)}))(e,m),p=s(void 0),g=t?.flatMap((e=>e?.inputs))||[],f=l((e=>{p.current=e}),[]),{handleSubmit:x}=Lh({step:e,inputs:g,onNextStep:i,saveStep:u,finishForm:d}),[,{field:y,onSubmit:b}]=rn(h,{onSubmit:(e,t)=>{x({...e,...p.current?.(t)})}});return r?o(vh,{}):c("form",{onSubmit:b,className:"space-y-m",children:[a({sections:t,field:y,step:e,registerSubmit:f}),o(Eh,{step:e,onPrevStep:n})]})})),$h=[[],[{title:"Персональные данные",columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"name",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"middleName",dadata:!0,filledByEsia:!0},{fieldType:"common",name:"sex",required:!0},{fieldType:"common",name:"birthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0,filledByEsia:!0},{fieldType:"common",name:"phone",required:!0,filledByEsia:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{fieldType:"common",name:"dulSerie",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulNumber",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulIssueDateField",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{fieldType:"common",name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"addressMatch"}]},{columns:2,inputs:[{fieldType:"common",name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{fieldType:"common",name:"housing",required:!0}]},{inputs:[{fieldType:"common",name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{fieldType:"info",text:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{fieldType:"common",name:"employment"},{fieldType:"common",name:"organizationName",required:!0,dadata:!0}]},{columns:2,inputs:[{fieldType:"common",name:"inn",required:!0,dadata:!0},{fieldType:"common",name:"legalForm",required:!0}]},{inputs:[{fieldType:"common",name:"organization",required:!1},{fieldType:"common",name:"amountWorkers",required:!1}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!1},{fieldType:"common",name:"employerOrganization",required:!1},{fieldType:"common",name:"generalSeniority",required:!0},{fieldType:"common",name:"lastJobExperience",required:!0},{fieldType:"common",name:"experience5Years",required:!0},{fieldType:"common",name:"jobsNumber",required:!0}]},{inputs:[{fieldType:"common",name:"organizationPhone",label:"Телефон работодателя",required:!0},{fieldType:"common",name:"beginDate",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"positionOrganization",required:!1},{fieldType:"common",name:"partInBusiness",required:!0}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{fieldType:"common",name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{fieldType:"common",name:"familyStatus",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"dependents",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"familyMembers"},{fieldType:"common",name:"children",required:!0}]},{title:"Совокупный доход"},{inputs:[{fieldType:"info",text:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{fieldType:"common",name:"confirmationIncome",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"wages",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"snils",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"conscription",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"disablePeopleFlg"}]},{inputs:[{fieldType:"common",name:"bankruptcyFlg"}]},{inputs:[{fieldType:"common",name:"shareholderFlg"}]},{inputs:[{fieldType:"common",name:"legalEntityName"}]},{inputs:[{fieldType:"common",name:"creditInRshbCd"}]}],[{title:"Отделение Банка",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0}]},{inputs:[{fieldType:"common",name:"addressRetail",required:!0}]},{title:"Код представителя Банка",columns:1,inputs:[]},{inputs:[{fieldType:"info",text:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{inputs:[{fieldType:"common",name:"bankEmployeeCode"}]}]],Uh=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Отделение Банка"],Wh=d((({className:e,...t})=>{const[n,d]=i(0),m=s(null),h=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]),p=ku();a((()=>Su((()=>p.assign("/")))),[]);const f=l((()=>{d((e=>Math.min(e+1,5))),h()}),[]),x=l((()=>{d((e=>Math.max(e-1,0))),h()}),[]),y=r((()=>$h[n]),[n]),b=0===n,[v,N]=i(!1);return o(g,{className:u("bg-transparent",e),defaultPadding:"p-0",...t,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[b||v?null:o(mh,{stepsTitles:Uh,step:n,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(qh,{step:n,sections:y,onNextStep:f,onPrevStep:x,isFormFinished:v,finishForm:N,renderStep:b?({registerSubmit:e,field:t})=>o(gm,{defaultParams:{sum:t("moneyValue").value,period:t("monthsValue").value,isAnnuity:t("isAnnuity").value},title:"Калькулятор кредита",footnote:"Расчёт является предварительным. Точные условия будут предоставлены в отделении Банка.",calcSource:{$ref:"/wcms-resources/credit-calculator-data.json"},registerSubmit:e}):void 0},String(n))})]})})})),Hh=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,Yh=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),Kh=1e9,Gh={sum:{min:1e4,max:Kh},period:3},Xh=zt((({className:e,filtrationSchema:t={},resetButton:n,sumInput:i,periodInput:a,...l})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=cd(Gh,{block:l.block,page:l.options?.page,normalize:e=>({...e,period:Jh(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=Zh(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...l,children:[o(nd,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(Wm,{label:i?.title,min:500,max:Kh,...d("sum",{parse:e=>({min:Number(e),max:Kh}),format:({min:e})=>String(e)})}),o(dl,{title:a?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(Zc,{blocksToRender:r,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),Jh=e=>Dt((e?.paramsSource?.rateRows||[]).filter(Hh).flatMap((e=>Yh(e.minMonths,e.maxMonths)))),Zh=e=>Dt(e.flatMap((e=>e||[])).filter(Hh).flatMap((e=>Yh(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],Qh=[{key:"10"},{key:"50"},{key:"100"}],ep=({itemCount:e,onItemCountChange:t})=>{const n=l((({key:e})=>t(Number(e))),[]);return c("div",{className:"mt-2 @lg:mt-0 items-center gap-s hidden @lg:flex",children:[o("span",{children:"Показать по"}),o(Mn,{className:"min-w-20",onChange:n,value:{key:String(e)},options:Qh,iconVersion:"black"})]})},tp="py-m @lg:px-lg px-m rounded-md cursor-pointer text-center min-w-10 @lg:min-w-0 hover:bg-primary-hover hover:text-white",np=(e,t)=>{const{currentPage:n,onPageChange:i,totalPages:a}=e,l=t+1;return l===n?o("div",{"aria-current":"true",className:"py-m @lg:px-lg px-m bg-primary-main text-center min-w-10 @lg:min-w-0 text-white rounded-md",children:l},String(t)):1!==l&&l!==a&&((e,t,n)=>e<t&&e>=t-1||e<=t+1&&e>t||((e,t,n)=>t<=2&&e<=t+2||t>=n-1&&e>=n-3)(e,t,n))(l,n,a)?o("div",{onClick:()=>i(l),className:tp,"aria-label":`Страница ${l}`,children:l},String(t)):null},ip={width:"24",height:"24"},ap=({currentPage:e,onPageChange:t,totalPages:n})=>{const i=r((()=>Array.from({length:n}).fill({currentPage:e,onPageChange:t,totalPages:n})),[n,e]),a=l((()=>{e>1&&t(e-1)}),[e]),s=l((()=>{e<n&&t(e+1)}),[e,n]),d=l((()=>t(1)),[]),m=l((()=>t(n)),[n]);return c("div",{className:"flex gap-m items-center",children:[o("div",{onClick:a,children:o(W,{name:"ArrowLeftIcon",iconVersion:"black",imageClassName:lp(1===e),...ip})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:tp,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,i.map(np),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:tp,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(W,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:lp(e===n),...ip})})]})},lp=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",rp=({currentPage:e,onPageChange:t,totalPages:n,itemCount:i,onItemCountChange:a})=>c("div",{className:"mt-3xl flex justify-between flex-col @lg:flex-row items-center select-none",role:"navigation","aria-label":"Пагинация",children:[o(ap,{currentPage:e,onPageChange:t,totalPages:n}),i&&a?o(ep,{itemCount:i,onItemCountChange:a}):null]}),sp=d((({className:e,value:t,autoFocus:n,onChange:i,onFocus:a,placeholder:r="Поиск по сайту"})=>{const s=l((e=>{i&&i(e.target?.value||"")}),[i]);return c("div",{className:u("relative",e),role:"form",children:[o("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:o(ne,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),o("input",{className:u("h-14 w-full px-10 text-l text-black box-border rounded-md",gn),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:n,onChange:s,onFocus:a})]})})),op=d((({field:e,onClearFilter:t,filtrationState:n})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(sp,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(Ul,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(Ul,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период до",minDate:n.startDate,...e("endDate")}),o("div",{className:"col-span-12 @lg:col-span-2 mt-8 @lg:mt-auto",children:o(Oa,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),cp=(e,t)=>o(fd,{...e,iconBgVersion:t,className:"shrink-0"}),dp=({title:e,timestamp:t,publicId:n})=>{const i=he(),{href:a}=i({href:`/api/v1/depository/${n}/file`});return c("div",{className:"flex gap-3 items-center py-lg border-gray border-opacity-50 border-b",children:[cp({icon:"DocDownloadIcon",iconVersion:"black"}),c("div",{className:"flex flex-col gap-x-6xl lg:flex-row lg:items-center",children:[t?o(_e,{size:"text-m","font-weight":"font-light",children:Lt(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:a,download:!0,"aria-label":"Скачать",children:e})]})]},n)},mp="/api/v1/depository",up={startDate:void 0,endDate:void 0,query:""},hp=zt((({className:e,...t})=>{const[n,a]=i(0),[r,s]=i(10),[d,{field:m,reset:h}]=rn(up),{totalPages:p=0,items:f=[]}=(({size:e,page:t,query:n,startDate:i,endDate:a})=>{const l=i?Lt(i,!0):"",r=a?Lt(a,!0):"",s=new URLSearchParams(mp);s.set("page",String(t)),s.set("size",String(e)),s.set("query",n),s.set("timestampStart",l),s.set("timestampEnd",r);const o=`?${s.toString()}`,{data:c}=hi(mp+o,Rt);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:n,...d}),x=l((e=>a(e-1)),[]),y=l((e=>{r!==e?(s(e),a(0)):s(e)}),[]);return c(g,{className:u(e,"container p-6xl"),...t,children:[o(op,{filtrationState:d,field:m,onClearFilter:h}),c("div",{className:"flex flex-col",children:[c("div",{className:"grid grid-cols-12 pb-lg border-gray border-opacity-50 border-b",children:[o("div",{className:"col-span-4 @lg:col-span-2 hidden @lg:block",children:o(_e,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(_e,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),f.length?f.map((e=>o(dp,{...e},String(e.publicId)))):o(hc,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(rp,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:y})]})]})})),pp=e=>"Image"===e?.contentType&&e?.image?o(ne,{image:e.image}):"Code"===e?.contentType&&e.code?o("div",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:e.code}):null,gp=d((({className:e="",title:t,description:n,error:i,button:a,...l})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...l,children:[o("div",{className:"flex justify-center",children:pp(i)}),o(k,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),a?.text?o(ve,{version:a?.version,text:a?.text,...a}):null]})));function fp(e,t){for(const[n,i]of e.entries())null!=i?t.setItem(n,i):t.removeItem(n)}const xp={};function yp(e,t=xp){const n=s(null),o=function(){const[,e]=i(0);return l((()=>e((e=>(e+1)%65536))),[])}();return a((()=>e.bus.watch((e=>{n.current?.has(String(e.type))&&o()}))),[e,o]),r((()=>new Proxy(t,{get:(t,i)=>(n.current||=new Set,n.current.add(i),e.getItem(i)),has:(t,i)=>(n.current||=new Set,n.current.add(i),e.hasItem(i)),set:(t,n,i)=>(e.setItem(n,i),!0),deleteProperty:(t,n)=>(e.removeItem(n),!0)})),[e])}const bp=new class{bus;store=new Map;get size(){return this.store.size}constructor(e=new ce){this.bus=e}hasItem(e){return this.store.has(e)}getItem(e){return this.store.get(e)}entries(){return this.store.entries()}setItem(e,t){this.store.set(e,t),this.bus.subject(e,t)}removeItem(e){this.store.delete(e),this.bus.subject(e,null)}};var vp,Np;function wp(e){return yp(bp,e)}vp=bp,Np=new class{storage;bus;get size(){return this.storage?.length??0}constructor(e,t=new ce){this.storage=e,this.bus=t}hasItem(e){return Boolean(this.storage?.getItem(String(e)))}getItem(e){const t=this.storage?.getItem(String(e))??null;try{return JSON.parse(String(t))}catch(e){return null}}entries(){return Array.from({length:this.size},((e,t)=>{const n=String(this.storage?.key(t));return[n,this.getItem(n)]}))}setItem(e,t){null!==t?this.storage?.setItem(String(e),JSON.stringify(t)):this.storage?.removeItem(String(e)),this.bus?.subject(e,t)}removeItem(e){this.storage?.removeItem(String(e)),this.bus?.subject(e,null)}}(globalThis?.localStorage),fp(vp,Np),fp(Np,vp),vp.bus.watch((({type:e,event:t})=>{null!=t?Np.setItem(e,t):Np.removeItem(e)}));const Cp="/api/v1/region";function Sp(e="Москва"){return wp().location??{name:e}}function kp(e="Москва"){const t=wp(),n=l((async()=>{if(!t.location){const n=await Pt(Cp);t.location=n??{name:e}}}),[t,e]);return hi(Cp,n),t}var Ip;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(Ip||(Ip={}));const Tp=new Intl.NumberFormat("ru",{style:"currency",currency:Ip.RUB}),Bp=e=>e?Tp.format(e):"",Pp="text-m font-light text-secondary-text ",Rp=`${Pp} text-left`,Dp=`${Pp} pl-5xl text-center`,Mp=`${Pp} pl-5xl text-right`,_p={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},Ap=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:Rp,children:o(_e,{size:"text-m",children:"Валюта"})}),o("th",{className:Dp,children:o(_e,{size:"text-m",children:"Купить"})}),o("th",{className:Mp,children:o(_e,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(Ep)})]}))),Ep=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m m-auto flex text-left",children:c("div",{className:"flex items-center gap-xs",children:[t?o(ne,{image:{icon:_p[t]},width:"24",height:"24"}):null,o(_e,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(_e,{size:"text-h6",children:Bp(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(_e,{size:"text-h6",children:Bp(e?.buyExchangeRate)})})]},t)},zp={icon:"GpsIcon"},Fp=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(fd,{...zp,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(C,{size:"text-l",color:"text-primary-main",children:t}):null,o(C,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),Vp=(e,t,n)=>{const i=Number(Op(e))*Math.pow(t,n?-1:1);return Number.isInteger(i)?i:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(i)},Op=e=>e.replace(/[^\d.,]/g,"").replace(",","."),Lp=e=>Zt([[e=>e.value!==Ip.RUB&&e.oppositeValue!==Ip.RUB,()=>e.handleConvert(e.value,Ip.RUB)],[e=>e.value===Ip.RUB&&e.oppositeValue===Ip.RUB,()=>e.handleConvert(e.value,Ip.USD)],[e=>e.value===Ip.RUB&&e.oppositeValue===Ip.RUB,()=>e.handleConvert(e.value,Ip.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function jp(e){const{placeholder:t,rates:n,selected:i,value:a,setValue:l,setSelected:r}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:i,text:i};return c("div",{className:"relative flex",children:[o(xn,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:a,onChange:l}),s.length?o(Mn,{className:"absolute right-0",isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const qp=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:a})=>{const[r,s]=i({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||Ip.RUB,selectBuy:n?.[0]?.currency?.currency||Ip.USD}),d=l((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[t&&n?c("div",{className:"grid gap-m",children:[jp({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:$p(r,d,n),value:r.inputSell,setValue:e=>Wp(d,n)(e,r.selectSell,r.selectBuy)}),jp({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:Up(r,d,t),value:r.inputBuy,setValue:e=>Hp(d,t)(e,r.selectBuy,r.selectSell)})]}):null,a?.text?o(ve,{text:a.text,version:a?.version,...a}):null]})})),$p=(e,t,n)=>i=>{t({selectSell:i}),Lp({value:i,oppositeValue:e.selectBuy,handleConvert:(i=e.selectSell,a=e.selectBuy)=>{Wp(t,n)(e.inputSell,i,a)}})},Up=(e,t,n)=>i=>{t({selectBuy:i}),Lp({value:i,oppositeValue:e.selectSell,handleConvert:(i=e.selectBuy,a=e.selectSell)=>Hp(t,n)(e.inputBuy,i,a)})},Wp=(e,t)=>(n,i,a)=>{e({inputSell:Op(n),selectBuy:a});const l=t.find((e=>e.currency?.currency===a))?.buyExchangeRate||t.find((e=>e.currency?.currency===i))?.buyExchangeRate;l&&e({inputBuy:String(Vp(n,l,i===Ip.RUB)||"")})},Hp=(e,t)=>(n,i,a)=>{e({inputBuy:Op(n),selectSell:a});const l=t.find((e=>e.currency?.currency===a))?.saleExchangeRate||t.find((e=>e.currency?.currency===i))?.saleExchangeRate;l&&e({inputSell:String(Vp(n,l,i===Ip.RUB)||"")})};const Yp=d((({className:e="",title:t="Курсы обмена валют",button:n,...i})=>{const a=function(e){const t=e?.code||"000",{data:n}=hi(`/api/v1/exchangerates?regionCode=${t}`,Rt);return n||{}}(Sp()),l=Kp(a?.exchangeRate?.currencies),r=l.filter((e=>e.buyExchangeRate));r.unshift({currency:{currency:Ip.RUB}});const s=l.filter((e=>e.saleExchangeRate));return s.push({currency:{currency:Ip.RUB}}),o(g,{className:u("box-border min-h-80",e),...i,children:o(Te,{className:"h-full",title:o(w,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap @lg:flex-nowrap",children:[c("div",{className:"w-full @2xl:w-auto @5xl:w-1/2",children:[l?o(Ap,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(Fp,{address:a?.address})]}),o(qp,{className:"grow w-1/2",currencyRatesBuy:r,currencyRatesSell:s,button:n})]})})})})),Kp=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],Gp=d((({className:e="",items:t})=>{const n=he();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(Xp(n))})})),Xp=e=>({dataFooter:t,...n},i)=>{const{text:a,href:l,target:r,onClick:s}=e(n);return a?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:l,target:r||"_self",onClick:s,...ge(t),children:a||null})},String(i)):null},Jp=d((({label:e,labelIconBgVersion:t,icon:n,onToggle:i,labelIcon:a})=>o(Hc,{tag:"button",className:u("border-none bg-transparent items-center group/button",a?.icon?"py-xs":"py-lg"),onClick:i,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[cp(a,t),e?o(_e,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:n?o(W,{name:n,iconVersion:"color",width:"24",height:"24"}):null}))),Zp=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",Qp=(e=!1)=>e?"MinusIcon":"PlusIcon",eg=(e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon",tg=zt((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,label:i="Развернуть",labelIcon:a,labelIconBgVersion:l,foldButtonVersion:r="default",version:s,role:c,...d})=>{const m=Se();return o(g,{className:u("w-full border-0 border-b border-solid border-main-divider last:border-b-0",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:c,...d,children:o(ea,{isFoldButtonOnTop:n,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(ta,{className:u("gap-lg",Zp(m)),isUnfolded:e,children:D({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>ng({foldButtonVersion:r,label:i,labelIcon:a,labelIconBgVersion:l,isUnfolded:e,onToggle:t,isMobile:m})})})}),{childrenTypes:{exclude:["RollupItem"]}}),ng=({foldButtonVersion:e,label:t,labelIcon:n,labelIconBgVersion:i,isUnfolded:a,onToggle:l,isMobile:r=!1})=>{const s=t||(a?"Скрыть":"Развернуть"),c=((e=!1,t=!1)=>t?eg(e):Qp(e))(a,r);return"accordion"===e?o(Jp,{label:s,labelIcon:n,labelIconBgVersion:i,icon:c,onToggle:l}):o(Yc,{label:s,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:l})},ig=d((({navigationItems:e})=>o("div",{className:"w-full",role:"menu",children:ag(e)}))),ag=e=>e?.filter((e=>e.icon?.icon)).map(((e,t)=>o(tg,{foldButtonVersion:"accordion",label:e?.text,labelIcon:e?.icon,role:"menuitem",children:e.items?o(Gp,{items:e.items}):null},String(t)))),lg=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(rg)}):null)),rg=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(_e,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(sg)})]},String(t)),sg=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:og(e.type,e.text)}),o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),og=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${cg(t)}`,children:o(_e,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},cg=e=>e.replaceAll(/\D/g,""),dg=d((({className:e="",index:t,text:n,...i})=>{const a=he(),{href:l,target:r,onClick:s}=a(i);return o("a",{className:u("text-secondary-text",e),href:l,target:r,onClick:s,children:n||`Документ ${t}`})})),mg=d((({className:e="",title:t,links:n})=>o("div",{className:e,children:n?.length?c("div",{className:"flex justify-between lg:items-center flex-col lg:flex-row gap-lg py-lg border-y border-y-main-divider",children:[o("div",{className:"lg:hidden",children:o(_e,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(dg,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),ug=d((({className:e="",index:t,...n})=>{const i=he(),{href:a,target:l,text:r,onClick:s}=i(n);return o("a",{className:u("text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px]",e),href:a,target:l,onClick:s,children:r||`Документ ${t}`})})),hg=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(_e,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} ${n}`})}):null,t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs",children:t.map(((e,t)=>o(ug,{index:t,...e},String(t))))}):null]}))),pg=zt((({className:e,footer:t,...n})=>{const{navigationItems:i}=n.options?.page?.navigation??{};n.options?.page?.common;const{documents:a,relatedEnterprises:l,contacts:r,mediaLinks:s=[],horizontalNavigationTitle:d,feedbackButton:m,license:h,otherLinks:p=[]}=t??{};return c(g,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...n,children:[null,c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(ig,{navigationItems:i}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u("w-full lg:w-52","flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(lg,{items:r}),m?o(ve,{className:"w-full",version:"primary",...m}):null,s.map(((e,t)=>o(fu,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),p.map(((e,t)=>o(ve,{className:"!text-left text-s font-light",version:"link",...e,children:e?.text},String(t))))]})]}),o(mg,{title:d,links:l}),o(hg,{links:a,license:h})]})})),gg=zt((({className:e,title:t,button:n,regionSource:a,data:l,...r})=>{const[s,d]=i({key:""}),m=a?.regions??[],h=oe({className:"text-white",version:n?.version||"primary"}),p=m?.find((e=>e.name===s.key))?.href,f=n?.text?n.text:"Перейти";return o(g,{className:e,defaultPadding:"p-6xl",...r,children:c("div",{className:"container max-w-[978px] space-y-m",children:[t?o(w,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(zn,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,p?o("div",{className:"text-center",children:o(ve,{href:p,target:"_blank",className:u("p-m w-full @xl:w-auto",h),data:hu(l,s?.key),children:f})}):null]})})})),fg={default:"bg-main-divider text-primary-main rounded hover:text-primary-main",transparent:"backdrop-opacity-30 bg-white/30 hover:text-primary-hover text-white"},xg=d((({version:e,text:t,mobileText:n,...i})=>{const a=Se()?n:t;return a?o(ve,{className:u("py-s px-lg font-light whitespace-nowrap",fg["transparent"===e?"transparent":"default"]),...i,children:a}):null})),yg=d((({bgColor:e,logo:t,alwaysShowLogo:n,internetBankButton:i,version:a,backwardButton:r})=>{const s=M(),d="/"===s.pathname,{dataFooter:m,dataHeader:u,...h}=t??{},p=l((()=>{s.back()}),[s]);return c("div",{className:"flex items-center justify-between w-full",children:[n||d?o("div",{children:o(Do,{className:"my-2xs",bgColor:e,logo:h,data:u,showTitle:!1})}):bg(p,r),o(xg,{version:a,...i})]})})),bg=(e,t)=>t?c("button",{className:"flex items-center text-l my-2xs",onClick:e,type:"button","aria-label":"Кнопка назад",children:[o(W,{name:"ChevronLeftIcon",iconVersion:"black",width:"24",height:"24"}),t]}):null,vg={"bg-white":"primary",transparent:"transparent"},Ng=zt((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:n=vg[e],portal:i,logo:a={},...l})=>{const{backwardButton:r,logo:s={}}=l.options?.page?.common??{},{internetBankButton:c}=i||{},d=a.image?.icon||a.image?.src?a:s;return o(g,{tag:"header",defaultPadding:"",version:n,...l,children:o("div",{className:"container px-lg py-2xs box-border",children:o(yg,{bgColor:e,logo:d,alwaysShowLogo:t,internetBankButton:c,version:n,backwardButton:r,...l})})})})),wg=(e=!1)=>e?{}:{padding:"p-0"},Cg={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},Sg=zt((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:i=!0,version:a="transparent",isTheme:l=!1,isCardBorder:r=!1,image:s,...c})=>{const d=M();return o(g,{className:u("relative flex flex-col",Cg[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${J(d)(s?.src)})`}}:{},padding:t,version:a,isTheme:l,...c,children:D({...c,extraProps:{className:u("w-full",pc(r)),...wg(i)}})})}),{childrenTypes:[]}),kg=zt((e=>o(Sg,{...e})),{childrenTypes:[]}),Ig=d((e=>{const{className:t,align:n,image:i,...a}=e,l=n?u("flex",Nd[n]):"";return o(g,{className:u(l,t),defaultPadding:"p-0",...a,children:o(ne,{image:i})})})),Tg=["байт","Кб","Мб","Гб","Тб","Пб"],Bg=d((({icon:e,text:t,href:n,target:i,fileFormat:a,data:l,fileSize:r})=>{const s=r&&a?",":"",d=r??"",m=a?String(a):"";return c("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",href:n,target:i,...ge(l),children:[e,t?c(_e,{size:"text-l",font:"font-light",children:[t," ",Pg(d,m),o(_e,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),Pg=(e,t)=>e||t?o("span",{children:", "}):"",Rg=(e,t)=>(n,i)=>{const a=$(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),l="Attachment"===n?.docType?((e,t=2)=>{if(0===e)return"";const n=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,n)).toFixed(t))} ${Tg[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?Mg(a):n?.fileFormat;return c("div",{role:"listitem",children:[o(Bg,{text:n?.text,target:n?.target,href:a,fileFormat:r,fileSize:l,icon:Dg(t),data:n?.data}),o(De,{__html:n?.__html})]},String(i))},Dg=e=>e?o(ne,{className:"min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md",image:e,width:"24",height:"24"}):null,Mg=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),i=-1!==t?e.substring(t+1):"";return i.includes("/")?i.replace(n,""):i},_g=d((({href:e,__html:t,target:n})=>{const{close:i}=me(),a=M(),r=$(a)(e),s=l((()=>{i()}),[]);return c(sr,{className:"my-6xl min-h-fit w-fit mx-auto",children:[t?o(De,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(ve,{text:"Я согласен",version:"primary",target:n,href:r,onClick:s}),o(Oa,{type:"button",version:"secondary",onClick:s,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]})})),Ag=d((({text:e,href:t,target:n,__html:i,icon:a})=>{if(!e&&!i)return null;const r=(e=>{const{open:t,close:n}=me();return{open:(n={})=>t(o(_g,{...e}),n),close:n}})({__html:i,href:t,target:n}),s=l((()=>r.open()),[r]);return c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[Dg(a),o(_e,{font:"font-light",children:e})]})})),Eg={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},zg=zt((({className:e="",title:t,description:n,align:i="text-center",documents:a,icon:l={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=M();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(k,{title:t,description:n,align:i,headlineVersion:"M",as:"h2",isEmbedded:!0}),a?.length?o("div",{className:u("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",Eg[r]),role:"list",children:a.map(Fg(d,l))}):null]})})),Fg=(e,t)=>(n,i)=>{const a=n?.docType;return""===a?null:"reportSource"in n&&n?.reportSource?.__html?Vg(t)(n,i):Rg(e,t)(n,i)},Vg=e=>(t,n)=>{const i={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(Ag,{...i,icon:e,href:Og(t)?t?.href:t?.attachment?.src}),o(De,{__html:t?.__html})]},String(n)):null},Og=e=>"href"in e,Lg=zt((({className:e,padding:t,align:n="text-left",buttons:i=[],description:a,image:l,__html:r,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const x="secondary"===p?"p-m min-w-32":"min-w-24",y=l?.src?o(ne,{className:"hidden lg:block",image:l}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:p,...f,children:c(Te,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(w,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:y,buttons:je(i,{className:"flex-wrap"}),children:[a?o(_e,{size:"text-xl","font-weight":"font-light",children:a}):null,c("div",{className:u("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[r?o(De,{__html:r,itemSize:"list-m"}):null,o(_e,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),d?.src?o("div",{className:u("flex justify-center bg-white rounded-md @xl:-order-1",x),children:o(ne,{className:"w-fit",image:d})}):null,l?.src?o(ne,{className:"lg:hidden",image:l}):null]})]})})})),jg=(e=[],t={})=>e.filter((({content:e={}})=>sd(t,e))).length,qg=(e,t)=>e===t;const $g=(e=>(t,n)=>t===n||Boolean(t&&n&&Object.keys(t).length===Object.keys(n).length&&Object.entries(t).every((([t,i])=>e(i,n[t])))))(function(...e){return(t,n)=>e.some((e=>e(t,n)))}(qg,((e=qg)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,i)=>e(t,n[i])))))())),Ug=[],Wg={},Hg={primary:"bg-white/30",secondary:"bg-main-divider"},Yg={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},Kg=d((({count:e,version:t="secondary"})=>{const n=Se(),i=n?"bg-main-divider":Hg[t],a=Yg[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",i),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(_e,{size:"text-xs",color:a,children:e})})})),Gg=({text:e,description:t,icon:n,isActive:i,type:a})=>{const l=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white"),text:e?"mb-xs text-xl":"mb-2xs text-l text-primary-text",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal",oldText:"text-m text-center",oldDesc:"text-m-light"}))(i);return c("div",{className:u("cursor-pointer text-left border-b-0 flex gap-2xs"),"aria-label":e,"aria-labelledby":`${e}-label`,children:[n?o(ne,{className:u("h-6 w-6 min-w-6 min-h-6",l.icon),image:{...n,iconVersion:n?.iconVersion??l.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===a?l.text:l.oldText,children:e}),o("div",{className:"animated"===a?l.desc:l.oldDesc,children:t})]})]})},Xg={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},Jg={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},Zg={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},Qg={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},ef=d((({tag:e="div",item:t={},isActive:n=!1,type:i="default",onClick:a})=>{const l=e,{text:r,description:s,icon:d,count:m,tabName:h,...p}=t;return o(l,{className:u("h-12","block flex-1","cursor-pointer",Xg[i],n?Qg[i]:Zg[i]),role:"tablist","aria-label":"Список табов",onClick:a,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?Jg[i]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[Gg({text:r,description:s,icon:d,isActive:n,type:i}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(Kg,{count:m,version:La(n,i)})}):null]})})})),tf=d((e=>o(e?.item?.href?nf:af,{...e}))),nf=d((e=>{const t=he(),n=l((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:i,...a}=t({...e.item,onClick:n});return o(ef,{...e,tag:"a",item:a,onClick:i})})),af=d((({item:e={},onClick:t,...n})=>{const i=l((()=>{t&&t(e)}),[t,e]);return o(ef,{item:e,onClick:i,...n})})),lf=(e,t,n)=>(i,a)=>o(tf,{isActive:i===e,onClick:t,type:n,item:i},String(a)),rf=d((({className:e,tabsType:t="default",items:n=[],activeItem:i,onChange:a})=>o("div",{className:u("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tabpanel","aria-label":"Панель управления табами",children:n.map(lf(i,a,t))}))),sf={categories:[],extraOptions:[],propertyType:[],stage:[]},of=zt((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:i,...a})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=cd(sf,{block:a.block,page:a.options?.page}),f=l(((e=sf)=>p(e)),[]),x=(({hotFilters:e=Ug,filtrationState:t=Wg,blocks:n=Ug,onFiltrationStateChange:i})=>{const a=r((()=>Math.max(0,e.findIndex((e=>$g(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:jg(n,t.filter),version:La(t===e[a])})))),[e,n,a]),o=l((t=>{i(e[s.indexOf(t)].filter)}),[e,s]);return{activeItem:s[a],items:s,onChange:o}})({hotFilters:t,filtrationState:s,blocks:a.block?.blocks,onFiltrationStateChange:f});return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...a,children:[o(rf,{...x}),o(nd,{filtrationSchema:n,resetButton:i,field:m,reset:h}),o(Zc,{blocksToRender:d,...a})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),cf=({location:e,address:t,billAcceptorType:n,terminalType:i,billAcceptorEnable:a,atmCode:l="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:uf(i)},{label:"Модуль приема наличных",value:a?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:l}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(_e,{size:"text-h4",children:uf(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(_e,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(xa,{color:"green",children:uf(s)})})]}),o("div",{className:"hidden sm:block",children:o(ra,{className:"flex-wrap",children:m?.map(mf)})}),o(ea,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ta,{isUnfolded:e,children:o(ra,{className:"flex-wrap",children:m?.map(mf)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Sa({isUnfolded:e,onToggle:t})})]},String(d))},df=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${uf(t)} №${n}`,body:e.toUpperCase()}),mf=(e,t)=>o(na,{...e},String(t)),uf=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",hf=[];const pf=async e=>{const t=await Pt(e,{method:"GET"});return Array.isArray(t)?t:hf},gf={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},ff={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},xf=d((({descriptionData:e,className:t})=>{const n=Sp(),i=n?.code??"000",{data:a,isLoad:l}=function(e){const{data:t,error:n}=hi(`/api/v1/atms?regionCode=${e}`,pf);return{data:t||hf,isLoad:!t&&!n}}(i);return o(Xa,{className:t,filterItems:yf,data:a,isLoad:l,initFilterState:gf,renderCard:cf,getBalloon:df,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),yf=(e,t)=>{const n=Object.keys(t).filter((e=>t[e])),i=n.filter((e=>e.startsWith("terminalType"))),a=n.filter((e=>!i.includes(e)));return e.filter((e=>{const t=a.every((t=>ff[t](e))),n=!i.length||i.some((t=>ff[t](e)));return t&&n}))},bf=({address:e,workScheduleDescription:t},n)=>t?c("div",{className:"bg-white col-span-12 p-3xl sm:border-yellow sm:border",children:[o("div",{className:"sm:flex sm:justify-between",children:c("div",{children:[o(_e,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(_e,{size:"text-l",children:e})]}):null]})}),o("div",{className:"hidden sm:block",children:vf({workScheduleDescription:t})}),o(ea,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ta,{isUnfolded:e,children:vf({workScheduleDescription:t})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Sa({isUnfolded:e,onToggle:t})})]},String(n)):null,vf=({workScheduleDescription:e})=>c("div",{children:[c(ra,{className:"flex",children:[o(na,{label:"Операции для физических лиц",children:o(_e,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(na,{label:"Операции для физических лиц",children:o(_e,{children:"Оформление и обслуживание банковских карт"})}),o(na,{label:"Операции для физических лиц",children:o(_e,{children:"Инвестиционное и накопительное страхование"})}),o(na,{label:"Операции для физических лиц",children:o(_e,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(na,{label:"Режим работы",className:"max-w-none",children:o(_e,{children:e})})]}),Nf=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),wf={branches:[],remoteWorkplaces:[]};const Cf=async e=>await Pt(e,{method:"GET"})||wf,Sf=d((({className:e})=>{const t=Sp(),n=t?.code??"000",{data:i,isLoad:a}=function(e="000"){const{data:t,error:n}=hi(`/api/v1/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,Cf);return{data:t||wf,isLoad:!t&&!n}}(n);return o(Xa,{className:e,data:i?.branches,isLoad:a,remoteWorkplaces:i?.remoteWorkplaces,renderCard:Ba,renderRemoteWorkplaceCard:bf,getBalloon:Ra,getBalloonRemoteWorkplaces:Nf,title:`Офисы филиала ${t?.name}`})})),kf=d((({data:e,className:t,...n})=>{const i=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===i?o(Sf,{}):o(xf,{descriptionData:e})})})),If=d((({className:e,title:t,description:n="Блок в разработке...",...i})=>c(g,{className:u("box-border",e),...i,children:[o(k,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(f,{})]}))),Tf=d((({className:e,padding:t,slides:n=[],...i})=>o(g,{className:u("overflow-hidden relative",e),padding:t,...i,children:o($c,{gap:0,padding:0,children:n.map((e=>e.productBlock)).map(((e,t)=>o("div",{className:"box-border h-full",children:o(Je,{className:"px-5 h-full",headlineVersion:"L",...e,...i})},String(t))))})}))),Bf=d((({address:e,email:t,telephone:n,button:i,className:a="",__html:l,richVersion:r,icon:s,title:d,version:m="primary",...h})=>c(g,{className:u("box-border text-left space-y-s",a),version:m,...h,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[Le(s)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ne,{image:s})}):null,d?o(w,{headingType:"h3",as:"h3",title:d}):null]}),c("div",{className:"w-full space-y-m",children:[l?Pf({__html:l,richVersion:r}):null,Rf({label:"Адрес",data:e,iconName:"GeolocationIcon"}),Rf({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),Rf({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),i?.text?je([i]):null]})]}))),Pf=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(De,{...e,itemSize:"list-s"})}),Rf=({label:e,data:t,iconName:n,dataColor:i=""})=>t?c("div",{className:"flex gap-s",children:[o(W,{iconVersion:"black",name:n,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(_e,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(_e,{size:"text-xl",color:i,children:t})]})]}):null,Df=d((e=>{const{__html:t,richVersion:n="",...i}=e;return o(g,{defaultPadding:"p-0",...i,children:o(De,{__html:t,richVersion:n})})})),Mf=d((({name:e,text:t,value:n,checked:i,onChange:a,className:l})=>o("div",{className:l,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:u(gn.split(" ").filter((e=>"rounded"!==e)),Ci,"flex justify-center items-center after:block after:w-2.5 after:h-2.5 after:rounded-full rounded-full","checked:border-2 checked:!border-primary-main focus:checked:border-primary-main checked:after:bg-primary-main"),type:"radio",value:n,name:e,checked:i,onChange:e=>a?.(e.target.value),role:"radio"}),t?o(_e,{color:"text-primary-text",children:t}):null]})}))),_f=d((({className:e=""})=>{const[t,n]=i("option2"),a=l((e=>n(e)),[]);return c("div",{className:u("order-4",e),role:"radiogroup",children:[o(Mf,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),o(Mf,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),Af=d((({data:e,fieldLabel:t,fieldValue:n,selected:i,placeholder:a="",setSelected:l,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[n||t],text:e?.[t]}))),c=s.find((e=>e.key===i));return o(Mn,{options:s,label:r,placeholder:a||i,onChange:e=>l(e.key),value:c})})),Ef=d((({regions:e=[],selectedRegion:t,onSelectedRegion:n,branches:i=[],selectedBranch:a,onSelectedBranch:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Af,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(Af,{data:i,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:l,label:"Отделение",placeholder:"Выберите отделение"})})]}))),zf=["От 1 дня","До 365 дней"],Ff=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(_e,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(dl,{min:1,max:365,value:e,items:zf,onChange:t})]}))),Vf=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:n,safeBoxCases:i=[],selectedBoxSize:a,onSelectedBoxSize:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Af,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(Af,{data:i,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:l,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),Of=d((({regions:e,selectedRegion:t,branches:n,selectedBranch:i,days:a,selectedCaseVolume:l,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:u})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(Ef,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:i,onSelectedBranch:Lf(m)}),o(Ff,{days:a,setDays:e=>m({days:e})}),o(Vf,{caseVolumes:d,selectedCaseVolume:l,onSelectedCaseVolume:jf(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(_e,{size:"text-l",font:"font-light",color:"text-secondary-text",children:"Тип договора"})}),c("div",{className:"contents @md:flex justify-between items-center gap-m",children:[o(_f,{}),o(ve,{text:"Офисы на карте",version:"primary",onClick:u,className:"order-6"})]})]}))),Lf=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},jf=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},qf=d((({days:e,tariffs:t=[]})=>{const n=Uf(e,t),i="На рисунке изображена пачка листов\nформата А4";return c("div",{className:"contents @xl:flex flex-col justify-between gap-xl order-2",children:[c("div",{className:"flex flex-col @xl:flex-row gap-x-6xl gap-y-2xl order-5 @xl:order-none py-2xl @xl:py-0 border-t border-main-divider @xl:border-none",children:[$f("Аренда за",e),$f("Цена",n+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:i})}),c("div",{className:"flex flex-col items-center gap-s order-3 @xl:order-none mb-xl @xl:mb-0 bg-primary-main py-s @xl:p-3xl text-center",children:[o(ne,{image:{icon:"PackA4Icon"},className:"@xl:h-60"}),o("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:o(C,{size:"text-s",font:"font-light",color:"text-white",children:i})})]})]})})),$f=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(_e,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o("span",{className:"text-l @xl:text-h3 text-primary-text",children:t})]}),Uf=(e,t)=>{const n=Wf(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},Wf=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},Hf=(e,t)=>e.find((e=>e.branchCode===t)),Yf=d((e=>{const{regions:t,data:n,branches:i,onChange:l,onClick:r}=e;a((()=>{l({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,l]);const s=Hf(i,n.selectedBranch),d=Kf(s?.safeBoxCaseVolumes),m=Gf(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=Xf(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(Of,{...n,regions:t,onClick:r,branches:i,caseVolumes:d,safeBoxCases:m,onChange:l}),o(qf,{days:n.days,tariffs:u})]})})),Kf=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Gf=(e,t)=>e?.find((e=>e.volume===t)),Xf=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Jf=[];const Zf=async e=>await Pt(e,{method:"GET"})||Jf,Qf=d((({title:e,footnote:t,className:n="",...a})=>{const[r,s]=i(!1),d=l((()=>s((e=>!e))),[]),[m,u]=i({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),h=Rs(),p=ex(m.selectedRegion,h),f=function(e){const{data:t}=hi(e?`/api/v1/safeboxes?regionCode=${e}`:null,Zf);return t||Jf}(p),x=l((e=>u((t=>({...t,...e})))),[u]),y=(b=Hf(f,m.selectedBranch)||f,Array.isArray(b)?b.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)].filter(Boolean),content:void 0}))).filter((e=>e.coords&&2===e.coords.length)):b?.gpsLatitude&&b?.gpsLongitude?[{coords:[b.gpsLatitude,b.gpsLongitude]}]:[]);var b;return c(g,{className:n,defaultPadding:"",...a,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(w,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(Yf,{regions:h,branches:f,data:{...m,selectedRegion:p},onClick:d,onChange:x}),t?o(C,{size:"text-s",font:"font-light",children:t}):null]}),y.length&&r?o(Hi,{points:y,className:"h-[640px]"}):null]})})),ex=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,tx={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"},nx=(e,t,n)=>(i,a)=>{const{button:l}=i;return o("div",{className:"contents",children:c("div",{className:"flex items-center relative flex-row",children:[o("div",{className:"overflow-hidden flex flex-shrink-0 items-center",children:ix(e,n)(i,a)}),c("div",{className:u("flex flex-col justify-center h-fit w-full",{"min-h-6xl":e}),children:[ax(i),l?.text?o(ve,{className:"box-border py-s w-full max-w-60 mt-lg",version:t,...l,children:l?.text}):null]})]})},String(a))},ix=(e,t)=>(n,i)=>{const a="secondary"===t?"white":"color",l=Boolean(n?.icon?.src),r=lx(e,l),s=l?"transparent"===t:t;return o(g,{className:u("z-10 mr-s flex justify-center content-center rounded-md",r),defaultPadding:"",version:s,children:o("div",{className:"flex max-w-full max-h-full items-center justify-center",children:rx({step:n,iconVersion:a,i:i,stepVersion:t})})})},ax=e=>c("div",{children:[e?.label?o(C,{size:"text-l",align:"text-left",children:e.label}):null,e?.description?o("div",{className:u("text-s font-light text-left",tx.description),children:e.description}):null,o(De,{__html:e.__html})]}),lx=(e,t)=>e&&t?"h-14 w-14":"h-11 w-11",rx=({step:e,iconVersion:t,i:n,stepVersion:i})=>{return Le(e?.icon)?o(ne,{image:{...e.icon,iconVersion:e.icon?.iconVersion||t},imageClassName:"max-w-full max-h-full",width:"24",height:"24"}):o("span",{className:u("text-h4","transparent"===i?tx.iconText:(a=i,"secondary"===a?"group-data-primary:text-white":"text-secondary-text")),children:n+1});var a},sx=d((({className:e="",title:t,description:n,steps:i=[],buttons:a,stepVersion:l="gray",version:r="primary",...s})=>{const d=i.length>3;return c(g,{className:u("box-border flex flex-col gap-xl",e),defaultPadding:"p-6xl",version:r,...s,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-left"}),i?.length?o("div",{className:"flex flex-col gap-6xl justify-between box-border",children:i.map(nx(d,r,l))}):null,je(a,{isVertical:!0})]})})),ox=d((({isActive:e,item:t,onClick:n})=>c("div",{className:u(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),title:t?.title||"",onClick:n,children:[o(W,{className:"w-6 h-6",name:t?.icon?.icon,iconVersion:e?"color":"black"}),t?.title||""]}))),cx=d((({className:e,head:t,children:n,onClose:i,onClick:a})=>{const{close:r}=me(),s=l((()=>{r(),i&&i()}),[i]);return c("div",{onClick:a,className:u("relative min-h-full bg-white p-0 rounded-xl top-32",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 rounded-xl bg-white z-10",children:[o(rr,{className:"absolute top-1.5 right-0",onClose:s}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})})),dx=({menuRef:e,dialogRef:t,closeDialog:n,openDialog:i,leftItems:a,rightItems:l})=>[{openBottomMenuItemDialog:(r,s)=>{const c="left"===s?a:l,d=e?.current?.getBoundingClientRect();i(o(cx,{onClick:e=>e.stopPropagation(),onClose:n,className:"mt-[20%] border-t border-current",head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:c[r].description||c[r].title})}),children:o("div",{className:"bg-white pb-20 pt-1 text-l",ref:t,children:o("iframe",{id:"iframe-dialog",onLoad:()=>(()=>{const e=document.getElementsByTagName("iframe")["iframe-dialog"];e.style.height=String(e?.contentWindow?.document.body.offsetHeight)+"px"})(),src:c[r]?.src,width:d?.width||0})})}),{id:"left"===s?a[r].title:l[r].title})}}];function mx(e){throw new Error(e)}const ux=({onCloseAll:e,onClose:t}={})=>{const[n,{push:r,pop:s,clear:o}]=function(e=[]){const[t,n]=i(e),a=l((e=>n((t=>[...t,e]))),[]),r=l((()=>n((e=>e.slice(0,-1)))),[]),s=l((e=>n((t=>t.filter((t=>t!==e))))),[]),o=l((()=>n([])),[]);return[t,{setList:n,push:a,pop:r,remove:s,clear:o}]}(),c=l((()=>{e&&e(n),o()}),[n,e]),d=l((()=>{t&&t(n[n.length-1]),s()}),[n,t]);return a((()=>de.subscribe("dialog",(e=>{if(e)switch(e.type){case"open":r(e);break;case"close":e.all?c():d();break;default:mx(e)}}))),[c,d]),n},hx=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:i,s2Matches:a}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),i=Array.from({length:e.length}),a=Array.from({length:t.length});let l=0;for(let r=0;r<e.length;r++){const s=Math.max(0,r-n),o=Math.min(r+n,t.length-1);for(let n=s;n<=o;n++)i[r]||a[n]||e[r]!==t[n]||(l++,i[r]=!0,a[n]=!0)}return{m:l,s1Matches:i,s2Matches:a}}(e,t);if(0===n)return 0;const l=function(e,t,{s1Matches:n,s2Matches:i}){let a=0;for(let l=0,r=0;l<e.length;l++){if(!n[l])continue;let s=r;for(;s<t.length;s++)if(i[s]){r=s+1;break}e[l]!==t[s]&&a++}return a}(e,t,{s1Matches:i,s2Matches:a}),r=(n/e.length+n/t.length+(n-l/2)/n)/3,s=r>.7?.1*function(e,t){let n=0;for(;e[n]===t[n]&&n<4;)n++;return n}(e,t):0;return r+s*(1-r)};const px=e=>e?.length?c("div",{className:"sm:border-t sm:border-main-divider mt-2xs pt-2xs",children:[o("div",{className:"mb-m",children:o(_e,{size:"text-m",font:"font-light",color:"text-secondary-text",children:"Представительства за рубежом:"})}),o("div",{className:"flex flex-col sm:flex-row gap-5xl",children:e.map(((e,t)=>o(gx,{...e},String(t))))})]}):null,gx=d((({icon:e,...t})=>{const n=he(),{text:i,target:a,href:l,onClick:r}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ne,{image:e}):null,i?o("a",{className:"hover:text-primary-hover",href:l,target:a,onClick:r,children:o(_e,{size:"text-l",font:"font-light",color:"text-primary-text",children:i})}):null]})})),fx=(e,t)=>n=>n.name?o(pu,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:hu(e,n.name),children:o(_e,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,xx=d((({className:e,searchTerm:t,onSearch:n})=>c("form",{className:`font-sans relative ${e}`,children:[o("div",{className:"absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none",children:t?null:o("label",{htmlFor:"search-bar-input",className:"text-secondary-text ",children:"Поиск по филиалам"})}),o("input",{id:"search-bar-input",className:u(gn,"h-12 pl-m w-full peer text-l text-black rounded-md box-border"),value:t,onChange:e=>n(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),yx=d((({defaultLocation:e})=>{const t=Sp(e),n=he(),{href:i}=n({href:`/branches/${t.slug}`});return t?o("div",{className:"mb-s",children:c(C,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(pu,{href:i,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),bx=d((({foreignOffices:e,branches:t})=>{const n=kp(t?.default),[a,s]=i(""),d=Rs(),m=r((()=>Nx(d).sort(((e,t)=>e.name.localeCompare(t.name)))),[d]),u=r((()=>((e,t)=>{const n=new Map;for(const i of e){const e=t(i),a=n.get(e)||[];n.set(e,[...a,i])}return n})(m,vx)),[m]),{close:h}=me(),p=l((e=>{n.location=e,h()}),[n]);return c(sr,{className:"pb-20",head:c("div",{children:[o(_e,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(yx,{defaultLocation:t?.default}),o(xx,{onSearch:s,searchTerm:a})]}),children:[a&&a.length>=3?o("div",{children:m.filter((({name:e})=>e&&hx(e.toLowerCase())(a.toLowerCase())>=.8)).map(fx(t?.dataSelect,p))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(u.entries()).map((g=p,f=t?.dataSelect,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(_e,{size:"text-h6",children:e})}),t.map(fx(f,g))]},e)))}),px(e)]});var g,f})),vx=e=>e.name?.charAt(0)??"",Nx=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),wx=d((({menuRef:e,menuItem:t,locationDialogProps:n,closeAll:i})=>{const l=(e=>{const{open:t,close:n}=me();return{open:(n={})=>t(o(bx,{...e}),n),close:n}})(n||{}),{name:r}=Sp(),s=e?.current?.getBoundingClientRect(),c=X(G.SITE_URL);return a((()=>{globalThis.frames["burger-menu-iframe"].postMessage({type:"currentLocation",data:r},"*")}),[r]),a((()=>{const e=e=>{if("location"===e.data.type&&l.open(),"reload"===e.data.type&&i(),"resize"===e.data.type){const t=document.getElementsByTagName("iframe")["iframe-dialog"];t&&t.style&&(t.style.height=String(e.data.data)+"px")}};return globalThis.addEventListener("message",e),()=>{globalThis.removeEventListener("message",e)}}),[]),o(cx,{onClick:e=>e.stopPropagation(),head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:t?.title,className:"font-medium"})}),children:o("div",{className:"bg-white pb-20 pt-1 text-l",children:o("iframe",{id:"iframe-dialog",name:"burger-menu-iframe",onLoad:()=>(()=>{const e=globalThis.frames["burger-menu-iframe"],t=document.getElementsByTagName("iframe")["iframe-dialog"];t.style.height=String(t?.contentWindow?.document.body.offsetHeight)+"px",e.postMessage({type:"currentTab",data:c?.slice(1)},"*"),e.postMessage({type:"currentLocation",data:r},"*")})(),src:t?.src,width:s?.width||0})})})})),Cx="burgerMenuDialog",Sx=({menuRef:e,centralMenuItem:t,closeAll:n,openDialog:i,locationDialogProps:a})=>{const l=ux(),r=((e,t)=>Boolean(t.find((t=>t.id===e),e)))(Cx,l);return[r,{toggle:()=>{r?n():i(o(wx,{locationDialogProps:a,menuRef:e,menuItem:t,closeAll:n}),{id:Cx})}}]},kx=[],Ix=zt((({sticky:e,...t})=>{const{menuItems:n=kx}=e??{},a=n.find((e=>"Меню"===e.title)),r=n.filter((e=>"Меню"!==e.title)),d=Math.floor(r.length/2),m=r.slice(0,d),u=r.slice(d),[h,p]=i(-1),[f,x]=i(""),{open:y,closeAll:b}=me(),v=l((()=>{p(-1),x(""),b()}),[b]),N=un(v),w=s(null),[C,{toggle:S}]=Sx({menuRef:w,centralMenuItem:a,closeAll:b,openDialog:y,locationDialogProps:t.header}),[{openBottomMenuItemDialog:k}]=dx({menuRef:w,dialogRef:N,closeDialog:v,openDialog:y,leftItems:m,rightItems:u}),I=l((e=>{v(),e.stopPropagation(),S()}),[v,S]),T=l(((e,t)=>{x(t),p(e),b(),k(e,t)}),[b,k]);return o(g,{className:"h-[74px] z-[100] relative",defaultPadding:"p-0",...t,children:c("div",{ref:w,className:"ml-auto container bg-white flex justify-center shadow-blue-gray",children:[m.map(Tx(T,"left",{activeIndex:h,currentItemPosition:f})),o(ox,{item:a,isActive:C,onClick:e=>I(e)}),u.map(Tx(T,"right",{activeIndex:h,currentItemPosition:f}))]})})})),Tx=(e,t,n)=>(i,a,l)=>o(ox,{item:i,isActive:l[n.activeIndex]?.title===i?.title&&n.currentItemPosition===t,onClick:r=>{l[n.activeIndex]?.title===i?.title&&n.currentItemPosition===t||r.stopPropagation(),e(a,t)}},i.title||String(a)),Bx="hidden sm:flex absolute z-40",Px={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},Rx=d((({className:e,items:t=[],activeItem:n,onChange:i,tabsType:l="default"})=>{const[r,s]=Mc({itemCount:t?.length||0});return a((()=>Dx(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(bc,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:Px[l].item,gap:Px[l].gap,children:t.map(lf(n,i,l))}),s.canScrollLeft?o(Fc,{className:u("left-6",Bx,Px[l].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(Vc,{className:u("right-6",Bx,Px[l].buttonTop),onClick:s.scrollRight}):null]})})),Dx=(e,t,n)=>{const i=t.findIndex((e=>e===n));e&&i>0&&e.scrollTo({left:e?.children[i]?.offsetLeft,behavior:"smooth"})},Mx={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},_x=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(Mx[t].wrapper,e),children:o(Rx,{className:Mx[t].component,tabsType:t,...n})}):null,Ax=zt((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=Ex(n??{}),p=M(),f=t.every((e=>"link"===e?.type)),x=s?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,{isReady:y}=p,[b,v]=i(Vx(x,((e="")=>{const t=globalThis?.location?.href;return t?new URL(t).searchParams.get(e):null})(h))),N=x[b],w=x.findIndex((e=>Boolean(e.selected)));a((()=>{const e=p.query[h]?x.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===p.query[h])):w;v(-1===e?0:e)}),[y,w,h]);const C=Fx(x[b],b),S=l((e=>{const t=x.indexOf(e),n=x[t];v(t),"group"===n.type&&((e,t)=>{const n=new URLSearchParams(p.query);e.text?n.set(h,e?.tabName??String(t)):n.delete(h),p.replace(`${p.pathname}?${n}`,"",{scroll:!1})})(e,t)}),[x]);return c(g,{className:u({"sticky top-1 z-20":d&&f},e),defaultPadding:"p-0",block:n,...m,children:[_x({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:zx(t,x),activeItem:N,tabsType:r,onChange:S}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:Object.entries(n?.slots??{}).map((([e,t])=>R(t,{...m?.options,slotName:C,parent:n,extraProps:{className:e===C?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(Fx)?.filter(Boolean)||[]}),Ex=({__id:e,anchor:t})=>t??e??"tabs",zx=(e,t)=>t?.length?t:e,Fx=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",Vx=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),Ox={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},Lx=d((({children:e,activeIndex:t,columnWidth:n,version:i="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:Ox[i],style:{transform:`translateX(-${t*n}px)`},children:e})}))),jx=d((({className:e="",isOpen:t,onClick:n})=>o(ve,{className:e,appendRight:o(ne,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"24",height:"24"}),text:t?"Скрыть":"Показать",version:"gray",onClick:n}))),qx={Buttons:({buttons:e})=>je(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ne,{image:e}):null,RichText:({__html:e,isDotted:t=!0})=>o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(De,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(_e,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(_e,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:i,isOpen:a})=>e?o(jx,{className:"w-fit",isOpen:a,onClick:()=>{t({tableSource:n,pdfUrl:i})}}):null},$x=d((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:l,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=i(!0);a((()=>{l===o&&s||m(!0)}),[s,o]);return Ux({cell:e,cellProps:{rowIdx:n,cellIdx:l,fieldIdx:t,displayTable:e=>{m(!1),c(l),r(e)},isVisible:d}})})),Ux=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...i}=e;if(!n||!(n in qx))return null;return o(qx[n],{...t,...i})},Wx=d((({cells:e,rowIdx:t,cellIdx:n,setTableInner:i,tableInner:a,openTableInnerIdx:l,setOpenTableInnerIdx:r})=>o("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>o($x,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:i,tableInner:a,openTableInnerIdx:l,setOpenTableInnerIdx:r},String(s)))):null}))),Hx=(e,t)=>140*((e=[])=>e.reduce(((e,t)=>e+t),0))(e.slice(0,t).map((e=>e?.cols?.length??1))),Yx=(e,t)=>e?.length>0?o("div",{className:u("flex",{"text-secondary-text":0===t}),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(_e,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,Kx=d((({rows:e})=>{return o(bc,{visibleItemCount:0,snapAlign:"snap-start",children:o("div",{children:e?.map((t=0,(e,n)=>{if(!e?.length)return null;const[i,...a]=e,l=u("flex duration-1000 text-center",0!==n?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[i?.data?o("div",{className:"whitespace-pre-wrap sm:whitespace-normal w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(_e,{size:"text-xl",font:"font-light",children:i.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:l,style:{transform:`translateX(-${Hx(a,t)}px)`},children:a?.map(((e,n)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(_e,{size:"text-xl",children:e.data}):null,e?.cols?Yx(e.cols,t):null]},`row${n}`)))})})]},String(n))}))})});var t})),Gx=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const i=`activeTabIdx:${e}-tableIdx:${n}`;return c("div",{className:"w-full @container",children:[o("div",{className:"flex py-m sm:px-m bg-white @4xl:bg-gray relative",children:o(_e,{size:"text-xl",align:"text-left",children:t.title})}),o("div",{className:"w-full sm:pl-xs overflow-hidden transition-height duration-500 ease-in-out",children:o("div",{className:"relative",children:o(Kx,{rows:t.rowsData})})})]},i)}))}))),Xx=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Jx=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:i})=>c("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?o("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>o("div",{className:u("rounded-md px-4 py-3 cursor-pointer",{"bg-primary-main":t===n}),onClick:()=>i(t),children:o(_e,{size:"text-xl",font:"font-light",color:Xx(t===n),children:e||t+1})},e)))}):null,t?o(ve,{className:"text-primary-main",href:t,version:"link",target:"_blank",appendLeft:o(W,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),Zx=zt((({tableSource:e,pdfUrl:t,onClick:n})=>{const a=e?.tableData,[r,s]=i(0),d=l((e=>s(e)),[]),m=a?.[r]?.items??[],u=a?.map((e=>e.currency??""));return c("div",a?{className:"bg-white z-10",children:[o(Jx,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(Gx,{activeTabIndex:r,items:m}),o(jx,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(_e,{size:"text-h6",children:"Данных нет"}),o(jx,{onClick:n,isOpen:!0})]})})),Qx=d((({children:e,tableInner:t,onHideContentClick:n})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:u("@4xl:border-main-divider @4xl:border-b","flex flex-col @4xl:flex-row gap-y-xs gap-x-5xl pb-lg @4xl:pt-lg"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(Zx,{...t,onClick:n})}):null]}))),ey=d((({row:{header:e,data:t},activeIndex:n,rowIdx:a,...r})=>{const[s,d]=i(void 0),m=l((e=>d(e)),[]),[h,p]=i(void 0),g=l((e=>p(e)),[]);return c(Qx,{onHideContentClick:()=>d(void 0),tableInner:s,...r,children:[o("div",{className:u("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(ne,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(_e,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(Lx,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(Wx,{cells:e,rowIdx:a,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})}));function ty({dec:e,inc:t,canDec:n,canInc:i,btnClass:a,className:l=""}){return n||i?c("div",{children:[n?o(zc,{className:u("absolute z-40",a[0],l),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!n}):null,i?o(zc,{className:u("absolute z-40 rotate-180",a[1],l),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!i}):null]}):null}const ny=d((({children:e,controls:t})=>{const{isScrollAvailable:n}=t;return c("div",{role:"table",className:"overflow-x-auto w-auto grid md:block",children:[c("div",{className:"relative space-y-xs",children:[e,ty({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),n?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),iy=d((({className:e="",title:t,description:n,rowHeaders:a,tariffsColumns:r,hiddenRowsNum:s=0,...d})=>{const m=r?.map((({data:e})=>e))||[],h=a?.map(((e,t)=>({header:e,data:m.map((e=>e?.[t]||[]))}))),p=m.length,[f,x]=((e,t=0)=>{const{itemCount:n,visibleItemCount:a}=e,[r,s]=i(t),o=l((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=l((()=>s((e=>Math.max(e-1,0)))),[n]),d=a?n>a&&r<n-a:r<n-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]})({itemCount:p,visibleItemCount:2}),y=(h||[]).map(((e,t)=>o(ey,{row:e,activeIndex:f,rowIdx:t,...d},String(t)))),[b,v]=s>0?[y.slice(0,-s),y.slice(-s)]:[y,[]];return c(g,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...d,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:s>0?o(ea,{renderFoldableSection:({isUnfolded:e})=>c(ny,{controls:x,children:[b,o(ta,{isUnfolded:e,children:v})]}),renderFoldButton:Kc}):o(ny,{controls:x,children:y})})]})})),ay=d((({className:e="",title:t,description:n,iconVersion:i,__html:a,richVersion:l,...r})=>c(g,{className:u("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...r,children:["small"===i?ly():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(_e,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?ry(n):null,a?o(De,{richVersion:l,__html:a}):null]})]}))),ly=()=>o("div",{className:"rounded-full h-4 w-4 text-center text-xs font-light bg-primary-main text-white group-data-secondary:bg-white group-data-secondary:text-primary-main",children:"i"}),ry=e=>o(C,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),sy=d((({prefix:e,unit:t,suffix:n})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(_e,{size:"text-h2",children:e})}):null,t?o("div",{className:"-mb-6 @xl:-mb-4",children:o("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,n?o("div",{className:"gradient-color-text",children:o(_e,{size:"text-h2",children:n})}):null]}))),oy=d((e=>{const{prefix:t,unit:n,suffix:i,...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(sy,{prefix:t,unit:n,suffix:i})})})),cy={AdTile:Vt,ApplicationForm:ho,ApplicationLeadForm:uc,BankAccountFiltration:ud,BenefitsBlock:xd,BonusBenefitsBlock:vd,ButtonsBlock:wd,CalculatorBonus:Fd,CalculatorBusinessDeposit:em,CalculatorCredit:gm,CalculatorDeposit:_m,CalculatorRefinancing:jm,CardTransfer:Km,Carousel:nu,CarouselCard:ru,CarouselCatalogCard:ou,CarouselLinks:mu,CarouselRecommendationCard:bu,CarouselTariffsCard:wu,CreditCardForm:dh,CreditForm:Wh,DepositFiltration:Xh,Depository:hp,ErrorBlock:gp,ExchangeRateTile:Yp,Footer:pg,GrantSupport:gg,Header:Ng,Headline:k,HorizontalLayout:kg,ImgBlock:Ig,LinkDocs:zg,MobileAppTile:Lg,MortgageFiltration:of,OfficesAtmsMap:kf,Placeholder:If,ProductBlock:Ft,ProductGallery:Tf,RepresentativeOfficeInfo:Bf,RichTextBlock:Df,RollupItem:tg,SafeDepositRental:Qf,StepsBlock:sx,StickyBottomMenu:Ix,TabsLayout:Ax,TariffsTable:iy,TextBlock:ay,UnitBlock:oy,VerticalLayout:Sg},dy=ue((()=>{a((()=>{Gt()}),[]);const e=an();mn(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const i=JSON.parse(n?.dataset?.aspects??"[]");Yt({aspectsAttributes:i,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))}));const my="cookie",uy=d((({__html:e})=>{const[t,{setTrue:n,setFalse:i}]=dn();!function(e,t,n=300){a((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}((()=>{globalThis.localStorage?.getItem(my)||n()}),[],3e3);const r=l((()=>{globalThis.localStorage?.setItem(my,"true"),i()}),[]);return t&&e?o("div",{className:"container fixed left-0 right-0 bottom-0 z-50",role:"dialog",children:c("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[o("div",{className:"sm:flex-1",children:o(De,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(rr,{className:"bg-main-gray rounded-md w-11 h-11",onClose:r})})]})}):null})),hy=d((()=>{const e=l((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=l((e=>{e?.onClose&&e.onClose()}),[]),n=ux({onCloseAll:e,onClose:t}),{close:i}=me(),r=l((({key:e})=>{"Escape"===e&&i()}),[]);return mn(globalThis.document,"keydown",r),a((()=>{n.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"))}),[n]),n.length?o("div",{className:"fixed inset-0 z-50",role:"dialog",children:n.map((({dialog:e,id:t},i)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:i!==n.length-1}),children:e},String(t||i))))}):null})),py=d((()=>{const[e,t]=i(null),n=l((()=>{t(null)}),[]);a((()=>de.subscribe("popup",(e=>{if(e)switch(e.type){case"open":case"update":t(e);break;case"close":n();break;default:mx(e)}}))),[]);const r=l((({key:e})=>{"Escape"===e&&n()}),[n]);return mn(globalThis.document,"keydown",r),e?o("div",{className:u("z-50",e.fixed?"fixed":"absolute"),style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",children:e.popup}):null})),gy="header",fy="footer",xy="sticky-footer",yy={},by=d((({className:e,data:t=yy,blocksRegistry:n,blockDecorator:i})=>{const{slots:a,blocks:l,fallback:r,...s}=t,d=Et(s,r);dy(),kp();const m={key:"",page:{slots:a,blocks:l,fallback:r,...d},blocksRegistry:n,blockDecorator:i,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:u("@container relative",t.style,e),children:[a?.header?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:R(a?.header,{...m,slotName:gy})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[D({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),R(a?.footer,{...m,slotName:fy})]})]}),a?.["sticky-footer"]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:R(a?.["sticky-footer"],{...m,slotName:xy})}):null,o(hy,{}),o(py,{}),o(uy,{__html:d?.cookieContent?.__html})]})}));Object.assign(by,{childrenTypes:[],slots:()=>[gy,fy,xy]});e.Blocks=cy,e.ContentPage=by,e.handlerDecorator=ue,e.joinList=ed,e.packageVersion="0.14.676",e.projectSettings=A,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=L,e.useNavigator=ku,e.useRouter=M,Object.defineProperty(e,"__esModule",{value:!0})}));
|