"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1225],{30166:function(e,t,n){n.d(t,{default:function(){return l.a}});var i=n(55775),l=n.n(i)},55775:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}});let i=n(47043);n(57437),n(2265);let l=i._(n(15602));function s(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 s={...i,...t};return(0,l.default)({...s,modules:null==(n=s.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)},81523:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return l}});let i=n(18993);function l(e){let{reason:t,children:n}=e;if("undefined"==typeof window)throw new i.BailoutToCSRError(t);return n}},15602:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return c}});let i=n(57437),l=n(2265),s=n(81523),o=n(70049);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)(o.PreloadCss,{moduleIds:t.modules}):null,(0,i.jsx)(n,{...e})]}):(0,i.jsx)(s.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}},70049:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadCss",{enumerable:!0,get:function(){return s}});let i=n(57437),l=n(20544);function s(e){let{moduleIds:t}=e;if("undefined"!=typeof window)return null;let n=(0,l.getExpectedRequestStore)("next/dynamic css"),s=[];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"));s.push(...t)}}return 0===s.length?null:(0,i.jsx)(i.Fragment,{children:s.map(e=>(0,i.jsx)("link",{precedence:"dynamic",rel:"stylesheet",href:n.assetPrefix+"/_next/"+encodeURI(e),as:"style"},e))})}},30631:function(e,t,n){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 s(){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 s}})},82778:function(e,t,n){n.d(t,{L:function(){return a},g:function(){return r}});var i=n(2265),l=n(30631);let s=null,o=e=>{s=e},r=()=>s,a=e=>{let{env:t}=e,n=(0,i.useRef)(!1);return n.current||(o(t),n.current=!0),(0,i.useEffect)(()=>{"production"===t.NODE_ENV&&(0,l.zK)()},[t.NODE_ENV]),null}},55487:function(e,t,n){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})}}},14073:function(e,t,n){let i;n.d(t,{PageLayout:function(){return tV}});var l=n(57437),s=n(30166),o=n(35563),r=n(54365),a=n(77337),c=n(52074),u=n(75461),d=n(6554),p=n(80684),m=n(2265),h=n(54887);let f=300,g=({opened:e})=>{let[t,n]=(0,m.useState)(!1),i=(0,m.useRef)(null),l=(0,m.useRef)(!1);return(0,m.useEffect)(()=>(e&&!l.current?(l.current=!0,n(!0)):!e&&l.current&&(i.current=setTimeout(()=>{l.current=!1,n(!1)},f)),()=>{i.current&&clearTimeout(i.current)}),[e]),{mounted:t}},w=(0,c.g)("click-outside","sc"),v=Object.freeze({overlay:`${w}__overlay`,open:`${w}--open`,close:`${w}--close`}),x=({onClose:e,onToucheMove:t,isOpen:n,delay:i=f})=>{let s=(0,m.useRef)(null),o=(0,m.useCallback)(()=>{e&&(s.current=setTimeout(()=>{e()},i))},[i,e]),a=(0,m.useCallback)(e=>{"Escape"===e.key&&o()},[o]);return(0,m.useEffect)(()=>(n&&window.addEventListener("keydown",a),()=>{s.current&&clearTimeout(s.current),window.removeEventListener("keydown",a)}),[n,a]),(0,l.jsx)("div",{className:(0,r.Z)(v.overlay,{[v.open]:n,[v.close]:!n}),onTouchStart:t,onClick:o})},_=(e,t)=>{e&&(t?e.setAttribute("data-portal",""):e.removeAttribute("data-portal"))},b=e=>{e.style.top||(window.prevScrollPosition=window.scrollY)},j=(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`)},y=e=>{e.style.setProperty("overflow","hidden"),e.style.setProperty("height","100vh")},N=e=>{e.classList.toggle("scroll-disable-windows",!1),e.style.removeProperty("overflow"),e.style.removeProperty("height"),e.style.removeProperty("width"),e.style.removeProperty("top")},C=()=>{void 0!==window.prevScrollPosition&&(window.scrollTo(0,window.prevScrollPosition),window.prevScrollPosition=void 0)},$=()=>document.querySelectorAll("[data-portal]").length>1,k=e=>{let t=(0,m.useRef)(null),n=(0,m.useRef)(!1);return(0,m.useEffect)(()=>{if(n.current===e)return;n.current=e;let i=t.current,l=document.body,s=document.documentElement,o=window.innerWidth-s.clientWidth,r=o>0;if(e&&r)b(l),j(l,s,o),_(i,!0);else if(e)y(l),_(i,!0);else{let e=!$();e&&N(l),e&&C(),_(i,!1)}return()=>{let e=!$();e&&N(l),e&&C()}},[e]),t},T=(0,c.g)("drawer-footer","sc"),O=Object.freeze({footer:`${T}__footer`,hasScroll:`${T}__footer--has-scroll`}),S=({footer:e,hasScroll:t,className:n})=>(0,l.jsx)("div",{className:(0,r.Z)(O.footer,{[O.hasScroll]:t},n),children:"function"==typeof e?e():e}),A=(0,c.g)("drawer-content","sc"),I=Object.freeze({container:`${A}__container`,open:`${A}--open`,close:`${A}--close`,header:`${A}__header`,rowHeader:`${A}__header--row`,title:`${A}__title`,center:`${A}__title--center`,left:`${A}__title--left`,right:`${A}__title--right`,controlContainer:`${A}__control-container`,content:`${A}__content`,footer:`${A}__footer`}),R=({onClose:e,onContentClick:t,children:n,title:i,rowTitle:s,titleAlign:o,isCloseable:a,footer:c,closeButton:u,isOpen:d,contentClassName:h,footerClassName:f,contentStyle:g,width:w})=>{let v=(0,m.useRef)(null),x=(0,m.useRef)(null),[_,b]=(0,m.useState)(!1);(0,m.useEffect)(()=>{var e;if(!x.current||!v.current)return;let t=(null==(e=null==x?void 0:x.current)?void 0:e.getBoundingClientRect().top)||0,n=null==v?void 0:v.current,i=()=>{let e=null==x?void 0:x.current;e&&b(()=>e.getBoundingClientRect().top!==t)};return n&&n.addEventListener("scroll",i,!1),()=>{null==n||n.removeEventListener("scroll",i,!1)}},[]);let j=g||w?{width:w,...g||{}}:void 0;return(0,l.jsxs)("div",{ref:v,style:j,className:(0,r.Z)(I.container,{[I.open]:d,[I.close]:!d},h),children:[i||a?(0,l.jsxs)("div",{className:(0,r.Z)(I.header,{[I.rowHeader]:s}),children:[a?u?"function"==typeof u?u():u:(0,l.jsx)("button",{type:"button",className:I.controlContainer,onClick:e,children:(0,l.jsx)(p.IconFdsCloseO,{size:24})}):null,i?(0,l.jsx)("h3",{className:(0,r.Z)(I.title,{[I[o]]:!0}),children:i}):null]}):null,(0,l.jsx)("div",{ref:x,className:I.content,onClick:t,children:n}),c&&(0,l.jsx)(S,{className:(0,r.Z)(I.footer,f),footer:c,hasScroll:_})]})},L=(0,c.g)("drawer-layout","sc"),P=Object.freeze({window:`${L}__window`}),z=({onClose:e,isOpen:t,children:n,withDisabledScroll:i,className:s,...o})=>{let a=(0,m.useCallback)(e=>e.stopPropagation(),[]);return k(t&&i),(0,l.jsxs)("div",{"data-portal":!0,className:(0,r.Z)(P.window,s),children:[(0,l.jsx)(x,{onClose:e,isOpen:t,delay:0}),(0,l.jsx)(R,{onContentClick:a,onClose:e,isOpen:t,...o,children:n})]})},E=({isOpen:e=!1,children:t,titleAlign:n="center",isCloseable:i=!0,withDisabledScroll:s=!0,...o})=>{let{mounted:r}=g({opened:e});return r?(0,l.jsx)(z,{titleAlign:n,isCloseable:i,isOpen:e,withDisabledScroll:s,...o,children:t}):null};E.displayName="Drawer";let U=(0,c.g)("mobile-modal-footer","sc"),M=Object.freeze({footer:`${U}__footer`,footerWithoutShadow:`${U}__footer--without-shadow`}),B=({footer:e,isSmallPopup:t=!1,footerClassName:n})=>(0,l.jsx)("div",{className:(0,r.Z)(M.footer,t&&M.footerWithoutShadow,n),children:"function"==typeof e?e():e}),W=(0,c.g)("mobile-popup","sc"),D=Object.freeze({mobilePopup:`${W}`,mobilePopupOpen:`${W}--open`,content:`${W}__content`,contentFull:`${W}__content--full`,contentTransition:`${W}__content--transition`,contentTransitionOpen:`${W}__content--transition-open`,contentLine:`${W}__content-line`,contentContainer:`${W}__content-container`,smallContentContainer:`${W}__content-container--small`,min:`${W}__content-container--min`,title:`${W}__title`,closeContainer:`${W}__close-container`,closeButton:`${W}__close-button`}),F=({children:e,footer:t,isOpen:n,isSmallPopup:i,onClose:s,hasCloseButton:o=!0,full:a,touchDistance:c=100,withDisabledScroll:u=!0,contentClassName:d,className:h,title:f,closeButton:g,footerClassName:w})=>{let[v,_]=(0,m.useState)(!1),[b,j]=(0,m.useState)(!1),[y,N]=(0,m.useState)(!0),[C,$]=(0,m.useState)("120%"),T=(0,m.useRef)(null),O=(0,m.useRef)(0),S=(0,m.useRef)(!1),A=e=>{var t,n,i;let l=null==(t=T.current)?void 0:t.offsetTop,s=null==(n=T.current)?void 0:n.offsetHeight;if(S.current=!0,N(!1),l&&s){let t=(null==(i=null==e?void 0:e.touches[0])?void 0:i.clientY)-l,n=0;t>=0&&t<=s+30&&(n=t),t>s+30&&(n=s+30),$(`${n}px`),O.current=n}},I=()=>{S.current&&(O.current>c&&s?null==s||s():$("0"),N(!0),S.current=!1),window.removeEventListener("touchmove",A),window.removeEventListener("touchend",I)};return(0,m.useEffect)(()=>{n&&setTimeout(()=>{_(!0),j(!0),$("0")},100),!n&&b&&($("120%"),_(!1),j(!1))},[b,n]),k(n&&u),(0,l.jsxs)("div",{"data-portal":!0,className:(0,r.Z)(D.mobilePopup,b&&D.mobilePopupOpen,h),children:[(0,l.jsx)(x,{onClose:()=>{n&&(null==s||s())},onToucheMove:()=>{n&&(_(!1),window.addEventListener("touchmove",A),window.addEventListener("touchend",I))},isOpen:n,delay:0}),(0,l.jsxs)("div",{className:(0,r.Z)(D.content,a&&D.contentFull,y&&D.contentTransition,y&&v&&D.contentTransitionOpen),ref:T,style:{transform:`translateY(${C})`},children:[(0,l.jsx)("div",{className:D.contentLine}),(0,l.jsxs)("div",{className:(0,r.Z)(D.contentContainer,i&&D.smallContentContainer,{[D.min]:!f&&!o},d),children:[!!f&&(0,l.jsx)("div",{className:D.title,children:f}),o?(0,l.jsx)("div",{className:D.closeContainer,children:o?g?"function"==typeof g?g():g:(0,l.jsx)("button",{onClick:s,className:D.closeButton,children:(0,l.jsx)(p.IconFdsCloseO,{size:24})}):null}):null,e]}),t&&(0,l.jsx)(B,{footerClassName:w,isSmallPopup:i,footer:t})]})]})},Z=({children:e,isSmallPopup:t=!1,isOpen:n=!1,...i})=>{let{mounted:s}=g({opened:n});return s?(0,l.jsx)(F,{isSmallPopup:t,isOpen:n,...i,children:e}):null};Z.displayName="UiMobilePopup";let G=({children:e,id:t="portal-root"})=>{let[n,i]=(0,m.useState)(null);return(0,m.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,h.createPortal)(e,n):null},V=(0,c.g)("footer-contacts-block","sc"),H=Object.freeze({contactsWrapper:`${V}__contacts-wrapper`,gray:`${V}__gray`,phones:`${V}__phones`,contactsButtons:`${V}__contacts-buttons`,vkIcon:`${V}__vk-icon`,tgIcon:`${V}__tg-icon`,dzenIcon:`${V}__dzen-icon`,maxIcon:`${V}__max-icon`,link:`${V}__link`}),q=(0,c.g)("footer","sc"),J=Object.freeze({wrapper:`${q}__wrapper`,section:`${q}__section`,container:`${q}__container`,top:`${q}__top`,main:`${q}__main`,links:`${q}__links`,disclaimer:`${q}__disclaimer`,bottom:`${q}__bottom`,bottomLinks:`${q}__bottom-links`,bottomDisclaimer:`${q}__bottom-disclaimer`,compact:`${q}__wrapper--compact`,white:`${q}__wrapper--white`}),Q="finkit-widgets-sc-footer",Y=[{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"}],K=[...Y,{title:"Онлайн чат",url:void 0}],X=[{type:"vk",className:H.vkIcon,iconName:"vk"},{type:"telegramChannel",className:H.tgIcon,iconName:"telegram"},{type:"dzen",className:H.dzenIcon,iconName:"dzen"},{type:"max",className:H.maxIcon,iconName:"max"}],ee=(0,l.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,l.jsx)("br",{}),(0,l.jsx)("br",{}),"Группа \xabМосковская Биржа\xbb - ПАО Московская Биржа и юридические лица, находящиеся под прямым или косвенным контролем ПАО Московская Биржа."]}),et=({onClick:e,eventActionText:t,eventLabel:n,...i})=>(0,l.jsx)(u.zx,{onClick:i=>{null==e||e(i),(0,d.h)({eventCategory:Q,eventActionType:d.D.button,eventActionText:t||"",eventLabel:n})},...i}),en=({onClick:e,eventActionType:t,eventActionText:n,eventLabel:i,chat:s,...o})=>(0,l.jsx)(u.rU,{onClick:l=>{var o,r,a;null==e||e(l),s&&(null==l||l.preventDefault(),null==(a=null==(r=null==(o=null==window?void 0:window.supportWidget)?void 0:o.craftTalk)?void 0:r.open)||a.call(r)),(0,d.h)({eventCategory:Q,eventActionType:t||d.D.link,eventActionText:n||"",eventLabel:i})},...o}),ei=({minioUrl:e,blogs:t})=>(0,l.jsxs)("div",{className:H.contactsWrapper,children:[(0,l.jsx)(o.xv,{className:H.gray,size:"16",weight:"regular",children:"Звоните или пишите"}),(0,l.jsx)("div",{className:H.phones,children:K.map(({title:e,url:t})=>(0,l.jsx)(en,{href:t,eventActionText:e,chat:!t,children:e},e))}),(0,l.jsx)(o.xv,{className:H.gray,size:"16",weight:"regular",children:"Следите за нами в соцсетях"}),(0,l.jsx)("div",{className:H.contactsButtons,children:X.map(({type:n,className:i,iconName:s})=>(0,l.jsx)(et,{as:"a",href:null==t?void 0:t[n],target:"_blank",className:i,iconRight:(0,l.jsx)("img",{width:24,height:24,src:(0,a.xn)(e,`/widgets/footer/${s}.svg`),alt:n,loading:"lazy"}),shape:"circle-icon",variant:"white",eventActionText:n,eventLabel:null==t?void 0:t[n]},n))}),(0,l.jsx)(o.xv,{className:H.gray,size:"16",weight:"regular",children:"Канал для инвесторов"}),(0,l.jsx)("div",{className:H.contactsButtons,children:(0,l.jsxs)(en,{href:null==t?void 0:t.investTg,target:"_blank",className:H.link,eventActionText:"telegram",eventLabel:null==t?void 0:t.investTg,children:[(0,l.jsx)(et,{className:H.tgIcon,iconRight:(0,l.jsx)("img",{width:24,height:24,src:(0,a.xn)(e,"/widgets/footer/telegram.svg"),alt:"telegram",loading:"lazy"}),shape:"circle-icon",variant:"white",eventActionText:"telegram",eventLabel:null==t?void 0:t.investTg}),"Финуслуги Инвест"]})})]}),el=(0,c.g)("footer-disclaimer","sc"),es=Object.freeze({disclaimer:`${el}`}),eo=e=>{let t=e=>{e.target instanceof HTMLAnchorElement&&(0,d.h)({eventCategory:Q,eventActionType:d.D.link,eventActionText:e.target.textContent||"",eventLabel:e.target.href})};return e.disclaimer?(0,l.jsx)("div",{className:(0,r.Z)(e.className,es.disclaimer),dangerouslySetInnerHTML:{__html:e.disclaimer||""},onClick:t}):(0,l.jsx)("div",{className:(0,r.Z)(e.className,es.disclaimer),onClick:t,children:e.children})},er=()=>{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},ea=(e="")=>{let[t,n]=(0,m.useState)(e);return(0,m.useEffect)(()=>{let t=er();if(!t||0===t.size)return;let[i,l=""]=e.split("?"),s=new URLSearchParams(l);t.forEach((e,t)=>{s.has(t)||s.set(t,e)});let o=s.toString();n(o?`${i}?${o}`:i)},[e]),t},ec=(0,c.g)("footer-modal-body","sc"),eu=Object.freeze({wrapper:`${ec}__wrapper`,title:`${ec}__title`,item:`${ec}__item`,label:`${ec}__label`,button:`${ec}__button`,description:`${ec}__description`}),ed=({directions:e})=>(0,l.jsxs)("div",{className:eu.wrapper,children:[(0,l.jsx)("div",{className:eu.title,children:"Направления"}),e.map(e=>(0,l.jsxs)(en,{className:eu.item,href:e.url,target:"_blank",eventActionText:e.name,eventLabel:`${e.name}_${e.url}`,children:[(0,l.jsxs)("div",{className:eu.label,children:[(0,l.jsx)("span",{children:e.name}),(0,l.jsx)(et,{className:eu.button,iconRight:(0,l.jsx)(p.IconFdsArrowUpRightSmallO,{size:28}),shape:"circle-icon",eventActionText:"IconFdsArrowUpRightSmallO"})]}),(0,l.jsx)("p",{className:eu.description,children:e.description})]},e.url))]}),ep=(0,c.g)("footer-popup","sc"),em=Object.freeze({wrapper:`${ep}__wrapper`,button:`${ep}__button`,icon:`${ep}__icon`,buttonWrapper:`${ep}__button-wrapper`}),eh=({directions:e})=>{let t=(0,u._m)("l"),[n,i]=(0,m.useState)(!1),s=()=>{i(!1)};return(0,l.jsxs)("div",{className:em.wrapper,children:[(0,l.jsx)("div",{className:em.buttonWrapper,children:(0,l.jsx)(et,{className:em.button,appearance:"ghost",variant:"white",onClick:()=>{i(!0)},label:"Все направления",eventActionText:"Все направления",iconLeft:(0,l.jsx)("div",{className:em.icon,children:[1,2,3,4,5,6,7,8,9].map(e=>(0,l.jsx)("div",{},e))})})}),(0,l.jsxs)(G,{children:[!t&&(0,l.jsx)(Z,{isOpen:n,onClose:s,full:!0,children:(0,l.jsx)(ed,{directions:e})}),t&&(0,l.jsx)(E,{isOpen:n,onClose:s,width:"804px",children:(0,l.jsx)(ed,{directions:e})})]})]})},ef=(0,c.g)("footer-left-column","sc"),eg=Object.freeze({leftColumn:`${ef}__left-column`,logoWrapper:`${ef}__logo-wrapper`,banner:`${ef}__banner`,mobAppLink:`${ef}__mob-app-link`,br:`${ef}__br`}),ew=({showcaseUrl:e,minioUrl:t,directions:n,mobAppUrl:i})=>{let s=ea(i);return(0,l.jsxs)("div",{className:eg.leftColumn,children:[(0,l.jsx)(en,{className:eg.logoWrapper,href:e,eventActionType:d.D.icon,eventActionText:"finuslugi_logo",eventLabel:`finuslugi_logo_${e}`,children:(0,l.jsx)("img",{src:(0,a.xn)(t,"/widgets/footer/finuslugi_base_logo.svg"),alt:"finuslugi logo",loading:"lazy"})}),(0,l.jsx)(eh,{directions:n??[]}),(0,l.jsx)(en,{href:s,target:"_blank",eventActionType:d.D.banner,eventActionText:"Управляйте финансами через приложение Финуслуг",eventLabel:s,className:eg.mobAppLink,children:(0,l.jsxs)(o.Zb,{className:eg.banner,children:[(0,l.jsxs)(o.xv,{weight:"medium",children:["Управляйте финансами",(0,l.jsx)("br",{}),"через приложение",(0,l.jsx)("br",{className:eg.br})," Финуслуг"]}),(0,l.jsx)(et,{iconRight:(0,l.jsx)(p.IconFdsArrowUpRightSmallO,{size:32}),shape:"circle-icon",variant:"white",eventActionText:"IconFdsArrowUpRightSmallO"}),(0,l.jsxs)("picture",{children:[(0,l.jsx)("source",{srcSet:(0,a.xn)(t,"/widgets/footer/apps_d.webp"),media:"(min-width: 1024px)"}),(0,l.jsx)("img",{src:(0,a.xn)(t,"/widgets/footer/apps_m.webp"),alt:"иллюстрация мобильного приложения",loading:"lazy"})]})]})})]})},ev=(0,c.g)("footer-logo","sc"),ex=Object.freeze({wrapper:`${ev}__wrapper`,link:`${ev}__link`,fromMoex:`${ev}__from-moex`,logo:`${ev}__logo`,white:`${ev}__wrapper--white`}),e_=({showcaseUrl:e,minioUrl:t,isWhite:n})=>(0,l.jsx)("div",{className:(0,r.Z)(ex.wrapper,{[ex.white]:n}),children:(0,l.jsxs)(en,{className:ex.link,href:e,eventActionType:d.D.icon,eventActionText:"finuslugi_logo",eventLabel:`finuslugi_logo_${e}`,children:[(0,l.jsx)("img",{className:ex.logo,src:`${t}/images/logo-brandmark-common-finuslugi.svg`}),(0,l.jsx)("img",{className:ex.fromMoex,src:`${t}/images/fromMoex.svg`})]})});var eb=((i=eb||{}).BLACK="black",i.GRAY="gray",i);let ej=(0,c.g)("footer-warning","sc"),ey=Object.freeze({reservedSpace:`${ej}__reserved-space`,wrapper:`${ej}__wrapper`,wrapperGray:`${ej}__wrapper--gray`,fixed:`${ej}__wrapper--fixed`,container:`${ej}__container`,text:`${ej}__text`,invisibleText:`${ej}__text--invisible`}),eN=({text:e,variant:t,fixed:n,isPlaceholder:i})=>(0,l.jsx)("div",{className:(0,r.Z)(ey.wrapper,{[ey.wrapperGray]:"gray"===t,[ey.fixed]:n&&!i}),children:(0,l.jsx)(o.W2,{className:ey.container,children:(0,l.jsx)("div",{className:(0,r.Z)(ey.text,{[ey.invisibleText]:i}),dangerouslySetInnerHTML:{__html:e}})})}),eC=({warning:e})=>{let t="string"==typeof e?{text:e}:e,n={text:t.text,fixed:t.fixed??!0,variant:t.variant??eb.BLACK};return(0,l.jsxs)("div",{className:ey.reservedSpace,children:[(0,l.jsx)(eN,{...n,isPlaceholder:n.fixed}),n.fixed&&(0,l.jsx)(eN,{...n,fixed:!0})]})},e$=({data:e,showcaseUrl:t="https://finuslugi.ru",minioUrl:n="https://assets.finuslugi.ru/mp-assets",customDisclaimer:i,variant:s="default",className:a})=>{var c,u;let d=!i&&null!=e&&e.disclaimer?e.disclaimer:void 0,p=s.includes("compact"),m=s.includes("white"),h=null==(c=null==e?void 0:e.bottom)?void 0:c.concat(p?Y:[]),f=e&&"warning"in e?e.warning:void 0;return e?(0,l.jsx)("footer",{className:(0,r.Z)(J.wrapper,a,{[J.compact]:p,[J.white]:m}),children:(0,l.jsxs)("section",{className:J.section,children:[(0,l.jsxs)(o.W2,{className:J.container,children:[!p&&(0,l.jsx)(ew,{showcaseUrl:t,minioUrl:n,directions:null==e?void 0:e.directions,mobAppUrl:null==e?void 0:e.mobAppUrl}),(0,l.jsx)("div",{className:J.wrapper,children:(0,l.jsxs)("div",{className:J.top,children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:J.main,children:[!p&&(0,l.jsx)("div",{className:J.links,children:null==(u=null==e?void 0:e.top)?void 0:u.map(e=>(0,l.jsx)(en,{href:e.url,eventActionText:e.title,eventLabel:e.url,children:e.title},e.url))}),p&&(0,l.jsx)(e_,{showcaseUrl:t,minioUrl:n,isWhite:m}),(0,l.jsx)(eo,{className:J.disclaimer,disclaimer:d,children:i||ee})]}),(0,l.jsxs)("div",{className:J.bottom,children:[(0,l.jsx)("div",{className:J.bottomLinks,children:null==h?void 0:h.map(e=>(0,l.jsx)(en,{href:e.url,eventActionText:e.title,eventLabel:e.url,children:e.title},e.url))}),(0,l.jsx)(eo,{className:J.bottomDisclaimer,disclaimer:null==e?void 0:e.bottomDisclaimer})]})]}),!p&&(0,l.jsx)(ei,{minioUrl:n,blogs:null==e?void 0:e.blogs})]})})]}),p&&!!f&&(0,l.jsx)(eC,{warning:f})]})}):null};var ek=n(55487),eT=n(4267);let eO={userRegion:eT.U,userTown:eT.a,allRegions:"all_regions",lastRegionsUpdateUnixTimestamp:"lastRegionsUpdateUnixTimestamp",allRussiaSelected:"all_russia_selected"},eS={userRegion:eT.U,userTown:eT.a,allRegions:"all_regions_new_api",lastRegionsUpdateUnixTimestamp:"lastRegionsUpdateUnixTimestamp_new_api",allRussiaSelected:"all_russia_selected"},eA=(e=!1)=>e?eS:eO,eI=(e=!1)=>e?window.allRegionsNewApi:window.allRegions,eR=(e,t=!1)=>{if(t){window.allRegionsNewApi=e;return}window.allRegions=e},eL=(e,t,n=!1)=>{if(typeof document>"u")return;let i=eA(n);if(!e&&!t){ek.a.removeItem(i.userRegion),ek.a.removeItem(i.userTown);return}ek.a.setItem(i.userRegion,JSON.stringify(e)||"",{"max-age":31536e3}),ek.a.setItem(i.userTown,JSON.stringify(t)||"",{"max-age":31536e3})},eP=e=>{if(typeof document>"u")return null;let t=ek.a.getItem(e)??void 0;if(!t||"undefined"===t)return null;try{return JSON.parse(decodeURIComponent(t))}catch{return null}},ez=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},eE=(e=!1)=>{if(typeof window>"u")return[];let t=eI(e);if(Array.isArray(t)&&t.length>0)return t;let n=ez(eA(e).allRegions)||[];return eR(n,e),n},eU=e=>e.some(e=>e.towns.some(e=>!!e.newId||!!e.fiasId)),eM=(e,t=!1)=>!(e.length<1)&&(!t||eU(e)),eB=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]),[])},eW=(e,t)=>`${e.replace(/\/+$/,"")}${t}`,eD=e=>e?1:0,eF=async e=>{try{return await (await fetch(e)).json()}catch(e){console.warn(e)}return null},eZ=(e,t=!1)=>{if(e.length<1)return;let n=eA(t);eR(e,t),window.localStorage.setItem(n.allRegions,JSON.stringify(e)),window.localStorage.setItem(n.lastRegionsUpdateUnixTimestamp,JSON.stringify(Date.now()))},eG=(e,t)=>{let n=t.filter(e=>e.isActive).map(e=>({id:e.geoRegionId,name:e.name,name_r:e.nameR,name_p:e.nameP,url:e.url,region_id:e.geoRegionId,enabled:eD(e.isActive),fiasId:e.fiasId,towns:[]})),i=n.reduce((e,t)=>(e[t.id]=t,e),{});return e.forEach(e=>{let t=i[e.geoRegionId];t&&t.towns.push({id:e.legacyId,name:e.name,name_r:e.nameR,name_p:e.nameP,url:e.url,main:eD(e.isRegionalCenter),newId:e.id,fiasId:e.fiasId})}),n},eV=(e,t,n)=>{let i=null,l=null;n&&e.some(e=>{let t=e.towns.find(e=>e.id===n.id)??null;return!!t&&(i=e,l=t,!0)});let s=t?e.find(e=>e.id===t.id)??null:null;return{region:i??s??t,town:l??n}},eH=(e,t)=>(!!e||!!t)&&!(null!=e&&e.newId)&&!(null!=e&&e.fiasId)&&!(null!=t&&t.newId)&&!(null!=t&&t.fiasId),eq=(e,t)=>!!(null!=e&&e.newId||null!=e&&e.fiasId||null!=t&&t.newId||null!=t&&t.fiasId),eJ=async()=>{let e=await eF("https://finuslugi.ru/money_data/Root.json?short=1"),t=Array.isArray(null==e?void 0:e.regions)?e.regions:[];return eZ(t),t},eQ=async e=>{let[t,n]=await Promise.all([eF(eW(e,"/sc/api/v1/cities?all=true&isActive=true")),eF(eW(e,"/sc/api/v1/regions?all=true"))]);if(!Array.isArray(null==t?void 0:t.content)||!Array.isArray(null==n?void 0:n.content))return[];let i=eG(t.content,n.content);return eU(i)?(eZ(i,!0),i):[]},eY=async({showcaseUrl:e="",useNewCitiesApi:t=!1}={})=>t?eQ(e):eJ(),eK=async e=>{let t=null;try{t=await (await fetch(`${e}`,{method:"GET"})).json()}catch(e){console.warn(e)}return t||null},eX=(e,t,n)=>{(0,d.h)({eventCategory:"finkit-widgets-sc-city-select",eventActionType:e,eventActionText:t,eventLabel:n})};var e0=n(85241);let e1=eE(),e2=eB(e1),e4={regions:e1,towns:e2,region:null,town:null,startPopupVisible:!1,setStartPopupVisible:()=>null,popupVisible:!1,handleToggleModal:()=>null,selectCity:()=>null,handleButtonClick:()=>null,startRegion:null,startTown:null},e5=(0,m.createContext)(e4);function e3(){return(0,m.useContext)(e5)}let e7=({children:e,initialRegion:t,initialTown:n,showStartGeoPopup:i=!0,lastRegionsUpdateUnixTimestamp:s,dadataUrl:o="https://finuslugi.ru/backend/money/dadata",showcaseUrl:r="",useNewCitiesApi:a=!1})=>{let c=eA(a),u=Number(ez(c.lastRegionsUpdateUnixTimestamp)||0),p=Number(s||0)>u,[h,f]=(0,m.useState)(eE(a)),g=(0,m.useRef)(h),[{startRegion:w,startTown:v},x]=(0,m.useState)({startRegion:e4.startRegion,startTown:e4.startTown}),_=t??e4.region,b=n??e4.town,[{region:j,town:y},N]=(0,m.useState)({region:_,town:b}),[C,$]=(0,m.useState)(e4.startPopupVisible),[k,T]=(0,m.useState)(e4.popupVisible),O=(0,m.useRef)(""),S=(0,m.useRef)(!1),A=(0,m.useMemo)(()=>eB(h),[h]);(0,m.useEffect)(()=>{g.current=h},[h]);let I=(0,m.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)||""),$(!0),x({startRegion:e,startTown:t})},[$,x]),R=(0,m.useCallback)((e,t)=>{window.sessionStorage.getItem("start_popup_opened")||I(e,t)},[I]),L=(0,m.useCallback)(()=>{if(O.current&&!j&&!y){let e=A.find(e=>e.name===O.current)??null;return R(h.find(t=>t.id===(null==e?void 0:e.parentId))??null,e)}R(j,y)},[j,y,A,h,R]),P=(0,m.useCallback)(e=>{T(e)},[T]),z=(0,m.useCallback)((e,t)=>{if(!e&&!t){window.localStorage.setItem(c.allRussiaSelected,"1"),window.localStorage.setItem(c.userRegion,""),window.localStorage.setItem(c.userTown,""),eL(null,null,a);return}window.localStorage.setItem(c.allRussiaSelected,"0"),window.localStorage.setItem(c.userRegion,JSON.stringify(e)||""),window.localStorage.setItem(c.userTown,JSON.stringify(t)||""),eL(e||null,t||null,a)},[c,a]),E=(0,m.useCallback)(e=>{e?eX(d.D.icon,"location"):eX(d.D.button,(null==y?void 0:y.name)||"Вся Россия"),!i||window.sessionStorage.getItem("start_popup_opened")?P(!0):L()},[i,y,P,L]),U=(0,m.useCallback)((e,t)=>{z(e,t),N({region:e||null,town:t||null}),$(!1),P(!1);let n=new CustomEvent("onRegionChange",{detail:{region:e,town:t}});document.dispatchEvent(n)},[P,z]),M=()=>{let e=eP(c.userRegion)??ez(c.userRegion),t=eP(c.userTown)??ez(c.userTown),n=eV(g.current,e,t),l=a&&eH(e,t);l&&(S.current=!0),l&&eq(n.region,n.town)&&(z(n.region,n.town),S.current=!1),N(n);let s=async({coords:{latitude:e,longitude:t}})=>{let n=`${o}?lat=${e}&lon=${t}`,i=await eK(n);null!=i&&i.location&&(O.current=i.location.data.city)};if(!window.localStorage.getItem("dadata")&&navigator.geolocation&&i)try{navigator.geolocation.getCurrentPosition(s,()=>null)}catch{}};return(0,m.useEffect)(()=>{(!eM(h,a)||p)&&eY({showcaseUrl:r,useNewCitiesApi:a}).then(e=>{e.length<1||f(e)})},[]),(0,m.useEffect)(()=>{if(!a)return;let e=eV(h,j,y);S.current&&eq(e.region,e.town)&&(z(e.region,e.town),S.current=!1),N(e)},[h,j,z,y,a]),(0,m.useEffect)(()=>{if(window.innerWidth<1024){let e=()=>{M(),window.removeEventListener("scroll",e)};window.addEventListener("scroll",e)}else setTimeout(()=>{M()},0)},[]),(0,l.jsx)(e5.Provider,{value:{regions:h,towns:A,region:j,town:y,startPopupVisible:C,setStartPopupVisible:$,popupVisible:k,handleToggleModal:P,selectCity:U,handleButtonClick:E,startRegion:w,startTown:v},children:e})},e6=()=>{let e=(0,m.useRef)(null),t=(0,m.useCallback)(()=>{e.current&&(clearTimeout(e.current),e.current=null)},[]),n=(0,m.useCallback)((t,n)=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{e.current=null,t()},n)},[]);return(0,m.useEffect)(()=>t,[t]),{start:n,clear:t,pending:!!e.current}},e8=(0,c.g)("city-select-modal-body","sc"),e9=Object.freeze({wrapper:`${e8}__wrapper`,subtitle:`${e8}__subtitle`,hintWrapper:`${e8}__hint-wrapper`,hintText:`${e8}__hint-text`,input:`${e8}__input`,chips:`${e8}__chips`,townsListWrapper:`${e8}__towns-list-wrapper`,townsList:`${e8}__towns-list`,townsGroup:`${e8}__towns-group`,townsGroupLabel:`${e8}__towns-group-label`,townsGroupList:`${e8}__towns-group-list`,townsName:`${e8}__towns-name`,regionName:`${e8}__region-name`}),te=({groupedTowns:e,chips:t,query:n,setQuery:i,isDrawer:s})=>{var o;let r=e3(),a=(0,m.useRef)(null),[c,h]=(0,m.useState)("10000px");(0,m.useEffect)(()=>{if(!s||!a.current)return;let e=e=>e.reduce((e,t)=>e+t,0),t=(n,i)=>{let l=n.map(e=>[...e]),s=l.map(e),o=s.reduce((e,t,n)=>t<s[e]?n:e,0);0===o&&l[0].push(l[1].shift()),2===o&&l[2].unshift(l[1].pop()),1===o&&s[0]>s[2]&&l[1].unshift(l[0].pop()),1===o&&s[0]<s[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&&h(`${i}px`)}).observe(a.current)},[]);let f=e=>{if(eX(d.D.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,l.jsxs)("div",{className:e9.wrapper,children:[(0,l.jsxs)("div",{className:e9.subtitle,children:["Покажем предложения рядом с вами",(0,l.jsxs)("div",{className:e9.hintWrapper,children:[(0,l.jsx)(p.IconFdsQuestionCircleO,{size:24}),(0,l.jsx)("div",{className:e9.hintText,children:"Укажите свой город, чтобы увидеть предложения, доступные в вашем регионе"})]})]}),(0,l.jsx)(u.MA,{className:e9.input,value:n,onChange:i,size:"s",placeholder:"Введите название города",icon:n?(0,l.jsx)(p.IconFdsCloseCircleO,{size:24,onClick:()=>i("")}):(0,l.jsx)(p.IconFdsSearchO,{size:24})}),(0,l.jsx)(u.cL,{className:e9.chips,chips:t,value:(null==(o=r.town)?void 0:o.id)||0,onChipClick:e=>{f(r.towns.find(t=>t.id===e))}}),(0,l.jsx)("div",{className:e9.townsListWrapper,children:(0,l.jsx)("div",{ref:a,className:e9.townsList,style:{maxHeight:c},children:e.map(e=>(0,l.jsxs)("div",{className:e9.townsGroup,children:[(0,l.jsx)("div",{className:e9.townsGroupLabel,children:e.letter}),(0,l.jsx)("div",{className:e9.townsGroupList,children:e.towns.map(e=>(0,l.jsxs)("button",{type:"button",onClick:()=>f(e),children:[(0,l.jsx)("div",{className:e9.townsName,children:e.name}),(0,l.jsx)("div",{className:e9.regionName,children:e.parentName})]},e.id))})]},e.letter))})})]})},tt=[1095,1096,134,720,189,180],tn=()=>{var e;let t=e3(),n=(0,u._m)("l"),[i,s]=(0,m.useState)(""),o=`Ваш выбор: ${(null==(e=t.town)?void 0:e.name)||"Вся Россия"}`,r=(0,m.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,m.useMemo)(()=>[{id:0,label:"Вся Россия"},...tt.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=()=>{eX(d.D.button,"close"),t.handleToggleModal(!1)};return(0,l.jsxs)(G,{children:[!n&&(0,l.jsx)(Z,{title:o,isOpen:t.popupVisible,onClose:c,full:!0,children:(0,l.jsx)(te,{groupedTowns:r,chips:a,query:i,setQuery:s})}),n&&(0,l.jsx)(E,{title:o,isOpen:t.popupVisible,onClose:c,width:"856px",rowTitle:!0,titleAlign:"left",children:(0,l.jsx)(te,{groupedTowns:r,chips:a,query:i,setQuery:s,isDrawer:!0})})]})},ti={"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"},tl=()=>{let{hostname:e}=window.location;return Object.prototype.hasOwnProperty.call(ti,e)?ti[e]:ti["finuslugi.ru"]},ts=(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)},to=()=>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)}})}),tr=()=>{let[e,t]=(0,m.useState)(!1),[n,i]=(0,m.useState)(!1),l=(0,m.useRef)(!1),s=e=>{l.current=e,i(e)};return(0,m.useEffect)(()=>{if(typeof window>"u")return;let e=tl(),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((o,r)=>{if(l.current){r(Error("chat is already opened"));return}i?(i.openWidget(),t(!1),o()):(s(!0),window.getWebChatCraftTalkExternalControl=e=>{var n;i=e;let l=document.querySelector(".webchat");l&&to().observe(l,{attributes:!0,attributeFilter:["style"]}),null!=(n=window.supportWidget)&&n.craftTalk&&(window.supportWidget.craftTalk.close=i.closeWidget),null==i||i.openWidget(),s(!1),t(!1),o()},ts(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}},ta=(0,m.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 tc(){return(0,m.useContext)(ta)}let tu=e=>{let[t,n]=(0,m.useState)(!1),[i,s]=(0,m.useState)(!1),[o,r]=(0,m.useState)(!!e.isMainBannerPage),{isChatModalOpen:a,setIsChatModalOpen:c,isChatLoading:u}=tr(),[d,p]=(0,m.useState)(null),[h,f]=(0,m.useState)(null),[g,w]=(0,m.useState)(!1),[v,x]=(0,m.useState)(!1),[_,b]=(0,m.useState)(!1),j=(0,m.useRef)(null),y=k(g),N=(0,m.useRef)(null),C=(0,m.useRef)(null),$=(0,m.useRef)(null),T=(0,m.useRef)(null),O=(0,m.useCallback)(()=>{y.current&&y.current.scrollTo({top:0})},[y]),S=(0,m.useCallback)(e=>{f(e),O()},[O]),A=(0,m.useCallback)(e=>{N.current&&clearTimeout(N.current),e&&x(!0),e||(N.current=setTimeout(()=>{x(!1),S(null)},300))},[S]),I=(0,m.useCallback)((e,t,n)=>{if(t&&S(t),!n&&e===d||!e){A(!g),w(!g);return}p(e),A(!0),w(!0)},[d,S,g,A]),R=(0,m.useCallback)(()=>{C.current&&clearTimeout(C.current),b(!0),C.current=setTimeout(()=>{b(!1)},650)},[]);return(0,m.useEffect)(()=>{n(!!document.cookie.includes("auth.gtm_customer_id"));let t=(0,e0.s)(s,r,e.isMainBannerPage);return(0,e0.i)(),t},[]),(0,l.jsx)("header",{children:(0,l.jsx)(ta.Provider,{value:{isAuth:t,isHeaderHidden:i,isHeaderTransparent:o,openedBlock:d,setOpenedBlock:I,openedSection:h,setOpenedSection:S,isNavigationOpen:g,isNavigationMounted:v,navMenuItemsRef:j,navigationRef:y,ignoreClicks:_,setIgnoreClicks:R,isChatModalOpen:a,setIsChatModalOpen:c,isChatLoading:u,fixedContainerRef:$,headerRef:T},children:e.children})})},td=({label:e,onClick:t,eventActionText:n,eventLabel:i,...s})=>(0,l.jsx)(u.zx,{label:e,onClick:e=>{null==t||t(e),(0,d.h)({eventCategory:eT.H,eventActionType:d.D.button,eventActionText:n||"",eventLabel:i||""})},...s}),tp=(0,c.g)("header-popup","sc"),tm=Object.freeze({popup:`${tp}__popup`,popupHeader:`${tp}__popup-header`,popupClose:`${tp}__popup-close`,body:`${tp}__body`}),th=({isOpen:e,onClose:t,children:n,title:i})=>{let s=(0,u._m)("l");return(0,l.jsxs)(G,{children:[!s&&(0,l.jsx)(Z,{title:i,isOpen:e,onClose:t,children:n}),s&&e&&(0,l.jsxs)("div",{className:tm.popup,children:[(0,l.jsxs)("div",{className:tm.popupHeader,children:[i,(0,l.jsx)(td,{className:tm.popupClose,iconLeft:(0,l.jsx)(p.IconFdsCloseO,{}),shape:"icon",appearance:"ghost",size:"xs",onClick:t,eventActionText:"IconFdsCloseO"})]}),(0,l.jsx)("div",{className:tm.body,children:n})]})]})},tf=(0,c.g)("start-choice-popup","sc"),tg=Object.freeze({top:`${tf}__top`,progress:`${tf}__progress`,innerCircle:`${tf}__inner-circle`,title:`${tf}__title`,subtitle:`${tf}__subtitle`,actions:`${tf}__actions`}),tw=()=>{var e,t;let n=e3(),[i,s]=(0,m.useState)(10),[o,r]=(0,m.useState)(0),a=(0,m.useRef)(void 0),c=()=>{eX(d.D.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,m.useEffect)(()=>{n.startPopupVisible?(()=>{let e=Number((" "+i).slice(1)),t=1e3*e/100,n=0,l=0;a.current=setInterval(()=>{n++,l+=t,r(3.6*n);let o=e-Math.floor(l/1e3);o<i&&s(o),100===n&&(clearInterval(a.current),c())},t)})():(clearInterval(a.current),s(10),r(0))},[n.startPopupVisible]),(0,l.jsxs)(th,{isOpen:n.startPopupVisible,onClose:c,title:(0,l.jsx)("button",{type:"button",className:tg.progress,style:{background:`conic-gradient(#ff0508 ${o}deg, #e3e7ec 0deg)`},onClick:c,children:(0,l.jsx)("div",{className:tg.innerCircle,children:i})}),children:[(0,l.jsxs)("div",{className:tg.top,children:[(0,l.jsxs)("div",{className:tg.title,children:["Ваш город ",(null==(e=n.startTown)?void 0:e.name)||(null==(t=n.startRegion)?void 0:t.name)||"Вся Россия","?"]}),(0,l.jsx)("div",{className:tg.subtitle,children:"Это поможет вам увидеть выгодные предложения в вашем городе"})]}),(0,l.jsxs)("div",{className:tg.actions,children:[(0,l.jsx)(td,{size:"s",stretch:!0,eventActionText:"Да, все верно",onClick:()=>{eX(d.D.button,"Да, все верно"),n.selectCity(n.startRegion,n.startTown)},children:"Да, все верно"}),(0,l.jsx)(td,{variant:"secondary",size:"s",stretch:!0,eventActionText:"Нет, изменить",onClick:()=>{eX(d.D.button,"Нет, изменить"),n.setStartPopupVisible(!1),n.handleToggleModal(!0)},children:"Нет, изменить"})]})]})},tv=(0,c.g)("city-select","sc"),tx=Object.freeze({button:`${tv}__button`,minimal:`${tv}__minimal`,full:`${tv}__full`}),t_=({initialTown:e})=>{var t;let n=e3(),i=(null==(t=n.town)?void 0:t.name)||e||"Вся Россия",{setIsChatModalOpen:s,isChatModalOpen:o}=tc(),{startPopupVisible:a,setStartPopupVisible:c,popupVisible:d}=n,h=(0,m.useRef)();(0,m.useEffect)(()=>{d&&(h.current="popup")},[d]),(0,m.useEffect)(()=>{o&&(h.current="chat")},[o]),(0,m.useEffect)(()=>{a&&(h.current="startPopup")},[a]),(0,m.useEffect)(()=>{h.current&&("chat"===h.current&&a?c(!1):["startPopup","popup"].includes(h.current)&&o&&s(!1))},[d,o,a,c,s]);let f={appearance:"ghost",size:"xs",onClick:()=>n.handleButtonClick(!1),iconLeft:(0,l.jsx)(p.IconFdsLocationO,{size:24})};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(u.zx,{...f,className:(0,r.Z)(tx.button,tx.full),label:i}),(0,l.jsx)(u.zx,{...f,className:(0,r.Z)(tx.button,tx.minimal),shape:"icon"}),(0,l.jsx)(tn,{}),(0,l.jsx)(tw,{})]})},tb=({onClick:e,eventActionType:t,eventActionText:n,eventLabel:i,...s})=>(0,l.jsx)(u.rU,{onClick:l=>{null==e||e(l),(0,d.h)({eventCategory:eT.H,eventActionType:t||d.D.link,eventActionText:n||"",eventLabel:i||""})},...s}),tj=(0,c.g)("header-mobile-app-banner","sc"),ty=Object.freeze({wrapper:`${tj}__wrapper`,container:`${tj}__container`,closeButton:`${tj}__close-button`,innerWrapper:`${tj}__inner-wrapper`,imageWrapper:`${tj}__image-wrapper`,image:`${tj}__image`,title:`${tj}__title`,description:`${tj}__description`,callToAction:`${tj}__call-to-action`,scanQr:`${tj}__scan-qr`}),tN=Object.freeze({mobile:56,desktop:68}),tC="headerBannerShownAt",t$=()=>{let e=localStorage.getItem(tC);if(!e)return null;let t=new Date(e);return isNaN(t.getTime())?null:t},tk=()=>{localStorage.setItem(tC,new Date().toISOString())},tT=()=>{let e=t$();return!e||Math.floor((e.getTime()-new Date().getTime())/864e5)>5},tO=({minioUrl:e,className:t,mobileAppUrl:n})=>{let{fixedContainerRef:i,headerRef:s}=tc(),[c,h]=(0,m.useState)(!1),[f,g]=(0,m.useState)(!1),[w,v]=(0,m.useState)(!1),x=(0,m.useCallback)((e="desktop")=>{let t=i.current;t&&(t.style.transform="translateY(0)",document.documentElement.style.setProperty("--fixed-header-height",`${tN[e]+eT.F[e]}px`),document.documentElement.style.setProperty("--new-header-height-desktop",`${tN.desktop+eT.F.desktop}px`),document.documentElement.style.setProperty("--new-header-height-mobile",`${tN.mobile+eT.F.mobile}px`),document.documentElement.style.setProperty("--static-new-header-height-mobile",`${tN.mobile+eT.F.mobile}px`),document.documentElement.style.setProperty("--static-new-header-height-desktop",`${tN.desktop+eT.F.desktop}px`),document.documentElement.style.setProperty("--header-height",`${tN[e]+108}px`))},[]),_=(0,m.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,m.useEffect)(()=>{let e=s.current;if(!e)return;let t=()=>{f&&h(!1),v(!1)};return e.addEventListener("transitionend",t),()=>{e.removeEventListener("transitionend",t)}},[f]),(0,m.useEffect)(()=>{tT()&&h(!0)},[]),(0,m.useEffect)(()=>{let e=window.innerWidth<768;c&&(x(e?"mobile":"desktop"),window.matchMedia("(prefers-reduced-motion: reduce)").matches?h(!0):v(!0));let t=()=>{if(!c)return null;x(window.innerWidth<768?"mobile":"desktop")};return window.addEventListener("resize",t),()=>{_(),window.removeEventListener("resize",t)}},[c,x,_]),c?(0,l.jsx)("div",{id:"headerNotice",role:"region","aria-label":"Мобильное приложение","data-opening":w,className:(0,r.Z)(ty.wrapper,t),children:(0,l.jsx)(o.W2,{children:(0,l.jsxs)("div",{className:ty.container,children:[(0,l.jsxs)("div",{className:ty.innerWrapper,children:[(0,l.jsxs)("picture",{className:ty.imageWrapper,children:[(0,l.jsx)("source",{srcSet:(0,a.xn)(e,"/widgets/header/qr-mobile-app.svg"),media:"(min-width: 768px)"}),(0,l.jsx)("img",{className:ty.image,src:(0,a.xn)(e,"/logo/finuslugi/default-regular.svg")})]}),(0,l.jsxs)("div",{className:ty.scanQr,children:[(0,l.jsx)("div",{className:ty.title,children:"Скачайте приложение Финуслуги"}),(0,l.jsx)("div",{className:ty.description,children:"Сканируйте QR-код"})]}),(0,l.jsxs)("div",{className:ty.callToAction,children:[(0,l.jsxs)("div",{children:["Приложение",(0,l.jsx)("br",{}),"Финуслуги"]}),(0,l.jsx)(u.zx,{onClick:()=>{(0,e0.h)(d.D.button,"skachat_mob_prilozheniye_fu"),window.open(n,"_blank","noreferrer")},variant:"white",size:"xs",children:"Скачать"})]})]}),(0,l.jsx)("div",{"aria-label":"Закрыть",role:"button",className:ty.closeButton,onClick:()=>{tk(),_(),window.matchMedia("(prefers-reduced-motion: reduce)").matches?h(!1):g(!0)},children:(0,l.jsx)(p.IconFdsCloseO,{size:"100%"})})]})})}):null},tS=(0,c.g)("header-chat-modal-body","sc"),tA=Object.freeze({wrapper:`${tS}__wrapper`,cardButton:`${tS}__card-button`,card:`${tS}__card`,cardTitle:`${tS}__card-title`,cardSubtitle:`${tS}__card-subtitle`,button:`${tS}__button`}),tI=()=>{let e=tc();return(0,l.jsxs)("div",{className:tA.wrapper,children:[(0,l.jsx)(td,{className:tA.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,l.jsxs)(o.Zb,{className:tA.card,variant:"secondary",children:[(0,l.jsxs)("div",{className:tA.cardTitle,children:[(0,l.jsx)("img",{src:"https://finuslugi.ru/icons/chaticons/new/chat_icon_hover.svg",alt:"chat",width:24,height:24,loading:"lazy"}),"Напишите в чат"]}),(0,l.jsxs)("p",{className:tA.cardSubtitle,children:["Виртуальный ассистент доступен\xa024/7, ",(0,l.jsx)("br",{}),"операторы\xa0—\xa0с\xa06:00 до\xa023:59\xa0мск"]})]})}),!1]})},tR=({data:e,isMobile:t})=>{let n=tc();return(0,l.jsx)("div",{className:e0.a.contentWrapper,children:e.map(e=>(0,l.jsx)(m.Fragment,{children:e.sections.map(e=>{var i;return(0,l.jsxs)("div",{className:(0,r.Z)(e0.a.content,{[e0.a.hidden]:n.openedSection!==e.id,[e0.a.contentOpen]:!!n.openedSection}),children:[(0,l.jsx)("div",{className:e0.a.contentHeader,children:(0,l.jsx)("label",{children:e.title})}),null==(i=e.content)?void 0:i.map((n,i)=>{var s,o;return(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{children:(0,l.jsx)("a",{className:(0,r.Z)(e0.a.contentTitle,{[e0.a.removed]:!n.title,[e0.a.contentTitleUrl]:!!n.url,[e0.a.contentTitleLink]:!!e.isSeeAllLinkAvailable,[e0.a.contentTitleNew]:!!n.new}),href:e.isSeeAllLinkAvailable?n.url:void 0,children:(0,l.jsxs)("span",{children:[e.isSeeAllLinkAvailable&&(0,l.jsx)("div",{className:e0.a.arrowIcon,children:(0,l.jsx)(p.IconFdsArrowUpRightSmallO,{})}),n.title]})})}),!(null!=(s=n.links)&&s.length)&&(0,l.jsx)(e0.N,{items:n.chips||[],maxNumberOfLines:e.content.length<=1?99:t?3:2}),!!(null!=(o=n.links)&&o.length)&&(0,l.jsx)("div",{className:(0,r.Z)(e0.a.links,{[e0.a.linksColumns]:!!n.columns,[e0.a.linksTitleless]:!n.title}),children:n.links.map(e=>(0,l.jsxs)("a",{href:e.url,className:(0,r.Z)({[e0.a.new]:!!e.new}),onClick:()=>(0,e0.h)(d.D.link,e.title,`${e.title}_${e.url}`),children:[(0,l.jsx)("div",{className:e0.a.arrowIcon,children:(0,l.jsx)(p.IconFdsArrowUpRightSmallO,{})}),(0,l.jsx)("span",{children:e.title})]},e.url))})]},`${n.url}_${i}`)})]},e.id)})},e.id))})},tL=(0,c.g)("navigation-section-icon","sc"),tP=Object.freeze({icon:`${tL}`}),tz=({name:e,background:t})=>{let n=(0,m.useMemo)(()=>e&&p[e]||null,[e]);return e&&n?(0,l.jsx)("div",{className:tP.icon,style:{background:t},children:(0,l.jsx)(n,{})}):null},tE=(0,c.g)("navigation","sc"),tU=Object.freeze({navigation:`${tE}`,navigationOpening:`${tE}--opening`,navigationClosing:`${tE}--closing`,wrapper:`${tE}__wrapper`,container:`${tE}__container`,containerOpen:`${tE}__container--open`,sections:`${tE}__sections`,sectionsOpen:`${tE}__sections--open`,citySelectButton:`${tE}__city-select-button`,sectionsTitle:`${tE}__sections-title`,sectionsWrapper:`${tE}__sections-wrapper`,section:`${tE}__section`,sectionArrow:`${tE}__section-arrow`,sectionExtra:`${tE}__section--extra`,sectionActive:`${tE}__section--active`,sectionTitle:`${tE}__section-title`,chatWrapper:`${tE}__chat-wrapper`,chatHeader:`${tE}__chat-header`,backButton:`${tE}__back-button`,useful:`${tE}__useful`,usefulOpen:`${tE}__useful--open`,usefulTitle:`${tE}__useful-title`,usefulGrid:`${tE}__useful-grid`,removed:`${tE}__removed`}),tM=({data:e})=>{var t;let n=tc(),i=e3(),s=(0,u.aF)("m"),[a,c]=(0,m.useState)(!0);(0,m.useEffect)(()=>{c(s)},[s]);let h=(0,m.useRef)(null),f=(0,m.useCallback)(()=>{h.current&&clearTimeout(h.current),h.current=setTimeout(()=>n.openedSection?n.setOpenedSection(null):n.isNavigationOpen?n.setOpenedBlock(null):void 0,50)},[n]),g=(0,m.useRef)(!1),w=(0,m.useRef)(null),v=(0,m.useCallback)(()=>{a&&(g.current=!0,w.current=window.onpopstate||null,window.onpopstate=function(){window.history.forward(),f()},window.history.pushState(null,"",window.location.href))},[f,a]),x=(0,m.useCallback)(()=>{g.current=!1,window.onpopstate=w.current,window.history.go(-1)},[]),_=(0,m.useRef)(null),b=(0,m.useCallback)(e=>{if(a||!n.navMenuItemsRef.current||!n.navigationRef.current)return;let t=e.target,i=!n.navMenuItemsRef.current.contains(t)&&!n.navigationRef.current.contains(t);if(i&&!_.current){n.setIgnoreClicks(),_.current=setTimeout(()=>n.setOpenedBlock(null),300);return}!i&&_.current&&(clearTimeout(_.current),_.current=null)},[a,n]),j=(0,m.useRef)(null),y=(0,m.useCallback)(e=>{typeof window>"u"||(e?(j.current=b,window.addEventListener("mousemove",j.current)):j.current&&window.removeEventListener("mousemove",j.current))},[b]);(0,m.useEffect)(()=>{y(n.isNavigationOpen),n.isNavigationOpen&&!g.current&&v(),!n.isNavigationOpen&&g.current&&x()},[n.isNavigationOpen]);let N=(e,t)=>()=>{(0,e0.h)(d.D.button,t),n.setOpenedSection(e)},{start:C,clear:$}=e6(),k=(e,t)=>()=>{a||C(N(e,t),150)},T=()=>{a||$()};return(0,l.jsx)("div",{ref:n.navigationRef,className:(0,r.Z)(tU.navigation,{[tU.removed]:!n.isNavigationMounted,[tU.navigationOpening]:n.isNavigationOpen,[tU.navigationClosing]:!n.isNavigationOpen}),children:(0,l.jsx)("div",{className:tU.wrapper,children:(0,l.jsxs)(o.W2,{className:(0,r.Z)(tU.container,{[tU.containerOpen]:!!n.openedSection}),children:[(0,l.jsxs)("div",{className:(0,r.Z)(tU.sections,{[tU.sectionsOpen]:!!n.openedSection}),children:[(0,l.jsx)(u.zx,{className:tU.citySelectButton,variant:"purple",appearance:"ghost",size:"xs",onClick:()=>i.handleButtonClick(!1),iconLeft:(0,l.jsx)(p.IconFdsLocationO,{size:24}),label:(null==(t=i.town)?void 0:t.name)||"Вся Россия"}),e.map(e=>(0,l.jsxs)("ul",{className:(0,r.Z)(tU.sectionsWrapper,{[tU.removed]:n.openedBlock!==e.id&&!a}),children:[(0,l.jsx)("div",{className:tU.sectionsTitle,children:eT.b[e.id]}),e.sections.map(e=>(0,l.jsxs)("li",{className:(0,r.Z)(tU.section,{[tU.sectionExtra]:!!e.extra,[tU.sectionActive]:n.openedSection===e.id}),onClick:N(e.id,e.title),onMouseEnter:k(e.id,e.title),onMouseLeave:T,children:[(0,l.jsx)(tz,{name:e.uikitIcon,background:e.uikitIconBg}),(0,l.jsx)("span",{className:tU.sectionTitle,children:e.title}),(0,l.jsx)("div",{className:tU.sectionArrow,children:(0,l.jsx)(p.IconFdsChevronRightSmallO,{size:24})})]},e.id))]},e.id)),(0,l.jsxs)("div",{className:tU.chatWrapper,children:[(0,l.jsx)("div",{className:tU.chatHeader,children:"Нужна помощь?"}),(0,l.jsx)(tI,{})]})]}),(0,l.jsxs)("button",{type:"button",className:(0,r.Z)(tU.backButton,{[tU.removed]:!n.openedSection}),onClick:()=>{(0,e0.h)(d.D.button,"Назад"),n.setOpenedSection(null)},children:[(0,l.jsx)(p.IconFdsChevronLeftO,{size:24}),(0,l.jsx)("span",{children:"Назад"})]}),(0,l.jsx)(tR,{data:e,isMobile:a}),(0,l.jsxs)("div",{className:(0,r.Z)(tU.useful,{[tU.usefulOpen]:!!n.openedSection}),children:[(0,l.jsx)("div",{className:tU.usefulTitle,children:"Полезное на Финуслугах"}),e.map(e=>(0,l.jsx)(m.Fragment,{children:e.sections.map(e=>{var t;return(0,l.jsx)("div",{className:(0,r.Z)(tU.usefulGrid,{[tU.removed]:n.openedSection!==e.id}),children:null==(t=e.useful)?void 0:t.map((e,t)=>(0,l.jsxs)("a",{href:e.url,onClick:()=>(0,e0.h)(d.D.link,e.title,`${e.title}_${e.url}`),children:[(0,l.jsx)("div",{children:(0,l.jsx)("img",{src:e.icon,srcSet:e.icon2?`${e.icon}, ${e.icon2} 2x`:void 0,alt:e.title,loading:"lazy"})}),(0,l.jsx)("span",{dangerouslySetInnerHTML:{__html:e.title}})]},`${e.title}_${t}`))},e.id)})},e.id))]})]})})})},tB=(e,t,n)=>{var i,l,s,o,r,c,u;let d=(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==(o=null==(s=null==e?void 0:e.NAVIGATOR)?void 0:s[d])?void 0:o.content)||[];if(null!=(u=null==(c=null==(r=null==e?void 0:e.NAVIGATOR)?void 0:r[d])?void 0:c.content)&&u[0]&&Array.isArray(n)&&p.length){let i=n.map(({title:e,url:n})=>({title:e,url:(0,a.xn)(t||"",n),new:0}));e.NAVIGATOR[d].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:[]}]},tW=({data:e,showcaseUrl:t="https://finuslugi.ru",minioUrl:n="https://assets.finuslugi.ru/mp-assets",lkUrl:i="https://lk.finuslugi.ru/registration",initialTown:s,isMainBannerPage:c,enableAppHeaderBanner:h=!1,news:f,className:g})=>{let w=tc(),v=(0,m.useMemo)(()=>tB(e,t,f),[e,t,f]),x=null==e?void 0:e.config,_=(0,m.useMemo)(()=>v.reduce((e,t)=>{var n;return e[t.id]=null==(n=t.sections[0])?void 0:n.id,e},{}),[v]),b=w.isAuth?"Личный кабинет":"Войти",j=c&&w.isHeaderTransparent,y=(e,t,n,i)=>()=>{e!==w.openedBlock?(0,e0.h)(d.D.toggle,t,"on"):(0,e0.h)(d.D.button,"menu_close","on");let l=n?_[e]:"";w.setOpenedBlock(e,l,!!i)},{start:N,clear:C}=e6(),$=(e,t,n,i)=>()=>{w.isNavigationOpen&&e===w.openedBlock||w.setIgnoreClicks(),N(y(e,t,n,i),200)},k=e=>()=>{w.ignoreClicks||e()},T=e=>w.openedBlock===e&&w.isNavigationOpen;return e?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{ref:w.headerRef,className:(0,r.Z)(eT.s.header,g,{[eT.s.transparent]:j}),children:(0,l.jsxs)("div",{ref:w.fixedContainerRef,className:(0,r.Z)(eT.s.fixed,{[eT.s.hidden]:w.isHeaderHidden,[eT.s.navigationOpen]:w.isNavigationOpen}),children:[!!(null!=x&&x.appBannerUrl)&&h&&(0,l.jsx)(tO,{mobileAppUrl:x.appBannerUrl,minioUrl:n}),(0,l.jsxs)(o.W2,{className:eT.s.container,children:[(0,l.jsxs)("div",{className:eT.s.leftRow,children:[(0,l.jsx)(tb,{className:eT.s.logo,href:t,eventActionType:d.D.icon,eventActionText:"finuslugi_logo",eventLabel:`finuslugi_logo_${t}`,children:(0,l.jsxs)("picture",{children:[(0,l.jsx)("source",{srcSet:(0,a.xn)(n,"/widgets/header/logo/d.webp"),media:"(min-width: 768px)"}),(0,l.jsx)("img",{src:(0,a.xn)(n,"/widgets/header/logo/m.webp"),alt:"Финуслуги",loading:"eager"})]})}),(0,l.jsx)("nav",{ref:w.navMenuItemsRef,className:eT.s.menuItems,children:(0,l.jsx)("ul",{children:eT.c.map(({id:e,label:t})=>(0,l.jsx)("li",{children:(0,l.jsx)(u.zx,{className:(0,r.Z)({[eT.s.menuItemActive]:T(e)}),label:t,variant:"white",size:"xs",onClick:k(y(e,t,!0)),onMouseEnter:$(e,t,!0,!0),onMouseLeave:C})},e))})}),(0,l.jsx)(td,{className:(0,r.Z)(eT.s.tabletMenuButton,{[eT.s.menuItemActive]:w.isNavigationOpen}),eventActionText:"Меню сайта",variant:"white",size:"xs",iconRight:(0,l.jsx)(p.IconFdsChevronDownO,{size:24}),onClick:y("FINPRODUCTS","Меню сайта"),children:"Меню сайта"})]}),(0,l.jsxs)("div",{className:(0,r.Z)(eT.s.buttonGroup,{[eT.s.whiteIcons]:(null==x?void 0:x.iconColorOnMobileMainBanner)==="white"}),children:[(0,l.jsxs)("div",{className:eT.s.chips,children:[(0,l.jsx)(td,{as:"a",href:i,size:"xs",shape:"icon",appearance:"ghost",eventActionText:"profile",eventLabel:`profile_${i}`,iconLeft:(0,l.jsx)(p.IconFdsUserO,{size:20})}),(0,l.jsx)(td,{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,l.jsx)(p.IconFdsChatDotsCircleO,{size:24})})]}),(0,l.jsx)(td,{className:eT.s.menuButton,size:"xs",shape:j?"icon":"default",appearance:j?"ghost":"fill",label:"Меню",onClick:y("FINPRODUCTS","Меню"),eventActionText:"Меню",iconLeft:(0,l.jsx)(p.IconFdsMenuSkewedO,{size:24})}),(0,l.jsxs)("div",{className:eT.s.moreButtons,children:[(0,l.jsx)(t_,{initialTown:s}),(0,l.jsx)(td,{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,l.jsx)(p.IconFdsChatDotsSquareAddO,{size:24}),children:"Онлайн чат"}),(0,l.jsx)(td,{as:"a",href:i,size:"xs",eventActionText:b,eventLabel:`${b}_${i}`,label:b})]})]}),(0,l.jsxs)(tb,{className:eT.s.auth,href:i,eventActionText:b,eventLabel:`${b}_${i}`,children:[(0,l.jsx)(td,{size:"xs",shape:"circle-icon",iconLeft:(0,l.jsx)(p.IconFdsUserO,{}),eventActionText:b,eventLabel:`${b}_${i}`}),(0,l.jsx)("p",{children:b})]}),(0,l.jsx)("div",{className:eT.s.close,children:(0,l.jsx)(td,{className:eT.s.close,size:"xs",variant:"secondary",shape:"circle-icon",iconLeft:(0,l.jsx)(p.IconFdsCloseO,{}),onClick:()=>w.setOpenedBlock(null),eventActionText:"IconFdsCloseO"})})]})]})}),(0,l.jsx)("div",{className:(0,r.Z)(eT.s.overlay,{[eT.s.removed]:!w.isNavigationMounted,[eT.s.overlayOpening]:w.isNavigationOpen,[eT.s.overlayClosing]:!w.isNavigationOpen}),onClick:k(()=>w.setOpenedBlock(null))}),(0,l.jsx)(tM,{data:v,minioUrl:n})]}):null},tD=e=>(0,l.jsx)(tu,{isMainBannerPage:e.isMainBannerPage,children:(0,l.jsx)(tW,{...e})}),tF=(0,c.g)("page-layout","sc"),tZ=Object.freeze({main:"".concat(tF,"__main")}),tG=(0,s.default)(()=>n.e(6715).then(n.bind(n,16715)).then(e=>e.CookiesPlate),{loadableGenerated:{webpack:()=>[require.resolveWeak("../sc-cookies-plate/index.mjs")]},ssr:!1});function tV(e){var t;let{initialGeo:n,headerData:i,footerData:s,showStartGeoPopup:o=!1,citySelectProviderProps:r,children:a}=e,{region:c,town:u}=null!=n?n:{},d=null!==(t=null==r?void 0:r.showcaseUrl)&&void 0!==t?t:"";return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(e7,{...r,showcaseUrl:d,showStartGeoPopup:o,initialRegion:c,initialTown:u,children:[i&&(0,l.jsx)(tD,{...i}),(0,l.jsx)("main",{className:tZ.main,children:a}),s&&(0,l.jsx)(e$,{...s})]}),(0,l.jsx)(tG,{})]})}}}]);