(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9259],{8039:(e,t,n)=>{"use strict";e.exports=n(65538)},9892:(e,t,n)=>{"use strict";n.d(t,{q:()=>r});let r="$inf$"},11246:(e,t,n)=>{"use strict";n.d(t,{d:()=>i});var r=n(56853);let i=(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 a=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||!a){if(t){let t={...e};t.url=window.location.pathname,i.push(t),sessionStorage.setItem("pushedEvents",JSON.stringify(i))}(0,r.Fj)(e)}}},12180:(e,t,n)=>{"use strict";n.d(t,{A:()=>l,B:()=>g,I:()=>C,O:()=>u,S:()=>q,U:()=>s,a:()=>d,b:()=>o,c:()=>B,d:()=>M,e:()=>c,f:()=>J,g:()=>W,i:()=>h,m:()=>f,n:()=>V,o:()=>P,r:()=>I,s:()=>L,t:()=>x,u:()=>$,z:()=>b});var r=n(12115),i=n(78392),a=Object.prototype.hasOwnProperty;let o=new WeakMap,l=()=>{},s=l(),u=Object,c=e=>e===s,d=e=>"function"==typeof e,f=(e,t)=>({...e,...t}),g=e=>d(e.then),p={},m={},w="undefined",h=typeof window!=w,v=typeof document!=w,_=h&&"Deno"in window,b=(e,t)=>{let n=o.get(e);return[()=>!c(t)&&e.get(t)||p,r=>{if(!c(t)){let i=e.get(t);t in m||(m[t]=i),n[5](t,f(i,r),i||p)}},n[6],()=>!c(t)&&t in m?m[t]:!c(t)&&e.get(t)||p]},y=!0,[S,R]=h&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[l,l],k={initFocus:e=>(v&&document.addEventListener("visibilitychange",e),S("focus",e),()=>{v&&document.removeEventListener("visibilitychange",e),R("focus",e)}),initReconnect:e=>{let t=()=>{y=!0,e()},n=()=>{y=!1};return S("online",t),S("offline",n),()=>{R("online",t),R("offline",n)}}},I=!r.useId,C=!h||_,x=e=>h&&typeof window.requestAnimationFrame!=w?window.requestAnimationFrame(e):setTimeout(e,1),$=C?r.useEffect:r.useLayoutEffect,O="u">typeof navigator&&navigator.connection,E=!C&&O&&(["slow-2g","2g"].includes(O.effectiveType)||O.saveData),T=new WeakMap,A=(e,t)=>e===`[object ${t}]`,j=0,N=e=>{let t,n,r=typeof e,i=u.prototype.toString.call(e),a=A(i,"Date"),o=A(i,"RegExp"),l=A(i,"Object");if(u(e)!==e||a||o)t=a?e.toJSON():"symbol"==r?e.toString():"string"==r?JSON.stringify(e):""+e;else{if(t=T.get(e))return t;if(t=++j+"~",T.set(e,t),Array.isArray(e)){for(n=0,t="@";n<e.length;n++)t+=N(e[n])+",";T.set(e,t)}if(l){t="#";let r=u.keys(e).sort();for(;!c(n=r.pop());)c(e[n])||(t+=n+":"+N(e[n])+",");T.set(e,t)}}return t},L=e=>{if(d(e))try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?N(e):"",t]},U=0,P=()=>++U;async function V(...e){let[t,n,r,a]=e,l=f({populateCache:!0,throwOnError:!0},"boolean"==typeof a?{revalidate:a}:a||{}),u=l.populateCache,p=l.rollbackOnError,m=l.optimisticData,w=l.throwOnError;if(d(n)){let e=[];for(let r of t.keys())!/^\$(inf|sub)\$/.test(r)&&n(t.get(r)._k)&&e.push(r);return Promise.all(e.map(h))}return h(n);async function h(n){let a,[f]=L(n);if(!f)return;let[h,v]=b(t,f),[_,y,S,R]=o.get(t),k=()=>{let e=_[f];return(d(l.revalidate)?l.revalidate(h().data,n):!1!==l.revalidate)&&(delete S[f],delete R[f],e&&e[0])?e[0](i.q2).then(()=>h().data):h().data};if(e.length<3)return k();let I=r,C=!1,x=P();y[f]=[x,0];let $=!c(m),O=h(),E=O.data,T=O._c,A=c(T)?E:T;if($&&v({data:m=d(m)?m(A,E):m,_c:A}),d(I))try{I=I(A)}catch(e){a=e,C=!0}if(I&&g(I)){let e;if(I=await I.catch(e=>{a=e,C=!0}),x!==y[f][0]){if(C)throw a;return I}C&&$&&(e=a,"function"==typeof p?p(e):!1!==p)&&(u=!0,v({data:A,_c:s}))}if(u&&!C&&(d(u)?v({data:u(I,A),error:s,_c:s}):v({data:I,error:s,_c:s})),y[f][1]=P(),Promise.resolve(k()).then(()=>{v({_c:s})}),C){if(w)throw a;return}return I}}let D=(e,t)=>{for(let n in e)e[n][0]&&e[n][0](t)},z=(e,t)=>{if(!o.has(e)){let n=f(k,t),r=Object.create(null),a=V.bind(s,e),u=l,c=Object.create(null),d=(e,t)=>{let n=c[e]||[];return c[e]=n,n.push(t),()=>n.splice(n.indexOf(t),1)},g=(t,n,r)=>{e.set(t,n);let i=c[t];if(i)for(let e of i)e(n,r)},p=()=>{if(!o.has(e)&&(o.set(e,[r,Object.create(null),Object.create(null),Object.create(null),a,g,d]),!C)){let t=n.initFocus(setTimeout.bind(s,D.bind(s,r,i.CC))),a=n.initReconnect(setTimeout.bind(s,D.bind(s,r,i.jB)));u=()=>{t&&t(),a&&a(),o.delete(e)}}};return p(),[e,a,p,u]}return[e,o.get(e)[4]]},[B,F]=z(new Map),M=f({onLoadingSlow:l,onSuccess:l,onError:l,onErrorRetry:(e,t,n,r,i)=>{let a=n.errorRetryCount,o=i.retryCount,l=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;(c(a)||!(o>a))&&setTimeout(r,l,i)},onDiscarded:l,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:E?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:E?5e3:3e3,compare:function e(t,n){var r,i;if(t===n)return!0;if(t&&n&&(r=t.constructor)===n.constructor){if(r===Date)return t.getTime()===n.getTime();if(r===RegExp)return t.toString()===n.toString();if(r===Array){if((i=t.length)===n.length)for(;i--&&e(t[i],n[i]););return -1===i}if(!r||"object"==typeof t){for(r in i=0,t)if(a.call(t,r)&&++i&&!a.call(n,r)||!(r in n)||!e(t[r],n[r]))return!1;return Object.keys(n).length===i}}return t!=t&&n!=n},isPaused:()=>!1,cache:B,mutate:F,fallback:{}},{isOnline:()=>y,isVisible:()=>{let e=v&&document.visibilityState;return c(e)||"hidden"!==e}}),J=(e,t)=>{let n=f(e,t);if(t){let{use:r,fallback:i}=e,{use:a,fallback:o}=t;r&&a&&(n.use=r.concat(a)),i&&o&&(n.fallback=f(i,o))}return n},q=(0,r.createContext)({}),W=e=>{let{value:t}=e,n=(0,r.useContext)(q),i=d(t),a=(0,r.useMemo)(()=>i?t(n):t,[i,n,t]),o=(0,r.useMemo)(()=>i?a:J(n,a),[i,n,a]),l=a&&a.provider,u=(0,r.useRef)(s);l&&!u.current&&(u.current=z(l(o.cache||B),a));let c=u.current;return c&&(o.cache=c[0],o.mutate=c[1]),$(()=>{if(c)return c[2]&&c[2](),c[3]},[]),(0,r.createElement)(q.Provider,f(e,{value:o}))}},17194:(e,t,n)=>{"use strict";n.d(t,{t:()=>i});let r={а:"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"},i=e=>e.replace(/[а-яё]/gi,e=>{let t=e.toLowerCase();return t in r?r[t]:e}).replaceAll(/[ \u00A0]/g,"_")},19766:(e,t,n)=>{"use strict";n.d(t,{C:()=>h,Y:()=>d,a:()=>l,u:()=>w});var r=n(12115),i=n(95155),a=n(20197),o=n(60558);let l=e=>{let[t,n]=(0,r.useState)(e);return(0,r.useEffect)(()=>{e&&n(!0)},[e]),e||t},s={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},u={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},c=e=>r.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},r.createElement("path",{d:"M3 9.998a9 9 0 0118 0c0 2.08-.89 4.273-2.029 6.249-1.148 1.991-2.6 3.844-3.826 5.262a4.123 4.123 0 01-6.29 0c-1.227-1.418-2.678-3.271-3.826-5.262C3.889 14.27 3 12.077 3 9.998zm9-7.5a7.5 7.5 0 00-7.5 7.5c0 1.688.737 3.607 1.828 5.5 1.083 1.877 2.468 3.65 3.661 5.029 1.084 1.251 2.938 1.251 4.022 0 1.193-1.379 2.578-3.152 3.66-5.03 1.092-1.893 1.829-3.81 1.829-5.499a7.5 7.5 0 00-7.5-7.5zm-4 7.5a4 4 0 118 0 4 4 0 01-8 0zm4-2.5a2.5 2.5 0 100 5 2.5 2.5 0 000-5z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}));function d({className:e,style:t,boxSize:n,size:i,onClick:a}){return r.createElement("span",{className:e,style:{...s,...a&&{cursor:"pointer"},...i&&{fontSize:`${i}px`},...n&&{width:`${n}px`,height:`${n}px`,display:"inline-flex",alignItems:"center",justifyContent:"center"},...t},...a?{role:"button",tabIndex:"0",onClick:a}:{}},r.createElement(c,{viewBox:"0 0 24 24",style:u}))}d.displayName="IconFdsLocationO";let f=(0,o.g)(),g=(0,o.a)(f),p={regions:f,towns:g,region:null,town:null,startPopupVisible:!1,setStartPopupVisible:()=>null,popupVisible:!1,handleToggleModal:()=>null,selectCity:()=>null,handleButtonClick:()=>null,startRegion:null,startTown:null},m=(0,r.createContext)(p);function w(){return(0,r.useContext)(m)}let h=({children:e,initialRegion:t,initialTown:n,showStartGeoPopup:l=!0,lastRegionsUpdateUnixTimestamp:s,showcaseUrl:u="",dadataUrl:c=(0,o.d)(u,"/backend/money/dadata"),useNewCitiesApi:d=!1})=>{let f=(0,o.e)(d),g=Number((0,o.p)(f.lastRegionsUpdateUnixTimestamp)||0),w=Number(s||0)>g,[h,v]=(0,r.useState)((0,o.g)(d)),_=(0,r.useRef)(h),[{startRegion:b,startTown:y},S]=(0,r.useState)({startRegion:p.startRegion,startTown:p.startTown}),R=t??p.region,k=n??p.town,[{region:I,town:C},x]=(0,r.useState)({region:R,town:k}),[$,O]=(0,r.useState)(p.startPopupVisible),[E,T]=(0,r.useState)(p.popupVisible),A=(0,r.useRef)(""),j=(0,r.useRef)(!1),N=(0,r.useMemo)(()=>(0,o.a)(h),[h]);(0,r.useEffect)(()=>{_.current=h},[h]);let L=(0,r.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)||""),O(!0),S({startRegion:e,startTown:t})},[O,S]),U=(0,r.useCallback)((e,t)=>{window.sessionStorage.getItem("start_popup_opened")||L(e,t)},[L]),P=(0,r.useCallback)(()=>{if(A.current&&!I&&!C){let e=N.find(e=>e.name===A.current)??null;return U(h.find(t=>t.id===(null==e?void 0:e.parentId))??null,e)}U(I,C)},[I,C,N,h,U]),V=(0,r.useCallback)(e=>{T(e)},[T]),D=(0,r.useCallback)((e,t)=>{if(!e&&!t){window.localStorage.setItem(f.allRussiaSelected,"1"),window.localStorage.setItem(f.userRegion,""),window.localStorage.setItem(f.userTown,""),(0,o.s)(null,null,d);return}window.localStorage.setItem(f.allRussiaSelected,"0"),window.localStorage.setItem(f.userRegion,JSON.stringify(e)||""),window.localStorage.setItem(f.userTown,JSON.stringify(t)||""),(0,o.s)(e||null,t||null,d)},[f,d]),z=(0,r.useCallback)(e=>{e?(0,o.h)(a.D.icon,"location"):(0,o.h)(a.D.button,(null==C?void 0:C.name)||"Вся Россия"),!l||window.sessionStorage.getItem("start_popup_opened")?V(!0):P()},[l,C,V,P]),B=(0,r.useCallback)((e,t)=>{D(e,t),x({region:e||null,town:t||null}),O(!1),V(!1);let n=new CustomEvent("onRegionChange",{detail:{region:e,town:t}});document.dispatchEvent(n)},[V,D]),F=()=>{let e=(0,o.f)(f.userRegion),t=e??(0,o.p)(f.userRegion),n=(0,o.f)(f.userTown)??(0,o.p)(f.userTown),r=(0,o.b)(_.current,t,n),i=d&&(0,o.j)(t,n);(0,o.k)(e,r.region)&&(0,o.s)(r.region,r.town,d),i&&(j.current=!0),i&&(0,o.c)(r.region,r.town)&&(D(r.region,r.town),j.current=!1),x(r);let a=async({coords:{latitude:e,longitude:t}})=>{let n=`${c}?lat=${e}&lon=${t}`,r=await (0,o.m)(n);null!=r&&r.location&&(A.current=r.location.data.city)};if(!window.localStorage.getItem("dadata")&&navigator.geolocation&&l)try{navigator.geolocation.getCurrentPosition(a,()=>null)}catch{}};return(0,r.useEffect)(()=>{(!(0,o.i)(h,d)||w)&&(0,o.l)({showcaseUrl:u,useNewCitiesApi:d}).then(e=>{e.length<1||v(e)})},[]),(0,r.useEffect)(()=>{let e=(0,o.b)(h,I,C);j.current&&(0,o.c)(e.region,e.town)&&(D(e.region,e.town),j.current=!1),x(e)},[h,I,D,C]),(0,r.useEffect)(()=>{if(window.innerWidth<1024){let e=()=>{F(),window.removeEventListener("scroll",e)};window.addEventListener("scroll",e)}else setTimeout(()=>{F()},0)},[]),(0,i.jsx)(m.Provider,{value:{regions:h,towns:N,region:I,town:C,startPopupVisible:$,setStartPopupVisible:O,popupVisible:E,handleToggleModal:V,selectCity:B,handleButtonClick:z,startRegion:b,startTown:y},children:e})}},20197:(e,t,n)=>{"use strict";let r;n.d(t,{D:()=>o,h:()=>s});var i=n(17194),a=n(11246),o=((r=o||{}).icon="icon",r.chip="chip",r.accordion="accordion",r.button="button",r.checkbox="checkbox",r.radio="radio",r.select="select",r.toggle="toggle",r.tooltip="tooltip",r.link="link",r.banner="banner",r.tag="tag",r.date="date",r.field="field",r.offer="offer",r.tab="tab",r.submitButton="submitButton",r.popup="popup",r.block="block",r.show="show",r.close="close",r);let l={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_",show:"show_",close:"close_"},s=({eventCategory:e,eventActionType:t,eventActionText:n="",eventLabel:r})=>{let o={event:"data-event",eventCategory:e,eventAction:l[t]+(0,i.t)(n)};void 0!==r&&(o.eventLabel=(0,i.t)("string"==typeof r?r:r.toString())),(0,a.d)(o)}},44855:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>p});var r=n(12115),i=n(8039),a=n(12180),o=n(78392),l=n(79143);let s=()=>{},u=s(),c=(new WeakMap,r.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}})),d={dedupe:!0},f=Promise.resolve(a.U),g=()=>a.A;a.O.defineProperty(a.g,"defaultValue",{value:a.d});let p=(0,l.qm)((e,t,n)=>{let{cache:s,compare:u,suspense:p,fallbackData:m,revalidateOnMount:w,revalidateIfStale:h,refreshInterval:v,refreshWhenHidden:_,refreshWhenOffline:b,keepPreviousData:y,strictServerPrefetchWarning:S}=n,[R,k,I,C]=a.b.get(s),[x,$]=(0,a.s)(e),O=(0,r.useRef)(!1),E=(0,r.useRef)(!1),T=(0,r.useRef)(x),A=(0,r.useRef)(t),j=(0,r.useRef)(n),N=()=>j.current.isVisible()&&j.current.isOnline(),[L,U,P,V]=(0,a.z)(s,x),D=(0,r.useRef)({}).current,z=(0,a.e)(m)?(0,a.e)(n.fallback)?a.U:n.fallback[x]:m,B=(e,t)=>{for(let n in D)if("data"===n){if(!u(e[n],t[n])&&(!(0,a.e)(e[n])||!u(Z,t[n])))return!1}else if(t[n]!==e[n])return!1;return!0},F=!O.current,M=(0,r.useMemo)(()=>{let e=L(),n=V(),r=e=>{let n=(0,a.m)(e);return(delete n._k,(()=>{if(!x||!t||j.current.isPaused())return!1;if(F&&!(0,a.e)(w))return w;let e=(0,a.e)(z)?n.data:z;return(0,a.e)(e)||h})())?{isValidating:!0,isLoading:!0,...n}:n},i=r(e),o=e===n?i:r(n),l=i;return[()=>{let e=r(L());return B(e,l)?(l.data=e.data,l.isLoading=e.isLoading,l.isValidating=e.isValidating,l.error=e.error,l):(l=e,e)},()=>o]},[s,x]),J=(0,i.useSyncExternalStore)((0,r.useCallback)(e=>P(x,(t,n)=>{B(n,t)||e()}),[s,x]),M[0],M[1]),q=R[x]&&R[x].length>0,W=J.data,G=(0,a.e)(W)?z&&(0,a.B)(z)?c(z):z:W,H=J.error,Y=(0,r.useRef)(G),Z=y?(0,a.e)(W)?(0,a.e)(Y.current)?G:Y.current:W:G,K=x&&(0,a.e)(G),Q=(0,r.useRef)(null);a.I||(0,i.useSyncExternalStore)(g,()=>(Q.current=!1,Q),()=>(Q.current=!0,Q));let X=Q.current;S&&X&&!p&&K&&console.warn(`Missing pre-initiated data for serialized key "${x}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);let ee=!(!x||!t||j.current.isPaused())&&(!q||!!(0,a.e)(H))&&(F&&!(0,a.e)(w)?w:p?!(0,a.e)(G)&&h:(0,a.e)(G)||h),et=F&&ee,en=(0,a.e)(J.isValidating)?et:J.isValidating,er=(0,a.e)(J.isLoading)?et:J.isLoading,ei=(0,r.useCallback)(async e=>{let t,r,i=A.current;if(!x||!i||E.current||j.current.isPaused())return!1;let l=!0,s=e||{},c=!I[x]||!s.dedupe,d=()=>a.r?!E.current&&x===T.current&&O.current:x===T.current,f={isValidating:!1,isLoading:!1},g=()=>{U(f)},p=()=>{let e=I[x];e&&e[1]===r&&delete I[x]},m={isValidating:!0};(0,a.e)(L().data)&&(m.isLoading=!0);try{if(c&&(U(m),n.loadingTimeout&&(0,a.e)(L().data)&&setTimeout(()=>{l&&d()&&j.current.onLoadingSlow(x,n)},n.loadingTimeout),I[x]=[i($),(0,a.o)()]),[t,r]=I[x],t=await t,c&&setTimeout(p,n.dedupingInterval),!I[x]||I[x][1]!==r)return c&&d()&&j.current.onDiscarded(x),!1;f.error=a.U;let e=k[x];if(!(0,a.e)(e)&&(r<=e[0]||r<=e[1]||0===e[1]))return g(),c&&d()&&j.current.onDiscarded(x),!1;let o=L().data;f.data=u(o,t)?o:t,c&&d()&&j.current.onSuccess(t,x,n)}catch(n){p();let e=j.current,{shouldRetryOnError:t}=e;!e.isPaused()&&(f.error=n,c&&d()&&(e.onError(n,x,e),(!0===t||(0,a.a)(t)&&t(n))&&(!j.current.revalidateOnFocus||!j.current.revalidateOnReconnect||N())&&e.onErrorRetry(n,x,e,e=>{let t=R[x];t&&t[0]&&t[0](o.I0,e)},{retryCount:(s.retryCount||0)+1,dedupe:!0})))}return l=!1,g(),!0},[x,s]),ea=(0,r.useCallback)((...e)=>(0,a.n)(s,T.current,...e),[]);if((0,a.u)(()=>{A.current=t,j.current=n,(0,a.e)(W)||(Y.current=W)}),(0,a.u)(()=>{if(!x)return;let e=ei.bind(a.U,d),t=0;j.current.revalidateOnFocus&&(t=Date.now()+j.current.focusThrottleInterval);let n=(0,l.aw)(x,R,(n,r={})=>{if(n==o.CC){let n=Date.now();j.current.revalidateOnFocus&&n>t&&N()&&(t=n+j.current.focusThrottleInterval,e())}else if(n==o.jB)j.current.revalidateOnReconnect&&N()&&e();else if(n==o.q2)return ei();else if(n==o.I0)return ei(r)});return E.current=!1,T.current=x,O.current=!0,U({_k:$}),ee&&!I[x]&&((0,a.e)(G)||a.I?e():(0,a.t)(e)),()=>{E.current=!0,n()}},[x]),(0,a.u)(()=>{let e;function t(){let t=(0,a.a)(v)?v(L().data):v;t&&-1!==e&&(e=setTimeout(n,t))}function n(){!L().error&&(_||j.current.isVisible())&&(b||j.current.isOnline())?ei(d).then(t):t()}return t(),()=>{e&&(clearTimeout(e),e=-1)}},[v,_,b,x]),(0,r.useDebugValue)(Z),p){if(!a.r&&a.I&&K)throw Error("Fallback data is required when using Suspense in SSR.");K&&(A.current=t,j.current=n,E.current=!1);let e=C[x];if(c(!(0,a.e)(e)&&K?ea(e):f),!(0,a.e)(H)&&K)throw H;let r=K?ei(d):f;!(0,a.e)(Z)&&K&&(r.status="fulfilled",r.value=!0),c(r)}return{mutate:ea,get data(){return D.data=!0,Z},get error(){return D.error=!0,H},get isValidating(){return D.isValidating=!0,en},get isLoading(){return D.isLoading=!0,er}}})},53730:(e,t,n)=>{"use strict";n.d(t,{a:()=>r});let r={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 r=`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;for(let e in n){if(!n.hasOwnProperty(e))continue;r+=`; ${e}`;let t=n[e];!0!==t&&(r+=`=${t}`)}document.cookie=r},removeItem:e=>{r.setItem(e,"",{"max-age":-1})}}},55727:(e,t,n)=>{"use strict";n.d(t,{N:()=>d});var r=n(95155),i=n(29722),a=n(12115),o=n(26048),l=n(83640);function s(e){return a.createElement("svg",{viewBox:"0 0 24 24",width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},a.createElement("path",{d:"M10.25 5.75c0 .414.336.75.75.75h5.44L5.22 17.72a.75.75 0 1 0 1.06 1.06L17.5 7.56V13a.75.75 0 0 0 1.5 0V5.75a.75.75 0 0 0-.75-.75H11a.75.75 0 0 0-.75.75Z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}))}n(63914);let u=(0,l.g)("link"),c=Object.freeze({link:u,states:{inverted:`${u}--inverted`,disabled:`${u}--disabled`},content:`${u}__content`,icon:`${u}__icon`,size:{s:`${u}--s`,m:`${u}--m`}});function d({as:e,size:t="m",withIcon:n=!1,children:a,disabled:l,text:u,inverted:f,onClick:g,className:p,style:m,dataQa:w,dataId:h,...v}){let _=(0,i.A)(c.link,{[c.states.inverted]:f,[c.states.disabled]:l},c.size[t],p),b=u||a;return(0,r.jsx)(e||"a",{className:_,disabled:l,style:m,onClick:g,"aria-disabled":l,tabIndex:l?-1:0,...v,"data-id":h,"data-qa":w,children:n?(0,r.jsxs)("span",{className:c.content,children:[b,(0,r.jsx)(o.P,{className:c.icon,children:(0,r.jsx)(s,{})})]}):b})}d.displayName="Link"},56053:(e,t,n)=>{"use strict";n.d(t,{F:()=>c,H:()=>l,U:()=>a,a:()=>u,b:()=>s,c:()=>o,s:()=>i});let r=(0,n(7596).g)("header","sc"),i=Object.freeze({header:`${r}`,fixed:`${r}__fixed`,hidden:`${r}__fixed--hidden`,transparent:`${r}--transparent`,navigationOpen:`${r}__navigation-open`,container:`${r}__container`,leftRow:`${r}__left-row`,logo:`${r}__logo`,menuItems:`${r}__menu-items`,menuItemActive:`${r}__menu-item-active`,tabletMenuButton:`${r}__tablet-menu-button`,buttonGroup:`${r}__button-group`,chips:`${r}__chips`,menuButton:`${r}__menu-button`,moreButtons:`${r}__more-buttons`,auth:`${r}__auth`,whiteIcons:`${r}__white-icons`,close:`${r}__close`,removed:`${r}__removed`,overlay:`${r}__overlay`,overlayOpening:`${r}__overlay--opening`,overlayClosing:`${r}__overlay--closing`}),a="user_region",o="user_town",l="cb-header",s=[{id:"FINPRODUCTS",label:"Финпродукты"},{id:"NAVIGATOR",label:"Журнал"},{id:"ABOUT",label:"О маркетплейсе"}],u=s.reduce((e,t)=>(e[t.id]=t.label,e),{}),c=Object.freeze({mobile:56,desktop:80})},60558:(e,t,n)=>{"use strict";n.d(t,{a:()=>v,b:()=>R,c:()=>I,d:()=>b,e:()=>s,f:()=>g,g:()=>m,h:()=>E,i:()=>h,j:()=>k,k:()=>d,l:()=>$,m:()=>O,p:()=>p,s:()=>f});var r=n(53730),i=n(20197),a=n(56053);let o={userRegion:a.U,userTown:a.c,allRegions:"all_regions",lastRegionsUpdateUnixTimestamp:"lastRegionsUpdateUnixTimestamp",allRussiaSelected:"all_russia_selected"},l={userRegion:a.U,userTown:a.c,allRegions:"all_regions_new_api",lastRegionsUpdateUnixTimestamp:"lastRegionsUpdateUnixTimestamp_new_api",allRussiaSelected:"all_russia_selected"},s=(e=!1)=>e?l:o,u=(e,t=!1)=>{if(t){window.allRegionsNewApi=e;return}window.allRegions=e},c=e=>Array.isArray(e.towns)?e.towns:[],d=(e,t)=>{if(!e||!t)return!1;if(e.url!==t.url)return!0;let n=c(e);return n.length>1||n.some(({main:e})=>!e)},f=(e,t,n=!1)=>{if(typeof document>"u")return;let i=s(n);if(!e&&!t){r.a.removeItem(i.userRegion),r.a.removeItem(i.userTown);return}r.a.setItem(i.userRegion,JSON.stringify((e=>{if(!e)return null;let t=c(e).find(({main:e})=>!!e);return{...e,towns:t?[t]:[]}})(e))||"",{"max-age":31536e3}),r.a.setItem(i.userTown,JSON.stringify(t)||"",{"max-age":31536e3})},g=e=>{if(typeof document>"u")return null;let t=r.a.getItem(e)??void 0;if(!t||"undefined"===t)return null;try{return JSON.parse(decodeURIComponent(t))}catch{return null}},p=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},m=(e=!1)=>{if(typeof window>"u")return[];let t=((e=!1)=>e?window.allRegionsNewApi:window.allRegions)(e);if(Array.isArray(t)&&t.length>0)return t;let n=p(s(e).allRegions)||[];return u(n,e),n},w=e=>e.some(e=>e.towns.some(e=>!!e.newId||!!e.fiasId)),h=(e,t=!1)=>!(e.length<1)&&(!t||w(e)),v=e=>{let t={};return e.map(({id:e,name:n,towns:r})=>(r.forEach(r=>{r.parentId=e,t[r.name]=t[r.name]||{},t[r.name][r.id]=n}),r)).reduce((e,n)=>(n.forEach(e=>{Object.keys(t[e.name]).length>1&&(e.parentName=t[e.name][e.id])}),[...e,...n]),[])},_=(e,t)=>`${e.replace(/\/+$/,"")}${t}`,b=(e,t)=>_(e||"https://finuslugi.ru",t),y=async e=>{try{return await (await fetch(e)).json()}catch(e){console.warn(e)}return null},S=(e,t=!1)=>{if(e.length<1)return;let n=s(t);u(e,t),window.localStorage.setItem(n.allRegions,JSON.stringify(e)),window.localStorage.setItem(n.lastRegionsUpdateUnixTimestamp,JSON.stringify(Date.now()))},R=(e,t,n)=>{let r=null,i=null;return n&&e.some(e=>{let t=e.towns.find(e=>e.id===n.id)??null;return!!t&&(r=e,i=t,!0)}),{region:r??(t?e.find(e=>e.url===t.url)??e.find(e=>e.region_id===t.region_id)??null:null)??t,town:i??n}},k=(e,t)=>(!!e||!!t)&&!(null!=e&&e.newId)&&!(null!=e&&e.fiasId)&&!(null!=t&&t.newId)&&!(null!=t&&t.fiasId),I=(e,t)=>!!(null!=e&&e.newId||null!=e&&e.fiasId||null!=t&&t.newId||null!=t&&t.fiasId),C=async e=>{let t=await y(b(e,"/money_data/Root.json?short=1")),n=Array.isArray(null==t?void 0:t.regions)?t.regions:[];return S(n),n},x=async e=>{let t,n,[r,i]=await Promise.all([y(_(e,"/sc/api/v1/cities?all=true&isActive=true")),y(_(e,"/sc/api/v1/regions?all=true"))]);if(!Array.isArray(null==r?void 0:r.content)||!Array.isArray(null==i?void 0:i.content))return[];let a=r.content,o=(n=(t=i.content.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:+!!e.isActive,fiasId:e.fiasId,towns:[]}))).reduce((e,t)=>(e[t.id]=t,e),{}),a.forEach(e=>{let t=n[e.geoRegionId];t&&t.towns.push({id:e.legacyId,name:e.name,name_r:e.nameR,name_p:e.nameP,url:e.url,main:+!!e.isRegionalCenter,newId:e.id,fiasId:e.fiasId})}),t);return w(o)?(S(o,!0),o):[]},$=async({showcaseUrl:e="",useNewCitiesApi:t=!1}={})=>t?x(e):C(e),O=async e=>{let t=null;try{t=await (await fetch(`${e}`,{method:"GET"})).json()}catch(e){console.warn(e)}return t||null},E=(e,t,n)=>{(0,i.h)({eventCategory:"finkit-widgets-sc-city-select",eventActionType:e,eventActionText:t,eventLabel:n})}},63914:()=>{},65538:(e,t,n)=>{"use strict";var r=n(12115),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=r.useState,o=r.useEffect,l=r.useLayoutEffect,s=r.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(e){return!0}}var c="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,c=r[1];return l(function(){i.value=n,i.getSnapshot=t,u(i)&&c({inst:i})},[e,n,t]),o(function(){return u(i)&&c({inst:i}),e(function(){u(i)&&c({inst:i})})},[e]),s(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},73321:(e,t,n)=>{"use strict";var r=n(74645);n.o(r,"notFound")&&n.d(t,{notFound:function(){return r.notFound}}),n.o(r,"usePathname")&&n.d(t,{usePathname:function(){return r.usePathname}}),n.o(r,"useSearchParams")&&n.d(t,{useSearchParams:function(){return r.useSearchParams}})},78392:(e,t,n)=>{"use strict";n.d(t,{CC:()=>r,I0:()=>o,jB:()=>i,q2:()=>a});let r=0,i=1,a=2,o=3},79143:(e,t,n)=>{"use strict";n.d(t,{Ht:()=>f,aw:()=>d,qm:()=>c});var r=n(12180),i=n(9892),a=n(12115);let o=r.i&&window.__SWR_DEVTOOLS_USE__,l=o?window.__SWR_DEVTOOLS_USE__:[],s=e=>(0,r.a)(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],u=l.concat(e=>(t,n,a)=>{let o=n&&((...e)=>{let[a]=(0,r.s)(t),[,,,o]=r.b.get(r.c);if(a.startsWith(i.q))return n(...e);let l=o[a];return(0,r.e)(l)?n(...e):(delete o[a],l)});return e(t,o,a)}),c=e=>function(...t){let n,i=(n=(0,a.useContext)(r.S),(0,a.useMemo)(()=>(0,r.m)(r.d,n),[n])),[o,l,c]=s(t),d=(0,r.f)(i,c),f=e,{use:g}=d,p=(g||[]).concat(u);for(let e=p.length;e--;)f=p[e](f);return f(o,l||d.fetcher||null,d)},d=(e,t,n)=>{let r=t[e]||(t[e]=[]);return r.push(n),()=>{let e=r.indexOf(n);e>=0&&(r[e]=r[r.length-1],r.pop())}},f=(e,t)=>(...n)=>{let[r,i,a]=s(n),o=(a.use||[]).concat(t);return e(r,i,{...a,use:o})};o&&(window.__SWR_DEVTOOLS_REACT__=a)},89584:(e,t,n)=>{"use strict";n.d(t,{s:()=>g});var r=n(95155),i=n(12115),a=n(29722),o=n(66424),l=n(86969),s=n(70179),u=n(26048),c=n(83640);n(97903);let d=(0,c.g)("radio"),f=Object.freeze({radio:d,input:`${d}__input`,marker:`${d}__marker`,wrapper:`${d}__wrapper`,label:`${d}__label`,caption:`${d}__caption`,icon:`${d}__icon`,iconButton:`${d}__icon-button`,states:{error:`${d}--error`,disabled:`${d}--disabled`,inverted:`${d}--inverted`},sizes:{xs:`${d}--xs`,s:`${d}--s`,m:`${d}--m`},variants:{primary:`${d}--primary`,secondary:`${d}--secondary`}}),g=(0,i.forwardRef)(({value:e,variant:t="primary",checked:n=!1,state:c="default",label:d,disabled:g=!1,caption:p,className:m,style:w,icon:h,withIcon:v=!1,size:_="m",inverted:b=!1,children:y,inputRef:S,onChange:R,onIconClick:k,dataQa:I,dataId:C,...x},$)=>{let O=(0,i.useId)(),E=y||d;return(0,r.jsxs)("label",{ref:$,htmlFor:O,"data-marker-label":"",className:(0,a.A)(m,f.radio,{[f.states.disabled]:g,[f.states.inverted]:b,[f.states.error]:"error"===c,[f.sizes[_]]:!0,[f.variants[t]]:!0}),style:w,"data-id":C,"data-qa":I,children:[(0,r.jsx)("input",{id:O,value:e,checked:n,className:f.input,type:"radio",disabled:g,onChange:e=>{null==R||R(e.target.value,e)},ref:S,...x}),(0,r.jsx)("span",{className:f.marker,children:(0,r.jsx)(s.C,{type:"radio",checked:n,inverted:b,state:c,disabled:g})}),E&&(0,r.jsxs)("span",{className:f.wrapper,children:[(0,r.jsx)("span",{className:f.label,children:E}),p&&(0,r.jsx)(l.C,{className:f.caption,withoutIcon:!0,children:p})]}),v&&(0,r.jsx)("button",{type:"button",className:(0,a.A)(f.iconButton),onClick:g?void 0:k,children:(0,r.jsx)(u.P,{className:(0,a.A)(f.icon),children:h?(0,r.jsx)(r.Fragment,{children:h}):(0,r.jsx)(o.S,{})})})]})});g.displayName="Radio"},97903:()=>{}}]);