(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[531],{5775:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let i=n(7043);n(7437),n(2265);let l=i._(n(5602));function o(e,t){var n;let i={loading:e=>{let{error:t,isLoading:n,pastDelay:i}=e;return null}};"function"==typeof e&&(i.loader=e);let o={...i,...t};return(0,l.default)({...o,modules:null==(n=o.loadableGenerated)?void 0:n.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1523:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return l}});let i=n(8993);function l(e){let{reason:t,children:n}=e;if("undefined"==typeof window)throw new i.BailoutToCSRError(t);return n}},5602:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return c}});let i=n(7437),l=n(2265),o=n(1523),s=n(49);function r(e){return{default:e&&"default"in e?e.default:e}}let a={loader:()=>Promise.resolve(r(()=>null)),loading:null,ssr:!0},c=function(e){let t={...a,...e},n=(0,l.lazy)(()=>t.loader().then(r)),c=t.loading;function u(e){let r=c?(0,i.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,a=t.ssr?(0,i.jsxs)(i.Fragment,{children:["undefined"==typeof window?(0,i.jsx)(s.PreloadCss,{moduleIds:t.modules}):null,(0,i.jsx)(n,{...e})]}):(0,i.jsx)(o.BailoutToCSR,{reason:"next/dynamic",children:(0,i.jsx)(n,{...e})});return(0,i.jsx)(l.Suspense,{fallback:r,children:a})}return u.displayName="LoadableComponent",u}},49:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadCss",{enumerable:!0,get:function(){return o}});let i=n(7437),l=n(544);function o(e){let{moduleIds:t}=e;if("undefined"!=typeof window)return null;let n=(0,l.getExpectedRequestStore)("next/dynamic css"),o=[];if(n.reactLoadableManifest&&t){let e=n.reactLoadableManifest;for(let n of t){if(!e[n])continue;let t=e[n].files.filter(e=>e.endsWith(".css"));o.push(...t)}}return 0===o.length?null:(0,i.jsx)(i.Fragment,{children:o.map(e=>(0,i.jsx)("link",{precedence:"dynamic",rel:"stylesheet",href:n.assetPrefix+"/_next/"+encodeURI(e),as:"style"},e))})}},6583:function(){},7565:function(){},6034:function(){},631:function(e,t,n){"use strict";function i(){return typeof window>"u"}function l(e){i()||(Array.isArray(window.dataLayer)?window.dataLayer.push(e):console.log("window.dataLayer does not exist"),Array.isArray(window._mtm)?window._mtm.push(e):console.log("window._mtm does not exist"))}function o(){if(i()){console.warn("Cant initialize tag manager on server side");return}"function"!=typeof window._init_gtm?console.warn("Cant init GTM, please check if GTM script exists"):window._init_gtm(),"function"!=typeof window._init_mtm?console.warn("Cant init MTM, please check if MTM script exists"):window._init_mtm()}n.d(t,{AB:function(){return l},zK:function(){return o}})},2778:function(e,t,n){"use strict";n.d(t,{L:function(){return a},g:function(){return r}});var i=n(2265),l=n(631);let o=null,s=e=>{o=e},r=()=>o,a=e=>{let{env:t}=e,n=(0,i.useRef)(!1);return n.current||(s(t),n.current=!0),(0,i.useEffect)(()=>{"production"===t.NODE_ENV&&(0,l.zK)()},[t.NODE_ENV]),null}},2074:function(e,t,n){"use strict";function i(e,t){return`finkit-widgets-${t}-${e}`}n.d(t,{g:function(){return i}})},5487:function(e,t,n){"use strict";n.d(t,{a:function(){return i}});let i={getItem:e=>{if(typeof document>"u")return null;let t=document.cookie.split(";").find(t=>t.split("=")[0].trim()===e);return t?t.split("=")[1]??null:null},setItem:(e,t,n={})=>{if(typeof document>"u")return;(n={path:"/",...n}).expires instanceof Date&&(n.expires=n.expires.toUTCString());let i=`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;for(let e in n){if(!n.hasOwnProperty(e))continue;i+=`; ${e}`;let t=n[e];!0!==t&&(i+=`=${t}`)}document.cookie=i},removeItem:e=>{i.setItem(e,"",{"max-age":-1})}}},3020:function(e,t,n){"use strict";let i,l;n.d(t,{PageLayout:function(){return t5}});var o=n(7437),s=n(5775),r=n.n(s),a=n(5563),c=n(1994);let u=/^\.?\//;function d(e,...t){let n=e||"";for(let e of t.filter(e=>e&&"/"!==e))if(n){let t=e.replace(u,"");n=function(e="",t){return e.endsWith("/")?e:e+"/"}(n)+t}else n=e;return n}Symbol.for("ufo:protocolRelative");var p=n(2074),m=n(5461);let h={а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"yo",ж:"zh",з:"z",и:"i",й:"y",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"h",ц:"c",ч:"ch",ш:"sh",щ:"sch",ъ:"",ы:"y",ь:"",э:"e",ю:"yu",я:"ya"},f=e=>e.replace(/[а-яё]/gi,e=>{let t=e.toLowerCase();return t in h?h[t]:e}).replaceAll(/[ \u00A0]/g,"_");var v=n(631);let g=(e,t)=>{if(typeof window>"u")return;let n=sessionStorage.getItem("pushedEvents"),i=n?JSON.parse(n):[];e.event||(e.event="data-event"),"string"==typeof e.eventAction&&(e.eventAction=e.eventAction.toLowerCase().replaceAll(" ","_")),"string"==typeof e.eventLabel&&(e.eventLabel=e.eventLabel.toLowerCase().replaceAll(" ","_")),e.eventLabel||(e.eventLabel="undefined");let l=i.find(n=>n.eventCategory===e.eventCategory&&n.eventAction===e.eventAction&&n.eventLabel===e.eventLabel&&("all"===t||"url"===t&&window.location.pathname===n.url));if(!t||!l){if(t){let t={...e};t.url=window.location.pathname,i.push(t),sessionStorage.setItem("pushedEvents",JSON.stringify(i))}(0,v.AB)(e)}};var w=((i=w||{}).icon="icon",i.chip="chip",i.accordion="accordion",i.button="button",i.checkbox="checkbox",i.radio="radio",i.select="select",i.toggle="toggle",i.tooltip="tooltip",i.link="link",i.banner="banner",i.tag="tag",i.date="date",i.field="field",i.offer="offer",i.tab="tab",i.submitButton="submitButton",i.popup="popup",i.block="block",i);let _={icon:"click_icon_",chip:"click_chip_",accordion:"show_acc_",button:"click_button_",checkbox:"click_check_",radio:"click_radio_",select:"click_sel_",toggle:"click_togg_",tooltip:"click_tip_",link:"click_link_",banner:"click_bnr_",tag:"click_tag_",date:"input_date_",field:"input_field_",offer:"click_offer_",tab:"click_tab_",submitButton:"form_button_",popup:"show_pop_up_",block:"click_block_"},x=({eventCategory:e,eventActionType:t,eventActionText:n="",eventLabel:i})=>{let l={event:"data-event",eventCategory:e,eventAction:_[t]+f(n)};void 0!==i&&(l.eventLabel=f("string"==typeof i?i:i.toString())),g(l)};var b=n(684),j=n(2265),y=n(4887);let $=300,N=({opened:e})=>{let[t,n]=(0,j.useState)(!1),i=(0,j.useRef)(null),l=(0,j.useRef)(!1);return(0,j.useEffect)(()=>(e&&!l.current?(l.current=!0,n(!0)):!e&&l.current&&(i.current=setTimeout(()=>{l.current=!1,n(!1)},$)),()=>{i.current&&clearTimeout(i.current)}),[e]),{mounted:t}},k=(0,p.g)("click-outside","sc"),C=Object.freeze({overlay:`${k}__overlay`,open:`${k}--open`,close:`${k}--close`}),O=({onClose:e,onToucheMove:t,isOpen:n,delay:i=$})=>{let l=(0,j.useRef)(null),s=(0,j.useCallback)(()=>{e&&(l.current=setTimeout(()=>{e()},i))},[i,e]),r=(0,j.useCallback)(e=>{"Escape"===e.key&&s()},[s]);return(0,j.useEffect)(()=>(n&&window.addEventListener("keydown",r),()=>{l.current&&clearTimeout(l.current),window.removeEventListener("keydown",r)}),[n,r]),(0,o.jsx)("div",{className:(0,c.Z)(C.overlay,{[C.open]:n,[C.close]:!n}),onTouchStart:t,onClick:s})},T=(e,t)=>{e&&(t?e.setAttribute("data-portal",""):e.removeAttribute("data-portal"))},S=e=>{e.style.top||(window.prevScrollPosition=window.scrollY)},A=(e,t,n)=>{t.style.setProperty("overflow-y","scroll"),e.classList.toggle("scroll-disable-windows",!0),e.style.setProperty("width",`calc(100vw - ${n}px)`),e.style.setProperty("top",`-${window.prevScrollPosition}px`)},I=e=>{e.style.setProperty("overflow","hidden"),e.style.setProperty("height","100vh")},L=e=>{e.classList.toggle("scroll-disable-windows",!1),e.style.removeProperty("overflow"),e.style.removeProperty("height"),e.style.removeProperty("width"),e.style.removeProperty("top")},R=()=>{void 0!==window.prevScrollPosition&&(window.scrollTo(0,window.prevScrollPosition),window.prevScrollPosition=void 0)},z=()=>document.querySelectorAll("[data-portal]").length>1,P=e=>{let t=(0,j.useRef)(null),n=(0,j.useRef)(!1);return(0,j.useEffect)(()=>{if(n.current===e)return;n.current=e;let i=t.current,l=document.body,o=document.documentElement,s=window.innerWidth-o.clientWidth,r=s>0;if(e&&r)S(l),A(l,o,s),T(i,!0);else if(e)I(l),T(i,!0);else{let e=!z();e&&L(l),e&&R(),T(i,!1)}return()=>{let e=!z();e&&L(l),e&&R()}},[e]),t},E=(0,p.g)("drawer-footer","sc"),M=Object.freeze({footer:`${E}__footer`,hasScroll:`${E}__footer--has-scroll`}),B=({footer:e,hasScroll:t,className:n})=>(0,o.jsx)("div",{className:(0,c.Z)(M.footer,{[M.hasScroll]:t},n),children:"function"==typeof e?e():e}),U=(0,p.g)("drawer-content","sc"),W=Object.freeze({container:`${U}__container`,open:`${U}--open`,close:`${U}--close`,header:`${U}__header`,rowHeader:`${U}__header--row`,title:`${U}__title`,center:`${U}__title--center`,left:`${U}__title--left`,right:`${U}__title--right`,controlContainer:`${U}__control-container`,content:`${U}__content`,footer:`${U}__footer`}),F=({onClose:e,onContentClick:t,children:n,title:i,rowTitle:l,titleAlign:s,isCloseable:r,footer:a,closeButton:u,isOpen:d,contentClassName:p,footerClassName:m,contentStyle:h,width:f})=>{let v=(0,j.useRef)(null),g=(0,j.useRef)(null),[w,_]=(0,j.useState)(!1);(0,j.useEffect)(()=>{var e;if(!g.current||!v.current)return;let t=(null==(e=null==g?void 0:g.current)?void 0:e.getBoundingClientRect().top)||0,n=null==v?void 0:v.current,i=()=>{let e=null==g?void 0:g.current;e&&_(()=>e.getBoundingClientRect().top!==t)};return n&&n.addEventListener("scroll",i,!1),()=>{null==n||n.removeEventListener("scroll",i,!1)}},[]);let x=h||f?{width:f,...h||{}}:void 0;return(0,o.jsxs)("div",{ref:v,style:x,className:(0,c.Z)(W.container,{[W.open]:d,[W.close]:!d},p),children:[i||r?(0,o.jsxs)("div",{className:(0,c.Z)(W.header,{[W.rowHeader]:l}),children:[r?u?"function"==typeof u?u():u:(0,o.jsx)("button",{type:"button",className:W.controlContainer,onClick:e,children:(0,o.jsx)(b.IconFdsCloseO,{size:24})}):null,i?(0,o.jsx)("h3",{className:(0,c.Z)(W.title,{[W[s]]:!0}),children:i}):null]}):null,(0,o.jsx)("div",{ref:g,className:W.content,onClick:t,children:n}),a&&(0,o.jsx)(B,{className:(0,c.Z)(W.footer,m),footer:a,hasScroll:w})]})},Z=(0,p.g)("drawer-layout","sc"),D=Object.freeze({window:`${Z}__window`}),G=({onClose:e,isOpen:t,children:n,withDisabledScroll:i,className:l,...s})=>{let r=(0,j.useCallback)(e=>e.stopPropagation(),[]);return P(t&&i),(0,o.jsxs)("div",{"data-portal":!0,className:(0,c.Z)(D.window,l),children:[(0,o.jsx)(O,{onClose:e,isOpen:t,delay:0}),(0,o.jsx)(F,{onContentClick:r,onClose:e,isOpen:t,...s,children:n})]})},V=({isOpen:e=!1,children:t,titleAlign:n="center",isCloseable:i=!0,withDisabledScroll:l=!0,...s})=>{let{mounted:r}=N({opened:e});return r?(0,o.jsx)(G,{titleAlign:n,isCloseable:i,isOpen:e,withDisabledScroll:l,...s,children:t}):null};V.displayName="Drawer";let H=(0,p.g)("mobile-modal-footer","sc"),q=Object.freeze({footer:`${H}__footer`,footerWithoutShadow:`${H}__footer--without-shadow`}),J=({footer:e,isSmallPopup:t=!1,footerClassName:n})=>(0,o.jsx)("div",{className:(0,c.Z)(q.footer,t&&q.footerWithoutShadow,n),children:"function"==typeof e?e():e}),Q=(0,p.g)("mobile-popup","sc"),Y=Object.freeze({mobilePopup:`${Q}`,mobilePopupOpen:`${Q}--open`,content:`${Q}__content`,contentFull:`${Q}__content--full`,contentTransition:`${Q}__content--transition`,contentTransitionOpen:`${Q}__content--transition-open`,contentLine:`${Q}__content-line`,contentContainer:`${Q}__content-container`,smallContentContainer:`${Q}__content-container--small`,min:`${Q}__content-container--min`,title:`${Q}__title`,closeContainer:`${Q}__close-container`,closeButton:`${Q}__close-button`}),K=({children:e,footer:t,isOpen:n,isSmallPopup:i,onClose:l,hasCloseButton:s=!0,full:r,touchDistance:a=100,withDisabledScroll:u=!0,contentClassName:d,className:p,title:m,closeButton:h,footerClassName:f})=>{let[v,g]=(0,j.useState)(!1),[w,_]=(0,j.useState)(!1),[x,y]=(0,j.useState)(!0),[$,N]=(0,j.useState)("120%"),k=(0,j.useRef)(null),C=(0,j.useRef)(0),T=(0,j.useRef)(!1),S=e=>{var t,n,i;let l=null==(t=k.current)?void 0:t.offsetTop,o=null==(n=k.current)?void 0:n.offsetHeight;if(T.current=!0,y(!1),l&&o){let t=(null==(i=null==e?void 0:e.touches[0])?void 0:i.clientY)-l,n=0;t>=0&&t<=o+30&&(n=t),t>o+30&&(n=o+30),N(`${n}px`),C.current=n}},A=()=>{T.current&&(C.current>a&&l?null==l||l():N("0"),y(!0),T.current=!1),window.removeEventListener("touchmove",S),window.removeEventListener("touchend",A)};return(0,j.useEffect)(()=>{n&&setTimeout(()=>{g(!0),_(!0),N("0")},100),!n&&w&&(N("120%"),g(!1),_(!1))},[w,n]),P(n&&u),(0,o.jsxs)("div",{"data-portal":!0,className:(0,c.Z)(Y.mobilePopup,w&&Y.mobilePopupOpen,p),children:[(0,o.jsx)(O,{onClose:()=>{n&&(null==l||l())},onToucheMove:()=>{n&&(g(!1),window.addEventListener("touchmove",S),window.addEventListener("touchend",A))},isOpen:n,delay:0}),(0,o.jsxs)("div",{className:(0,c.Z)(Y.content,r&&Y.contentFull,x&&Y.contentTransition,x&&v&&Y.contentTransitionOpen),ref:k,style:{transform:`translateY(${$})`},children:[(0,o.jsx)("div",{className:Y.contentLine}),(0,o.jsxs)("div",{className:(0,c.Z)(Y.contentContainer,i&&Y.smallContentContainer,{[Y.min]:!m&&!s},d),children:[!!m&&(0,o.jsx)("div",{className:Y.title,children:m}),s?(0,o.jsx)("div",{className:Y.closeContainer,children:s?h?"function"==typeof h?h():h:(0,o.jsx)("button",{onClick:l,className:Y.closeButton,children:(0,o.jsx)(b.IconFdsCloseO,{size:24})}):null}):null,e]}),t&&(0,o.jsx)(J,{footerClassName:f,isSmallPopup:i,footer:t})]})]})},X=({children:e,isSmallPopup:t=!1,isOpen:n=!1,...i})=>{let{mounted:l}=N({opened:n});return l?(0,o.jsx)(K,{isSmallPopup:t,isOpen:n,...i,children:e}):null};X.displayName="UiMobilePopup";let ee=({children:e,id:t="portal-root"})=>{let[n,i]=(0,j.useState)(null);return(0,j.useEffect)(()=>{let e=document.getElementById(t);if(e){i(e);return}let n=document.createElement("div");return n.id=t,document.body.appendChild(n),i(n),()=>{document.body.removeChild(n)}},[t]),n?(0,y.createPortal)(e,n):null},et=(0,p.g)("footer-contacts-block","sc"),en=Object.freeze({contactsWrapper:`${et}__contacts-wrapper`,gray:`${et}__gray`,phones:`${et}__phones`,contactsButtons:`${et}__contacts-buttons`,vkIcon:`${et}__vk-icon`,tgIcon:`${et}__tg-icon`,dzenIcon:`${et}__dzen-icon`,maxIcon:`${et}__max-icon`,link:`${et}__link`}),ei=(0,p.g)("footer","sc"),el=Object.freeze({wrapper:`${ei}__wrapper`,section:`${ei}__section`,container:`${ei}__container`,top:`${ei}__top`,main:`${ei}__main`,links:`${ei}__links`,disclaimer:`${ei}__disclaimer`,bottom:`${ei}__bottom`,bottomLinks:`${ei}__bottom-links`,bottomDisclaimer:`${ei}__bottom-disclaimer`,compact:`${ei}__wrapper--compact`,white:`${ei}__wrapper--white`}),eo="finkit-widgets-sc-footer",es=[{title:"8 (800) 505-32-32",url:"tel:88005053232"},{title:"8 (800) 700-64-94",url:"tel:88007006494"},{title:"+7 (495) 145-32-32",url:"tel:+74951453232"},{title:"+7 (495) 787-64-94",url:"tel:+74957876494"}],er=[...es,{title:"Онлайн чат",url:void 0}],ea=[{type:"vk",className:en.vkIcon,iconName:"vk"},{type:"telegramChannel",className:en.tgIcon,iconName:"telegram"},{type:"dzen",className:en.dzenIcon,iconName:"dzen"},{type:"max",className:en.maxIcon,iconName:"max"}],ec=(0,o.jsxs)("p",{children:["На сайте finuslugi.ru предоставляются услуги оператора финансовой платформы ПАО Московская Биржа, а также услуги ООО \xabМБ Маркетплейс\xbb, организации, не являющейся оператором финансовой платформы в соответствии с Федеральным законом от 20.07.2020 №211-ФЗ \xabО совершении финансовых сделок с использованием финансовой платформы\xbb. Услуги оператора финансовой платформы ПАО Московская Биржа обозначены пометкой \xabОткрытие онлайн на Финуслугах\xbb. Иная информация на сайте www.finuslugi.ru считается размещенной ООО \xabМБ Маркетплейс\xbb, если иное явно не следует из существа размещаемой информации. ООО \xabМБ Маркетплейс\xbb входит в Группу \xabМосковская Биржа\xbb.",(0,o.jsx)("br",{}),(0,o.jsx)("br",{}),"Группа \xabМосковская Биржа\xbb - ПАО Московская Биржа и юридические лица, находящиеся под прямым или косвенным контролем ПАО Московская Биржа."]}),eu=({onClick:e,eventActionText:t,eventLabel:n,...i})=>(0,o.jsx)(m.zx,{onClick:i=>{null==e||e(i),x({eventCategory:eo,eventActionType:w.button,eventActionText:t||"",eventLabel:n})},...i}),ed=({onClick:e,eventActionType:t,eventActionText:n,eventLabel:i,chat:l,...s})=>(0,o.jsx)(m.rU,{onClick:o=>{var s,r,a;null==e||e(o),l&&(null==o||o.preventDefault(),null==(a=null==(r=null==(s=null==window?void 0:window.supportWidget)?void 0:s.craftTalk)?void 0:r.open)||a.call(r)),x({eventCategory:eo,eventActionType:t||w.link,eventActionText:n||"",eventLabel:i})},...s}),ep=({minioUrl:e,blogs:t})=>(0,o.jsxs)("div",{className:en.contactsWrapper,children:[(0,o.jsx)(a.xv,{className:en.gray,size:"16",weight:"regular",children:"Звоните или пишите"}),(0,o.jsx)("div",{className:en.phones,children:er.map(({title:e,url:t})=>(0,o.jsx)(ed,{href:t,eventActionText:e,chat:!t,children:e},e))}),(0,o.jsx)(a.xv,{className:en.gray,size:"16",weight:"regular",children:"Следите за нами в соцсетях"}),(0,o.jsx)("div",{className:en.contactsButtons,children:ea.map(({type:n,className:i,iconName:l})=>(0,o.jsx)(eu,{as:"a",href:null==t?void 0:t[n],target:"_blank",className:i,iconRight:(0,o.jsx)("img",{width:24,height:24,src:d(e,`/widgets/footer/${l}.svg`),alt:n,loading:"lazy"}),shape:"circle-icon",variant:"white",eventActionText:n,eventLabel:null==t?void 0:t[n]},n))}),(0,o.jsx)(a.xv,{className:en.gray,size:"16",weight:"regular",children:"Канал для инвесторов"}),(0,o.jsx)("div",{className:en.contactsButtons,children:(0,o.jsxs)(ed,{href:null==t?void 0:t.investTg,target:"_blank",className:en.link,eventActionText:"telegram",eventLabel:null==t?void 0:t.investTg,children:[(0,o.jsx)(eu,{className:en.tgIcon,iconRight:(0,o.jsx)("img",{width:24,height:24,src:d(e,"/widgets/footer/telegram.svg"),alt:"telegram",loading:"lazy"}),shape:"circle-icon",variant:"white",eventActionText:"telegram",eventLabel:null==t?void 0:t.investTg}),"Финуслуги Инвест"]})})]}),em=(0,p.g)("footer-disclaimer","sc"),eh=Object.freeze({disclaimer:`${em}`}),ef=e=>{let t=e=>{e.target instanceof HTMLAnchorElement&&x({eventCategory:eo,eventActionType:w.link,eventActionText:e.target.textContent||"",eventLabel:e.target.href})};return e.disclaimer?(0,o.jsx)("div",{className:(0,c.Z)(e.className,eh.disclaimer),dangerouslySetInnerHTML:{__html:e.disclaimer||""},onClick:t}):(0,o.jsx)("div",{className:(0,c.Z)(e.className,eh.disclaimer),onClick:t,children:e.children})},ev=()=>{let e=new URL(window.location.href),t=new URLSearchParams;return e.searchParams.forEach((e,n)=>{/^utm_/i.test(n)&&t.set(n,e)}),t},eg=(e="")=>{let[t,n]=(0,j.useState)(e);return(0,j.useEffect)(()=>{let t=ev();if(!t||0===t.size)return;let[i,l=""]=e.split("?"),o=new URLSearchParams(l);t.forEach((e,t)=>{o.has(t)||o.set(t,e)});let s=o.toString();n(s?`${i}?${s}`:i)},[e]),t},ew=(0,p.g)("footer-modal-body","sc"),e_=Object.freeze({wrapper:`${ew}__wrapper`,title:`${ew}__title`,item:`${ew}__item`,label:`${ew}__label`,button:`${ew}__button`,description:`${ew}__description`}),ex=({directions:e})=>(0,o.jsxs)("div",{className:e_.wrapper,children:[(0,o.jsx)("div",{className:e_.title,children:"Направления"}),e.map(e=>(0,o.jsxs)(ed,{className:e_.item,href:e.url,target:"_blank",eventActionText:e.name,eventLabel:`${e.name}_${e.url}`,children:[(0,o.jsxs)("div",{className:e_.label,children:[(0,o.jsx)("span",{children:e.name}),(0,o.jsx)(eu,{className:e_.button,iconRight:(0,o.jsx)(b.IconFdsArrowUpRightSmallO,{size:28}),shape:"circle-icon",eventActionText:"IconFdsArrowUpRightSmallO"})]}),(0,o.jsx)("p",{className:e_.description,children:e.description})]},e.url))]}),eb=(0,p.g)("footer-popup","sc"),ej=Object.freeze({wrapper:`${eb}__wrapper`,button:`${eb}__button`,icon:`${eb}__icon`,buttonWrapper:`${eb}__button-wrapper`}),ey=({directions:e})=>{let t=(0,m._m)("l"),[n,i]=(0,j.useState)(!1),l=()=>{i(!1)};return(0,o.jsxs)("div",{className:ej.wrapper,children:[(0,o.jsx)("div",{className:ej.buttonWrapper,children:(0,o.jsx)(eu,{className:ej.button,appearance:"ghost",variant:"white",onClick:()=>{i(!0)},label:"Все направления",eventActionText:"Все направления",iconLeft:(0,o.jsx)("div",{className:ej.icon,children:[1,2,3,4,5,6,7,8,9].map(e=>(0,o.jsx)("div",{},e))})})}),(0,o.jsxs)(ee,{children:[!t&&(0,o.jsx)(X,{isOpen:n,onClose:l,full:!0,children:(0,o.jsx)(ex,{directions:e})}),t&&(0,o.jsx)(V,{isOpen:n,onClose:l,width:"804px",children:(0,o.jsx)(ex,{directions:e})})]})]})},e$=(0,p.g)("footer-left-column","sc"),eN=Object.freeze({leftColumn:`${e$}__left-column`,logoWrapper:`${e$}__logo-wrapper`,banner:`${e$}__banner`,mobAppLink:`${e$}__mob-app-link`,br:`${e$}__br`}),ek=({showcaseUrl:e,minioUrl:t,directions:n,mobAppUrl:i})=>{let l=eg(i);return(0,o.jsxs)("div",{className:eN.leftColumn,children:[(0,o.jsx)(ed,{className:eN.logoWrapper,href:e,eventActionType:w.icon,eventActionText:"finuslugi_logo",eventLabel:`finuslugi_logo_${e}`,children:(0,o.jsx)("img",{src:d(t,"/widgets/footer/finuslugi_base_logo.svg"),alt:"finuslugi logo",loading:"lazy"})}),(0,o.jsx)(ey,{directions:n??[]}),(0,o.jsx)(ed,{href:l,target:"_blank",eventActionType:w.banner,eventActionText:"Управляйте финансами через приложение Финуслуг",eventLabel:l,className:eN.mobAppLink,children:(0,o.jsxs)(a.Zb,{className:eN.banner,children:[(0,o.jsxs)(a.xv,{weight:"medium",children:["Управляйте финансами",(0,o.jsx)("br",{}),"через приложение",(0,o.jsx)("br",{className:eN.br})," Финуслуг"]}),(0,o.jsx)(eu,{iconRight:(0,o.jsx)(b.IconFdsArrowUpRightSmallO,{size:32}),shape:"circle-icon",variant:"white",eventActionText:"IconFdsArrowUpRightSmallO"}),(0,o.jsxs)("picture",{children:[(0,o.jsx)("source",{srcSet:d(t,"/widgets/footer/apps_d.webp"),media:"(min-width: 1024px)"}),(0,o.jsx)("img",{src:d(t,"/widgets/footer/apps_m.webp"),alt:"иллюстрация мобильного приложения",loading:"lazy"})]})]})})]})},eC=(0,p.g)("footer-logo","sc"),eO=Object.freeze({wrapper:`${eC}__wrapper`,link:`${eC}__link`,fromMoex:`${eC}__from-moex`,logo:`${eC}__logo`,white:`${eC}__wrapper--white`}),eT=({showcaseUrl:e,minioUrl:t,isWhite:n})=>(0,o.jsx)("div",{className:(0,c.Z)(eO.wrapper,{[eO.white]:n}),children:(0,o.jsxs)(ed,{className:eO.link,href:e,eventActionType:w.icon,eventActionText:"finuslugi_logo",eventLabel:`finuslugi_logo_${e}`,children:[(0,o.jsx)("img",{className:eO.logo,src:`${t}/images/logo-brandmark-common-finuslugi.svg`}),(0,o.jsx)("img",{className:eO.fromMoex,src:`${t}/images/fromMoex.svg`})]})});var eS=((l=eS||{}).BLACK="black",l.GRAY="gray",l);let eA=(0,p.g)("footer-warning","sc"),eI=Object.freeze({reservedSpace:`${eA}__reserved-space`,wrapper:`${eA}__wrapper`,wrapperGray:`${eA}__wrapper--gray`,fixed:`${eA}__wrapper--fixed`,container:`${eA}__container`,text:`${eA}__text`,invisibleText:`${eA}__text--invisible`}),eL=({text:e,variant:t,fixed:n,isPlaceholder:i})=>(0,o.jsx)("div",{className:(0,c.Z)(eI.wrapper,{[eI.wrapperGray]:"gray"===t,[eI.fixed]:n&&!i}),children:(0,o.jsx)(a.W2,{className:eI.container,children:(0,o.jsx)("div",{className:(0,c.Z)(eI.text,{[eI.invisibleText]:i}),dangerouslySetInnerHTML:{__html:e}})})}),eR=({warning:e})=>{let t="string"==typeof e?{text:e}:e,n={text:t.text,fixed:t.fixed??!0,variant:t.variant??eS.BLACK};return(0,o.jsxs)("div",{className:eI.reservedSpace,children:[(0,o.jsx)(eL,{...n,isPlaceholder:n.fixed}),n.fixed&&(0,o.jsx)(eL,{...n,fixed:!0})]})},ez=({data:e,showcaseUrl:t="https://finuslugi.ru",minioUrl:n="https://assets.finuslugi.ru/mp-assets",customDisclaimer:i,variant:l="default",className:s})=>{var r,u;let d=!i&&null!=e&&e.disclaimer?e.disclaimer:void 0,p=l.includes("compact"),m=l.includes("white"),h=null==(r=null==e?void 0:e.bottom)?void 0:r.concat(p?es:[]),f=e&&"warning"in e?e.warning:void 0;return e?(0,o.jsx)("footer",{className:(0,c.Z)(el.wrapper,s,{[el.compact]:p,[el.white]:m}),children:(0,o.jsxs)("section",{className:el.section,children:[(0,o.jsxs)(a.W2,{className:el.container,children:[!p&&(0,o.jsx)(ek,{showcaseUrl:t,minioUrl:n,directions:null==e?void 0:e.directions,mobAppUrl:null==e?void 0:e.mobAppUrl}),(0,o.jsx)("div",{className:el.wrapper,children:(0,o.jsxs)("div",{className:el.top,children:[(0,o.jsxs)("div",{children:[(0,o.jsxs)("div",{className:el.main,children:[!p&&(0,o.jsx)("div",{className:el.links,children:null==(u=null==e?void 0:e.top)?void 0:u.map(e=>(0,o.jsx)(ed,{href:e.url,eventActionText:e.title,eventLabel:e.url,children:e.title},e.url))}),p&&(0,o.jsx)(eT,{showcaseUrl:t,minioUrl:n,isWhite:m}),(0,o.jsx)(ef,{className:el.disclaimer,disclaimer:d,children:i||ec})]}),(0,o.jsxs)("div",{className:el.bottom,children:[(0,o.jsx)("div",{className:el.bottomLinks,children:null==h?void 0:h.map(e=>(0,o.jsx)(ed,{href:e.url,eventActionText:e.title,eventLabel:e.url,children:e.title},e.url))}),(0,o.jsx)(ef,{className:el.bottomDisclaimer,disclaimer:null==e?void 0:e.bottomDisclaimer})]})]}),!p&&(0,o.jsx)(ep,{minioUrl:n,blogs:null==e?void 0:e.blogs})]})})]}),p&&!!f&&(0,o.jsx)(eR,{warning:f})]})}):null},eP=(0,p.g)("header","sc"),eE=Object.freeze({header:`${eP}`,fixed:`${eP}__fixed`,hidden:`${eP}__fixed--hidden`,transparent:`${eP}--transparent`,navigationOpen:`${eP}__navigation-open`,container:`${eP}__container`,leftRow:`${eP}__left-row`,logo:`${eP}__logo`,menuItems:`${eP}__menu-items`,menuItemActive:`${eP}__menu-item-active`,tabletMenuButton:`${eP}__tablet-menu-button`,buttonGroup:`${eP}__button-group`,chips:`${eP}__chips`,menuButton:`${eP}__menu-button`,moreButtons:`${eP}__more-buttons`,auth:`${eP}__auth`,whiteIcons:`${eP}__white-icons`,close:`${eP}__close`,removed:`${eP}__removed`,overlay:`${eP}__overlay`,overlayOpening:`${eP}__overlay--opening`,overlayClosing:`${eP}__overlay--closing`}),eM="user_region",eB="user_town",eU="cb-header",eW=[{id:"FINPRODUCTS",label:"Финпродукты"},{id:"NAVIGATOR",label:"Журнал"},{id:"ABOUT",label:"О маркетплейсе"}],eF=eW.reduce((e,t)=>(e[t.id]=t.label,e),{}),eZ=Object.freeze({mobile:56,desktop:80});var eD=n(5487);let eG=(e,t,n)=>{if(typeof window>"u"||typeof document>"u")return;let i=document.getElementById("mainHomeBanner"),l=!1,o=0,s=0,r=()=>window.innerWidth<768,a=r(),c=()=>window.scrollY||document.documentElement.scrollTop,u=()=>{let e=document.querySelector(":root");e&&(s=parseFloat(window.getComputedStyle(e).getPropertyValue("--fixed-header-height")),o=c())},d=()=>{let e=r();e!==a&&(a=e,s=0)},p=function(){let r=c(),a=document.getElementById("headerNotice"),d=null==a?void 0:a.getAttribute("data-opening");if("true"===d)return;s||u();let p=r<s,m=r<((null==i?void 0:i.clientHeight)||0);if(n&&m||p){l=!1,e(!1),t(!0);return}e(l=r>o),l&&setTimeout(()=>t(!1),50);let h=l?"0px":"false"===d?`${s}px`:"";document.documentElement.style.setProperty("--new-header-height-desktop",h),document.documentElement.style.setProperty("--new-header-height-mobile",h),o=r<=0?0:r};return window.addEventListener("scroll",p),window.addEventListener("resize",d),()=>{window.removeEventListener("scroll",p),window.removeEventListener("resize",d)}},eV=()=>{let e=new URLSearchParams(window.location.search),t={};for(let[n,i]of Array.from(e.entries()))n.startsWith("utm_")&&(t[n]=i);return Object.keys(t).length>0?t:null},eH=()=>document.cookie.split(";").some(e=>e.trim().startsWith("utm_params=")),eq=(e,t,n)=>{let i=new Date;i.setTime(i.getTime()+864e5*n);let l=encodeURIComponent(JSON.stringify(t)),o=`;domain=.${window.location.hostname}`;document.cookie=`${e}=${l};expires=${i.toUTCString()};path=/;SameSite=Lax${o}`},eJ=()=>{let e=eV();e&&!eH()&&eq("utm_params",e,90),e&&eq("utm_last",e,90)},eQ=()=>{setTimeout(()=>{if(!(typeof document>"u"||"string"!=typeof document.cookie))try{eJ()}catch(e){console.error("UTM tracking error:",e)}},0)},eY=(e,t,n)=>x({eventCategory:eU,eventActionType:e,eventActionText:t,eventLabel:n}),eK=(0,p.g)("navigation-chips","sc"),eX=Object.freeze({wrapper:`${eK}__wrapper`,gray:`${eK}__variantGray`,white:`${eK}__variantWhite`,container:`${eK}__container`,chip:`${eK}__chip`,more:`${eK}__chip--more`,active:`${eK}__chip--active`,label:`${eK}__label`,hidden:`${eK}__hidden`}),e0=(0,p.g)("navigation-content","sc"),e1=Object.freeze({contentWrapper:`${e0}__content-wrapper`,content:`${e0}__content`,contentOpen:`${e0}__content--open`,contentHeader:`${e0}__content-header`,contentTitle:`${e0}__content-title`,contentTitleUrl:`${e0}__content-title--url`,contentTitleLink:`${e0}__content-title--link`,contentTitleNew:`${e0}__content-title--new`,new:`${e0}__new`,vip:`${e0}__vip`,arrowIcon:`${e0}__arrow-icon`,links:`${e0}__links`,linksColumns:`${e0}__links--columns`,linksTitleless:`${e0}__links--titleless`,removed:`${e0}__removed`,hidden:`${e0}__content--hidden`}),e2=({chip:e,hidden:t,onClick:n,refCallback:i,activeChipId:l})=>{let s=!!n,r=()=>{if(s)return null==n?void 0:n(e.url);eY(w.chip,e.title,`${e.title}_${e.url}`)},a=(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:eX.label,children:e.title}),e.arrow&&(0,o.jsx)(b.IconFdsArrowUpRightSmallO,{size:24})]}),u=(0,c.Z)(eX.chip,{[eX.hidden]:t,[e1.new]:!!e.new,[e1.vip]:!!e.vip,[eX.active]:e.url===l});return s?(0,o.jsx)("button",{type:"button",className:u,onClick:r,ref:i,children:a}):(0,o.jsx)("a",{href:e.url,className:u,onClick:r,ref:i,children:a})},e4=({items:e=[],maxNumberOfLines:t,variant:n,className:i,activeChipId:l,onClick:s})=>{let r=(0,j.useRef)(null),a=(0,j.useRef)(null),u=(0,j.useRef)({}),[d,p]=(0,j.useState)(!1),[m,h]=(0,j.useState)(e.length),[f,v]=(0,j.useState)(!1);(0,j.useMemo)(()=>{let t=u.current;e.forEach(e=>{e.url in t||(t[e.url]=null)}),Object.keys(t).forEach(n=>{e.find(e=>String(e.url)===String(n))||delete t[n]})},[e]);let g=(0,j.useCallback)(()=>{let n=r.current;if(!n)return;let i=e=>e?e.getBoundingClientRect().width:0,l=i(n),o=Math.max(Number(t)||0,0),s=()=>{h(e.length),v(!1)};if(d||0===o||l<=0){s();return}let c=(()=>{try{let e=getComputedStyle(n),t=parseFloat(e.columnGap||e.gap||"12");return Number.isNaN(t)?12:t}catch{return 12}})(),p=i(a.current),m=e.map(e=>i(u.current[e.url]));if(m.some(e=>0===e)){s();return}let f=1,g=0,w=0;for(let e of m){let t=f===o?p+c:0,n=0===g?e:g+c+e;if(n+t<=l-.5)g=n,w++;else{if(++f>o)break;g=e,w++}}v(w<e.length),h(w)},[d,e,t]);(0,j.useLayoutEffect)(()=>{let e=r.current;if(!e)return;let t=new ResizeObserver(()=>{requestAnimationFrame(g)});return t.observe(e),requestAnimationFrame(g),()=>{t.disconnect()}},[g]),(0,j.useEffect)(()=>{requestAnimationFrame(g)},[g]);let _=d||(t??0)<=0||!f;return(0,o.jsx)("div",{className:(0,c.Z)(i,eX.wrapper,{[eX.gray]:"gray"===n,[eX.white]:"white"===n}),children:(0,o.jsxs)("div",{ref:r,className:eX.container,children:[e.map((e,t)=>(0,o.jsx)(e2,{chip:e,hidden:!_&&t>=m,activeChipId:l,onClick:s,refCallback:t=>{u.current[e.url]=t}},e.url)),!_&&f&&(0,o.jsxs)("button",{type:"button",ref:a,className:(0,c.Z)(eX.chip,eX.more),onClick:()=>{eY(w.chip,"Еще"),p(!0)},children:[(0,o.jsx)(b.IconFdsDotsVerticalO,{size:20}),(0,o.jsx)("span",{className:eX.label,children:"Еще"})]}),(_||!f)&&(0,o.jsxs)("button",{type:"button",ref:a,className:(0,c.Z)(eX.chip,eX.more,eX.hidden),tabIndex:-1,"aria-hidden":"true",children:[(0,o.jsx)(b.IconFdsDotsVerticalO,{size:20}),(0,o.jsx)("span",{className:eX.label,children:"Еще"})]})]})})},e5=(e,t)=>{if(!(typeof document>"u")){if(!e&&!t){eD.a.removeItem(eM),eD.a.removeItem(eB);return}eD.a.setItem(eM,JSON.stringify(e)||"",{"max-age":31536e3}),eD.a.setItem(eB,JSON.stringify(t)||"",{"max-age":31536e3})}},e3=e=>{if(typeof document>"u")return null;let t=eD.a.getItem(e)??void 0;if(!t||"undefined"===t)return null;try{return JSON.parse(decodeURIComponent(t))}catch{return null}},e7=function(e){if(typeof window>"u"||!window.localStorage)return null;let t=window.localStorage.getItem(e);if(!t||"undefined"===t)return null;try{return JSON.parse(t)}catch(t){console.warn(`Invalid object in localStorage for key "${e}": ${t}`)}return null},e6=()=>{if(typeof window>"u")return[];if(Array.isArray(window.allRegions)&&window.allRegions.length>0)return window.allRegions;let e=e7("all_regions")||[];return window.allRegions=e,e},e8=e=>{let t={};return e.map(({id:e,name:n,towns:i})=>(i.forEach(i=>{i.parentId=e,t[i.name]=t[i.name]||{},t[i.name][i.id]=n}),i)).reduce((e,n)=>(n.forEach(e=>{Object.keys(t[e.name]).length>1&&(e.parentName=t[e.name][e.id])}),[...e,...n]),[])},e9=async()=>{let e={regions:[]};try{e=await (await fetch("https://finuslugi.ru/money_data/Root.json?short=1")).json()}catch(e){console.warn(e)}let t=null!=e&&e.regions?e.regions:[];return t.length<1?[]:(window.allRegions=t,window.localStorage.setItem("all_regions",JSON.stringify(t)),window.localStorage.setItem("lastRegionsUpdateUnixTimestamp",JSON.stringify(Date.now())),t)},te=async e=>{let t=null;try{t=await (await fetch(`${e}`,{method:"GET"})).json()}catch(e){console.warn(e)}return t||null},tt=(e,t,n)=>{x({eventCategory:to,eventActionType:e,eventActionText:t,eventLabel:n})},tn=e6(),ti=e8(tn),tl={regions:tn,towns:ti,region:null,town:null,startPopupVisible:!1,setStartPopupVisible:()=>null,popupVisible:!1,handleToggleModal:()=>null,selectCity:()=>null,handleButtonClick:()=>null,startRegion:null,startTown:null},to="finkit-widgets-sc-city-select",ts=(0,j.createContext)(tl);function tr(){return(0,j.useContext)(ts)}let ta=({children:e,initialRegion:t,initialTown:n,showStartGeoPopup:i=!0,lastRegionsUpdateUnixTimestamp:l,dadataUrl:s="https://finuslugi.ru/backend/money/dadata"})=>{let r=Number(e7("lastRegionsUpdateUnixTimestamp")||0),a=Number(l||0)>r,[c,u]=(0,j.useState)(e6()),[{startRegion:d,startTown:p},m]=(0,j.useState)({startRegion:tl.startRegion,startTown:tl.startTown}),h=t??tl.region,f=n??tl.town,[{region:v,town:g},_]=(0,j.useState)({region:h,town:f}),[x,b]=(0,j.useState)(tl.startPopupVisible),[y,$]=(0,j.useState)(tl.popupVisible),N=(0,j.useRef)(""),k=(0,j.useMemo)(()=>e8(c),[c.length]),C=(0,j.useCallback)((e,t)=>{window.sessionStorage.setItem("start_popup_opened","1"),window.localStorage.setItem("auto_town",JSON.stringify(t)||""),window.localStorage.setItem("auto_region",JSON.stringify(e)||""),b(!0),m({startRegion:e,startTown:t})},[b,m]),O=(0,j.useCallback)((e,t)=>{window.sessionStorage.getItem("start_popup_opened")||C(e,t)},[C]),T=(0,j.useCallback)(()=>{if(N.current&&!v&&!g){let e=k.find(e=>e.name===N.current)??null;return O(c.find(t=>t.id===(null==e?void 0:e.parentId))??null,e)}O(v,g)},[v,g,k,c,O]),S=(0,j.useCallback)(e=>{$(e)},[$]),A=(0,j.useCallback)(e=>{e?tt(w.icon,"location"):tt(w.button,(null==g?void 0:g.name)||"Вся Россия"),!i||window.sessionStorage.getItem("start_popup_opened")?S(!0):T()},[i,g,S,T]),I=(0,j.useCallback)((e,t)=>{e||t?(window.localStorage.setItem("all_russia_selected","0"),window.localStorage.setItem(eM,JSON.stringify(e)||""),window.localStorage.setItem(eB,JSON.stringify(t)||""),e5(e||null,t||null)):(window.localStorage.setItem("all_russia_selected","1"),window.localStorage.setItem(eM,""),window.localStorage.setItem(eB,""),e5(null,null)),_({region:e||null,town:t||null}),b(!1),S(!1);let n=new CustomEvent("onRegionChange",{detail:{region:e,town:t}});document.dispatchEvent(n)},[S]),L=()=>{_({region:e3(eM)??e7(eM),town:e3(eB)??e7(eB)});let e=async({coords:{latitude:e,longitude:t}})=>{let n=`${s}?lat=${e}&lon=${t}`,i=await te(n);null!=i&&i.location&&(N.current=i.location.data.city)};if(!window.localStorage.getItem("dadata")&&navigator.geolocation&&i)try{navigator.geolocation.getCurrentPosition(e,()=>null)}catch{}};return(0,j.useEffect)(()=>{if((c.length<1||a)&&e9().then(e=>u(e)),window.innerWidth<1024){let e=()=>{L(),window.removeEventListener("scroll",e)};window.addEventListener("scroll",e)}else setTimeout(()=>{L()},0)},[]),(0,o.jsx)(ts.Provider,{value:{regions:c,towns:k,region:v,town:g,startPopupVisible:x,setStartPopupVisible:b,popupVisible:y,handleToggleModal:S,selectCity:I,handleButtonClick:A,startRegion:d,startTown:p},children:e})},tc=()=>{let e=(0,j.useRef)(null),t=(0,j.useCallback)(()=>{e.current&&(clearTimeout(e.current),e.current=null)},[]),n=(0,j.useCallback)((t,n)=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{e.current=null,t()},n)},[]);return(0,j.useEffect)(()=>t,[t]),{start:n,clear:t,pending:!!e.current}},tu=(0,p.g)("city-select-modal-body","sc"),td=Object.freeze({wrapper:`${tu}__wrapper`,subtitle:`${tu}__subtitle`,hintWrapper:`${tu}__hint-wrapper`,hintText:`${tu}__hint-text`,input:`${tu}__input`,chips:`${tu}__chips`,townsListWrapper:`${tu}__towns-list-wrapper`,townsList:`${tu}__towns-list`,townsGroup:`${tu}__towns-group`,townsGroupLabel:`${tu}__towns-group-label`,townsGroupList:`${tu}__towns-group-list`,townsName:`${tu}__towns-name`,regionName:`${tu}__region-name`}),tp=({groupedTowns:e,chips:t,query:n,setQuery:i,isDrawer:l})=>{var s;let r=tr(),a=(0,j.useRef)(null),[c,u]=(0,j.useState)("10000px");(0,j.useEffect)(()=>{if(!l||!a.current)return;let e=e=>e.reduce((e,t)=>e+t,0),t=(n,i)=>{let l=n.map(e=>[...e]),o=l.map(e),s=o.reduce((e,t,n)=>t<o[e]?n:e,0);0===s&&l[0].push(l[1].shift()),2===s&&l[2].unshift(l[1].pop()),1===s&&o[0]>o[2]&&l[1].unshift(l[0].pop()),1===s&&o[0]<o[2]&&l[1].push(l[2].shift());let r=Math.max(...l.map(e));return r>=i?i:t(l,r)};new ResizeObserver(()=>{var e;if(!(null!=(e=a.current)&&e.children))return;let n=Array.from(a.current.children,e=>e.offsetHeight+32);if(0===n.length)return;let i=0;try{i=t([[],n,[]],1/0)}catch{i=0}i>0&&u(`${i}px`)}).observe(a.current)},[]);let d=e=>{if(tt(w.button,(null==e?void 0:e.name)||"Вся Россия"),!(null!=e&&e.id))return r.selectCity();let t=r.regions.find(t=>t.id===Number(e.parentId))||null;r.selectCity(t,e)};return(0,o.jsxs)("div",{className:td.wrapper,children:[(0,o.jsxs)("div",{className:td.subtitle,children:["Покажем предложения рядом с вами",(0,o.jsxs)("div",{className:td.hintWrapper,children:[(0,o.jsx)(b.IconFdsQuestionCircleO,{size:24}),(0,o.jsx)("div",{className:td.hintText,children:"Укажите свой город, чтобы увидеть предложения, доступные в вашем регионе"})]})]}),(0,o.jsx)(m.MA,{className:td.input,value:n,onChange:i,size:"s",placeholder:"Введите название города",icon:n?(0,o.jsx)(b.IconFdsCloseCircleO,{size:24,onClick:()=>i("")}):(0,o.jsx)(b.IconFdsSearchO,{size:24})}),(0,o.jsx)(m.cL,{className:td.chips,chips:t,value:(null==(s=r.town)?void 0:s.id)||0,onChipClick:e=>{d(r.towns.find(t=>t.id===e))}}),(0,o.jsx)("div",{className:td.townsListWrapper,children:(0,o.jsx)("div",{ref:a,className:td.townsList,style:{maxHeight:c},children:e.map(e=>(0,o.jsxs)("div",{className:td.townsGroup,children:[(0,o.jsx)("div",{className:td.townsGroupLabel,children:e.letter}),(0,o.jsx)("div",{className:td.townsGroupList,children:e.towns.map(e=>(0,o.jsxs)("button",{type:"button",onClick:()=>d(e),children:[(0,o.jsx)("div",{className:td.townsName,children:e.name}),(0,o.jsx)("div",{className:td.regionName,children:e.parentName})]},e.id))})]},e.letter))})})]})},tm=[1095,1096,134,720,189,180],th=()=>{var e;let t=tr(),n=(0,m._m)("l"),[i,l]=(0,j.useState)(""),s=`Ваш выбор: ${(null==(e=t.town)?void 0:e.name)||"Вся Россия"}`,r=(0,j.useMemo)(()=>t.towns.filter(e=>-1!==String(e.name).toLocaleLowerCase().indexOf(i.toLocaleLowerCase())).sort((e,t)=>e.name.localeCompare(t.name)).reduce((e,t)=>{let n=e.pop();return n||(n={letter:t.name[0],towns:[]}),n.letter!==t.name[0]&&(e.push(n),n={letter:t.name[0],towns:[]}),n.towns.push(t),e.push(n),e},[]),[i,t.towns.length]),a=(0,j.useMemo)(()=>[{id:0,label:"Вся Россия"},...tm.map(e=>{let n=t.towns.find(t=>t.id===e);return{id:null==n?void 0:n.id,label:null==n?void 0:n.name}}).filter(e=>(null==e?void 0:e.id)!==void 0)],[t.towns.length]),c=()=>{tt(w.button,"close"),t.handleToggleModal(!1)};return(0,o.jsxs)(ee,{children:[!n&&(0,o.jsx)(X,{title:s,isOpen:t.popupVisible,onClose:c,full:!0,children:(0,o.jsx)(tp,{groupedTowns:r,chips:a,query:i,setQuery:l})}),n&&(0,o.jsx)(V,{title:s,isOpen:t.popupVisible,onClose:c,width:"856px",rowTitle:!0,titleAlign:"left",children:(0,o.jsx)(tp,{groupedTowns:r,chips:a,query:i,setQuery:l,isDrawer:!0})})]})},tf={"uat-mp.beta.moex.com":"//chat-marketplace.beta.moex.com","finuslugi.ru":"//chat.finuslugi.ru","dev-rc.beta.moex.com":"//dev-opbot.tech.finuslugi.ru"},tv=()=>{let{hostname:e}=window.location;return Object.prototype.hasOwnProperty.call(tf,e)?tf[e]:tf["finuslugi.ru"]},tg=(e,t)=>{let n=document.createElement("link");n.rel="stylesheet",n.type="text/css",n.href=`${e}/assets/css/${t}`,document.head.appendChild(n);let i=document.createElement("script");i.src=`${e}/get-bootstrap/${t}`,i.defer=!0,document.body.appendChild(i)},tw=()=>new MutationObserver(e=>{e.forEach(e=>{if("style"===e.attributeName){let e=document.querySelector(".webchat"),t=!!e&&"none"!==e.style.display;window.supportWidget&&window.supportWidget.craftTalk&&(window.supportWidget.craftTalk.isOpened=t)}})}),t_=()=>{let[e,t]=(0,j.useState)(!1),[n,i]=(0,j.useState)(!1),l=(0,j.useRef)(!1),o=e=>{l.current=e,i(e)};return(0,j.useEffect)(()=>{if(typeof window>"u")return;let e=tv(),n="webchat_main";window.supportWidget={craftTalk:{isOpened:!1,setConfig:t=>{if(t.host&&(e=t.host),t.channel&&(n=t.channel),t.user){let e="function"==typeof t.user?t.user:()=>({...t.user});window.__WebchatUserCallback=e}},open:()=>new Promise(e=>{e()}),close:()=>null,toggle:()=>null}};let i=null;window.supportWidget&&window.supportWidget.craftTalk&&(window.supportWidget.craftTalk.open=()=>new Promise((s,r)=>{if(l.current){r(Error("chat is already opened"));return}i?(i.openWidget(),t(!1),s()):(o(!0),window.getWebChatCraftTalkExternalControl=e=>{var n;i=e;let l=document.querySelector(".webchat");l&&tw().observe(l,{attributes:!0,attributeFilter:["style"]}),null!=(n=window.supportWidget)&&n.craftTalk&&(window.supportWidget.craftTalk.close=i.closeWidget),null==i||i.openWidget(),o(!1),t(!1),s()},tg(e,n))}),window.supportWidget.craftTalk.toggle=()=>{var e,t,n,i;null!=(t=null==(e=window.supportWidget)?void 0:e.craftTalk)&&t.isOpened?window.supportWidget.craftTalk.close():null==(i=null==(n=window.supportWidget)?void 0:n.craftTalk)||i.open()})},[]),{isChatModalOpen:e,setIsChatModalOpen:t,isChatLoading:n}},tx=(0,j.createContext)({isAuth:!1,isHeaderHidden:!1,isHeaderTransparent:!1,openedBlock:null,setOpenedBlock:()=>null,openedSection:null,setOpenedSection:()=>null,isNavigationOpen:!1,isNavigationMounted:!1,navMenuItemsRef:{current:null},navigationRef:{current:null},ignoreClicks:!1,setIgnoreClicks:()=>null,isChatModalOpen:!1,setIsChatModalOpen:()=>null,isChatLoading:!1,fixedContainerRef:{current:null},headerRef:{current:null}});function tb(){return(0,j.useContext)(tx)}let tj=e=>{let[t,n]=(0,j.useState)(!1),[i,l]=(0,j.useState)(!1),[s,r]=(0,j.useState)(!!e.isMainBannerPage),{isChatModalOpen:a,setIsChatModalOpen:c,isChatLoading:u}=t_(),[d,p]=(0,j.useState)(null),[m,h]=(0,j.useState)(null),[f,v]=(0,j.useState)(!1),[g,w]=(0,j.useState)(!1),[_,x]=(0,j.useState)(!1),b=(0,j.useRef)(null),y=P(f),$=(0,j.useRef)(null),N=(0,j.useRef)(null),k=(0,j.useRef)(null),C=(0,j.useRef)(null),O=(0,j.useCallback)(()=>{y.current&&y.current.scrollTo({top:0})},[y]),T=(0,j.useCallback)(e=>{h(e),O()},[O]),S=(0,j.useCallback)(e=>{$.current&&clearTimeout($.current),e&&w(!0),e||($.current=setTimeout(()=>{w(!1),T(null)},300))},[T]),A=(0,j.useCallback)((e,t,n)=>{if(t&&T(t),!n&&e===d||!e){S(!f),v(!f);return}p(e),S(!0),v(!0)},[d,T,f,S]),I=(0,j.useCallback)(()=>{N.current&&clearTimeout(N.current),x(!0),N.current=setTimeout(()=>{x(!1)},650)},[]);return(0,j.useEffect)(()=>{n(!!document.cookie.includes("auth.gtm_customer_id"));let t=eG(l,r,e.isMainBannerPage);return eQ(),t},[]),(0,o.jsx)("header",{children:(0,o.jsx)(tx.Provider,{value:{isAuth:t,isHeaderHidden:i,isHeaderTransparent:s,openedBlock:d,setOpenedBlock:A,openedSection:m,setOpenedSection:T,isNavigationOpen:f,isNavigationMounted:g,navMenuItemsRef:b,navigationRef:y,ignoreClicks:_,setIgnoreClicks:I,isChatModalOpen:a,setIsChatModalOpen:c,isChatLoading:u,fixedContainerRef:k,headerRef:C},children:e.children})})},ty=({label:e,onClick:t,eventActionText:n,eventLabel:i,...l})=>(0,o.jsx)(m.zx,{label:e,onClick:e=>{null==t||t(e),x({eventCategory:eU,eventActionType:w.button,eventActionText:n||"",eventLabel:i||""})},...l}),t$=(0,p.g)("header-popup","sc"),tN=Object.freeze({popup:`${t$}__popup`,popupHeader:`${t$}__popup-header`,popupClose:`${t$}__popup-close`,body:`${t$}__body`}),tk=({isOpen:e,onClose:t,children:n,title:i})=>{let l=(0,m._m)("l");return(0,o.jsxs)(ee,{children:[!l&&(0,o.jsx)(X,{title:i,isOpen:e,onClose:t,children:n}),l&&e&&(0,o.jsxs)("div",{className:tN.popup,children:[(0,o.jsxs)("div",{className:tN.popupHeader,children:[i,(0,o.jsx)(ty,{className:tN.popupClose,iconLeft:(0,o.jsx)(b.IconFdsCloseO,{}),shape:"icon",appearance:"ghost",size:"xs",onClick:t,eventActionText:"IconFdsCloseO"})]}),(0,o.jsx)("div",{className:tN.body,children:n})]})]})},tC=(0,p.g)("start-choice-popup","sc"),tO=Object.freeze({top:`${tC}__top`,progress:`${tC}__progress`,innerCircle:`${tC}__inner-circle`,title:`${tC}__title`,subtitle:`${tC}__subtitle`,actions:`${tC}__actions`}),tT=()=>{var e,t;let n=tr(),[i,l]=(0,j.useState)(10),[s,r]=(0,j.useState)(0),a=(0,j.useRef)(void 0),c=()=>{tt(w.button,"close_choose_popup"),window.localStorage.setItem("auto_town",JSON.stringify(n.startTown)||""),window.localStorage.setItem("auto_region",JSON.stringify(n.startRegion)||""),n.setStartPopupVisible(!1)};return(0,j.useEffect)(()=>{n.startPopupVisible?(()=>{let e=Number((" "+i).slice(1)),t=1e3*e/100,n=0,o=0;a.current=setInterval(()=>{n++,o+=t,r(3.6*n);let s=e-Math.floor(o/1e3);s<i&&l(s),100===n&&(clearInterval(a.current),c())},t)})():(clearInterval(a.current),l(10),r(0))},[n.startPopupVisible]),(0,o.jsxs)(tk,{isOpen:n.startPopupVisible,onClose:c,title:(0,o.jsx)("button",{type:"button",className:tO.progress,style:{background:`conic-gradient(#ff0508 ${s}deg, #e3e7ec 0deg)`},onClick:c,children:(0,o.jsx)("div",{className:tO.innerCircle,children:i})}),children:[(0,o.jsxs)("div",{className:tO.top,children:[(0,o.jsxs)("div",{className:tO.title,children:["Ваш город ",(null==(e=n.startTown)?void 0:e.name)||(null==(t=n.startRegion)?void 0:t.name)||"Вся Россия","?"]}),(0,o.jsx)("div",{className:tO.subtitle,children:"Это поможет вам увидеть выгодные предложения в вашем городе"})]}),(0,o.jsxs)("div",{className:tO.actions,children:[(0,o.jsx)(ty,{size:"s",stretch:!0,eventActionText:"Да, все верно",onClick:()=>{tt(w.button,"Да, все верно"),n.selectCity(n.startRegion,n.startTown)},children:"Да, все верно"}),(0,o.jsx)(ty,{variant:"secondary",size:"s",stretch:!0,eventActionText:"Нет, изменить",onClick:()=>{tt(w.button,"Нет, изменить"),n.setStartPopupVisible(!1),n.handleToggleModal(!0)},children:"Нет, изменить"})]})]})},tS=(0,p.g)("city-select","sc"),tA=Object.freeze({button:`${tS}__button`,minimal:`${tS}__minimal`,full:`${tS}__full`}),tI=({initialTown:e})=>{var t;let n=tr(),i=(null==(t=n.town)?void 0:t.name)||e||"Вся Россия",{setIsChatModalOpen:l,isChatModalOpen:s}=tb(),{startPopupVisible:r,setStartPopupVisible:a,popupVisible:u}=n,d=(0,j.useRef)();(0,j.useEffect)(()=>{u&&(d.current="popup")},[u]),(0,j.useEffect)(()=>{s&&(d.current="chat")},[s]),(0,j.useEffect)(()=>{r&&(d.current="startPopup")},[r]),(0,j.useEffect)(()=>{d.current&&("chat"===d.current&&r?a(!1):["startPopup","popup"].includes(d.current)&&s&&l(!1))},[u,s,r,a,l]);let p={appearance:"ghost",size:"xs",onClick:()=>n.handleButtonClick(!1),iconLeft:(0,o.jsx)(b.IconFdsLocationO,{size:24})};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(m.zx,{...p,className:(0,c.Z)(tA.button,tA.full),label:i}),(0,o.jsx)(m.zx,{...p,className:(0,c.Z)(tA.button,tA.minimal),shape:"icon"}),(0,o.jsx)(th,{}),(0,o.jsx)(tT,{})]})},tL=({onClick:e,eventActionType:t,eventActionText:n,eventLabel:i,...l})=>(0,o.jsx)(m.rU,{onClick:l=>{null==e||e(l),x({eventCategory:eU,eventActionType:t||w.link,eventActionText:n||"",eventLabel:i||""})},...l}),tR=(0,p.g)("header-mobile-app-banner","sc"),tz=Object.freeze({wrapper:`${tR}__wrapper`,container:`${tR}__container`,closeButton:`${tR}__close-button`,innerWrapper:`${tR}__inner-wrapper`,imageWrapper:`${tR}__image-wrapper`,image:`${tR}__image`,title:`${tR}__title`,description:`${tR}__description`,callToAction:`${tR}__call-to-action`,scanQr:`${tR}__scan-qr`}),tP=Object.freeze({mobile:56,desktop:68}),tE="headerBannerShownAt",tM=()=>{let e=localStorage.getItem(tE);if(!e)return null;let t=new Date(e);return isNaN(t.getTime())?null:t},tB=()=>{localStorage.setItem(tE,new Date().toISOString())},tU=()=>{let e=tM();return!e||Math.floor((e.getTime()-new Date().getTime())/864e5)>5},tW=({minioUrl:e,className:t,mobileAppUrl:n})=>{let{fixedContainerRef:i,headerRef:l}=tb(),[s,r]=(0,j.useState)(!1),[u,p]=(0,j.useState)(!1),[h,f]=(0,j.useState)(!1),v=(0,j.useCallback)((e="desktop")=>{let t=i.current;t&&(t.style.transform="translateY(0)",document.documentElement.style.setProperty("--fixed-header-height",`${tP[e]+eZ[e]}px`),document.documentElement.style.setProperty("--new-header-height-desktop",`${tP.desktop+eZ.desktop}px`),document.documentElement.style.setProperty("--new-header-height-mobile",`${tP.mobile+eZ.mobile}px`),document.documentElement.style.setProperty("--static-new-header-height-mobile",`${tP.mobile+eZ.mobile}px`),document.documentElement.style.setProperty("--static-new-header-height-desktop",`${tP.desktop+eZ.desktop}px`),document.documentElement.style.setProperty("--header-height",`${tP[e]+108}px`))},[]),g=(0,j.useCallback)(()=>{let e=i.current;e&&(document.documentElement.style.removeProperty("--fixed-header-height"),document.documentElement.style.removeProperty("--new-header-height-desktop"),document.documentElement.style.removeProperty("--new-header-height-mobile"),document.documentElement.style.removeProperty("--static-new-header-height-mobile"),document.documentElement.style.removeProperty("--static-new-header-height-desktop"),document.documentElement.style.removeProperty("--header-height"),e.style.transform="")},[]);return(0,j.useEffect)(()=>{let e=l.current;if(!e)return;let t=()=>{u&&r(!1),f(!1)};return e.addEventListener("transitionend",t),()=>{e.removeEventListener("transitionend",t)}},[u]),(0,j.useEffect)(()=>{tU()&&r(!0)},[]),(0,j.useEffect)(()=>{let e=window.innerWidth<768;s&&(v(e?"mobile":"desktop"),window.matchMedia("(prefers-reduced-motion: reduce)").matches?r(!0):f(!0));let t=()=>{if(!s)return null;v(window.innerWidth<768?"mobile":"desktop")};return window.addEventListener("resize",t),()=>{g(),window.removeEventListener("resize",t)}},[s,v,g]),s?(0,o.jsx)("div",{id:"headerNotice",role:"region","aria-label":"Мобильное приложение","data-opening":h,className:(0,c.Z)(tz.wrapper,t),children:(0,o.jsx)(a.W2,{children:(0,o.jsxs)("div",{className:tz.container,children:[(0,o.jsxs)("div",{className:tz.innerWrapper,children:[(0,o.jsxs)("picture",{className:tz.imageWrapper,children:[(0,o.jsx)("source",{srcSet:d(e,"/widgets/header/qr-mobile-app.svg"),media:"(min-width: 768px)"}),(0,o.jsx)("img",{className:tz.image,src:d(e,"/logo/finuslugi/default-regular.svg")})]}),(0,o.jsxs)("div",{className:tz.scanQr,children:[(0,o.jsx)("div",{className:tz.title,children:"Скачайте приложение Финуслуги"}),(0,o.jsx)("div",{className:tz.description,children:"Сканируйте QR-код"})]}),(0,o.jsxs)("div",{className:tz.callToAction,children:[(0,o.jsxs)("div",{children:["Приложение",(0,o.jsx)("br",{}),"Финуслуги"]}),(0,o.jsx)(m.zx,{onClick:()=>{eY(w.button,"skachat_mob_prilozheniye_fu"),window.open(n,"_blank","noreferrer")},variant:"white",size:"xs",children:"Скачать"})]})]}),(0,o.jsx)("div",{"aria-label":"Закрыть",role:"button",className:tz.closeButton,onClick:()=>{tB(),g(),window.matchMedia("(prefers-reduced-motion: reduce)").matches?r(!1):p(!0)},children:(0,o.jsx)(b.IconFdsCloseO,{size:"100%"})})]})})}):null},tF=(0,p.g)("header-chat-modal-body","sc"),tZ=Object.freeze({wrapper:`${tF}__wrapper`,cardButton:`${tF}__card-button`,card:`${tF}__card`,cardTitle:`${tF}__card-title`,cardSubtitle:`${tF}__card-subtitle`,button:`${tF}__button`}),tD=()=>{let e=tb();return(0,o.jsxs)("div",{className:tZ.wrapper,children:[(0,o.jsx)(ty,{className:tZ.cardButton,variant:"secondary",pending:e.isChatLoading,onClick:()=>{var e,t,n;return null==(n=null==(t=null==(e=null==window?void 0:window.supportWidget)?void 0:e.craftTalk)?void 0:t.open)?void 0:n.call(t)},eventActionText:"Напишите в чат",children:(0,o.jsxs)(a.Zb,{className:tZ.card,variant:"secondary",children:[(0,o.jsxs)("div",{className:tZ.cardTitle,children:[(0,o.jsx)("img",{src:"https://finuslugi.ru/icons/chaticons/new/chat_icon_hover.svg",alt:"chat",width:24,height:24,loading:"lazy"}),"Напишите в чат"]}),(0,o.jsxs)("p",{className:tZ.cardSubtitle,children:["Виртуальный ассистент доступен\xa024/7, ",(0,o.jsx)("br",{}),"операторы\xa0—\xa0с\xa06:00 до\xa023:59\xa0мск"]})]})}),!1]})},tG=({data:e,isMobile:t})=>{let n=tb();return(0,o.jsx)("div",{className:e1.contentWrapper,children:e.map(e=>(0,o.jsx)(j.Fragment,{children:e.sections.map(e=>(0,o.jsxs)("div",{className:(0,c.Z)(e1.content,{[e1.hidden]:n.openedSection!==e.id,[e1.contentOpen]:!!n.openedSection}),children:[(0,o.jsx)("div",{className:e1.contentHeader,children:(0,o.jsx)("label",{children:e.title})}),e.content.map((n,i)=>{var l,s;return(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{children:(0,o.jsx)("a",{className:(0,c.Z)(e1.contentTitle,{[e1.removed]:!n.title,[e1.contentTitleUrl]:!!n.url,[e1.contentTitleLink]:!!e.isSeeAllLinkAvailable,[e1.contentTitleNew]:!!n.new}),href:e.isSeeAllLinkAvailable?n.url:void 0,children:(0,o.jsxs)("span",{children:[e.isSeeAllLinkAvailable&&(0,o.jsx)("div",{className:e1.arrowIcon,children:(0,o.jsx)(b.IconFdsArrowUpRightSmallO,{})}),n.title]})})}),!(null!=(l=n.links)&&l.length)&&(0,o.jsx)(e4,{items:n.chips||[],maxNumberOfLines:e.content.length<=1?99:t?3:2}),!!(null!=(s=n.links)&&s.length)&&(0,o.jsx)("div",{className:(0,c.Z)(e1.links,{[e1.linksColumns]:!!n.columns,[e1.linksTitleless]:!n.title}),children:n.links.map(e=>(0,o.jsxs)("a",{href:e.url,className:(0,c.Z)({[e1.new]:!!e.new}),onClick:()=>eY(w.link,e.title,`${e.title}_${e.url}`),children:[(0,o.jsx)("div",{className:e1.arrowIcon,children:(0,o.jsx)(b.IconFdsArrowUpRightSmallO,{})}),(0,o.jsx)("span",{children:e.title})]},e.url))})]},`${n.url}_${i}`)})]},e.id))},e.id))})},tV=(0,p.g)("navigation-section-icon","sc"),tH=Object.freeze({icon:`${tV}`}),tq=({name:e,background:t})=>{let n=(0,j.useMemo)(()=>e&&b[e]||null,[e]);return e&&n?(0,o.jsx)("div",{className:tH.icon,style:{background:t},children:(0,o.jsx)(n,{})}):null},tJ=(0,p.g)("navigation","sc"),tQ=Object.freeze({navigation:`${tJ}`,navigationOpening:`${tJ}--opening`,navigationClosing:`${tJ}--closing`,wrapper:`${tJ}__wrapper`,container:`${tJ}__container`,containerOpen:`${tJ}__container--open`,sections:`${tJ}__sections`,sectionsOpen:`${tJ}__sections--open`,citySelectButton:`${tJ}__city-select-button`,sectionsTitle:`${tJ}__sections-title`,sectionsWrapper:`${tJ}__sections-wrapper`,section:`${tJ}__section`,sectionArrow:`${tJ}__section-arrow`,sectionExtra:`${tJ}__section--extra`,sectionActive:`${tJ}__section--active`,sectionTitle:`${tJ}__section-title`,chatWrapper:`${tJ}__chat-wrapper`,chatHeader:`${tJ}__chat-header`,backButton:`${tJ}__back-button`,useful:`${tJ}__useful`,usefulOpen:`${tJ}__useful--open`,usefulTitle:`${tJ}__useful-title`,usefulGrid:`${tJ}__useful-grid`,removed:`${tJ}__removed`}),tY=({data:e})=>{var t;let n=tb(),i=tr(),l=(0,m.aF)("m"),[s,r]=(0,j.useState)(!0);(0,j.useEffect)(()=>{r(l)},[l]);let u=(0,j.useRef)(null),d=(0,j.useCallback)(()=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>n.openedSection?n.setOpenedSection(null):n.isNavigationOpen?n.setOpenedBlock(null):void 0,50)},[n]),p=(0,j.useRef)(!1),h=(0,j.useRef)(null),f=(0,j.useCallback)(()=>{s&&(p.current=!0,h.current=window.onpopstate||null,window.onpopstate=function(){window.history.forward(),d()},window.history.pushState(null,"",window.location.href))},[d,s]),v=(0,j.useCallback)(()=>{p.current=!1,window.onpopstate=h.current,window.history.go(-1)},[]),g=(0,j.useRef)(null),_=(0,j.useCallback)(e=>{if(s||!n.navMenuItemsRef.current||!n.navigationRef.current)return;let t=e.target,i=!n.navMenuItemsRef.current.contains(t)&&!n.navigationRef.current.contains(t);if(i&&!g.current){n.setIgnoreClicks(),g.current=setTimeout(()=>n.setOpenedBlock(null),300);return}!i&&g.current&&(clearTimeout(g.current),g.current=null)},[s,n]),x=(0,j.useRef)(null),y=(0,j.useCallback)(e=>{typeof window>"u"||(e?(x.current=_,window.addEventListener("mousemove",x.current)):x.current&&window.removeEventListener("mousemove",x.current))},[_]);(0,j.useEffect)(()=>{y(n.isNavigationOpen),n.isNavigationOpen&&!p.current&&f(),!n.isNavigationOpen&&p.current&&v()},[n.isNavigationOpen]);let $=(e,t)=>()=>{eY(w.button,t),n.setOpenedSection(e)},{start:N,clear:k}=tc(),C=(e,t)=>()=>{s||N($(e,t),150)},O=()=>{s||k()};return(0,o.jsx)("div",{ref:n.navigationRef,className:(0,c.Z)(tQ.navigation,{[tQ.removed]:!n.isNavigationMounted,[tQ.navigationOpening]:n.isNavigationOpen,[tQ.navigationClosing]:!n.isNavigationOpen}),children:(0,o.jsx)("div",{className:tQ.wrapper,children:(0,o.jsxs)(a.W2,{className:(0,c.Z)(tQ.container,{[tQ.containerOpen]:!!n.openedSection}),children:[(0,o.jsxs)("div",{className:(0,c.Z)(tQ.sections,{[tQ.sectionsOpen]:!!n.openedSection}),children:[(0,o.jsx)(m.zx,{className:tQ.citySelectButton,variant:"purple",appearance:"ghost",size:"xs",onClick:()=>i.handleButtonClick(!1),iconLeft:(0,o.jsx)(b.IconFdsLocationO,{size:24}),label:(null==(t=i.town)?void 0:t.name)||"Вся Россия"}),e.map(e=>(0,o.jsxs)("ul",{className:(0,c.Z)(tQ.sectionsWrapper,{[tQ.removed]:n.openedBlock!==e.id&&!s}),children:[(0,o.jsx)("div",{className:tQ.sectionsTitle,children:eF[e.id]}),e.sections.map(e=>(0,o.jsxs)("li",{className:(0,c.Z)(tQ.section,{[tQ.sectionExtra]:!!e.extra,[tQ.sectionActive]:n.openedSection===e.id}),onClick:$(e.id,e.title),onMouseEnter:C(e.id,e.title),onMouseLeave:O,children:[(0,o.jsx)(tq,{name:e.uikitIcon,background:e.uikitIconBg}),(0,o.jsx)("span",{className:tQ.sectionTitle,children:e.title}),(0,o.jsx)("div",{className:tQ.sectionArrow,children:(0,o.jsx)(b.IconFdsChevronRightSmallO,{size:24})})]},e.id))]},e.id)),(0,o.jsxs)("div",{className:tQ.chatWrapper,children:[(0,o.jsx)("div",{className:tQ.chatHeader,children:"Нужна помощь?"}),(0,o.jsx)(tD,{})]})]}),(0,o.jsxs)("button",{type:"button",className:(0,c.Z)(tQ.backButton,{[tQ.removed]:!n.openedSection}),onClick:()=>{eY(w.button,"Назад"),n.setOpenedSection(null)},children:[(0,o.jsx)(b.IconFdsChevronLeftO,{size:24}),(0,o.jsx)("span",{children:"Назад"})]}),(0,o.jsx)(tG,{data:e,isMobile:s}),(0,o.jsxs)("div",{className:(0,c.Z)(tQ.useful,{[tQ.usefulOpen]:!!n.openedSection}),children:[(0,o.jsx)("div",{className:tQ.usefulTitle,children:"Полезное на Финуслугах"}),e.map(e=>(0,o.jsx)(j.Fragment,{children:e.sections.map(e=>(0,o.jsx)("div",{className:(0,c.Z)(tQ.usefulGrid,{[tQ.removed]:n.openedSection!==e.id}),children:e.useful.map((e,t)=>(0,o.jsxs)("a",{href:e.url,onClick:()=>eY(w.link,e.title,`${e.title}_${e.url}`),children:[(0,o.jsx)("div",{children:(0,o.jsx)("img",{src:e.icon,srcSet:e.icon2?`${e.icon}, ${e.icon2} 2x`:void 0,alt:e.title,loading:"lazy"})}),(0,o.jsx)("span",{dangerouslySetInnerHTML:{__html:e.title}})]},`${e.title}_${t}`))},e.id))},e.id))]})]})})})},tK=(e,t,n)=>{var i,l,o,s,r,a,c;let u=(null==(l=null==(i=null==e?void 0:e.NAVIGATOR)?void 0:i.findIndex)?void 0:l.call(i,({id:e})=>"news"===e))||-1,p=(null==(s=null==(o=null==e?void 0:e.NAVIGATOR)?void 0:o[u])?void 0:s.content)||[];if(null!=(c=null==(a=null==(r=null==e?void 0:e.NAVIGATOR)?void 0:r[u])?void 0:a.content)&&c[0]&&Array.isArray(n)&&p.length){let i=n.map(({title:e,url:n})=>({title:e,url:d(t||"",n),new:0}));e.NAVIGATOR[u].content[0].links=i}return[{id:"FINPRODUCTS",sections:Array.isArray(null==e?void 0:e.FINPRODUCTS)?null==e?void 0:e.FINPRODUCTS:[]},{id:"NAVIGATOR",sections:Array.isArray(null==e?void 0:e.NAVIGATOR)?null==e?void 0:e.NAVIGATOR:[]},{id:"ABOUT",sections:Array.isArray(null==e?void 0:e.ABOUT)?null==e?void 0:e.ABOUT:[]}]},tX=({data:e,showcaseUrl:t="https://finuslugi.ru",minioUrl:n="https://assets.finuslugi.ru/mp-assets",lkUrl:i="https://lk.finuslugi.ru/registration",initialTown:l,isMainBannerPage:s,enableAppHeaderBanner:r=!1,news:u,className:p})=>{let h=tb(),f=(0,j.useMemo)(()=>tK(e,t,u),[e,t,u]),v=null==e?void 0:e.config,g=(0,j.useMemo)(()=>f.reduce((e,t)=>{var n;return e[t.id]=null==(n=t.sections[0])?void 0:n.id,e},{}),[f]),_=h.isAuth?"Личный кабинет":"Войти",x=s&&h.isHeaderTransparent,y=(e,t,n,i)=>()=>{e!==h.openedBlock?eY(w.toggle,t,"on"):eY(w.button,"menu_close","on");let l=n?g[e]:"";h.setOpenedBlock(e,l,!!i)},{start:$,clear:N}=tc(),k=(e,t,n,i)=>()=>{h.isNavigationOpen&&e===h.openedBlock||h.setIgnoreClicks(),$(y(e,t,n,i),200)},C=e=>()=>{h.ignoreClicks||e()},O=e=>h.openedBlock===e&&h.isNavigationOpen;return e?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{ref:h.headerRef,className:(0,c.Z)(eE.header,p,{[eE.transparent]:x}),children:(0,o.jsxs)("div",{ref:h.fixedContainerRef,className:(0,c.Z)(eE.fixed,{[eE.hidden]:h.isHeaderHidden,[eE.navigationOpen]:h.isNavigationOpen}),children:[!!(null!=v&&v.appBannerUrl)&&r&&(0,o.jsx)(tW,{mobileAppUrl:v.appBannerUrl,minioUrl:n}),(0,o.jsxs)(a.W2,{className:eE.container,children:[(0,o.jsxs)("div",{className:eE.leftRow,children:[(0,o.jsx)(tL,{className:eE.logo,href:t,eventActionType:w.icon,eventActionText:"finuslugi_logo",eventLabel:`finuslugi_logo_${t}`,children:(0,o.jsxs)("picture",{children:[(0,o.jsx)("source",{srcSet:d(n,"/widgets/header/logo/d.webp"),media:"(min-width: 768px)"}),(0,o.jsx)("img",{src:d(n,"/widgets/header/logo/m.webp"),alt:"Финуслуги",loading:"eager"})]})}),(0,o.jsx)("nav",{ref:h.navMenuItemsRef,className:eE.menuItems,children:(0,o.jsx)("ul",{children:eW.map(({id:e,label:t})=>(0,o.jsx)("li",{children:(0,o.jsx)(m.zx,{className:(0,c.Z)({[eE.menuItemActive]:O(e)}),label:t,variant:"white",size:"xs",onClick:C(y(e,t,!0)),onMouseEnter:k(e,t,!0,!0),onMouseLeave:N})},e))})}),(0,o.jsx)(ty,{className:(0,c.Z)(eE.tabletMenuButton,{[eE.menuItemActive]:h.isNavigationOpen}),eventActionText:"Меню сайта",variant:"white",size:"xs",iconRight:(0,o.jsx)(b.IconFdsChevronDownO,{size:24}),onClick:y("FINPRODUCTS","Меню сайта"),children:"Меню сайта"})]}),(0,o.jsxs)("div",{className:(0,c.Z)(eE.buttonGroup,{[eE.whiteIcons]:(null==v?void 0:v.iconColorOnMobileMainBanner)==="white"}),children:[(0,o.jsxs)("div",{className:eE.chips,children:[(0,o.jsx)(ty,{as:"a",href:i,size:"xs",shape:"icon",appearance:"ghost",eventActionText:"profile",eventLabel:`profile_${i}`,iconLeft:(0,o.jsx)(b.IconFdsUserO,{size:20})}),(0,o.jsx)(ty,{onClick:()=>{var e,t,n;return null==(n=null==(t=null==(e=null==window?void 0:window.supportWidget)?void 0:e.craftTalk)?void 0:t.open)?void 0:n.call(t)},size:"xs",shape:"icon",appearance:"ghost",eventActionText:"IconFdsChatDotsCircleO",iconLeft:(0,o.jsx)(b.IconFdsChatDotsCircleO,{size:24})})]}),(0,o.jsx)(ty,{className:eE.menuButton,size:"xs",shape:x?"icon":"default",appearance:x?"ghost":"fill",label:"Меню",onClick:y("FINPRODUCTS","Меню"),eventActionText:"Меню",iconLeft:(0,o.jsx)(b.IconFdsMenuSkewedO,{size:24})}),(0,o.jsxs)("div",{className:eE.moreButtons,children:[(0,o.jsx)(tI,{initialTown:l}),(0,o.jsx)(ty,{onClick:()=>{var e,t,n;return null==(n=null==(t=null==(e=null==window?void 0:window.supportWidget)?void 0:e.craftTalk)?void 0:t.open)?void 0:n.call(t)},size:"xs",appearance:"ghost",eventActionText:"IconFdsChatDotsSquareAddO",iconLeft:(0,o.jsx)(b.IconFdsChatDotsSquareAddO,{size:24}),children:"Онлайн чат"}),(0,o.jsx)(ty,{as:"a",href:i,size:"xs",eventActionText:_,eventLabel:`${_}_${i}`,label:_})]})]}),(0,o.jsxs)(tL,{className:eE.auth,href:i,eventActionText:_,eventLabel:`${_}_${i}`,children:[(0,o.jsx)(ty,{size:"xs",shape:"circle-icon",iconLeft:(0,o.jsx)(b.IconFdsUserO,{}),eventActionText:_,eventLabel:`${_}_${i}`}),(0,o.jsx)("p",{children:_})]}),(0,o.jsx)("div",{className:eE.close,children:(0,o.jsx)(ty,{className:eE.close,size:"xs",variant:"secondary",shape:"circle-icon",iconLeft:(0,o.jsx)(b.IconFdsCloseO,{}),onClick:()=>h.setOpenedBlock(null),eventActionText:"IconFdsCloseO"})})]})]})}),(0,o.jsx)("div",{className:(0,c.Z)(eE.overlay,{[eE.removed]:!h.isNavigationMounted,[eE.overlayOpening]:h.isNavigationOpen,[eE.overlayClosing]:!h.isNavigationOpen}),onClick:C(()=>h.setOpenedBlock(null))}),(0,o.jsx)(tY,{data:f,minioUrl:n})]}):null},t0=e=>(0,o.jsx)(tj,{isMainBannerPage:e.isMainBannerPage,children:(0,o.jsx)(tX,{...e})}),t1=(0,p.g)("page-layout","sc"),t2=Object.freeze({main:"".concat(t1,"__main")}),t4=r()(()=>n.e(715).then(n.bind(n,6715)).then(e=>e.CookiesPlate),{loadableGenerated:{webpack:()=>[require.resolveWeak("../sc-cookies-plate/index.mjs")]},ssr:!1});function t5(e){let{initialGeo:t,headerData:n,footerData:i,showStartGeoPopup:l=!1,children:s}=e,{region:r,town:a}=null!=t?t:{};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(ta,{showStartGeoPopup:l,initialRegion:r,initialTown:a,children:[n&&(0,o.jsx)(t0,{...n}),(0,o.jsx)("main",{className:t2.main,children:s}),i&&(0,o.jsx)(ez,{...i})]}),(0,o.jsx)(t4,{})]})}}}]);