@redneckz/wildless-cms-uni-blocks 0.14.648 → 0.14.650
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/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +34 -6
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
- package/bundle/components/CreditForm/formStateMap.d.ts +1 -0
- package/bundle/ui-kit/FormField/Fields/ConfirmationIncomeField.d.ts +2 -0
- package/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
- package/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/dist/components/CreditForm/creditFormStepsData.js +4 -0
- package/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/dist/components/CreditForm/formStateMap.d.ts +1 -0
- package/dist/components/CreditForm/formStateMap.js +1 -0
- package/dist/components/CreditForm/formStateMap.js.map +1 -1
- package/dist/components/CreditForm/getThirdStepData.js +2 -1
- package/dist/components/CreditForm/getThirdStepData.js.map +1 -1
- package/dist/components/CreditForm/useCreditFormAPI.js +12 -1
- package/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/ConfirmationIncomeField.d.ts +2 -0
- package/dist/ui-kit/FormField/Fields/ConfirmationIncomeField.js +11 -0
- package/dist/ui-kit/FormField/Fields/ConfirmationIncomeField.js.map +1 -0
- package/dist/ui-kit/FormField/Fields/PartInBusinessField.js +3 -2
- package/dist/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -1
- package/dist/ui-kit/FormField/Fields/SnilsField.js +4 -1
- package/dist/ui-kit/FormField/Fields/SnilsField.js.map +1 -1
- package/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/dist/ui-kit/FormField/getField.js +2 -0
- package/dist/ui-kit/FormField/getField.js.map +1 -1
- package/dist/ui-kit/FormField/getObjectValidator.js +1 -0
- package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
- package/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/lib/components/CreditForm/creditFormStepsData.js +4 -0
- package/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/lib/components/CreditForm/formStateMap.d.ts +1 -0
- package/lib/components/CreditForm/formStateMap.js +1 -0
- package/lib/components/CreditForm/formStateMap.js.map +1 -1
- package/lib/components/CreditForm/getThirdStepData.js +2 -1
- package/lib/components/CreditForm/getThirdStepData.js.map +1 -1
- package/lib/components/CreditForm/useCreditFormAPI.js +12 -1
- package/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/ConfirmationIncomeField.d.ts +2 -0
- package/lib/ui-kit/FormField/Fields/ConfirmationIncomeField.js +9 -0
- package/lib/ui-kit/FormField/Fields/ConfirmationIncomeField.js.map +1 -0
- package/lib/ui-kit/FormField/Fields/PartInBusinessField.js +3 -2
- package/lib/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -1
- package/lib/ui-kit/FormField/Fields/SnilsField.js +4 -1
- package/lib/ui-kit/FormField/Fields/SnilsField.js.map +1 -1
- package/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/lib/ui-kit/FormField/getField.js +2 -0
- package/lib/ui-kit/FormField/getField.js.map +1 -1
- package/lib/ui-kit/FormField/getObjectValidator.js +1 -0
- package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +34 -6
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
- package/mobile/bundle/components/CreditForm/formStateMap.d.ts +1 -0
- package/mobile/bundle/ui-kit/FormField/Fields/ConfirmationIncomeField.d.ts +2 -0
- package/mobile/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
- package/mobile/dist/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/dist/components/CreditForm/creditFormStepsData.js +4 -0
- package/mobile/dist/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/mobile/dist/components/CreditForm/formStateMap.d.ts +1 -0
- package/mobile/dist/components/CreditForm/formStateMap.js +1 -0
- package/mobile/dist/components/CreditForm/formStateMap.js.map +1 -1
- package/mobile/dist/components/CreditForm/getThirdStepData.js +2 -1
- package/mobile/dist/components/CreditForm/getThirdStepData.js.map +1 -1
- package/mobile/dist/components/CreditForm/useCreditFormAPI.js +12 -1
- package/mobile/dist/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/ConfirmationIncomeField.d.ts +2 -0
- package/mobile/dist/ui-kit/FormField/Fields/ConfirmationIncomeField.js +11 -0
- package/mobile/dist/ui-kit/FormField/Fields/ConfirmationIncomeField.js.map +1 -0
- package/mobile/dist/ui-kit/FormField/Fields/PartInBusinessField.js +3 -2
- package/mobile/dist/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/Fields/SnilsField.js +4 -1
- package/mobile/dist/ui-kit/FormField/Fields/SnilsField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/dist/ui-kit/FormField/getField.js +2 -0
- package/mobile/dist/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js +1 -0
- package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.d.ts +1 -0
- package/mobile/lib/components/ApplicationLeadForm/getInitialFormState.js.map +1 -1
- package/mobile/lib/components/CreditForm/creditFormStepsData.js +4 -0
- package/mobile/lib/components/CreditForm/creditFormStepsData.js.map +1 -1
- package/mobile/lib/components/CreditForm/formStateMap.d.ts +1 -0
- package/mobile/lib/components/CreditForm/formStateMap.js +1 -0
- package/mobile/lib/components/CreditForm/formStateMap.js.map +1 -1
- package/mobile/lib/components/CreditForm/getThirdStepData.js +2 -1
- package/mobile/lib/components/CreditForm/getThirdStepData.js.map +1 -1
- package/mobile/lib/components/CreditForm/useCreditFormAPI.js +12 -1
- package/mobile/lib/components/CreditForm/useCreditFormAPI.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/ConfirmationIncomeField.d.ts +2 -0
- package/mobile/lib/ui-kit/FormField/Fields/ConfirmationIncomeField.js +9 -0
- package/mobile/lib/ui-kit/FormField/Fields/ConfirmationIncomeField.js.map +1 -0
- package/mobile/lib/ui-kit/FormField/Fields/PartInBusinessField.js +3 -2
- package/mobile/lib/ui-kit/FormField/Fields/PartInBusinessField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/Fields/SnilsField.js +4 -1
- package/mobile/lib/ui-kit/FormField/Fields/SnilsField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
- package/mobile/lib/ui-kit/FormField/getField.js +2 -0
- package/mobile/lib/ui-kit/FormField/getField.js.map +1 -1
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js +1 -0
- package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
- package/mobile/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -0
- package/mobile/src/components/CreditForm/creditFormStepsData.tsx +4 -0
- package/mobile/src/components/CreditForm/formStateMap.tsx +3 -0
- package/mobile/src/components/CreditForm/getThirdStepData.ts +2 -0
- package/mobile/src/components/CreditForm/useCreditFormAPI.tsx +15 -2
- package/mobile/src/ui-kit/FormField/Fields/ConfirmationIncomeField.tsx +18 -0
- package/mobile/src/ui-kit/FormField/Fields/PartInBusinessField.tsx +5 -1
- package/mobile/src/ui-kit/FormField/Fields/SnilsField.tsx +11 -7
- package/mobile/src/ui-kit/FormField/NameFieldDef.ts +2 -1
- package/mobile/src/ui-kit/FormField/getField.tsx +2 -0
- package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +1 -0
- package/package.json +1 -1
- package/src/components/ApplicationLeadForm/getInitialFormState.tsx +1 -0
- package/src/components/CreditForm/creditFormStepsData.tsx +4 -0
- package/src/components/CreditForm/formStateMap.tsx +3 -0
- package/src/components/CreditForm/getThirdStepData.ts +2 -0
- package/src/components/CreditForm/useCreditFormAPI.tsx +15 -2
- package/src/ui-kit/FormField/Fields/ConfirmationIncomeField.tsx +18 -0
- package/src/ui-kit/FormField/Fields/PartInBusinessField.tsx +5 -1
- package/src/ui-kit/FormField/Fields/SnilsField.tsx +11 -7
- package/src/ui-kit/FormField/NameFieldDef.ts +2 -1
- package/src/ui-kit/FormField/getField.tsx +2 -0
- package/src/ui-kit/FormField/getObjectValidator.tsx +1 -0
package/bundle/bundle.umd.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniBlocks={})}(this,(function(e){"use strict";let t;const n=e=>(...n)=>t[e](...n),l=n("useState"),a=n("useEffect"),i=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:l,...a}=t||{},i=n?.slots?.default,r=l||i&&i();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:l="p-xl",padding:a,block:i,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||l,e),...m?{"data-ver":t}:{},...i?.anchor?{id:i.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)=>y(100,e).map((e=>Math.floor(e))).map(b),b=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),y=(e,t)=>[e].concat(t>0?y(e/1.618,t-1):[]),v={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},N=d((({className:e="",headingType:t="h3",as:n="h3",title:l,children:a})=>o(n,{role:"heading",className:u("font-sans m-0",v[t],e),children:l||a}))),w=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),C={XXL:{title:{headingType:"h0",as:"h1"},descriptionSize:"text-h5",descriptionWeight:"font-normal",descriptionStyle:"mt-xl"},XL:{title:{headingType:"h1",as:"h1"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},L:{title:{headingType:"h2",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},M:{title:{headingType:"h3",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-s"},S:{title:{headingType:"h4",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-xs"},XS:{title:{headingType:"h5",as:"h2"},descriptionSize:"text-m",descriptionWeight:"font-light",descriptionStyle:"mt-xs"}},k=d((({className:e,version:t="",headlineVersion:n="XL",title:l,description:a,align:i="text-center",as:r,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=C[n],p={marginTop:h.descriptionStyle};return c(g,{className:u({"@container-normal":s},e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[l?o(N,{className:u("whitespace-pre-wrap",i),...h?.title,as:r||h?.title.as,title:l}):null,a?o(w,{size:h.descriptionSize,font:h.descriptionWeight,align:i,...p,children:a}):null]})})),S=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),I=[];function T(e,t,{className:n,...l}={}){const{key:a,blockDecorator:i=S,blocksRegistry:r={},ancestors:s=I}=t,{type:c}=e;c&&c in r||console.warn(`No block with "${c}" is registered`);const d=c&&r[c];return i({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:i})=>{const{content:r}=n;return d?o(d,{className:i,block:e,options:t,...r,...l},a):null}},a)}const B=[],R=(e,{key:t,ancestors:n=B,slotName:l=null,extraProps:a,renderProps:i=T,...r})=>{const s=a?(e,t)=>T(e,t,a):i;return(e||[]).map(((e,a)=>s(e,{...r,key:`${t||e.type}-${a}`,ancestors:r.parent?[...n||B,[r.parent,l]]:n},a)))};function P({block:e,options:t,children:n,extraProps:l,renderProps:a}){return n||(e&&t?R(e.blocks,{...t,parent:e,extraProps:l,renderProps:a}):null)}function D(){return D._impl()}D._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),D.setup=e=>{D._impl=e};const M=["CDN","BASE_PATH"],_=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return M.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),z=e=>Boolean(e?.includes(":")),V=(e,t)=>Boolean(e&&!z(e)&&(!t||"_self"===t)),A=e=>Boolean(e?.startsWith("#")),F=e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),E=(...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:z,isLocalURL:V,isHash:A,withoutQuery:F,joinPath:E,hasPrefix:O});const $="/api/",j=`${$}v1/storage`,q=e=>(t,n)=>{if([!t,z(t),A(t),[_.CDN,$].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`${j}/${t}/attachment`;const l=t?.startsWith("/");return E(O(t,n)?"":n,l?"/":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:l=`Иконка ${n}`,title:a=l,iconVersion:i="color",width:r,height:s})=>{const d=D(),m="normal"===i?`${n}.svg`:`sprites.svg#${n}`,h=q(d)(E(_.CDN,"/icons/",m));return"normal"===i?o("img",{className:e,src:h,alt:l,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[i],{invert:"white"===i},t),width:r,height:s,"aria-hidden":"true",children:[a?o("title",{children:a}):null,l?o("desc",{children:l}):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)),X=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function G(e=""){try{return new URL(e).pathname}catch(e){return""}}const J=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":G(X.SITE_URL);return t&&!z(t)?q(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 l=D();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(Z).map((({src:e,format:n,media:a},i)=>o("source",{srcSet:J(l)(e),type:te(n),media:a?`(max-width: ${a}px)`:"",width:t?.size?.width,height:t?.size?.height},`${i}_${e}`))):null,t?.src?ee({...t,src:J(l)(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="",...l})=>t?.src||t?.icon?t.icon?o(W,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...l}):o(Q,{className:e,imageClassName:n,image:t}):null)),le={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",ie={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?le[n]:"",t?"rounded-full":"rounded-md",e].join(" ");const ce=new class{subscribers={};subjectsStateMap={};subscribe(e,t){this.subscribers[e]=(this.subscribers[e]||[]).concat(t);const n=this.subjectsStateMap[e];return n&&t(n),()=>{this.unsubscribe(e,t)}}unsubscribe(e,t){this.subscribers[e]=this.subscribers[e]?.filter((e=>e!==t))}fire(e,t){e in this.subjectsStateMap&&(this.subjectsStateMap[e]=t),this.subscribers[e]?.forEach((e=>e(t)))}subject(e,t){this.subjectsStateMap[e]=t}},de=()=>({open:(e,t={})=>ce.fire("dialog",{type:"open",dialog:e,...t}),close:()=>ce.fire("dialog",{type:"close"}),closeAll:()=>ce.fire("dialog",{type:"close",all:!0})}),me=e=>me._impl(e);function ue(){const e=G(X.SITE_URL),t=D(),{closeAll:n}=de();return e=>{const n=q(t)(e.href);return{...e,href:n,"aria-label":e.text,onClick:me(l({...e,href:n}))}};function l({href:l,target:a,onClick:i}){return r=>{i?.(r),he(l,a,e)||(n(),r?.preventDefault(),t.push(((e,t="")=>e?.replace(t,"")||"/")(l,e)))}}}me._impl=e=>e,me.setup=e=>{me._impl=e};const he=(e,t,n)=>{if(!V(e,t))return!0;const l=X.SUB_PORTALS?.split(",");return!!l?.some((t=>O(e,t)))||!O(e,n||"/")},pe=e=>{if(!Array.isArray(e)||!e.length)return{};try{return{"data-aspects":JSON.stringify(e)}}catch(e){return{}}},ge=d((e=>{const{text:t,aboveText:n,appendLeft:l,appendRight:a,version:i="primary"}=e,r=xe(e)&&"hidden lg:block";return c("div",{className:u(fe(e),"flex gap-xs"),children:[l?o("div",{className:u(r,se[i]),children:l}):null,xe(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[i]),children:a}):null]})})),fe=e=>{const{version:t,aboveText:n,rounded:l}=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",xe(e)?a:"h-12 w-12 m-auto",{"rounded-full":l})},xe=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),be=({className:e,rounded:t,version:n})=>["inline-block",re,n?ie[n]:"",t?"rounded-full":"rounded-md",e].join(" "),ye=d((({disabled:e,children:t,method:n="LINK",href:l,...a})=>{const r=(({method:e,href:t})=>i((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:l,pathname:a,searchParams:i}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[l,a].join(""));for(const[e,t]of i.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:l}),s=ue()({onClick:r,href:l,...a}),c=t??o(ge,{...s});return o(e?Ne:ve,{...s,children:c})})),ve=d((({className:e="",href:t,rel:n,target:l,ariaLabel:a,version:i,rounded:r,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:oe({className:e,version:i,rounded:r}),href:t,rel:n,target:l,"aria-label":a||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...pe(d),children:m}))),Ne=d((({className:e,ariaLabel:t,version:n,rounded:l,children:a})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:be({className:e,rounded:l,version:n}),children:a})));function we({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:l=!1}){if(!n)return null;const a="primary"===e?"white":"black",i="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(l?"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}),i),onClick:t,children:o(ne,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:a}})}),o(ye,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const Ce=()=>{const[e,t]=l(false);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"},Se=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&ke[n],t),children:e}):null,Ie=d((({className:e,version:t="primary",defaultPadding:n,padding:l="",title:a,buttons:r,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:x,...b})=>{const y=Ce(),v=D(),N=i((()=>v.back()),[]),w=b.options?.page?.common?.backwardButton,C=f&&!y;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",l||n,e),children:[C&&we({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:[Se(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]}),Be(P({...b,extraProps:{className:"@container-normal"}})),Se(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Te(p)]:r,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),r?o("div",{className:"self-end",children:r}):null]})]})]})})),Te=e=>u(e?"row-span-2":"@xl:row-span-2"),Be=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,Pe=d((e=>{const{__html:t="",richVersion:n="",itemSize:l="list-m",isDotted:a=!0}=e,i=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,l,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",i),dangerouslySetInnerHTML:{__html:t}})}):null})),De=(e,t)=>e?o(w,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,Me=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),_e=(e,t)=>e?o(Me,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,ze=(e,t)=>["label"in e?_e(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:De(e.description,t)},String(t)):null,"__html"in e?o(Pe,{...e},`rte-${t}`):null],Ve=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:ze(n)})]}))),Ae=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(Ve,{benefitsVersion:t,...e},String(n))))}):null)),Fe=d((({className:e,benefits:t})=>t?.length?o("div",{className:u("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap(ze)}):null)),Ee=d((({isTabularBenefits:e,...t})=>o(e?Fe:Ae,{...t}))),Oe=e=>Boolean(e?.src||e?.icon),Le=(e,{className:t,buttonClassName:n,isVertical:l}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",l?"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($e(n))}):null,$e=(e="")=>(t,n)=>{const{text:l,icon:a,iconRight:i,version:r,...s}=t||{},c=je(a,r),d=je(i,r);return l||a?.icon?o(ye,{className:u("basis-full @lg:basis-auto",e),appendLeft:qe({...a,iconVersion:c}),appendRight:qe({...i,iconVersion:d}),version:r,text:l,...s},n?String(n):""):null},je=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},qe=e=>Oe(e)&&o(ne,{image:e,width:String(e?.size?.width||24),height:String(24)}),Ue=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),We=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(He)}):null)),He=({label:e,amount:t,unit:n},l)=>c("div",{className:"basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg sm:rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(Me,{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:[Ue(2)(t)," ",n||"₽"]}):null]},String(l)),Ye=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(Ke)}):null)),Ke=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(Me,{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"},Ge=d((({className:e,padding:t,defaultPadding:n,title:l,description:a,headlineVersion:i="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:b,image:y,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:C=!1}={},backwardButton:S,children:I,...T})=>{const B=y?.src?o(ne,{image:y}):null,R=o(k,{title:l,description:a,headlineVersion:i,align:r,isEmbedded:!0}),P=u?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Ie,{className:e,padding:t,defaultPadding:n,...g?{title:R}:{insetTitle:R},...Je(B,N),isImageSecondary:C,imageAlign:v,isImageAlwaysOnRight:w,buttons:Le(b),backwardButton:S,...T,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[P?.length?o(Ee,{benefitsVersion:s,isTabularBenefits:d,benefits:P}):null,h?o(Pe,{richVersion:p,__html:h,isDotted:m,itemSize:Xe[i]}):null,I,f?.length?o(We,{priceList:f}):null,Ze(x)]})})})),Je=(e,t)=>t?{rightImage:e}:{leftImage:e},Ze=e=>e?.length?o(Ye,{tags:e}):null,Qe=e=>Boolean(e&&Array.isArray(e)),et=e=>Boolean(e&&!Array.isArray(e)&&"object"==typeof e),tt=(e,t)=>{return n=e,Boolean(et(n)&&"string"==typeof n.$ref)?t.ref(e):et(e)?t.record(e):Qe(e)?t.array(e):t.scalar?t.scalar(e):e;var n},nt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(lt,e),lt=(e,t)=>e&&t?et(e)?e[t]:Qe(e)?e[parseInt(t,10)]:e:e,at=(e,t)=>tt(e,{ref:({$ref:e,...n})=>at(e?nt(t(e),e):n,t),record:e=>Object.entries(e).map((([e,n])=>({[e]:at(n,t)}))).reduce(((e,t)=>Object.assign(e,t)),{}),array:e=>e.map((e=>at(e,t)))}),it=(e,t,n=[])=>{tt(e,{ref:e=>t(e.$ref,n),record:e=>{for(const l in e)it(e[l],t,[...n,l])},array:e=>{for(let l=0;l<e.length;l++)it(e[l],t,[...n,l])}})};async function rt(e,t){try{return e?await st(e,t):null}catch(e){console.error(e)}return null}const st=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),ot=e=>[...new Set(e)],ct={},dt=["/portal-resources"],mt=(e,t)=>at(e,(e=>t?.[e])),ut=(e,t)=>{const n=(e=>{const t=[];return it(e,(e=>t.push(e))),t})(e),[i,r]=l({});return a((()=>{n.length&&(async e=>Object.fromEntries((await Promise.allSettled(ot(e).filter((e=>!dt.some((t=>e.startsWith(t))))).map((async e=>[e,ct[e]||=await st(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(n).then(r)}),[n.join()]),n.length?mt(e,{...t,...i}):e};function ht(e,t={}){const n=d((t=>{const n=ut((({block:e,options:t,className:n,defaultPadding:l,padding:a,isTheme:i,version:r,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const pt=ht((({className:e,padding:t,defaultPadding:n,...l})=>o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...l,children:o(Ge,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...l})})),{childrenTypes:["UnitBlock"]}),gt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>ft(0,t?.length)),[t]),l=t?.[n];return l?o(pt,{suppressHydrationWarning:!0,...l,...e}):o(g,{...e,children:o(f,{})})})),ft=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),xt=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),l=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getFullYear());return t?`${a}-${l}-${n}`:`${n}.${l}.${a}`}},bt=e=>e?.replace(/[^+\d]/g,"");const yt=e=>e?{phone:bt(e)}:{},vt=(e,t="birthday")=>e?{[t]:xt(e)}:{},Nt=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),wt=(e,t=!0)=>({[t?"email":"mail"]:e}),Ct=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:bt(e)}:{},kt=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:l,params:a}of e)t[l??""]?.(n,a)},St="rshb-query-params";function It(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(St)||"";return e&&globalThis.sessionStorage?.setItem(St,e),e}function Tt(e){if(!e)throw new Error("Value should be fulfilled");return e}const Bt=e=>t=>{const[,n]=Tt(e.find((([e])=>e(t))));return n(t)},Rt=e=>Bt(e.map((([e,t])=>[e,()=>t])));Rt.if=e=>new Pt(void 0,e);class Pt{parent;predicate;unit;get entry(){return[Tt(this.predicate),Tt(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new Pt(this,e)}then(e){return new Pt(this.parent,this.predicate,e)}else(e){return Bt([...Dt(this),[()=>!0,e]])}}const Dt=e=>[...e?.parent?Dt(e.parent):[],e.entry],Mt=e=>{const t=e.target?.closest("a");if(z(t?.href)&&!t?.href?.startsWith(globalThis.location?.origin)){e.preventDefault(),e.stopPropagation();const n=(e=>{const t=It();if(!z(e)||!t)return e;const n=new URL(e);for(const[e,l]of new URLSearchParams(t))n.searchParams.set(e,l);return n.toString()})(t?.href)||t?.href;if(n){_t(t?.target)?.(n)}}},_t=Rt([[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 zt(){return zt._impl()}zt._impl=()=>({forwardQuery:Mt}),zt.setup=e=>{zt._impl=e};const Vt=e=>e,At=(e,{resetOnSubmit:t,onSubmit:n,normalize:r}={})=>{const[s,o]=l(e),c=i(r?e=>o(e instanceof Function?t=>{const n=r(e(t));return Ft(t,n)?t:n}:r(e)):o,[r]);a((()=>{r&&o(r)}),[r]);const[d,m]=l(!1),[u,h]=l({}),p=i(((e,t)=>{const{parse:n=Vt,format:l=Vt}=t||{};return{value:l(s[e]),isDirty:d||u[e],onChange:t=>{c((l=>({...l,[e]:n(t)}))),h((t=>({...t,[e]:!0})))}}}),[c,d,u]),g=i((e=>{c(e),h(e)}),[]),f=i((()=>{c(e),m(!1),h({})}),[e]),x=i((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}]},Ft=(e,t)=>e&&t&&Object.keys({...e,...t}).every((n=>e[n]===t[n])),Et=d((e=>{const{className:t,title:n,children:l,...a}=e;return o(g,{className:t,defaultPadding:"p-6xl",...a,children:c("div",{className:"container max-w-[978px] space-y-lg",children:[n?o(N,{headingType:"h3",title:n,className:"@xl:text-center"}):null,l]})})})),Ot=e=>"OUTSERVICE"===e?"/api/v1/outservice/outserviceregions":void 0;function Lt(e=!1){const[t,n]=l(e),a=i((()=>n(!0)),[]),r=i((()=>n(!1)),[]),s=i((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:a,setFalse:r,toggle:s}]}function $t(e,t,n,l){a((()=>{if(e&&n)return e.addEventListener(t,n,l),()=>{e.removeEventListener(t,n,l)}}),[e,t,n])}function jt(e){const t=s(null),n=i((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return $t(globalThis.document,"click",n),t}const qt=({label:e,errors:t})=>e&&t?`${e}*`:e,Ut=()=>{},Wt="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",Ht=e=>e?o(Me,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,Yt=d((({key:e,className:t="",id:n,name:l,type:r="text",label:d,placeholder:m,value:h="",valid:p=!0,children:g,onChange:f,onFocus:x,onBlur:b,pattern:y,autoFocus:v=!1,isTextarea:N=!1,disabled:w=!1})=>{const C=s(null),k=i((e=>{const t=(e.target?.value||"").trimStart();f&&f(t)}),[f]);a((()=>{v&&C.current?.focus()}),[v,C]);const S=g?"pr-3xl":"",I=Kt(p);return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[Ht(d),N?o("textarea",{className:u("block resize-y min-h-24",Xt,I),id:u("textarea",n),name:l||n,placeholder:m,value:h,onChange:k,onFocus:x,onBlur:b,disabled:w},e):o("input",{type:r,className:u("h-14",Xt,S,I),ref:C,id:n,name:l||n,placeholder:m,value:h,onChange:k,onFocus:x,onBlur:b,pattern:y,disabled:w},e)]}),g]})})),Kt=e=>e?Wt:"border-error",Xt="w-full border rounded-md text-primary-text outline-none p-m",Gt=e=>o("div",{className:"h-6",children:e?o(Me,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),Jt=e=>e?.value||"",Zt={url:"suggest/address"},Qt={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:Zt,addressFact:Zt,organizationAddress:Zt},en=()=>({open:(e,t)=>ce.fire("popup",{type:"open",popup:e,...t}),update:(e,t)=>ce.fire("popup",{type:"update",popup:e,...t}),close:()=>ce.fire("popup",{type:"close"})}),tn=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 nn({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=l([]),f=en(),x=Qt[n],b=i((()=>{h.current=t,f.close()}),[t]),y=i((e=>{b(),h.current=e.processedValue,c&&c(e.processedValue),d&&d(e)}),[b,c]),v=s(null),N=r((()=>async e=>{if(!x)return;const t=await(e=>{const{url:t,query:n,queryPrefix:l,requestData:a={},responseItemHandler:i=Jt}=e,r=(s=i,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${l?`${l}, `:""}${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 l=(...a)=>{l.dispose(),n=setTimeout((()=>{e(...a)}),t)};return l.dispose=()=>{n&&clearTimeout(n)},l})(N,300)),[N]);return a((()=>{if(!e||!v.current||h.current===t)return void b();const n=v.current,{top:l,left:a,width:i,height:r}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.update(o(tn,{options:p,value:t,onChange:y}),{top:l+globalThis.scrollY+r,left:a,width:i})}),[e,p,t,y]),v}const ln=d((({className:e,label:t,value:n="",placeholder:l,error:a,errors:r,onChange:s=Ut,onDaDataChange:d,onBlur:m,isTextarea:h,type:p,name:g="",daDataQueryPrefix:f,inputLength:x,dadata:b=!1,disabled:y=!1})=>{const[v,{setFalse:N,setTrue:w}]=Lt(),C=jt(N),k=i((e=>x?e.length<=x&&s(e):s(e)),[s]),S=nn({isOpen:v&&b,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:S,children:o(Yt,{disabled:y,type:p||"text","aria-label":t,label:qt({label:t,errors:r}),valid:Boolean(!a),value:n,onChange:k,onBlur:m,isTextarea:h,placeholder:an(l,r,t)})}),Gt(a)]})})),an=(e,t,n)=>t&&!n?`${e}*`:e,rn=e=>e?.text||e?.key||"",sn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,on=d((({popupRef:e,options:t,value:n,query:l,onChange:a,iconVersion:i})=>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:sn(t,l).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:rn(e)}),o(W,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:i,className:u("absolute right-4 pt-3xs",{hidden:e.key!==n?.key})})]},e.key)))}):null));const cn=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[b,{setFalse:y,setTrue:v}]=Lt(),[N,w]=l(""),C=un(x,n.length),k=b&&!C,S=i((()=>{w(""),y()}),[]),I=function({isOpen:e,options:t,value:n,query:l,onChange:r,onClose:c,iconVersion:d}){const m=en(),u=i((()=>{m.close(),c&&c()}),[c]),h=i((e=>{u(),r&&r(e)}),[u,r]),p=s(null),g=jt(u);return a((()=>{if(!e||!p.current)return;const a=p.current,{top:i,left:r,width:s,height:c}=a.getBoundingClientRect();m.update(o(on,{popupRef:g,options:t,value:n,query:l,onChange:h,iconVersion:d}),{top:i+window.scrollY+c,left:r,width:s})}),[e,t,n,l,h]),p}({isOpen:b,options:n,value:r,query:N,onChange:f,onClose:S,iconVersion:g});return c("div",{className:u("space-y-xs",e),children:[Ht(t),c("div",{className:u("relative",k?"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",mn(m,d,C)),onClick:k?S:v,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:rn(r)||h}),dn(k,g)]}),p&&k?o("div",{className:u("absolute top-0 w-full z-20"),children:o(Yt,{type:"text",autoFocus:!0,value:N,onChange:w})}):null]})]})})),dn=(e,t)=>o(W,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),mn=(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"),un=(e,t)=>e||0===t,hn=d((({className:e="",label:t,error:n,errors:l,...a})=>c("div",{className:e,children:[o(cn,{...a,valid:!n,label:qt({label:t,errors:l})}),Gt(n)]}))),pn=e=>!e?.length,gn=e=>t=>n=>e(n)?[]:[t],fn=gn((e=>null!=e&&""!==e)),xn="Некорректно заполненное поле",bn=e=>fn(e??xn),yn=e=>gn((e=>e?.key&&""!==e?.key))(e??xn),vn=e=>gn((e=>"string"==typeof e&&e.length>0&&e.length<=2))(e??xn),Nn=e=>gn((e=>"string"==typeof e&&e.length>1))(e??xn),wn=(e,t)=>gn((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??xn),Cn=e=>gn((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}$/,gn((e=>"string"==typeof e&&t.test(e))))(e);var t},Sn=gn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),In=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},Tn=e=>Boolean("0"===e.qc&&"0"===e.qcComplete&&"2"===e.qcHouse),Bn=()=>gn(Tn)("Укажите регион, город/населенный пункт, улицу, дом, квартиру"),Rn={typeForm:bn(),surname:Nn("Укажите свою фамилию"),name:Nn("Укажите своё имя"),middleName:Nn("Укажите своё отчество"),region:yn(),addressBranch:yn(),phone:kn("Укажите номер телефона"),secondaryPhone:kn("Укажите номер телефона"),organizationPhone:kn("Укажите номер телефона"),birthday:bn("Укажите дату рождения"),birthPlace:bn("Укажите место рождения"),education:bn("Выберите ваше образование"),housing:bn("Выберите тип жилья"),employment:bn("Выберите информацию о трудоустройстве"),organization:bn("Выберите тип организации"),amountWorkers:bn("Выберите информацию о количестве сотрудников"),employerActivities:bn("Выберите вид деятельности организации"),employerOrganization:bn("Выберите вид организации"),positionOrganization:bn("Выберите вашу должность"),dulSerie:(Pn="Укажите серию паспорта",gn((e=>"string"==typeof e&&4===e.length))(Pn)),dulNumber:Cn("Укажите номер паспорта"),dulIssueDateField:bn("Укажите дату выдачи паспорта"),dulSubdivisionCode:Cn("Укажите код подразделения"),dulIssuedBy:bn("Укажите организацию, выдавшую паспорт"),email:(e=>gn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(e))("Укажите электронную почту"),fullName:Nn(),inn:(e=>gn((e=>"string"==typeof e&&(10===e.length||12===e.length)))(e))("Укажите ИНН"),legalForm:bn("Укажите ОПФ"),organizationName:bn("Укажите наименование организации"),generalSeniority:vn("Укажите количество лет стажа"),lastJobExperience:vn("Укажите стаж на последнем месте работы"),experience5Years:vn("Укажите общий стаж за последние 5 лет"),jobsNumber:vn("Укажите количество мест работы за последние 5 лет"),beginDate:bn("Укажите дату заключения трудового договора"),addressFact:Bn(),partnerComments:bn(),collectionCount:bn(),comment:bn(),acquiringType:yn(),feedbackMethod:yn(),serviceType:yn(),serviceDirection:yn(),meetingDay:bn(),product:bn(),localities:bn(),consentDataProcessing:Sn,annualRevenue:bn(),consentToReceiveMaterials:Sn,processPersonalDataFlg:Sn,consentProviderFlg:Sn,consentPfrFlg:Sn,consentOthersFlg:Sn,consentInformFlg:Sn,familyStatus:bn("Выберите семейное положение"),children:wn(2,"Укажите количество детей"),familyMembers:wn(2,"Укажите количество членов семьи"),dependents:wn(2,"Укажите количество иждивенцев"),totalIncome:wn(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:wn(10,"Укажите сумму обязательных выплат"),snils:(e=>gn(In)(e))("Некорректный номер СНИЛС"),conscription:bn(),armyIdFlg:Sn,sex:bn("Укажите свой пол"),addressRegistration:Bn(),organizationAddress:Bn(),participantDateRegistration:bn("Укажите дату регистрации"),retirementIncome:bn(),otherIncome:bn(),mandatoryIncome:bn(),otherPayments:bn(),disablePeopleFlg:bn(),bankruptcyFlg:bn(),shareholderFlg:bn(),legalEntityName:bn(),bankEmployeeCode:bn(),partInBusiness:bn(),regionRetail:yn("Выберите филиал банка"),addressRetail:yn("Выберите адрес банка"),addressMatch:bn(),codeWord:(e=>gn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&/^[\u0400-\u04FF\d]+$/u.test(e)))(e??xn))("Необходимо ввести кодовое слово")};var Pn;const Dn=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,Rn?.[e||""]])))},Mn=(e,t)=>{const{value:n,isDirty:l}=e,a=l?t(n):[];return{...e,errors:a,error:a[0]}},_n=(e,t,n=!1)=>n?Mn(e,t):e,zn=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],Vn=d((({field:e,input:t})=>o(hn,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:zn,..._n(e("acquiringType"),Rn.acquiringType,t?.required)}))),An=(e="")=>Boolean("trade"===e||"all"===e),Fn=e=>null!=e,En=new Map,On=e=>Boolean(e?.every((e=>Array.isArray(e)?On(e):!e||"string"==typeof e))),Ln=e=>On(e)?e.toString():"";function $n(e,t,{fallback:n,cache:i}={}){const s=r((()=>jn(e)),[e]),[o,c]=l(void 0),[d,m]=l(void 0);a((()=>{if(!s.some(Fn))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await((e,t=En)=>n=>{const l=Ln(n),a=t.get(l);if(l&&Fn(a))return a;const i=e(...n);return l&&Fn(i)&&t.set(l,Promise.resolve(i)),i})(t,i)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,i,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 jn(e){return Array.isArray(e)?e:e instanceof Function?jn(e()):[e]}const qn=[];const Un=async e=>await rt(e,{method:"GET"})||qn;function Wn(e=!1){const{data:t}=$n("/api/v1"+(e?"/premiumBranchesByRegions":"/branchesByRegions"),st);return Array.isArray(t)?t:[]}const Hn=d((({field:e,input:t,isPremium:n=!1})=>{const l=e("region"),i=l?.value?.key,r=l?.value?.text,s=n?Wn(n)?.find((e=>e?.region===r))?.branches:function(e){const{data:t}=$n(e?`/api/v1/branches?regionCode=${e}`:null,Un);return t||qn}(i)?.filter((e=>e?.address));return a((()=>{""!==l?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[l?.value]),o(hn,{label:"Отделение",placeholder:"Выберите отделение",options:(s||[]).map((({address:e=""})=>({key:e,text:e}))),..._n(e("addressBranch"),Rn.addressBranch,t?.required),isSearch:!0})})),Yn=d((({field:e,input:t})=>{const n="addressFact",l=e(n).value,{value:r}=e("addressMatch");a((()=>{r&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[r]);const s=i((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})}),[]),c=i((t=>{e?.(n)?.onChange?.({...e(n).value,fullAddress:t})}),[]);return o(ln,{label:"Адрес",disabled:r,..._n(e(n),Rn[n],t?.required),value:l.fullAddress,onChange:c,...t,onDaDataChange:s})})),Kn=(e,t)=>"RETIREE"!==e?.("employment")?.value?.key&&t,Xn=()=>JSON.parse(globalThis.localStorage?.getItem("leadForm")??"{}")?.esiaId,Gn=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",l=e(n).value,a=i((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=i((t=>{e?.(n)?.onChange?.({...e(n).value,fullAddress:t})}),[]);return o(ln,{disabled:"addressRegistration"===n&&Xn()&&t?.filledByEsia,label:"Адрес",..._n(e(n),Rn[n],"organizationAddress"===t?.name?Kn(e,t?.required):t?.required),value:l.fullAddress,onChange:r,...t,onDaDataChange:a})})),Jn=d((({className:e,viewBox:t,fill:n="none",width:l,height:a,paths:i,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:l,height:a,children:i.map((({d:e,fill:t,...n},l)=>{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},l)}))}))),Zn="appearance-none w-5 h-5 border-solid flex-none",Qn=[{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"}],el=d((({className:e,value:t,text:n,disabled:l,isRadio:a,onChange:r})=>{const s=i((e=>{l||(e.preventDefault(),r&&r(!t))}),[r,l,t]),d=a?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(Jn,{paths:Qn,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",nl(l)),onClick:s,children:[o("div",{className:u(Zn,"m-0",a?"rounded-full border-2":al(t),!l&&t?"border-primary-main":"border-gray",l?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:ll(a),"aria-checked":Boolean(t),"aria-disabled":Boolean(l),"aria-label":n}),t?d:null,tl(n)]})})})),tl=e=>e?o("div",{className:"ml-s",children:o(Me,{size:"text-l",font:"font-light",children:e})}):null,nl=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",ll=(e=!1)=>e?"radio":"checkbox",al=(e=!1)=>u("rounded border",{"bg-primary-main":e}),il=d((({className:e,text:t,value:n,key:l,disabled:a,error:i,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(el,{text:t,value:n,disabled:a,onChange:r},l),Gt(i)]}))),rl=d((({field:e})=>o(il,{text:"Адрес фактического места жительства совпадает с адресом регистрации",..._n(e("addressMatch"),Rn.addressMatch)}))),sl=(e,{normalize:t,format:n})=>{const{value:a,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=l(!1),m=i((e=>{d(!0),r&&r(e)}),[]),u=i((()=>{d(!1),o&&o(t(a)),s&&s()}),[o,a]);return{value:c||!n?a:n(a),onFocus:m,onBlur:u}},ol=(e,t,n)=>Math.max(t,Math.min(e,n));function cl(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function dl({list:e=[],min:t,max:n,step:l,value:a=e[0]||t,disabled:i,onChange:r}){const s=e.length?e.indexOf(a):a,d={backgroundSize:`${(100*(s>t?s-t:0)/(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||i?"bg-gray":"bg-primary-main")},String(t))))}):null,o("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:o("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:d,type:"range",min:t,max:n,step:l,value:s,disabled:i,onChange:t=>{const n=cl(t.target?.value),l=e.length?e[n]:n;r&&r(l||0)}})})]})}const ml=1,ul=100,hl=d((e=>{const{className:t,title:n,items:l=[],list:a=[],min:r=(a.length?0:ml),max:s=(a.length?a.length-1:ul),step:d=1,value:m=a[0]||r,disabled:h=!1,onChange:p}=e,g=sl(e,{normalize:(e=0)=>a.length?pl(a)(e):ol(e,r,s),format:Ue()}),f=i((e=>{p&&p(cl(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(Me,{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",Wt,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),dl({list:a,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),gl(l)]})})),pl=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),gl=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Me,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),fl=["От 1 000 ₽","До 1 000 000 000 ₽"],xl=d((({field:e})=>o(hl,{title:"Сумма, ₽",items:fl,min:1e3,max:1e9,...e("amount")}))),bl=e=>{const{data:t,error:n}=$n(`/api/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,yl);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},yl=async e=>await rt(e,{method:"POST"})||[],vl=ht((({field:e,source:t,label:n,fieldName:l,input:a})=>{const i=t&&t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(hn,{placeholder:"Выберите из списка",label:n,options:i,..._n(e(l),Rn[l],a?.required)})})),Nl=d((({field:e,input:t})=>{const{data:n}=bl("EMPLOYEES_NUMBER");return o(vl,{field:e,source:n,label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),wl=d((({field:e,input:t})=>o(ln,{label:"Годовая выручка, ₽",..._n(e("annualRevenue"),Rn.annualRevenue,t?.required)}))),Cl=d((({field:e})=>o(il,{text:"Наличие военного билета",..._n(e("armyIdFlg"),Rn.armyIdFlg)}))),kl=d((({field:e,input:t})=>o(ln,{label:"Код представителя Банка",placeholder:"Введите код",type:"number",..._n(e("bankEmployeeCode"),Rn.bankEmployeeCode,t?.required),...t}))),Sl=d((({field:e})=>o(ln,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e("bankEmpolee")}))),Il=d((({field:e})=>o(il,{text:"В отношении меня ведётся производство по делу о банкротстве",..._n(e("bankruptcyFlg"),Rn.bankruptcyFlg)}))),Tl=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:l,currentYear:a,min:i,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,l,d),n=Bl(t,e),c=Rl(t,i,r);u.push(o("td",{children:o("div",{className:Pl(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},Bl=(e,t)=>t&&e.toDateString()===t.toDateString(),Rl=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),Pl=(e=!1,t=!1)=>u("p-s text-center rounded-md border",{"border-transparent hover:bg-gray":!e},t?"text-gray hover:bg-transparent":"cursor-pointer"),Dl=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Ml=d((({today:e,currentMonth:t,currentYear:n,min:l,max:a,onDateSelect:s=Ut,setValue:d=Ut})=>{const m=i((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:Dl.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Tl({firstDayOfWeek:u,today:e,totalDays:h,currentYear:n,currentMonth:t,min:l,max:a,onDateClick:m})})]})})),_l=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function zl(e,t){const n=e.replace(/\D/g,"");if(""===n||e?.length===t.length)return e;const l=[...t],a=l.findIndex(Vl),i=l.map(((e,t)=>Fl(e)?l.slice(0,t).filter(Fl).length:-1)),r=l.map(((e,t)=>Al(e)?e:n.charAt(i[t])||e)),s=i.indexOf(n.length-1)+1;return r.slice(0,Math.max(a,s)).join("")}const Vl=e=>"_"===e,Al=e=>/\d/.test(e),Fl=e=>Vl(e)||Al(e),El=1940,Ol={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Ll=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:i,disabled:r,onChange:d,onClick:m})=>{const h=s(null),[p,g]=l(i||"");return a((()=>{g(i||"")}),[i]),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(zl(t,"__.__.____"))},onBlur:()=>{if($l(p)){const[n,l,a]=p.split(".");d?.(new Date(Number(a),Number(l)-1,Number(n))),e(Number(l)-1),t(Number(a))}else g(i||"")},disabled:r}),r?null:o(W,{className:"mr-s",...Ol})]})})),$l=e=>{const[t,n,l]=e.split(".");if((e=>Number(e)>=El&&Number(e)<=(new Date).getFullYear())(l)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(l),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},jl=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:l,setSelectedMonth:a,setSelectedYear:i,disabled:r=!1})=>o(Ll,{onChange:l,disabled:r,onClick:e,value:t&&xt(t),setSelectedMonth:a,setSelectedYear:i,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")}),ql=_l.map((e=>({key:e}))),Ul=Array.from({length:(new Date).getFullYear()-El+1},((e,t)=>El+t)).reverse().map((e=>({key:String(e)}))),Wl=(e,t)=>{const n=new Date(e,t,1);let l=0;for(;n.getMonth()===t;)l++,n.setDate(n.getDate()+1);return l},Hl=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:l,onChange:a})=>{l&&a?.(new Date(t,n,Math.min(e,l.getDate())))},Yl={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Kl={className:"min-w-32",iconVersion:"black",isBorder:!1},Xl=d((({className:e="",label:t="",value:n,valid:r=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g}]=Lt(!1),[f,x]=l(n?.getMonth()||(new Date).getMonth()),[b,y]=l(n?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:v,handleNextMonth:N,handleSelectMonth:w,handleSelectYear:C,monthsOptions:k,yearsOptions:S,handleChangeVisibleCalendar:I,ref:T}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:l,onYearSelect:a,selectedYear:r,onChange:s,value:o})=>{const c=jt(i((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:i((()=>e(!t)),[t]),handleNextMonth:i((()=>{n+1<=11?l(n+1):(l(0),a(r+1))}),[n]),handlePrevMonth:i((()=>{n-1>=0?l(n-1):(l(11),a(r-1))}),[n]),handleSelectMonth:i((({key:e})=>{l(_l.indexOf(e));const t=Wl(r,_l.indexOf(e));Hl({maxDateOfMonth:t,selectedYear:r,selectedMonth:_l.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:i((({key:e})=>{a(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:ql,yearsOptions:Ul,ref:c}})({onYearSelect:y,onMonthSelect:x,onShowCalendar:g,selectedYear:b,selectedMonth:f,showCalendar:p,onChange:h,value:n}),B=((e,t)=>{const[n,i]=l(!1);return a((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();i(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:[Ht(t),c("div",{className:"relative",children:[jl({handleChangeVisibleCalendar:I,value:n,valid:r,onChange:h,disabled:m,setSelectedMonth:x,setSelectedYear:y}),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,{...Yl,className:"-rotate-90 cursor-pointer"})}),o(cn,{onChange:w,value:{key:_l[f]},options:k,...Kl}),o(cn,{onChange:C,value:{key:String(b)},options:S,...Kl}),o("div",{className:"my-auto",onClick:N,children:o(W,{...Yl,className:"rotate-90 cursor-pointer"})})]}),o(Ml,{today:n,currentMonth:f,currentYear:b,onDateSelect:h,min:s,max:d,setValue:g})]}):null]})]})})),Gl=d((({className:e,label:t,error:n,errors:l,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Xl,{label:qt({label:t,errors:l}),valid:Boolean(!n),...a}),Gt(n)]}))),Jl=d((({field:e,input:t})=>o(Gl,{label:"Дата начала работы на текущем месте",..._n(e("beginDate"),Rn.beginDate,Kn(e,t?.required)),...t}))),Zl=d((({field:e,input:t,isRetailForm:n=!1})=>{const{value:l}=e("birthday");return o(Gl,{label:"Дата рождения",..._n(e("birthday"),Rn.birthday,t?.required),error:n&&l&&!Ql(l)?"Допустимый возраст заёмщика - от 23 до 75 лет":""})})),Ql=e=>{const t=new Date,n=new Date(t.getFullYear()-23,t.getMonth(),t.getDate()),l=new Date(t.getFullYear()-75,t.getMonth(),t.getDate());return!(!e||e>n||e<l)},ea=d((({field:e,input:t})=>o(ln,{label:"Место рождения",..._n(e("birthPlace"),Rn.birthPlace,t?.required),...t}))),ta=d((({field:e,input:t})=>{const{data:n}=bl("CARD_TYPE");return o(vl,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t})})),na=d((({field:e,input:t})=>o(ln,{label:"Количество детей до 18 лет",placeholder:"Введите значение",type:"number",..._n(e("children"),Rn.children,t?.required),...t}))),la=d((({field:e,input:t})=>o(ln,{label:"Кодовое слово",..._n(e("codeWord"),Rn.codeWord,t?.required),...t}))),aa=d((({field:e,input:t})=>o(ln,{label:"Количество объектов инкассации",type:"number",..._n(e("collectionCount"),Rn.collectionCount,t?.required)}))),ia=d((({field:e,input:t})=>o(ln,{className:"col-span-2",..._n(e("comment"),Rn.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),ra=d((({field:e,input:t})=>{const{data:n}=bl("MILITARY_STATUS");return o(vl,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),sa={processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3},consentToReceiveMaterials:{text:"Согласен на получение информационных и аналитических материалов по электронной почте"}};async function oa(e,t,n){const l=await fetch(`/api/v1${e}`,{method:t,headers:{"Content-Type":"application/json",...da()},credentials:"include",body:n?JSON.stringify(n):null});return ca(l)?l.json():l}const ca=e=>"application/json"===e.headers.get("Content-Type"),da=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},ma=async(e,t=!1)=>{const n=await(async(e,t=!1)=>{const n=await oa(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return await n.blob()})(e,t);return URL.createObjectURL(n)},ua=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"})}))),ha=d((({className:e,head:t,children:n,onClose:l,onClick:a})=>{const{close:r}=de(),s=i((()=>{r(),l&&l()}),[l]);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(ua,{className:"absolute top-0 right-0",onClose:s}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})})),pa=async(e,t,n=!1)=>{const l=await ma(t,n);e(o(ha,{className:"my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0",children:n?o("img",{src:l}):o("iframe",{src:`${l}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"})}))},ga=d((({className:e,error:t,docId:n,...l})=>{const{open:a}=de(),i=Ce();return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(el,{...l}),n?o(ye,{className:"text-primary-main",onClick:()=>pa(a,n,i),children:o(Me,{children:"Ознакомиться"})}):null]}),Gt(t)]})})),fa=d((({field:e,input:t})=>t&&t.name?o(ga,{text:sa[t.name]?.text,docId:sa[t.name]?.docId,..._n(e(t.name),Rn[t.name],t?.required)}):null)),xa=d((({field:e,input:t})=>{const{data:n}=bl("CREDIT_IN_RSHB");return o(vl,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком / \n вкладчиком с долей участия более 20% уставного капитала руководителем, \n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t})})),ba={horizontal:"@lg:flex-row",vertical:""},ya=d((({label:e,items:t,value:n,className:l,onChange:a,disabled:i=!1,orientation:r="horizontal"})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(Me,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",ba[r],l),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(el,{isRadio:!0,text:t,value:n===e,onChange:()=>a&&a(e),disabled:i},String(e))))})]}))),va=[{id:"rub",text:"Рубль"}],Na=d((({field:e})=>{const{value:t}=e("currency");return c("div",{className:"",children:[o(Me,{font:"font-light",children:"Валюта дебетовой карты"}),o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(ya,{className:"whitespace-normal",orientation:"horizontal",items:va,value:t??"rub"})})]})})),wa=d((({field:e,input:t})=>o(ln,{label:"Количество иждивенцев",placeholder:"За исключение детей до 18 лет",type:"number",inputLength:2,..._n(e("dependents"),Rn.dependents,t?.required),...t}))),Ca=d((({field:e,input:t})=>o(Gl,{label:"Желаемая дата встречи",..._n(e("desiredMeetingDate"),Rn.meetingDay,t?.required)}))),ka=d((({field:e})=>o(il,{text:"Являюсь инвалидом",..._n(e("disablePeopleFlg"),Rn.disablePeopleFlg)}))),Sa=d((({field:e,input:t})=>o(Gl,{label:"Дата выдачи",..._n(e("dulIssueDateField"),Rn.dulIssueDateField,t?.required),disabled:Xn()&&t?.filledByEsia}))),Ia=d((({field:e,input:t})=>{const{value:n,onChange:l}=e("dulSubdivisionCode"),a=i((e=>{l?.(e?.data?.code?.replace("-",""))}),[]);return o(ln,{disabled:Xn()&&t?.filledByEsia,label:"Кем выдан",...t,..._n(e("dulIssuedBy"),Rn.dulIssuedBy,t?.required),onDaDataChange:a,daDataQueryPrefix:n})})),Ta=d((({field:e,input:t})=>o(ln,{disabled:Xn()&&t?.filledByEsia,label:"Номер документа",type:"number",inputLength:6,..._n(e("dulNumber"),Rn.dulNumber,t?.required)}))),Ba=d((({field:e,input:t})=>o(ln,{disabled:Xn()&&t?.filledByEsia,label:"Серия документа",type:"number",inputLength:4,..._n(e("dulSerie"),Rn.dulSerie,t?.required)}))),Ra=d((({field:e,input:t})=>{const n=i((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(ln,{disabled:Xn()&&t?.filledByEsia,label:"Код подразделения",type:"number",inputLength:6,...t,..._n(e("dulSubdivisionCode"),Rn.dulSubdivisionCode,t?.required),onDaDataChange:n})})),Pa=d((({field:e,input:t})=>{const{data:n}=bl("EDUCATION_LEVEL");return o(vl,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),Da=d((({field:e,input:t})=>{const{required:n,...l}=t;return o(ln,{label:"Электронная почта",..._n(e("email"),Rn.email,n),...l})})),Ma=d((({field:e,input:t})=>{const{data:n}=bl("ORGANIZATION_ACTIVITY_TYPE");return o(vl,{field:e,source:n,label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),_a=d((({field:e,input:t})=>{const{data:n}=bl("ORGANIZATION_KIND");return o(vl,{field:e,source:n,label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),za=d((({field:e,input:t})=>{const{data:n}=bl("EMPLOYMENT_INFO_UNITED");return o(vl,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),Va=d((({field:e,input:t})=>o(ln,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",type:"number",..._n(e("expenses"),Rn.expenses,t?.required),...t}))),Aa=d((({field:e,input:t})=>o(ln,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",inputLength:2,..._n(e("experience5Years"),Rn.experience5Years,Kn(e,t?.required)),...t}))),Fa=d((({field:e})=>{const{value:t,onChange:n}=e("familyMembers"),l="В браке"===e("familyStatus")?.value?.key?2:1,i=Number(e("children")?.value),r=Number(e("dependents")?.value),s=l+i+r;return a((()=>{e?.("familyMembers")?.onChange?.(s)}),[e("familyStatus")?.value?.key,i,r]),o(ln,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:t,onChange:e=>n?.(e)})})),Ea=d((({field:e,input:t})=>{const{data:n}=bl("MARITAL_STATUS");return o(vl,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),Oa=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],La=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],$a=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],ja=d((({field:e,input:t})=>o(hn,{label:"Способ получения ответа",options:$a,..._n(e("feedbackMethod"),Rn.feedbackMethod,t?.required)}))),qa=d((({field:e,input:t})=>o(ln,{label:"ФИО",..._n(e("fullName"),Rn.fullName,t?.required),...t}))),Ua=d((({field:e,input:t})=>o(ln,{label:"Общий стаж",type:"number",inputLength:2,placeholder:"Количество лет",..._n(e("generalSeniority"),Rn.generalSeniority,Kn(e,t?.required)),...t}))),Wa=d((({field:e,input:t})=>{const{data:n}=bl("HOUSE_TYPE");return o(vl,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Ha=d((({field:e,input:t})=>{const n=i((t=>{e?.("organizationName")?.onChange?.(t.data?.name?.short_with_opf),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(ln,{label:"ИНН",type:"number",inputLength:12,...t,..._n(e("inn"),Rn.inn,Kn(e,t?.required)),onDaDataChange:n})})),Ya=d((({field:e})=>o(il,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),Ka=d((({field:e,input:t})=>o(ln,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",type:"number",inputLength:2,..._n(e("jobsNumber"),Rn.jobsNumber,Kn(e,t?.required)),...t}))),Xa=d((({field:e,input:t})=>o(ln,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",inputLength:2,..._n(e("lastJobExperience"),Rn.lastJobExperience,Kn(e,t?.required)),...t}))),Ga=d((({field:e,input:t})=>o(ln,{label:"Наименование юридического лица",...t,..._n(e("legalEntityName"),Rn.legalEntityName,t?.required)}))),Ja=d((({field:e,input:t})=>o(ln,{label:"ОПФ",placeholder:"ООО, ПАО и др.",..._n(e("legalForm"),Rn.legalForm,Kn(e,t?.required)),...t}))),Za=[];async function Qa(){const e=await rt("/api/v1/outservice/outserviceregions");return e&&Array.isArray(e)?e:Za}const ei=d((({field:e,input:t})=>{const n=e("region")?.value?.key,{data:l}=$n("outServiceRegions",Qa),i=l?.find((e=>e.code===n))?.localities?.map((e=>({key:e,text:e})));return a((()=>{""!==n&&e?.("localities")?.onChange?.("")}),[n]),o(hn,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:i,..._n(e("localities"),Rn.localities,t?.required),isSearch:!0})})),ti=d((({field:e,input:t})=>o(ln,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",..._n(e("mandatoryIncome"),Rn.mandatoryIncome,t?.required),...t}))),ni=d((({field:e,input:t})=>o(ln,{label:"Отчество (Обязательно, при наличии)",inputLength:60,disabled:Xn()&&t?.filledByEsia,..._n(e("middleName"),Rn.middleName),...t}))),li=d((({field:e,input:t})=>o(ln,{label:"Имя",inputLength:60,disabled:Xn()&&t?.filledByEsia,..._n(e("name"),Rn.name,t?.required),...t}))),ai=d((({value:e=!1,text:t,type:n="checkbox",onChange:l})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>l&&l(!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(Me,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),ii=d((({field:e})=>An(e("acquiringType")?.value?.key)?o(ai,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),ri=d((({field:e,input:t})=>{const{data:n}=bl("ORGANIZATION_TYPE");return o(vl,{field:e,source:n,label:"Тип организации",fieldName:"organization",input:t})})),si=d((({field:e,input:t})=>{const n=i((t=>{e?.("inn")?.onChange?.(t.data?.inn),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(ln,{label:"Наименование организации",...t,..._n(e("organizationName"),Rn.organizationName,Kn(e,t?.required)),onDaDataChange:n})})),oi=d((({field:e,input:t})=>o(ln,{label:"Иные доходы",placeholder:"Введите значение",type:"number",..._n(e("otherIncome"),Rn.otherIncome,t?.required),...t}))),ci=d((({field:e,input:t})=>o(ln,{label:"Обязательные выплаты",placeholder:"Введите значение",type:"number",..._n(e("otherPayments"),Rn.otherPayments,t?.required),...t}))),di=d((({field:e,input:t})=>o(Gl,{label:"Дата регистрации по месту жительства",..._n(e("participantDateRegistration"),Rn.participantDateRegistration,t?.required)}))),mi=d((({field:e,input:t})=>{const n={..._n(e("partInBusiness"),Rn.partInBusiness,Kn(e,t?.required))};return o(ln,{label:"Доля участия в бизнесе",placeholder:"в %",type:"number",inputLength:3,...n,...t,onChange:e=>n?.onChange&&n?.onChange(String(Number(e)>100?100:Number(e)||""))})})),ui=d((({field:e,input:t})=>{const{required:n,...l}=t;return o(ln,{..._n(e("partnerComments"),Rn.partnerComments,n),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...l})})),hi=[{id:"mir",text:"Карта МИР"},{id:"union_pay",text:"UnionPay"},{id:"payment_system_j",text:"Платежная система (Дж)"},{id:"payment_system_b",text:"Платежная система (B)* "},{id:"free_card",text:"Бесплатная карта"}],pi=d((({field:e})=>{const{value:t,onChange:n}=e("paymentSystem");return c("div",{className:"",children:[o(Me,{font:"font-light",children:"Платежная система"}),o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(ya,{className:"whitespace-normal",orientation:"horizontal",items:hi,value:t??"mir",onChange:e=>n&&n(e)})})]})})),gi=e=>"_"===e,fi=e=>/\d/.test(e),xi=e=>gi(e)||fi(e),bi=[..."+7 (___) ___-__-__"],yi=bi.findIndex(gi),vi=bi.map(((e,t)=>xi(e)?bi.slice(0,t).filter(xi).length:-1));function Ni(e){const t=e.replace(/\D/g,""),n=bi.map(((e,n)=>fi(e)?e:t.charAt(vi[n])||e)),l=vi.indexOf(t.length-1)+1;return(l?n.slice(0,Math.max(yi,l)):n).join("")}const wi=d((({children:e,onChange:t,...n})=>{const l=i((e=>t&&t(Ni(e))),[t]),a=i((e=>{"+7 ("===e&&t&&t("")}),[]);return o(Yt,{...n,onChange:l,onFocus:e=>l(e?.target?.value||""),onBlur:e=>a(e?.target?.value||""),children:e})})),Ci=d((({className:e,label:t,error:n,...l})=>c("div",{className:u("shrink-0 w-full",e),children:[o(wi,{"aria-label":t,label:qt({label:t,errors:l?.errors}),valid:Boolean(!n),placeholder:"+7 (___) ___-__-__",...l}),Gt(n)]}))),ki=d((({field:e,input:t})=>o(Ci,{label:"Телефон",..._n(e(t?.name||"phone"),Rn.phone,"organizationPhone"===t?.name?Kn(e,t?.required):t?.required),...t}))),Si=d((({field:e,input:t})=>{const{data:n}=bl("POSITION");return o(vl,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),Ii=d((({field:e})=>An(e("acquiringType")?.value?.key)?o(ai,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),Ti=ht((({field:e,source:t})=>o(hn,{placeholder:"Выберите продукт",label:"Продукт",options:Bi(t?.productList),...Mn(e("product"),Rn.product)}))),Bi=e=>(e??[]).map((e=>({key:e,value:e})));function Ri(e="/api/v1/regions"){const{data:t}=$n(e,st);return Array.isArray(t)?t:[]}const Pi=d((({field:e,input:t,url:n})=>{const l=Ri(n);return o(hn,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>l?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[l]),..._n(e("region"),Rn.region,t?.required)})})),Di=d((({field:e,input:t})=>{const n=Wn(!0),l=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(hn,{label:"Регион",placeholder:"Выберите регион",options:l,..._n(e("region"),Rn.region,t?.required)})})),Mi=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:n=!1,renderFoldableSection:a,renderFoldButton:r})=>{const[s,o]=l(n),d=i((()=>{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 _i=d((({className:e="",isUnfolded:t,children:n})=>{const l=s(null),i=function(e,t){const n=s(null);return a((()=>{const t=n?.current;if(!t)return;const l=new ResizeObserver((n=>{e(t,n[0])}));return l.observe(t),()=>{l.disconnect()}}),[e,...t]),n}((e=>{l.current&&(l.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:l,className:`transition-max-h duration-300 overflow-hidden ${l.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:i,children:n})})})),zi=d((({value:e,subText:t,children:n,isPhone:l,...a})=>{const i=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[i.length,n,t].every((e=>!e))?null:Vi({textItems:i,subText:t,children:n,isPhone:l,...a})})),Vi=({label:e,labelSize:t="text-m",textItems:n,subColor:l,subText:a,className:i,children:r,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",i),children:[e?o(Me,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||Ai(n,s),a?o(Me,{color:l,size:"text-m",children:a}):null]}),Ai=(e,t)=>e.filter(Boolean).map(((e,n)=>o(Me,{size:"text-l",children:t?o("a",{href:`tel:${Fi(e)}`,children:e.trim()}):e.trim()},String(n)))),Fi=e=>e.replace(/\D/g,""),Ei=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}))),Oi=e=>{const t=$i(e);return o(zi,{label:"Режим работы",value:t,className:"max-w-none"})},Li=({workTime:e="",lunchHour:t="",daysOff:n=""},l=!1)=>e?[`${l?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",$i=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))),l=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[Li({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":l}),Li({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:l},!0)].filter(Boolean)},ji=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],qi=e=>ji.map((([t,n,l])=>({key:t,title:l,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??"")}}))),Ui=e=>{if(!e)return null;const t=Wi(e);return c(Ei,{className:"border-none",children:[o(zi,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(Hi)})}),o(zi,{label:"Режим работы",className:"max-w-none",children:o(Me,{children:e})})]})},Wi=e=>{const t=ji.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],l=n[n.length-1]?.toLowerCase();return l?.includes("выходной")?t.map((e=>({...e,status:!l?.includes(e.short.toLowerCase())}))):t},Hi=({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(Me,{size:"text-xs",children:e})},String(n)),Yi=({currency:e,buyExchangeRate:t,saleExchangeRate:n},l)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(zi,{label:"Валюта",value:e.currency}):null,t?o(zi,{label:"Купить",value:String(t)}):null,n?o(zi,{label:"Продать",value:String(n)}):null]},String(l)),Ki={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"}},Xi=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",Ki[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(Me,{size:"text-m",color:Ki[n].text,children:t})]}))),Gi=(new Date).getDay(),Ji=e=>{const[t]=e?.slice(Gi-1)??[];if(!t)return null;const{lunchHour:n,status:l,workTime:a,hasLunch:i}=t;return l?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[a?o(Xi,{color:"green",children:a}):null,n&&i?o(Xi,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(Xi,{color:"red",children:"Выходной"})},Zi=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Qi=({title:e,status:t,workTime:n,lunchHour:l,hasLunch:a},i)=>o(zi,{label:e,value:t&&n?n:"",subText:Zi({lunchHour:l,hasLunch:a,status:t}),subColor:!t||a?"text-error":"text-green-dark"},String(i)),er=["ArrowDownIcon","ArrowUpIcon"],tr=["Подробнее","Скрыть"],nr=({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:tr[Number(e)]}),o(W,{className:"text-primary-text",name:er[Number(e)],width:"16",height:"16"})]}),lr=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,ar=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,ir=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,rr=({name:e,address:t,phone:n,fax:l,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},u)=>{if(!d)return null;const h=qi(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(Me,{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(Me,{size:"text-l",children:t})]}):null]}),Ji(h)]}),o("div",{className:"hidden sm:block",children:sr({phone:n,fax:l,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(Mi,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(_i,{isUnfolded:e,children:sr({phone:n,fax:l,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>nr({isUnfolded:e,onToggle:t})})]},String(u))},sr=({phone:e,fax:t,phoneBusiness:n,phoneNatural:l,phoneCallCentre:a,phoneCurrencyControl:i,workSchedule:r,exchangeRate:s})=>{const d=qi(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(Ei,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(zi,{label:"Факс",value:t,isPhone:!0}),o(zi,{label:"Телефон филиала",value:e,isPhone:!0}),o(zi,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(zi,{label:"Обслуживание физических лиц",value:l,isPhone:!0}),o(zi,{label:"Для консультаций по валютному контролю",value:i,isPhone:!0}),o(zi,{label:"Контакт-центр",value:a,isPhone:!0})]}),r?.isMatchesPattern?o(Ei,{children:o(zi,{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(Qi)})})}):c(Ei,{children:[o(zi,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(Hi)})}),Oi(d)]}),r?.businessScheduleVisibleTag?Ui(r?.businessScheduleDescription):null,s?.currencies?.length?o(Ei,{className:"flex-wrap",children:s?.currencies?.map(Yi)}):null]})},or=({name:e="",address:t="",workSchedule:n})=>{const l=(a=e)?`${a?.charAt(0)?.toUpperCase()}${a?.slice(1)}`:"";var a;const i=`${t} ${(e=>{const t=qi(e),n=e?$i(t):"",l=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?lr(n):ir(n,l):ar(n):null})(n)}`;return{header:l,body:i}},cr=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),dr=d((({children:e})=>cr?e:null)),mr=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"})}))),ur="/icons/MapMarkerClusterIcon.svg",hr="/icons/MapMarkerClusterYellowIcon.svg";function pr({yandexMaps:e,map:t,points:n,isLoad:l}){if(l||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const a=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),i=gr("offices",e,a);if(n.length&&n.every((e=>"type"in e))){const l=gr("workplaces",e,a),r=fr(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=fr(n.filter((e=>"offices"===e.type)),"offices",e);i.add(s),l.add(r),t.geoObjects.add(l),t.geoObjects.add(i)}else{const l=fr(n,"offices",e);i.add(l),t.geoObjects.add(i)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const gr=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?ur:hr,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),fr=(e,t,n)=>e.map((({coords:e,content:l})=>new n.Placemark(e,{balloonContentHeader:l?.header,balloonContentBody:l?.body,balloonContentFooter:l?.footer,hintContent:l?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?ur:hr,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),xr={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},br={...xr,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},yr=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(br).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"})}),vr=e=>globalThis[e],Nr=(e,t)=>{const n=document.getElementById(t);if(n){const t=vr(e);return t?Promise.resolve(t):new Promise((t=>{n.addEventListener("load",(()=>{t(vr(e))}))}))}return new Promise(((n,l)=>{const a=document.createElement("script");a.src=t,a.async=!0,a.id=t,a.addEventListener("load",(()=>{n(vr(e))})),a.addEventListener("error",(e=>{l(e)})),document.head.appendChild(a)}))};const wr=()=>function(e,t,n=!0){const[i,r]=l(void 0);return a((()=>{let l=!0;return Nr(e,t).then((e=>{l&&r(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(l=!1,n){const e=document.getElementById(t);e&&document.head.removeChild(e),r(void 0)}}}),[e,t,n]),i}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${_.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1),Cr={...xr,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},kr=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),l="in"===t?n+1:n-1;e.current.setZoom(l,{checkZoomRange:!0})},className:`${Object.values(Cr).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(W,{name:n,width:"20",height:"16"})})})),Sr=[55.753995,37.614069],Ir=d((({points:e,className:t="",zoom:n=5,isLoad:l,selectedAddress:i})=>{const r=s(null),d=wr();if(a((()=>{r.current?pr({yandexMaps:d,map:r.current,points:e,isLoad:l}):d?.ready((()=>{r.current||(r.current=new d.Map("map",{center:Tr(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),pr({yandexMaps:d,map:r.current,points:e,isLoad:l})}))}),[d,e,n,l,i]),a((()=>{r.current&&i&&d?.geocode(i).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();r.current.setCenter(t),r.current.setZoom(18)}))}),[i]),!d)return null;const m="z-10";return c("div",{id:"map",className:u("relative","w-full",t),children:[l?o(mr,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",m),children:[o(kr,{yandexMaps:r}),o(kr,{yandexMaps:r,direction:"out"})]}),yr(r,d,u("right-2 top-80",m))]})})),Tr=e=>{const t=[Rr(Br(e,0)),Rr(Br(e,1))];return t.every((e=>e))?t:Sr},Br=(e,t)=>e.map((e=>e.coords?.[t])),Rr=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Pr={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},Dr={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},Mr={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 _r({disabled:e,onClick:t}){return n=>{!e&&t&&t(n)}}const zr={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"},Vr={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")},Ar=d((({children:e,...t})=>{const n=e=>({...e,onClick:me(_r(e))}),{className:l,version:a="primary",active:i,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":i,"bg-main-gray text-main-disabled cursor-not-allowed":r,"rounded-md":c},i||r?"":u(zr[a],Vr[a]),l),type:s,role:d,onClick:m,children:e})})),Fr=(e,t)=>e&&"underlined"!==t?"primary":"secondary",Er=(e,t,n)=>{const l=Fr("all"===t),a=Fr("business"===t),i=(e,t,l)=>{const a=e.currentTarget===e.target&&"business"===t?r(l):l;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(Ar,{"data-id":"all",onClick:t=>i(t,"all",e),version:l,children:"Для физических лиц"}),o(Ar,{"data-id":"business",onClick:t=>i(t,"business",e),version:a,children:"Для юридических лиц"})]})},Or=({__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(Pe,{__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(Me,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,Lr="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",$r=({filters:e,field:{field:t,reset:n},onlyOffice:l,labels:a})=>{const i=l?5:6,r=(e||[]).map((e=>o(el,{text:a[e],...t(e)},e))),[s,d]=i>0?[r.slice(0,i),r.slice(i)]:[r,[]];return o("div",{children:e?.length?o("div",{children:o(Mi,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:Lr,children:s}),o(_i,{className:Lr,isUnfolded:e,children:d})]}),renderFoldButton:jr(n,l)})}):null})},jr=(e,t=!1)=>({isUnfolded:n,onToggle:l})=>c("div",{className:"flex space-x-lg",children:[t?o(ye,{version:"transparent",className:"text-secondary-text [&>*]:p-0",appendRight:o(W,{name:["ArrowDownIcon","ArrowUpIcon"][Number(n)],width:"16",height:"16"}),text:["Больше фильтров","Меньше фильтров"][Number(n)],onClick:l}):null,o(ye,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:e,children:qr()})]}),qr=()=>c("div",{className:"flex items-center",children:["Очистить фильтр",o(W,{name:"CloseIcon",width:"16",height:"16",className:"ml-2xs"})]}),Ur=(e,t)=>o("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:c(N,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(Me,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),Wr=()=>{},Hr=e=>"all"===e?"block":"hidden",Yr=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:a=[],renderCard:i=Wr,renderRemoteWorkplaceCard:r=Wr,getBalloon:s=Wr,getBalloonRemoteWorkplaces:d=Wr,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=At(Pr),{filteredItems:b,points:y,filteredRemoteWorkplaces:v,lengthItems:N}=Jr({data:t,remoteWorkplaces:a,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=l("all"),k={filters:Xr([...t,...a]),field:{field:f,reset:x},onlyOffice:p,labels:Dr};return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[Ur(h,N),m?Or(m):null,p&&Er(t,w,C),o("div",{className:u("pb-3xl",Hr(w)),children:$r(k)})]}),o("div",{className:"h-[600px]",children:o(dr,{children:o(Ir,{points:y,isLoad:n,className:"h-full"})})})]}),c(dr,{children:[b.map(i),v.map(r)]})]})})),Kr=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>Mr[t](e)))))},Xr=e=>Object.keys(Pr).filter((t=>e.filter((e=>Mr[t](e))).length)),Gr=()=>{},Jr=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:l=Gr,getBalloonRemoteWorkplaces:a=Gr})=>{const[i,s,o,c]=r((()=>{const i=Kr(e,n),r=Kr(t,n),s=[...i.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:l(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[i,s,r,i.length+r?.length]}),[e,t,n,l,a]);return{filteredItems:i,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},Zr=d((({field:e,input:t})=>{const n=e("regionRetail"),l=e("addressRetail"),i=Wn(),r=n?.value?.key,s=i.find((({region:e})=>e===r)),d=!i,m=n?.value?.text,u=Wn()?.find((e=>e?.region===m))?.branches;a((()=>{""!==n?.value?.key&&e?.("addressRetail")?.onChange?.("")}),[n?.value]);const{points:h}=Jr({data:s?.branches||[],filtrationState:{},getBalloon:or}),p=Boolean(n?.value?.key);return c("div",{children:[o(hn,{label:"Адрес отделения",placeholder:"Выберите отделение",options:(u||[]).map((({address:e=""})=>({key:e,text:e}))),..._n(e("addressRetail"),Rn.addressRetail,t?.required&&p),isSearch:!0}),o("div",{className:"h-[600px]",children:o(dr,{children:o(Ir,{points:h,isLoad:d,className:"h-full",selectedAddress:l?.value?.text})})})]})})),Qr=d((({field:e,input:t})=>{const n=Wn();return o(hn,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:r((()=>n?.map((({region:e=""})=>({key:e,text:e})))),[n]),..._n(e("regionRetail"),Rn.regionRetail,t?.required)})})),es=d((({field:e,input:t})=>o(ln,{label:"Пенсионные доходы",placeholder:"Введите значение",type:"number",..._n(e("retirementIncome"),Rn.retirementIncome,t?.required),...t}))),ts=d((({field:e})=>{const t=e("secondaryPhone");return o(Ci,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?Mn(t,Rn.secondaryPhone):t})})),ns=d((({field:e,input:t})=>o(hn,{label:"Направление обслуживания",placeholder:"Выберите направление",options:La,..._n(e("serviceDirection"),Rn.serviceDirection,t?.required)}))),ls=d((({className:e,label:t,onChange:n,error:l,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ya,{label:qt({label:t,errors:a?.errors}),onChange:e=>n&&n(e),...a}),Gt(l)]}))),as=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],is=d((({field:e,input:t})=>o(ls,{label:"Пол",orientation:"horizontal",items:as,..._n(e("sex"),Rn.sex,t?.required)}))),rs=d((({field:e})=>o(il,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",..._n(e("shareholderFlg"),Rn.shareholderFlg)}))),ss=d((({children:e,onChange:t,...n})=>{const l=i((e=>t&&t(zl(e,"___-___-___ __"))),[t]),a=i((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(Yt,{...n,onChange:l,onFocus:e=>l(e?.target?.value||""),onBlur:e=>a(e?.target?.value||""),children:e})})),os=d((({className:e,label:t,value:n,error:l,onChange:a,onBlur:i,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ss,{"aria-label":t,label:qt({label:t,errors:r?.errors}),valid:Boolean(!l),value:n,onChange:a,onBlur:i,placeholder:"___-___-___ __"}),Gt(l)]}))),cs=d((({field:e,input:t})=>o(os,{label:"СНИЛС",..._n(e("snils"),Rn.snils,t?.required),...t}))),ds=d((({field:e,input:t})=>o(ln,{label:"Фамилия",inputLength:60,disabled:Xn()&&t?.filledByEsia,..._n(e("surname"),Rn.surname,t?.required),...t}))),ms=["От 1 мес","До 15 лет"],us=d((({field:e})=>o(hl,{title:"Срок, месяцев",items:ms,min:1,max:180,...e("term")}))),hs=d((({field:e,input:t})=>o(ln,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",..._n(e("totalIncome"),Rn.totalIncome,t?.required),...t}))),ps=d((({field:e,input:t})=>o(hn,{label:"Тип обслуживания",options:Oa,..._n(e("serviceType"),Rn.serviceType,t?.required)}))),gs=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],fs=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(ya,{className:"whitespace-normal",orientation:"horizontal",items:gs,value:t,onChange:e=>n&&n(e)})})}));const xs={$ref:"/wcms-resources/outservice-productlist.json"},bs=(e,t,n=!1)=>(l,a)=>{const i="ULTRASERVICE"===t||"PREMIUMSERVICE"===t,r={surname:o(ds,{field:e,input:l}),name:o(li,{field:e,input:l}),middleName:o(ni,{field:e,input:l}),phone:o(ki,{field:e,input:l}),organizationPhone:o(ki,{field:e,input:l}),email:o(Da,{field:e,input:l}),fullName:o(qa,{field:e,input:l}),inn:o(Ha,{field:e,input:l}),legalForm:o(Ja,{field:e,input:l}),organizationName:o(si,{field:e,input:l}),generalSeniority:o(Ua,{field:e,input:l}),lastJobExperience:o(Xa,{field:e,input:l}),experience5Years:o(Aa,{field:e,input:l}),jobsNumber:o(Ka,{field:e,input:l}),beginDate:o(Jl,{field:e,input:l}),addressFact:o(Yn,{field:e,input:l}),organizationAddress:o(Gn,{field:e,input:l}),comment:o(ia,{field:e,input:l}),addressBranch:o(Hn,{field:e,input:l,isPremium:i}),sex:o(is,{field:e,input:l}),birthday:o(Zl,{field:e,input:l,isRetailForm:n}),birthPlace:o(ea,{field:e,input:l}),desiredMeetingDate:o(Ca,{field:e,input:l}),product:o(Ti,{field:e,source:xs}),localities:o(ei,{field:e,input:l}),isClient:o(Ya,{field:e}),partnerComments:o(ui,{field:e,input:l}),collectionCount:o(aa,{field:e,input:l}),acquiringType:o(Vn,{field:e,input:l}),onlineCheckout:o(ii,{field:e}),posTerminal:o(Ii,{field:e}),serviceType:o(ps,{field:e,input:l}),term:o(us,{field:e}),amount:o(xl,{field:e}),annualRevenue:o(wl,{field:e,input:l}),vedTypes:o(fs,{field:e}),feedbackMethod:o(ja,{field:e,input:l}),serviceDirection:o(ns,{field:e,input:l}),bankEmpolee:o(Sl,{field:e}),secondaryPhone:o(ts,{field:e}),consentToReceiveMaterials:o(fa,{field:e,input:l}),processPersonalDataFlg:o(fa,{field:e,input:l}),consentProviderFlg:o(fa,{field:e,input:l}),consentOthersFlg:o(fa,{field:e,input:l}),consentInformFlg:o(fa,{field:e,input:l}),consentPfrFlg:o(fa,{field:e,input:l}),applicationDate:o(ln,{label:"Дата и время обращения в Банк",...e("applicationDate")}),region:i?o(Di,{field:e}):o(Pi,{field:e,input:l,url:Ot(t)}),education:o(Pa,{field:e,input:l}),housing:o(Wa,{field:e,input:l}),employment:o(za,{field:e,input:l}),organization:o(ri,{field:e,input:l}),amountWorkers:o(Nl,{field:e,input:l}),employerActivities:o(Ma,{field:e,input:l}),employerOrganization:o(_a,{field:e,input:l}),positionOrganization:o(Si,{field:e,input:l}),familyStatus:o(Ea,{field:e,input:l}),children:o(na,{field:e,input:l}),familyMembers:o(Fa,{field:e,input:l}),dependents:o(wa,{field:e,input:l}),totalIncome:o(hs,{field:e,input:l}),expenses:o(Va,{field:e,input:l}),snils:o(cs,{field:e,input:l}),conscription:o(ra,{field:e,input:l}),armyIdFlg:o(Cl,{field:e,input:l}),dulSerie:o(Ba,{field:e,input:l}),dulNumber:o(Ta,{field:e,input:l}),dulIssueDateField:o(Sa,{field:e,input:l}),dulSubdivisionCode:o(Ra,{field:e,input:l}),dulIssuedBy:o(Ia,{field:e,input:l}),addressRegistration:o(Gn,{field:e,input:l}),participantDateRegistration:o(di,{field:e,input:l}),retirementIncome:o(es,{field:e,input:l}),otherIncome:o(oi,{field:e,input:l}),mandatoryIncome:o(ti,{field:e,input:l}),otherPayments:o(ci,{field:e,input:l}),disablePeopleFlg:o(ka,{field:e,input:l}),bankruptcyFlg:o(Il,{field:e,input:l}),shareholderFlg:o(rs,{field:e,input:l}),legalEntityName:o(Ga,{field:e,input:l}),creditInRshbCd:o(xa,{field:e,input:l}),bankEmployeeCode:o(kl,{field:e,input:l}),partInBusiness:o(mi,{field:e,input:l}),regionRetail:o(Qr,{field:e,input:l}),addressRetail:o(Zr,{field:e,input:l}),addressMatch:o(rl,{field:e,input:l}),paymentSystem:o(pi,{field:e,input:l}),currency:o(Na,{field:e,input:l}),cardCategory:o(ta,{field:e,input:l}),codeWord:o(la,{field:e,input:l})};return function({input:e,field:t}){const{condition:n}=e,{value:l}=t(n?.name||"");return!n||n?.values?.find((e=>e===(l?.key??l)))}({input:l,field:e})?o("div",{children:r[l?.name||""]},String(a)):null},ys=e=>2===e?"@xl:grid-cols-2":"",vs=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Me,{size:"text-h6",children:e})}):null,Ns=d((function({responseType:e,typeForm:t}){const n="OK"===e,l=n?"ResponseOKIcon":"ResponseFailIcon",{close:a}=de(),r=i((()=>{a()}),[]),s="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(ha,{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:l,iconVersion:"normal"},width:"136",height:"136"}),o(k,{className:"w-full",title:n?"Ваша заявка отправлена":"Не удалось отправить заявку",description:n?s:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(Ar,{type:"button",onClick:r,children:"Хорошо"})]})})})),ws=e=>{const{open:t,close:n}=de();return{open:(n,l={})=>t(o(Ns,{...e,...n}),l),close:n}},Cs=e=>t=>t&&Object.entries(e).flatMap((([e,n])=>n(t[e])))||[],ks=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:l,amount:a,term:i,annualRevenue:r,serviceType:s,vedTypes:o,region:c,...d}=e,m=t||r?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:l=!1,term:a,amount:i,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${An(t?.key)?`/Онлайн касса=${n}/POS-терминал=${l}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${i}/Срок=${a}/Выручка=${r}`})(e):null,u={...d,...Is(o),...Ss(c),...m?{partnerComments:m}:{},...s?{typeForm:s}:{}};return Object.fromEntries(Object.entries(u)?.map((([e,t])=>[e,t?.key||t])))},Ss=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},Is=e=>e?{vedTypes:Object.fromEntries(gs.map((({id:t})=>[t,t===e])))}:{},Ts={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:zn[0],serviceType:Oa[0],feedbackMethod:$a[0],serviceDirection:La[0],vedTypes:gs[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1},Bs=d((({text:e,link:t})=>c(w,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(Me,{children:e}):null,t?o(ye,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"!text-left text-primary-main",children:o(Me,{children:t.text})}):null]}))),Rs=(e,t)=>o(Ar,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Ps=(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(el,{...e}),o(Bs,{link:t})]}),Gt(Mn(e,Sn).error)]}):o(Bs,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),Rs(n)]}),Ds={send:async function(e,t=!1){const{typeForm:n,region:l,phone:a="",email:i,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,...Nt(l,g),...wt(i,g),...yt(a),...vt(s,"desiredMeetingDate"),...g?vt(r):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...Ct(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}}},Ms=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))||[],b=((e,t="")=>{const n=Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||Ts[e.name||""]])));return n?.serviceType&&"PREMIUMSERVICE"===t&&(n.serviceType=Oa[1]),{...n,typeForm:{key:t,text:""}}})(x,n),[y,v]=l(""),w=ws({typeForm:n}),C=i((async(e,t)=>{const n=_s(x,e),l=Cs(Dn(n));if(!pn(l(e)))return console.warn("validation fail");const a=ks({...e,...h}),i=await Ds.send(a,"lead"===m)?"OK":"Fail";if(v(i),i&&w.open({responseType:i}),"OK"===i&&g){const e=zt();kt({aspectsAttributes:g,aspects:e,ev:t})}return i}),[]),[,{field:k,onSubmit:S,reset:I}]=At(b,{onSubmit:C}),T=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(x)?.name;return a((()=>{"OK"===y&&(v(""),I())}),[y]),c(Et,{className:u("container space-y-m",e),title:t,...f,children:[c("form",{onSubmit:S,children:[r.map(((e,t)=>c("div",{className:u(ys(e.columns),"grid gap-x-m"),children:[vs(e.title),(e?.inputs||[])?.map(bs(k,n))]},`section-${t}`))),Ps(T?k("consentDataProcessing"):void 0,d,s)]}),p?c("div",{className:"space-y-m",children:[o(N,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex sm:justify-center gap-xl",children:[c("a",{className:"flex gap-s items-center text-primary-text no-underline",href:"tel:8 (800) 200-78-70","aria-label":"телефон 8 (800) 200-78-70",children:[o(ne,{image:{icon:"PhoneIcon"},width:"24",height:"24"}),o("span",{children:"8 (800) 200-78-70"})]}),c("a",{className:"flex gap-s items-center text-primary-text no-underline","aria-label":"почта ved@rshb.ru",href:"mailto:ved@rshb.ru",children:[o(ne,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),_s=(e,t)=>e.filter((e=>"secondaryPhone"===e?.name?Boolean(t.secondaryPhone):e)).filter((e=>!e?.condition||e?.condition.values.find((n=>{const l=t?.[e?.condition?.name??""];return n===(l?.key??l)}))));function zs(e){const[t,n]=l(JSON.parse(globalThis.localStorage?.getItem(e)||"null"));return[t,i((t=>{globalThis.localStorage?.setItem(e,JSON.stringify(t)),n(t)}),[e,globalThis.localStorage])]}const Vs=d((({inputs:e=[],typeForm:t="",field:n,key:l})=>{const a=e.every((e=>Boolean(n(e.name).value))),i=r((()=>e?.filter((e=>e.required))?.some((e=>Boolean(Mn(n(e?.name),Rn[e?.name]).error)))),[e]);return o("div",{className:"w-fit",children:o(Mi,{isFoldButtonOnTop:!0,unfoldedByDefault:!0,renderFoldableSection:({isUnfolded:l})=>o(_i,{isUnfolded:l,className:"flex flex-col pl-2xl",children:e.map(bs(n,t))}),renderFoldButton:As(c("div",{children:[o(el,{value:a,onChange:t=>{for(const l of e){const e=n(l.name);e?.onChange&&e.onChange(t)}},text:"Согласие на все документы"},l),Gt(i?"Отметьте все обязательные соглашения":"")]}))})})})),As=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"})})]}),Fs=({field:e,typeForm:t="",inputs:n,isRetailForm:l=!1})=>{const{consentInputs:a,restInputs:i}=Es(n||[]);return a.length>2?c("div",{children:[i.map(bs(e,t,l)),o(Vs,{inputs:a,field:e})]}):(n||[])?.map(bs(e,t,l))},Es=e=>({consentInputs:e?.filter((e=>Object.keys(sa).includes(e.name||"")))||[],restInputs:e?.filter((e=>!Object.keys(sa).includes(e.name||"")))||[]}),Os={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",organizationPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:zn[0],serviceType:Oa[0],feedbackMethod:$a[0],serviceDirection:La[0],vedTypes:gs[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},Ls=(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||Os[e.name||""]]))),typeForm:{key:n,text:""}}},$s=(e,t)=>o(Ar,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),js=e=>oa("/user-data/updateUserProfile","PUT",e),qs=e=>oa("/user-data/updateUserTask","PUT",e),Us={width:"118",height:"24"},Ws={"bg-white":"color",transparent:"white"},Hs={"bg-white":"text-primary-main",transparent:"text-white"},Ys=(e,t,n)=>o(ne,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:Ws[e]},className:Hs[e],width:n?.width,height:n?.height}),Ks={"bg-white":"text-primary-text",transparent:"text-white"},Xs=d((({className:e,href:t="/",logo:n,children:l,targetBlank:a,bgColor:i="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??"Россельхозбанк",...pe(s),children:[Ys(i,n?.image,Us),r?l??o("div",{className:"ml-s",children:o(Me,{font:"font-medium",color:Ks[i],size:"",children:n?.title??"Россельхозбанк"})}):null]}))),Gs=async({code:e,setHasError:t,close:n,sendCode:l=Ut})=>{const a=await(i={captchaText:e},oa("/sms/checkCaptcha","POST",i));var i;"ERROR"===await a.text()?t(!0):(l(),n?.())},Js=async(e,t)=>{const n=await(e=>oa(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET"))(t);e(URL.createObjectURL(await n.blob()))},Zs=d((({phoneNumber:e,close:t,sendCode:n,onClose:i})=>{const[r,s]=l(""),[d,m]=l(""),[u,h]=l(!1);return a((()=>{Js(s,e)}),[]),o(ha,{head:o(Xs,{}),onClose:i,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:r}),o("div",{onClick:()=>Js(s,e),className:"flex w-8 items-center justify-center cursor-pointer",children:o(W,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(Yt,{className:"w-[300px]",onChange:m,value:d,placeholder:"Введите код с картинки"}),u?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-[310px] justify-between",children:[o(Ar,{onClick:t,version:"secondary",children:"Вернуться"}),o(Ar,{type:"submit",disabled:!d,onClick:()=>Gs({code:d,setHasError:h,close:t,sendCode:n}),version:"secondary",children:"Отправить"})]})]})})})),Qs=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:eo(e)})))),eo=e=>`${`${Math.floor(e/60)}`.padStart(2,"0")}:${(""+e%60).padStart(2,"0")}`,to=async({phoneNumber:e,captchaDialog:t,setTimeNextReq:n,setIsTimerStarted:l,setAttemps:a})=>{try{await(i={phoneNumber:e,smsCodesSetName:{key:"AUTHENTICATION"}},oa("/sms/sendCode","POST",i)).then((t=>{if("string"!=typeof t&&t.errorMessage&&t.errorMessage.startsWith(`Too many request for phoneNumber [${e}]`))throw t})),a(0),n(180),l(!0)}catch(e){t.open()}var i},no=d((({values:e,setValues:t,hasError:n,errorText:r})=>{const[d,m]=l(0),u=s([]);a((()=>{u.current?.[d]?.focus()}),[d]);const h=i((n=>l=>{const{value:a}=l.currentTarget,i=a.slice(0,1);t(e.map(((e,t)=>t===n?i:e))),m(n+1)}),[e]),p=i((n=>l=>{const{key:a}=l;if("Backspace"===a&&!e[n]){const l=n>0?n-1:e.length-1,a=e.map(((e,t)=>t===l?"":e));t(a),m(l)}}),[e]),g=i((n=>{n.preventDefault();const l=n.clipboardData.getData("text"),a=e.map(((e,t)=>t<l.length?l[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,l)=>o("input",{type:"number",maxLength:1,value:t,onChange:h(l),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[l]=e},onFocus:e=>e.target.select(),onKeyDown:p(l),className:lo(l,e,n)},l)))}),n?o("div",{className:"text-error",children:r}):null]})})),lo=(e,t,n=!1)=>{const l=!t[e];return`w-16 h-20 text-3xl text-center p-2 m-2 border ${n&&l?"border-error":"border-gray"} rounded-md caret-transparent outline-none`},ao=d((({isDisabled:e,onClick:t,text:n})=>o(Ar,{type:"button",onClick:t,disabled:e,children:o(Me,{font:"font-medium",children:n})}))),io=e=>{globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token)},ro=({close:e,values:t})=>{const[n,s]=l(!1),[o,c]=l(""),[d,m]=l(!1),[u,h]=l(0),[p,g]=l(!1),[f,x]=l(0),b=i((()=>{s(!1),c("")}),[]),y=r((()=>0===u&&p),[u,p]),v=r((()=>f>2||!t.every(Boolean)||y),[t]),N=i((async()=>{try{g(!1),h(0),x(f+1),m(!0),await(async e=>oa("/sms/checkCode","POST",e).then(io))({smsText:t.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),b(),e&&e(t.join(""))}catch{m(!1),c(f>1?"Исчерпан лимит ввода смс-кода":"Неверный код"),s(!0)}}),[t,f]);return a((()=>{y?(s(!0),c("Код просрочен")):s(!1)}),[y]),{handleSubmit:N,hasError:n,errorText:o,isLoading:d,timeNextReq:u,isSubmitButtonDisabled:v,setTimeNextReq:h,setIsTimerStarted:g,setAttemps:x}},so=d((({close:e=Ut,onClose:t=Ut,title:n,description:r,__html:s,code:d=!0,codeLength:m=4,textButton:u="",phoneNumber:h="+79999999999"})=>{const[p,g]=l(Array(m).fill("")),{handleSubmit:f,hasError:x,errorText:b,isLoading:y,timeNextReq:v,isSubmitButtonDisabled:N,setTimeNextReq:w,setIsTimerStarted:C,setAttemps:S}=ro({values:p,close:e}),I=i((()=>{to({phoneNumber:h,captchaDialog:T,setTimeNextReq:w,setIsTimerStarted:C,setAttemps:S})}),[]),T=((e,t)=>{const{open:n,close:l,closeAll:a}=de();return{open:()=>n(o(Zs,{close:l,onClose:t,...e})),close:l,closeAll:a}})({phoneNumber:h,sendCode:I},t);return a((()=>{I()}),[]),o(ha,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg",children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[o(k,{className:"w-full",title:n,description:r,headlineVersion:"S",isEmbedded:!0}),d?o(no,{values:p,setValues:g,errorText:b,hasError:x}):null,co(v,w,I),o(Pe,{itemSize:"list-s",__html:s}),oo(u,N,f),y?o(mr,{blur:!1}):null]})})})),oo=(e,t,n)=>e?o(ao,{isDisabled:t,onClick:n,text:e}):null,co=(e,t,n)=>e?c("div",{className:"flex flex-row text-l font-light text-primary-main",children:["Получить новый код можно через",o(Qs,{className:"text-primary-main ml-1",time:e,setTime:t})]}):o(ye,{onClick:n,className:"text-primary-main",children:"Получить новый код"}),mo=()=>{const{open:e,close:t}=de();return{open:(n,l)=>e(o(so,{onClose:t,close:n,...l})),close:t}},uo={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},ho={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},po=d((function({handleSubmit:e=Ut,onClose:t=Ut}){const[n,a]=l(""),[r,s]=l(!1),{open:d,close:m}=de(),u=Ce(),h=i((()=>{m(),e(n)}),[n]),p=i((e=>{a(e),"REFUSE"===e&&s(!0)}),[]),g=r?ho:uo;return o(ha,{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:()=>pa(d,fo,u),children:o(N,{className:"text-center text-balance",headingType:"h2",title:g.title})}),o(w,{align:"text-center",children:g.description}),o(ya,{className:"whitespace-normal",orientation:"horizontal",items:go,value:n,onChange:p}),o(Ar,{disabled:!n,type:"button",onClick:h,children:"Продолжить"})]})})})),go=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],fo=2,xo=e=>{const{open:t,close:n}=de(),l=mo(),a=(t,a)=>async i=>{n(),"SIGNED"===i&&t?l.open((t=>async n=>{t&&await js({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()})(a),bo(t)):e()};return{open:(n,l)=>t(o(po,{handleSubmit:a(n,l),onClose:e}))}},bo=e=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:bt(e),textButton:"Отправить",__html:"<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>\n <ul><li>согласие на запрос информации в БКИ</li></ul>"}),yo=d((function({handleClose:e}){const t=i((async()=>{const e=await(t={redirectUri:globalThis.location.href},oa("/esia/getLink","POST",t));var t;e&&(globalThis.location.href=e.link)}),[]);return o(ha,{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(Ar,{type:"button",onClick:t,children:"Заполнить через Госуслуги"}),o(Ar,{type:"button",version:"secondary",onClick:e,children:"Пропустить"})]})]})})})),vo={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},No={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK"},wo={mandatoryIncome:"INCOME_AVERAGE",otherPayments:"MANDATORY_PAYMENTS"},Co=e=>Object.entries(e).reduce(((e,[t,n])=>t in vo?[...e,{contactTypeCd:{key:vo[t]},value:n}]:e),[]),ko=e=>Object.entries(e).reduce(((e,[t,n])=>t in No?[...e,{addressType:{key:No[t]},...n}]:e),[]),So=({inputs:e,programId:t,nextStepLink:n,saveForm:a})=>{const[r,s]=l(""),[,c]=zs("taskId"),[,d]=zs("profileId"),[,m]=zs("participantId"),u=(e=>{const{open:t,close:n}=de(),l=i((()=>{n(),globalThis.location.href=e}),[]);return{open:(e={})=>t(o(yo,{handleClose:l}),e),close:n}})(n),h=xo(u.open),p=mo(),g=i(((e,t,n)=>{m(e),c(t),d(n)}),[]);return{handleSubmit:i((async n=>{const l=Cs(Dn(e));if(!pn(l(n)))return console.warn("validation fail");try{const{profile:{id:e}}=await(i={profile:{phone:bt(n.phone)}},oa("/public-data/createUserProfile","POST",i));if(e&&n?.phone){const l=async()=>{try{await Io({programId:t,profileId:e,formData:n,saveUserData:g,saveForm:a}),p.close(),h.open(n.phone,e)}catch{s("Fail")}},i=Object.keys(sa).filter((e=>n[e])).map((e=>sa[e]?.text));p.open(l,To(n?.phone,i))}}catch{s("Fail")}var i}),[]),responseStatus:r}},Io=async({programId:e,profileId:t,formData:n,saveUserData:l,saveForm:a})=>{const i=Ro(n);await js(((e,t)=>{const{name:n="",surname:l="",middleName:a="",birthday:i="",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:l,midname:a,birthDate:i&&xt(i,!0),email:s,phone:bt(r),processPersonalDataFlg:Boolean(o),consentProviderFlg:Boolean(c),consentPfrFlg:Boolean(d),consentPhotoFlg:Boolean(m),consentAssignmentClaimsFlg:Boolean(u),consentCollectionFlg:Boolean(h),consentInformFlg:Boolean(p)}}})(t,i));const{taskId:r,participantId:s}=await(o={profileId:t,programId:e},oa("/user-data/createDraftTask","POST",o));var o;await qs((({participantId:e,taskId:t,profileId:n,formData:l})=>{const{name:a,surname:i,middleName:r,birthday:s,phone:o,email:c}=l;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:globalThis.location.origin,id:t,participants:[{birthDate:s&&xt(s,!0),id:e,midname:r,name:a,surname:i,profile:{id:n},participantContacts:Co({phone:o&&bt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}]}}})({participantId:s,taskId:r,profileId:t,formData:i})),l(s,r,t),a(n)},To=(e,t)=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:bt(e),textButton:"Оформить",__html:`<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>${Bo(t)}`}),Bo=e=>`<ul>${e?.map((e=>"<li>"+e+"</li>")).join("")}</ul>`,Ro=e=>{const{consentOthersFlg:t,...n}=e;return{...n,consentCollectionFlg:t,consentAssignmentClaimsFlg:t,consentPhotoFlg:t}},Po=e=>{const{profile:t,addInfo:n,document:l,addressRegistration:a,addressFact:i}=e;return{name:t?.name,surname:t?.surname,middleName:t?.midname,birthday:t?.birthDate,phone:Ni(t?.phone),email:t?.email,dulIssueDateField:l?.dulIssueDate,dulIssuedBy:l?.dulIssuedBy,dulNumber:l?.dulNumber,dulSerie:l?.dulSerie,dulSubdivisionCode:l?.dulSubdivisionCode,snils:n?.snils,birthPlace:n?.birthPlace,addressRegistration:Do(a),addressFact:Do(i)}},Do=e=>{const{postcode:t,region:n,regionCode:l,locality:a,city:i,street:r,house:s,building:o,block:c,apartment:d}=e,m=[t,n,a||i,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:l?.key,fullAddress:m}},Mo=e=>{const[t,n]=l(!1),[r]=zs("profileId"),[s,o]=zs("leadForm"),c=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),d=c.get("code"),m=c.get("state"),u=i((async()=>{if(r&&d&&m){const n=await(t={profileId:r,code:d,state:m,redirectUri:globalThis.location?.href},oa("/esia/updateProfileEsia","POST",t));o({...s,...Po(n)}),globalThis.location.href=e}var t}),[]);return a((()=>{d?(n(!0),u()):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),{isLoading:t}},_o=d((({className:e,title:t,programId:n="",nextStepLink:i="/credit-lead",sections:r=[],button:s,...d})=>{const m=r?.flatMap((e=>e?.inputs))||[],[h,p]=l(""),{isLoading:g}=Mo(i),[f,x]=zs("leadForm"),b=Ls(m,f),{handleSubmit:y,responseStatus:v}=So({inputs:m,programId:n,nextStepLink:i,saveForm:x});if(v){ws({responseType:v}).open()}const[,{field:N,onSubmit:w,reset:C}]=At(b,{onSubmit:y});return a((()=>{"OK"===h&&(p(""),C())}),[h]),o(Et,{className:u("container space-y-m",e),title:t,...d,children:c("form",{onSubmit:w,className:"space-y-m relative",children:[g?o(mr,{blur:!1}):null,r.map(((e,t)=>c("div",{className:u(ys(e.columns),"grid gap-x-m"),children:[vs(e.title),Fs({field:N,inputs:e?.inputs,isRetailForm:!0})]},`section-${t}`))),$s(s)]})})})),zo=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black",link:l})=>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(Pe,{__html:e}),l?.text?o(ye,{className:"text-primary-main",children:l.text}):null]})]}))),Vo=d((({interval:e=0,title:t,__html:n})=>{const[a,i]=l(e),r=100-(e-a)/e*100;return c("div",{children:[t?o(k,{title:t,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) ${r}%, 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(Qs,{interval:e,time:a,setTime:i})})]}),n?o(Pe,{__html:n}):null]})]})})),Ao=d((({title:e,description:t,infoCard:n,sectionInfoTitle:l,sectionInfo:a,sectionAdditionalTitle:i,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(Vo,{interval:d}):null]}),o(Fo,{title:l,items:a}),o(Fo,{title:i,items:r,countColumns:!0}),n?.__html?o(zo,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(Ar,{className:"w-full mt-lg",children:s}):null]}))),Fo=({title:e,items:t,countColumns:n=!1})=>{const l=Ce();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(Me,{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",ys(n||l?1:2)),children:t.map(((e,t)=>o("div",{children:Eo(e)},t)))}):null]})]}):null},Eo=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Me,{color:"text-secondary-text",size:"text-l",children:e}),o(Me,{color:"text-primary-text",size:"text-xl",children:t})]}),Oo=d((({title:e,description:t})=>{const n=Ce();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"})]})})),Lo=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",$o=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function jo(e,{sensitivity:t,rootRef:n}={}){const l=s(null),i=r((()=>({threshold:qo(t),root:n?.current})),[t,n?.current]);return a((()=>{if(!l.current)return;const t=new IntersectionObserver(e,i);return t.observe(l.current),()=>{t.disconnect()}}),[e,i]),l}function qo(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 Uo=d((({className:e,style:t,idx:n,activeIndex:l,observerOptions:a,children:r,onIntersection:s})=>{const c=jo(i((e=>{e.length&&s&&s(n||0,e[e.length-1])}),[s,n]),a);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===l),ref:c,role:"listitem",children:r})})),Wo=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],Ho=d((({className:e,itemClassName:t,containerRef:n,activeIndex:l,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},b=s([]),y=i(((e,t)=>{const n=[...b.current||[]];n[e]=t,b.current=n,g&&g(n),f&&f(Ko(n))}),[g,f]),v=a>0?r*Number(a)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?Yo(c,v):{},...N?$o(h):{},gap:`${r}px`};return o("div",{className:u("box-border overflow-auto no-scrollbar",d,e),style:C,ref:n,role:"list",children:(k=(e,n)=>o(Uo,{className:u(m,a?Wo[a-1]:"",{"h-full":N},t),style:w?Yo(c/4):{},activeIndex:l,idx:n,observerOptions:x,onIntersection:y,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(k):k(e,0))(p)});var k})),Yo=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Ko=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Xo={"horizontal-list":"w-6","vertical-list":"h-6"},Go=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(l,a)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",a===e?Xo[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(a)},String(a)),Jo=({activeIndex:e,onClick:t})=>(n,l)=>{const a=l===e,i=a?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover: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(l),"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",i),children:[o("div",{className:r,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(l))},Zo=e=>e,Qo=(e=Zo)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),ec=Qo(),tc=(e=Zo)=>Qo((t=>-e(t))),nc=tc(),lc=e=>t=>e.scrollWidth/t,ac=e=>(t,n)=>{e.scrollBy({left:n*lc(e)(t),behavior:"smooth"})},ic=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[a,r]=l([]),o=i((e=>{r((t=>{return(n=t)===(l=e)||Boolean(n&&l&&n?.length===l?.length&&n.every(((e,t)=>e===l[t])))?t:e;var n,l})),t&&t(e)}),[t]),[c,d]=a.length?[tc()(a),Qo()(a)]:[-1,-1],m=c>0,u=d<e-1,h=i((()=>{var t;n.current&&(m?ac(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=i((()=>{n.current&&(u?ac(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=i(((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}]},rc={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},sc=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:l="horizontal-list",version:r,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=Ce(),[h,p]=ic({itemCount:s.length}),g=oc(Boolean(s?.length));a((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=i((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(Ho,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(Jo({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",rc[l],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(Go({activeIndex:t,onClick:f,listType:l}))}):null})),oc=(e=!1)=>({behavior:e?"auto":"smooth"}),cc=d((({className:e,disabled:t,...n})=>o(ye,{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"})}))),dc=d((e=>o(cc,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),mc=d((e=>o(cc,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),uc="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",hc=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:l,isBottom:a})=>{const{canScrollLeft:i,canScrollRight:r,scrollLeft:s,scrollRight:d}=t,m=l&&!a;return c("div",{className:e,children:[n?pc(t):null,i?o(dc,{className:u(gc(a),m?"left-1":"left-0"),onClick:s}):null,r?o(mc,{className:u(gc(a),m?"right-1":"right-0"),onClick:d}):null]})})),pc=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(uc,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(uc,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),gc=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),fc=d((({className:e,version:t,gap:n=14,padding:l=16,visibleItemCount:a=1,listType:i="horizontal-list",snapAlign:r,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:x})=>{const b=Array.isArray(g)?g.length:0,[y,v]=ic({itemCount:b,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===i?"relative h-full":""),children:[o(Ho,{containerRef:y,activeIndex:N,visibleItemCount:a,gap:n,padding:l,listType:i,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(hc,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(sc,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:b,listType:i,version:t,navButtons:x,containerRef:y,containerScroll:v})]})})),xc=({blocksToRender:e,...t})=>o(fc,{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",Lo(!0)),children:T(e,t)},String(n))})}),bc=e=>e%2!=0,yc=d((({textNode:e,iconNode:t,tag:n,onClick:l,justifyContent:a="between",className:i,role:r,...s})=>c(n,{tag:n,className:u("flex items-center w-full gap-1","between"===a?"justify-between":"justify-center",i),onClick:l,role:r,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),vc=d((({className:e="",label:t,icon:n,dataTheme:l="pc",disabled:a=!1,onClick:i})=>o(yc,{tag:"button",onClick:i,disabled:a,"data-theme":l,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(Me,{size:"text-h4",children:t}),iconNode:n?o(ne,{image:{icon:n,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),Nc=({isUnfolded:e,onToggle:t})=>o(vc,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),wc=["ArrowDownIcon","ArrowUpIcon"],Cc="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",kc=({topItemsCount:e=0,label:t="",block:n,blocksToRender:l=[],...a})=>{const[i,r]=e>0?[l.slice(0,e),l.slice(e)]:[l,[]];return c("div",{className:u("space-y-2xs",{hidden:!l.length}),children:[c("div",{className:u(Cc),children:[R(i,{...a.options,parent:n}),bc(i.length)?o(gt,{className:"col-span-6",...a}):null]}),o(Mi,{renderFoldableSection:({isUnfolded:e})=>c(_i,{className:u(Cc),isUnfolded:e,children:[R(r,{...a.options,parent:n}),bc(r.length)?o(gt,{className:"col-span-6",...a}):null]}),renderFoldButton:({isUnfolded:n,onToggle:l})=>o(vc,{className:u({hidden:e<1}),disabled:!r?.length,label:t,icon:wc[Number(n)],dataTheme:a.options?.page?.colorPalette,onClick:l})})]})},Sc=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...l})=>{switch(e?.view){case"grid":return c("div",{children:[Ic(n,t),kc({...e,...l,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[Ic(n,t),xc({...l,blocksToRender:t})]});default:return null}})),Ic=(e,t)=>e&&!t.length?o(Oo,{...e}):null,Tc=e=>t=>t.reduce(((t,n,l)=>t.length?t.concat({...e,key:`sep-${l}`},n):[n]),[]),Bc=d((({value:e,onChange:t,items:n=[],multiple:l})=>n.map((n=>o(ai,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const a=e?.includes(n);t(l?a?(e||[]).filter((e=>e!==n)):[...e||[],n]:a?[]:[n])})(n.value),type:l?"checkbox":"radio"},n.value))))),Rc=d((({children:e,filtrationSchema:t,resetButton:n,field:l,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,Tc(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(Pc(l)).filter(Boolean))]}),n?o("div",{children:o(Ar,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:a,children:n?.text})}):null]}))),Pc=e=>([t,n])=>{const l=n?.type;return"array"===l?Dc(t,e)(n):null},Dc=(e,t)=>n=>{const l=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(Me,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(Bc,{items:l,multiple:!n?.single,...t(e)})]},e)};function Mc(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const _c=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,zc=(e,t)=>Object.entries(e).map((([n,l])=>"number"==typeof l?Array.isArray(t[n])?((e,t)=>n=>_c(t[e])||_c(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>_c(t[e])||_c(n[e])||Vc(t[e])<=Vc(n[e]))(n,e):"object"==typeof l&&"min"in l&&"max"in l?((e,t)=>n=>_c(t[e])||_c(n[e])||Vc(t[e]?.min)>=Vc(n[e]?.min)&&Vc(t[e]?.min)<=Vc(n[e]?.max))(n,e):Array.isArray(l)?((e,t)=>n=>_c(t[e])||_c(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>_c(t[e])||_c(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),Vc=e=>Number(e||0),Ac=(e,{block:t,page:n,normalize:l=Vt})=>{const a=t?.blocks||[],[i,{field:s,reset:o,update:c}]=At(e),d=r((()=>Mc(a,a.map((e=>mt(e.content,n?.fallback))))),[a,n?.fallback]),m=i===e?a:((e,t)=>(n=Vt)=>e?.filter((([,e])=>zc(t,n(e)||{}))).map((([e])=>e)))(d,i)(l);return[i,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},Fc={},Ec={},Oc=ht((({className:e,filtrationSchema:t=Fc,consumerField:n={},resetButton:l,...a})=>{const[,{blocksToRender:i},{field:r,reset:s}]=Ac(Ec,{block:a.block,page:a.options?.page}),d=o(cn,{className:"w-64",label:n?.title,options:Lc(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>Lc(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...a,children:[o(Rc,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(Ar,{type:"reset",className:"mt-lg w-64",onClick:s,version:l?.version,children:l?.text})})]})}),o(Sc,{blocksToRender:i,...a})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),Lc=e=>Mc(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),$c=(e=!1)=>e?"text-left":"text-center",jc={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},qc=d((({className:e,defaultIconSize:t=44,iconBgVersion:n="primary",size:l,icon:a,...i})=>{const r=String(l?.width||t);return a?o("div",{style:{width:`${r}px`,height:`${r}px`},className:u("rounded-icon object-fit flex justify-center items-center",jc[n],e),children:o(W,{...i,width:"54%",height:"54%",name:a})}):null})),Uc=d((({className:e="",title:t,benefitList:n,...l})=>{const a=Ce();return c(g,{className:e,defaultPadding:"p-6xl",...l,children:[t?o(N,{headingType:"h3",as:"h2",className:$c(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(Wc)}):null]})})),Wc=({label:e,description:t,__html:n,icon:l,isDotted:a=!1,iconBgVersion:i},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[l?.icon?o(qc,{className:"shrink-0",iconBgVersion:i,...l}):null,l?.src?o(ne,{className:"shrink-0",image:l}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(N,{headingType:"h6",children:e}),o(Me,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(Pe,{__html:n,isDotted:a,itemSize:"list-s"}):null]}):null]},String(r)),Hc=e=>({icon:t,title:n,description:l},a)=>c("div",{className:u("flex flex-col gap-1","items-center",{"justify-center":!l&&!n}),children:[n?o(Me,{size:"text-h6",font:"font-normal",align:e,children:n}):null,t?o(ne,{image:t,height:"180",className:"w-auto mx-auto"}):null,l?o(Me,{size:"text-h6",font:"font-normal",align:e,children:l}):null]},String(a)),Yc=(e,t,n)=>o("div",{className:`grid gap-2xs ${Kc(t)}`,children:e.map(Hc(n))}),Kc=e=>{switch(e){case"3":return"grid-cols-3";case"4":return"grid-cols-4";default:return"grid-cols-5"}},Xc=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:l="4",subtitle:a,title:i,...r})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...r,children:[o(k,{defaultPadding:"",title:i,description:a,headlineVersion:"M"}),e?.length?Yc(e,l,t):null]}))),Gc={start:"justify-start",center:"justify-center",end:"justify-end"},Jc=d((({buttons:e,className:t="",align:n,...l})=>{const a=n&&u("flex",Gc[n]);return o(g,{className:u("!bg-transparent",a,t),defaultPadding:"p-0",...l,children:Le(e)})})),Zc=d((({className:e,title:t,children:n,...l})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...l,children:[t?o(N,{className:"text-center",title:t}):null,n]}))),Qc="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",ed="flex flex-col lg:max-w-80 lg:w-1/2 gap-2xl",td="flex flex-col gap-y-xl min-w-52",nd=d((({value:e,fractionDigits:t,fixed:n,prefix:l,postfix:a})=>o(Me,{size:"text-h3",children:"number"==typeof e?[l,Ue(t,{fixed:n})(e),a].filter(Boolean).join(" "):e}))),ld=d((({className:e,title:t,value:n,color:l="text-secondary-text",...a})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(Me,{size:"text-l",font:"font-light",color:l,children:t}):null,n?o(nd,{value:n,...a}):o(Me,{size:"text-h3",children:"-"})]}))),ad=(e,t)=>e?o(w,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,id=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:l=2,depositeName:a,isShowDepositeName:i,color:r="text-secondary-text"})=>c("div",{children:[o(Me,{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:Ue(l,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),a&&i?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:a}):null]})]}))),rd=d((({title:e="Ставка"})=>c("div",{className:"space-y-s min-w-96",children:[o(Me,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(W,{className:"w-10 h-auto lg:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:o(w,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Процентная ставка не найдена, выберите другие параметры"})})]}))),sd=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:l=2,color:a="text-secondary-text",children:i,...r})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(id,{title:e,rate:t,unit:n,fractionDigits:l,color:a,...r})}),o(ld,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:l,fixed:!0,color:a,...r}),i]}):o(rd,{title:e,...r}),od=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...l})=>o(hl,{items:e?[`От ${Ue(1)(l.min||0)} ${n}`,`До ${Ue(1)(l.max||0)} ${n}`]:[],step:t,...l}),cd={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},dd={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},md=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:l}=e,[a,i]=((e,t,n)=>{const{maxBonus:l=5e3,prefMonthsNum:a=cd.prefMonthsNum,prefTravelBonusRate:i=cd.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(i*t)+Math.round(r*n),l);return[c,c*a+Math.min(Math.round(s*t)+Math.round(o*n),l)*(12-a)]})(t||dd,n,l);return{...t,...e,monthBonus:a,yearBonus:i}},ud=ht((({className:e="",title:t,calcSource:n,buttons:l,footnote:a,...i})=>{const[r,{field:s}]=At({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=md(r,n);return o(Zc,{className:e,title:t,...i,children:c("section",{className:u(Qc,e),children:[c("div",{className:ed,children:[od({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),od({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?sd({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:td,children:[f>=0?o(ld,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,Le(l,{isVertical:!0}),ad(a)]})]})})})),hd=Math.round(29.5),pd=(e,t=0)=>e?.sum?e.sum:t,gd=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,fd=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,xd=({items:e,title:t,mobileTitle:n=t,orientation:l="horizontal",value:a,onChange:i,...r})=>c("div",{className:"grid gap-s whitespace-nowrap",children:[t?o("div",{className:"hidden @5xl:block",role:"radiogroup","aria-label":t,children:o(Me,{color:"text-secondary-text",font:"font-light",children:t})}):null,n?o("div",{className:"@5xl:hidden",role:"radiogroup","aria-label":n,children:o(Me,{color:"text-secondary-text",font:"font-light",children:n})}):null,o(ya,{orientation:l,items:e,value:e[a?0:1].id,onChange:t=>i&&i(t===e[0].id),...r})]}),bd=e=>xd({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),yd=" (c капитализацией)",vd=({income:e,finalSum:t,postfix:n="₽",buttons:l=[],footnotes:a=[],isCapitalization:i=!1})=>c("div",{className:td,children:[o(ld,{title:`Доход в конце срока${i?yd:""}`,value:e,postfix:n,prefix:"+"}),o(ld,{title:`Сумма в конце срока${i?yd:""}`,value:t,postfix:n}),Le(l,{isVertical:!0}),a?.map(ad)]}),Nd=([e,t],n,l=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:wd([e,t],l),wd=([e,t],n=[])=>({[e]:n.length?nc(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?ec(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),Cd=(e,[t,n],l)=>e>=l[t]&&e<=l[n],kd={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const Sd={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Id=(e,t)=>{const{daysValue:n,moneyValue:l,isPartialWithdrawal:a,isReplenished:i,isMonthlyInterestPayment:r}=e,s=i||a,o=n<90||n>730,c=function(e){const t=e?.rateType?kd[e?.rateType]:"",{data:n}=$n(t?`/api/v1/depositrates/${t}`:null,st);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&Td(s,e)&&Cd(l,["minSum","maxSum"],e)&&Cd(n,["minDays","maxDays"],e)))||Sd,{rate:m}=d,u=Bd(m,e),h=l+u,p=c||[Sd];return{...d,...wd(["minSum","maxSum"],p),...wd(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},Td=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Bd=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:l,daysValue:a}=t;return n?Math.round(l*Math.pow((1200+e)/1200,a/30)-l):Math.round(l*e*a/365/100)},Rd=ht((({className:e="",title:t,buttons:n,footnote:l,bottomFootnote:a,isShowDepositeName:i,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=At({moneyValue:pd(r,1e5),daysValue:gd(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=Id(m,s),{income:g,finalSum:f,rate:x,depositeName:b}=p;return o(Zc,{className:e,title:t,...d,children:c("section",{className:u(Qc,e),children:[c("div",{className:ed,children:[od({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(y={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(hl,{items:[`От ${fd(y.min||0)}`,`До ${fd(y.max||0)}`],step:1,...y})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[Pd(p,h),bd({title:"Выплата процентов",orientation:"vertical",...h("isMonthlyInterestPayment"),className:"sm:flex-col"})]})]}),sd({rate:x,depositeName:b,isShowDepositeName:i}),vd({income:g,finalSum:f,buttons:n,footnotes:[l,a]})]})});var y})),Pd=(e,t)=>c("div",{className:"space-y-s",children:[o(Me,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(el,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(el,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),Dd=(e=[],t=!1)=>Md([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),Md=(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]},_d=({min:e=0,max:t=0,availableMonths:n,...l})=>o(hl,{items:[`От ${zd(e)}`,`До ${zd(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...l}),zd=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Vd=e=>xd({...e,className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Ad=({field:e,defParams:t,calcParams:n,map:l,monthsValue:a="maxMonths"})=>{Object.entries(l).forEach((([n,l])=>{e?.(n)?.onChange?.(t?.[l])})),e?.("monthsValue")?.onChange?.(ol(t?.[a],n.minMonths,n.maxMonths))},Fd=(e,t)=>{const{isAnnuity:n,moneyValue:l,monthsValue:a,moneyExtra:i}=t;if(0===e)return 0;if(n){const t=e/1200;return i?(l+i)*(t+t/(Math.pow(1+t,a)-1)):l*(t+t/(Math.pow(1+t,a)-1))}return Math.round(l/a)+l*(e/1200)},Ed={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Od=e=>Ld({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Ld({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&Ld({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&Ld({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Ld=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:l,viewSettingFieldKey:a})=>!!n&&!n[a]||t[l]===e[l],$d=(e,t,n)=>{const{moneyValue:l,monthsValue:a}=e,i=t?.rateRows||[Ed],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Od({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Nd(["minSum","maxSum"],r,i),{minMonths:c,maxMonths:d}=Nd(["minMonths","maxMonths"],r,i),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:l,monthsValue:a})=>e?.find((e=>Od({row:e,userInputParams:t,paramsViewSettings:n})&&Cd(l,["minSum","maxSum"],e)&&Cd(a,["minMonths","maxMonths"],e)))||Ed)({rateRows:i,userInputParams:e,paramsViewSettings:n,moneyValue:l,monthsValue:a}),{rate:u}=m,h=Fd(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:l,monthsValue:a,monthlyPayment:h}},jd=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),qd={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},Ud=ht((({className:e,title:t,calcSource:n,buttons:l,footnote:i,paramsViewSettings:r,defaultParams:s,registerSubmit:d,...m})=>{const h=(p=n?.rateRows,Md([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],p));var p;const[g,{field:f,onSubmit:x}]=At({moneyValue:pd(s,2e5),monthsValue:gd(s,hd),isAnnuity:Boolean(s?.isAnnuity),isInsurance:Boolean(s?.isEnableInsurance),isSalaryClient:Boolean(s?.isEnableSalaryClient),isPensionClient:Boolean(s?.isEnablePensionClient),isStateEmployee:Boolean(s?.isEnableStateEmployee)});d?.(x);const b=$d(g,n,r),y=Vd({title:"Тип платежа",orientation:"vertical",...f("isAnnuity")}),{onChange:v}=f("moneyValue"),{onChange:N}=f("monthsValue");return a((()=>{v&&v(ol(g.moneyValue,b.minSum,b.maxSum))}),[b.minSum,b.maxSum]),a((()=>{N&&N(ol(g.monthsValue,b.minMonths,b.maxMonths))}),[b.minMonths,b.maxMonths]),a((()=>{!jd(s)&&h&&Ad({field:f,defParams:h,calcParams:b,map:qd,monthsValue:"minMonths"})}),[n,s]),o(Zc,{className:e,title:t,...m,children:c("section",{className:u(Qc,e),children:[c("div",{className:ed,children:[od({title:"Сумма кредита, ₽",step:500,min:b.minSum,max:b.maxSum,...f("moneyValue"),value:b.moneyValue}),_d({title:"Срок кредита, месяцев",min:b.minMonths,max:b.maxMonths,...f("monthsValue"),value:b.monthsValue}),Wd({...b,...r},f),o("div",{className:"sm:hidden",children:y})]}),c("div",{className:u(td,"@4xl:w-1/2"),children:[o(ld,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(ld,{title:"Ставка",value:b?.rate,fractionDigits:2,postfix:"%"}),o(ld,{title:"Ежемесячный платёж",value:b.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:y}),Le(l,{isVertical:!0}),ad(i)]})]})})})),Wd=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(el,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(el,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(el,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(el,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),Hd=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,l]=t[n-1],[a,i]=t[n];l>=a?t.splice(n-1,2,[e,Math.max(l,i)]):n++}return t},Yd={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},Kd=(e,t,n)=>{const{moneyValue:l,monthsValue:a}=e,i=t?.[0]?Jd(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=>[Gd({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),Gd({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),Gd({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),Gd({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,Cd(l,["minSum","maxSum"],t),Cd(a||i,["minMonths","maxMonths"],t)].every(Boolean)))||Yd,{rate:u}=m,h=Xd(u,e),p=l+h,g=t||[Yd];return{...m,...wd(["minSum","maxSum"],g),...wd(["minMonths","maxMonths"],g),availableMonths:Hd(g.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((l,a)=>t>=e?e+a*n:e-a*n)))(e,t))),...e,defaultMonth:i,income:h,finalSum:p}},Xd=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:l,monthsValue:a}=t;return n?Math.round(l*Math.pow((1200+e)/1200,a)-l):Math.round(l*e*30*a/365/100)},Gd=({row:e,userInputParams:t,paramKey:n,isExclude:l})=>l||t[n]===e[n],Jd=(e,t)=>e+Math.round((t-e)/2),Zd=(e="rub")=>"rub"===e,Qd=(e,t)=>{const{minMonths:n,maxMonths:l}=wd(["minMonths","maxMonths"],lm(t,e?.currency)),a=e.monthsValue||Math.round((n+l)/2);return{monthsValue:ol(a,n,l)}},em=(e,t)=>{const{minSum:n,maxSum:l}=wd(["minSum","maxSum"],lm(t,e?.currency)),a=e.moneyValue||n;return{moneyValue:ol(a,n,l)}},tm=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),nm=e=>{const t=Zd(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},lm=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},am=(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?xd({title:"Пополнение",...t("isReplenish"),value:e.isReplenish,orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,e.isShowWithdrawn?xd({title:"Снятие",...t("isWithdrawn"),value:e.isWithdrawn,orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null]}),im(e.isShowReplenish||e.isShowWithdrawn),c("div",{className:"flex gap-lg",children:[e.isShowMonthlyInterestPayment?bd({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment,orientation:"vertical"}):null,e.isShowRemoteRegistration?(l={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration,orientation:"vertical"},xd({...l,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]}),im(e.isShowNewClient),e.isShowNewClient?o(el,{text:"Новый вкладчик",...t("isNewClient")}):null]});var l},im=(e=!1)=>e?o("div",{className:"border-b border-main-divider w-full"}):null,rm={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum"},sm={text:"₽",key:"rub"},om=ht((({className:e,title:t,calcSource:n,buttons:l=[],footnote:r="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[sm],g=i((e=>t=>e?{...t,...nm(t),...em(t,e),...Qd(t,e),...tm(t,e)}:t)(h),[h]),[f,{field:x}]=At({moneyValue:pd(d,2e4),monthsValue:gd(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:sm},{normalize:g}),b=x?.("currency")?.value??sm,y=x?.("isNewClient")?.value,v=lm(h,b),N=Kd(f,v,s),{rate:w,income:C,finalSum:k,type:S=""}=N,I=i((()=>{Ad({field:x,defParams:Dd(v,y),calcParams:N,monthsValue:"minMonths",map:rm})}),[x,h]);a((()=>{!jd(d)&&v&&I()}),[d,h]);const T=w===Dd(v,y)?.rate;return o(Zc,{className:e,title:t,...m,children:c("section",{className:u(Qc,e),children:[c("div",{className:ed,children:[c("div",{className:"flex gap-m",children:[od({className:"w-full",title:`Сумма, ${b?.text}`,min:N.minSum,max:N.maxSum,...x("moneyValue"),value:N.moneyValue,postfix:b?.text,step:cm(b?.key)}),h&&h?.length>1?o(hn,{label:"Валюта",options:p,...x("currency")}):null]}),_d({title:"Срок, месяцев",min:N.minMonths,max:N.maxMonths,availableMonths:N.availableMonths,...x("monthsValue"),value:N.monthsValue}),am({...N,...s},x)]}),sd({rate:w,children:mm(I,T)}),vd({income:C,finalSum:k,buttons:[...l,dm(n?.buttons,S)],footnotes:[r],postfix:b?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),cm=(e="")=>Zd(e)?1e3:100,dm=(e=[],t="")=>{const{type:n,...l}=e.find((e=>e.type===t))??{};return l},mm=(e,t=!1)=>t?null:o(Ar,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),um=e=>hm({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&hm({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),hm=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:l,viewSettingFieldKey:a})=>!!n&&!n[a]||t[l]===e[l],pm={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},gm=(e,t,n)=>{const{moneyValue:l,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r}=e,s=t?.rateRows||[pm],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>um({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Nd(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Nd(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:l,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r})=>e?.find((e=>um({row:e,userInputParams:t,paramsViewSettings:n})&&Cd(l+r,["minSum","maxSum"],e)&&Cd(i,["minSumOld","maxSumOld"],e)&&Cd(r,["minSumExtra","maxSumExtra"],e)&&Cd(a,["minMonths","maxMonths"],e)))||pm)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:l,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r}),{rate:p}=h,g=Fd(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:l,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r,monthlyPayment:g,benefit:f}},fm=ht((({className:e="",title:t,calcSource:n,buttons:l,footnote:a,paramsViewSettings:i,...r})=>{const[s,{field:d}]=At({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),m=gm(s,n,i),h=Vd({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")});return o(Zc,{className:e,title:t,...r,children:c("section",{className:u(Qc,e),children:[c("div",{className:ed,children:[od({title:"Остаток долга в других банках, ₽ ",step:500,min:m.minSum,max:m.maxSum-m.maxSumExtra,...d("moneyValue"),value:m.moneyValue}),od({title:"Ежемесячный платёж в других банках, ₽",step:500,min:m.minSumOld,max:m.maxSumOld,...d("oldMonthlyPayment"),value:m.oldMonthlyPayment}),_d({title:"Новый срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),xm({...m,...i},d),m.isExtraMoney?od({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(td,"@4xl:w-1/2"),children:[o(ld,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(ld,{title:"Ставка",value:m?.rate,fractionDigits:2,postfix:"%"}),o(ld,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),m.benefit>0?o(ld,{title:"Выгода в месяц",value:m.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:h}),Le(l,{isVertical:!0}),ad(a)]})]})})})),xm=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(el,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(el,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(el,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),bm=d((e=>{const{onChange:t,min:n,max:l,defaultValue:a="0",fractionDigits:r=0,...s}=e,c=sl(e,{normalize:(e=a)=>n&&l?String(ol(Number(ym(e)),n,l)):ym(e),format:Ue(r)}),d=i((e=>t&&t(ym(e))),[t]);return o(Yt,{onChange:d,...s,...c})})),ym=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),vm=d((e=>o(bm,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Me,{size:"text-xl",font:"font-light",children:"₽"})})}))),Nm={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},wm={amount:1500},Cm=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:i,formType:r="private",...s})=>{const[{amount:d},{field:m}]=At(wm),[h,p]=l(!1);return a((()=>{p(d<=0)}),[d]),c(g,{className:u("flex flex-col items-center",e),defaultPadding:"p-6xl",...s,children:[t?o(N,{className:"pb-lg xl:pb-4xl self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-[468px]",method:"POST",action:Nm[r],children:[o(vm,{valid:!h,label:n,max:3e5,min:1,...m("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:d}),i?.text?o(Ar,{className:"w-full mt-lg",type:"submit",disabled:h,children:i.text}):null]})]})})),km=({className:e,text:t="ХИТ"}={})=>c("div",{className:u("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(W,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(w,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),Sm="relative h-full",Im={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},Tm=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...l})=>{const{blocks:a}=l.block||{},i=a?.some(Pm),r=n?{defaultPadding:"p-6xl pb-m"}:{};return P({...l,renderProps:(n,l,a)=>c("div",{className:Bm(n,{someCardsHighlighted:i}),children:[T(n,l,{className:Rm(n,{someCardsHighlighted:i,showBorder:!e,cardSize:t}),...r,blockIndex:a}),Pm(n)?km({className:"absolute top-0 -right-4 z-40"}):null]},String(a))})},Bm=(e,{someCardsHighlighted:t})=>u(Sm,t&&(Pm(e)?"pt-3xl":"pt-3xl sm:pt-16")),Rm=(e,{someCardsHighlighted:t,showBorder:n,cardSize:l="normal"})=>u(Sm,"min-w-80",Im[l],t&&(Pm(e)?"pt-3xl sm:pt-16":"pt-3xl"),Lo(n),n&&"h-full"),Pm=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,Dm=ht((({className:e,visibleItemCount:t=1,noCardBorder:n,arrowsPadded:l=!0,isGap:a=!0,cardSize:i="normal",isNavButtons:r=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(fc,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:a?16:0,padding:0,arrowsPadded:l,navButtons:r?Mm(s?.block?.blocks):[],hasBlur:!0,children:Tm({noCardBorder:n,cardSize:i,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),Mm=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],_m="z-10 border border-solid w-full h-full",zm=u(_m,"absolute hidden @xl:block border-transparent"),Vm=d((({className:e,title:t,description:n,button:l,...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(zm,"top-9 right-12 bg-green-dark")}),o("div",{className:u(zm,"top-6 right-8 bg-green")}),o("div",{className:u(zm,"top-3 right-4 bg-green-light")}),c("div",{className:u(_m,"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}),Le([l],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),Am={black:"bg-black",white:"bg-white"},Fm=d((({className:e="",title:t,description:n,image:l,price:a,button:i,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(Ie,{className:"h-full",padding:d,title:o(k,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:l?.src?o(ne,{className:"flex justify-center align-center mb-xl",image:l}):null,buttons:Le([i],{buttonClassName:"w-full self-end"}),children:[r?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(Me,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(Em)]}):null,a?c(Me,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),Em=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${Am[e]}`},String(t)),Om=d((({icon:e,...t})=>{const n=ue(),{text:l,href:a,target:i,onClick:r}=n(t);return l?o("div",{className:u("p-3 rounded-lg bg-white text-secondary-text flex justify-center"),children:o("a",{role:"link",href:a,target:i,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:l}):null,o("div",{className:"font-light md:font-normal text-primary-text text-center text-xs md:text-sm whitespace-wrap",children:l})]})})}):null})),Lm=d((({className:e,additionalDescription:t,description:n,links:l,title:a,...i})=>o(g,{defaultPadding:"p-5xl",className:u("overflow-hidden",e),...i,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})]}),l?.length?$m(l):null]})}))),$m=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(Om,{...e},String(t))))}),jm=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"mindboxEvent"===e?{...n,eventJson:t}:n}))),qm=d((({className:e="",href:t,target:n,onClick:l,data:a,children:i})=>{const r=ue()({href:t,target:n,onClick:l});return o(t?"a":"div",{className:u("block",e),...t?r:{},role:t?"link":"none",...pe(a),children:i})})),Um=[{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"}}],Wm=d((({className:e="",media:t,showButtonText:n,stretched:a,version:i="white",children:r})=>{if(!t?.length)return null;const[s,d]=l(),m=t?.map((e=>{const{href:t,icon:l,text:a}=e,{iconMapped:r}=(e=>Um.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=Oe(l)?l: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??i}})),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},Hm(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:Le(m,{className:Ym(s??!1,a??!1,n),buttonClassName:h})}),r?o(Me,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),Hm=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",Ym=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),Km=d((({className:e,padding:t,description:n,additionalDescription:l,href:a,icon:i,isDotted:r,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:x=!0,isImageAlwaysOnRight:b=true,isImageSecondary:y=!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(qm,{href:a,target:m,className:"h-full",data:jm(v),children:c(Ie,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(k,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...Je(Oe(i)?o(ne,{image:i}):null,x),buttons:d.length?o(Wm,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:b,isImageSecondary:y,imageAlign:"center",children:[o(Ee,{benefits:f}),s?o(Pe,{__html:s,isDotted:r,itemSize:"list-s"}):null,Xm(l,p)]})})}))),Xm=(e,t)=>e?o(w,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,Gm=(e,t)=>{const{title:n,description:l,buttons:a}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(Me,{size:"text-m",color:"text-secondary-text",children:n})}):null,l?o("div",{className:"mt-2xs",children:o(Me,{size:"text-xl",color:"text-primary-text",children:l})}):null,a?.length?o("div",{className:"text-primary-main",children:Le(a)}):null]},String(t))},Jm=d((({className:e="",title:t,align:n="text-center",icon:i,button:r,visibleCellsCount:s=1,cardCells:d=[],options:m,data:h,...p})=>{const f=d.map(Gm),[x,b]=s>0?[f.slice(0,s),f.slice(s)]:[f,[]],[y,v]=l(!1);return a((()=>ce.subscribe("fold",(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:[Oe(i)?o("div",{className:"self-center",children:o(ne,{image:i})}):null,t?o(N,{className:u("pt-xs",n),headingType:"h5",title:t}):null,r?.text?o(ye,{className:"w-full mt-m mb-lg",...r}):null,b.length?o(Mi,{renderFoldableSection:()=>c("div",{children:[x,o(_i,{isUnfolded:y,children:b})]}),renderFoldButton:d.length>=s?Zm(m?.parent,h,y):null}):o("div",{children:x})]})})),Zm=(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&&ce.fire("fold",{type:"fold",isUnfolded:!n,parent:e})},type:"button",...n?pe(t):{},children:[o("div",{children:n?"Скрыть":"Подробнее о тарифе"}),o(W,{className:"text-primary-text",name:n?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),Qm=d((({className:e,contacts:t,info:n,version:l="secondary",...a})=>c(g,{className:u("flex",e),defaultPadding:"p-6xl",version:l,...a,children:[n?.length?eu(n):null,t?.length?eu(t):null]}))),eu=e=>o("div",{className:"flex gap-5xl grow basis-0",children:e.map(((e,t)=>tu({column:e,i:t})))}),tu=({column:e,i:t})=>e?o("div",{className:"flex flex-col gap-xl grow basis-0",children:e.map((({title:e="",description:t,additionalDescription:n,button:l},a)=>c("div",{children:[o(k,{title:e,description:t,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),n?o("div",{className:"mt-xs opacity-80",children:o(w,{size:"text-m",font:"font-light",children:n})}):null,o("div",{className:u({"mt-xl":Boolean(l?.text)}),children:Le([l])})]},String(a))))},`col-${String(t)}`):null,nu=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]})]}))),lu=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const l=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(nu,{step:l,showPercentage:!1})]})})}));var au;!function(e){e.process="IN_PROCESS",e.ok="OK",e.fail="FAILED",e.rework="REWORK"}(au||(au={}));const iu=d((({title:e,description:t,infoCard:n,sectionInfoTitle:l,sectionInfo:a,sectionAdditionalTitle:i,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(Vo,{interval:d}):null]}),o(ru,{title:l,items:a}),o(ru,{title:i,items:r,countColumns:!0}),n?.__html?o(zo,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(ye,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),ru=({title:e,items:t,countColumns:n=!1})=>{const l=Ce();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(Me,{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",ys(n||l?1:2)),children:t.map(((e,t)=>o("div",{children:su(e)},t)))}):null]})]}):null},su=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Me,{color:"text-secondary-text",size:"text-l",children:e}),o(Me,{color:"text-primary-text",size:"text-xl",children:t})]}),ou=d((()=>o(iu,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит.\n Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),cu=d((()=>{const[e]=zs("leadForm");return o(iu,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:e?.moneyValue?.toLocaleString()+" ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}]})})),du=d((()=>{const[e]=zs("leadForm");return o(iu,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),mu=d((()=>{const[e]=zs("leadForm");return o(iu,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),uu=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],hu=d((()=>{const[e,t]=l(au.process),[n]=zs("taskId");return a((()=>{for(const e of uu)oa("/user-data/sendSignalToProcess","POST",{signalType:e,taskId:n});const e=setInterval((()=>(e=>oa("/user-data/getTaskStatus","POST",e))({taskId:2816419}).then((n=>{n.statusCd&&n.statusCd!==au.process&&(clearInterval(e),t(n.statusCd))}))),3e4)}),[]),pu(e)})),pu=e=>({IN_PROCESS:o(cu,{}),FAILED:o(ou,{}),OK:o(mu,{}),REWORK:o(du,{})}[e]||null),gu={0:{moneyValue:0,monthsValue:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1},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:""},2:{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:"",inn:void 0,jobsNumber:"",lastJobExperience:"",legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},3:{familyStatus:{key:"",text:""},dependents:void 0,familyMembers:void 0,mandatoryIncome:void 0,otherPayments:void 0,snils:"",armyIdFlg:!1},4:{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},5:{regionRetail:"",addressRetail:"",bankEmployeeCode:""}},fu=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(zo,{__html:e},`${t}_${n}`))):null},xu=({field:e,inputs:t})=>(t||[])?.map(bs(e,"")),bu=({sections:e,field:t})=>e?.map((({inputs:e,columns:n,title:l},a)=>c("div",{className:u(ys(n),"grid gap-x-m"),children:[fu(e),vs(l),xu({field:t,inputs:e})]},`section-${a}`))),yu=d((({step:e,onPrevStep:t})=>{const n=0===e;return c("div",{className:"flex justify-between",children:[o(Ar,{onClick:t,className:u("w-full @xl:w-auto"),type:"button",version:"secondary",disabled:n,children:"Назад"}),o(Ar,{className:u("w-full @xl:w-auto"),type:"submit",children:"Далее"})]})})),vu=e=>{const{name:t,surname:n,middleName:l,birthday:a="",phone:i="",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:b}=e;return{birthDate:xt(a,!0),midname:l,name:t,surname:n,birthPlace:o,dulIssueDate:xt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:xt(g,!0),houseTypeCd:f,participantContacts:Co({phone:bt(i),email:r}),participantAddresses:ko({addressRegistration:x,addressFact:b}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}},Nu=(e,t)=>{switch(e){case 1:default:return vu(t);case 2:return(e=>{const{employment:t,organizationName:n,inn:l,legalForm:a,organization:i,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:l,organizationActivityTypeCd:s,organizationTypeCd:i,organizationKindCd:o,employeesNumberCd:r,opf:a,seniority:c,generalSeniority:m,jobsNumber:u,lastWorkDuration:d,positionCd:g,participantContacts:Co({organizationPhone:h&&bt(h)}),participantAddresses:ko({organizationAddress:p})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:l,mandatoryIncome:a,otherPayments:i,snils:r,armyIdFlg:s}=e;return{maritalStatusCd:t,totalDependents:l,otherDependents:n,participantIncomes:(o={mandatoryIncome:a,otherPayments:i},Object.entries(o).reduce(((e,[t,n])=>t in wo?[...e,{incomeTypeCd:{key:wo[t]},value:n}]:e),[])),snils:r?.replaceAll(" ",""),armyIdFlg:s};var o})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:l,creditInRshbCd:a}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:l,creditInRshbCd:a}})(t)}},wu=({step:e,inputs:t,onNextStep:n,saveStep:l,finishForm:a})=>{const[r]=zs("taskId"),[s]=zs("profileId"),[o]=zs("participantId"),c=i((async i=>{const c=Cs(Dn(Cu(i,t,e)));if(!pn(c(i)))return console.warn("validation fail");l(i);try{r&&s&&o&&await qs((({participantId:e,taskId:t,profileId:n,formData:l,step:a=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:globalThis.location.origin,id:t,authorizedAgentId:l?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Nu(a,l)}]}}))({participantId:o,taskId:r,profileId:s,step:e,formData:i}))}catch(e){return"Fail"}return n(),5===e&&a?.(!0),"OK"}),[]);return{handleSubmit:c}},Cu=(e,t,n)=>2===n&&"employment"in e&&"RETIREE"===e?.employment?.key?[]:t,ku=d((({step:e,sections:t,onPrevStep:n,onNextStep:l,inputs:a,renderStep:r=bu,isFormFinished:d,finishForm:m})=>{const[u,h]=zs("leadForm"),p=((e,t)=>(t&&(t.birthday=t.birthday?new Date(t.birthday):void 0,t.dulIssueDateField=t.dulIssueDateField?new Date(t.dulIssueDateField):void 0,t.participantDateRegistration=t.participantDateRegistration?new Date(t.participantDateRegistration):void 0,t.beginDate=t?.beginDate?new Date(t.beginDate):void 0),{...gu[e],...t}))(e,u),g=s(void 0),f=i((e=>{g.current=e}),[]),{handleSubmit:x}=wu({step:e,inputs:a,onNextStep:l,saveStep:h,finishForm:m}),[,{field:b,onSubmit:y}]=At(p,{onSubmit:(e,t)=>{x({...e,...g.current?.(t)})}});return d?o(hu,{}):c("form",{onSubmit:y,className:"space-y-m",children:[r({sections:t,field:b,registerSubmit:f}),o(yu,{step:e,onPrevStep:n})]})})),Su=[[],[{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:"mandatoryIncome",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"otherPayments",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"}]}]],Iu=["","Персональные данные","Данные о трудоустройстве","Данные о доходах и расходах","Дополнительные сведения","Отделение Банка"],Tu=d((({className:e,...t})=>{const[n,a]=l(0),s=i((()=>{a((e=>Math.min(e+1,5)))}),[]),d=i((()=>{a((e=>Math.max(e-1,0)))}),[]),m=r((()=>Su[n]),[n]),h=m?.flatMap((e=>e?.inputs))||[],p=0===n,[f,x]=l(!1);return o(g,{className:u("bg-transparent",e),defaultPadding:"p-0",...t,children:c("div",{className:"container grid grid-cols-12",children:[p||f?null:o(lu,{stepsTitles:Iu,step:n,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(ku,{step:n,inputs:h,sections:m,onNextStep:s,onPrevStep:d,isFormFinished:f,finishForm:x,renderStep:p?({registerSubmit:e})=>o(Ud,{title:"Калькулятор кредита",footnote:"Расчёт является предварительным. Точные условия будут предоставлены в отделении Банка.",calcSource:{$ref:"/wcms-resources/credit-calculator-data.json"},registerSubmit:e}):void 0},String(n))})]})})})),Bu=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,Ru=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),Pu=1e9,Du={sum:{min:1e4,max:Pu},period:3},Mu=ht((({className:e,filtrationSchema:t={},resetButton:n,sumInput:l,periodInput:a,...i})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=Ac(Du,{block:i.block,page:i.options?.page,normalize:e=>({...e,period:_u(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=zu(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...i,children:[o(Rc,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(vm,{label:l?.title,min:500,max:Pu,...d("sum",{parse:e=>({min:Number(e),max:Pu}),format:({min:e})=>String(e)})}),o(hl,{title:a?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(Sc,{blocksToRender:r,...i})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),_u=e=>ot((e?.paramsSource?.rateRows||[]).filter(Bu).flatMap((e=>Ru(e.minMonths,e.maxMonths)))),zu=e=>ot(e.flatMap((e=>e||[])).filter(Bu).flatMap((e=>Ru(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],Vu=[{key:"10"},{key:"50"},{key:"100"}],Au=({itemCount:e,onItemCountChange:t})=>{const n=i((({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(cn,{className:"min-w-20",onChange:n,value:{key:String(e)},options:Vu,iconVersion:"black"})]})},Fu="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",Eu=(e,t)=>{const{currentPage:n,onPageChange:l,totalPages:a}=e,i=t+1;return i===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:i},String(t)):1!==i&&i!==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))(i,n,a)?o("div",{onClick:()=>l(i),className:Fu,"aria-label":`Страница ${i}`,children:i},String(t)):null},Ou={width:"24",height:"24"},Lu=({currentPage:e,onPageChange:t,totalPages:n})=>{const l=r((()=>Array.from({length:n}).fill({currentPage:e,onPageChange:t,totalPages:n})),[n,e]),a=i((()=>{e>1&&t(e-1)}),[e]),s=i((()=>{e<n&&t(e+1)}),[e,n]),d=i((()=>t(1)),[]),m=i((()=>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:$u(1===e),...Ou})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:Fu,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,l.map(Eu),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:Fu,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(W,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:$u(e===n),...Ou})})]})},$u=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",ju=({currentPage:e,onPageChange:t,totalPages:n,itemCount:l,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(Lu,{currentPage:e,onPageChange:t,totalPages:n}),l&&a?o(Au,{itemCount:l,onItemCountChange:a}):null]}),qu=d((({className:e,value:t,autoFocus:n,onChange:l,onFocus:a,placeholder:r="Поиск по сайту"})=>{const s=i((e=>{l&&l(e.target?.value||"")}),[l]);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",Wt),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:n,onChange:s,onFocus:a})]})})),Uu=d((({field:e,onClearFilter:t,filtrationState:n})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(qu,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(Xl,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(Xl,{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(Ar,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),Wu=({title:e,timestamp:t,publicId:n})=>{const l=ue(),{href:a}=l({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:[null,c("div",{className:"flex flex-col gap-x-6xl lg:flex-row lg:items-center",children:[t?o(Me,{size:"text-m","font-weight":"font-light",children:xt(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:a,download:!0,"aria-label":"Скачать",children:e})]})]},n)},Hu="/api/v1/depository",Yu={startDate:void 0,endDate:void 0,query:""},Ku=ht((({className:e,...t})=>{const[n,a]=l(0),[r,s]=l(10),[d,{field:m,reset:h}]=At(Yu),{totalPages:p=0,items:f=[]}=(({size:e,page:t,query:n,startDate:l,endDate:a})=>{const i=l?xt(l,!0):"",r=a?xt(a,!0):"",s=new URLSearchParams(Hu);s.set("page",String(t)),s.set("size",String(e)),s.set("query",n),s.set("timestampStart",i),s.set("timestampEnd",r);const o=`?${s.toString()}`,{data:c}=$n(Hu+o,st);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:n,...d}),x=i((e=>a(e-1)),[]),b=i((e=>{r!==e?(s(e),a(0)):s(e)}),[]);return c(g,{className:u(e,"container p-6xl"),...t,children:[o(Uu,{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(Me,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(Me,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),f.length?f.map((e=>o(Wu,{...e},String(e.publicId)))):o(Oo,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(ju,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:b})]})]})})),Xu=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,Gu=d((({className:e="",title:t,description:n,error:l,button:a,...i})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...i,children:[o("div",{className:"flex justify-center",children:Xu(l)}),o(k,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),a?.text?o(ye,{version:a?.version,text:a?.text,...a}):null]}))),Ju="location";function Zu(e="Москва"){const[t,n]=((e,t,n)=>{const[r,s]=l(n||null);return a((()=>e.subscribe(t,(e=>s(e)))),[e,t]),[r,i((n=>e.fire(t,n)),[e,t])]})(ce,"location",eh()??{name:e}),r=i((e=>{th(e),n(e)}),[]),{data:s}=$n(Qu()?null:"/api/v1/region",st);return a((()=>{s&&!Qu()&&n(s)}),[s]),[t??{name:e},r]}const Qu=()=>Boolean(globalThis.localStorage?.getItem(Ju)),eh=()=>{try{const e=globalThis.localStorage?.getItem(Ju);return e&&JSON.parse(e)}catch(e){return null}},th=e=>{try{globalThis.localStorage?.setItem(Ju,JSON.stringify(e))}catch(e){}};var nh;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(nh||(nh={}));const lh=new Intl.NumberFormat("ru",{style:"currency",currency:nh.RUB}),ah=e=>e?lh.format(e):"",ih="text-m font-light text-secondary-text ",rh=`${ih} text-left`,sh=`${ih} pl-5xl text-center`,oh=`${ih} pl-5xl text-right`,ch={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},dh=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:rh,children:o(Me,{size:"text-m",children:"Валюта"})}),o("th",{className:sh,children:o(Me,{size:"text-m",children:"Купить"})}),o("th",{className:oh,children:o(Me,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(mh)})]}))),mh=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:ch[t]},width:"24",height:"24"}):null,o(Me,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(Me,{size:"text-h6",children:ah(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(Me,{size:"text-h6",children:ah(e?.buyExchangeRate)})})]},t)},uh={icon:"GpsIcon"},hh=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(qc,{...uh,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(w,{size:"text-l",color:"text-primary-main",children:t}):null,o(w,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),ph=(e,t,n)=>{const l=Number(gh(e))*Math.pow(t,n?-1:1);return Number.isInteger(l)?l:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(l)},gh=e=>e.replace(/[^\d.,]/g,"").replace(",","."),fh=e=>Rt([[e=>e.value!==nh.RUB&&e.oppositeValue!==nh.RUB,()=>e.handleConvert(e.value,nh.RUB)],[e=>e.value===nh.RUB&&e.oppositeValue===nh.RUB,()=>e.handleConvert(e.value,nh.USD)],[e=>e.value===nh.RUB&&e.oppositeValue===nh.RUB,()=>e.handleConvert(e.value,nh.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function xh(e){const{placeholder:t,rates:n,selected:l,value:a,setValue:i,setSelected:r}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:l,text:l};return c("div",{className:"relative flex",children:[o(Yt,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:a,onChange:i}),s.length?o(cn,{className:"absolute right-0",isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const bh=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:a})=>{const[r,s]=l({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||nh.RUB,selectBuy:n?.[0]?.currency?.currency||nh.USD}),d=i((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:[xh({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:yh(r,d,n),value:r.inputSell,setValue:e=>Nh(d,n)(e,r.selectSell,r.selectBuy)}),xh({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:vh(r,d,t),value:r.inputBuy,setValue:e=>wh(d,t)(e,r.selectBuy,r.selectSell)})]}):null,a?.text?o(ye,{text:a.text,version:a?.version,...a}):null]})})),yh=(e,t,n)=>l=>{t({selectSell:l}),fh({value:l,oppositeValue:e.selectBuy,handleConvert:(l=e.selectSell,a=e.selectBuy)=>{Nh(t,n)(e.inputSell,l,a)}})},vh=(e,t,n)=>l=>{t({selectBuy:l}),fh({value:l,oppositeValue:e.selectSell,handleConvert:(l=e.selectBuy,a=e.selectSell)=>wh(t,n)(e.inputBuy,l,a)})},Nh=(e,t)=>(n,l,a)=>{e({inputSell:gh(n),selectBuy:a});const i=t.find((e=>e.currency?.currency===a))?.buyExchangeRate||t.find((e=>e.currency?.currency===l))?.buyExchangeRate;i&&e({inputBuy:String(ph(n,i,l===nh.RUB)||"")})},wh=(e,t)=>(n,l,a)=>{e({inputBuy:gh(n),selectSell:a});const i=t.find((e=>e.currency?.currency===a))?.saleExchangeRate||t.find((e=>e.currency?.currency===l))?.saleExchangeRate;i&&e({inputSell:String(ph(n,i,l===nh.RUB)||"")})};const Ch=d((({className:e="",title:t="Курсы обмена валют",button:n,...l})=>{const[a]=Zu(),i=function(e){const t=e?.code||"000",{data:n}=$n(`/api/v1/exchangerates?regionCode=${t}`,st);return n||{}}(a),r=kh(i?.exchangeRate?.currencies),s=r.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:nh.RUB}});const d=r.filter((e=>e.saleExchangeRate));return d.push({currency:{currency:nh.RUB}}),o(g,{className:u("box-border min-h-80",e),...l,children:o(Ie,{className:"h-full",title:o(N,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap @lg:flex-nowrap",children:[c("div",{className:"w-full @2xl:w-auto @5xl:w-1/2",children:[r?o(dh,{className:"mb-xl",exchangeCurrencyItems:r}):null,o(hh,{address:i?.address})]}),o(bh,{className:"grow w-1/2",currencyRatesBuy:s,currencyRatesSell:d,button:n})]})})})})),kh=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],Sh=d((({className:e="",items:t})=>{const n=ue();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(Ih(n))})})),Ih=e=>({dataFooter:t,...n},l)=>{const{text:a,href:i,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:i,target:r||"_self",onClick:s,...pe(t),children:a||null})},String(l)):null},Th=e=>t=>!t.displayArea||e.includes(t.displayArea.toLowerCase()),Bh=["all","footer"],Rh=d((({className:e,navigationItems:t})=>{const n=ue();return o("div",{role:"menu",className:u("w-full flex items-start justify-between flex-col md:flex-row gap-y-m lg:order-2",e),children:t?.filter(Th(Bh)).map(n).map(Ph)})})),Ph=(e,t)=>{const{text:n,items:l=[],href:a,target:i="_self",onClick:r,dataFooter:s}=e,d=l.filter(Th(Bh));return c("div",{role:"menuitem",className:"flex flex-col gap-s w-full @md:w-1/4",children:[o("a",{className:"leading-5 text-l text-primary-text hover:text-primary-main no-underline",href:a,target:i,onClick:r,...pe(s),children:n}),d?o(Sh,{items:d}):null]},String(t))},Dh=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(Mh)}):null)),Mh=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(Me,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(_h)})]},String(t)),_h=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:zh(e.type,e.text)}),o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),zh=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Vh(t)}`,children:o(Me,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(w,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},Vh=e=>e.replaceAll(/\D/g,""),Ah=d((({className:e="",index:t,text:n,...l})=>{const a=ue(),{href:i,target:r,onClick:s}=a(l);return o("a",{className:u("text-secondary-text",e),href:i,target:r,onClick:s,children:n||`Документ ${t}`})})),Fh=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(Me,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(Ah,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),Eh="w-full lg:w-52";function Oh(e,t,n=300){a((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}const Lh=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:l,s2Matches:a}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),l=Array.from({length:e.length}),a=Array.from({length:t.length});let i=0;for(let r=0;r<e.length;r++){const s=Math.max(0,r-n),o=Math.min(r+n,t.length-1);for(let n=s;n<=o;n++)l[r]||a[n]||e[r]!==t[n]||(i++,l[r]=!0,a[n]=!0)}return{m:i,s1Matches:l,s2Matches:a}}(e,t);if(0===n)return 0;const i=function(e,t,{s1Matches:n,s2Matches:l}){let a=0;for(let i=0,r=0;i<e.length;i++){if(!n[i])continue;let s=r;for(;s<t.length;s++)if(l[s]){r=s+1;break}e[i]!==t[s]&&a++}return a}(e,t,{s1Matches:l,s2Matches:a}),r=(n/e.length+n/t.length+(n-i/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 $h=(e,t)=>(n,l)=>{for(const[a,i]of l)n.set(a,e(n.get(a)||t,i));return n},jh=(e=[])=>e.reduce(((e,t)=>e+t),0),qh=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),Uh=e=>t=>e.map((([e,n])=>[Lh(t)(e),n])).filter((([e])=>e>=.8)).map((([e,t])=>Hh(t,e))).reduce($h(Math.max,0),new Map),Wh=e=>t=>{return Mc(t,t.map((({title:e})=>e)).map((e=>t=>{const n=qh(t||"");return n.length?jh(e.map((e=>ec(n.map(Lh(e)))))):0})(e))).sort((l=([,e])=>e,n=(e,t)=>l(e)-l(t),(e,t)=>-n(e,t))).map((([e])=>e));var n,l},Hh=(e,t)=>new Map(e.map((e=>[e,t]))),Yh=({basePathList:e,initialQuery:t=""})=>{const[n,i]=l(t||"");a((()=>{null!=t&&i(t)}),[t]);const{data:r}=$n(e?.length?e:null,Kh),[s,o]=l(null);return Oh((()=>{r&&o(r.map((e=>t=>{const{corpus:n,dictionary:l}=t||{};if(!(e&&n?.length&&l&&Object.keys(l).length))return[];const a=qh(e);if(!a.length)return[];const i=Object.entries(l),r=[...a.map(Uh(i)).reduce($h(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*a.length)).map((([e])=>n[e]));return Wh(a)(r)})(n)))}),[r,n]),[s,{value:n,onChange:i}]},Kh=async(...e)=>(await Promise.allSettled(e.map((e=>rt(E(e,"/","search.index.json")))))).map((e=>"fulfilled"===e.status?e.value:{})),Xh=d((({initialQuery:e,navigationItems:t})=>{const n=r((()=>t?.map((e=>e.href||"/"))),[t]),[l,a]=Yh({basePathList:n,initialQuery:e}),i=r((()=>Gh(t)(l)),[t,l]);return o(ha,{head:o(qu,{autoFocus:!0,...a}),children:o(Rh,{navigationItems:i})})})),Gh=e=>t=>e?.length&&t?.length?Mc(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:E("/",t)})))}))):[],Jh=(e={})=>{const{open:t,close:n}=de();return{open:(n={},l={})=>t(o(Xh,{...e,...n}),l),close:n}},Zh=d((({className:e,search:t,...n})=>{const[a,r]=l(""),s=i((()=>r("")),[]),d=Jh(n),m=i((e=>{r(e),Qh(e)&&d.open({initialQuery:e},{onClose:s})}),[s,d]);return c("div",{className:u("relative",e),role:"search",children:[o(qu,{value:a,placeholder:t?.placeholder,onChange:m}),o(ua,{className:"absolute top-0 right-0 sm:hidden",onClose:s})]})})),Qh=e=>e&&e.length>=3,ep=(e,t)=>{const{logo:n}=e??{},{dataHeader:l,dataFooter:a,...i}=n??{};return c("div",{className:"flex items-stretch gap-3xl",children:[o(Xs,{className:Eh,logo:i,data:a,showTitle:!1}),o(Zh,{className:"grow",navigationItems:t,...e})]})},tp=d((({className:e="",index:t,...n})=>{const l=ue(),{href:a,target:i,text:r,onClick:s}=l(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:i,onClick:s,children:r||`Документ ${t}`})})),np=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(Me,{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(tp,{index:t,...e},String(t))))}):null]}))),lp=ht((({className:e,footer:t,...n})=>{const{navigationItems:l}=n.options?.page?.navigation??{},a=n.options?.page?.common??{},{documents:i,relatedEnterprises:r,contacts:s,mediaLinks:d=[],horizontalNavigationTitle:m,feedbackButton:h,license:p,otherLinks:f=[]}=t??{};return c(g,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...n,children:[ep(a,l),c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(Rh,{navigationItems:l}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u(Eh,"flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(Dh,{items:s}),h?o(ye,{className:"w-full",version:"primary",...h}):null,d.map(((e,t)=>o(Wm,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),f.map(((e,t)=>o(ye,{className:"!text-left text-s font-light",version:"link",...e,children:e?.text},String(t))))]})]}),o(Fh,{title:m,links:r}),o(np,{links:i,license:p})]})})),ap=d((({className:e="",title:t,description:n,calendar:l,...a})=>c(g,{className:u("space-y-m",e),defaultPadding:"p-6xl",...a,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0}),l?ip(l):null]}))),ip=e=>{const t=100/(e.reduce(((e,t)=>t?.month?.length?e+t.month.length:e),0)||1),n=e.filter((e=>e?.month?.length)).map((e=>({...e,flexBasis:`${e?.month?.length?e.month.length*t:""}%`})));return c("div",{className:"w-full flex flex-col justify-center gap-s",children:[o("div",{className:"flex w-full text-h6 text-center",children:n.map((e=>rp(e,t)))}),o("div",{className:"flex gap-s w-full",children:n.map(((e,t)=>c("div",{className:"border-r border-main-divider last:border-r-0 space-y-s",style:{flexBasis:e.flexBasis},children:[o("div",{className:"flex gap-s",children:sp(e)}),c("div",{className:"text-s",children:[o(Me,{size:"text-s",font:"font-light",color:"text-primary-text",children:e.text})," ",o(Me,{size:"text-s",font:"font-light",color:"text-primary-main",children:e.greenText})]})]},`monthItem-${t}`)))})]})},rp=(e,t)=>e.month?.map(((e,n)=>o("div",{style:{flexBasis:`${t}%`},children:e.text},`monthName-${n}`))),sp=e=>e.month?.map((e=>e.image?.src?o("div",{className:"h-52 border-r pr-s border-main-divider last:border-r-0",children:o(ne,{image:e.image,className:"flex"})},`monthImage-${e.image.src}`):null)),op=ht((({className:e,title:t,button:n,regionSource:a,data:i,...r})=>{const[s,d]=l({key:""}),m=a?.regions??[],h=oe({className:"text-white",version:n?.version||"primary"}),p=m?.find((e=>e.name===s.key))?.href,f=n?.text?n.text:"Перейти";return o(g,{className:e,defaultPadding:"p-6xl",...r,children:c("div",{className:"container max-w-[978px] space-y-m",children:[t?o(N,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(hn,{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(ye,{href:p,target:"_blank",className:u("p-m w-full @xl:w-auto",h),data:jm(i,s?.key),children:f})}):null]})})}));function cp(e=[]){const t=D(),n=Array.from(e.entries()).filter((([,e])=>dp(t)(e)));return n.find((([,e])=>dp(t,!0)(e)))??n[n.length-1]??[]}const dp=(e,t=!1)=>({href:n})=>{if(!n)return!1;const l=F(mp(e)(n));return t?l===F(n):l.startsWith(F(n))},mp=e=>t=>{const n=G(X.SITE_URL);return z(t)?e.href:E(n,e.pathname)},up=d((({className:e="",items:t,activeItem:n,ariaLabel:l="Меню"})=>{const[r,{setFalse:d,toggle:m}]=Lt(!1),h=jt(d),p=s(null),g=i((({isOpened:e,buttonRef:t,menuRef:n})=>{if(e&&t.current&&n.current){const e=n.current.getBoundingClientRect(),l=t.current.getBoundingClientRect(),a=globalThis.innerWidth-e.width;e.right>=globalThis.innerWidth?n.current.style.left=`${a}px`:l.left>e.left&&(a>l.left?n.current.style.left="":n.current.style.left=`${a}px`)}}),[r]);return $t(globalThis,"resize",(()=>g({isOpened:r,buttonRef:h,menuRef:p}))),a((()=>{g({isOpened:r,buttonRef:h,menuRef:p})}),[r]),c("div",{className:u(r?"rounded-md shadow-blue-gray":"",e),ref:h,role:"navigation",children:[o("button",{type:"button",className:"group/btn flex justify-between items-center h-6","aria-label":l,onClick:m,role:"button","aria-labelledby":"labeldiv",children:Array(3).fill(null).map(((e,t)=>o("div",{className:"w-[3px] h-[3px] rounded mr-2xs bg-primary-text group-hover/btn:bg-primary-hover group-data-transparent:bg-white"},String(t))))}),o("div",{ref:p,className:u("absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56 z-40",{hidden:!r}),"aria-hidden":!r,children:pp(t,n)})]})})),hp=d((({isActive:e,...t})=>{const n=ue(),{text:l,href:a,target:i,onClick:r}=n(t);return o("a",{className:u("text-l font-light pb-m hover:text-primary-main",{"text-primary-main":e}),href:a,target:i,onClick:r,role:"link",...pe(t?.data),children:l})})),pp=(e,t)=>e?.map(((e,n)=>o(hp,{isActive:e===t,...e},e?.text??String(n)))),gp={default:"w-6 h-6",large:"w-12 h-12"},fp=d((({className:e,isRounded:t,buttonSize:n="default",isGrayBg:l=!1,disabled:a,ariaLabel:i="Меню второго уровня",image:r,data:s,onClick:c,version:d})=>o("button",{className:u("group/btn border-0 flex shrink-0 items-center",l?"p-s rounded-full":"p-0 bg-inherit","transparent"===d?"backdrop-opacity-30 bg-white/30":l&&!t?"bg-main-divider":"",t?"w-8 h-8 text-secondary-light hover:text-secondary-hove":`${gp[n]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:a,"aria-label":i,onClick:c,...pe(s),children:o(ne,{image:r,className:u("h-full",{"bg-main-divider/20 rounded-full":t}),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),xp="chatbot",bp="text-page__btn-chat",yp={personal:"//chat.mes.rshb.ru/assets/js/webchat_rshb",business:""},vp=d((({chat:e="personal",iconVersion:t,className:n,ariaLabel:l="Чат",version:i})=>{const r=(e=>{a((()=>globalThis.localStorage?.setItem("webchat-keep-open",String(Date.now()))),[]);const t=yp[e??""];return n=>{if(t)if("personal"!==e)Nr(xp,t);else{const e=n.target;e?.classList.contains(bp)||e?.classList.add(bp),document.getElementById("webchat-js-container:webchat_rshb")||Nr(xp,t)}}})(e);return o(fp,{className:n,image:{icon:"HeadphonesIcon",iconVersion:t},ariaLabel:l,onClick:r,buttonSize:"large",isGrayBg:!0,version:i})})),Np=d((({className:e="",active:t,dataItemName:n,children:l,data:a,...i})=>{const r=ue(),{href:s,target:d,text:m,onClick:h}=r(i);return c("a",{className:u("relative inline-block bg-transparent text-center no-underline",e),href:s,target:d,"data-item-name":n,onClick:h,...pe(a),children:[o("span",{className:wp(t),children:m||l}),t?o("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-white"}):null]})})),wp=(e=!1)=>u("font-sans text-l lg:font-light",e?"text-primary-main":"text-primary-text hover:text-primary-main","group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),Cp=d((({observerOptions:e,onVisibilityChange:t,children:n,className:l,...a})=>{const r=jo(i((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e);return o("span",{ref:r,className:l,role:"menuitem",children:o(Np,{...a,children:n})})})),kp={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"},Sp=d((({version:e,text:t,mobileText:n,...l})=>{const a=Ce()?n:t;return a?o(ye,{className:u("py-s px-lg font-light whitespace-nowrap",kp["transparent"===e?"transparent":"default"]),...l,children:a}):null})),Ip=d((({subItems:e=[],version:t,internetBankButton:n,dropdownMenuAriaLabel:a,chatBotAriaLabel:i})=>{const d="transparent"===t?"white":"black",[,m]=cp(e),[u,h]=l(e.length),p=e.slice(u),g=s(null),f={rootRef:g},x=r((()=>e.map(((e,t)=>e=>{h(e?Tp(t):Bp(t))}))),[e]);return c("nav",{className:"mt-s flex gap-s items-center justify-between",children:[o("div",{ref:g,className:"overflow-hidden whitespace-nowrap pb-s mt-xs space-x-lg",role:"menu",children:e.map(((e,t)=>o(Cp,{className:u-1<t?"invisible":"",active:e===m,observerOptions:f,onVisibilityChange:x[t],data:e.dataHeader,...e},String(t))))}),p.length?o(up,{items:p,activeItem:m,ariaLabel:a}):null,_.CHAT_BOT?o(vp,{version:t,iconVersion:d,chat:_.CHAT_BOT,ariaLabel:i}):null,o(Sp,{version:t,...n})]})})),Tp=e=>t=>Math.max(t,e+1),Bp=e=>t=>Math.min(t,e),Rp=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(Me,{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(Pp,{...e},String(t))))})]}):null,Pp=d((({icon:e,...t})=>{const n=ue(),{text:l,target:a,href:i,onClick:r}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ne,{image:e}):null,l?o("a",{className:"hover:text-primary-hover",href:i,target:a,onClick:r,children:o(Me,{size:"text-l",font:"font-light",color:"text-primary-text",children:l})}):null]})})),Dp=(e,t)=>n=>n.name?o(qm,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:jm(e,n.name),children:o(Me,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,Mp=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(Wt,"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"})]}))),_p=d((({foreignOffices:e,branches:t})=>{const[n,a]=Zu(t?.default),r=ue(),{href:s}=r({href:`/branches/${n.slug}`}),[d,m]=l(""),u=Vp(Ri()).sort(((e,t)=>e.name.localeCompare(t.name))),h=((e,t)=>{const n=new Map;for(const l of e){const e=t(l),a=n.get(e)||[];n.set(e,[...a,l])}return n})(u,zp),{close:p}=de(),g=i((e=>{a(e),p()}),[]);return c(ha,{className:"pb-20",head:c("div",{children:[o(Me,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),n?o("div",{className:"mb-s",children:c(w,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(qm,{href:s,className:"inline mx-2xs text-primary-main",children:n.name})]})}):null,o(Mp,{onSearch:m,searchTerm:d})]}),children:[d&&d.length>=3?o("div",{children:u.filter((({name:e})=>e&&Lh(e.toLowerCase())(d.toLowerCase())>=.8)).map(Dp(t?.dataSelect,g))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(h.entries()).map((f=g,x=t?.dataSelect,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(Me,{size:"text-h6",children:e})}),t.map(Dp(x,f))]},e)))}),Rp(e)]});var f,x})),zp=e=>e.name?.charAt(0)||"",Vp=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()||""}))),Ap=d((({className:e="",active:t,flat:n,children:l,data:a,...i})=>{const r=ue(),{href:s,target:c,text:d,onClick:m}=r(i);return o("a",{className:u(Fp(t,n),e),href:s,target:c,onClick:m,rel:"noopener noreferrer","aria-label":`Ссылка на ${d}`,...pe(a),children:o("span",{suppressHydrationWarning:!0,className:Ep(t,n),children:d||l})})})),Fp=(e=!1,t=!1)=>u("inline-block border border-solid bg-transparent text-center no-underline",e?"rounded-md border-primary-main group-data-transparent:border-white":"border-transparent",{"px-m py-xs":!t}),Ep=(e=!1,t=!1)=>u("font-sans text-s font-light",e?"text-primary-main":u(t?"text-primary-text":"text-secondary-text","hover:text-primary-main"),"group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),Op=d((({className:e,version:t,...n})=>{const l="transparent"===t?"white":"black",[a]=Zu(n?.branches?.default),r=Jh(n),s=(e=>{const{open:t,close:n}=de();return{open:(n={})=>t(o(_p,{...e}),n),close:n}})(n),d=i((()=>r.open()),[r]),m=i((()=>s.open()),[s]);return c("div",{className:u("flex items-center ml-5 md:max-w-[300px] xl:max-w-full gap-lg",e),role:"navigation",children:[n?.branches?.visible?o(Ap,{className:"whitespace-nowrap text-ellipsis overflow-hidden",flat:!0,href:"#",text:a?.name,data:jm(n?.branches?.dataClick,a?.name??""),onClick:m}):null,n?.officesAtms?.href?o(Ap,{className:"whitespace-nowrap",flat:!0,...n.officesAtms}):null,o(fp,{image:{icon:"LoupeIcon",iconVersion:l},ariaLabel:n?.search?.ariaLabel??"Поиск",onClick:d,data:n?.search?.data})]})})),Lp=d((({observerOptions:e,onVisibilityChange:t,children:n,className:l,...a})=>{const r=jo(i((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e);return o("span",{ref:r,className:l,role:"menuitem",children:o(Ap,{...a,children:n})})})),$p=d((({navigationItems:e=[],activeTopItem:t,dropdownMenuAriaLabel:n,version:a,headerData:i,search:d,bgColor:m,logo:u})=>{const[h,p]=l(e.length),g=e.slice(h),f=s(null),x={rootRef:f},b=r((()=>e.map(((e,t)=>e=>{p(e?jp(t):qp(t))}))),[e]),{dataFooter:y,dataHeader:v,...N}=u??{};return c("div",{className:"flex items-center justify-between",children:[o(Xs,{className:"mr-3xl",bgColor:m,logo:N,data:v,showTitle:!1}),o("div",{ref:f,className:"overflow-hidden min-w-[160px] pb-xs mt-xs",role:"menu",children:e.map(((e,n)=>o(Lp,{className:h-1<n?"invisible":"",active:e===t,observerOptions:x,onVisibilityChange:b[n],data:e.dataHeader,...e},String(n))))}),g.length?o(up,{className:"mx-xs",items:g,activeItem:t,ariaLabel:n}):null,o(Op,{version:a,className:"ml-auto",search:d,navigationItems:e,...i})]})})),jp=e=>t=>Math.max(t,e+1),qp=e=>t=>Math.min(t,e),Up={"bg-white":"primary",transparent:"transparent"},Wp=["all","header"],Hp=ht((({className:e,bgColor:t="bg-white",logo:n={},version:l=Up[t],portal:a,header:i={},...r})=>{const{common:s,navigation:d}=Kp(r?.options?.page),{navigationItems:m}=d,{logo:h={}}=s,[,p]=cp(m),{internetBankButton:f}=a||{},x=n.image?.icon||n.image?.src||n?.title?n:h;return o(g,{tag:"header",className:u("pt-m px-20",p?.items?.length?"pb-m":"pb-lg",e),defaultPadding:"",version:l,...r,children:c("div",{className:"container",children:[o("div",{className:"whitespace-nowrap",children:o($p,{activeTopItem:p,navigationItems:m?.filter(Th(Wp)),version:l,headerData:{...i,...d},search:s.search,bgColor:t,logo:x})}),o("div",{className:u("mt-s h-px bg-main-divider",Yp(l))}),p?.items?.length&&o(Ip,{subItems:p?.items?.filter(Th(Wp)),version:l,internetBankButton:f})]})})})),Yp=e=>"transparent"===e?"opacity-30":"",Kp=e=>({navigation:e?.navigation??{},common:e?.common??{}}),Xp=(e=!1)=>e?{}:{padding:"p-0"},Gp={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},Jp=ht((({className:e="",padding:t="p-0",gap:n="XS",isInnerPadding:l=!0,version:a="transparent",isTheme:i=!1,isCardBorder:r,...s})=>o(g,{className:u("relative","grid grid-cols-12",Gp[n],e),padding:t,version:a,isTheme:i,...s,children:P({...s,extraProps:{...Xp(l),className:Lo(r)}})})),{childrenTypes:{exclude:["HorizontalLayout"]}}),Zp=d((e=>{const{className:t,align:n,image:l,...a}=e,i=n?u("flex",Gc[n]):"";return o(g,{className:u(i,t),defaultPadding:"p-0",...a,children:o(ne,{image:l})})})),Qp=(e,t=0)=>{const{itemCount:n,visibleItemCount:a}=e,[r,s]=l(t),o=i((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=i((()=>s((e=>Math.max(e-1,0)))),[n]),d=a?n>a&&r<n-a:r<n-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]};function eg({dec:e,inc:t,canDec:n,canInc:l,btnClass:a,className:i=""}){return n||l?c("div",{children:[n?o(cc,{className:u("absolute z-40",a[0],i),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!n}):null,l?o(cc,{className:u("absolute z-40 rotate-180",a[1],i),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!l}):null]}):null}const tg=d((({className:e="",cards:t=[],button:n})=>{const[a,r]=l(0),s=i((e=>r(e)),[]),d=t.length,[m,u]=Qp({itemCount:d,visibleItemCount:2}),{canDec:h,canInc:p}=u,g=t[m]?.href;return c("section",{role:"listitem",className:`min-w-full text-center ${e}`,children:[c("div",{className:"relative overflow-hidden","aria-label":"Страховые программы",children:[d?ng({activeIndex:m,cards:t,selectedCardIndex:a,onClick:s}):null,eg({...u,btnClass:["left-12","right-12"],className:"top-16"}),h?o("div",{className:"absolute top-0 left-0 h-full w-32 bg-opacity-from-white"}):null,p?o("div",{className:"absolute top-0 right-0 h-full w-32 bg-opacity-to-white"}):null]}),o(ye,{className:"w-60 text-center",version:"primary",...n,href:g})]})}));function ng({activeIndex:e,cards:t,selectedCardIndex:n,onClick:l}){const a=460*e,i=t.length>2?"justify-start":"justify-center";return o("div",{style:{transform:`translateX(-${a}px)`},className:"duration-1000 px-6xl",children:o("div",{className:`w-full flex flex-nowrap gap-s pb-6xl ${i}`,children:t.map(((e,t)=>function({slide:e,i:t,isActive:n,onClick:l}){return c("button",{type:"button",onClick:l,className:"p-3xl min-w-fit flex items-center gap-2xl bg-white border-solid border relative "+(n?"shadow-dark-blue border-primary-main":"ease-in duration-300 border-gray"),children:[e?.icon?o(ne,{className:"p-lg rounded-full bg-secondary-light",image:e.icon,width:"108",height:"108"}):null,c("div",{className:"flex gap-s",children:[e?.sum?lg("страховая сумма",e.sum):null,e?.fee?lg("страховой взнос",e.fee):null]}),ag(n)]},String(t))}({slide:e,i:t,isActive:Boolean(t===n),onClick:()=>l(t)})))})})}function lg(e,t){return c("div",{className:"flex flex-col text-left whitespace-pre",children:[c(Me,{size:"text-h6",children:[Ue(2)(t)," ₽"]}),o("div",{className:"mt-2xs",children:o(Me,{size:"text-l",color:"text-secondary-text",children:e})})]})}function ag(e){return e?o(ne,{className:"h-6 w-6 min-w-6 min-h-6 absolute right-4 top-4",image:{icon:"DoneIcon"},width:"24",height:"24"}):null}const ig=d((({className:e="",title:t,insuranceTabs:n=[],button:a,...r})=>{const[s,d]=l(0),m=i((e=>d(e)),[]);return c(g,{className:u("box-border overflow-hidden relative px-0 space-y-2xl",e),defaultPadding:"p-6xl",...r,children:[t?o(N,{className:"text-center",title:t,headingType:"h3"}):null,n?.length>1?o("div",{className:"p-xs bg-secondary-light w-fit mx-auto rounded-md",children:n.map(((e,t)=>function({title:e,i:t,isActive:n,onClick:l}){return o("button",{type:"button",onClick:l,"aria-label":`Кнопка ${e}`,className:"box-border px-m py-s text-m font-light "+(n?"bg-primary-main text-white rounded-md":"text-secondary-text"),children:e},String(t))}({title:e?.title,i:t,isActive:Boolean(t===s),onClick:()=>m(t)})))}):null,o("div",{className:"flex",style:{transform:`translateX(-${s}00%)`},role:"list",children:rg({insuranceTabs:n,button:a})})]})})),rg=({insuranceTabs:e,button:t})=>{const n=e?.map((e=>e.cards));return n?.length?n.map(((e,n)=>o(tg,{button:t,cards:e},String(n)))):null};const sg={yellow:"bg-yellow",green:"bg-green","green-light":"bg-green-light","green-dark":"bg-green-dark"},og={XS:"h-10",S:"h-16",M:"h-24",L:"h-32",XL:"h-52"},cg=d((e=>{const{className:t="",__html:n,isDotted:l,investmentZeroColumn:a,investmentColumns:i,...r}=e,s=i?[...i]:[];return a&&s.unshift(a),o(g,{className:t,defaultPadding:"p-4xl",...r,children:c("div",{className:"container text-m font-light space-y-4xl",children:[s?.length?c("div",{children:[c("div",{className:"flex items-end relative pl-3xl pr-lg text-white",children:[Tc(o("div",{className:"w-px h-4 bg-gray"}))(s.map(dg)),o("div",{className:"absolute right-3xl w-px h-4 bg-gray"})]}),o("div",{className:"border-t border-gray -mt-xs mx-3xl"}),o("div",{className:"flex justify-between text-primary-text mt-s -mx-5xl",children:s.map(hg)})]}):null,n?o("div",{className:"max-w-2xl font-light text-base",children:o(Pe,{__html:n,isDotted:l,itemSize:"list-s"})}):null]})})})),dg=(e,t,n)=>{const l=1===t,a=t===n.length-1,i=e.cells?.reverse()||[];return o("div",{className:`${mg(l,a,e.cells)}`,children:i.length?o("div",{className:"w-full "+(a?"border-4 border-green-more-dark p-1.5 min-w-72":""),children:i.map(ug)}):null},`column_${t}`)},mg=(e,t,n=[])=>[n.length?"flex-1":"flex-0",!n.length||e||t?"":"pl-s",n.length&&!t?"pr-s pb-3xl":"pb-xl"].join(" "),ug=(e,t)=>{const n=e.cellSize||"XS",l=e.cellColor||"green";return e.text?o("div",{className:`flex-1 flex items-center justify-center relative py-xs ${og[n]} ${sg[l]} ${"XS"===n?"px-s":"px-5xl"}`,children:o(Me,{align:"text-center",children:e.text})},`cell_${t}`):null},hg=(e,t)=>e?.title?o("div",{className:"flex-1 max-w-44 text-center px-xs last:pr-4xl last:max-w-52",children:e.title},`title_${t}`):null,pg=["байт","Кб","Мб","Гб","Тб","Пб"],gg=d((({icon:e,text:t,href:n,target:l,fileFormat:a,data:i,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:l,...pe(i),children:[e,t?c(Me,{size:"text-l",font:"font-light",children:[t," ",fg(d,m),o(Me,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),fg=(e,t)=>e||t?o("span",{children:", "}):"",xg=(e,t)=>(n,l)=>{const a=q(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),i="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))} ${pg[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?yg(a):n?.fileFormat;return c("div",{role:"listitem",children:[o(gg,{text:n?.text,target:n?.target,href:a,fileFormat:r,fileSize:i,icon:bg(t),data:n?.data}),o(Pe,{__html:n?.__html})]},String(l))},bg=e=>e?o(ne,{className:"min-w-6 min-h-6",image:e,width:"24",height:"24"}):null,yg=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),l=-1!==t?e.substring(t+1):"";return l.includes("/")?l.replace(n,""):l},vg=d((({href:e,__html:t,target:n})=>{const{close:l}=de(),a=D(),r=q(a)(e),s=i((()=>{l()}),[]);return c(ha,{className:"my-6xl min-h-fit w-fit mx-auto",children:[t?o(Pe,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(ye,{text:"Я согласен",version:"primary",target:n,href:r,onClick:s}),o(Ar,{type:"button",version:"secondary",onClick:s,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]})})),Ng=d((({text:e,href:t,target:n,__html:l,icon:a})=>{if(!e&&!l)return null;const r=(e=>{const{open:t,close:n}=de();return{open:(n={})=>t(o(vg,{...e}),n),close:n}})({__html:l,href:t,target:n}),s=i((()=>r.open()),[r]);return c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[bg(a),o(Me,{font:"font-light",children:e})]})})),wg={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},Cg=ht((({className:e="",title:t,description:n,align:l="text-center",documents:a,icon:i={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=D();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(k,{title:t,description:n,align:l,headlineVersion:"M",as:"h2",isEmbedded:!0}),a?.length?o("div",{className:u("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",wg[r]),role:"list",children:a.map(kg(d,i))}):null]})})),kg=(e,t)=>(n,l)=>{const a=n?.docType;return""===a?null:"reportSource"in n&&n?.reportSource?.__html?Sg(t)(n,l):xg(e,t)(n,l)},Sg=e=>(t,n)=>{const l={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(Ng,{...l,icon:e,href:Ig(t)?t?.href:t?.attachment?.src}),o(Pe,{__html:t?.__html})]},String(n)):null},Ig=e=>"href"in e,Tg=ht((({className:e,padding:t,align:n="text-left",buttons:l=[],description:a,image:i,__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",b=i?.src?o(ne,{className:"hidden lg:block",image:i}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:p,...f,children:c(Ie,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(N,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:b,buttons:Le(l,{className:"flex-wrap"}),children:[a?o(Me,{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(Pe,{__html:r,itemSize:"list-m"}):null,o(Me,{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,i?.src?o(ne,{className:"lg:hidden",image:i}):null]})]})})})),Bg=(e=[],t={})=>e.filter((({content:e={}})=>zc(t,e))).length,Rg=(e,t)=>e===t;const Pg=(Dg=function(...e){return(t,n)=>e.some((e=>e(t,n)))}(Rg,((e=Rg)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,l)=>e(t,n[l])))))()),(e,t)=>e===t||Boolean(e&&t&&Object.keys(e).length===Object.keys(t).length&&Object.entries(e).every((([e,n])=>Dg(n,t[e])))));var Dg;const Mg=[],_g={},zg={primary:"bg-white/30",secondary:"bg-main-divider"},Vg={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},Ag=d((({count:e,version:t="secondary"})=>{const n=Ce(),l=n?"bg-main-divider":zg[t],a=Vg[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",l),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(Me,{size:"text-xs",color:a,children:e})})})),Fg=({text:e,description:t,icon:n,isActive:l,type:a})=>{const i=(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"}))(l);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",i.icon),image:{...n,iconVersion:n?.iconVersion??i.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===a?i.text:i.oldText,children:e}),o("div",{className:"animated"===a?i.desc:i.oldDesc,children:t})]})]})},Eg={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},Og={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},Lg={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},$g={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},jg=d((({tag:e="div",item:t={},isActive:n=!1,type:l="default",onClick:a})=>{const i=e,{text:r,description:s,icon:d,count:m,tabName:h,...p}=t;return o(i,{className:u("h-12","block flex-1","cursor-pointer",Eg[l],n?$g[l]:Lg[l]),role:"tablist","aria-label":"Список табов",onClick:a,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?Og[l]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[Fg({text:r,description:s,icon:d,isActive:n,type:l}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(Ag,{count:m,version:Fr(n,l)})}):null]})})})),qg=d((e=>o(e?.item?.href?Ug:Wg,{...e}))),Ug=d((e=>{const t=ue(),n=i((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:l,...a}=t({...e.item,onClick:n});return o(jg,{...e,tag:"a",item:a,onClick:l})})),Wg=d((({item:e={},onClick:t,...n})=>{const l=i((()=>{t&&t(e)}),[t,e]);return o(jg,{item:e,onClick:l,...n})})),Hg=(e,t,n)=>(l,a)=>o(qg,{isActive:l===e,onClick:t,type:n,item:l},String(a)),Yg=d((({className:e,tabsType:t="default",items:n=[],activeItem:l,onChange:a})=>o("div",{className:u("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tabpanel","aria-label":"Панель управления табами",children:n.map(Hg(l,a,t))}))),Kg={categories:[],extraOptions:[],propertyType:[],stage:[]},Xg=ht((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:l,...a})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=Ac(Kg,{block:a.block,page:a.options?.page}),f=i(((e=Kg)=>p(e)),[]),x=(({hotFilters:e=Mg,filtrationState:t=_g,blocks:n=Mg,onFiltrationStateChange:l})=>{const a=r((()=>Math.max(0,e.findIndex((e=>Pg(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:Bg(n,t.filter),version:Fr(t===e[a])})))),[e,n,a]),o=i((t=>{l(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(Yg,{...x}),o(Rc,{filtrationSchema:n,resetButton:l,field:m,reset:h}),o(Sc,{blocksToRender:d,...a})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),Gg=({location:e,address:t,billAcceptorType:n,terminalType:l,billAcceptorEnable:a,atmCode:i="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:Qg(l)},{label:"Модуль приема наличных",value:a?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:i}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(Me,{size:"text-h4",children:Qg(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Me,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(Xi,{color:"green",children:Qg(s)})})]}),o("div",{className:"hidden sm:block",children:o(Ei,{className:"flex-wrap",children:m?.map(Zg)})}),o(Mi,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(_i,{isUnfolded:e,children:o(Ei,{className:"flex-wrap",children:m?.map(Zg)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>nr({isUnfolded:e,onToggle:t})})]},String(d))},Jg=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${Qg(t)} №${n}`,body:e.toUpperCase()}),Zg=(e,t)=>o(zi,{...e},String(t)),Qg=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",ef=[];const tf=async e=>{const t=await rt(e,{method:"GET"});return Array.isArray(t)?t:ef},nf={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},lf={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)},af=d((({descriptionData:e,className:t})=>{const[n]=Zu(),l=n?.code??"000",{data:a,isLoad:i}=function(e){const{data:t,error:n}=$n(`/api/v1/atms?regionCode=${e}`,tf);return{data:t||ef,isLoad:!t&&!n}}(l);return o(Yr,{className:t,filterItems:rf,data:a,isLoad:i,initFilterState:nf,renderCard:Gg,getBalloon:Jg,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),rf=(e,t)=>{const n=Object.keys(t).filter((e=>t[e])),l=n.filter((e=>e.startsWith("terminalType"))),a=n.filter((e=>!l.includes(e)));return e.filter((e=>{const t=a.every((t=>lf[t](e))),n=!l.length||l.some((t=>lf[t](e)));return t&&n}))},sf=({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(Me,{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(Me,{size:"text-l",children:e})]}):null]})}),o("div",{className:"hidden sm:block",children:of({workScheduleDescription:t})}),o(Mi,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(_i,{isUnfolded:e,children:of({workScheduleDescription:t})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>nr({isUnfolded:e,onToggle:t})})]},String(n)):null,of=({workScheduleDescription:e})=>c("div",{children:[c(Ei,{className:"flex",children:[o(zi,{label:"Операции для физических лиц",children:o(Me,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(zi,{label:"Операции для физических лиц",children:o(Me,{children:"Оформление и обслуживание банковских карт"})}),o(zi,{label:"Операции для физических лиц",children:o(Me,{children:"Инвестиционное и накопительное страхование"})}),o(zi,{label:"Операции для физических лиц",children:o(Me,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(zi,{label:"Режим работы",className:"max-w-none",children:o(Me,{children:e})})]}),cf=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),df={branches:[],remoteWorkplaces:[]};const mf=async e=>await rt(e,{method:"GET"})||df,uf=d((({className:e})=>{const[t]=Zu(),n=t?.code??"000",{data:l,isLoad:a}=function(e="000"){const{data:t,error:n}=$n(`/api/v1/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,mf);return{data:t||df,isLoad:!t&&!n}}(n);return o(Yr,{className:e,data:l?.branches,isLoad:a,remoteWorkplaces:l?.remoteWorkplaces,renderCard:rr,renderRemoteWorkplaceCard:sf,getBalloon:or,getBalloonRemoteWorkplaces:cf,title:`Офисы филиала ${t?.name}`})})),hf=d((({data:e,className:t,...n})=>{const l=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===l?o(uf,{}):o(af,{descriptionData:e})})})),pf=d((({className:e,title:t,description:n="Блок в разработке...",...l})=>c(g,{className:u("box-border",e),...l,children:[o(k,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(f,{})]}))),gf="hidden sm:flex absolute z-40 top-10",ff=ht((({className:e="",padding:t,slides:n=[],...a})=>{const[i,r]=l(0),[s,d]=ic({itemCount:n?.length||0});return c(g,{className:u("box-border overflow-hidden",e),defaultPadding:"pt-6xl",padding:t,...a,children:[o("div",{className:"flex duration-1000",style:{transform:`translateX(-${100*i}%)`},role:"list",children:n.map((({productBlock:e},t)=>o("div",{className:"box-border grow-0 shrink-0 basis-full",role:"listitem",children:o(Ge,{className:"pl-6xl h-full",headlineVersion:"M",isFullWidthTitle:!1,...e,...a})},String(t))))}),c("div",{className:"relative pr-xs mt-m -mb-m flex gap-xs box-border",children:[o(Ho,{containerRef:s,snapAlign:"snap-start",onVisibleIndicesChange:d.handleVisibleIndicesChange,itemClassName:"h-40 flex items-stretch w-screen",gap:8,children:n.map(xf({activeSlideIndex:i,onClick:r}))}),d.canScrollLeft?o(dc,{className:u("left-6",gf),onClick:d.scrollLeft}):null,d.canScrollRight?o(mc,{className:u("right-6",gf),onClick:d.scrollRight}):null]})]})})),xf=({activeSlideIndex:e,onClick:t})=>({nav:n},l)=>{const a=l===e,i=a?"min-w-[370px] mt-s h-28 bg-white shadow-dark-blue border-none p-6":"min-w-72 mt-lg h-24 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=a?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=a?"text-secondary-text text-l font-light":"text-secondary-text text-m font-light group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(l),"aria-label":n?.title,className:u("relative overflow-hidden grow","ml-xs px-xl","box-border basis-0 border","border-gray group-data-secondary:border-white/50","text-left whitespace-nowrap",i),children:[o("div",{className:r,children:n?.title}),o("div",{className:s,children:n?.description})]},String(l))},bf=d((({address:e,email:t,telephone:n,button:l,className:a="",__html:i,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:[Oe(s)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ne,{image:s})}):null,d?o(N,{headingType:"h3",as:"h3",title:d}):null]}),c("div",{className:"w-full space-y-m",children:[i?yf({__html:i,richVersion:r}):null,vf({label:"Адрес",data:e,iconName:"GeolocationIcon"}),vf({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),vf({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),l?.text?Le([l]):null]})]}))),yf=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(Pe,{...e,itemSize:"list-s"})}),vf=({label:e,data:t,iconName:n,dataColor:l=""})=>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(Me,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(Me,{size:"text-xl",color:l,children:t})]})]}):null,Nf=d((e=>{const{__html:t,richVersion:n="",...l}=e;return o(g,{defaultPadding:"p-0",...l,children:o(Pe,{__html:t,richVersion:n})})})),wf=d((({label:e,labelIconBgVersion:t,icon:n,onToggle:l,labelIcon:a})=>o(yc,{tag:"button",className:u("border-none bg-transparent items-center group/button",a?.icon?"py-xs":"py-lg"),onClick:l,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[null,e?o(Me,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:n?o(W,{name:n,iconVersion:"color",width:"24",height:"24"}):null}))),Cf=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",kf=(e=!1)=>e?"MinusIcon":"PlusIcon",Sf=(e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon",If=ht((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,label:l="Развернуть",labelIcon:a,labelIconBgVersion:i,foldButtonVersion:r="default",version:s,role:c,...d})=>{const m=Ce();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(Mi,{isFoldButtonOnTop:n,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(_i,{className:u("gap-lg",Cf(m)),isUnfolded:e,children:P({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Tf({foldButtonVersion:r,label:l,labelIcon:a,labelIconBgVersion:i,isUnfolded:e,onToggle:t,isMobile:m})})})}),{childrenTypes:{exclude:["RollupItem"]}}),Tf=({foldButtonVersion:e,label:t,labelIcon:n,labelIconBgVersion:l,isUnfolded:a,onToggle:i,isMobile:r=!1})=>{const s=t||(a?"Скрыть":"Развернуть"),c=((e=!1,t=!1)=>t?Sf(e):kf(e))(a,r);return"accordion"===e?o(wf,{label:s,labelIcon:n,labelIconBgVersion:l,icon:c,onToggle:i}):o(vc,{label:s,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:i})},Bf=d((({name:e,text:t,value:n,checked:l,onChange:a,className:i})=>o("div",{className:i,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:u(Wt.split(" ").filter((e=>"rounded"!==e)),Zn,"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:l,onChange:e=>a?.(e.target.value),role:"radio"}),t?o(Me,{color:"text-primary-text",children:t}):null]})}))),Rf=d((({className:e=""})=>{const[t,n]=l("option2"),a=i((e=>n(e)),[]);return c("div",{className:u("order-4",e),role:"radiogroup",children:[o(Bf,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),o(Bf,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),Pf=d((({data:e,fieldLabel:t,fieldValue:n,selected:l,placeholder:a="",setSelected:i,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[n||t],text:e?.[t]}))),c=s.find((e=>e.key===l));return o(cn,{options:s,label:r,placeholder:a||l,onChange:e=>i(e.key),value:c})})),Df=d((({regions:e=[],selectedRegion:t,onSelectedRegion:n,branches:l=[],selectedBranch:a,onSelectedBranch:i})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Pf,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(Pf,{data:l,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:i,label:"Отделение",placeholder:"Выберите отделение"})})]}))),Mf=["От 1 дня","До 365 дней"],_f=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Me,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(hl,{min:1,max:365,value:e,items:Mf,onChange:t})]}))),zf=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:n,safeBoxCases:l=[],selectedBoxSize:a,onSelectedBoxSize:i})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Pf,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(Pf,{data:l,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:i,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),Vf=d((({regions:e,selectedRegion:t,branches:n,selectedBranch:l,days:a,selectedCaseVolume:i,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:u})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(Df,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:l,onSelectedBranch:Af(m)}),o(_f,{days:a,setDays:e=>m({days:e})}),o(zf,{caseVolumes:d,selectedCaseVolume:i,onSelectedCaseVolume:Ff(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(Me,{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(Rf,{}),o(ye,{text:"Офисы на карте",version:"primary",onClick:u,className:"order-6"})]})]}))),Af=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},Ff=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},Ef=d((({days:e,tariffs:t=[]})=>{const n=Lf(e,t),l="На рисунке изображена пачка листов\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:[Of("Аренда за",e),Of("Цена",n+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:l})}),c("div",{className:"flex flex-col items-center gap-s order-3 @xl:order-none mb-xl @xl:mb-0 bg-primary-main py-s @xl:p-3xl text-center",children:[o(ne,{image:{icon:"PackA4Icon"},className:"@xl:h-60"}),o("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:o(w,{size:"text-s",font:"font-light",color:"text-white",children:l})})]})]})})),Of=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(Me,{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})]}),Lf=(e,t)=>{const n=$f(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},$f=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},jf=(e,t)=>e.find((e=>e.branchCode===t)),qf=d((e=>{const{regions:t,data:n,branches:l,onChange:i,onClick:r}=e;a((()=>{i({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,i]);const s=jf(l,n.selectedBranch),d=Uf(s?.safeBoxCaseVolumes),m=Wf(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=Hf(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(Vf,{...n,regions:t,onClick:r,branches:l,caseVolumes:d,safeBoxCases:m,onChange:i}),o(Ef,{days:n.days,tariffs:u})]})})),Uf=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Wf=(e,t)=>e?.find((e=>e.volume===t)),Hf=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Yf=[];const Kf=async e=>await rt(e,{method:"GET"})||Yf,Xf=d((({title:e,footnote:t,className:n="",...a})=>{const[r,s]=l(!1),d=i((()=>s((e=>!e))),[]),[m,u]=l({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),h=Ri(),p=Gf(m.selectedRegion,h),f=function(e){const{data:t}=$n(e?`/api/v1/safeboxes?regionCode=${e}`:null,Kf);return t||Yf}(p),x=i((e=>u((t=>({...t,...e})))),[u]),b=(y=jf(f,m.selectedBranch)||f,Array.isArray(y)?y.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)].filter(Boolean),content:void 0}))).filter((e=>e.coords&&2===e.coords.length)):y?.gpsLatitude&&y?.gpsLongitude?[{coords:[y.gpsLatitude,y.gpsLongitude]}]:[]);var y;return c(g,{className:n,defaultPadding:"",...a,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(N,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(qf,{regions:h,branches:f,data:{...m,selectedRegion:p},onClick:d,onChange:x}),t?o(w,{size:"text-s",font:"font-light",children:t}):null]}),b.length&&r?o(Ir,{points:b,className:"h-[640px]"}):null]})})),Gf=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,Jf=e=>e<4?"w-72":"w-52",Zf={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"},Qf=d((({buttons:e,className:t="",description:n,showLines:l=!0,steps:a=[],stepVersion:i="gray",title:r,version:s="primary",...d})=>{const m=a.length>3,h=Zf,p=(e=>e?"":"opacity-0")(l),f=Ce();return c(g,{className:u("box-border flex flex-col items-center overflow-hidden gap-y-3xl",t),defaultPadding:"p-6xl",version:s,...d,children:[o(k,{headlineVersion:"S",title:r,description:n,isEmbedded:!0,className:"w-full",align:$c(f)}),a?.length?c("div",{className:"box-border space-y-lg flex flex-col justify-center",children:[o("div",{className:u("flex items-center",m?"px-16":"px-24"),children:Tc(o("div",{className:u("h-0.5 w-full bg-secondary-light flex-1",p)}))(a.map(ex(h,m,i)))}),o("div",{className:u("flex justify-between",m?"gap-x-s":"gap-x-20"),children:a.map((x={styleMap:h,version:s},(e,t,n)=>{const{styleMap:l,version:a}=x,{label:i,description:r,button:s,isDotted:d}=e;return c("div",{className:u("relative flex flex-col items-center text-center justify-between whitespace-pre-line overflow-hidden space-y-3xl",Jf(n.length)),children:[c("div",{className:"space-y-xs",children:[i?o(Me,{size:"text-h6",align:"text-center",children:i}):null,c("div",{className:"flex flex-col items-center gap-3xs",children:[r?o("div",{className:l.description,children:r}):null,o(Pe,{__html:e.__html,itemSize:"list-s",isDotted:d})]})]}),s?.text?o(ye,{className:"box-border py-s w-full max-w-60 mt-auto",version:a,...s,children:s?.text}):null]},String(t))}))})]}):null,Le(e)]});var x})),ex=(e,t,n)=>({icon:l},a)=>{const i="secondary"===n?"white":"color";return o(g,{defaultPadding:"",className:`${tx(t)} flex justify-center items-center text-center rounded-full box-border z-10`,version:n,children:Oe(l)?o(ne,{image:{...l,iconVersion:l?.iconVersion||i},width:"48",height:"48"}):o("span",{className:u("text-h4","transparent"===n?e.iconText:(r=n,"secondary"===r?"group-data-primary:text-white":"text-secondary-text")),children:a+1})},String(a));var r},tx=e=>e?"h-16 w-16":"h-24 w-24",nx=d((()=>o("div",{className:"hidden",role:"none"}))),lx="hidden sm:flex absolute z-40",ax={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},ix=d((({className:e,items:t=[],activeItem:n,onChange:l,tabsType:i="default"})=>{const[r,s]=ic({itemCount:t?.length||0});return a((()=>rx(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(Ho,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:ax[i].item,gap:ax[i].gap,children:t.map(Hg(n,l,i))}),s.canScrollLeft?o(dc,{className:u("left-6",lx,ax[i].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(mc,{className:u("right-6",lx,ax[i].buttonTop),onClick:s.scrollRight}):null]})})),rx=(e,t,n)=>{const l=t.findIndex((e=>e===n));e&&l>0&&e.scrollTo({left:e?.children[l]?.offsetLeft,behavior:"smooth"})},sx={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},ox=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(sx[t].wrapper,e),children:o(ix,{className:sx[t].component,tabsType:t,...n})}):null,cx=ht((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=dx(n??{}),p=D(),f=t.every((e=>"link"===e?.type)),x=s?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,{isReady:b}=p,[y,v]=l(hx(x,((e="")=>{const t=globalThis?.location?.href;return t?new URL(t).searchParams.get(e):null})(h))),N=x[y],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)}),[b,w,h]);const C=ux(x[y],y),k=i((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:[ox({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:mx(t,x),activeItem:N,tabsType:r,onChange:k}),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(ux)?.filter(Boolean)||[]}),dx=({__id:e,anchor:t})=>t??e??"tabs",mx=(e,t)=>t?.length?t:e,ux=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",hx=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),px={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},gx=d((({children:e,activeIndex:t,columnWidth:n,version:l="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:px[l],style:{transform:`translateX(-${t*n}px)`},children:e})}))),fx=d((({className:e="",isOpen:t,onClick:n})=>o(ye,{className:e,appendRight:o(ne,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"24",height:"24"}),text:t?"Скрыть":"Показать",version:"gray",onClick:n}))),xx={Buttons:({buttons:e})=>Le(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(Pe,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(Me,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(Me,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:l,isOpen:a})=>e?o(fx,{className:"w-fit",isOpen:a,onClick:()=>{t({tableSource:n,pdfUrl:l})}}):null},bx=d((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:i,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=l(!0);a((()=>{i===o&&s||m(!0)}),[s,o]);return yx({cell:e,cellProps:{rowIdx:n,cellIdx:i,fieldIdx:t,displayTable:e=>{m(!1),c(i),r(e)},isVisible:d}})})),yx=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...l}=e;if(!n||!(n in xx))return null;return o(xx[n],{...t,...l})},vx=d((({cells:e,rowIdx:t,cellIdx:n,setTableInner:l,tableInner:a,openTableInnerIdx:i,setOpenTableInnerIdx:r})=>o("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>o(bx,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:l,tableInner:a,openTableInnerIdx:i,setOpenTableInnerIdx:r},String(s)))):null}))),Nx=(e,t)=>140*jh(e.slice(0,t).map((e=>e?.cols?.length??1))),wx=(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(Me,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,Cx=d((({rows:e})=>{const t=e?.[0]?.length??0,[n,l]=Qp({itemCount:t,visibleItemCount:5});return c("div",{children:[e?.map((a=n,(e,t)=>{if(!e?.length)return null;const[n,...l]=e,i=u("flex duration-1000 text-center",0!==t?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[n?.data?o("div",{className:"whitespace-pre-wrap sm:whitespace-normal w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(Me,{size:"text-xl",font:"font-light",children:n.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:i,style:{transform:`translateX(-${Nx(l,a)}px)`},children:l?.map(((e,t)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(Me,{size:"text-xl",children:e.data}):null,e?.cols?wx(e.cols,a):null]},`row${t}`)))})})]},String(t))})),eg({...l,btnClass:["left-3 top-20","right-3 top-20"],className:""})]});var a})),kx=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const l=`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(Me,{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(Cx,{rows:t.rowsData})})})]},l)}))}))),Sx=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Ix=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:l})=>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:()=>l(t),children:o(Me,{size:"text-xl",font:"font-light",color:Sx(t===n),children:e||t+1})},e)))}):null,t?o(ye,{className:"text-primary-main",href:t,version:"secondary",target:"_blank",appendLeft:o(W,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),Tx=ht((({tableSource:e,pdfUrl:t,onClick:n})=>{const a=e?.tableData,[r,s]=l(0),d=i((e=>s(e)),[]),m=a?.[r]?.items??[],u=a?.map((e=>e.currency??""));return c("div",a?{className:"bg-white z-10",children:[o(Ix,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(kx,{activeTabIndex:r,items:m}),o(fx,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Me,{size:"text-h6",children:"Данных нет"}),o(fx,{onClick:n,isOpen:!0})]})})),Bx=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(Tx,{...t,onClick:n})}):null]}))),Rx=d((({row:{header:e,data:t},activeIndex:n,rowIdx:a,...r})=>{const[s,d]=l(void 0),m=i((e=>d(e)),[]),[h,p]=l(void 0),g=i((e=>p(e)),[]);return c(Bx,{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(Me,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(gx,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(vx,{cells:e,rowIdx:a,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})})),Px=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,eg({...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]})})),Dx=d((({className:e="",title:t,description:n,rowHeaders:l,tariffsColumns:a,hiddenRowsNum:i=0,...r})=>{const s=a?.map((({data:e})=>e))||[],d=l?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=s.length,[h,p]=Qp({itemCount:m,visibleItemCount:2}),f=(d||[]).map(((e,t)=>o(Rx,{row:e,activeIndex:h,rowIdx:t,...r},String(t)))),[x,b]=i>0?[f.slice(0,-i),f.slice(-i)]:[f,[]];return c(g,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...r,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:i>0?o(Mi,{renderFoldableSection:({isUnfolded:e})=>c(Px,{controls:p,children:[x,o(_i,{isUnfolded:e,children:b})]}),renderFoldButton:Nc}):o(Px,{controls:p,children:f})})]})})),Mx=d((({className:e="",title:t,description:n,iconVersion:l,__html:a,richVersion:i,...r})=>c(g,{className:u("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...r,children:["small"===l?_x():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Me,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?zx(n):null,a?o(Pe,{richVersion:i,__html:a}):null]})]}))),_x=()=>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"}),zx=e=>o(w,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),Vx=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(Me,{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(Me,{size:"text-h2",children:n})}):null]}))),Ax=d((e=>{const{prefix:t,unit:n,suffix:l,...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(Vx,{prefix:t,unit:n,suffix:l})})})),Fx=ht((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:l=!0,version:a="transparent",isTheme:i=!1,isCardBorder:r=!1,image:s,...c})=>{const d=D();return o(g,{className:u("relative flex flex-col",Gp[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${J(d)(s?.src)})`}}:{},padding:t,version:a,isTheme:i,...c,children:P({...c,extraProps:{className:u("w-full",Lo(r)),...Xp(l)}})})}),{childrenTypes:[]}),Ex=e=>(e=>{const t="col-span-",n=e?.split(/\s+/).find((e=>e.startsWith(t)));return n?parseInt(n.substring(t.length),10):12})(e)<10?"py-xl px-6xl":"py-6xl px-32",Ox=d((({className:e,title:t,url:n,previewImg:l,...a})=>{const i=D();return c(g,{className:e,defaultPadding:Ex(e),...a,children:[o(k,{title:t,headlineVersion:"M"}),n?o("video",{className:"m-auto w-full object-fill",preload:"metadata",poster:q(i)(l?.src),style:{maxHeight:524},controls:!0,children:o("source",{src:q(i)(n)})}):null]})})),Lx={AdTile:gt,ApplicationForm:Ms,ApplicationLeadForm:_o,ApplicationStatus:Ao,BankAccountFiltration:Oc,BenefitsBlock:Uc,BonusBenefitsBlock:Xc,ButtonsBlock:Jc,CalculatorBonus:ud,CalculatorBusinessDeposit:Rd,CalculatorCredit:Ud,CalculatorDeposit:om,CalculatorRefinancing:fm,CardTransfer:Cm,Carousel:Dm,CarouselCard:Vm,CarouselCatalogCard:Fm,CarouselLinks:Lm,CarouselRecommendationCard:Km,CarouselTariffsCard:Jm,ContactsBlock:Qm,CreditForm:Tu,DepositFiltration:Mu,Depository:Ku,ErrorBlock:Gu,ExchangeRateTile:Ch,Footer:lp,GracePeriod:ap,GrantSupport:op,Header:Hp,Headline:k,HorizontalLayout:Jp,ImgBlock:Zp,InsuranceAmountBlock:ig,InvestmentInfo:cg,LinkDocs:Cg,MobileAppTile:Tg,MortgageFiltration:Xg,OfficesAtmsMap:hf,Placeholder:pf,ProductBlock:pt,ProductGallery:ff,RepresentativeOfficeInfo:bf,RichTextBlock:Nf,RollupItem:If,SafeDepositRental:Xf,StepsBlock:Qf,StickyBottomMenu:nx,TabsLayout:cx,TariffsTable:Dx,TextBlock:Mx,UnitBlock:Ax,VerticalLayout:Fx,Video:Ox},$x=me((()=>{a((()=>{It()}),[]);const e=zt();$t(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const l=JSON.parse(n?.dataset?.aspects??"[]");kt({aspectsAttributes:l,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))})),jx="cookie",qx=d((({__html:e})=>{const[t,{setTrue:n,setFalse:l}]=Lt();Oh((()=>{globalThis.localStorage?.getItem(jx)||n()}),[],3e3);const a=i((()=>{globalThis.localStorage?.setItem(jx,"true"),l()}),[]);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(Pe,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(ua,{className:"bg-main-gray rounded-md w-11 h-11",onClose:a})})]})}):null}));function Ux(e){throw new Error(e)}const Wx=({onCloseAll:e,onClose:t}={})=>{const[n,{push:r,pop:s,clear:o}]=function(e=[]){const[t,n]=l(e),a=i((e=>n((t=>[...t,e]))),[]),r=i((()=>n((e=>e.slice(0,-1)))),[]),s=i((e=>n((t=>t.filter((t=>t!==e))))),[]),o=i((()=>n([])),[]);return[t,{setList:n,push:a,pop:r,remove:s,clear:o}]}(),c=i((()=>{e&&e(n),o()}),[n,e]),d=i((()=>{t&&t(n[n.length-1]),s()}),[n,t]);return a((()=>ce.subscribe("dialog",(e=>{switch(e.type){case"open":r(e);break;case"close":e.all?c():d();break;default:Ux(e)}}))),[c,d]),n},Hx=d((()=>{const e=i((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=i((e=>{e?.onClose&&e.onClose()}),[]),n=Wx({onCloseAll:e,onClose:t}),{close:l}=de(),r=i((({key:e})=>{"Escape"===e&&l()}),[]);return $t(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},l)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:l!==n.length-1}),children:e},String(t||l))))}):null})),Yx=d((()=>{const[e,t]=l(null),n=i((()=>{t(null)}),[]);a((()=>ce.subscribe("popup",(e=>{switch(e.type){case"open":case"update":t(e);break;case"close":n();break;default:Ux(e)}}))),[]);const r=i((({key:e})=>{"Escape"===e&&n()}),[n]);return $t(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})),Kx="header",Xx="footer",Gx="sticky-footer",Jx={},Zx=d((({className:e,data:t=Jx,blocksRegistry:n,blockDecorator:l})=>{const{slots:a,blocks:i,fallback:r,...s}=t,d=ut(s,r);$x();const m={key:"",page:{slots:a,blocks:i,fallback:r,...d},blocksRegistry:n,blockDecorator:l,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:Kx})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[P({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),R(a?.footer,{...m,slotName:Xx})]})]}),a?.["sticky-footer"]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:R(a?.["sticky-footer"],{...m,slotName:Gx})}):null,o(Hx,{}),o(Yx,{}),o(qx,{__html:d?.cookieContent?.__html})]})}));Object.assign(Zx,{childrenTypes:[],slots:()=>[Kx,Xx,Gx]});e.Blocks=Lx,e.ContentPage=Zx,e.handlerDecorator=me,e.joinList=Tc,e.packageVersion="0.14.647",e.projectSettings=_,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=L,e.useRouter=D,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniBlocks={})}(this,(function(e){"use strict";let t;const n=e=>(...n)=>t[e](...n),l=n("useState"),a=n("useEffect"),i=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:l,...a}=t||{},i=n?.slots?.default,r=l||i&&i();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:l="p-xl",padding:a,block:i,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||l,e),...m?{"data-ver":t}:{},...i?.anchor?{id:i.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)=>y(100,e).map((e=>Math.floor(e))).map(b),b=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),y=(e,t)=>[e].concat(t>0?y(e/1.618,t-1):[]),v={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},N=d((({className:e="",headingType:t="h3",as:n="h3",title:l,children:a})=>o(n,{role:"heading",className:u("font-sans m-0",v[t],e),children:l||a}))),w=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),C={XXL:{title:{headingType:"h0",as:"h1"},descriptionSize:"text-h5",descriptionWeight:"font-normal",descriptionStyle:"mt-xl"},XL:{title:{headingType:"h1",as:"h1"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},L:{title:{headingType:"h2",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},M:{title:{headingType:"h3",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-s"},S:{title:{headingType:"h4",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-xs"},XS:{title:{headingType:"h5",as:"h2"},descriptionSize:"text-m",descriptionWeight:"font-light",descriptionStyle:"mt-xs"}},k=d((({className:e,version:t="",headlineVersion:n="XL",title:l,description:a,align:i="text-center",as:r,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=C[n],p={marginTop:h.descriptionStyle};return c(g,{className:u({"@container-normal":s},e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[l?o(N,{className:u("whitespace-pre-wrap",i),...h?.title,as:r||h?.title.as,title:l}):null,a?o(w,{size:h.descriptionSize,font:h.descriptionWeight,align:i,...p,children:a}):null]})})),S=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),I=[];function T(e,t,{className:n,...l}={}){const{key:a,blockDecorator:i=S,blocksRegistry:r={},ancestors:s=I}=t,{type:c}=e;c&&c in r||console.warn(`No block with "${c}" is registered`);const d=c&&r[c];return i({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:i})=>{const{content:r}=n;return d?o(d,{className:i,block:e,options:t,...r,...l},a):null}},a)}const B=[],R=(e,{key:t,ancestors:n=B,slotName:l=null,extraProps:a,renderProps:i=T,...r})=>{const s=a?(e,t)=>T(e,t,a):i;return(e||[]).map(((e,a)=>s(e,{...r,key:`${t||e.type}-${a}`,ancestors:r.parent?[...n||B,[r.parent,l]]:n},a)))};function P({block:e,options:t,children:n,extraProps:l,renderProps:a}){return n||(e&&t?R(e.blocks,{...t,parent:e,extraProps:l,renderProps:a}):null)}function D(){return D._impl()}D._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),D.setup=e=>{D._impl=e};const M=["CDN","BASE_PATH"],_=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return M.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),z=e=>Boolean(e?.includes(":")),V=(e,t)=>Boolean(e&&!z(e)&&(!t||"_self"===t)),A=e=>Boolean(e?.startsWith("#")),E=e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),F=(...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:z,isLocalURL:V,isHash:A,withoutQuery:E,joinPath:F,hasPrefix:O});const $="/api/",j=`${$}v1/storage`,q=e=>(t,n)=>{if([!t,z(t),A(t),[_.CDN,$].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`${j}/${t}/attachment`;const l=t?.startsWith("/");return F(O(t,n)?"":n,l?"/":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:l=`Иконка ${n}`,title:a=l,iconVersion:i="color",width:r,height:s})=>{const d=D(),m="normal"===i?`${n}.svg`:`sprites.svg#${n}`,h=q(d)(F(_.CDN,"/icons/",m));return"normal"===i?o("img",{className:e,src:h,alt:l,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[i],{invert:"white"===i},t),width:r,height:s,"aria-hidden":"true",children:[a?o("title",{children:a}):null,l?o("desc",{children:l}):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)),X=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function G(e=""){try{return new URL(e).pathname}catch(e){return""}}const J=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":G(X.SITE_URL);return t&&!z(t)?q(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 l=D();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(Z).map((({src:e,format:n,media:a},i)=>o("source",{srcSet:J(l)(e),type:te(n),media:a?`(max-width: ${a}px)`:"",width:t?.size?.width,height:t?.size?.height},`${i}_${e}`))):null,t?.src?ee({...t,src:J(l)(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="",...l})=>t?.src||t?.icon?t.icon?o(W,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...l}):o(Q,{className:e,imageClassName:n,image:t}):null)),le={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",ie={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?le[n]:"",t?"rounded-full":"rounded-md",e].join(" ");const ce=new class{subscribers={};subjectsStateMap={};subscribe(e,t){this.subscribers[e]=(this.subscribers[e]||[]).concat(t);const n=this.subjectsStateMap[e];return n&&t(n),()=>{this.unsubscribe(e,t)}}unsubscribe(e,t){this.subscribers[e]=this.subscribers[e]?.filter((e=>e!==t))}fire(e,t){e in this.subjectsStateMap&&(this.subjectsStateMap[e]=t),this.subscribers[e]?.forEach((e=>e(t)))}subject(e,t){this.subjectsStateMap[e]=t}},de=()=>({open:(e,t={})=>ce.fire("dialog",{type:"open",dialog:e,...t}),close:()=>ce.fire("dialog",{type:"close"}),closeAll:()=>ce.fire("dialog",{type:"close",all:!0})}),me=e=>me._impl(e);function ue(){const e=G(X.SITE_URL),t=D(),{closeAll:n}=de();return e=>{const n=q(t)(e.href);return{...e,href:n,"aria-label":e.text,onClick:me(l({...e,href:n}))}};function l({href:l,target:a,onClick:i}){return r=>{i?.(r),he(l,a,e)||(n(),r?.preventDefault(),t.push(((e,t="")=>e?.replace(t,"")||"/")(l,e)))}}}me._impl=e=>e,me.setup=e=>{me._impl=e};const he=(e,t,n)=>{if(!V(e,t))return!0;const l=X.SUB_PORTALS?.split(",");return!!l?.some((t=>O(e,t)))||!O(e,n||"/")},pe=e=>{if(!Array.isArray(e)||!e.length)return{};try{return{"data-aspects":JSON.stringify(e)}}catch(e){return{}}},ge=d((e=>{const{text:t,aboveText:n,appendLeft:l,appendRight:a,version:i="primary"}=e,r=xe(e)&&"hidden lg:block";return c("div",{className:u(fe(e),"flex gap-xs"),children:[l?o("div",{className:u(r,se[i]),children:l}):null,xe(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[i]),children:a}):null]})})),fe=e=>{const{version:t,aboveText:n,rounded:l}=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",xe(e)?a:"h-12 w-12 m-auto",{"rounded-full":l})},xe=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),be=({className:e,rounded:t,version:n})=>["inline-block",re,n?ie[n]:"",t?"rounded-full":"rounded-md",e].join(" "),ye=d((({disabled:e,children:t,method:n="LINK",href:l,...a})=>{const r=(({method:e,href:t})=>i((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:l,pathname:a,searchParams:i}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[l,a].join(""));for(const[e,t]of i.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:l}),s=ue()({onClick:r,href:l,...a}),c=t??o(ge,{...s});return o(e?Ne:ve,{...s,children:c})})),ve=d((({className:e="",href:t,rel:n,target:l,ariaLabel:a,version:i,rounded:r,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:oe({className:e,version:i,rounded:r}),href:t,rel:n,target:l,"aria-label":a||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...pe(d),children:m}))),Ne=d((({className:e,ariaLabel:t,version:n,rounded:l,children:a})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:be({className:e,rounded:l,version:n}),children:a})));function we({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:l=!1}){if(!n)return null;const a="primary"===e?"white":"black",i="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(l?"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}),i),onClick:t,children:o(ne,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:a}})}),o(ye,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const Ce=()=>{const[e,t]=l(false);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"},Se=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&ke[n],t),children:e}):null,Ie=d((({className:e,version:t="primary",defaultPadding:n,padding:l="",title:a,buttons:r,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:x,...b})=>{const y=Ce(),v=D(),N=i((()=>v.back()),[]),w=b.options?.page?.common?.backwardButton,C=f&&!y;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",l||n,e),children:[C&&we({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:[Se(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]}),Be(P({...b,extraProps:{className:"@container-normal"}})),Se(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Te(p)]:r,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),r?o("div",{className:"self-end",children:r}):null]})]})]})})),Te=e=>u(e?"row-span-2":"@xl:row-span-2"),Be=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,Pe=d((e=>{const{__html:t="",richVersion:n="",itemSize:l="list-m",isDotted:a=!0}=e,i=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,l,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",i),dangerouslySetInnerHTML:{__html:t}})}):null})),De=(e,t)=>e?o(w,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,Me=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),_e=(e,t)=>e?o(Me,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,ze=(e,t)=>["label"in e?_e(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:De(e.description,t)},String(t)):null,"__html"in e?o(Pe,{...e},`rte-${t}`):null],Ve=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:ze(n)})]}))),Ae=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(Ve,{benefitsVersion:t,...e},String(n))))}):null)),Ee=d((({className:e,benefits:t})=>t?.length?o("div",{className:u("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap(ze)}):null)),Fe=d((({isTabularBenefits:e,...t})=>o(e?Ee:Ae,{...t}))),Oe=e=>Boolean(e?.src||e?.icon),Le=(e,{className:t,buttonClassName:n,isVertical:l}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",l?"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($e(n))}):null,$e=(e="")=>(t,n)=>{const{text:l,icon:a,iconRight:i,version:r,...s}=t||{},c=je(a,r),d=je(i,r);return l||a?.icon?o(ye,{className:u("basis-full @lg:basis-auto",e),appendLeft:qe({...a,iconVersion:c}),appendRight:qe({...i,iconVersion:d}),version:r,text:l,...s},n?String(n):""):null},je=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},qe=e=>Oe(e)&&o(ne,{image:e,width:String(e?.size?.width||24),height:String(24)}),Ue=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),We=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(He)}):null)),He=({label:e,amount:t,unit:n},l)=>c("div",{className:"basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg sm:rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(Me,{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:[Ue(2)(t)," ",n||"₽"]}):null]},String(l)),Ye=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(Ke)}):null)),Ke=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(Me,{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"},Ge=d((({className:e,padding:t,defaultPadding:n,title:l,description:a,headlineVersion:i="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:b,image:y,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:C=!1}={},backwardButton:S,children:I,...T})=>{const B=y?.src?o(ne,{image:y}):null,R=o(k,{title:l,description:a,headlineVersion:i,align:r,isEmbedded:!0}),P=u?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Ie,{className:e,padding:t,defaultPadding:n,...g?{title:R}:{insetTitle:R},...Je(B,N),isImageSecondary:C,imageAlign:v,isImageAlwaysOnRight:w,buttons:Le(b),backwardButton:S,...T,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[P?.length?o(Fe,{benefitsVersion:s,isTabularBenefits:d,benefits:P}):null,h?o(Pe,{richVersion:p,__html:h,isDotted:m,itemSize:Xe[i]}):null,I,f?.length?o(We,{priceList:f}):null,Ze(x)]})})})),Je=(e,t)=>t?{rightImage:e}:{leftImage:e},Ze=e=>e?.length?o(Ye,{tags:e}):null,Qe=e=>Boolean(e&&Array.isArray(e)),et=e=>Boolean(e&&!Array.isArray(e)&&"object"==typeof e),tt=(e,t)=>{return n=e,Boolean(et(n)&&"string"==typeof n.$ref)?t.ref(e):et(e)?t.record(e):Qe(e)?t.array(e):t.scalar?t.scalar(e):e;var n},nt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(lt,e),lt=(e,t)=>e&&t?et(e)?e[t]:Qe(e)?e[parseInt(t,10)]:e:e,at=(e,t)=>tt(e,{ref:({$ref:e,...n})=>at(e?nt(t(e),e):n,t),record:e=>Object.entries(e).map((([e,n])=>({[e]:at(n,t)}))).reduce(((e,t)=>Object.assign(e,t)),{}),array:e=>e.map((e=>at(e,t)))}),it=(e,t,n=[])=>{tt(e,{ref:e=>t(e.$ref,n),record:e=>{for(const l in e)it(e[l],t,[...n,l])},array:e=>{for(let l=0;l<e.length;l++)it(e[l],t,[...n,l])}})};async function rt(e,t){try{return e?await st(e,t):null}catch(e){console.error(e)}return null}const st=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),ot=e=>[...new Set(e)],ct={},dt=["/portal-resources"],mt=(e,t)=>at(e,(e=>t?.[e])),ut=(e,t)=>{const n=(e=>{const t=[];return it(e,(e=>t.push(e))),t})(e),[i,r]=l({});return a((()=>{n.length&&(async e=>Object.fromEntries((await Promise.allSettled(ot(e).filter((e=>!dt.some((t=>e.startsWith(t))))).map((async e=>[e,ct[e]||=await st(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(n).then(r)}),[n.join()]),n.length?mt(e,{...t,...i}):e};function ht(e,t={}){const n=d((t=>{const n=ut((({block:e,options:t,className:n,defaultPadding:l,padding:a,isTheme:i,version:r,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const pt=ht((({className:e,padding:t,defaultPadding:n,...l})=>o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...l,children:o(Ge,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...l})})),{childrenTypes:["UnitBlock"]}),gt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>ft(0,t?.length)),[t]),l=t?.[n];return l?o(pt,{suppressHydrationWarning:!0,...l,...e}):o(g,{...e,children:o(f,{})})})),ft=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),xt=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),l=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getFullYear());return t?`${a}-${l}-${n}`:`${n}.${l}.${a}`}},bt=e=>e?.replace(/[^+\d]/g,"");const yt=e=>e?{phone:bt(e)}:{},vt=(e,t="birthday")=>e?{[t]:xt(e)}:{},Nt=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),wt=(e,t=!0)=>({[t?"email":"mail"]:e}),Ct=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:bt(e)}:{},kt=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:l,params:a}of e)t[l??""]?.(n,a)},St="rshb-query-params";function It(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(St)||"";return e&&globalThis.sessionStorage?.setItem(St,e),e}function Tt(e){if(!e)throw new Error("Value should be fulfilled");return e}const Bt=e=>t=>{const[,n]=Tt(e.find((([e])=>e(t))));return n(t)},Rt=e=>Bt(e.map((([e,t])=>[e,()=>t])));Rt.if=e=>new Pt(void 0,e);class Pt{parent;predicate;unit;get entry(){return[Tt(this.predicate),Tt(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new Pt(this,e)}then(e){return new Pt(this.parent,this.predicate,e)}else(e){return Bt([...Dt(this),[()=>!0,e]])}}const Dt=e=>[...e?.parent?Dt(e.parent):[],e.entry],Mt=e=>{const t=e.target?.closest("a");if(z(t?.href)&&!t?.href?.startsWith(globalThis.location?.origin)){e.preventDefault(),e.stopPropagation();const n=(e=>{const t=It();if(!z(e)||!t)return e;const n=new URL(e);for(const[e,l]of new URLSearchParams(t))n.searchParams.set(e,l);return n.toString()})(t?.href)||t?.href;if(n){_t(t?.target)?.(n)}}},_t=Rt([[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 zt(){return zt._impl()}zt._impl=()=>({forwardQuery:Mt}),zt.setup=e=>{zt._impl=e};const Vt=e=>e,At=(e,{resetOnSubmit:t,onSubmit:n,normalize:r}={})=>{const[s,o]=l(e),c=i(r?e=>o(e instanceof Function?t=>{const n=r(e(t));return Et(t,n)?t:n}:r(e)):o,[r]);a((()=>{r&&o(r)}),[r]);const[d,m]=l(!1),[u,h]=l({}),p=i(((e,t)=>{const{parse:n=Vt,format:l=Vt}=t||{};return{value:l(s[e]),isDirty:d||u[e],onChange:t=>{c((l=>({...l,[e]:n(t)}))),h((t=>({...t,[e]:!0})))}}}),[c,d,u]),g=i((e=>{c(e),h(e)}),[]),f=i((()=>{c(e),m(!1),h({})}),[e]),x=i((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}]},Et=(e,t)=>e&&t&&Object.keys({...e,...t}).every((n=>e[n]===t[n])),Ft=d((e=>{const{className:t,title:n,children:l,...a}=e;return o(g,{className:t,defaultPadding:"p-6xl",...a,children:c("div",{className:"container max-w-[978px] space-y-lg",children:[n?o(N,{headingType:"h3",title:n,className:"@xl:text-center"}):null,l]})})})),Ot=e=>"OUTSERVICE"===e?"/api/v1/outservice/outserviceregions":void 0;function Lt(e=!1){const[t,n]=l(e),a=i((()=>n(!0)),[]),r=i((()=>n(!1)),[]),s=i((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:a,setFalse:r,toggle:s}]}function $t(e,t,n,l){a((()=>{if(e&&n)return e.addEventListener(t,n,l),()=>{e.removeEventListener(t,n,l)}}),[e,t,n])}function jt(e){const t=s(null),n=i((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return $t(globalThis.document,"click",n),t}const qt=({label:e,errors:t})=>e&&t?`${e}*`:e,Ut=()=>{},Wt="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",Ht=e=>e?o(Me,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,Yt=d((({key:e,className:t="",id:n,name:l,type:r="text",label:d,placeholder:m,value:h="",valid:p=!0,children:g,onChange:f,onFocus:x,onBlur:b,pattern:y,autoFocus:v=!1,isTextarea:N=!1,disabled:w=!1})=>{const C=s(null),k=i((e=>{const t=(e.target?.value||"").trimStart();f&&f(t)}),[f]);a((()=>{v&&C.current?.focus()}),[v,C]);const S=g?"pr-3xl":"",I=Kt(p);return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[Ht(d),N?o("textarea",{className:u("block resize-y min-h-24",Xt,I),id:u("textarea",n),name:l||n,placeholder:m,value:h,onChange:k,onFocus:x,onBlur:b,disabled:w},e):o("input",{type:r,className:u("h-14",Xt,S,I),ref:C,id:n,name:l||n,placeholder:m,value:h,onChange:k,onFocus:x,onBlur:b,pattern:y,disabled:w},e)]}),g]})})),Kt=e=>e?Wt:"border-error",Xt="w-full border rounded-md text-primary-text outline-none p-m",Gt=e=>o("div",{className:"h-6",children:e?o(Me,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),Jt=e=>e?.value||"",Zt={url:"suggest/address"},Qt={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:Zt,addressFact:Zt,organizationAddress:Zt},en=()=>({open:(e,t)=>ce.fire("popup",{type:"open",popup:e,...t}),update:(e,t)=>ce.fire("popup",{type:"update",popup:e,...t}),close:()=>ce.fire("popup",{type:"close"})}),tn=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 nn({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=l([]),f=en(),x=Qt[n],b=i((()=>{h.current=t,f.close()}),[t]),y=i((e=>{b(),h.current=e.processedValue,c&&c(e.processedValue),d&&d(e)}),[b,c]),v=s(null),N=r((()=>async e=>{if(!x)return;const t=await(e=>{const{url:t,query:n,queryPrefix:l,requestData:a={},responseItemHandler:i=Jt}=e,r=(s=i,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${l?`${l}, `:""}${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 l=(...a)=>{l.dispose(),n=setTimeout((()=>{e(...a)}),t)};return l.dispose=()=>{n&&clearTimeout(n)},l})(N,300)),[N]);return a((()=>{if(!e||!v.current||h.current===t)return void b();const n=v.current,{top:l,left:a,width:i,height:r}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.update(o(tn,{options:p,value:t,onChange:y}),{top:l+globalThis.scrollY+r,left:a,width:i})}),[e,p,t,y]),v}const ln=d((({className:e,label:t,value:n="",placeholder:l,error:a,errors:r,onChange:s=Ut,onDaDataChange:d,onBlur:m,isTextarea:h,type:p,name:g="",daDataQueryPrefix:f,inputLength:x,dadata:b=!1,disabled:y=!1})=>{const[v,{setFalse:N,setTrue:w}]=Lt(),C=jt(N),k=i((e=>x?e.length<=x&&s(e):s(e)),[s]),S=nn({isOpen:v&&b,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:S,children:o(Yt,{disabled:y,type:p||"text","aria-label":t,label:qt({label:t,errors:r}),valid:Boolean(!a),value:n,onChange:k,onBlur:m,isTextarea:h,placeholder:an(l,r,t)})}),Gt(a)]})})),an=(e,t,n)=>t&&!n?`${e}*`:e,rn=e=>e?.text||e?.key||"",sn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,on=d((({popupRef:e,options:t,value:n,query:l,onChange:a,iconVersion:i})=>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:sn(t,l).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:rn(e)}),o(W,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:i,className:u("absolute right-4 pt-3xs",{hidden:e.key!==n?.key})})]},e.key)))}):null));const cn=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[b,{setFalse:y,setTrue:v}]=Lt(),[N,w]=l(""),C=un(x,n.length),k=b&&!C,S=i((()=>{w(""),y()}),[]),I=function({isOpen:e,options:t,value:n,query:l,onChange:r,onClose:c,iconVersion:d}){const m=en(),u=i((()=>{m.close(),c&&c()}),[c]),h=i((e=>{u(),r&&r(e)}),[u,r]),p=s(null),g=jt(u);return a((()=>{if(!e||!p.current)return;const a=p.current,{top:i,left:r,width:s,height:c}=a.getBoundingClientRect();m.update(o(on,{popupRef:g,options:t,value:n,query:l,onChange:h,iconVersion:d}),{top:i+window.scrollY+c,left:r,width:s})}),[e,t,n,l,h]),p}({isOpen:b,options:n,value:r,query:N,onChange:f,onClose:S,iconVersion:g});return c("div",{className:u("space-y-xs",e),children:[Ht(t),c("div",{className:u("relative",k?"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",mn(m,d,C)),onClick:k?S:v,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:rn(r)||h}),dn(k,g)]}),p&&k?o("div",{className:u("absolute top-0 w-full z-20"),children:o(Yt,{type:"text",autoFocus:!0,value:N,onChange:w})}):null]})]})})),dn=(e,t)=>o(W,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),mn=(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"),un=(e,t)=>e||0===t,hn=d((({className:e="",label:t,error:n,errors:l,...a})=>c("div",{className:e,children:[o(cn,{...a,valid:!n,label:qt({label:t,errors:l})}),Gt(n)]}))),pn=e=>!e?.length,gn=e=>t=>n=>e(n)?[]:[t],fn=gn((e=>null!=e&&""!==e)),xn="Некорректно заполненное поле",bn=e=>fn(e??xn),yn=e=>gn((e=>e?.key&&""!==e?.key))(e??xn),vn=e=>gn((e=>"string"==typeof e&&e.length>0&&e.length<=2))(e??xn),Nn=e=>gn((e=>"string"==typeof e&&e.length>1))(e??xn),wn=(e,t)=>gn((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??xn),Cn=e=>gn((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}$/,gn((e=>"string"==typeof e&&t.test(e))))(e);var t},Sn=gn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),In=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},Tn=e=>Boolean("0"===e.qc&&"0"===e.qcComplete&&"2"===e.qcHouse),Bn=()=>gn(Tn)("Укажите регион, город/населенный пункт, улицу, дом, квартиру"),Rn={typeForm:bn(),surname:Nn("Укажите свою фамилию"),name:Nn("Укажите своё имя"),middleName:Nn("Укажите своё отчество"),region:yn(),addressBranch:yn(),phone:kn("Укажите номер телефона"),secondaryPhone:kn("Укажите номер телефона"),organizationPhone:kn("Укажите номер телефона"),birthday:bn("Укажите дату рождения"),birthPlace:bn("Укажите место рождения"),education:bn("Выберите ваше образование"),housing:bn("Выберите тип жилья"),employment:bn("Выберите информацию о трудоустройстве"),organization:bn("Выберите тип организации"),amountWorkers:bn("Выберите информацию о количестве сотрудников"),employerActivities:bn("Выберите вид деятельности организации"),employerOrganization:bn("Выберите вид организации"),positionOrganization:bn("Выберите вашу должность"),dulSerie:(Pn="Укажите серию паспорта",gn((e=>"string"==typeof e&&4===e.length))(Pn)),dulNumber:Cn("Укажите номер паспорта"),dulIssueDateField:bn("Укажите дату выдачи паспорта"),dulSubdivisionCode:Cn("Укажите код подразделения"),dulIssuedBy:bn("Укажите организацию, выдавшую паспорт"),email:(e=>gn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(e))("Укажите электронную почту"),fullName:Nn(),inn:(e=>gn((e=>"string"==typeof e&&(10===e.length||12===e.length)))(e))("Укажите ИНН"),legalForm:bn("Укажите ОПФ"),organizationName:bn("Укажите наименование организации"),generalSeniority:vn("Укажите количество лет стажа"),lastJobExperience:vn("Укажите стаж на последнем месте работы"),experience5Years:vn("Укажите общий стаж за последние 5 лет"),jobsNumber:vn("Укажите количество мест работы за последние 5 лет"),beginDate:bn("Укажите дату заключения трудового договора"),addressFact:Bn(),partnerComments:bn(),collectionCount:bn(),comment:bn(),acquiringType:yn(),feedbackMethod:yn(),serviceType:yn(),serviceDirection:yn(),meetingDay:bn(),product:bn(),localities:bn(),consentDataProcessing:Sn,annualRevenue:bn(),consentToReceiveMaterials:Sn,processPersonalDataFlg:Sn,consentProviderFlg:Sn,consentPfrFlg:Sn,consentOthersFlg:Sn,consentInformFlg:Sn,familyStatus:bn("Выберите семейное положение"),children:wn(2,"Укажите количество детей"),familyMembers:wn(2,"Укажите количество членов семьи"),dependents:wn(2,"Укажите количество иждивенцев"),totalIncome:wn(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:wn(10,"Укажите сумму обязательных выплат"),snils:(e=>gn(In)(e))("Некорректный номер СНИЛС"),conscription:bn(),armyIdFlg:Sn,sex:bn("Укажите свой пол"),addressRegistration:Bn(),organizationAddress:Bn(),participantDateRegistration:bn("Укажите дату регистрации"),retirementIncome:bn(),otherIncome:bn(),mandatoryIncome:bn(),otherPayments:bn(),disablePeopleFlg:bn(),bankruptcyFlg:bn(),shareholderFlg:bn(),legalEntityName:bn(),bankEmployeeCode:bn(),partInBusiness:bn(),regionRetail:yn("Выберите филиал банка"),addressRetail:yn("Выберите адрес банка"),addressMatch:bn(),codeWord:(e=>gn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&/^[\u0400-\u04FF\d]+$/u.test(e)))(e??xn))("Необходимо ввести кодовое слово"),confirmationIncome:bn()};var Pn;const Dn=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,Rn?.[e||""]])))},Mn=(e,t)=>{const{value:n,isDirty:l}=e,a=l?t(n):[];return{...e,errors:a,error:a[0]}},_n=(e,t,n=!1)=>n?Mn(e,t):e,zn=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],Vn=d((({field:e,input:t})=>o(hn,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:zn,..._n(e("acquiringType"),Rn.acquiringType,t?.required)}))),An=(e="")=>Boolean("trade"===e||"all"===e),En=e=>null!=e,Fn=new Map,On=e=>Boolean(e?.every((e=>Array.isArray(e)?On(e):!e||"string"==typeof e))),Ln=e=>On(e)?e.toString():"";function $n(e,t,{fallback:n,cache:i}={}){const s=r((()=>jn(e)),[e]),[o,c]=l(void 0),[d,m]=l(void 0);a((()=>{if(!s.some(En))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await((e,t=Fn)=>n=>{const l=Ln(n),a=t.get(l);if(l&&En(a))return a;const i=e(...n);return l&&En(i)&&t.set(l,Promise.resolve(i)),i})(t,i)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,i,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 jn(e){return Array.isArray(e)?e:e instanceof Function?jn(e()):[e]}const qn=[];const Un=async e=>await rt(e,{method:"GET"})||qn;function Wn(e=!1){const{data:t}=$n("/api/v1"+(e?"/premiumBranchesByRegions":"/branchesByRegions"),st);return Array.isArray(t)?t:[]}const Hn=d((({field:e,input:t,isPremium:n=!1})=>{const l=e("region"),i=l?.value?.key,r=l?.value?.text,s=n?Wn(n)?.find((e=>e?.region===r))?.branches:function(e){const{data:t}=$n(e?`/api/v1/branches?regionCode=${e}`:null,Un);return t||qn}(i)?.filter((e=>e?.address));return a((()=>{""!==l?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[l?.value]),o(hn,{label:"Отделение",placeholder:"Выберите отделение",options:(s||[]).map((({address:e=""})=>({key:e,text:e}))),..._n(e("addressBranch"),Rn.addressBranch,t?.required),isSearch:!0})})),Yn=d((({field:e,input:t})=>{const n="addressFact",l=e(n).value,{value:r}=e("addressMatch");a((()=>{r&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[r]);const s=i((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})}),[]),c=i((t=>{e?.(n)?.onChange?.({...e(n).value,fullAddress:t})}),[]);return o(ln,{label:"Адрес",disabled:r,..._n(e(n),Rn[n],t?.required),value:l.fullAddress,onChange:c,...t,onDaDataChange:s})})),Kn=(e,t)=>"RETIREE"!==e?.("employment")?.value?.key&&t,Xn=()=>JSON.parse(globalThis.localStorage?.getItem("leadForm")??"{}")?.esiaId,Gn=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",l=e(n).value,a=i((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=i((t=>{e?.(n)?.onChange?.({...e(n).value,fullAddress:t})}),[]);return o(ln,{disabled:"addressRegistration"===n&&Xn()&&t?.filledByEsia,label:"Адрес",..._n(e(n),Rn[n],"organizationAddress"===t?.name?Kn(e,t?.required):t?.required),value:l.fullAddress,onChange:r,...t,onDaDataChange:a})})),Jn=d((({className:e,viewBox:t,fill:n="none",width:l,height:a,paths:i,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:l,height:a,children:i.map((({d:e,fill:t,...n},l)=>{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},l)}))}))),Zn="appearance-none w-5 h-5 border-solid flex-none",Qn=[{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"}],el=d((({className:e,value:t,text:n,disabled:l,isRadio:a,onChange:r})=>{const s=i((e=>{l||(e.preventDefault(),r&&r(!t))}),[r,l,t]),d=a?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(Jn,{paths:Qn,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",nl(l)),onClick:s,children:[o("div",{className:u(Zn,"m-0",a?"rounded-full border-2":al(t),!l&&t?"border-primary-main":"border-gray",l?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:ll(a),"aria-checked":Boolean(t),"aria-disabled":Boolean(l),"aria-label":n}),t?d:null,tl(n)]})})})),tl=e=>e?o("div",{className:"ml-s",children:o(Me,{size:"text-l",font:"font-light",children:e})}):null,nl=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",ll=(e=!1)=>e?"radio":"checkbox",al=(e=!1)=>u("rounded border",{"bg-primary-main":e}),il=d((({className:e,text:t,value:n,key:l,disabled:a,error:i,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(el,{text:t,value:n,disabled:a,onChange:r},l),Gt(i)]}))),rl=d((({field:e})=>o(il,{text:"Адрес фактического места жительства совпадает с адресом регистрации",..._n(e("addressMatch"),Rn.addressMatch)}))),sl=(e,{normalize:t,format:n})=>{const{value:a,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=l(!1),m=i((e=>{d(!0),r&&r(e)}),[]),u=i((()=>{d(!1),o&&o(t(a)),s&&s()}),[o,a]);return{value:c||!n?a:n(a),onFocus:m,onBlur:u}},ol=(e,t,n)=>Math.max(t,Math.min(e,n));function cl(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function dl({list:e=[],min:t,max:n,step:l,value:a=e[0]||t,disabled:i,onChange:r}){const s=e.length?e.indexOf(a):a,d={backgroundSize:`${(100*(s>t?s-t:0)/(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||i?"bg-gray":"bg-primary-main")},String(t))))}):null,o("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:o("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:d,type:"range",min:t,max:n,step:l,value:s,disabled:i,onChange:t=>{const n=cl(t.target?.value),l=e.length?e[n]:n;r&&r(l||0)}})})]})}const ml=1,ul=100,hl=d((e=>{const{className:t,title:n,items:l=[],list:a=[],min:r=(a.length?0:ml),max:s=(a.length?a.length-1:ul),step:d=1,value:m=a[0]||r,disabled:h=!1,onChange:p}=e,g=sl(e,{normalize:(e=0)=>a.length?pl(a)(e):ol(e,r,s),format:Ue()}),f=i((e=>{p&&p(cl(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(Me,{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",Wt,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),dl({list:a,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),gl(l)]})})),pl=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),gl=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Me,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),fl=["От 1 000 ₽","До 1 000 000 000 ₽"],xl=d((({field:e})=>o(hl,{title:"Сумма, ₽",items:fl,min:1e3,max:1e9,...e("amount")}))),bl=e=>{const{data:t,error:n}=$n(`/api/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,yl);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},yl=async e=>await rt(e,{method:"POST"})||[],vl=ht((({field:e,source:t,label:n,fieldName:l,input:a})=>{const i=t&&t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(hn,{placeholder:"Выберите из списка",label:n,options:i,..._n(e(l),Rn[l],a?.required)})})),Nl=d((({field:e,input:t})=>{const{data:n}=bl("EMPLOYEES_NUMBER");return o(vl,{field:e,source:n,label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),wl=d((({field:e,input:t})=>o(ln,{label:"Годовая выручка, ₽",..._n(e("annualRevenue"),Rn.annualRevenue,t?.required)}))),Cl=d((({field:e})=>o(il,{text:"Наличие военного билета",..._n(e("armyIdFlg"),Rn.armyIdFlg)}))),kl=d((({field:e,input:t})=>o(ln,{label:"Код представителя Банка",placeholder:"Введите код",type:"number",..._n(e("bankEmployeeCode"),Rn.bankEmployeeCode,t?.required),...t}))),Sl=d((({field:e})=>o(ln,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e("bankEmpolee")}))),Il=d((({field:e})=>o(il,{text:"В отношении меня ведётся производство по делу о банкротстве",..._n(e("bankruptcyFlg"),Rn.bankruptcyFlg)}))),Tl=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:l,currentYear:a,min:i,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,l,d),n=Bl(t,e),c=Rl(t,i,r);u.push(o("td",{children:o("div",{className:Pl(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},Bl=(e,t)=>t&&e.toDateString()===t.toDateString(),Rl=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),Pl=(e=!1,t=!1)=>u("p-s text-center rounded-md border",{"border-transparent hover:bg-gray":!e},t?"text-gray hover:bg-transparent":"cursor-pointer"),Dl=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Ml=d((({today:e,currentMonth:t,currentYear:n,min:l,max:a,onDateSelect:s=Ut,setValue:d=Ut})=>{const m=i((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:Dl.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Tl({firstDayOfWeek:u,today:e,totalDays:h,currentYear:n,currentMonth:t,min:l,max:a,onDateClick:m})})]})})),_l=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function zl(e,t){const n=e.replace(/\D/g,"");if(""===n||e?.length===t.length)return e;const l=[...t],a=l.findIndex(Vl),i=l.map(((e,t)=>El(e)?l.slice(0,t).filter(El).length:-1)),r=l.map(((e,t)=>Al(e)?e:n.charAt(i[t])||e)),s=i.indexOf(n.length-1)+1;return r.slice(0,Math.max(a,s)).join("")}const Vl=e=>"_"===e,Al=e=>/\d/.test(e),El=e=>Vl(e)||Al(e),Fl=1940,Ol={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Ll=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:i,disabled:r,onChange:d,onClick:m})=>{const h=s(null),[p,g]=l(i||"");return a((()=>{g(i||"")}),[i]),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(zl(t,"__.__.____"))},onBlur:()=>{if($l(p)){const[n,l,a]=p.split(".");d?.(new Date(Number(a),Number(l)-1,Number(n))),e(Number(l)-1),t(Number(a))}else g(i||"")},disabled:r}),r?null:o(W,{className:"mr-s",...Ol})]})})),$l=e=>{const[t,n,l]=e.split(".");if((e=>Number(e)>=Fl&&Number(e)<=(new Date).getFullYear())(l)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(l),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},jl=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:l,setSelectedMonth:a,setSelectedYear:i,disabled:r=!1})=>o(Ll,{onChange:l,disabled:r,onClick:e,value:t&&xt(t),setSelectedMonth:a,setSelectedYear:i,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")}),ql=_l.map((e=>({key:e}))),Ul=Array.from({length:(new Date).getFullYear()-Fl+1},((e,t)=>Fl+t)).reverse().map((e=>({key:String(e)}))),Wl=(e,t)=>{const n=new Date(e,t,1);let l=0;for(;n.getMonth()===t;)l++,n.setDate(n.getDate()+1);return l},Hl=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:l,onChange:a})=>{l&&a?.(new Date(t,n,Math.min(e,l.getDate())))},Yl={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Kl={className:"min-w-32",iconVersion:"black",isBorder:!1},Xl=d((({className:e="",label:t="",value:n,valid:r=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g}]=Lt(!1),[f,x]=l(n?.getMonth()||(new Date).getMonth()),[b,y]=l(n?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:v,handleNextMonth:N,handleSelectMonth:w,handleSelectYear:C,monthsOptions:k,yearsOptions:S,handleChangeVisibleCalendar:I,ref:T}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:l,onYearSelect:a,selectedYear:r,onChange:s,value:o})=>{const c=jt(i((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:i((()=>e(!t)),[t]),handleNextMonth:i((()=>{n+1<=11?l(n+1):(l(0),a(r+1))}),[n]),handlePrevMonth:i((()=>{n-1>=0?l(n-1):(l(11),a(r-1))}),[n]),handleSelectMonth:i((({key:e})=>{l(_l.indexOf(e));const t=Wl(r,_l.indexOf(e));Hl({maxDateOfMonth:t,selectedYear:r,selectedMonth:_l.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:i((({key:e})=>{a(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:ql,yearsOptions:Ul,ref:c}})({onYearSelect:y,onMonthSelect:x,onShowCalendar:g,selectedYear:b,selectedMonth:f,showCalendar:p,onChange:h,value:n}),B=((e,t)=>{const[n,i]=l(!1);return a((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();i(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:[Ht(t),c("div",{className:"relative",children:[jl({handleChangeVisibleCalendar:I,value:n,valid:r,onChange:h,disabled:m,setSelectedMonth:x,setSelectedYear:y}),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,{...Yl,className:"-rotate-90 cursor-pointer"})}),o(cn,{onChange:w,value:{key:_l[f]},options:k,...Kl}),o(cn,{onChange:C,value:{key:String(b)},options:S,...Kl}),o("div",{className:"my-auto",onClick:N,children:o(W,{...Yl,className:"rotate-90 cursor-pointer"})})]}),o(Ml,{today:n,currentMonth:f,currentYear:b,onDateSelect:h,min:s,max:d,setValue:g})]}):null]})]})})),Gl=d((({className:e,label:t,error:n,errors:l,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Xl,{label:qt({label:t,errors:l}),valid:Boolean(!n),...a}),Gt(n)]}))),Jl=d((({field:e,input:t})=>o(Gl,{label:"Дата начала работы на текущем месте",..._n(e("beginDate"),Rn.beginDate,Kn(e,t?.required)),...t}))),Zl=d((({field:e,input:t,isRetailForm:n=!1})=>{const{value:l}=e("birthday");return o(Gl,{label:"Дата рождения",..._n(e("birthday"),Rn.birthday,t?.required),error:n&&l&&!Ql(l)?"Допустимый возраст заёмщика - от 23 до 75 лет":""})})),Ql=e=>{const t=new Date,n=new Date(t.getFullYear()-23,t.getMonth(),t.getDate()),l=new Date(t.getFullYear()-75,t.getMonth(),t.getDate());return!(!e||e>n||e<l)},ea=d((({field:e,input:t})=>o(ln,{label:"Место рождения",..._n(e("birthPlace"),Rn.birthPlace,t?.required),...t}))),ta=d((({field:e,input:t})=>{const{data:n}=bl("CARD_TYPE");return o(vl,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t})})),na=d((({field:e,input:t})=>o(ln,{label:"Количество детей до 18 лет",placeholder:"Введите значение",type:"number",..._n(e("children"),Rn.children,t?.required),...t}))),la=d((({field:e,input:t})=>o(ln,{label:"Кодовое слово",..._n(e("codeWord"),Rn.codeWord,t?.required),...t}))),aa=d((({field:e,input:t})=>o(ln,{label:"Количество объектов инкассации",type:"number",..._n(e("collectionCount"),Rn.collectionCount,t?.required)}))),ia=d((({field:e,input:t})=>o(ln,{className:"col-span-2",..._n(e("comment"),Rn.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),ra=d((({field:e,input:t})=>{const{data:n}=bl("INCOME_CERT_UNITED");return o(vl,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),sa=d((({field:e,input:t})=>{const{data:n}=bl("MILITARY_STATUS");return o(vl,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),oa={processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3},consentToReceiveMaterials:{text:"Согласен на получение информационных и аналитических материалов по электронной почте"}};async function ca(e,t,n){const l=await fetch(`/api/v1${e}`,{method:t,headers:{"Content-Type":"application/json",...ma()},credentials:"include",body:n?JSON.stringify(n):null});return da(l)?l.json():l}const da=e=>"application/json"===e.headers.get("Content-Type"),ma=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},ua=async(e,t=!1)=>{const n=await(async(e,t=!1)=>{const n=await ca(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return await n.blob()})(e,t);return URL.createObjectURL(n)},ha=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"})}))),pa=d((({className:e,head:t,children:n,onClose:l,onClick:a})=>{const{close:r}=de(),s=i((()=>{r(),l&&l()}),[l]);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(ha,{className:"absolute top-0 right-0",onClose:s}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})})),ga=async(e,t,n=!1)=>{const l=await ua(t,n);e(o(pa,{className:"my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0",children:n?o("img",{src:l}):o("iframe",{src:`${l}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"})}))},fa=d((({className:e,error:t,docId:n,...l})=>{const{open:a}=de(),i=Ce();return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(el,{...l}),n?o(ye,{className:"text-primary-main",onClick:()=>ga(a,n,i),children:o(Me,{children:"Ознакомиться"})}):null]}),Gt(t)]})})),xa=d((({field:e,input:t})=>t&&t.name?o(fa,{text:oa[t.name]?.text,docId:oa[t.name]?.docId,..._n(e(t.name),Rn[t.name],t?.required)}):null)),ba=d((({field:e,input:t})=>{const{data:n}=bl("CREDIT_IN_RSHB");return o(vl,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком / \n вкладчиком с долей участия более 20% уставного капитала руководителем, \n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t})})),ya={horizontal:"@lg:flex-row",vertical:""},va=d((({label:e,items:t,value:n,className:l,onChange:a,disabled:i=!1,orientation:r="horizontal"})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(Me,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",ya[r],l),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(el,{isRadio:!0,text:t,value:n===e,onChange:()=>a&&a(e),disabled:i},String(e))))})]}))),Na=[{id:"rub",text:"Рубль"}],wa=d((({field:e})=>{const{value:t}=e("currency");return c("div",{className:"",children:[o(Me,{font:"font-light",children:"Валюта дебетовой карты"}),o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(va,{className:"whitespace-normal",orientation:"horizontal",items:Na,value:t??"rub"})})]})})),Ca=d((({field:e,input:t})=>o(ln,{label:"Количество иждивенцев",placeholder:"За исключение детей до 18 лет",type:"number",inputLength:2,..._n(e("dependents"),Rn.dependents,t?.required),...t}))),ka=d((({field:e,input:t})=>o(Gl,{label:"Желаемая дата встречи",..._n(e("desiredMeetingDate"),Rn.meetingDay,t?.required)}))),Sa=d((({field:e})=>o(il,{text:"Являюсь инвалидом",..._n(e("disablePeopleFlg"),Rn.disablePeopleFlg)}))),Ia=d((({field:e,input:t})=>o(Gl,{label:"Дата выдачи",..._n(e("dulIssueDateField"),Rn.dulIssueDateField,t?.required),disabled:Xn()&&t?.filledByEsia}))),Ta=d((({field:e,input:t})=>{const{value:n,onChange:l}=e("dulSubdivisionCode"),a=i((e=>{l?.(e?.data?.code?.replace("-",""))}),[]);return o(ln,{disabled:Xn()&&t?.filledByEsia,label:"Кем выдан",...t,..._n(e("dulIssuedBy"),Rn.dulIssuedBy,t?.required),onDaDataChange:a,daDataQueryPrefix:n})})),Ba=d((({field:e,input:t})=>o(ln,{disabled:Xn()&&t?.filledByEsia,label:"Номер документа",type:"number",inputLength:6,..._n(e("dulNumber"),Rn.dulNumber,t?.required)}))),Ra=d((({field:e,input:t})=>o(ln,{disabled:Xn()&&t?.filledByEsia,label:"Серия документа",type:"number",inputLength:4,..._n(e("dulSerie"),Rn.dulSerie,t?.required)}))),Pa=d((({field:e,input:t})=>{const n=i((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(ln,{disabled:Xn()&&t?.filledByEsia,label:"Код подразделения",type:"number",inputLength:6,...t,..._n(e("dulSubdivisionCode"),Rn.dulSubdivisionCode,t?.required),onDaDataChange:n})})),Da=d((({field:e,input:t})=>{const{data:n}=bl("EDUCATION_LEVEL");return o(vl,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),Ma=d((({field:e,input:t})=>{const{required:n,...l}=t;return o(ln,{label:"Электронная почта",..._n(e("email"),Rn.email,n),...l})})),_a=d((({field:e,input:t})=>{const{data:n}=bl("ORGANIZATION_ACTIVITY_TYPE");return o(vl,{field:e,source:n,label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),za=d((({field:e,input:t})=>{const{data:n}=bl("ORGANIZATION_KIND");return o(vl,{field:e,source:n,label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),Va=d((({field:e,input:t})=>{const{data:n}=bl("EMPLOYMENT_INFO_UNITED");return o(vl,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),Aa=d((({field:e,input:t})=>o(ln,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",type:"number",..._n(e("expenses"),Rn.expenses,t?.required),...t}))),Ea=d((({field:e,input:t})=>o(ln,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",inputLength:2,..._n(e("experience5Years"),Rn.experience5Years,Kn(e,t?.required)),...t}))),Fa=d((({field:e})=>{const{value:t,onChange:n}=e("familyMembers"),l="В браке"===e("familyStatus")?.value?.key?2:1,i=Number(e("children")?.value),r=Number(e("dependents")?.value),s=l+i+r;return a((()=>{e?.("familyMembers")?.onChange?.(s)}),[e("familyStatus")?.value?.key,i,r]),o(ln,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:t,onChange:e=>n?.(e)})})),Oa=d((({field:e,input:t})=>{const{data:n}=bl("MARITAL_STATUS");return o(vl,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),La=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],$a=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],ja=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],qa=d((({field:e,input:t})=>o(hn,{label:"Способ получения ответа",options:ja,..._n(e("feedbackMethod"),Rn.feedbackMethod,t?.required)}))),Ua=d((({field:e,input:t})=>o(ln,{label:"ФИО",..._n(e("fullName"),Rn.fullName,t?.required),...t}))),Wa=d((({field:e,input:t})=>o(ln,{label:"Общий стаж",type:"number",inputLength:2,placeholder:"Количество лет",..._n(e("generalSeniority"),Rn.generalSeniority,Kn(e,t?.required)),...t}))),Ha=d((({field:e,input:t})=>{const{data:n}=bl("HOUSE_TYPE");return o(vl,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Ya=d((({field:e,input:t})=>{const n=i((t=>{e?.("organizationName")?.onChange?.(t.data?.name?.short_with_opf),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(ln,{label:"ИНН",type:"number",inputLength:12,...t,..._n(e("inn"),Rn.inn,Kn(e,t?.required)),onDaDataChange:n})})),Ka=d((({field:e})=>o(il,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),Xa=d((({field:e,input:t})=>o(ln,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",type:"number",inputLength:2,..._n(e("jobsNumber"),Rn.jobsNumber,Kn(e,t?.required)),...t}))),Ga=d((({field:e,input:t})=>o(ln,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",inputLength:2,..._n(e("lastJobExperience"),Rn.lastJobExperience,Kn(e,t?.required)),...t}))),Ja=d((({field:e,input:t})=>o(ln,{label:"Наименование юридического лица",...t,..._n(e("legalEntityName"),Rn.legalEntityName,t?.required)}))),Za=d((({field:e,input:t})=>o(ln,{label:"ОПФ",placeholder:"ООО, ПАО и др.",..._n(e("legalForm"),Rn.legalForm,Kn(e,t?.required)),...t}))),Qa=[];async function ei(){const e=await rt("/api/v1/outservice/outserviceregions");return e&&Array.isArray(e)?e:Qa}const ti=d((({field:e,input:t})=>{const n=e("region")?.value?.key,{data:l}=$n("outServiceRegions",ei),i=l?.find((e=>e.code===n))?.localities?.map((e=>({key:e,text:e})));return a((()=>{""!==n&&e?.("localities")?.onChange?.("")}),[n]),o(hn,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:i,..._n(e("localities"),Rn.localities,t?.required),isSearch:!0})})),ni=d((({field:e,input:t})=>o(ln,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",..._n(e("mandatoryIncome"),Rn.mandatoryIncome,t?.required),...t}))),li=d((({field:e,input:t})=>o(ln,{label:"Отчество (Обязательно, при наличии)",inputLength:60,disabled:Xn()&&t?.filledByEsia,..._n(e("middleName"),Rn.middleName),...t}))),ai=d((({field:e,input:t})=>o(ln,{label:"Имя",inputLength:60,disabled:Xn()&&t?.filledByEsia,..._n(e("name"),Rn.name,t?.required),...t}))),ii=d((({value:e=!1,text:t,type:n="checkbox",onChange:l})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>l&&l(!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(Me,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),ri=d((({field:e})=>An(e("acquiringType")?.value?.key)?o(ii,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),si=d((({field:e,input:t})=>{const{data:n}=bl("ORGANIZATION_TYPE");return o(vl,{field:e,source:n,label:"Тип организации",fieldName:"organization",input:t})})),oi=d((({field:e,input:t})=>{const n=i((t=>{e?.("inn")?.onChange?.(t.data?.inn),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(ln,{label:"Наименование организации",...t,..._n(e("organizationName"),Rn.organizationName,Kn(e,t?.required)),onDaDataChange:n})})),ci=d((({field:e,input:t})=>o(ln,{label:"Иные доходы",placeholder:"Введите значение",type:"number",..._n(e("otherIncome"),Rn.otherIncome,t?.required),...t}))),di=d((({field:e,input:t})=>o(ln,{label:"Обязательные выплаты",placeholder:"Введите значение",type:"number",..._n(e("otherPayments"),Rn.otherPayments,t?.required),...t}))),mi=d((({field:e,input:t})=>o(Gl,{label:"Дата регистрации по месту жительства",..._n(e("participantDateRegistration"),Rn.participantDateRegistration,t?.required)}))),ui=d((({field:e,input:t})=>{const n="BUSINESS_OWNER"===e("positionOrganization")?.value?.key,l={..._n(e("partInBusiness"),Rn.partInBusiness,Kn(e,n&&t?.required))};return o(ln,{label:"Доля участия в бизнесе",placeholder:"в %",type:"number",inputLength:3,...l,...t,onChange:e=>l?.onChange&&l?.onChange(String(Number(e)>100?100:Number(e)||"")),value:n?l?.value:"",disabled:!n})})),hi=d((({field:e,input:t})=>{const{required:n,...l}=t;return o(ln,{..._n(e("partnerComments"),Rn.partnerComments,n),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...l})})),pi=[{id:"mir",text:"Карта МИР"},{id:"union_pay",text:"UnionPay"},{id:"payment_system_j",text:"Платежная система (Дж)"},{id:"payment_system_b",text:"Платежная система (B)* "},{id:"free_card",text:"Бесплатная карта"}],gi=d((({field:e})=>{const{value:t,onChange:n}=e("paymentSystem");return c("div",{className:"",children:[o(Me,{font:"font-light",children:"Платежная система"}),o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(va,{className:"whitespace-normal",orientation:"horizontal",items:pi,value:t??"mir",onChange:e=>n&&n(e)})})]})})),fi=e=>"_"===e,xi=e=>/\d/.test(e),bi=e=>fi(e)||xi(e),yi=[..."+7 (___) ___-__-__"],vi=yi.findIndex(fi),Ni=yi.map(((e,t)=>bi(e)?yi.slice(0,t).filter(bi).length:-1));function wi(e){const t=e.replace(/\D/g,""),n=yi.map(((e,n)=>xi(e)?e:t.charAt(Ni[n])||e)),l=Ni.indexOf(t.length-1)+1;return(l?n.slice(0,Math.max(vi,l)):n).join("")}const Ci=d((({children:e,onChange:t,...n})=>{const l=i((e=>t&&t(wi(e))),[t]),a=i((e=>{"+7 ("===e&&t&&t("")}),[]);return o(Yt,{...n,onChange:l,onFocus:e=>l(e?.target?.value||""),onBlur:e=>a(e?.target?.value||""),children:e})})),ki=d((({className:e,label:t,error:n,...l})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Ci,{"aria-label":t,label:qt({label:t,errors:l?.errors}),valid:Boolean(!n),placeholder:"+7 (___) ___-__-__",...l}),Gt(n)]}))),Si=d((({field:e,input:t})=>o(ki,{label:"Телефон",..._n(e(t?.name||"phone"),Rn.phone,"organizationPhone"===t?.name?Kn(e,t?.required):t?.required),...t}))),Ii=d((({field:e,input:t})=>{const{data:n}=bl("POSITION");return o(vl,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),Ti=d((({field:e})=>An(e("acquiringType")?.value?.key)?o(ii,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),Bi=ht((({field:e,source:t})=>o(hn,{placeholder:"Выберите продукт",label:"Продукт",options:Ri(t?.productList),...Mn(e("product"),Rn.product)}))),Ri=e=>(e??[]).map((e=>({key:e,value:e})));function Pi(e="/api/v1/regions"){const{data:t}=$n(e,st);return Array.isArray(t)?t:[]}const Di=d((({field:e,input:t,url:n})=>{const l=Pi(n);return o(hn,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>l?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[l]),..._n(e("region"),Rn.region,t?.required)})})),Mi=d((({field:e,input:t})=>{const n=Wn(!0),l=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(hn,{label:"Регион",placeholder:"Выберите регион",options:l,..._n(e("region"),Rn.region,t?.required)})})),_i=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:n=!1,renderFoldableSection:a,renderFoldButton:r})=>{const[s,o]=l(n),d=i((()=>{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 zi=d((({className:e="",isUnfolded:t,children:n})=>{const l=s(null),i=function(e,t){const n=s(null);return a((()=>{const t=n?.current;if(!t)return;const l=new ResizeObserver((n=>{e(t,n[0])}));return l.observe(t),()=>{l.disconnect()}}),[e,...t]),n}((e=>{l.current&&(l.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:l,className:`transition-max-h duration-300 overflow-hidden ${l.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:i,children:n})})})),Vi=d((({value:e,subText:t,children:n,isPhone:l,...a})=>{const i=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[i.length,n,t].every((e=>!e))?null:Ai({textItems:i,subText:t,children:n,isPhone:l,...a})})),Ai=({label:e,labelSize:t="text-m",textItems:n,subColor:l,subText:a,className:i,children:r,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",i),children:[e?o(Me,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||Ei(n,s),a?o(Me,{color:l,size:"text-m",children:a}):null]}),Ei=(e,t)=>e.filter(Boolean).map(((e,n)=>o(Me,{size:"text-l",children:t?o("a",{href:`tel:${Fi(e)}`,children:e.trim()}):e.trim()},String(n)))),Fi=e=>e.replace(/\D/g,""),Oi=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}))),Li=e=>{const t=ji(e);return o(Vi,{label:"Режим работы",value:t,className:"max-w-none"})},$i=({workTime:e="",lunchHour:t="",daysOff:n=""},l=!1)=>e?[`${l?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",ji=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))),l=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[$i({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":l}),$i({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:l},!0)].filter(Boolean)},qi=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],Ui=e=>qi.map((([t,n,l])=>({key:t,title:l,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??"")}}))),Wi=e=>{if(!e)return null;const t=Hi(e);return c(Oi,{className:"border-none",children:[o(Vi,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(Yi)})}),o(Vi,{label:"Режим работы",className:"max-w-none",children:o(Me,{children:e})})]})},Hi=e=>{const t=qi.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],l=n[n.length-1]?.toLowerCase();return l?.includes("выходной")?t.map((e=>({...e,status:!l?.includes(e.short.toLowerCase())}))):t},Yi=({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(Me,{size:"text-xs",children:e})},String(n)),Ki=({currency:e,buyExchangeRate:t,saleExchangeRate:n},l)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(Vi,{label:"Валюта",value:e.currency}):null,t?o(Vi,{label:"Купить",value:String(t)}):null,n?o(Vi,{label:"Продать",value:String(n)}):null]},String(l)),Xi={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"}},Gi=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",Xi[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(Me,{size:"text-m",color:Xi[n].text,children:t})]}))),Ji=(new Date).getDay(),Zi=e=>{const[t]=e?.slice(Ji-1)??[];if(!t)return null;const{lunchHour:n,status:l,workTime:a,hasLunch:i}=t;return l?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[a?o(Gi,{color:"green",children:a}):null,n&&i?o(Gi,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(Gi,{color:"red",children:"Выходной"})},Qi=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",er=({title:e,status:t,workTime:n,lunchHour:l,hasLunch:a},i)=>o(Vi,{label:e,value:t&&n?n:"",subText:Qi({lunchHour:l,hasLunch:a,status:t}),subColor:!t||a?"text-error":"text-green-dark"},String(i)),tr=["ArrowDownIcon","ArrowUpIcon"],nr=["Подробнее","Скрыть"],lr=({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:nr[Number(e)]}),o(W,{className:"text-primary-text",name:tr[Number(e)],width:"16",height:"16"})]}),ar=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,ir=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,rr=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,sr=({name:e,address:t,phone:n,fax:l,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},u)=>{if(!d)return null;const h=Ui(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(Me,{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(Me,{size:"text-l",children:t})]}):null]}),Zi(h)]}),o("div",{className:"hidden sm:block",children:or({phone:n,fax:l,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(_i,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(zi,{isUnfolded:e,children:or({phone:n,fax:l,phoneBusiness:a,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>lr({isUnfolded:e,onToggle:t})})]},String(u))},or=({phone:e,fax:t,phoneBusiness:n,phoneNatural:l,phoneCallCentre:a,phoneCurrencyControl:i,workSchedule:r,exchangeRate:s})=>{const d=Ui(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(Oi,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(Vi,{label:"Факс",value:t,isPhone:!0}),o(Vi,{label:"Телефон филиала",value:e,isPhone:!0}),o(Vi,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(Vi,{label:"Обслуживание физических лиц",value:l,isPhone:!0}),o(Vi,{label:"Для консультаций по валютному контролю",value:i,isPhone:!0}),o(Vi,{label:"Контакт-центр",value:a,isPhone:!0})]}),r?.isMatchesPattern?o(Oi,{children:o(Vi,{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(er)})})}):c(Oi,{children:[o(Vi,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(Yi)})}),Li(d)]}),r?.businessScheduleVisibleTag?Wi(r?.businessScheduleDescription):null,s?.currencies?.length?o(Oi,{className:"flex-wrap",children:s?.currencies?.map(Ki)}):null]})},cr=({name:e="",address:t="",workSchedule:n})=>{const l=(a=e)?`${a?.charAt(0)?.toUpperCase()}${a?.slice(1)}`:"";var a;const i=`${t} ${(e=>{const t=Ui(e),n=e?ji(t):"",l=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?ar(n):rr(n,l):ir(n):null})(n)}`;return{header:l,body:i}},dr=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),mr=d((({children:e})=>dr?e:null)),ur=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"})}))),hr="/icons/MapMarkerClusterIcon.svg",pr="/icons/MapMarkerClusterYellowIcon.svg";function gr({yandexMaps:e,map:t,points:n,isLoad:l}){if(l||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const a=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),i=fr("offices",e,a);if(n.length&&n.every((e=>"type"in e))){const l=fr("workplaces",e,a),r=xr(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=xr(n.filter((e=>"offices"===e.type)),"offices",e);i.add(s),l.add(r),t.geoObjects.add(l),t.geoObjects.add(i)}else{const l=xr(n,"offices",e);i.add(l),t.geoObjects.add(i)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const fr=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?hr:pr,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),xr=(e,t,n)=>e.map((({coords:e,content:l})=>new n.Placemark(e,{balloonContentHeader:l?.header,balloonContentBody:l?.body,balloonContentFooter:l?.footer,hintContent:l?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?hr:pr,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),br={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},yr={...br,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},vr=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(yr).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"})}),Nr=e=>globalThis[e],wr=(e,t)=>{const n=document.getElementById(t);if(n){const t=Nr(e);return t?Promise.resolve(t):new Promise((t=>{n.addEventListener("load",(()=>{t(Nr(e))}))}))}return new Promise(((n,l)=>{const a=document.createElement("script");a.src=t,a.async=!0,a.id=t,a.addEventListener("load",(()=>{n(Nr(e))})),a.addEventListener("error",(e=>{l(e)})),document.head.appendChild(a)}))};const Cr=()=>function(e,t,n=!0){const[i,r]=l(void 0);return a((()=>{let l=!0;return wr(e,t).then((e=>{l&&r(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(l=!1,n){const e=document.getElementById(t);e&&document.head.removeChild(e),r(void 0)}}}),[e,t,n]),i}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${_.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1),kr={...br,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},Sr=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),l="in"===t?n+1:n-1;e.current.setZoom(l,{checkZoomRange:!0})},className:`${Object.values(kr).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(W,{name:n,width:"20",height:"16"})})})),Ir=[55.753995,37.614069],Tr=d((({points:e,className:t="",zoom:n=5,isLoad:l,selectedAddress:i})=>{const r=s(null),d=Cr();if(a((()=>{r.current?gr({yandexMaps:d,map:r.current,points:e,isLoad:l}):d?.ready((()=>{r.current||(r.current=new d.Map("map",{center:Br(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),gr({yandexMaps:d,map:r.current,points:e,isLoad:l})}))}),[d,e,n,l,i]),a((()=>{r.current&&i&&d?.geocode(i).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();r.current.setCenter(t),r.current.setZoom(18)}))}),[i]),!d)return null;const m="z-10";return c("div",{id:"map",className:u("relative","w-full",t),children:[l?o(ur,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",m),children:[o(Sr,{yandexMaps:r}),o(Sr,{yandexMaps:r,direction:"out"})]}),vr(r,d,u("right-2 top-80",m))]})})),Br=e=>{const t=[Pr(Rr(e,0)),Pr(Rr(e,1))];return t.every((e=>e))?t:Ir},Rr=(e,t)=>e.map((e=>e.coords?.[t])),Pr=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Dr={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},Mr={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},_r={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 zr({disabled:e,onClick:t}){return n=>{!e&&t&&t(n)}}const Vr={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"},Ar={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")},Er=d((({children:e,...t})=>{const n=e=>({...e,onClick:me(zr(e))}),{className:l,version:a="primary",active:i,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":i,"bg-main-gray text-main-disabled cursor-not-allowed":r,"rounded-md":c},i||r?"":u(Vr[a],Ar[a]),l),type:s,role:d,onClick:m,children:e})})),Fr=(e,t)=>e&&"underlined"!==t?"primary":"secondary",Or=(e,t,n)=>{const l=Fr("all"===t),a=Fr("business"===t),i=(e,t,l)=>{const a=e.currentTarget===e.target&&"business"===t?r(l):l;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(Er,{"data-id":"all",onClick:t=>i(t,"all",e),version:l,children:"Для физических лиц"}),o(Er,{"data-id":"business",onClick:t=>i(t,"business",e),version:a,children:"Для юридических лиц"})]})},Lr=({__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(Pe,{__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(Me,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,$r="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",jr=({filters:e,field:{field:t,reset:n},onlyOffice:l,labels:a})=>{const i=l?5:6,r=(e||[]).map((e=>o(el,{text:a[e],...t(e)},e))),[s,d]=i>0?[r.slice(0,i),r.slice(i)]:[r,[]];return o("div",{children:e?.length?o("div",{children:o(_i,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:$r,children:s}),o(zi,{className:$r,isUnfolded:e,children:d})]}),renderFoldButton:qr(n,l)})}):null})},qr=(e,t=!1)=>({isUnfolded:n,onToggle:l})=>c("div",{className:"flex space-x-lg",children:[t?o(ye,{version:"transparent",className:"text-secondary-text [&>*]:p-0",appendRight:o(W,{name:["ArrowDownIcon","ArrowUpIcon"][Number(n)],width:"16",height:"16"}),text:["Больше фильтров","Меньше фильтров"][Number(n)],onClick:l}):null,o(ye,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:e,children:Ur()})]}),Ur=()=>c("div",{className:"flex items-center",children:["Очистить фильтр",o(W,{name:"CloseIcon",width:"16",height:"16",className:"ml-2xs"})]}),Wr=(e,t)=>o("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:c(N,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(Me,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),Hr=()=>{},Yr=e=>"all"===e?"block":"hidden",Kr=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:a=[],renderCard:i=Hr,renderRemoteWorkplaceCard:r=Hr,getBalloon:s=Hr,getBalloonRemoteWorkplaces:d=Hr,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=At(Dr),{filteredItems:b,points:y,filteredRemoteWorkplaces:v,lengthItems:N}=Zr({data:t,remoteWorkplaces:a,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=l("all"),k={filters:Gr([...t,...a]),field:{field:f,reset:x},onlyOffice:p,labels:Mr};return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[Wr(h,N),m?Lr(m):null,p&&Or(t,w,C),o("div",{className:u("pb-3xl",Yr(w)),children:jr(k)})]}),o("div",{className:"h-[600px]",children:o(mr,{children:o(Tr,{points:y,isLoad:n,className:"h-full"})})})]}),c(mr,{children:[b.map(i),v.map(r)]})]})})),Xr=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>_r[t](e)))))},Gr=e=>Object.keys(Dr).filter((t=>e.filter((e=>_r[t](e))).length)),Jr=()=>{},Zr=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:l=Jr,getBalloonRemoteWorkplaces:a=Jr})=>{const[i,s,o,c]=r((()=>{const i=Xr(e,n),r=Xr(t,n),s=[...i.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:l(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[i,s,r,i.length+r?.length]}),[e,t,n,l,a]);return{filteredItems:i,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},Qr=d((({field:e,input:t})=>{const n=e("regionRetail"),l=e("addressRetail"),i=Wn(),r=n?.value?.key,s=i.find((({region:e})=>e===r)),d=!i,m=n?.value?.text,u=Wn()?.find((e=>e?.region===m))?.branches;a((()=>{""!==n?.value?.key&&e?.("addressRetail")?.onChange?.("")}),[n?.value]);const{points:h}=Zr({data:s?.branches||[],filtrationState:{},getBalloon:cr}),p=Boolean(n?.value?.key);return c("div",{children:[o(hn,{label:"Адрес отделения",placeholder:"Выберите отделение",options:(u||[]).map((({address:e=""})=>({key:e,text:e}))),..._n(e("addressRetail"),Rn.addressRetail,t?.required&&p),isSearch:!0}),o("div",{className:"h-[600px]",children:o(mr,{children:o(Tr,{points:h,isLoad:d,className:"h-full",selectedAddress:l?.value?.text})})})]})})),es=d((({field:e,input:t})=>{const n=Wn();return o(hn,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:r((()=>n?.map((({region:e=""})=>({key:e,text:e})))),[n]),..._n(e("regionRetail"),Rn.regionRetail,t?.required)})})),ts=d((({field:e,input:t})=>o(ln,{label:"Пенсионные доходы",placeholder:"Введите значение",type:"number",..._n(e("retirementIncome"),Rn.retirementIncome,t?.required),...t}))),ns=d((({field:e})=>{const t=e("secondaryPhone");return o(ki,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?Mn(t,Rn.secondaryPhone):t})})),ls=d((({field:e,input:t})=>o(hn,{label:"Направление обслуживания",placeholder:"Выберите направление",options:$a,..._n(e("serviceDirection"),Rn.serviceDirection,t?.required)}))),as=d((({className:e,label:t,onChange:n,error:l,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(va,{label:qt({label:t,errors:a?.errors}),onChange:e=>n&&n(e),...a}),Gt(l)]}))),is=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],rs=d((({field:e,input:t})=>o(as,{label:"Пол",orientation:"horizontal",items:is,..._n(e("sex"),Rn.sex,t?.required)}))),ss=d((({field:e})=>o(il,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",..._n(e("shareholderFlg"),Rn.shareholderFlg)}))),os=d((({children:e,onChange:t,...n})=>{const l=i((e=>t&&t(zl(e,"___-___-___ __"))),[t]),a=i((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(Yt,{...n,onChange:l,onFocus:e=>l(e?.target?.value||""),onBlur:e=>a(e?.target?.value||""),children:e})})),cs=d((({className:e,label:t,value:n,error:l,onChange:a,onBlur:i,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(os,{"aria-label":t,label:qt({label:t,errors:r?.errors}),valid:Boolean(!l),value:n,onChange:a,onBlur:i,placeholder:"___-___-___ __"}),Gt(l)]}))),ds=d((({field:e,input:t})=>{const n=e("consentPfrFlg")?.value;return o(cs,{label:"СНИЛС",..._n(e("snils"),Rn.snils,!!n&&t?.required),...t})})),ms=d((({field:e,input:t})=>o(ln,{label:"Фамилия",inputLength:60,disabled:Xn()&&t?.filledByEsia,..._n(e("surname"),Rn.surname,t?.required),...t}))),us=["От 1 мес","До 15 лет"],hs=d((({field:e})=>o(hl,{title:"Срок, месяцев",items:us,min:1,max:180,...e("term")}))),ps=d((({field:e,input:t})=>o(ln,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",..._n(e("totalIncome"),Rn.totalIncome,t?.required),...t}))),gs=d((({field:e,input:t})=>o(hn,{label:"Тип обслуживания",options:La,..._n(e("serviceType"),Rn.serviceType,t?.required)}))),fs=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],xs=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(va,{className:"whitespace-normal",orientation:"horizontal",items:fs,value:t,onChange:e=>n&&n(e)})})}));const bs={$ref:"/wcms-resources/outservice-productlist.json"},ys=(e,t,n=!1)=>(l,a)=>{const i="ULTRASERVICE"===t||"PREMIUMSERVICE"===t,r={surname:o(ms,{field:e,input:l}),name:o(ai,{field:e,input:l}),middleName:o(li,{field:e,input:l}),phone:o(Si,{field:e,input:l}),organizationPhone:o(Si,{field:e,input:l}),email:o(Ma,{field:e,input:l}),fullName:o(Ua,{field:e,input:l}),inn:o(Ya,{field:e,input:l}),legalForm:o(Za,{field:e,input:l}),organizationName:o(oi,{field:e,input:l}),generalSeniority:o(Wa,{field:e,input:l}),lastJobExperience:o(Ga,{field:e,input:l}),experience5Years:o(Ea,{field:e,input:l}),jobsNumber:o(Xa,{field:e,input:l}),beginDate:o(Jl,{field:e,input:l}),addressFact:o(Yn,{field:e,input:l}),organizationAddress:o(Gn,{field:e,input:l}),comment:o(ia,{field:e,input:l}),addressBranch:o(Hn,{field:e,input:l,isPremium:i}),sex:o(rs,{field:e,input:l}),birthday:o(Zl,{field:e,input:l,isRetailForm:n}),birthPlace:o(ea,{field:e,input:l}),desiredMeetingDate:o(ka,{field:e,input:l}),product:o(Bi,{field:e,source:bs}),localities:o(ti,{field:e,input:l}),isClient:o(Ka,{field:e}),partnerComments:o(hi,{field:e,input:l}),collectionCount:o(aa,{field:e,input:l}),acquiringType:o(Vn,{field:e,input:l}),onlineCheckout:o(ri,{field:e}),posTerminal:o(Ti,{field:e}),serviceType:o(gs,{field:e,input:l}),term:o(hs,{field:e}),amount:o(xl,{field:e}),annualRevenue:o(wl,{field:e,input:l}),vedTypes:o(xs,{field:e}),feedbackMethod:o(qa,{field:e,input:l}),serviceDirection:o(ls,{field:e,input:l}),bankEmpolee:o(Sl,{field:e}),secondaryPhone:o(ns,{field:e}),consentToReceiveMaterials:o(xa,{field:e,input:l}),processPersonalDataFlg:o(xa,{field:e,input:l}),consentProviderFlg:o(xa,{field:e,input:l}),consentOthersFlg:o(xa,{field:e,input:l}),consentInformFlg:o(xa,{field:e,input:l}),consentPfrFlg:o(xa,{field:e,input:l}),applicationDate:o(ln,{label:"Дата и время обращения в Банк",...e("applicationDate")}),region:i?o(Mi,{field:e}):o(Di,{field:e,input:l,url:Ot(t)}),education:o(Da,{field:e,input:l}),housing:o(Ha,{field:e,input:l}),employment:o(Va,{field:e,input:l}),organization:o(si,{field:e,input:l}),amountWorkers:o(Nl,{field:e,input:l}),employerActivities:o(_a,{field:e,input:l}),employerOrganization:o(za,{field:e,input:l}),positionOrganization:o(Ii,{field:e,input:l}),familyStatus:o(Oa,{field:e,input:l}),children:o(na,{field:e,input:l}),familyMembers:o(Fa,{field:e,input:l}),dependents:o(Ca,{field:e,input:l}),totalIncome:o(ps,{field:e,input:l}),expenses:o(Aa,{field:e,input:l}),snils:o(ds,{field:e,input:l}),conscription:o(sa,{field:e,input:l}),armyIdFlg:o(Cl,{field:e,input:l}),dulSerie:o(Ra,{field:e,input:l}),dulNumber:o(Ba,{field:e,input:l}),dulIssueDateField:o(Ia,{field:e,input:l}),dulSubdivisionCode:o(Pa,{field:e,input:l}),dulIssuedBy:o(Ta,{field:e,input:l}),addressRegistration:o(Gn,{field:e,input:l}),participantDateRegistration:o(mi,{field:e,input:l}),retirementIncome:o(ts,{field:e,input:l}),otherIncome:o(ci,{field:e,input:l}),mandatoryIncome:o(ni,{field:e,input:l}),otherPayments:o(di,{field:e,input:l}),disablePeopleFlg:o(Sa,{field:e,input:l}),bankruptcyFlg:o(Il,{field:e,input:l}),shareholderFlg:o(ss,{field:e,input:l}),legalEntityName:o(Ja,{field:e,input:l}),creditInRshbCd:o(ba,{field:e,input:l}),bankEmployeeCode:o(kl,{field:e,input:l}),partInBusiness:o(ui,{field:e,input:l}),regionRetail:o(es,{field:e,input:l}),addressRetail:o(Qr,{field:e,input:l}),addressMatch:o(rl,{field:e,input:l}),paymentSystem:o(gi,{field:e,input:l}),currency:o(wa,{field:e,input:l}),cardCategory:o(ta,{field:e,input:l}),codeWord:o(la,{field:e,input:l}),confirmationIncome:o(ra,{field:e,input:l})};return function({input:e,field:t}){const{condition:n}=e,{value:l}=t(n?.name||"");return!n||n?.values?.find((e=>e===(l?.key??l)))}({input:l,field:e})?o("div",{children:r[l?.name||""]},String(a)):null},vs=e=>2===e?"@xl:grid-cols-2":"",Ns=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Me,{size:"text-h6",children:e})}):null,ws=d((function({responseType:e,typeForm:t}){const n="OK"===e,l=n?"ResponseOKIcon":"ResponseFailIcon",{close:a}=de(),r=i((()=>{a()}),[]),s="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(pa,{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:l,iconVersion:"normal"},width:"136",height:"136"}),o(k,{className:"w-full",title:n?"Ваша заявка отправлена":"Не удалось отправить заявку",description:n?s:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(Er,{type:"button",onClick:r,children:"Хорошо"})]})})})),Cs=e=>{const{open:t,close:n}=de();return{open:(n,l={})=>t(o(ws,{...e,...n}),l),close:n}},ks=e=>t=>t&&Object.entries(e).flatMap((([e,n])=>n(t[e])))||[],Ss=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:l,amount:a,term:i,annualRevenue:r,serviceType:s,vedTypes:o,region:c,...d}=e,m=t||r?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:l=!1,term:a,amount:i,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${An(t?.key)?`/Онлайн касса=${n}/POS-терминал=${l}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${i}/Срок=${a}/Выручка=${r}`})(e):null,u={...d,...Ts(o),...Is(c),...m?{partnerComments:m}:{},...s?{typeForm:s}:{}};return Object.fromEntries(Object.entries(u)?.map((([e,t])=>[e,t?.key||t])))},Is=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},Ts=e=>e?{vedTypes:Object.fromEntries(fs.map((({id:t})=>[t,t===e])))}:{},Bs={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:zn[0],serviceType:La[0],feedbackMethod:ja[0],serviceDirection:$a[0],vedTypes:fs[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1},Rs=d((({text:e,link:t})=>c(w,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(Me,{children:e}):null,t?o(ye,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"!text-left text-primary-main",children:o(Me,{children:t.text})}):null]}))),Ps=(e,t)=>o(Er,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Ds=(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(el,{...e}),o(Rs,{link:t})]}),Gt(Mn(e,Sn).error)]}):o(Rs,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),Ps(n)]}),Ms={send:async function(e,t=!1){const{typeForm:n,region:l,phone:a="",email:i,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,...Nt(l,g),...wt(i,g),...yt(a),...vt(s,"desiredMeetingDate"),...g?vt(r):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...Ct(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}}},_s=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))||[],b=((e,t="")=>{const n=Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||Bs[e.name||""]])));return n?.serviceType&&"PREMIUMSERVICE"===t&&(n.serviceType=La[1]),{...n,typeForm:{key:t,text:""}}})(x,n),[y,v]=l(""),w=Cs({typeForm:n}),C=i((async(e,t)=>{const n=zs(x,e),l=ks(Dn(n));if(!pn(l(e)))return console.warn("validation fail");const a=Ss({...e,...h}),i=await Ms.send(a,"lead"===m)?"OK":"Fail";if(v(i),i&&w.open({responseType:i}),"OK"===i&&g){const e=zt();kt({aspectsAttributes:g,aspects:e,ev:t})}return i}),[]),[,{field:k,onSubmit:S,reset:I}]=At(b,{onSubmit:C}),T=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(x)?.name;return a((()=>{"OK"===y&&(v(""),I())}),[y]),c(Ft,{className:u("container space-y-m",e),title:t,...f,children:[c("form",{onSubmit:S,children:[r.map(((e,t)=>c("div",{className:u(vs(e.columns),"grid gap-x-m"),children:[Ns(e.title),(e?.inputs||[])?.map(ys(k,n))]},`section-${t}`))),Ds(T?k("consentDataProcessing"):void 0,d,s)]}),p?c("div",{className:"space-y-m",children:[o(N,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex sm:justify-center gap-xl",children:[c("a",{className:"flex gap-s items-center text-primary-text no-underline",href:"tel:8 (800) 200-78-70","aria-label":"телефон 8 (800) 200-78-70",children:[o(ne,{image:{icon:"PhoneIcon"},width:"24",height:"24"}),o("span",{children:"8 (800) 200-78-70"})]}),c("a",{className:"flex gap-s items-center text-primary-text no-underline","aria-label":"почта ved@rshb.ru",href:"mailto:ved@rshb.ru",children:[o(ne,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),zs=(e,t)=>e.filter((e=>"secondaryPhone"===e?.name?Boolean(t.secondaryPhone):e)).filter((e=>!e?.condition||e?.condition.values.find((n=>{const l=t?.[e?.condition?.name??""];return n===(l?.key??l)}))));function Vs(e){const[t,n]=l(JSON.parse(globalThis.localStorage?.getItem(e)||"null"));return[t,i((t=>{globalThis.localStorage?.setItem(e,JSON.stringify(t)),n(t)}),[e,globalThis.localStorage])]}const As=d((({inputs:e=[],typeForm:t="",field:n,key:l})=>{const a=e.every((e=>Boolean(n(e.name).value))),i=r((()=>e?.filter((e=>e.required))?.some((e=>Boolean(Mn(n(e?.name),Rn[e?.name]).error)))),[e]);return o("div",{className:"w-fit",children:o(_i,{isFoldButtonOnTop:!0,unfoldedByDefault:!0,renderFoldableSection:({isUnfolded:l})=>o(zi,{isUnfolded:l,className:"flex flex-col pl-2xl",children:e.map(ys(n,t))}),renderFoldButton:Es(c("div",{children:[o(el,{value:a,onChange:t=>{for(const l of e){const e=n(l.name);e?.onChange&&e.onChange(t)}},text:"Согласие на все документы"},l),Gt(i?"Отметьте все обязательные соглашения":"")]}))})})})),Es=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"})})]}),Fs=({field:e,typeForm:t="",inputs:n,isRetailForm:l=!1})=>{const{consentInputs:a,restInputs:i}=Os(n||[]);return a.length>2?c("div",{children:[i.map(ys(e,t,l)),o(As,{inputs:a,field:e})]}):(n||[])?.map(ys(e,t,l))},Os=e=>({consentInputs:e?.filter((e=>Object.keys(oa).includes(e.name||"")))||[],restInputs:e?.filter((e=>!Object.keys(oa).includes(e.name||"")))||[]}),Ls={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",organizationPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:zn[0],serviceType:La[0],feedbackMethod:ja[0],serviceDirection:$a[0],vedTypes:fs[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},$s=(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||Ls[e.name||""]]))),typeForm:{key:n,text:""}}},js=(e,t)=>o(Er,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),qs=e=>ca("/user-data/updateUserProfile","PUT",e),Us=e=>ca("/user-data/updateUserTask","PUT",e),Ws={width:"118",height:"24"},Hs={"bg-white":"color",transparent:"white"},Ys={"bg-white":"text-primary-main",transparent:"text-white"},Ks=(e,t,n)=>o(ne,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:Hs[e]},className:Ys[e],width:n?.width,height:n?.height}),Xs={"bg-white":"text-primary-text",transparent:"text-white"},Gs=d((({className:e,href:t="/",logo:n,children:l,targetBlank:a,bgColor:i="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??"Россельхозбанк",...pe(s),children:[Ks(i,n?.image,Ws),r?l??o("div",{className:"ml-s",children:o(Me,{font:"font-medium",color:Xs[i],size:"",children:n?.title??"Россельхозбанк"})}):null]}))),Js=async({code:e,setHasError:t,close:n,sendCode:l=Ut})=>{const a=await(i={captchaText:e},ca("/sms/checkCaptcha","POST",i));var i;"ERROR"===await a.text()?t(!0):(l(),n?.())},Zs=async(e,t)=>{const n=await(e=>ca(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET"))(t);e(URL.createObjectURL(await n.blob()))},Qs=d((({phoneNumber:e,close:t,sendCode:n,onClose:i})=>{const[r,s]=l(""),[d,m]=l(""),[u,h]=l(!1);return a((()=>{Zs(s,e)}),[]),o(pa,{head:o(Gs,{}),onClose:i,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:r}),o("div",{onClick:()=>Zs(s,e),className:"flex w-8 items-center justify-center cursor-pointer",children:o(W,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(Yt,{className:"w-[300px]",onChange:m,value:d,placeholder:"Введите код с картинки"}),u?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-[310px] justify-between",children:[o(Er,{onClick:t,version:"secondary",children:"Вернуться"}),o(Er,{type:"submit",disabled:!d,onClick:()=>Js({code:d,setHasError:h,close:t,sendCode:n}),version:"secondary",children:"Отправить"})]})]})})})),eo=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:to(e)})))),to=e=>`${`${Math.floor(e/60)}`.padStart(2,"0")}:${(""+e%60).padStart(2,"0")}`,no=async({phoneNumber:e,captchaDialog:t,setTimeNextReq:n,setIsTimerStarted:l,setAttemps:a})=>{try{await(i={phoneNumber:e,smsCodesSetName:{key:"AUTHENTICATION"}},ca("/sms/sendCode","POST",i)).then((t=>{if("string"!=typeof t&&t.errorMessage&&t.errorMessage.startsWith(`Too many request for phoneNumber [${e}]`))throw t})),a(0),n(180),l(!0)}catch(e){t.open()}var i},lo=d((({values:e,setValues:t,hasError:n,errorText:r})=>{const[d,m]=l(0),u=s([]);a((()=>{u.current?.[d]?.focus()}),[d]);const h=i((n=>l=>{const{value:a}=l.currentTarget,i=a.slice(0,1);t(e.map(((e,t)=>t===n?i:e))),m(n+1)}),[e]),p=i((n=>l=>{const{key:a}=l;if("Backspace"===a&&!e[n]){const l=n>0?n-1:e.length-1,a=e.map(((e,t)=>t===l?"":e));t(a),m(l)}}),[e]),g=i((n=>{n.preventDefault();const l=n.clipboardData.getData("text"),a=e.map(((e,t)=>t<l.length?l[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,l)=>o("input",{type:"number",maxLength:1,value:t,onChange:h(l),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[l]=e},onFocus:e=>e.target.select(),onKeyDown:p(l),className:ao(l,e,n)},l)))}),n?o("div",{className:"text-error",children:r}):null]})})),ao=(e,t,n=!1)=>{const l=!t[e];return`w-16 h-20 text-3xl text-center p-2 m-2 border ${n&&l?"border-error":"border-gray"} rounded-md caret-transparent outline-none`},io=d((({isDisabled:e,onClick:t,text:n})=>o(Er,{type:"button",onClick:t,disabled:e,children:o(Me,{font:"font-medium",children:n})}))),ro=e=>{globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token)},so=({close:e,values:t})=>{const[n,s]=l(!1),[o,c]=l(""),[d,m]=l(!1),[u,h]=l(0),[p,g]=l(!1),[f,x]=l(0),b=i((()=>{s(!1),c("")}),[]),y=r((()=>0===u&&p),[u,p]),v=r((()=>f>2||!t.every(Boolean)||y),[t]),N=i((async()=>{try{g(!1),h(0),x(f+1),m(!0),await(async e=>ca("/sms/checkCode","POST",e).then(ro))({smsText:t.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),b(),e&&e(t.join(""))}catch{m(!1),c(f>1?"Исчерпан лимит ввода смс-кода":"Неверный код"),s(!0)}}),[t,f]);return a((()=>{y?(s(!0),c("Код просрочен")):s(!1)}),[y]),{handleSubmit:N,hasError:n,errorText:o,isLoading:d,timeNextReq:u,isSubmitButtonDisabled:v,setTimeNextReq:h,setIsTimerStarted:g,setAttemps:x}},oo=d((({close:e=Ut,onClose:t=Ut,title:n,description:r,__html:s,code:d=!0,codeLength:m=4,textButton:u="",phoneNumber:h="+79999999999"})=>{const[p,g]=l(Array(m).fill("")),{handleSubmit:f,hasError:x,errorText:b,isLoading:y,timeNextReq:v,isSubmitButtonDisabled:N,setTimeNextReq:w,setIsTimerStarted:C,setAttemps:S}=so({values:p,close:e}),I=i((()=>{no({phoneNumber:h,captchaDialog:T,setTimeNextReq:w,setIsTimerStarted:C,setAttemps:S})}),[]),T=((e,t)=>{const{open:n,close:l,closeAll:a}=de();return{open:()=>n(o(Qs,{close:l,onClose:t,...e})),close:l,closeAll:a}})({phoneNumber:h,sendCode:I},t);return a((()=>{I()}),[]),o(pa,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg",children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[o(k,{className:"w-full",title:n,description:r,headlineVersion:"S",isEmbedded:!0}),d?o(lo,{values:p,setValues:g,errorText:b,hasError:x}):null,mo(v,w,I),o(Pe,{itemSize:"list-s",__html:s}),co(u,N,f),y?o(ur,{blur:!1}):null]})})})),co=(e,t,n)=>e?o(io,{isDisabled:t,onClick:n,text:e}):null,mo=(e,t,n)=>e?c("div",{className:"flex flex-row text-l font-light text-primary-main",children:["Получить новый код можно через",o(eo,{className:"text-primary-main ml-1",time:e,setTime:t})]}):o(ye,{onClick:n,className:"text-primary-main",children:"Получить новый код"}),uo=()=>{const{open:e,close:t}=de();return{open:(n,l)=>e(o(oo,{onClose:t,close:n,...l})),close:t}},ho={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},po={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},go=d((function({handleSubmit:e=Ut,onClose:t=Ut}){const[n,a]=l(""),[r,s]=l(!1),{open:d,close:m}=de(),u=Ce(),h=i((()=>{m(),e(n)}),[n]),p=i((e=>{a(e),"REFUSE"===e&&s(!0)}),[]),g=r?po:ho;return o(pa,{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:()=>ga(d,xo,u),children:o(N,{className:"text-center text-balance",headingType:"h2",title:g.title})}),o(w,{align:"text-center",children:g.description}),o(va,{className:"whitespace-normal",orientation:"horizontal",items:fo,value:n,onChange:p}),o(Er,{disabled:!n,type:"button",onClick:h,children:"Продолжить"})]})})})),fo=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],xo=2,bo=e=>{const{open:t,close:n}=de(),l=uo(),a=(t,a)=>async i=>{n(),"SIGNED"===i&&t?l.open((t=>async n=>{t&&await qs({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()})(a),yo(t)):e()};return{open:(n,l)=>t(o(go,{handleSubmit:a(n,l),onClose:e}))}},yo=e=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:bt(e),textButton:"Отправить",__html:"<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>\n <ul><li>согласие на запрос информации в БКИ</li></ul>"}),vo=d((function({handleClose:e}){const t=i((async()=>{const e=await(t={redirectUri:globalThis.location.href},ca("/esia/getLink","POST",t));var t;e&&(globalThis.location.href=e.link)}),[]);return o(pa,{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(Er,{type:"button",onClick:t,children:"Заполнить через Госуслуги"}),o(Er,{type:"button",version:"secondary",onClick:e,children:"Пропустить"})]})]})})})),No={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},wo={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK"},Co={mandatoryIncome:"INCOME_AVERAGE",otherPayments:"MANDATORY_PAYMENTS"},ko=e=>Object.entries(e).reduce(((e,[t,n])=>t in No?[...e,{contactTypeCd:{key:No[t]},value:n}]:e),[]),So=e=>Object.entries(e).reduce(((e,[t,n])=>t in wo?[...e,{addressType:{key:wo[t]},...n}]:e),[]),Io=({inputs:e,programId:t,nextStepLink:n,saveForm:a})=>{const[r,s]=l(""),[,c]=Vs("taskId"),[,d]=Vs("profileId"),[,m]=Vs("participantId"),u=(e=>{const{open:t,close:n}=de(),l=i((()=>{n(),globalThis.location.href=e}),[]);return{open:(e={})=>t(o(vo,{handleClose:l}),e),close:n}})(n),h=bo(u.open),p=uo(),g=i(((e,t,n)=>{m(e),c(t),d(n)}),[]);return{handleSubmit:i((async n=>{const l=ks(Dn(e));if(!pn(l(n)))return console.warn("validation fail");try{const{profile:{id:e}}=await(i={profile:{phone:bt(n.phone)}},ca("/public-data/createUserProfile","POST",i));if(e&&n?.phone){const l=async()=>{try{await To({programId:t,profileId:e,formData:n,saveUserData:g,saveForm:a}),p.close(),h.open(n.phone,e)}catch{s("Fail")}},i=Object.keys(oa).filter((e=>n[e])).map((e=>oa[e]?.text));p.open(l,Bo(n?.phone,i))}}catch{s("Fail")}var i}),[]),responseStatus:r}},To=async({programId:e,profileId:t,formData:n,saveUserData:l,saveForm:a})=>{const i=Po(n);await qs(((e,t)=>{const{name:n="",surname:l="",middleName:a="",birthday:i="",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:l,midname:a,birthDate:i&&xt(i,!0),email:s,phone:bt(r),processPersonalDataFlg:Boolean(o),consentProviderFlg:Boolean(c),consentPfrFlg:Boolean(d),consentPhotoFlg:Boolean(m),consentAssignmentClaimsFlg:Boolean(u),consentCollectionFlg:Boolean(h),consentInformFlg:Boolean(p)}}})(t,i));const{taskId:r,participantId:s}=await(o={profileId:t,programId:e},ca("/user-data/createDraftTask","POST",o));var o;await Us((({participantId:e,taskId:t,profileId:n,formData:l})=>{const{name:a,surname:i,middleName:r,birthday:s,phone:o,email:c}=l;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:globalThis.location.origin,id:t,participants:[{birthDate:s&&xt(s,!0),id:e,midname:r,name:a,surname:i,profile:{id:n},participantContacts:ko({phone:o&&bt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}]}}})({participantId:s,taskId:r,profileId:t,formData:i})),l(s,r,t),a(n)},Bo=(e,t)=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:bt(e),textButton:"Оформить",__html:`<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>${Ro(t)}`}),Ro=e=>`<ul>${e?.map((e=>"<li>"+e+"</li>")).join("")}</ul>`,Po=e=>{const{consentOthersFlg:t,...n}=e;return{...n,consentCollectionFlg:t,consentAssignmentClaimsFlg:t,consentPhotoFlg:t}},Do=e=>{const{profile:t,addInfo:n,document:l,addressRegistration:a,addressFact:i}=e;return{name:t?.name,surname:t?.surname,middleName:t?.midname,birthday:t?.birthDate,phone:wi(t?.phone),email:t?.email,dulIssueDateField:l?.dulIssueDate,dulIssuedBy:l?.dulIssuedBy,dulNumber:l?.dulNumber,dulSerie:l?.dulSerie,dulSubdivisionCode:l?.dulSubdivisionCode,snils:n?.snils,birthPlace:n?.birthPlace,addressRegistration:Mo(a),addressFact:Mo(i)}},Mo=e=>{const{postcode:t,region:n,regionCode:l,locality:a,city:i,street:r,house:s,building:o,block:c,apartment:d}=e,m=[t,n,a||i,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:l?.key,fullAddress:m}},_o=e=>{const[t,n]=l(!1),[r]=Vs("profileId"),[s,o]=Vs("leadForm"),c=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),d=c.get("code"),m=c.get("state"),u=i((async()=>{if(r&&d&&m){const n=await(t={profileId:r,code:d,state:m,redirectUri:globalThis.location?.href},ca("/esia/updateProfileEsia","POST",t));o({...s,...Do(n)}),globalThis.location.href=e}var t}),[]);return a((()=>{d?(n(!0),u()):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),{isLoading:t}},zo=d((({className:e,title:t,programId:n="",nextStepLink:i="/credit-lead",sections:r=[],button:s,...d})=>{const m=r?.flatMap((e=>e?.inputs))||[],[h,p]=l(""),{isLoading:g}=_o(i),[f,x]=Vs("leadForm"),b=$s(m,f),{handleSubmit:y,responseStatus:v}=Io({inputs:m,programId:n,nextStepLink:i,saveForm:x});if(v){Cs({responseType:v}).open()}const[,{field:N,onSubmit:w,reset:C}]=At(b,{onSubmit:y});return a((()=>{"OK"===h&&(p(""),C())}),[h]),o(Ft,{className:u("container space-y-m",e),title:t,...d,children:c("form",{onSubmit:w,className:"space-y-m relative",children:[g?o(ur,{blur:!1}):null,r.map(((e,t)=>c("div",{className:u(vs(e.columns),"grid gap-x-m"),children:[Ns(e.title),Fs({field:N,inputs:e?.inputs,isRetailForm:!0})]},`section-${t}`))),js(s)]})})})),Vo=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black",link:l})=>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(Pe,{__html:e}),l?.text?o(ye,{className:"text-primary-main",children:l.text}):null]})]}))),Ao=d((({interval:e=0,title:t,__html:n})=>{const[a,i]=l(e),r=100-(e-a)/e*100;return c("div",{children:[t?o(k,{title:t,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) ${r}%, 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(eo,{interval:e,time:a,setTime:i})})]}),n?o(Pe,{__html:n}):null]})]})})),Eo=d((({title:e,description:t,infoCard:n,sectionInfoTitle:l,sectionInfo:a,sectionAdditionalTitle:i,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(Ao,{interval:d}):null]}),o(Fo,{title:l,items:a}),o(Fo,{title:i,items:r,countColumns:!0}),n?.__html?o(Vo,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(Er,{className:"w-full mt-lg",children:s}):null]}))),Fo=({title:e,items:t,countColumns:n=!1})=>{const l=Ce();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(Me,{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",vs(n||l?1:2)),children:t.map(((e,t)=>o("div",{children:Oo(e)},t)))}):null]})]}):null},Oo=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Me,{color:"text-secondary-text",size:"text-l",children:e}),o(Me,{color:"text-primary-text",size:"text-xl",children:t})]}),Lo=d((({title:e,description:t})=>{const n=Ce();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"})]})})),$o=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",jo=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function qo(e,{sensitivity:t,rootRef:n}={}){const l=s(null),i=r((()=>({threshold:Uo(t),root:n?.current})),[t,n?.current]);return a((()=>{if(!l.current)return;const t=new IntersectionObserver(e,i);return t.observe(l.current),()=>{t.disconnect()}}),[e,i]),l}function Uo(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 Wo=d((({className:e,style:t,idx:n,activeIndex:l,observerOptions:a,children:r,onIntersection:s})=>{const c=qo(i((e=>{e.length&&s&&s(n||0,e[e.length-1])}),[s,n]),a);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===l),ref:c,role:"listitem",children:r})})),Ho=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],Yo=d((({className:e,itemClassName:t,containerRef:n,activeIndex:l,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},b=s([]),y=i(((e,t)=>{const n=[...b.current||[]];n[e]=t,b.current=n,g&&g(n),f&&f(Xo(n))}),[g,f]),v=a>0?r*Number(a)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?Ko(c,v):{},...N?jo(h):{},gap:`${r}px`};return o("div",{className:u("box-border overflow-auto no-scrollbar",d,e),style:C,ref:n,role:"list",children:(k=(e,n)=>o(Wo,{className:u(m,a?Ho[a-1]:"",{"h-full":N},t),style:w?Ko(c/4):{},activeIndex:l,idx:n,observerOptions:x,onIntersection:y,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(k):k(e,0))(p)});var k})),Ko=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Xo=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Go={"horizontal-list":"w-6","vertical-list":"h-6"},Jo=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(l,a)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",a===e?Go[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(a)},String(a)),Zo=({activeIndex:e,onClick:t})=>(n,l)=>{const a=l===e,i=a?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover: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(l),"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",i),children:[o("div",{className:r,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(l))},Qo=e=>e,ec=(e=Qo)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),tc=ec(),nc=(e=Qo)=>ec((t=>-e(t))),lc=nc(),ac=e=>t=>e.scrollWidth/t,ic=e=>(t,n)=>{e.scrollBy({left:n*ac(e)(t),behavior:"smooth"})},rc=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[a,r]=l([]),o=i((e=>{r((t=>{return(n=t)===(l=e)||Boolean(n&&l&&n?.length===l?.length&&n.every(((e,t)=>e===l[t])))?t:e;var n,l})),t&&t(e)}),[t]),[c,d]=a.length?[nc()(a),ec()(a)]:[-1,-1],m=c>0,u=d<e-1,h=i((()=>{var t;n.current&&(m?ic(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=i((()=>{n.current&&(u?ic(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=i(((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}]},sc={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},oc=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:l="horizontal-list",version:r,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=Ce(),[h,p]=rc({itemCount:s.length}),g=cc(Boolean(s?.length));a((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=i((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(Yo,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(Zo({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",sc[l],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(Jo({activeIndex:t,onClick:f,listType:l}))}):null})),cc=(e=!1)=>({behavior:e?"auto":"smooth"}),dc=d((({className:e,disabled:t,...n})=>o(ye,{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"})}))),mc=d((e=>o(dc,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),uc=d((e=>o(dc,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),hc="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",pc=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:l,isBottom:a})=>{const{canScrollLeft:i,canScrollRight:r,scrollLeft:s,scrollRight:d}=t,m=l&&!a;return c("div",{className:e,children:[n?gc(t):null,i?o(mc,{className:u(fc(a),m?"left-1":"left-0"),onClick:s}):null,r?o(uc,{className:u(fc(a),m?"right-1":"right-0"),onClick:d}):null]})})),gc=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(hc,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(hc,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),fc=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),xc=d((({className:e,version:t,gap:n=14,padding:l=16,visibleItemCount:a=1,listType:i="horizontal-list",snapAlign:r,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:x})=>{const b=Array.isArray(g)?g.length:0,[y,v]=rc({itemCount:b,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===i?"relative h-full":""),children:[o(Yo,{containerRef:y,activeIndex:N,visibleItemCount:a,gap:n,padding:l,listType:i,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(pc,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(oc,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:b,listType:i,version:t,navButtons:x,containerRef:y,containerScroll:v})]})})),bc=({blocksToRender:e,...t})=>o(xc,{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",$o(!0)),children:T(e,t)},String(n))})}),yc=e=>e%2!=0,vc=d((({textNode:e,iconNode:t,tag:n,onClick:l,justifyContent:a="between",className:i,role:r,...s})=>c(n,{tag:n,className:u("flex items-center w-full gap-1","between"===a?"justify-between":"justify-center",i),onClick:l,role:r,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),Nc=d((({className:e="",label:t,icon:n,dataTheme:l="pc",disabled:a=!1,onClick:i})=>o(vc,{tag:"button",onClick:i,disabled:a,"data-theme":l,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(Me,{size:"text-h4",children:t}),iconNode:n?o(ne,{image:{icon:n,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),wc=({isUnfolded:e,onToggle:t})=>o(Nc,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Cc=["ArrowDownIcon","ArrowUpIcon"],kc="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",Sc=({topItemsCount:e=0,label:t="",block:n,blocksToRender:l=[],...a})=>{const[i,r]=e>0?[l.slice(0,e),l.slice(e)]:[l,[]];return c("div",{className:u("space-y-2xs",{hidden:!l.length}),children:[c("div",{className:u(kc),children:[R(i,{...a.options,parent:n}),yc(i.length)?o(gt,{className:"col-span-6",...a}):null]}),o(_i,{renderFoldableSection:({isUnfolded:e})=>c(zi,{className:u(kc),isUnfolded:e,children:[R(r,{...a.options,parent:n}),yc(r.length)?o(gt,{className:"col-span-6",...a}):null]}),renderFoldButton:({isUnfolded:n,onToggle:l})=>o(Nc,{className:u({hidden:e<1}),disabled:!r?.length,label:t,icon:Cc[Number(n)],dataTheme:a.options?.page?.colorPalette,onClick:l})})]})},Ic=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...l})=>{switch(e?.view){case"grid":return c("div",{children:[Tc(n,t),Sc({...e,...l,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[Tc(n,t),bc({...l,blocksToRender:t})]});default:return null}})),Tc=(e,t)=>e&&!t.length?o(Lo,{...e}):null,Bc=e=>t=>t.reduce(((t,n,l)=>t.length?t.concat({...e,key:`sep-${l}`},n):[n]),[]),Rc=d((({value:e,onChange:t,items:n=[],multiple:l})=>n.map((n=>o(ii,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const a=e?.includes(n);t(l?a?(e||[]).filter((e=>e!==n)):[...e||[],n]:a?[]:[n])})(n.value),type:l?"checkbox":"radio"},n.value))))),Pc=d((({children:e,filtrationSchema:t,resetButton:n,field:l,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,Bc(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(Dc(l)).filter(Boolean))]}),n?o("div",{children:o(Er,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:a,children:n?.text})}):null]}))),Dc=e=>([t,n])=>{const l=n?.type;return"array"===l?Mc(t,e)(n):null},Mc=(e,t)=>n=>{const l=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(Me,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(Rc,{items:l,multiple:!n?.single,...t(e)})]},e)};function _c(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const zc=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,Vc=(e,t)=>Object.entries(e).map((([n,l])=>"number"==typeof l?Array.isArray(t[n])?((e,t)=>n=>zc(t[e])||zc(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>zc(t[e])||zc(n[e])||Ac(t[e])<=Ac(n[e]))(n,e):"object"==typeof l&&"min"in l&&"max"in l?((e,t)=>n=>zc(t[e])||zc(n[e])||Ac(t[e]?.min)>=Ac(n[e]?.min)&&Ac(t[e]?.min)<=Ac(n[e]?.max))(n,e):Array.isArray(l)?((e,t)=>n=>zc(t[e])||zc(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>zc(t[e])||zc(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),Ac=e=>Number(e||0),Ec=(e,{block:t,page:n,normalize:l=Vt})=>{const a=t?.blocks||[],[i,{field:s,reset:o,update:c}]=At(e),d=r((()=>_c(a,a.map((e=>mt(e.content,n?.fallback))))),[a,n?.fallback]),m=i===e?a:((e,t)=>(n=Vt)=>e?.filter((([,e])=>Vc(t,n(e)||{}))).map((([e])=>e)))(d,i)(l);return[i,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},Fc={},Oc={},Lc=ht((({className:e,filtrationSchema:t=Fc,consumerField:n={},resetButton:l,...a})=>{const[,{blocksToRender:i},{field:r,reset:s}]=Ec(Oc,{block:a.block,page:a.options?.page}),d=o(cn,{className:"w-64",label:n?.title,options:$c(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>$c(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...a,children:[o(Pc,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(Er,{type:"reset",className:"mt-lg w-64",onClick:s,version:l?.version,children:l?.text})})]})}),o(Ic,{blocksToRender:i,...a})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),$c=e=>_c(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),jc=(e=!1)=>e?"text-left":"text-center",qc={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},Uc=d((({className:e,defaultIconSize:t=44,iconBgVersion:n="primary",size:l,icon:a,...i})=>{const r=String(l?.width||t);return a?o("div",{style:{width:`${r}px`,height:`${r}px`},className:u("rounded-icon object-fit flex justify-center items-center",qc[n],e),children:o(W,{...i,width:"54%",height:"54%",name:a})}):null})),Wc=d((({className:e="",title:t,benefitList:n,...l})=>{const a=Ce();return c(g,{className:e,defaultPadding:"p-6xl",...l,children:[t?o(N,{headingType:"h3",as:"h2",className:jc(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(Hc)}):null]})})),Hc=({label:e,description:t,__html:n,icon:l,isDotted:a=!1,iconBgVersion:i},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[l?.icon?o(Uc,{className:"shrink-0",iconBgVersion:i,...l}):null,l?.src?o(ne,{className:"shrink-0",image:l}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(N,{headingType:"h6",children:e}),o(Me,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(Pe,{__html:n,isDotted:a,itemSize:"list-s"}):null]}):null]},String(r)),Yc=e=>({icon:t,title:n,description:l},a)=>c("div",{className:u("flex flex-col gap-1","items-center",{"justify-center":!l&&!n}),children:[n?o(Me,{size:"text-h6",font:"font-normal",align:e,children:n}):null,t?o(ne,{image:t,height:"180",className:"w-auto mx-auto"}):null,l?o(Me,{size:"text-h6",font:"font-normal",align:e,children:l}):null]},String(a)),Kc=(e,t,n)=>o("div",{className:`grid gap-2xs ${Xc(t)}`,children:e.map(Yc(n))}),Xc=e=>{switch(e){case"3":return"grid-cols-3";case"4":return"grid-cols-4";default:return"grid-cols-5"}},Gc=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:l="4",subtitle:a,title:i,...r})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...r,children:[o(k,{defaultPadding:"",title:i,description:a,headlineVersion:"M"}),e?.length?Kc(e,l,t):null]}))),Jc={start:"justify-start",center:"justify-center",end:"justify-end"},Zc=d((({buttons:e,className:t="",align:n,...l})=>{const a=n&&u("flex",Jc[n]);return o(g,{className:u("!bg-transparent",a,t),defaultPadding:"p-0",...l,children:Le(e)})})),Qc=d((({className:e,title:t,children:n,...l})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...l,children:[t?o(N,{className:"text-center",title:t}):null,n]}))),ed="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",td="flex flex-col lg:max-w-80 lg:w-1/2 gap-2xl",nd="flex flex-col gap-y-xl min-w-52",ld=d((({value:e,fractionDigits:t,fixed:n,prefix:l,postfix:a})=>o(Me,{size:"text-h3",children:"number"==typeof e?[l,Ue(t,{fixed:n})(e),a].filter(Boolean).join(" "):e}))),ad=d((({className:e,title:t,value:n,color:l="text-secondary-text",...a})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(Me,{size:"text-l",font:"font-light",color:l,children:t}):null,n?o(ld,{value:n,...a}):o(Me,{size:"text-h3",children:"-"})]}))),id=(e,t)=>e?o(w,{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:l=2,depositeName:a,isShowDepositeName:i,color:r="text-secondary-text"})=>c("div",{children:[o(Me,{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:Ue(l,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),a&&i?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:a}):null]})]}))),sd=d((({title:e="Ставка"})=>c("div",{className:"space-y-s min-w-96",children:[o(Me,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(W,{className:"w-10 h-auto lg:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:o(w,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Процентная ставка не найдена, выберите другие параметры"})})]}))),od=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:l=2,color:a="text-secondary-text",children:i,...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:l,color:a,...r})}),o(ad,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:l,fixed:!0,color:a,...r}),i]}):o(sd,{title:e,...r}),cd=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...l})=>o(hl,{items:e?[`От ${Ue(1)(l.min||0)} ${n}`,`До ${Ue(1)(l.max||0)} ${n}`]:[],step:t,...l}),dd={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},md={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},ud=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:l}=e,[a,i]=((e,t,n)=>{const{maxBonus:l=5e3,prefMonthsNum:a=dd.prefMonthsNum,prefTravelBonusRate:i=dd.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(i*t)+Math.round(r*n),l);return[c,c*a+Math.min(Math.round(s*t)+Math.round(o*n),l)*(12-a)]})(t||md,n,l);return{...t,...e,monthBonus:a,yearBonus:i}},hd=ht((({className:e="",title:t,calcSource:n,buttons:l,footnote:a,...i})=>{const[r,{field:s}]=At({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=ud(r,n);return o(Qc,{className:e,title:t,...i,children:c("section",{className:u(ed,e),children:[c("div",{className:td,children:[cd({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),cd({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?od({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:nd,children:[f>=0?o(ad,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,Le(l,{isVertical:!0}),id(a)]})]})})})),pd=Math.round(29.5),gd=(e,t=0)=>e?.sum?e.sum:t,fd=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,xd=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,bd=({items:e,title:t,mobileTitle:n=t,orientation:l="horizontal",value:a,onChange:i,...r})=>c("div",{className:"grid gap-s whitespace-nowrap",children:[t?o("div",{className:"hidden @5xl:block",role:"radiogroup","aria-label":t,children:o(Me,{color:"text-secondary-text",font:"font-light",children:t})}):null,n?o("div",{className:"@5xl:hidden",role:"radiogroup","aria-label":n,children:o(Me,{color:"text-secondary-text",font:"font-light",children:n})}):null,o(va,{orientation:l,items:e,value:e[a?0:1].id,onChange:t=>i&&i(t===e[0].id),...r})]}),yd=e=>bd({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),vd=" (c капитализацией)",Nd=({income:e,finalSum:t,postfix:n="₽",buttons:l=[],footnotes:a=[],isCapitalization:i=!1})=>c("div",{className:nd,children:[o(ad,{title:`Доход в конце срока${i?vd:""}`,value:e,postfix:n,prefix:"+"}),o(ad,{title:`Сумма в конце срока${i?vd:""}`,value:t,postfix:n}),Le(l,{isVertical:!0}),a?.map(id)]}),wd=([e,t],n,l=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:Cd([e,t],l),Cd=([e,t],n=[])=>({[e]:n.length?lc(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],l)=>e>=l[t]&&e<=l[n],Sd={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const Id={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Td=(e,t)=>{const{daysValue:n,moneyValue:l,isPartialWithdrawal:a,isReplenished:i,isMonthlyInterestPayment:r}=e,s=i||a,o=n<90||n>730,c=function(e){const t=e?.rateType?Sd[e?.rateType]:"",{data:n}=$n(t?`/api/v1/depositrates/${t}`:null,st);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&Bd(s,e)&&kd(l,["minSum","maxSum"],e)&&kd(n,["minDays","maxDays"],e)))||Id,{rate:m}=d,u=Rd(m,e),h=l+u,p=c||[Id];return{...d,...Cd(["minSum","maxSum"],p),...Cd(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},Bd=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Rd=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:l,daysValue:a}=t;return n?Math.round(l*Math.pow((1200+e)/1200,a/30)-l):Math.round(l*e*a/365/100)},Pd=ht((({className:e="",title:t,buttons:n,footnote:l,bottomFootnote:a,isShowDepositeName:i,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=At({moneyValue:gd(r,1e5),daysValue:fd(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=Td(m,s),{income:g,finalSum:f,rate:x,depositeName:b}=p;return o(Qc,{className:e,title:t,...d,children:c("section",{className:u(ed,e),children:[c("div",{className:td,children:[cd({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(y={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(hl,{items:[`От ${xd(y.min||0)}`,`До ${xd(y.max||0)}`],step:1,...y})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[Dd(p,h),yd({title:"Выплата процентов",orientation:"vertical",...h("isMonthlyInterestPayment"),className:"sm:flex-col"})]})]}),od({rate:x,depositeName:b,isShowDepositeName:i}),Nd({income:g,finalSum:f,buttons:n,footnotes:[l,a]})]})});var y})),Dd=(e,t)=>c("div",{className:"space-y-s",children:[o(Me,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(el,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(el,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),Md=(e=[],t=!1)=>_d([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),_d=(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]},zd=({min:e=0,max:t=0,availableMonths:n,...l})=>o(hl,{items:[`От ${Vd(e)}`,`До ${Vd(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...l}),Vd=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Ad=e=>bd({...e,className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Ed=({field:e,defParams:t,calcParams:n,map:l,monthsValue:a="maxMonths"})=>{Object.entries(l).forEach((([n,l])=>{e?.(n)?.onChange?.(t?.[l])})),e?.("monthsValue")?.onChange?.(ol(t?.[a],n.minMonths,n.maxMonths))},Fd=(e,t)=>{const{isAnnuity:n,moneyValue:l,monthsValue:a,moneyExtra:i}=t;if(0===e)return 0;if(n){const t=e/1200;return i?(l+i)*(t+t/(Math.pow(1+t,a)-1)):l*(t+t/(Math.pow(1+t,a)-1))}return Math.round(l/a)+l*(e/1200)},Od={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Ld=e=>$d({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&$d({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&$d({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&$d({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),$d=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:l,viewSettingFieldKey:a})=>!!n&&!n[a]||t[l]===e[l],jd=(e,t,n)=>{const{moneyValue:l,monthsValue:a}=e,i=t?.rateRows||[Od],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Ld({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=wd(["minSum","maxSum"],r,i),{minMonths:c,maxMonths:d}=wd(["minMonths","maxMonths"],r,i),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:l,monthsValue:a})=>e?.find((e=>Ld({row:e,userInputParams:t,paramsViewSettings:n})&&kd(l,["minSum","maxSum"],e)&&kd(a,["minMonths","maxMonths"],e)))||Od)({rateRows:i,userInputParams:e,paramsViewSettings:n,moneyValue:l,monthsValue:a}),{rate:u}=m,h=Fd(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:l,monthsValue:a,monthlyPayment:h}},qd=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),Ud={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},Wd=ht((({className:e,title:t,calcSource:n,buttons:l,footnote:i,paramsViewSettings:r,defaultParams:s,registerSubmit:d,...m})=>{const h=(p=n?.rateRows,_d([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],p));var p;const[g,{field:f,onSubmit:x}]=At({moneyValue:gd(s,2e5),monthsValue:fd(s,pd),isAnnuity:Boolean(s?.isAnnuity),isInsurance:Boolean(s?.isEnableInsurance),isSalaryClient:Boolean(s?.isEnableSalaryClient),isPensionClient:Boolean(s?.isEnablePensionClient),isStateEmployee:Boolean(s?.isEnableStateEmployee)});d?.(x);const b=jd(g,n,r),y=Ad({title:"Тип платежа",orientation:"vertical",...f("isAnnuity")}),{onChange:v}=f("moneyValue"),{onChange:N}=f("monthsValue");return a((()=>{v&&v(ol(g.moneyValue,b.minSum,b.maxSum))}),[b.minSum,b.maxSum]),a((()=>{N&&N(ol(g.monthsValue,b.minMonths,b.maxMonths))}),[b.minMonths,b.maxMonths]),a((()=>{!qd(s)&&h&&Ed({field:f,defParams:h,calcParams:b,map:Ud,monthsValue:"minMonths"})}),[n,s]),o(Qc,{className:e,title:t,...m,children:c("section",{className:u(ed,e),children:[c("div",{className:td,children:[cd({title:"Сумма кредита, ₽",step:500,min:b.minSum,max:b.maxSum,...f("moneyValue"),value:b.moneyValue}),zd({title:"Срок кредита, месяцев",min:b.minMonths,max:b.maxMonths,...f("monthsValue"),value:b.monthsValue}),Hd({...b,...r},f),o("div",{className:"sm:hidden",children:y})]}),c("div",{className:u(nd,"@4xl:w-1/2"),children:[o(ad,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(ad,{title:"Ставка",value:b?.rate,fractionDigits:2,postfix:"%"}),o(ad,{title:"Ежемесячный платёж",value:b.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:y}),Le(l,{isVertical:!0}),id(i)]})]})})})),Hd=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(el,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(el,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(el,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(el,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),Yd=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,l]=t[n-1],[a,i]=t[n];l>=a?t.splice(n-1,2,[e,Math.max(l,i)]):n++}return t},Kd={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},Xd=(e,t,n)=>{const{moneyValue:l,monthsValue:a}=e,i=t?.[0]?Zd(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=>[Jd({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),Jd({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),Jd({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),Jd({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,kd(l,["minSum","maxSum"],t),kd(a||i,["minMonths","maxMonths"],t)].every(Boolean)))||Kd,{rate:u}=m,h=Gd(u,e),p=l+h,g=t||[Kd];return{...m,...Cd(["minSum","maxSum"],g),...Cd(["minMonths","maxMonths"],g),availableMonths:Yd(g.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((l,a)=>t>=e?e+a*n:e-a*n)))(e,t))),...e,defaultMonth:i,income:h,finalSum:p}},Gd=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:l,monthsValue:a}=t;return n?Math.round(l*Math.pow((1200+e)/1200,a)-l):Math.round(l*e*30*a/365/100)},Jd=({row:e,userInputParams:t,paramKey:n,isExclude:l})=>l||t[n]===e[n],Zd=(e,t)=>e+Math.round((t-e)/2),Qd=(e="rub")=>"rub"===e,em=(e,t)=>{const{minMonths:n,maxMonths:l}=Cd(["minMonths","maxMonths"],am(t,e?.currency)),a=e.monthsValue||Math.round((n+l)/2);return{monthsValue:ol(a,n,l)}},tm=(e,t)=>{const{minSum:n,maxSum:l}=Cd(["minSum","maxSum"],am(t,e?.currency)),a=e.moneyValue||n;return{moneyValue:ol(a,n,l)}},nm=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),lm=e=>{const t=Qd(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},am=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},im=(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?bd({title:"Пополнение",...t("isReplenish"),value:e.isReplenish,orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,e.isShowWithdrawn?bd({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?yd({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment,orientation:"vertical"}):null,e.isShowRemoteRegistration?(l={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration,orientation:"vertical"},bd({...l,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]}),rm(e.isShowNewClient),e.isShowNewClient?o(el,{text:"Новый вкладчик",...t("isNewClient")}):null]});var l},rm=(e=!1)=>e?o("div",{className:"border-b border-main-divider w-full"}):null,sm={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum"},om={text:"₽",key:"rub"},cm=ht((({className:e,title:t,calcSource:n,buttons:l=[],footnote:r="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[om],g=i((e=>t=>e?{...t,...lm(t),...tm(t,e),...em(t,e),...nm(t,e)}:t)(h),[h]),[f,{field:x}]=At({moneyValue:gd(d,2e4),monthsValue:fd(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:om},{normalize:g}),b=x?.("currency")?.value??om,y=x?.("isNewClient")?.value,v=am(h,b),N=Xd(f,v,s),{rate:w,income:C,finalSum:k,type:S=""}=N,I=i((()=>{Ed({field:x,defParams:Md(v,y),calcParams:N,monthsValue:"minMonths",map:sm})}),[x,h]);a((()=>{!qd(d)&&v&&I()}),[d,h]);const T=w===Md(v,y)?.rate;return o(Qc,{className:e,title:t,...m,children:c("section",{className:u(ed,e),children:[c("div",{className:td,children:[c("div",{className:"flex gap-m",children:[cd({className:"w-full",title:`Сумма, ${b?.text}`,min:N.minSum,max:N.maxSum,...x("moneyValue"),value:N.moneyValue,postfix:b?.text,step:dm(b?.key)}),h&&h?.length>1?o(hn,{label:"Валюта",options:p,...x("currency")}):null]}),zd({title:"Срок, месяцев",min:N.minMonths,max:N.maxMonths,availableMonths:N.availableMonths,...x("monthsValue"),value:N.monthsValue}),im({...N,...s},x)]}),od({rate:w,children:um(I,T)}),Nd({income:C,finalSum:k,buttons:[...l,mm(n?.buttons,S)],footnotes:[r],postfix:b?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),dm=(e="")=>Qd(e)?1e3:100,mm=(e=[],t="")=>{const{type:n,...l}=e.find((e=>e.type===t))??{};return l},um=(e,t=!1)=>t?null:o(Er,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),hm=e=>pm({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&pm({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),pm=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:l,viewSettingFieldKey:a})=>!!n&&!n[a]||t[l]===e[l],gm={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},fm=(e,t,n)=>{const{moneyValue:l,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r}=e,s=t?.rateRows||[gm],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>hm({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=wd(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=wd(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:l,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r})=>e?.find((e=>hm({row:e,userInputParams:t,paramsViewSettings:n})&&kd(l+r,["minSum","maxSum"],e)&&kd(i,["minSumOld","maxSumOld"],e)&&kd(r,["minSumExtra","maxSumExtra"],e)&&kd(a,["minMonths","maxMonths"],e)))||gm)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:l,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r}),{rate:p}=h,g=Fd(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:l,monthsValue:a,oldMonthlyPayment:i,moneyExtra:r,monthlyPayment:g,benefit:f}},xm=ht((({className:e="",title:t,calcSource:n,buttons:l,footnote:a,paramsViewSettings:i,...r})=>{const[s,{field:d}]=At({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),m=fm(s,n,i),h=Ad({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")});return o(Qc,{className:e,title:t,...r,children:c("section",{className:u(ed,e),children:[c("div",{className:td,children:[cd({title:"Остаток долга в других банках, ₽ ",step:500,min:m.minSum,max:m.maxSum-m.maxSumExtra,...d("moneyValue"),value:m.moneyValue}),cd({title:"Ежемесячный платёж в других банках, ₽",step:500,min:m.minSumOld,max:m.maxSumOld,...d("oldMonthlyPayment"),value:m.oldMonthlyPayment}),zd({title:"Новый срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),bm({...m,...i},d),m.isExtraMoney?cd({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(nd,"@4xl:w-1/2"),children:[o(ad,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(ad,{title:"Ставка",value:m?.rate,fractionDigits:2,postfix:"%"}),o(ad,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),m.benefit>0?o(ad,{title:"Выгода в месяц",value:m.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:h}),Le(l,{isVertical:!0}),id(a)]})]})})})),bm=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(el,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(el,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(el,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),ym=d((e=>{const{onChange:t,min:n,max:l,defaultValue:a="0",fractionDigits:r=0,...s}=e,c=sl(e,{normalize:(e=a)=>n&&l?String(ol(Number(vm(e)),n,l)):vm(e),format:Ue(r)}),d=i((e=>t&&t(vm(e))),[t]);return o(Yt,{onChange:d,...s,...c})})),vm=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Nm=d((e=>o(ym,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Me,{size:"text-xl",font:"font-light",children:"₽"})})}))),wm={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},Cm={amount:1500},km=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:i,formType:r="private",...s})=>{const[{amount:d},{field:m}]=At(Cm),[h,p]=l(!1);return a((()=>{p(d<=0)}),[d]),c(g,{className:u("flex flex-col items-center",e),defaultPadding:"p-6xl",...s,children:[t?o(N,{className:"pb-lg xl:pb-4xl self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-[468px]",method:"POST",action:wm[r],children:[o(Nm,{valid:!h,label:n,max:3e5,min:1,...m("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:d}),i?.text?o(Er,{className:"w-full mt-lg",type:"submit",disabled:h,children:i.text}):null]})]})})),Sm=({className:e,text:t="ХИТ"}={})=>c("div",{className:u("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(W,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(w,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),Im="relative h-full",Tm={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},Bm=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...l})=>{const{blocks:a}=l.block||{},i=a?.some(Dm),r=n?{defaultPadding:"p-6xl pb-m"}:{};return P({...l,renderProps:(n,l,a)=>c("div",{className:Rm(n,{someCardsHighlighted:i}),children:[T(n,l,{className:Pm(n,{someCardsHighlighted:i,showBorder:!e,cardSize:t}),...r,blockIndex:a}),Dm(n)?Sm({className:"absolute top-0 -right-4 z-40"}):null]},String(a))})},Rm=(e,{someCardsHighlighted:t})=>u(Im,t&&(Dm(e)?"pt-3xl":"pt-3xl sm:pt-16")),Pm=(e,{someCardsHighlighted:t,showBorder:n,cardSize:l="normal"})=>u(Im,"min-w-80",Tm[l],t&&(Dm(e)?"pt-3xl sm:pt-16":"pt-3xl"),$o(n),n&&"h-full"),Dm=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,Mm=ht((({className:e,visibleItemCount:t=1,noCardBorder:n,arrowsPadded:l=!0,isGap:a=!0,cardSize:i="normal",isNavButtons:r=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(xc,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:a?16:0,padding:0,arrowsPadded:l,navButtons:r?_m(s?.block?.blocks):[],hasBlur:!0,children:Bm({noCardBorder:n,cardSize:i,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),_m=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],zm="z-10 border border-solid w-full h-full",Vm=u(zm,"absolute hidden @xl:block border-transparent"),Am=d((({className:e,title:t,description:n,button:l,...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(Vm,"top-9 right-12 bg-green-dark")}),o("div",{className:u(Vm,"top-6 right-8 bg-green")}),o("div",{className:u(Vm,"top-3 right-4 bg-green-light")}),c("div",{className:u(zm,"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}),Le([l],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),Em={black:"bg-black",white:"bg-white"},Fm=d((({className:e="",title:t,description:n,image:l,price:a,button:i,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(Ie,{className:"h-full",padding:d,title:o(k,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:l?.src?o(ne,{className:"flex justify-center align-center mb-xl",image:l}):null,buttons:Le([i],{buttonClassName:"w-full self-end"}),children:[r?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(Me,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(Om)]}):null,a?c(Me,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),Om=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${Em[e]}`},String(t)),Lm=d((({icon:e,...t})=>{const n=ue(),{text:l,href:a,target:i,onClick:r}=n(t);return l?o("div",{className:u("p-3 rounded-lg bg-white text-secondary-text flex justify-center"),children:o("a",{role:"link",href:a,target:i,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:l}):null,o("div",{className:"font-light md:font-normal text-primary-text text-center text-xs md:text-sm whitespace-wrap",children:l})]})})}):null})),$m=d((({className:e,additionalDescription:t,description:n,links:l,title:a,...i})=>o(g,{defaultPadding:"p-5xl",className:u("overflow-hidden",e),...i,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})]}),l?.length?jm(l):null]})}))),jm=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(Lm,{...e},String(t))))}),qm=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"mindboxEvent"===e?{...n,eventJson:t}:n}))),Um=d((({className:e="",href:t,target:n,onClick:l,data:a,children:i})=>{const r=ue()({href:t,target:n,onClick:l});return o(t?"a":"div",{className:u("block",e),...t?r:{},role:t?"link":"none",...pe(a),children:i})})),Wm=[{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"}}],Hm=d((({className:e="",media:t,showButtonText:n,stretched:a,version:i="white",children:r})=>{if(!t?.length)return null;const[s,d]=l(),m=t?.map((e=>{const{href:t,icon:l,text:a}=e,{iconMapped:r}=(e=>Wm.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=Oe(l)?l: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??i}})),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},Ym(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:Le(m,{className:Km(s??!1,a??!1,n),buttonClassName:h})}),r?o(Me,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),Ym=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",Km=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),Xm=d((({className:e,padding:t,description:n,additionalDescription:l,href:a,icon:i,isDotted:r,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:x=!0,isImageAlwaysOnRight:b=true,isImageSecondary:y=!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(Um,{href:a,target:m,className:"h-full",data:qm(v),children:c(Ie,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(k,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...Je(Oe(i)?o(ne,{image:i}):null,x),buttons:d.length?o(Hm,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:b,isImageSecondary:y,imageAlign:"center",children:[o(Fe,{benefits:f}),s?o(Pe,{__html:s,isDotted:r,itemSize:"list-s"}):null,Gm(l,p)]})})}))),Gm=(e,t)=>e?o(w,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,Jm=(e,t)=>{const{title:n,description:l,buttons:a}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(Me,{size:"text-m",color:"text-secondary-text",children:n})}):null,l?o("div",{className:"mt-2xs",children:o(Me,{size:"text-xl",color:"text-primary-text",children:l})}):null,a?.length?o("div",{className:"text-primary-main",children:Le(a)}):null]},String(t))},Zm=d((({className:e="",title:t,align:n="text-center",icon:i,button:r,visibleCellsCount:s=1,cardCells:d=[],options:m,data:h,...p})=>{const f=d.map(Jm),[x,b]=s>0?[f.slice(0,s),f.slice(s)]:[f,[]],[y,v]=l(!1);return a((()=>ce.subscribe("fold",(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:[Oe(i)?o("div",{className:"self-center",children:o(ne,{image:i})}):null,t?o(N,{className:u("pt-xs",n),headingType:"h5",title:t}):null,r?.text?o(ye,{className:"w-full mt-m mb-lg",...r}):null,b.length?o(_i,{renderFoldableSection:()=>c("div",{children:[x,o(zi,{isUnfolded:y,children:b})]}),renderFoldButton:d.length>=s?Qm(m?.parent,h,y):null}):o("div",{children:x})]})})),Qm=(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&&ce.fire("fold",{type:"fold",isUnfolded:!n,parent:e})},type:"button",...n?pe(t):{},children:[o("div",{children:n?"Скрыть":"Подробнее о тарифе"}),o(W,{className:"text-primary-text",name:n?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),eu=d((({className:e,contacts:t,info:n,version:l="secondary",...a})=>c(g,{className:u("flex",e),defaultPadding:"p-6xl",version:l,...a,children:[n?.length?tu(n):null,t?.length?tu(t):null]}))),tu=e=>o("div",{className:"flex gap-5xl grow basis-0",children:e.map(((e,t)=>nu({column:e,i:t})))}),nu=({column:e,i:t})=>e?o("div",{className:"flex flex-col gap-xl grow basis-0",children:e.map((({title:e="",description:t,additionalDescription:n,button:l},a)=>c("div",{children:[o(k,{title:e,description:t,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),n?o("div",{className:"mt-xs opacity-80",children:o(w,{size:"text-m",font:"font-light",children:n})}):null,o("div",{className:u({"mt-xl":Boolean(l?.text)}),children:Le([l])})]},String(a))))},`col-${String(t)}`):null,lu=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]})]}))),au=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const l=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(lu,{step:l,showPercentage:!1})]})})}));var iu;!function(e){e.process="IN_PROCESS",e.ok="OK",e.fail="FAILED",e.rework="REWORK"}(iu||(iu={}));const ru=d((({title:e,description:t,infoCard:n,sectionInfoTitle:l,sectionInfo:a,sectionAdditionalTitle:i,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(Ao,{interval:d}):null]}),o(su,{title:l,items:a}),o(su,{title:i,items:r,countColumns:!0}),n?.__html?o(Vo,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(ye,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),su=({title:e,items:t,countColumns:n=!1})=>{const l=Ce();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(Me,{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",vs(n||l?1:2)),children:t.map(((e,t)=>o("div",{children:ou(e)},t)))}):null]})]}):null},ou=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Me,{color:"text-secondary-text",size:"text-l",children:e}),o(Me,{color:"text-primary-text",size:"text-xl",children:t})]}),cu=d((()=>o(ru,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит.\n Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),du=d((()=>{const[e]=Vs("leadForm");return o(ru,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:e?.moneyValue?.toLocaleString()+" ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}]})})),mu=d((()=>{const[e]=Vs("leadForm");return o(ru,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),uu=d((()=>{const[e]=Vs("leadForm");return o(ru,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),hu=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],pu=d((()=>{const[e,t]=l(iu.process),[n]=Vs("taskId");return a((()=>{for(const e of hu)ca("/user-data/sendSignalToProcess","POST",{signalType:e,taskId:n});const e=setInterval((()=>(e=>ca("/user-data/getTaskStatus","POST",e))({taskId:2816419}).then((n=>{n.statusCd&&n.statusCd!==iu.process&&(clearInterval(e),t(n.statusCd))}))),3e4)}),[]),gu(e)})),gu=e=>({IN_PROCESS:o(du,{}),FAILED:o(cu,{}),OK:o(uu,{}),REWORK:o(mu,{})}[e]||null),fu={0:{moneyValue:0,monthsValue:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1},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:""},2:{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:"",inn:void 0,jobsNumber:"",lastJobExperience:"",legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},3:{familyStatus:{key:"",text:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},mandatoryIncome:void 0,otherPayments:void 0,snils:"",armyIdFlg:!1},4:{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},5:{regionRetail:"",addressRetail:"",bankEmployeeCode:""}},xu=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(Vo,{__html:e},`${t}_${n}`))):null},bu=({field:e,inputs:t})=>(t||[])?.map(ys(e,"")),yu=({sections:e,field:t})=>e?.map((({inputs:e,columns:n,title:l},a)=>c("div",{className:u(vs(n),"grid gap-x-m"),children:[xu(e),Ns(l),bu({field:t,inputs:e})]},`section-${a}`))),vu=d((({step:e,onPrevStep:t})=>{const n=0===e;return c("div",{className:"flex justify-between",children:[o(Er,{onClick:t,className:u("w-full @xl:w-auto"),type:"button",version:"secondary",disabled:n,children:"Назад"}),o(Er,{className:u("w-full @xl:w-auto"),type:"submit",children:"Далее"})]})})),Nu=e=>{const{name:t,surname:n,middleName:l,birthday:a="",phone:i="",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:b}=e;return{birthDate:xt(a,!0),midname:l,name:t,surname:n,birthPlace:o,dulIssueDate:xt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:xt(g,!0),houseTypeCd:f,participantContacts:ko({phone:bt(i),email:r}),participantAddresses:So({addressRegistration:x,addressFact:b}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}},wu=(e,t)=>{switch(e){case 1:default:return Nu(t);case 2:return(e=>{const{employment:t,organizationName:n,inn:l,legalForm:a,organization:i,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:l,organizationActivityTypeCd:s,organizationTypeCd:i,organizationKindCd:o,employeesNumberCd:r,opf:a,seniority:c,generalSeniority:m,jobsNumber:u,lastWorkDuration:d,positionCd:g,participantContacts:ko({organizationPhone:h&&bt(h)}),participantAddresses:So({organizationAddress:p})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:l,confirmationIncome:a,mandatoryIncome:i,otherPayments:r,snils:s,armyIdFlg:o}=e;return{maritalStatusCd:t,totalDependents:l,incomeCertificateCd:a,otherDependents:n,participantIncomes:(c={mandatoryIncome:i,otherPayments:r},Object.entries(c).reduce(((e,[t,n])=>t in Co?[...e,{incomeTypeCd:{key:Co[t]},value:n}]:e),[])),snils:s?.replaceAll(" ",""),armyIdFlg:o};var c})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:l,creditInRshbCd:a}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:l,creditInRshbCd:a}})(t)}},Cu=({step:e,inputs:t,onNextStep:n,saveStep:l,finishForm:a})=>{const[r]=Vs("taskId"),[s]=Vs("profileId"),[o]=Vs("participantId"),c=i((async i=>{const c=ks(Dn(ku(i,t,e)));if(!pn(c(i)))return console.warn("validation fail");l(i);try{r&&s&&o&&await Us((({participantId:e,taskId:t,profileId:n,formData:l,step:a=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:globalThis.location.origin,id:t,authorizedAgentId:l?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...wu(a,l)}]}}))({participantId:o,taskId:r,profileId:s,step:e,formData:i}))}catch(e){return"Fail"}return n(),5===e&&a?.(!0),"OK"}),[]);return{handleSubmit:c}},ku=(e,t,n)=>"BUSINESS_OWNER"!==e.positionOrganization?.key?t.map((e=>"partInBusiness"===e?.name?{...e,required:!1}:e)):e.consentPfrFlg?2===n&&"RETIREE"===e.employment?.key?[]:t:t.map((e=>"snils"===e?.name?{...e,required:!1}:e)),Su=d((({step:e,sections:t,onPrevStep:n,onNextStep:l,inputs:a,renderStep:r=yu,isFormFinished:d,finishForm:m})=>{const[u,h]=Vs("leadForm"),p=((e,t)=>(t&&(t.birthday=t.birthday?new Date(t.birthday):void 0,t.dulIssueDateField=t.dulIssueDateField?new Date(t.dulIssueDateField):void 0,t.participantDateRegistration=t.participantDateRegistration?new Date(t.participantDateRegistration):void 0,t.beginDate=t?.beginDate?new Date(t.beginDate):void 0),{...fu[e],...t}))(e,u),g=s(void 0),f=i((e=>{g.current=e}),[]),{handleSubmit:x}=Cu({step:e,inputs:a,onNextStep:l,saveStep:h,finishForm:m}),[,{field:b,onSubmit:y}]=At(p,{onSubmit:(e,t)=>{x({...e,...g.current?.(t)})}});return d?o(pu,{}):c("form",{onSubmit:y,className:"space-y-m",children:[r({sections:t,field:b,registerSubmit:f}),o(vu,{step:e,onPrevStep:n})]})})),Iu=[[],[{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:"confirmationIncome",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryIncome",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"otherPayments",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"}]}]],Tu=["","Персональные данные","Данные о трудоустройстве","Данные о доходах и расходах","Дополнительные сведения","Отделение Банка"],Bu=d((({className:e,...t})=>{const[n,a]=l(0),s=i((()=>{a((e=>Math.min(e+1,5)))}),[]),d=i((()=>{a((e=>Math.max(e-1,0)))}),[]),m=r((()=>Iu[n]),[n]),h=m?.flatMap((e=>e?.inputs))||[],p=0===n,[f,x]=l(!1);return o(g,{className:u("bg-transparent",e),defaultPadding:"p-0",...t,children:c("div",{className:"container grid grid-cols-12",children:[p||f?null:o(au,{stepsTitles:Tu,step:n,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(Su,{step:n,inputs:h,sections:m,onNextStep:s,onPrevStep:d,isFormFinished:f,finishForm:x,renderStep:p?({registerSubmit:e})=>o(Wd,{title:"Калькулятор кредита",footnote:"Расчёт является предварительным. Точные условия будут предоставлены в отделении Банка.",calcSource:{$ref:"/wcms-resources/credit-calculator-data.json"},registerSubmit:e}):void 0},String(n))})]})})})),Ru=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,Pu=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),Du=1e9,Mu={sum:{min:1e4,max:Du},period:3},_u=ht((({className:e,filtrationSchema:t={},resetButton:n,sumInput:l,periodInput:a,...i})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=Ec(Mu,{block:i.block,page:i.options?.page,normalize:e=>({...e,period:zu(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=Vu(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...i,children:[o(Pc,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(Nm,{label:l?.title,min:500,max:Du,...d("sum",{parse:e=>({min:Number(e),max:Du}),format:({min:e})=>String(e)})}),o(hl,{title:a?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(Ic,{blocksToRender:r,...i})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),zu=e=>ot((e?.paramsSource?.rateRows||[]).filter(Ru).flatMap((e=>Pu(e.minMonths,e.maxMonths)))),Vu=e=>ot(e.flatMap((e=>e||[])).filter(Ru).flatMap((e=>Pu(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],Au=[{key:"10"},{key:"50"},{key:"100"}],Eu=({itemCount:e,onItemCountChange:t})=>{const n=i((({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(cn,{className:"min-w-20",onChange:n,value:{key:String(e)},options:Au,iconVersion:"black"})]})},Fu="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",Ou=(e,t)=>{const{currentPage:n,onPageChange:l,totalPages:a}=e,i=t+1;return i===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:i},String(t)):1!==i&&i!==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))(i,n,a)?o("div",{onClick:()=>l(i),className:Fu,"aria-label":`Страница ${i}`,children:i},String(t)):null},Lu={width:"24",height:"24"},$u=({currentPage:e,onPageChange:t,totalPages:n})=>{const l=r((()=>Array.from({length:n}).fill({currentPage:e,onPageChange:t,totalPages:n})),[n,e]),a=i((()=>{e>1&&t(e-1)}),[e]),s=i((()=>{e<n&&t(e+1)}),[e,n]),d=i((()=>t(1)),[]),m=i((()=>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:ju(1===e),...Lu})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:Fu,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,l.map(Ou),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:Fu,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(W,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:ju(e===n),...Lu})})]})},ju=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",qu=({currentPage:e,onPageChange:t,totalPages:n,itemCount:l,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($u,{currentPage:e,onPageChange:t,totalPages:n}),l&&a?o(Eu,{itemCount:l,onItemCountChange:a}):null]}),Uu=d((({className:e,value:t,autoFocus:n,onChange:l,onFocus:a,placeholder:r="Поиск по сайту"})=>{const s=i((e=>{l&&l(e.target?.value||"")}),[l]);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",Wt),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:n,onChange:s,onFocus:a})]})})),Wu=d((({field:e,onClearFilter:t,filtrationState:n})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(Uu,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(Xl,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(Xl,{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(Er,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),Hu=({title:e,timestamp:t,publicId:n})=>{const l=ue(),{href:a}=l({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:[null,c("div",{className:"flex flex-col gap-x-6xl lg:flex-row lg:items-center",children:[t?o(Me,{size:"text-m","font-weight":"font-light",children:xt(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:a,download:!0,"aria-label":"Скачать",children:e})]})]},n)},Yu="/api/v1/depository",Ku={startDate:void 0,endDate:void 0,query:""},Xu=ht((({className:e,...t})=>{const[n,a]=l(0),[r,s]=l(10),[d,{field:m,reset:h}]=At(Ku),{totalPages:p=0,items:f=[]}=(({size:e,page:t,query:n,startDate:l,endDate:a})=>{const i=l?xt(l,!0):"",r=a?xt(a,!0):"",s=new URLSearchParams(Yu);s.set("page",String(t)),s.set("size",String(e)),s.set("query",n),s.set("timestampStart",i),s.set("timestampEnd",r);const o=`?${s.toString()}`,{data:c}=$n(Yu+o,st);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:n,...d}),x=i((e=>a(e-1)),[]),b=i((e=>{r!==e?(s(e),a(0)):s(e)}),[]);return c(g,{className:u(e,"container p-6xl"),...t,children:[o(Wu,{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(Me,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(Me,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),f.length?f.map((e=>o(Hu,{...e},String(e.publicId)))):o(Lo,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(qu,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:b})]})]})})),Gu=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,Ju=d((({className:e="",title:t,description:n,error:l,button:a,...i})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...i,children:[o("div",{className:"flex justify-center",children:Gu(l)}),o(k,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),a?.text?o(ye,{version:a?.version,text:a?.text,...a}):null]}))),Zu="location";function Qu(e="Москва"){const[t,n]=((e,t,n)=>{const[r,s]=l(n||null);return a((()=>e.subscribe(t,(e=>s(e)))),[e,t]),[r,i((n=>e.fire(t,n)),[e,t])]})(ce,"location",th()??{name:e}),r=i((e=>{nh(e),n(e)}),[]),{data:s}=$n(eh()?null:"/api/v1/region",st);return a((()=>{s&&!eh()&&n(s)}),[s]),[t??{name:e},r]}const eh=()=>Boolean(globalThis.localStorage?.getItem(Zu)),th=()=>{try{const e=globalThis.localStorage?.getItem(Zu);return e&&JSON.parse(e)}catch(e){return null}},nh=e=>{try{globalThis.localStorage?.setItem(Zu,JSON.stringify(e))}catch(e){}};var lh;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(lh||(lh={}));const ah=new Intl.NumberFormat("ru",{style:"currency",currency:lh.RUB}),ih=e=>e?ah.format(e):"",rh="text-m font-light text-secondary-text ",sh=`${rh} text-left`,oh=`${rh} pl-5xl text-center`,ch=`${rh} pl-5xl text-right`,dh={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},mh=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:sh,children:o(Me,{size:"text-m",children:"Валюта"})}),o("th",{className:oh,children:o(Me,{size:"text-m",children:"Купить"})}),o("th",{className:ch,children:o(Me,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(uh)})]}))),uh=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:dh[t]},width:"24",height:"24"}):null,o(Me,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(Me,{size:"text-h6",children:ih(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(Me,{size:"text-h6",children:ih(e?.buyExchangeRate)})})]},t)},hh={icon:"GpsIcon"},ph=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(Uc,{...hh,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(w,{size:"text-l",color:"text-primary-main",children:t}):null,o(w,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),gh=(e,t,n)=>{const l=Number(fh(e))*Math.pow(t,n?-1:1);return Number.isInteger(l)?l:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(l)},fh=e=>e.replace(/[^\d.,]/g,"").replace(",","."),xh=e=>Rt([[e=>e.value!==lh.RUB&&e.oppositeValue!==lh.RUB,()=>e.handleConvert(e.value,lh.RUB)],[e=>e.value===lh.RUB&&e.oppositeValue===lh.RUB,()=>e.handleConvert(e.value,lh.USD)],[e=>e.value===lh.RUB&&e.oppositeValue===lh.RUB,()=>e.handleConvert(e.value,lh.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function bh(e){const{placeholder:t,rates:n,selected:l,value:a,setValue:i,setSelected:r}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:l,text:l};return c("div",{className:"relative flex",children:[o(Yt,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:a,onChange:i}),s.length?o(cn,{className:"absolute right-0",isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const yh=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:a})=>{const[r,s]=l({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||lh.RUB,selectBuy:n?.[0]?.currency?.currency||lh.USD}),d=i((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:[bh({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:vh(r,d,n),value:r.inputSell,setValue:e=>wh(d,n)(e,r.selectSell,r.selectBuy)}),bh({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:Nh(r,d,t),value:r.inputBuy,setValue:e=>Ch(d,t)(e,r.selectBuy,r.selectSell)})]}):null,a?.text?o(ye,{text:a.text,version:a?.version,...a}):null]})})),vh=(e,t,n)=>l=>{t({selectSell:l}),xh({value:l,oppositeValue:e.selectBuy,handleConvert:(l=e.selectSell,a=e.selectBuy)=>{wh(t,n)(e.inputSell,l,a)}})},Nh=(e,t,n)=>l=>{t({selectBuy:l}),xh({value:l,oppositeValue:e.selectSell,handleConvert:(l=e.selectBuy,a=e.selectSell)=>Ch(t,n)(e.inputBuy,l,a)})},wh=(e,t)=>(n,l,a)=>{e({inputSell:fh(n),selectBuy:a});const i=t.find((e=>e.currency?.currency===a))?.buyExchangeRate||t.find((e=>e.currency?.currency===l))?.buyExchangeRate;i&&e({inputBuy:String(gh(n,i,l===lh.RUB)||"")})},Ch=(e,t)=>(n,l,a)=>{e({inputBuy:fh(n),selectSell:a});const i=t.find((e=>e.currency?.currency===a))?.saleExchangeRate||t.find((e=>e.currency?.currency===l))?.saleExchangeRate;i&&e({inputSell:String(gh(n,i,l===lh.RUB)||"")})};const kh=d((({className:e="",title:t="Курсы обмена валют",button:n,...l})=>{const[a]=Qu(),i=function(e){const t=e?.code||"000",{data:n}=$n(`/api/v1/exchangerates?regionCode=${t}`,st);return n||{}}(a),r=Sh(i?.exchangeRate?.currencies),s=r.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:lh.RUB}});const d=r.filter((e=>e.saleExchangeRate));return d.push({currency:{currency:lh.RUB}}),o(g,{className:u("box-border min-h-80",e),...l,children:o(Ie,{className:"h-full",title:o(N,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap @lg:flex-nowrap",children:[c("div",{className:"w-full @2xl:w-auto @5xl:w-1/2",children:[r?o(mh,{className:"mb-xl",exchangeCurrencyItems:r}):null,o(ph,{address:i?.address})]}),o(yh,{className:"grow w-1/2",currencyRatesBuy:s,currencyRatesSell:d,button:n})]})})})})),Sh=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],Ih=d((({className:e="",items:t})=>{const n=ue();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(Th(n))})})),Th=e=>({dataFooter:t,...n},l)=>{const{text:a,href:i,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:i,target:r||"_self",onClick:s,...pe(t),children:a||null})},String(l)):null},Bh=e=>t=>!t.displayArea||e.includes(t.displayArea.toLowerCase()),Rh=["all","footer"],Ph=d((({className:e,navigationItems:t})=>{const n=ue();return o("div",{role:"menu",className:u("w-full flex items-start justify-between flex-col md:flex-row gap-y-m lg:order-2",e),children:t?.filter(Bh(Rh)).map(n).map(Dh)})})),Dh=(e,t)=>{const{text:n,items:l=[],href:a,target:i="_self",onClick:r,dataFooter:s}=e,d=l.filter(Bh(Rh));return c("div",{role:"menuitem",className:"flex flex-col gap-s w-full @md:w-1/4",children:[o("a",{className:"leading-5 text-l text-primary-text hover:text-primary-main no-underline",href:a,target:i,onClick:r,...pe(s),children:n}),d?o(Ih,{items:d}):null]},String(t))},Mh=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(_h)}):null)),_h=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(Me,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(zh)})]},String(t)),zh=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Vh(e.type,e.text)}),o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Vh=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Ah(t)}`,children:o(Me,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(w,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},Ah=e=>e.replaceAll(/\D/g,""),Eh=d((({className:e="",index:t,text:n,...l})=>{const a=ue(),{href:i,target:r,onClick:s}=a(l);return o("a",{className:u("text-secondary-text",e),href:i,target:r,onClick:s,children:n||`Документ ${t}`})})),Fh=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(Me,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(Eh,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),Oh="w-full lg:w-52";function Lh(e,t,n=300){a((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}const $h=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:l,s2Matches:a}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),l=Array.from({length:e.length}),a=Array.from({length:t.length});let i=0;for(let r=0;r<e.length;r++){const s=Math.max(0,r-n),o=Math.min(r+n,t.length-1);for(let n=s;n<=o;n++)l[r]||a[n]||e[r]!==t[n]||(i++,l[r]=!0,a[n]=!0)}return{m:i,s1Matches:l,s2Matches:a}}(e,t);if(0===n)return 0;const i=function(e,t,{s1Matches:n,s2Matches:l}){let a=0;for(let i=0,r=0;i<e.length;i++){if(!n[i])continue;let s=r;for(;s<t.length;s++)if(l[s]){r=s+1;break}e[i]!==t[s]&&a++}return a}(e,t,{s1Matches:l,s2Matches:a}),r=(n/e.length+n/t.length+(n-i/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 jh=(e,t)=>(n,l)=>{for(const[a,i]of l)n.set(a,e(n.get(a)||t,i));return n},qh=(e=[])=>e.reduce(((e,t)=>e+t),0),Uh=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),Wh=e=>t=>e.map((([e,n])=>[$h(t)(e),n])).filter((([e])=>e>=.8)).map((([e,t])=>Yh(t,e))).reduce(jh(Math.max,0),new Map),Hh=e=>t=>{return _c(t,t.map((({title:e})=>e)).map((e=>t=>{const n=Uh(t||"");return n.length?qh(e.map((e=>tc(n.map($h(e)))))):0})(e))).sort((l=([,e])=>e,n=(e,t)=>l(e)-l(t),(e,t)=>-n(e,t))).map((([e])=>e));var n,l},Yh=(e,t)=>new Map(e.map((e=>[e,t]))),Kh=({basePathList:e,initialQuery:t=""})=>{const[n,i]=l(t||"");a((()=>{null!=t&&i(t)}),[t]);const{data:r}=$n(e?.length?e:null,Xh),[s,o]=l(null);return Lh((()=>{r&&o(r.map((e=>t=>{const{corpus:n,dictionary:l}=t||{};if(!(e&&n?.length&&l&&Object.keys(l).length))return[];const a=Uh(e);if(!a.length)return[];const i=Object.entries(l),r=[...a.map(Wh(i)).reduce(jh(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*a.length)).map((([e])=>n[e]));return Hh(a)(r)})(n)))}),[r,n]),[s,{value:n,onChange:i}]},Xh=async(...e)=>(await Promise.allSettled(e.map((e=>rt(F(e,"/","search.index.json")))))).map((e=>"fulfilled"===e.status?e.value:{})),Gh=d((({initialQuery:e,navigationItems:t})=>{const n=r((()=>t?.map((e=>e.href||"/"))),[t]),[l,a]=Kh({basePathList:n,initialQuery:e}),i=r((()=>Jh(t)(l)),[t,l]);return o(pa,{head:o(Uu,{autoFocus:!0,...a}),children:o(Ph,{navigationItems:i})})})),Jh=e=>t=>e?.length&&t?.length?_c(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:F("/",t)})))}))):[],Zh=(e={})=>{const{open:t,close:n}=de();return{open:(n={},l={})=>t(o(Gh,{...e,...n}),l),close:n}},Qh=d((({className:e,search:t,...n})=>{const[a,r]=l(""),s=i((()=>r("")),[]),d=Zh(n),m=i((e=>{r(e),ep(e)&&d.open({initialQuery:e},{onClose:s})}),[s,d]);return c("div",{className:u("relative",e),role:"search",children:[o(Uu,{value:a,placeholder:t?.placeholder,onChange:m}),o(ha,{className:"absolute top-0 right-0 sm:hidden",onClose:s})]})})),ep=e=>e&&e.length>=3,tp=(e,t)=>{const{logo:n}=e??{},{dataHeader:l,dataFooter:a,...i}=n??{};return c("div",{className:"flex items-stretch gap-3xl",children:[o(Gs,{className:Oh,logo:i,data:a,showTitle:!1}),o(Qh,{className:"grow",navigationItems:t,...e})]})},np=d((({className:e="",index:t,...n})=>{const l=ue(),{href:a,target:i,text:r,onClick:s}=l(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:i,onClick:s,children:r||`Документ ${t}`})})),lp=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(Me,{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(np,{index:t,...e},String(t))))}):null]}))),ap=ht((({className:e,footer:t,...n})=>{const{navigationItems:l}=n.options?.page?.navigation??{},a=n.options?.page?.common??{},{documents:i,relatedEnterprises:r,contacts:s,mediaLinks:d=[],horizontalNavigationTitle:m,feedbackButton:h,license:p,otherLinks:f=[]}=t??{};return c(g,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...n,children:[tp(a,l),c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(Ph,{navigationItems:l}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u(Oh,"flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(Mh,{items:s}),h?o(ye,{className:"w-full",version:"primary",...h}):null,d.map(((e,t)=>o(Hm,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),f.map(((e,t)=>o(ye,{className:"!text-left text-s font-light",version:"link",...e,children:e?.text},String(t))))]})]}),o(Fh,{title:m,links:r}),o(lp,{links:i,license:p})]})})),ip=d((({className:e="",title:t,description:n,calendar:l,...a})=>c(g,{className:u("space-y-m",e),defaultPadding:"p-6xl",...a,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0}),l?rp(l):null]}))),rp=e=>{const t=100/(e.reduce(((e,t)=>t?.month?.length?e+t.month.length:e),0)||1),n=e.filter((e=>e?.month?.length)).map((e=>({...e,flexBasis:`${e?.month?.length?e.month.length*t:""}%`})));return c("div",{className:"w-full flex flex-col justify-center gap-s",children:[o("div",{className:"flex w-full text-h6 text-center",children:n.map((e=>sp(e,t)))}),o("div",{className:"flex gap-s w-full",children:n.map(((e,t)=>c("div",{className:"border-r border-main-divider last:border-r-0 space-y-s",style:{flexBasis:e.flexBasis},children:[o("div",{className:"flex gap-s",children:op(e)}),c("div",{className:"text-s",children:[o(Me,{size:"text-s",font:"font-light",color:"text-primary-text",children:e.text})," ",o(Me,{size:"text-s",font:"font-light",color:"text-primary-main",children:e.greenText})]})]},`monthItem-${t}`)))})]})},sp=(e,t)=>e.month?.map(((e,n)=>o("div",{style:{flexBasis:`${t}%`},children:e.text},`monthName-${n}`))),op=e=>e.month?.map((e=>e.image?.src?o("div",{className:"h-52 border-r pr-s border-main-divider last:border-r-0",children:o(ne,{image:e.image,className:"flex"})},`monthImage-${e.image.src}`):null)),cp=ht((({className:e,title:t,button:n,regionSource:a,data:i,...r})=>{const[s,d]=l({key:""}),m=a?.regions??[],h=oe({className:"text-white",version:n?.version||"primary"}),p=m?.find((e=>e.name===s.key))?.href,f=n?.text?n.text:"Перейти";return o(g,{className:e,defaultPadding:"p-6xl",...r,children:c("div",{className:"container max-w-[978px] space-y-m",children:[t?o(N,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(hn,{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(ye,{href:p,target:"_blank",className:u("p-m w-full @xl:w-auto",h),data:qm(i,s?.key),children:f})}):null]})})}));function dp(e=[]){const t=D(),n=Array.from(e.entries()).filter((([,e])=>mp(t)(e)));return n.find((([,e])=>mp(t,!0)(e)))??n[n.length-1]??[]}const mp=(e,t=!1)=>({href:n})=>{if(!n)return!1;const l=E(up(e)(n));return t?l===E(n):l.startsWith(E(n))},up=e=>t=>{const n=G(X.SITE_URL);return z(t)?e.href:F(n,e.pathname)},hp=d((({className:e="",items:t,activeItem:n,ariaLabel:l="Меню"})=>{const[r,{setFalse:d,toggle:m}]=Lt(!1),h=jt(d),p=s(null),g=i((({isOpened:e,buttonRef:t,menuRef:n})=>{if(e&&t.current&&n.current){const e=n.current.getBoundingClientRect(),l=t.current.getBoundingClientRect(),a=globalThis.innerWidth-e.width;e.right>=globalThis.innerWidth?n.current.style.left=`${a}px`:l.left>e.left&&(a>l.left?n.current.style.left="":n.current.style.left=`${a}px`)}}),[r]);return $t(globalThis,"resize",(()=>g({isOpened:r,buttonRef:h,menuRef:p}))),a((()=>{g({isOpened:r,buttonRef:h,menuRef:p})}),[r]),c("div",{className:u(r?"rounded-md shadow-blue-gray":"",e),ref:h,role:"navigation",children:[o("button",{type:"button",className:"group/btn flex justify-between items-center h-6","aria-label":l,onClick:m,role:"button","aria-labelledby":"labeldiv",children:Array(3).fill(null).map(((e,t)=>o("div",{className:"w-[3px] h-[3px] rounded mr-2xs bg-primary-text group-hover/btn:bg-primary-hover group-data-transparent:bg-white"},String(t))))}),o("div",{ref:p,className:u("absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56 z-40",{hidden:!r}),"aria-hidden":!r,children:gp(t,n)})]})})),pp=d((({isActive:e,...t})=>{const n=ue(),{text:l,href:a,target:i,onClick:r}=n(t);return o("a",{className:u("text-l font-light pb-m hover:text-primary-main",{"text-primary-main":e}),href:a,target:i,onClick:r,role:"link",...pe(t?.data),children:l})})),gp=(e,t)=>e?.map(((e,n)=>o(pp,{isActive:e===t,...e},e?.text??String(n)))),fp={default:"w-6 h-6",large:"w-12 h-12"},xp=d((({className:e,isRounded:t,buttonSize:n="default",isGrayBg:l=!1,disabled:a,ariaLabel:i="Меню второго уровня",image:r,data:s,onClick:c,version:d})=>o("button",{className:u("group/btn border-0 flex shrink-0 items-center",l?"p-s rounded-full":"p-0 bg-inherit","transparent"===d?"backdrop-opacity-30 bg-white/30":l&&!t?"bg-main-divider":"",t?"w-8 h-8 text-secondary-light hover:text-secondary-hove":`${fp[n]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:a,"aria-label":i,onClick:c,...pe(s),children:o(ne,{image:r,className:u("h-full",{"bg-main-divider/20 rounded-full":t}),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),bp="chatbot",yp="text-page__btn-chat",vp={personal:"//chat.mes.rshb.ru/assets/js/webchat_rshb",business:""},Np=d((({chat:e="personal",iconVersion:t,className:n,ariaLabel:l="Чат",version:i})=>{const r=(e=>{a((()=>globalThis.localStorage?.setItem("webchat-keep-open",String(Date.now()))),[]);const t=vp[e??""];return n=>{if(t)if("personal"!==e)wr(bp,t);else{const e=n.target;e?.classList.contains(yp)||e?.classList.add(yp),document.getElementById("webchat-js-container:webchat_rshb")||wr(bp,t)}}})(e);return o(xp,{className:n,image:{icon:"HeadphonesIcon",iconVersion:t},ariaLabel:l,onClick:r,buttonSize:"large",isGrayBg:!0,version:i})})),wp=d((({className:e="",active:t,dataItemName:n,children:l,data:a,...i})=>{const r=ue(),{href:s,target:d,text:m,onClick:h}=r(i);return c("a",{className:u("relative inline-block bg-transparent text-center no-underline",e),href:s,target:d,"data-item-name":n,onClick:h,...pe(a),children:[o("span",{className:Cp(t),children:m||l}),t?o("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-white"}):null]})})),Cp=(e=!1)=>u("font-sans text-l lg:font-light",e?"text-primary-main":"text-primary-text hover:text-primary-main","group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),kp=d((({observerOptions:e,onVisibilityChange:t,children:n,className:l,...a})=>{const r=qo(i((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e);return o("span",{ref:r,className:l,role:"menuitem",children:o(wp,{...a,children:n})})})),Sp={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"},Ip=d((({version:e,text:t,mobileText:n,...l})=>{const a=Ce()?n:t;return a?o(ye,{className:u("py-s px-lg font-light whitespace-nowrap",Sp["transparent"===e?"transparent":"default"]),...l,children:a}):null})),Tp=d((({subItems:e=[],version:t,internetBankButton:n,dropdownMenuAriaLabel:a,chatBotAriaLabel:i})=>{const d="transparent"===t?"white":"black",[,m]=dp(e),[u,h]=l(e.length),p=e.slice(u),g=s(null),f={rootRef:g},x=r((()=>e.map(((e,t)=>e=>{h(e?Bp(t):Rp(t))}))),[e]);return c("nav",{className:"mt-s flex gap-s items-center justify-between",children:[o("div",{ref:g,className:"overflow-hidden whitespace-nowrap pb-s mt-xs space-x-lg",role:"menu",children:e.map(((e,t)=>o(kp,{className:u-1<t?"invisible":"",active:e===m,observerOptions:f,onVisibilityChange:x[t],data:e.dataHeader,...e},String(t))))}),p.length?o(hp,{items:p,activeItem:m,ariaLabel:a}):null,_.CHAT_BOT?o(Np,{version:t,iconVersion:d,chat:_.CHAT_BOT,ariaLabel:i}):null,o(Ip,{version:t,...n})]})})),Bp=e=>t=>Math.max(t,e+1),Rp=e=>t=>Math.min(t,e),Pp=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(Me,{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(Dp,{...e},String(t))))})]}):null,Dp=d((({icon:e,...t})=>{const n=ue(),{text:l,target:a,href:i,onClick:r}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ne,{image:e}):null,l?o("a",{className:"hover:text-primary-hover",href:i,target:a,onClick:r,children:o(Me,{size:"text-l",font:"font-light",color:"text-primary-text",children:l})}):null]})})),Mp=(e,t)=>n=>n.name?o(Um,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:qm(e,n.name),children:o(Me,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,_p=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(Wt,"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"})]}))),zp=d((({foreignOffices:e,branches:t})=>{const[n,a]=Qu(t?.default),r=ue(),{href:s}=r({href:`/branches/${n.slug}`}),[d,m]=l(""),u=Ap(Pi()).sort(((e,t)=>e.name.localeCompare(t.name))),h=((e,t)=>{const n=new Map;for(const l of e){const e=t(l),a=n.get(e)||[];n.set(e,[...a,l])}return n})(u,Vp),{close:p}=de(),g=i((e=>{a(e),p()}),[]);return c(pa,{className:"pb-20",head:c("div",{children:[o(Me,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),n?o("div",{className:"mb-s",children:c(w,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(Um,{href:s,className:"inline mx-2xs text-primary-main",children:n.name})]})}):null,o(_p,{onSearch:m,searchTerm:d})]}),children:[d&&d.length>=3?o("div",{children:u.filter((({name:e})=>e&&$h(e.toLowerCase())(d.toLowerCase())>=.8)).map(Mp(t?.dataSelect,g))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(h.entries()).map((f=g,x=t?.dataSelect,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(Me,{size:"text-h6",children:e})}),t.map(Mp(x,f))]},e)))}),Pp(e)]});var f,x})),Vp=e=>e.name?.charAt(0)||"",Ap=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()||""}))),Ep=d((({className:e="",active:t,flat:n,children:l,data:a,...i})=>{const r=ue(),{href:s,target:c,text:d,onClick:m}=r(i);return o("a",{className:u(Fp(t,n),e),href:s,target:c,onClick:m,rel:"noopener noreferrer","aria-label":`Ссылка на ${d}`,...pe(a),children:o("span",{suppressHydrationWarning:!0,className:Op(t,n),children:d||l})})})),Fp=(e=!1,t=!1)=>u("inline-block border border-solid bg-transparent text-center no-underline",e?"rounded-md border-primary-main group-data-transparent:border-white":"border-transparent",{"px-m py-xs":!t}),Op=(e=!1,t=!1)=>u("font-sans text-s font-light",e?"text-primary-main":u(t?"text-primary-text":"text-secondary-text","hover:text-primary-main"),"group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),Lp=d((({className:e,version:t,...n})=>{const l="transparent"===t?"white":"black",[a]=Qu(n?.branches?.default),r=Zh(n),s=(e=>{const{open:t,close:n}=de();return{open:(n={})=>t(o(zp,{...e}),n),close:n}})(n),d=i((()=>r.open()),[r]),m=i((()=>s.open()),[s]);return c("div",{className:u("flex items-center ml-5 md:max-w-[300px] xl:max-w-full gap-lg",e),role:"navigation",children:[n?.branches?.visible?o(Ep,{className:"whitespace-nowrap text-ellipsis overflow-hidden",flat:!0,href:"#",text:a?.name,data:qm(n?.branches?.dataClick,a?.name??""),onClick:m}):null,n?.officesAtms?.href?o(Ep,{className:"whitespace-nowrap",flat:!0,...n.officesAtms}):null,o(xp,{image:{icon:"LoupeIcon",iconVersion:l},ariaLabel:n?.search?.ariaLabel??"Поиск",onClick:d,data:n?.search?.data})]})})),$p=d((({observerOptions:e,onVisibilityChange:t,children:n,className:l,...a})=>{const r=qo(i((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e);return o("span",{ref:r,className:l,role:"menuitem",children:o(Ep,{...a,children:n})})})),jp=d((({navigationItems:e=[],activeTopItem:t,dropdownMenuAriaLabel:n,version:a,headerData:i,search:d,bgColor:m,logo:u})=>{const[h,p]=l(e.length),g=e.slice(h),f=s(null),x={rootRef:f},b=r((()=>e.map(((e,t)=>e=>{p(e?qp(t):Up(t))}))),[e]),{dataFooter:y,dataHeader:v,...N}=u??{};return c("div",{className:"flex items-center justify-between",children:[o(Gs,{className:"mr-3xl",bgColor:m,logo:N,data:v,showTitle:!1}),o("div",{ref:f,className:"overflow-hidden min-w-[160px] pb-xs mt-xs",role:"menu",children:e.map(((e,n)=>o($p,{className:h-1<n?"invisible":"",active:e===t,observerOptions:x,onVisibilityChange:b[n],data:e.dataHeader,...e},String(n))))}),g.length?o(hp,{className:"mx-xs",items:g,activeItem:t,ariaLabel:n}):null,o(Lp,{version:a,className:"ml-auto",search:d,navigationItems:e,...i})]})})),qp=e=>t=>Math.max(t,e+1),Up=e=>t=>Math.min(t,e),Wp={"bg-white":"primary",transparent:"transparent"},Hp=["all","header"],Yp=ht((({className:e,bgColor:t="bg-white",logo:n={},version:l=Wp[t],portal:a,header:i={},...r})=>{const{common:s,navigation:d}=Xp(r?.options?.page),{navigationItems:m}=d,{logo:h={}}=s,[,p]=dp(m),{internetBankButton:f}=a||{},x=n.image?.icon||n.image?.src||n?.title?n:h;return o(g,{tag:"header",className:u("pt-m px-20",p?.items?.length?"pb-m":"pb-lg",e),defaultPadding:"",version:l,...r,children:c("div",{className:"container",children:[o("div",{className:"whitespace-nowrap",children:o(jp,{activeTopItem:p,navigationItems:m?.filter(Bh(Hp)),version:l,headerData:{...i,...d},search:s.search,bgColor:t,logo:x})}),o("div",{className:u("mt-s h-px bg-main-divider",Kp(l))}),p?.items?.length&&o(Tp,{subItems:p?.items?.filter(Bh(Hp)),version:l,internetBankButton:f})]})})})),Kp=e=>"transparent"===e?"opacity-30":"",Xp=e=>({navigation:e?.navigation??{},common:e?.common??{}}),Gp=(e=!1)=>e?{}:{padding:"p-0"},Jp={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},Zp=ht((({className:e="",padding:t="p-0",gap:n="XS",isInnerPadding:l=!0,version:a="transparent",isTheme:i=!1,isCardBorder:r,...s})=>o(g,{className:u("relative","grid grid-cols-12",Jp[n],e),padding:t,version:a,isTheme:i,...s,children:P({...s,extraProps:{...Gp(l),className:$o(r)}})})),{childrenTypes:{exclude:["HorizontalLayout"]}}),Qp=d((e=>{const{className:t,align:n,image:l,...a}=e,i=n?u("flex",Jc[n]):"";return o(g,{className:u(i,t),defaultPadding:"p-0",...a,children:o(ne,{image:l})})})),eg=(e,t=0)=>{const{itemCount:n,visibleItemCount:a}=e,[r,s]=l(t),o=i((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=i((()=>s((e=>Math.max(e-1,0)))),[n]),d=a?n>a&&r<n-a:r<n-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]};function tg({dec:e,inc:t,canDec:n,canInc:l,btnClass:a,className:i=""}){return n||l?c("div",{children:[n?o(dc,{className:u("absolute z-40",a[0],i),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!n}):null,l?o(dc,{className:u("absolute z-40 rotate-180",a[1],i),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!l}):null]}):null}const ng=d((({className:e="",cards:t=[],button:n})=>{const[a,r]=l(0),s=i((e=>r(e)),[]),d=t.length,[m,u]=eg({itemCount:d,visibleItemCount:2}),{canDec:h,canInc:p}=u,g=t[m]?.href;return c("section",{role:"listitem",className:`min-w-full text-center ${e}`,children:[c("div",{className:"relative overflow-hidden","aria-label":"Страховые программы",children:[d?lg({activeIndex:m,cards:t,selectedCardIndex:a,onClick:s}):null,tg({...u,btnClass:["left-12","right-12"],className:"top-16"}),h?o("div",{className:"absolute top-0 left-0 h-full w-32 bg-opacity-from-white"}):null,p?o("div",{className:"absolute top-0 right-0 h-full w-32 bg-opacity-to-white"}):null]}),o(ye,{className:"w-60 text-center",version:"primary",...n,href:g})]})}));function lg({activeIndex:e,cards:t,selectedCardIndex:n,onClick:l}){const a=460*e,i=t.length>2?"justify-start":"justify-center";return o("div",{style:{transform:`translateX(-${a}px)`},className:"duration-1000 px-6xl",children:o("div",{className:`w-full flex flex-nowrap gap-s pb-6xl ${i}`,children:t.map(((e,t)=>function({slide:e,i:t,isActive:n,onClick:l}){return c("button",{type:"button",onClick:l,className:"p-3xl min-w-fit flex items-center gap-2xl bg-white border-solid border relative "+(n?"shadow-dark-blue border-primary-main":"ease-in duration-300 border-gray"),children:[e?.icon?o(ne,{className:"p-lg rounded-full bg-secondary-light",image:e.icon,width:"108",height:"108"}):null,c("div",{className:"flex gap-s",children:[e?.sum?ag("страховая сумма",e.sum):null,e?.fee?ag("страховой взнос",e.fee):null]}),ig(n)]},String(t))}({slide:e,i:t,isActive:Boolean(t===n),onClick:()=>l(t)})))})})}function ag(e,t){return c("div",{className:"flex flex-col text-left whitespace-pre",children:[c(Me,{size:"text-h6",children:[Ue(2)(t)," ₽"]}),o("div",{className:"mt-2xs",children:o(Me,{size:"text-l",color:"text-secondary-text",children:e})})]})}function ig(e){return e?o(ne,{className:"h-6 w-6 min-w-6 min-h-6 absolute right-4 top-4",image:{icon:"DoneIcon"},width:"24",height:"24"}):null}const rg=d((({className:e="",title:t,insuranceTabs:n=[],button:a,...r})=>{const[s,d]=l(0),m=i((e=>d(e)),[]);return c(g,{className:u("box-border overflow-hidden relative px-0 space-y-2xl",e),defaultPadding:"p-6xl",...r,children:[t?o(N,{className:"text-center",title:t,headingType:"h3"}):null,n?.length>1?o("div",{className:"p-xs bg-secondary-light w-fit mx-auto rounded-md",children:n.map(((e,t)=>function({title:e,i:t,isActive:n,onClick:l}){return o("button",{type:"button",onClick:l,"aria-label":`Кнопка ${e}`,className:"box-border px-m py-s text-m font-light "+(n?"bg-primary-main text-white rounded-md":"text-secondary-text"),children:e},String(t))}({title:e?.title,i:t,isActive:Boolean(t===s),onClick:()=>m(t)})))}):null,o("div",{className:"flex",style:{transform:`translateX(-${s}00%)`},role:"list",children:sg({insuranceTabs:n,button:a})})]})})),sg=({insuranceTabs:e,button:t})=>{const n=e?.map((e=>e.cards));return n?.length?n.map(((e,n)=>o(ng,{button:t,cards:e},String(n)))):null};const og={yellow:"bg-yellow",green:"bg-green","green-light":"bg-green-light","green-dark":"bg-green-dark"},cg={XS:"h-10",S:"h-16",M:"h-24",L:"h-32",XL:"h-52"},dg=d((e=>{const{className:t="",__html:n,isDotted:l,investmentZeroColumn:a,investmentColumns:i,...r}=e,s=i?[...i]:[];return a&&s.unshift(a),o(g,{className:t,defaultPadding:"p-4xl",...r,children:c("div",{className:"container text-m font-light space-y-4xl",children:[s?.length?c("div",{children:[c("div",{className:"flex items-end relative pl-3xl pr-lg text-white",children:[Bc(o("div",{className:"w-px h-4 bg-gray"}))(s.map(mg)),o("div",{className:"absolute right-3xl w-px h-4 bg-gray"})]}),o("div",{className:"border-t border-gray -mt-xs mx-3xl"}),o("div",{className:"flex justify-between text-primary-text mt-s -mx-5xl",children:s.map(pg)})]}):null,n?o("div",{className:"max-w-2xl font-light text-base",children:o(Pe,{__html:n,isDotted:l,itemSize:"list-s"})}):null]})})})),mg=(e,t,n)=>{const l=1===t,a=t===n.length-1,i=e.cells?.reverse()||[];return o("div",{className:`${ug(l,a,e.cells)}`,children:i.length?o("div",{className:"w-full "+(a?"border-4 border-green-more-dark p-1.5 min-w-72":""),children:i.map(hg)}):null},`column_${t}`)},ug=(e,t,n=[])=>[n.length?"flex-1":"flex-0",!n.length||e||t?"":"pl-s",n.length&&!t?"pr-s pb-3xl":"pb-xl"].join(" "),hg=(e,t)=>{const n=e.cellSize||"XS",l=e.cellColor||"green";return e.text?o("div",{className:`flex-1 flex items-center justify-center relative py-xs ${cg[n]} ${og[l]} ${"XS"===n?"px-s":"px-5xl"}`,children:o(Me,{align:"text-center",children:e.text})},`cell_${t}`):null},pg=(e,t)=>e?.title?o("div",{className:"flex-1 max-w-44 text-center px-xs last:pr-4xl last:max-w-52",children:e.title},`title_${t}`):null,gg=["байт","Кб","Мб","Гб","Тб","Пб"],fg=d((({icon:e,text:t,href:n,target:l,fileFormat:a,data:i,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:l,...pe(i),children:[e,t?c(Me,{size:"text-l",font:"font-light",children:[t," ",xg(d,m),o(Me,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),xg=(e,t)=>e||t?o("span",{children:", "}):"",bg=(e,t)=>(n,l)=>{const a=q(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),i="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))} ${gg[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?vg(a):n?.fileFormat;return c("div",{role:"listitem",children:[o(fg,{text:n?.text,target:n?.target,href:a,fileFormat:r,fileSize:i,icon:yg(t),data:n?.data}),o(Pe,{__html:n?.__html})]},String(l))},yg=e=>e?o(ne,{className:"min-w-6 min-h-6",image:e,width:"24",height:"24"}):null,vg=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),l=-1!==t?e.substring(t+1):"";return l.includes("/")?l.replace(n,""):l},Ng=d((({href:e,__html:t,target:n})=>{const{close:l}=de(),a=D(),r=q(a)(e),s=i((()=>{l()}),[]);return c(pa,{className:"my-6xl min-h-fit w-fit mx-auto",children:[t?o(Pe,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(ye,{text:"Я согласен",version:"primary",target:n,href:r,onClick:s}),o(Er,{type:"button",version:"secondary",onClick:s,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]})})),wg=d((({text:e,href:t,target:n,__html:l,icon:a})=>{if(!e&&!l)return null;const r=(e=>{const{open:t,close:n}=de();return{open:(n={})=>t(o(Ng,{...e}),n),close:n}})({__html:l,href:t,target:n}),s=i((()=>r.open()),[r]);return c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[yg(a),o(Me,{font:"font-light",children:e})]})})),Cg={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},kg=ht((({className:e="",title:t,description:n,align:l="text-center",documents:a,icon:i={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=D();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(k,{title:t,description:n,align:l,headlineVersion:"M",as:"h2",isEmbedded:!0}),a?.length?o("div",{className:u("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",Cg[r]),role:"list",children:a.map(Sg(d,i))}):null]})})),Sg=(e,t)=>(n,l)=>{const a=n?.docType;return""===a?null:"reportSource"in n&&n?.reportSource?.__html?Ig(t)(n,l):bg(e,t)(n,l)},Ig=e=>(t,n)=>{const l={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(wg,{...l,icon:e,href:Tg(t)?t?.href:t?.attachment?.src}),o(Pe,{__html:t?.__html})]},String(n)):null},Tg=e=>"href"in e,Bg=ht((({className:e,padding:t,align:n="text-left",buttons:l=[],description:a,image:i,__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",b=i?.src?o(ne,{className:"hidden lg:block",image:i}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:p,...f,children:c(Ie,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(N,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:b,buttons:Le(l,{className:"flex-wrap"}),children:[a?o(Me,{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(Pe,{__html:r,itemSize:"list-m"}):null,o(Me,{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,i?.src?o(ne,{className:"lg:hidden",image:i}):null]})]})})})),Rg=(e=[],t={})=>e.filter((({content:e={}})=>Vc(t,e))).length,Pg=(e,t)=>e===t;const Dg=(Mg=function(...e){return(t,n)=>e.some((e=>e(t,n)))}(Pg,((e=Pg)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,l)=>e(t,n[l])))))()),(e,t)=>e===t||Boolean(e&&t&&Object.keys(e).length===Object.keys(t).length&&Object.entries(e).every((([e,n])=>Mg(n,t[e])))));var Mg;const _g=[],zg={},Vg={primary:"bg-white/30",secondary:"bg-main-divider"},Ag={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},Eg=d((({count:e,version:t="secondary"})=>{const n=Ce(),l=n?"bg-main-divider":Vg[t],a=Ag[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",l),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(Me,{size:"text-xs",color:a,children:e})})})),Fg=({text:e,description:t,icon:n,isActive:l,type:a})=>{const i=(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"}))(l);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",i.icon),image:{...n,iconVersion:n?.iconVersion??i.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===a?i.text:i.oldText,children:e}),o("div",{className:"animated"===a?i.desc:i.oldDesc,children:t})]})]})},Og={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},Lg={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},$g={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},jg={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},qg=d((({tag:e="div",item:t={},isActive:n=!1,type:l="default",onClick:a})=>{const i=e,{text:r,description:s,icon:d,count:m,tabName:h,...p}=t;return o(i,{className:u("h-12","block flex-1","cursor-pointer",Og[l],n?jg[l]:$g[l]),role:"tablist","aria-label":"Список табов",onClick:a,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?Lg[l]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[Fg({text:r,description:s,icon:d,isActive:n,type:l}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(Eg,{count:m,version:Fr(n,l)})}):null]})})})),Ug=d((e=>o(e?.item?.href?Wg:Hg,{...e}))),Wg=d((e=>{const t=ue(),n=i((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:l,...a}=t({...e.item,onClick:n});return o(qg,{...e,tag:"a",item:a,onClick:l})})),Hg=d((({item:e={},onClick:t,...n})=>{const l=i((()=>{t&&t(e)}),[t,e]);return o(qg,{item:e,onClick:l,...n})})),Yg=(e,t,n)=>(l,a)=>o(Ug,{isActive:l===e,onClick:t,type:n,item:l},String(a)),Kg=d((({className:e,tabsType:t="default",items:n=[],activeItem:l,onChange:a})=>o("div",{className:u("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tabpanel","aria-label":"Панель управления табами",children:n.map(Yg(l,a,t))}))),Xg={categories:[],extraOptions:[],propertyType:[],stage:[]},Gg=ht((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:l,...a})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=Ec(Xg,{block:a.block,page:a.options?.page}),f=i(((e=Xg)=>p(e)),[]),x=(({hotFilters:e=_g,filtrationState:t=zg,blocks:n=_g,onFiltrationStateChange:l})=>{const a=r((()=>Math.max(0,e.findIndex((e=>Dg(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:Rg(n,t.filter),version:Fr(t===e[a])})))),[e,n,a]),o=i((t=>{l(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(Kg,{...x}),o(Pc,{filtrationSchema:n,resetButton:l,field:m,reset:h}),o(Ic,{blocksToRender:d,...a})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),Jg=({location:e,address:t,billAcceptorType:n,terminalType:l,billAcceptorEnable:a,atmCode:i="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:ef(l)},{label:"Модуль приема наличных",value:a?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:i}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(Me,{size:"text-h4",children:ef(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Me,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(Gi,{color:"green",children:ef(s)})})]}),o("div",{className:"hidden sm:block",children:o(Oi,{className:"flex-wrap",children:m?.map(Qg)})}),o(_i,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(zi,{isUnfolded:e,children:o(Oi,{className:"flex-wrap",children:m?.map(Qg)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>lr({isUnfolded:e,onToggle:t})})]},String(d))},Zg=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${ef(t)} №${n}`,body:e.toUpperCase()}),Qg=(e,t)=>o(Vi,{...e},String(t)),ef=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",tf=[];const nf=async e=>{const t=await rt(e,{method:"GET"});return Array.isArray(t)?t:tf},lf={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},af={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)},rf=d((({descriptionData:e,className:t})=>{const[n]=Qu(),l=n?.code??"000",{data:a,isLoad:i}=function(e){const{data:t,error:n}=$n(`/api/v1/atms?regionCode=${e}`,nf);return{data:t||tf,isLoad:!t&&!n}}(l);return o(Kr,{className:t,filterItems:sf,data:a,isLoad:i,initFilterState:lf,renderCard:Jg,getBalloon:Zg,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),sf=(e,t)=>{const n=Object.keys(t).filter((e=>t[e])),l=n.filter((e=>e.startsWith("terminalType"))),a=n.filter((e=>!l.includes(e)));return e.filter((e=>{const t=a.every((t=>af[t](e))),n=!l.length||l.some((t=>af[t](e)));return t&&n}))},of=({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(Me,{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(Me,{size:"text-l",children:e})]}):null]})}),o("div",{className:"hidden sm:block",children:cf({workScheduleDescription:t})}),o(_i,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(zi,{isUnfolded:e,children:cf({workScheduleDescription:t})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>lr({isUnfolded:e,onToggle:t})})]},String(n)):null,cf=({workScheduleDescription:e})=>c("div",{children:[c(Oi,{className:"flex",children:[o(Vi,{label:"Операции для физических лиц",children:o(Me,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(Vi,{label:"Операции для физических лиц",children:o(Me,{children:"Оформление и обслуживание банковских карт"})}),o(Vi,{label:"Операции для физических лиц",children:o(Me,{children:"Инвестиционное и накопительное страхование"})}),o(Vi,{label:"Операции для физических лиц",children:o(Me,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(Vi,{label:"Режим работы",className:"max-w-none",children:o(Me,{children:e})})]}),df=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),mf={branches:[],remoteWorkplaces:[]};const uf=async e=>await rt(e,{method:"GET"})||mf,hf=d((({className:e})=>{const[t]=Qu(),n=t?.code??"000",{data:l,isLoad:a}=function(e="000"){const{data:t,error:n}=$n(`/api/v1/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,uf);return{data:t||mf,isLoad:!t&&!n}}(n);return o(Kr,{className:e,data:l?.branches,isLoad:a,remoteWorkplaces:l?.remoteWorkplaces,renderCard:sr,renderRemoteWorkplaceCard:of,getBalloon:cr,getBalloonRemoteWorkplaces:df,title:`Офисы филиала ${t?.name}`})})),pf=d((({data:e,className:t,...n})=>{const l=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===l?o(hf,{}):o(rf,{descriptionData:e})})})),gf=d((({className:e,title:t,description:n="Блок в разработке...",...l})=>c(g,{className:u("box-border",e),...l,children:[o(k,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(f,{})]}))),ff="hidden sm:flex absolute z-40 top-10",xf=ht((({className:e="",padding:t,slides:n=[],...a})=>{const[i,r]=l(0),[s,d]=rc({itemCount:n?.length||0});return c(g,{className:u("box-border overflow-hidden",e),defaultPadding:"pt-6xl",padding:t,...a,children:[o("div",{className:"flex duration-1000",style:{transform:`translateX(-${100*i}%)`},role:"list",children:n.map((({productBlock:e},t)=>o("div",{className:"box-border grow-0 shrink-0 basis-full",role:"listitem",children:o(Ge,{className:"pl-6xl h-full",headlineVersion:"M",isFullWidthTitle:!1,...e,...a})},String(t))))}),c("div",{className:"relative pr-xs mt-m -mb-m flex gap-xs box-border",children:[o(Yo,{containerRef:s,snapAlign:"snap-start",onVisibleIndicesChange:d.handleVisibleIndicesChange,itemClassName:"h-40 flex items-stretch w-screen",gap:8,children:n.map(bf({activeSlideIndex:i,onClick:r}))}),d.canScrollLeft?o(mc,{className:u("left-6",ff),onClick:d.scrollLeft}):null,d.canScrollRight?o(uc,{className:u("right-6",ff),onClick:d.scrollRight}):null]})]})})),bf=({activeSlideIndex:e,onClick:t})=>({nav:n},l)=>{const a=l===e,i=a?"min-w-[370px] mt-s h-28 bg-white shadow-dark-blue border-none p-6":"min-w-72 mt-lg h-24 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=a?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=a?"text-secondary-text text-l font-light":"text-secondary-text text-m font-light group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(l),"aria-label":n?.title,className:u("relative overflow-hidden grow","ml-xs px-xl","box-border basis-0 border","border-gray group-data-secondary:border-white/50","text-left whitespace-nowrap",i),children:[o("div",{className:r,children:n?.title}),o("div",{className:s,children:n?.description})]},String(l))},yf=d((({address:e,email:t,telephone:n,button:l,className:a="",__html:i,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:[Oe(s)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ne,{image:s})}):null,d?o(N,{headingType:"h3",as:"h3",title:d}):null]}),c("div",{className:"w-full space-y-m",children:[i?vf({__html:i,richVersion:r}):null,Nf({label:"Адрес",data:e,iconName:"GeolocationIcon"}),Nf({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),Nf({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),l?.text?Le([l]):null]})]}))),vf=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(Pe,{...e,itemSize:"list-s"})}),Nf=({label:e,data:t,iconName:n,dataColor:l=""})=>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(Me,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(Me,{size:"text-xl",color:l,children:t})]})]}):null,wf=d((e=>{const{__html:t,richVersion:n="",...l}=e;return o(g,{defaultPadding:"p-0",...l,children:o(Pe,{__html:t,richVersion:n})})})),Cf=d((({label:e,labelIconBgVersion:t,icon:n,onToggle:l,labelIcon:a})=>o(vc,{tag:"button",className:u("border-none bg-transparent items-center group/button",a?.icon?"py-xs":"py-lg"),onClick:l,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[null,e?o(Me,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:n?o(W,{name:n,iconVersion:"color",width:"24",height:"24"}):null}))),kf=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",Sf=(e=!1)=>e?"MinusIcon":"PlusIcon",If=(e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon",Tf=ht((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,label:l="Развернуть",labelIcon:a,labelIconBgVersion:i,foldButtonVersion:r="default",version:s,role:c,...d})=>{const m=Ce();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(_i,{isFoldButtonOnTop:n,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(zi,{className:u("gap-lg",kf(m)),isUnfolded:e,children:P({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Bf({foldButtonVersion:r,label:l,labelIcon:a,labelIconBgVersion:i,isUnfolded:e,onToggle:t,isMobile:m})})})}),{childrenTypes:{exclude:["RollupItem"]}}),Bf=({foldButtonVersion:e,label:t,labelIcon:n,labelIconBgVersion:l,isUnfolded:a,onToggle:i,isMobile:r=!1})=>{const s=t||(a?"Скрыть":"Развернуть"),c=((e=!1,t=!1)=>t?If(e):Sf(e))(a,r);return"accordion"===e?o(Cf,{label:s,labelIcon:n,labelIconBgVersion:l,icon:c,onToggle:i}):o(Nc,{label:s,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:i})},Rf=d((({name:e,text:t,value:n,checked:l,onChange:a,className:i})=>o("div",{className:i,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:u(Wt.split(" ").filter((e=>"rounded"!==e)),Zn,"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:l,onChange:e=>a?.(e.target.value),role:"radio"}),t?o(Me,{color:"text-primary-text",children:t}):null]})}))),Pf=d((({className:e=""})=>{const[t,n]=l("option2"),a=i((e=>n(e)),[]);return c("div",{className:u("order-4",e),role:"radiogroup",children:[o(Rf,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),o(Rf,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),Df=d((({data:e,fieldLabel:t,fieldValue:n,selected:l,placeholder:a="",setSelected:i,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[n||t],text:e?.[t]}))),c=s.find((e=>e.key===l));return o(cn,{options:s,label:r,placeholder:a||l,onChange:e=>i(e.key),value:c})})),Mf=d((({regions:e=[],selectedRegion:t,onSelectedRegion:n,branches:l=[],selectedBranch:a,onSelectedBranch:i})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Df,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(Df,{data:l,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:i,label:"Отделение",placeholder:"Выберите отделение"})})]}))),_f=["От 1 дня","До 365 дней"],zf=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Me,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(hl,{min:1,max:365,value:e,items:_f,onChange:t})]}))),Vf=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:n,safeBoxCases:l=[],selectedBoxSize:a,onSelectedBoxSize:i})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Df,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(Df,{data:l,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:i,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),Af=d((({regions:e,selectedRegion:t,branches:n,selectedBranch:l,days:a,selectedCaseVolume:i,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:u})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(Mf,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:l,onSelectedBranch:Ef(m)}),o(zf,{days:a,setDays:e=>m({days:e})}),o(Vf,{caseVolumes:d,selectedCaseVolume:i,onSelectedCaseVolume:Ff(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(Me,{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(Pf,{}),o(ye,{text:"Офисы на карте",version:"primary",onClick:u,className:"order-6"})]})]}))),Ef=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},Ff=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},Of=d((({days:e,tariffs:t=[]})=>{const n=$f(e,t),l="На рисунке изображена пачка листов\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:[Lf("Аренда за",e),Lf("Цена",n+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:l})}),c("div",{className:"flex flex-col items-center gap-s order-3 @xl:order-none mb-xl @xl:mb-0 bg-primary-main py-s @xl:p-3xl text-center",children:[o(ne,{image:{icon:"PackA4Icon"},className:"@xl:h-60"}),o("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:o(w,{size:"text-s",font:"font-light",color:"text-white",children:l})})]})]})})),Lf=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(Me,{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})]}),$f=(e,t)=>{const n=jf(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},jf=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},qf=(e,t)=>e.find((e=>e.branchCode===t)),Uf=d((e=>{const{regions:t,data:n,branches:l,onChange:i,onClick:r}=e;a((()=>{i({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,i]);const s=qf(l,n.selectedBranch),d=Wf(s?.safeBoxCaseVolumes),m=Hf(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=Yf(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(Af,{...n,regions:t,onClick:r,branches:l,caseVolumes:d,safeBoxCases:m,onChange:i}),o(Of,{days:n.days,tariffs:u})]})})),Wf=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Hf=(e,t)=>e?.find((e=>e.volume===t)),Yf=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Kf=[];const Xf=async e=>await rt(e,{method:"GET"})||Kf,Gf=d((({title:e,footnote:t,className:n="",...a})=>{const[r,s]=l(!1),d=i((()=>s((e=>!e))),[]),[m,u]=l({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),h=Pi(),p=Jf(m.selectedRegion,h),f=function(e){const{data:t}=$n(e?`/api/v1/safeboxes?regionCode=${e}`:null,Xf);return t||Kf}(p),x=i((e=>u((t=>({...t,...e})))),[u]),b=(y=qf(f,m.selectedBranch)||f,Array.isArray(y)?y.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)].filter(Boolean),content:void 0}))).filter((e=>e.coords&&2===e.coords.length)):y?.gpsLatitude&&y?.gpsLongitude?[{coords:[y.gpsLatitude,y.gpsLongitude]}]:[]);var y;return c(g,{className:n,defaultPadding:"",...a,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(N,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(Uf,{regions:h,branches:f,data:{...m,selectedRegion:p},onClick:d,onChange:x}),t?o(w,{size:"text-s",font:"font-light",children:t}):null]}),b.length&&r?o(Tr,{points:b,className:"h-[640px]"}):null]})})),Jf=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,Zf=e=>e<4?"w-72":"w-52",Qf={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"},ex=d((({buttons:e,className:t="",description:n,showLines:l=!0,steps:a=[],stepVersion:i="gray",title:r,version:s="primary",...d})=>{const m=a.length>3,h=Qf,p=(e=>e?"":"opacity-0")(l),f=Ce();return c(g,{className:u("box-border flex flex-col items-center overflow-hidden gap-y-3xl",t),defaultPadding:"p-6xl",version:s,...d,children:[o(k,{headlineVersion:"S",title:r,description:n,isEmbedded:!0,className:"w-full",align:jc(f)}),a?.length?c("div",{className:"box-border space-y-lg flex flex-col justify-center",children:[o("div",{className:u("flex items-center",m?"px-16":"px-24"),children:Bc(o("div",{className:u("h-0.5 w-full bg-secondary-light flex-1",p)}))(a.map(tx(h,m,i)))}),o("div",{className:u("flex justify-between",m?"gap-x-s":"gap-x-20"),children:a.map((x={styleMap:h,version:s},(e,t,n)=>{const{styleMap:l,version:a}=x,{label:i,description:r,button:s,isDotted:d}=e;return c("div",{className:u("relative flex flex-col items-center text-center justify-between whitespace-pre-line overflow-hidden space-y-3xl",Zf(n.length)),children:[c("div",{className:"space-y-xs",children:[i?o(Me,{size:"text-h6",align:"text-center",children:i}):null,c("div",{className:"flex flex-col items-center gap-3xs",children:[r?o("div",{className:l.description,children:r}):null,o(Pe,{__html:e.__html,itemSize:"list-s",isDotted:d})]})]}),s?.text?o(ye,{className:"box-border py-s w-full max-w-60 mt-auto",version:a,...s,children:s?.text}):null]},String(t))}))})]}):null,Le(e)]});var x})),tx=(e,t,n)=>({icon:l},a)=>{const i="secondary"===n?"white":"color";return o(g,{defaultPadding:"",className:`${nx(t)} flex justify-center items-center text-center rounded-full box-border z-10`,version:n,children:Oe(l)?o(ne,{image:{...l,iconVersion:l?.iconVersion||i},width:"48",height:"48"}):o("span",{className:u("text-h4","transparent"===n?e.iconText:(r=n,"secondary"===r?"group-data-primary:text-white":"text-secondary-text")),children:a+1})},String(a));var r},nx=e=>e?"h-16 w-16":"h-24 w-24",lx=d((()=>o("div",{className:"hidden",role:"none"}))),ax="hidden sm:flex absolute z-40",ix={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:l,tabsType:i="default"})=>{const[r,s]=rc({itemCount:t?.length||0});return a((()=>sx(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(Yo,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:ix[i].item,gap:ix[i].gap,children:t.map(Yg(n,l,i))}),s.canScrollLeft?o(mc,{className:u("left-6",ax,ix[i].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(uc,{className:u("right-6",ax,ix[i].buttonTop),onClick:s.scrollRight}):null]})})),sx=(e,t,n)=>{const l=t.findIndex((e=>e===n));e&&l>0&&e.scrollTo({left:e?.children[l]?.offsetLeft,behavior:"smooth"})},ox={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},cx=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(ox[t].wrapper,e),children:o(rx,{className:ox[t].component,tabsType:t,...n})}):null,dx=ht((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=mx(n??{}),p=D(),f=t.every((e=>"link"===e?.type)),x=s?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,{isReady:b}=p,[y,v]=l(px(x,((e="")=>{const t=globalThis?.location?.href;return t?new URL(t).searchParams.get(e):null})(h))),N=x[y],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)}),[b,w,h]);const C=hx(x[y],y),k=i((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:[cx({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:ux(t,x),activeItem:N,tabsType:r,onChange:k}),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(hx)?.filter(Boolean)||[]}),mx=({__id:e,anchor:t})=>t??e??"tabs",ux=(e,t)=>t?.length?t:e,hx=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",px=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),gx={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},fx=d((({children:e,activeIndex:t,columnWidth:n,version:l="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:gx[l],style:{transform:`translateX(-${t*n}px)`},children:e})}))),xx=d((({className:e="",isOpen:t,onClick:n})=>o(ye,{className:e,appendRight:o(ne,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"24",height:"24"}),text:t?"Скрыть":"Показать",version:"gray",onClick:n}))),bx={Buttons:({buttons:e})=>Le(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(Pe,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(Me,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(Me,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:l,isOpen:a})=>e?o(xx,{className:"w-fit",isOpen:a,onClick:()=>{t({tableSource:n,pdfUrl:l})}}):null},yx=d((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:i,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=l(!0);a((()=>{i===o&&s||m(!0)}),[s,o]);return vx({cell:e,cellProps:{rowIdx:n,cellIdx:i,fieldIdx:t,displayTable:e=>{m(!1),c(i),r(e)},isVisible:d}})})),vx=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...l}=e;if(!n||!(n in bx))return null;return o(bx[n],{...t,...l})},Nx=d((({cells:e,rowIdx:t,cellIdx:n,setTableInner:l,tableInner:a,openTableInnerIdx:i,setOpenTableInnerIdx:r})=>o("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>o(yx,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:l,tableInner:a,openTableInnerIdx:i,setOpenTableInnerIdx:r},String(s)))):null}))),wx=(e,t)=>140*qh(e.slice(0,t).map((e=>e?.cols?.length??1))),Cx=(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(Me,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,kx=d((({rows:e})=>{const t=e?.[0]?.length??0,[n,l]=eg({itemCount:t,visibleItemCount:5});return c("div",{children:[e?.map((a=n,(e,t)=>{if(!e?.length)return null;const[n,...l]=e,i=u("flex duration-1000 text-center",0!==t?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[n?.data?o("div",{className:"whitespace-pre-wrap sm:whitespace-normal w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(Me,{size:"text-xl",font:"font-light",children:n.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:i,style:{transform:`translateX(-${wx(l,a)}px)`},children:l?.map(((e,t)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(Me,{size:"text-xl",children:e.data}):null,e?.cols?Cx(e.cols,a):null]},`row${t}`)))})})]},String(t))})),tg({...l,btnClass:["left-3 top-20","right-3 top-20"],className:""})]});var a})),Sx=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const l=`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(Me,{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})})})]},l)}))}))),Ix=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Tx=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:l})=>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:()=>l(t),children:o(Me,{size:"text-xl",font:"font-light",color:Ix(t===n),children:e||t+1})},e)))}):null,t?o(ye,{className:"text-primary-main",href:t,version:"secondary",target:"_blank",appendLeft:o(W,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),Bx=ht((({tableSource:e,pdfUrl:t,onClick:n})=>{const a=e?.tableData,[r,s]=l(0),d=i((e=>s(e)),[]),m=a?.[r]?.items??[],u=a?.map((e=>e.currency??""));return c("div",a?{className:"bg-white z-10",children:[o(Tx,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(Sx,{activeTabIndex:r,items:m}),o(xx,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Me,{size:"text-h6",children:"Данных нет"}),o(xx,{onClick:n,isOpen:!0})]})})),Rx=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(Bx,{...t,onClick:n})}):null]}))),Px=d((({row:{header:e,data:t},activeIndex:n,rowIdx:a,...r})=>{const[s,d]=l(void 0),m=i((e=>d(e)),[]),[h,p]=l(void 0),g=i((e=>p(e)),[]);return c(Rx,{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(Me,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(fx,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(Nx,{cells:e,rowIdx:a,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})})),Dx=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,tg({...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]})})),Mx=d((({className:e="",title:t,description:n,rowHeaders:l,tariffsColumns:a,hiddenRowsNum:i=0,...r})=>{const s=a?.map((({data:e})=>e))||[],d=l?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=s.length,[h,p]=eg({itemCount:m,visibleItemCount:2}),f=(d||[]).map(((e,t)=>o(Px,{row:e,activeIndex:h,rowIdx:t,...r},String(t)))),[x,b]=i>0?[f.slice(0,-i),f.slice(-i)]:[f,[]];return c(g,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...r,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:i>0?o(_i,{renderFoldableSection:({isUnfolded:e})=>c(Dx,{controls:p,children:[x,o(zi,{isUnfolded:e,children:b})]}),renderFoldButton:wc}):o(Dx,{controls:p,children:f})})]})})),_x=d((({className:e="",title:t,description:n,iconVersion:l,__html:a,richVersion:i,...r})=>c(g,{className:u("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...r,children:["small"===l?zx():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Me,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?Vx(n):null,a?o(Pe,{richVersion:i,__html:a}):null]})]}))),zx=()=>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"}),Vx=e=>o(w,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),Ax=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(Me,{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(Me,{size:"text-h2",children:n})}):null]}))),Ex=d((e=>{const{prefix:t,unit:n,suffix:l,...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(Ax,{prefix:t,unit:n,suffix:l})})})),Fx=ht((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:l=!0,version:a="transparent",isTheme:i=!1,isCardBorder:r=!1,image:s,...c})=>{const d=D();return o(g,{className:u("relative flex flex-col",Jp[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${J(d)(s?.src)})`}}:{},padding:t,version:a,isTheme:i,...c,children:P({...c,extraProps:{className:u("w-full",$o(r)),...Gp(l)}})})}),{childrenTypes:[]}),Ox=e=>(e=>{const t="col-span-",n=e?.split(/\s+/).find((e=>e.startsWith(t)));return n?parseInt(n.substring(t.length),10):12})(e)<10?"py-xl px-6xl":"py-6xl px-32",Lx=d((({className:e,title:t,url:n,previewImg:l,...a})=>{const i=D();return c(g,{className:e,defaultPadding:Ox(e),...a,children:[o(k,{title:t,headlineVersion:"M"}),n?o("video",{className:"m-auto w-full object-fill",preload:"metadata",poster:q(i)(l?.src),style:{maxHeight:524},controls:!0,children:o("source",{src:q(i)(n)})}):null]})})),$x={AdTile:gt,ApplicationForm:_s,ApplicationLeadForm:zo,ApplicationStatus:Eo,BankAccountFiltration:Lc,BenefitsBlock:Wc,BonusBenefitsBlock:Gc,ButtonsBlock:Zc,CalculatorBonus:hd,CalculatorBusinessDeposit:Pd,CalculatorCredit:Wd,CalculatorDeposit:cm,CalculatorRefinancing:xm,CardTransfer:km,Carousel:Mm,CarouselCard:Am,CarouselCatalogCard:Fm,CarouselLinks:$m,CarouselRecommendationCard:Xm,CarouselTariffsCard:Zm,ContactsBlock:eu,CreditForm:Bu,DepositFiltration:_u,Depository:Xu,ErrorBlock:Ju,ExchangeRateTile:kh,Footer:ap,GracePeriod:ip,GrantSupport:cp,Header:Yp,Headline:k,HorizontalLayout:Zp,ImgBlock:Qp,InsuranceAmountBlock:rg,InvestmentInfo:dg,LinkDocs:kg,MobileAppTile:Bg,MortgageFiltration:Gg,OfficesAtmsMap:pf,Placeholder:gf,ProductBlock:pt,ProductGallery:xf,RepresentativeOfficeInfo:yf,RichTextBlock:wf,RollupItem:Tf,SafeDepositRental:Gf,StepsBlock:ex,StickyBottomMenu:lx,TabsLayout:dx,TariffsTable:Mx,TextBlock:_x,UnitBlock:Ex,VerticalLayout:Fx,Video:Lx},jx=me((()=>{a((()=>{It()}),[]);const e=zt();$t(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const l=JSON.parse(n?.dataset?.aspects??"[]");kt({aspectsAttributes:l,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))})),qx="cookie",Ux=d((({__html:e})=>{const[t,{setTrue:n,setFalse:l}]=Lt();Lh((()=>{globalThis.localStorage?.getItem(qx)||n()}),[],3e3);const a=i((()=>{globalThis.localStorage?.setItem(qx,"true"),l()}),[]);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(Pe,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(ha,{className:"bg-main-gray rounded-md w-11 h-11",onClose:a})})]})}):null}));function Wx(e){throw new Error(e)}const Hx=({onCloseAll:e,onClose:t}={})=>{const[n,{push:r,pop:s,clear:o}]=function(e=[]){const[t,n]=l(e),a=i((e=>n((t=>[...t,e]))),[]),r=i((()=>n((e=>e.slice(0,-1)))),[]),s=i((e=>n((t=>t.filter((t=>t!==e))))),[]),o=i((()=>n([])),[]);return[t,{setList:n,push:a,pop:r,remove:s,clear:o}]}(),c=i((()=>{e&&e(n),o()}),[n,e]),d=i((()=>{t&&t(n[n.length-1]),s()}),[n,t]);return a((()=>ce.subscribe("dialog",(e=>{switch(e.type){case"open":r(e);break;case"close":e.all?c():d();break;default:Wx(e)}}))),[c,d]),n},Yx=d((()=>{const e=i((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=i((e=>{e?.onClose&&e.onClose()}),[]),n=Hx({onCloseAll:e,onClose:t}),{close:l}=de(),r=i((({key:e})=>{"Escape"===e&&l()}),[]);return $t(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},l)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:l!==n.length-1}),children:e},String(t||l))))}):null})),Kx=d((()=>{const[e,t]=l(null),n=i((()=>{t(null)}),[]);a((()=>ce.subscribe("popup",(e=>{switch(e.type){case"open":case"update":t(e);break;case"close":n();break;default:Wx(e)}}))),[]);const r=i((({key:e})=>{"Escape"===e&&n()}),[n]);return $t(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})),Xx="header",Gx="footer",Jx="sticky-footer",Zx={},Qx=d((({className:e,data:t=Zx,blocksRegistry:n,blockDecorator:l})=>{const{slots:a,blocks:i,fallback:r,...s}=t,d=ut(s,r);jx();const m={key:"",page:{slots:a,blocks:i,fallback:r,...d},blocksRegistry:n,blockDecorator:l,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:Xx})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[P({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),R(a?.footer,{...m,slotName:Gx})]})]}),a?.["sticky-footer"]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:R(a?.["sticky-footer"],{...m,slotName:Jx})}):null,o(Yx,{}),o(Kx,{}),o(Ux,{__html:d?.cookieContent?.__html})]})}));Object.assign(Qx,{childrenTypes:[],slots:()=>[Xx,Gx,Jx]});e.Blocks=$x,e.ContentPage=Qx,e.handlerDecorator=me,e.joinList=Bc,e.packageVersion="0.14.649",e.projectSettings=_,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=L,e.useRouter=D,Object.defineProperty(e,"__esModule",{value:!0})}));
|