(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7036],{4779:(e,t,n)=>{"use strict";n.d(t,{_:()=>i,y:()=>s});var l,o=n(49684),r=n(26180),s=((l={}).icon="icon",l.chip="chip",l.accordion="accordion",l.button="button",l.checkbox="checkbox",l.radio="radio",l.select="select",l.toggle="toggle",l.tooltip="tooltip",l.link="link",l.banner="banner",l.tag="tag",l.date="date",l.field="field",l.offer="offer",l.tab="tab",l.submit_button="submit_button",l.popup="popup",l.block="block",l);let i=({eventCategory:e,eventActionType:t,eventActionText:n="",eventLabel:l})=>{let s={event:"data-event",eventCategory:e,eventAction:{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_",submit_button:"form_button_",popup:"show_pop_up_",block:"click_block_"}[t]+(0,r.y)(n)};void 0!==l&&(s.eventLabel=(0,r.y)("string"==typeof l?l:l.toString())),(0,o.o)(s)}},6814:(e,t,n)=>{"use strict";n.d(t,{C:()=>o});var l,o=((l={}).bank="bank",l.mfo="mfo",l.insurance="insurance",l)},19553:e=>{e.exports={footer:"MobileModalFooter_footer__5dRCK",footerWithoutShadow:"MobileModalFooter_footerWithoutShadow__zHKVO"}},26180:(e,t,n)=>{"use strict";n.d(t,{y:()=>o});let l={а:"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"},o=e=>e.replace(/[а-яё]/gi,e=>{let t=e.toLowerCase();return t in l?l[t]:e}).replaceAll(" ","_").replaceAll("\xa0","_")},27530:(e,t,n)=>{"use strict";n.d(t,{l:()=>l});let l=300},27757:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l.Z});var l=n(30093)},30093:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});var l=n(12115),o=n(47650);let r=({children:e,id:t="portal-root"})=>{let[n,r]=(0,l.useState)(null);return(0,l.useEffect)(()=>{let e=document.getElementById(t);if(e)return void r(e);let n=document.createElement("div");return n.id=t,document.body.appendChild(n),r(n),()=>{document.body.removeChild(n)}},[t]),n?(0,o.createPortal)(e,n):null}},30495:e=>{e.exports={select:"Select_select__0ooqU",inputcontainer:"Select_inputcontainer__BuU_G",popup:"Select_popup__9utOI",popupContent:"Select_popupContent__b24XJ",emptyList:"Select_emptyList__ZelL1",optionsList:"Select_optionsList__UYSue",optionsItem:"Select_optionsItem__ZoWXt",removeLineHeight:"Select_removeLineHeight__kS_JM",checkbox:"Select_checkbox__ktQ17",active:"Select_active__vgO83",marker:"Select_marker__oTsN9",targetOptionsItem:"Select_targetOptionsItem__uKptc",selectedOptionsItem:"Select_selectedOptionsItem__uJeIB",icon:"Select_icon__YG2wf",popupActions:"Select_popupActions__KpN4D"}},44301:e=>{e.exports={mobilePopup:"MobilePopup_mobilePopup__NCFCK",content:"MobilePopup_content__B5iF0",contentFull:"MobilePopup_contentFull__DBrvo",contentLine:"MobilePopup_contentLine__eykLy",contentContainer:"MobilePopup_contentContainer___ZbOq",min:"MobilePopup_min__D0Hml",contentTransition:"MobilePopup_contentTransition__7_kGL",contentTransitionOpen:"MobilePopup_contentTransitionOpen__GDGpr",title:"MobilePopup_title__IEYZk",closeContainer:"MobilePopup_closeContainer__HSRUL",closeButton:"MobilePopup_closeButton__Bse_M",smallContentContainer:"MobilePopup_smallContentContainer__8jHeS"}},45699:e=>{e.exports={select:"Select_select__wUGZD",popup:"Select_popup__2HKJ3",window:"Select_window__WitRz",safeAreaLine:"Select_safeAreaLine__qbM3u",inputcontainer:"Select_inputcontainer__Rodfv",inputPopup:"Select_inputPopup__SPh8Y",inputButton:"Select_inputButton__mq_GY",content:"Select_content__ygf94",empty:"Select_empty__5BzIj",optionsList:"Select_optionsList__XCV9b",optionsItem:"Select_optionsItem__yasBX",checkbox:"Select_checkbox__82QZr",active:"Select_active__zYX1a",marker:"Select_marker__xyw_M",multipleList:"Select_multipleList__uv_Uj",selectedOptionsItem:"Select_selectedOptionsItem__wHDr_",popupActions:"Select_popupActions__sF73Z"}},48709:(e,t,n)=>{"use strict";n.d(t,{i:()=>u});var l=n(95155),o=n(12115),r=n(29722),s=n(27530),i=n(78065),a=n.n(i);let u=({onClose:e,onToucheMove:t,isOpen:n,delay:i=s.l})=>{let u=(0,o.useRef)(null),c=(0,o.useCallback)(()=>{e&&(u.current=setTimeout(()=>{e()},i))},[i,e]),d=(0,o.useCallback)(e=>{"Escape"===e.key&&c()},[c]);return(0,o.useEffect)(()=>(n&&window.addEventListener("keydown",d),()=>{u.current&&clearTimeout(u.current),window.removeEventListener("keydown",d)}),[n,d]),(0,l.jsx)("div",{className:(0,r.A)(a().overlay,{[a().open]:n,[a().close]:!n}),onTouchStart:t,onClick:c})}},49684:(e,t,n)=>{"use strict";n.d(t,{o:()=>o});var l=n(56853);let o=(e,t)=>{let n=sessionStorage.getItem("pushedEvents"),o=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(" ","_"));let r=o.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||!r){if(t){let t={...e};t.url=window.location.pathname,o.push(t),sessionStorage.setItem("pushedEvents",JSON.stringify(o))}(0,l.Fj)(e)}}},51381:(e,t,n)=>{"use strict";n.d(t,{_:()=>o});var l=n(12115);let o=e=>{let t=(0,l.useRef)(null),n=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{if(n.current===e)return;n.current=e;let l=t.current,o=window.innerWidth-document.documentElement.clientWidth;e&&o&&!document.body.style.top&&(window.prevScrollPosition=window.scrollY||window.pageYOffset),e&&o&&(document.documentElement.style.setProperty("overflow-y","scroll"),document.body.classList.toggle("scroll-disable-windows",!0),document.body.style.setProperty("width",`calc(100vw - ${o}px)`),document.body.style.setProperty("top",`-${window.prevScrollPosition}px`)),e&&!o&&(document.body.style.setProperty("overflow","hidden"),document.body.style.setProperty("height","100vw")),e&&l&&l.setAttribute("data-portal","");let r=document.querySelectorAll("[data-portal]").length>1;return e||r||(document.body.classList.toggle("scroll-disable-windows",!1),document.body.style.removeProperty("overflow"),document.body.style.removeProperty("height"),document.body.style.removeProperty("width"),document.body.style.removeProperty("top")),e||r||void 0===window.prevScrollPosition||(window.scrollTo(0,window.prevScrollPosition),window.prevScrollPosition=void 0),!e&&l&&l.removeAttribute("data-portal"),()=>{document.body.classList.toggle("scroll-disable-windows",!1),document.body.style.removeProperty("overflow"),document.body.style.removeProperty("height"),void 0!==window.prevScrollPosition&&(window.scrollTo(0,window.prevScrollPosition),window.prevScrollPosition=void 0)}},[e]),t}},72435:(e,t,n)=>{"use strict";n.d(t,{L:()=>l.UiMobilePopup});var l=n(74763)},74410:(e,t,n)=>{"use strict";n.d(t,{J:()=>r});var l=n(12115),o=n(27530);let r=({opened:e})=>{let[t,n]=(0,l.useState)(!1),r=(0,l.useRef)(null),s=(0,l.useRef)(!1);return(0,l.useEffect)(()=>(e&&!s.current?(s.current=!0,n(!0)):!e&&s.current&&(r.current=setTimeout(()=>{s.current=!1,n(!1)},o.l)),()=>{r.current&&clearTimeout(r.current)}),[e]),{mounted:t}}},74763:(e,t,n)=>{"use strict";n.r(t),n.d(t,{UiMobilePopup:()=>g});var l=n(95155),o=n(12115),r=n(29722),s=n(48709),i=n(19553),a=n.n(i);let u=({footer:e,isSmallPopup:t=!1,footerClassName:n})=>(0,l.jsx)("div",{className:(0,r.A)(a().footer,t&&a().footerWithoutShadow,n),children:"function"==typeof e?e():e});var c=n(51381),d=n(74410),p=n(44301),_=n.n(p);let m=({children:e,footer:t,isOpen:n,isSmallPopup:i,onClose:a,hasCloseButton:d=!0,full:p,touchDistance:m=100,withDisabledScroll:g=!0,contentClassName:v,className:f,title:h,closeButton:b,footerClassName:w})=>{let[y,S]=(0,o.useState)(!1),[k,C]=(0,o.useState)(!1),[x,L]=(0,o.useState)(!0),[I,P]=(0,o.useState)("120%"),E=(0,o.useRef)(null),j=(0,o.useRef)(0),A=(0,o.useRef)(!1),N=e=>{let t=E.current?.offsetTop,n=E.current?.offsetHeight;if(A.current=!0,L(!1),t&&n){let l=e?.touches[0]?.clientY-t,o=0;l>=0&&l<=n+30&&(o=l),l>n+30&&(o=n+30),P(`${o}px`),j.current=o}},T=()=>{A.current&&(j.current>m&&a?a?.():P("0"),L(!0),A.current=!1),window.removeEventListener("touchmove",N),window.removeEventListener("touchend",T)};return(0,o.useEffect)(()=>{n&&setTimeout(()=>{S(!0),C(!0),P("0")},100),!n&&k&&(P("120%"),S(!1),C(!1))},[k,n]),(0,c._)(n&&g),(0,l.jsxs)("div",{"data-portal":!0,className:(0,r.A)(_().mobilePopup,k&&_().mobilePopupOpen,f),children:[(0,l.jsx)(s.i,{onClose:()=>{n&&a?.()},onToucheMove:()=>{n&&(S(!1),window.addEventListener("touchmove",N),window.addEventListener("touchend",T))},isOpen:n,delay:0}),(0,l.jsxs)("div",{className:(0,r.A)(_().content,p&&_().contentFull,x&&_().contentTransition,x&&y&&_().contentTransitionOpen),ref:E,style:{transform:`translateY(${I})`},children:[(0,l.jsx)("div",{className:_().contentLine}),(0,l.jsxs)("div",{className:(0,r.A)(_().contentContainer,i&&_().smallContentContainer,{[_().min]:!h&&!d},v),children:[!!h&&(0,l.jsx)("div",{className:_().title,children:h}),d?(0,l.jsx)("div",{className:_().closeContainer,children:(0,l.jsx)("div",{className:_().closeContainer,children:d?b?"function"==typeof b?b():b:(0,l.jsx)("button",{onClick:a,className:_().closeButton,children:(0,l.jsx)("img",{src:"https://assets.finuslugi.ru/mp-assets/images/sc/close_gray.svg",alt:"close",loading:"lazy"})}):null})}):null,e]}),t&&(0,l.jsx)(u,{footerClassName:w,isSmallPopup:i,footer:t})]})]})},g=({children:e,isSmallPopup:t=!1,isOpen:n=!1,...o})=>{let{mounted:r}=(0,d.J)({opened:n});return r?(0,l.jsx)(m,{isSmallPopup:t,isOpen:n,...o,children:e}):null};g.displayName="UiMobilePopup"},78065:e=>{e.exports={overlay:"ClickOutside_overlay__YQi9L",open:"ClickOutside_open__bmtsz",fade:"ClickOutside_fade__io1xj",close:"ClickOutside_close__AC078","fade-out":"ClickOutside_fade-out__wJ_pJ"}},83457:e=>{e.exports={inputRoot:"Input_inputRoot__OpQtf",wrapperInput:"Input_wrapperInput__W_Fgs",big:"Input_big__6tH9J",middle:"Input_middle__EejLc",hasValue:"Input_hasValue__vNnNi",label:"Input_label__appbZ",addoneAfter:"Input_addoneAfter__SKvFS",addoneBefore:"Input_addoneBefore__c2BkI",gray:"Input_gray__3TOAb",success:"Input_success__qKGYc",error:"Input_error__dlwf5",white:"Input_white__QAtmB",isFocused:"Input_isFocused__ln1w8",disabled:"Input_disabled__dXsOf",readOnly:"Input_readOnly__VY57j",withRange:"Input_withRange__juSxl",buttonClear:"Input_buttonClear__jgpiV",deleteIcon:"Input_deleteIcon__imUCt",inputContainer:"Input_inputContainer__WDbYX",cover:"Input_cover__peS2N",input:"Input_input__ZcnKW",inputCenter:"Input_inputCenter__Vd7jO",maskPlaceholder:"Input_maskPlaceholder__jH41P",maskPlaceholderCenter:"Input_maskPlaceholderCenter__I7p_d",maskPlaceholderHide:"Input_maskPlaceholderHide__BZ0kM",controlContainer:"Input_controlContainer__qWVWN",message:"Input_message__g6rjt",successMessage:"Input_successMessage__o7JXJ",errorMessage:"Input_errorMessage__nen8r",defaultMessage:"Input_defaultMessage__P9LQz",range:"Input_range___mksh"}},88068:(e,t,n)=>{"use strict";n.d(t,{n:()=>k});var l=n(95155),o=n(12115),r=n(84685),s=n(24691),i=n(29722),a=n(83457),u=n.n(a);let c="Обязательное поле",d=(0,o.memo)(({onChange:e=()=>null,onFocus:t=()=>null,onBlur:n=()=>null,onKeyDown:s=()=>null,inputClear:a=()=>null,label:d,allowClear:p=!1,addonBefore:_,addonAfter:m,state:g,appearance:v="gray",inputType:f,required:h=!1,infoMessage:b,message:w,innerRef:y=null,disabled:S,id:k,placeholder:C,autoFocus:x=!1,value:L,readOnly:I,className:P,onlyRange:E,size:j="small",maskPlaceholder:A,...N})=>{let[T,M]=(0,o.useState)(x);(0,o.useEffect)(()=>M(x),[x]);let O=(0,o.useRef)(null),R=!h||(L||"error"!==g)&&g?w:c,D=b?.length&&!h||b?.length&&L?b:c;return(0,l.jsxs)("div",{className:(0,i.A)(u().inputRoot,P),children:[(0,l.jsxs)("label",{htmlFor:k,className:(0,i.A)(u().wrapperInput,u()[v],u()[j],{[u().isFocused]:T&&!S,[u().hasValue]:T||!!L||!!C||A,[u().disabled]:S,[u().success]:"success"===g,[u().error]:"error"===g,[u().readOnly]:I}),children:[_&&(0,l.jsx)("div",{className:(0,i.A)(u().controlContainer,u().addoneBefore),children:_}),(0,l.jsxs)("div",{className:(0,i.A)(u().inputContainer,{[u().cover]:"button"===f}),children:[A&&(0,l.jsxs)("div",{className:(0,i.A)(u().maskPlaceholder,!C&&!d&&u().maskPlaceholderCenter),children:[L&&(0,l.jsx)("span",{className:u().maskPlaceholderHide,children:L}),A.slice(String(L??"").length)]}),(0,l.jsx)("input",{id:k,ref:e=>{O.current=e,y&&(y.current=e)},value:L??"",disabled:S||E,autoFocus:"button"!==f&&T,readOnly:I,onFocus:e=>{T||(M(!0),t(e))},onBlur:e=>{T&&(M(!1),n(e))},onChange:t=>{e(t)},onKeyDown:e=>{s&&s(e)},className:(0,i.A)(u().input,!d&&u().inputCenter),placeholder:A?void 0:C,...N}),d?.length?(0,l.jsx)("span",{className:(0,i.A)(u().label,"error"===g&&u().error),children:d}):null]}),p&&(!!L||"string"==typeof L&&!!L.trim().length)&&(0,l.jsx)("button",{type:"button",className:(0,i.A)(u().controlContainer,u().buttonClear),onClick:e=>{if(e.preventDefault(),O.current){var t;let e,n,l;e=(t=O.current).value,t.value="",n=new Event("input",{bubbles:!0}),(l=t._valueTracker)&&l.setValue(e),t.dispatchEvent(n),"input"===f&&O.current.focus()}a()},children:(0,l.jsx)(r._7M,{size:20})}),m&&(0,l.jsx)("div",{className:(0,i.A)(u().controlContainer,u().addoneAfter),children:m})]}),(!!w?.length&&g||h||!!b?.length)&&(0,l.jsx)("div",{className:(0,i.A)(u().message,{[u().successMessage]:"success"===g,[u().errorMessage]:"error"===g,[u().defaultMessage]:h&&!g||!h&&!g&&!!b?.length}),children:g?R:D})]})});d.displayName="UiInput";let p=({isOpenPopup:e,isMobile:t=!1,multiple:n,scrollValue:l,selectedItemIndex:r,pointedItemIndex:s,pointedTrigger:i,container:a,element:u})=>{let c=(0,o.useCallback)(e=>{a&&e>=0&&u.current&&null!==u.current&&u.current.scrollIntoView({block:"nearest",inline:"nearest"})},[a,u]);return(0,o.useEffect)(()=>{let t;!n&&e&&t!==r&&"number"==typeof r&&(t=r,c(r))},[a,u,e,n,c,r]),(0,o.useEffect)(()=>{let n;!t&&e&&n!==s&&"number"==typeof s&&"key"===i&&(n=s,c(s))},[t,a,u,e,s,i,c]),(0,o.useEffect)(()=>{let t;n&&e&&a.current&&t!==l&&(t=l,a.current.scrollTo({top:l}))},[a,e,n,l]),null};var _=n(30495),m=n.n(_);let g="calc(100% + 8px)",v=((e=20)=>{let t=null;return n=>{t&&clearInterval(t),t=setTimeout(n,e)}})(),f=(0,o.memo)(({onSearch:e,onChange:t=()=>null,options:n,optionsEmptyText:a,multiple:u=!1,search:c=!1,defaultOpen:_=!1,autoFocus:f=!1,value:h,popupHeight:b=312,className:w,removeLineHeight:y,onClose:S,onOpen:k,popupDataQa:C,itemDataQa:x,...L})=>{let I=(0,o.useRef)(!1),[P,E]=(0,o.useState)(()=>h??null),[j,A]=(0,o.useState)(""),[N,T]=(0,o.useState)(f||_),[M,O]=(0,o.useState)(!1),[R,D]=(0,o.useState)(null),[B,$]=(0,o.useState)(()=>P?n.filter(e=>P.find(t=>String(t.value)===String(e.value))):null),[U,F]=(0,o.useState)(0),[X,H]=(0,o.useState)({mouseX:void 0,mouseY:void 0,isDisplaced:!0}),Y=N&&!!n.length,z=(0,o.useCallback)(e=>{M||(A(""),T(!1),S?.()),e?.current&&u&&Y&&F(e.current.scrollTop)},[M,Y,u,S]),V=(0,o.useRef)(null),Z=(0,o.useRef)(null),G=(0,o.useRef)(null),J=((e,t=300)=>{let n=(0,o.useRef)(null),l=(0,o.useRef)(null),r=(0,o.useRef)(null);return(0,o.useEffect)(()=>{let o=()=>{n.current&&clearTimeout(n.current),r.current&&(window.removeEventListener("keydown",r.current.keyDown),document.removeEventListener("mousedown",r.current.clickOutside))};return o(),r.current={keyDown(o){"Escape"===o.key&&e&&(n.current=setTimeout(()=>{e(l)},t))},clickOutside(t){0===t.button&&l.current&&!l.current.contains(t.target)&&e(l)}},window.addEventListener("keydown",r.current.keyDown),document.addEventListener("mousedown",r.current.clickOutside),o},[e,t]),l})(z),q=(0,o.useMemo)(()=>c&&j&&""!==j?n.filter(e=>-1!==String(e.label).toLocaleLowerCase().indexOf(j.toLocaleLowerCase())):n,[j,n,c]),K=(0,o.useCallback)((e=!1)=>{H({mouseX:void 0,mouseY:void 0,isDisplaced:!0}),T(t=>!e&&!t),O(t=>!e&&!t),e&&V.current?.blur(),J?.current&&u&&Y&&F(J.current.scrollTop),e&&S?.()},[J,u,Y,S]),W=(0,o.useCallback)(e=>{if(u)$((n=[])=>{if(!n)return[e];let l=n.findIndex(t=>String(t.label).toLocaleLowerCase()===String(e.label).toLocaleLowerCase());if(l>=0){let e=[...n.slice(0,l),...n.slice(l+1)];return e.length||(E(null),D(null),$(null),t(null)),e}return[...n,e]});else{let l=[],o=n.find(t=>String(t.value).trim().toLocaleLowerCase()===String(e.value).trim().toLocaleLowerCase());l=o?[o]:[];let r=n.findIndex(e=>e.label.toLocaleLowerCase()===l[0]?.label.toLocaleLowerCase());D(r>=0?r:null),E([e]),$([e]),t(h&&e.value===h[0].value?null:l),K(!0),A("")}},[K,u,t,n,h]),Q=(0,o.useCallback)(()=>{t(B),K(!0)},[K,t,B]),{pointedItemIndex:ee,pointedTrigger:et,setPointedItem:en,handleKeyNavigation:el}=(({isOpenPopup:e,multiple:t,optionsList:n,defaultPointedIndex:l,onTogglePopup:r,onSelectedItem:s,onClearCallBack:i})=>{let[a,u]=(0,o.useState)({index:l,trigger:"key"}),{index:c,trigger:d}=a,p=(0,o.useRef)(n.length);(0,o.useEffect)(()=>{e||null===l||t||(u({index:l,trigger:"key"}),p.current=n.length),p.current!==n.length&&e&&(p.current=n.length,u({index:0,trigger:"key"}))},[n.length,e,l,t]);let _=(0,o.useCallback)(()=>{e?null!==c&&(s(n[c]),i()):r()},[e,n,c,s,i,r]),m=(0,o.useCallback)(()=>{e&&r(!0)},[e,r]),g=(0,o.useCallback)(()=>{e&&n.length&&(u(({index:e})=>null===e?{trigger:"key",index:0}:e+1<n.length?{trigger:"key",index:e+1}:e+1===n.length?{trigger:"key",index:0}:{trigger:"key",index:e}),i())},[e,i,n.length]),v=(0,o.useCallback)(()=>{e&&n.length&&(u(({index:e})=>null===e?{trigger:"key",index:0}:e+1>n.length?{trigger:"key",index:e-1}:0===e?{trigger:"key",index:n.length-1}:e+1<=n.length?{trigger:"key",index:e-1}:{trigger:"key",index:e}),i())},[e,i,n.length]);return{pointedItemIndex:c,pointedTrigger:d,setPointedItem:u,handleKeyNavigation:e=>{e.stopPropagation();let t=e||window.event;switch(e.key){case"Escape":m();break;case"Enter":_();break;case"ArrowDown":t.preventDefault(),g();break;case"ArrowUp":t.preventDefault(),v()}}}})({isOpenPopup:Y,multiple:u,optionsList:q,defaultPointedIndex:R,onTogglePopup:K,onSelectedItem:W,onClearCallBack:()=>H(e=>({...e,isDisplaced:!1}))}),eo=e=>{e.preventDefault(),en(e=>({...e,trigger:"mouse"})),H(t=>{let n=void 0===t.mouseX&&void 0===t.mouseY||t.mouseX!==e.screenX||t.mouseY!==e.screenY;return{...t,mouseX:e.screenX,mouseY:e.screenY,isDisplaced:n}})},er=(0,o.useCallback)(()=>{E(null),D(null),en({index:null,trigger:"key"}),F(0),$(null),K(!0),t(null)},[K,t,en]);p({isOpenPopup:Y,multiple:u,scrollValue:U,selectedItemIndex:R,pointedItemIndex:ee,pointedTrigger:et,container:J,element:G});let es=(0,o.useMemo)(()=>!B?.length||Y?j:u?"":B[0].label,[B,j,u,Y]),ei=(0,o.useMemo)(()=>{if(!B?.length)return j;let{length:e}=B;return u?1===e?B[0].label:`Выбрано (${e})`:Y&&!j.length?B[0].label:j},[Y,u,j,B]),ea={readOnly:!c,addonAfter:(0,l.jsx)("div",{className:(0,i.A)(m().icon,{[m().iconRotate]:!c&&N}),children:N?(0,l.jsx)(r.wTS,{size:18}):(0,l.jsx)(r.j8g,{size:24})}),onChange:e=>{A(e.currentTarget.value)},autoFocus:N,inputType:"select",inputClear:()=>u?A(""):er(),value:es,placeholder:ei,onFocus:()=>c&&T(!0),onClick:()=>{c?N||T(!0):T(e=>!e)},autoComplete:"off",innerRef:V,...L};(0,o.useEffect)(()=>{I.current?(E(h),$(h?n.filter(e=>h.find(t=>String(t.value)===String(e.value))):null)):I.current=!0},[n,h]);let[eu,ec]=(0,o.useState)(0),[ed,ep]=(0,o.useState)(null),e_=(0,o.useRef)(null);(0,o.useEffect)(()=>{let e=()=>{v(()=>ec(window.scrollY))};return Y?window.addEventListener("scroll",e,!1):window.removeEventListener("scroll",e,!1),()=>window.removeEventListener("scroll",e,!1)},[Y]),(0,o.useEffect)(()=>{if(!e_.current||!V.current)return;let e=V.current.getBoundingClientRect(),t=e_.current.getBoundingClientRect(),n=window.innerHeight,l={top:"unset",right:"0",left:"0",bottom:"unset"},o=n-e.top-8-e.height;!(document.querySelectorAll("[data-portal]").length>0)&&(n<(t.height+8)*2+e.height?e.top>o:o<t.height)?l.bottom="70px":l.top=g,ep(l)},[Y,eu]);let em=ed||{top:g,left:"0",right:"0"};return(0,o.useEffect)(()=>{Y&&k?.()},[Y,k]),(0,o.useEffect)(()=>{e?.(j)},[j]),(0,l.jsxs)("div",{className:(0,i.A)(m().select,w),onMouseEnter:()=>O(!0),onMouseLeave:()=>O(!1),onKeyDown:e=>el(e),children:[(0,l.jsx)("div",{className:m().inputcontainer,children:(0,l.jsx)(d,{...ea})}),Y&&(0,l.jsxs)("div",{className:m().popup,ref:e_,style:{maxHeight:`${b}px`,...em},"data-qa":C,children:[(0,l.jsxs)("div",{ref:J,className:m().popupContent,style:{maxHeight:`${b-(u?100:20)}px`},children:[0===q.length&&(0,l.jsx)("div",{className:m().emptyList,children:a||"Нет совпадений"}),q.length>0&&(0,l.jsx)("ul",{className:m().optionsList,ref:Z,children:q.map((e,t)=>{let n=!1;return u?n=!!B?.find(t=>String(t.value)===String(e.value)):P&&(n=String(P[0]?.value)===String(e.value)),(0,l.jsx)("li",{onMouseLeave:eo,onMouseEnter:e=>{e.stopPropagation(),X.isDisplaced&&en({index:t,trigger:"mouse"})},ref:ee===t?G:void 0,className:(0,i.A)(m().optionsItem,{[m().targetOptionsItem]:ee===t,[m().selectedOptionsItem]:n,[m().removeLineHeight]:y}),"data-qa":x,children:(0,l.jsxs)("button",{onMouseDown:()=>W(e),children:[u&&(0,l.jsx)("span",{className:(0,i.A)(m().checkbox,{[m().active]:n}),children:n&&(0,l.jsx)(r.cut,{className:m().marker})}),e.label]})},e.value)})})]}),u&&!!B?.length&&(0,l.jsxs)("div",{className:m().popupActions,children:[(0,l.jsx)(s.$,{size:"xs",iconLeft:(0,l.jsx)(r.Eau,{}),shape:"icon",variant:"secondary",onClick:er}),(0,l.jsx)(s.$,{size:"xs",onClick:Q,label:`Применить (${B.length})`})]})]})]})});f.displayName="Desktop";var h=n(27757),b=n(72435),w=n(45699),y=n.n(w);let S=(0,o.memo)(({onSearch:e,onChange:t=()=>null,options:n,optionsEmptyText:a,multiple:u=!1,search:c=!1,defaultOpen:_=!1,autoFocus:m=!1,value:g,className:v,removeLineHeight:f,onClose:w,onOpen:S,popupDataQa:k,itemDataQa:C,...x})=>{let L=(0,o.useRef)(!1),[I,P]=(0,o.useState)(()=>g??null),[E,j]=(0,o.useState)(""),[A,N]=(0,o.useState)(!1),[T,M]=(0,o.useState)(m||_),[O,R]=(0,o.useState)(_),[D,B]=(0,o.useState)(null),[$,U]=(0,o.useState)(()=>I?n.filter(e=>I.find(t=>String(t.value)===String(e.value))):null),[F,X]=(0,o.useState)(0),H=(0,o.useRef)(null),Y=(0,o.useRef)(null),z=(0,o.useRef)(null),V=(0,o.useMemo)(()=>T&&!!n.length,[T,n.length]),Z=(0,o.useMemo)(()=>c&&E&&""!==E?n.filter(e=>-1!==String(e.label).toLocaleLowerCase().indexOf(E.toLocaleLowerCase())):n,[E,n,c]),G=(0,o.useCallback)(e=>{setTimeout(()=>M(t=>!e&&!t),300),N(t=>!e&&!t),R(t=>!e&&!t),O||(N(!1),M(!1),j("")),z?.current&&u&&V&&X(z.current.scrollTop),e&&w?.()},[O,u,V,w]),J=(0,o.useCallback)(()=>{setTimeout(()=>N(!0),600),M(!0),R(!0)},[]),q=(0,o.useCallback)(e=>{if(u)U((n=[])=>{if(!n)return[e];let l=n.findIndex(t=>String(t.label).toLocaleLowerCase()===String(e.label).toLocaleLowerCase());return l>=0?([...n.slice(0,l),...n.slice(l+1)].length||(P(null),B(null),U(null),t(null)),[...n.slice(0,l),...n.slice(l+1)]):[...n,e]});else{let l=[],o=n.find(t=>String(t.value).trim().toLocaleLowerCase()===String(e.value).trim().toLocaleLowerCase());l=o?[o]:[];let r=n.findIndex(e=>e.label.toLocaleLowerCase()===l[0]?.label.toLocaleLowerCase());B(r>=0?r:null),P([e]),U([e]),t(g&&e.value===g[0].value?null:l),j(""),setTimeout(()=>G(!0),300)}},[G,u,t,n,g]),K=(0,o.useCallback)(()=>{t($),G(!0)},[G,t,$]),W=(0,o.useCallback)(()=>{P(null),B(null),X(0),U(null),G(!0),t(null)},[G,t]);p({isMobile:!0,isOpenPopup:V,multiple:u,scrollValue:F,selectedItemIndex:D,container:z,element:Y});let Q=(0,o.useMemo)(()=>!$?.length||V?E:u?"":$[0].label,[$,E,u,V]),ee=(0,o.useMemo)(()=>$?.length?1===$.length?$[0].label:u?`Выбрано (${$.length})`:"":"",[u,$]),et=(0,o.useMemo)(()=>{if(!$?.length)return E;let{length:e}=$;return 1===e?$[0].label:u?`Выбрано (${e})`:V&&!E.length?$[0].label:E},[V,u,E,$]);return(0,o.useEffect)(()=>{L.current?(P(g),U(g?n.filter(e=>g.find(t=>String(t.value)===String(e.value))):null)):L.current=!0},[n,g]),(0,o.useEffect)(()=>{V&&S?.()},[V,S]),(0,o.useEffect)(()=>{e?.(E)},[E]),(0,l.jsxs)("div",{className:(0,i.A)(y().select,v),children:[(0,l.jsx)("div",{className:(0,i.A)(y().inputcontainer,y().inputButton),children:(0,l.jsx)(d,{readOnly:!c,addonAfter:(0,l.jsx)(r.j8g,{size:24,className:y().icon}),inputType:"button",inputClear:W,value:ee,onClick:J,autoComplete:"off",type:"button",...x})}),V&&(0,l.jsx)(h.Z,{children:(0,l.jsx)(b.L,{full:!0,className:y().popup,isOpen:O,onClose:()=>G(!0),children:(0,l.jsxs)("div",{className:y().window,"data-qa":k,children:[(0,l.jsx)("div",{className:y().safeAreaLine}),(0,l.jsx)("div",{className:(0,i.A)(y().inputcontainer,y().inputPopup),children:(0,l.jsx)(d,{readOnly:!c,addonAfter:(0,l.jsx)("div",{className:y().icon,children:c?(0,l.jsx)(r.wTS,{size:18}):(0,l.jsx)(r.j8g,{size:24})}),onChange:e=>j(e.currentTarget.value),autoFocus:A,inputType:"select",inputClear:()=>j(""),value:Q,placeholder:et,onFocus:()=>N(!0),onClick:()=>!A&&N(!0),autoComplete:"off",...x})}),(0,l.jsxs)("div",{ref:z,className:y().content,children:[0===Z.length&&(0,l.jsx)("div",{className:y().empty,children:a||"Нет совпадений"}),Z.length>0&&(0,l.jsx)("ul",{className:(0,i.A)(y().optionsList,{[y().multipleList]:u}),ref:H,children:Z.map((e,t)=>{let n=!1;return u?n=!!$?.find(t=>String(t.value)===String(e.value)):I&&(n=String(I[0]?.value)===String(e.value)),(0,l.jsx)("li",{ref:D===t?Y:void 0,className:(0,i.A)(y().optionsItem,{[y().selectedOptionsItem]:n,[y().removeLineHeight]:f}),"data-qa":C,children:(0,l.jsxs)("button",{onMouseDown:()=>q(e),children:[u&&(0,l.jsx)("span",{className:(0,i.A)(y().checkbox,{[y().active]:n}),children:n&&(0,l.jsx)(r.cut,{className:y().marker})}),(0,l.jsx)("p",{children:e.label})]})},e.value)})})]}),u&&!!$?.length&&(0,l.jsxs)("div",{className:y().popupActions,children:[(0,l.jsx)(s.$,{iconLeft:(0,l.jsx)(r.Eau,{}),shape:"icon",variant:"secondary",onClick:W}),(0,l.jsx)(s.$,{onClick:K,label:`Применить (${$.length})`})]})]})})})]})});S.displayName="Mobile";let k=(0,o.memo)(({isMobile:e,...t})=>{let[n,r]=(0,o.useState)(!1);return((0,o.useEffect)(()=>{r(!0)},[]),n)?e?(0,l.jsx)(S,{...t}):(0,l.jsx)(f,{...t}):(0,l.jsx)(S,{...t})});k.displayName="UiSelect"},96429:(e,t,n)=>{"use strict";n.d(t,{p:()=>_});var l=n(63109),o=n(41463);let r={APP_PREFIX:"directory",DETAIL_PAGES_PREFIX:"directory-pages",APP_VERSION:o.env.APP_VERSION??String(Math.random()).slice(2),REDIS_PORT:Number(o.env.REDIS_PORT),REDIS_HOST:o.env.REDIS_HOST};var s=n(4997);n(41463);let i=0,a=[],u=new Map,c=async()=>{i>=24&&await new Promise(e=>{a.push(e)}),i+=1},d=async e=>{await c();try{return await e()}finally{i=Math.max(0,i-1),a.shift()?.()}},p=async({url:e,endpoint:t,method:n,config:o,env:r})=>{let s=new AbortController,i=setTimeout(()=>s.abort(),3e3),a=()=>s.abort();o?.signal?.aborted&&s.abort(),o?.signal?.addEventListener("abort",a,{once:!0});let u=performance.now();try{let i=await (0,l.OT)(e,{baseURL:t,method:n,headers:{...o?.headers},...o,signal:s.signal,timeout:3e3,retry:0,next:{revalidate:Number(r.REVALIDATE_REQUEST_VALUE)||3600}}),a=performance.now()-u;return console.warn(`Запрос ${t}${e} занял ${a.toFixed(2)} ms`),{data:i,error:null}}catch(n){return n.status??n.statusCode,console.error("Ошибка запроса",`${n}: ${t}${e}`),{data:null,error:n||"Unknown error"}}finally{clearTimeout(i),o?.signal?.removeEventListener("abort",a)}},_=async({url:e,options:t={},config:n})=>{let l=(0,s.p)(),o=((e,t)=>{let n=e.NEXT_PUBLIC_HEADLESS_CMS;e.NEXT_PUBLIC_API_URL,e.NEXT_PUBLIC_PAGECONTENT_API;let l=e.NEXT_PUBLIC_BASE_URL,o=e.NEXT_PUBLIC_MP_SC_REDIRECTS_API,s=e.NEXT_PUBLIC_MP_SC_ORGANIZATION_API;e.NEXT_PUBLIC_MICROLOANS_API_URL;let{isHeadlessCMS:i,isPageContent:a,isMpScRedirects:u,isMpScOrganization:c,isBaseUrl:d,isOrganizationApi:p,isMicroloans:_}=t;return p?`${l}/${r.APP_PREFIX}/api/organization`:i?`${l}/sc`:a?`${l}/page-content`:u?o:i?n:_?`${l}/credits`:c?s:l})(l,t),i=(n?.method||"GET").toUpperCase();if(!o)return console.error("Ошибка запроса: API endpoint не задан",e),{data:null,error:"API endpoint is not configured"};let a=()=>d(()=>p({url:e,endpoint:o,method:i,config:n,env:l}));if(n?.signal||"GET"!==i&&"HEAD"!==i)return a();var c=`${i}:${o}${e}`;let _=u.get(c);if(_)return _;let m=a().finally(()=>{u.delete(c)});return u.set(c,m),m}}}]);