(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[43],{8114:function(e,t,a){"use strict";a.d(t,{I:function(){return r}});var l=a(7294),i=a(6646),n=a.n(i);let r=e=>{let{wrapperRef:t}=e,[a,i]=(0,l.useState)(0),r=n().overlay,o=()=>{var e;let a=(null===(e=t.current)||void 0===e?void 0:e.getBoundingClientRect().bottom)||1e4;if(a>.6*window.innerHeight)return i(0);let l=(.6*window.innerHeight-a)/(.6*window.innerHeight);i(l>.6?.6:l)};return(0,l.useEffect)(()=>(document.addEventListener("scroll",o),()=>{document.removeEventListener("scroll",o)}),[]),{overlayClassName:r,overlayStyles:{background:"rgba(0, 0, 0, ".concat(a,")")}}}},2995:function(e,t,a){"use strict";a.r(t),a.d(t,{NavigatorDetail:function(){return G}});var l=a(5893),i=a(9194),n=a(6535),r=a(4588),o=a(6010),s=a(1163),u=a(7294),c=a(4838),d=a(3055),p=a(4578),m=a(5352),_=a(7701),v=a(2307),h=a(4386),g=a(1309),x=a(8059),f=a(8114),b=a(3051),j=a(4800),N=a(5131),w=a(5900),I=a.n(w);let y=e=>{let{date:t,className:a,variant:i="desktop"}=e;return t?(0,l.jsx)("div",{className:(0,o.Z)(I().wrapper,a,I()[i]),children:(0,l.jsxs)("label",{children:["Обновлено ",t]})}):null};var D=a(1997),R=a(338),C=a(9298),$=a.n(C);let k=e=>{var t,a;let{post:n,BASE_URL:r,postViews:o}=e,s=(0,D.p6)(String(n.public_date),!0),u=(0,D.k2)(n.update_time),c=(0,D.fx)(n.public_date,n.update_time),d=n.read_time||0;return(0,l.jsxs)("div",{className:$().wrapper,children:[(0,l.jsxs)("div",{className:$().info,children:[(0,l.jsx)("div",{className:$().unit,children:(0,l.jsx)("label",{children:s})}),!!d&&(0,l.jsxs)("div",{className:$().unit,children:[(0,l.jsx)(i.IconFdsClockO,{size:24}),(0,l.jsxs)("label",{children:[d," мин"]})]}),!!o&&(0,l.jsxs)("div",{className:$().unit,children:[(0,l.jsx)(i.IconFdsEyeO,{size:24}),(0,l.jsx)("label",{children:o})]}),c&&(0,l.jsx)(y,{date:u,className:$().right})]}),!!(null==n?void 0:null===(t=n.author)||void 0===t?void 0:t.name)&&(null==n?void 0:null===(a=n.author)||void 0===a?void 0:a.url)&&(0,l.jsxs)("a",{className:$().author,href:"/navigator/author/".concat(null==n?void 0:n.author.url),target:"_self",children:[(null==n?void 0:n.author.photo)&&(0,l.jsx)("img",{className:$().image,src:(0,R.J)(n.author.photo,"original",r),alt:n.author.name}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:$().name,children:n.author.name}),(0,l.jsx)("div",{className:$().position,children:n.author.position})]})]})]})};var M=a(2288),P=a(7315),F=a(2027),L=a(3627);function S(e){let t=e.match(/^navigator\/([^/]+)\/.+$/);return t?t[1]:null}var z=a(6129),T=a(2864),B=a(2825),W=a(3161),A=a(7771),E=a(7311),H=a(2853);let O=async(e,t,a,l,i,n)=>{var r;let o=await (0,H.pW)(e,9,void 0,t,l?void 0:a,l?1:void 0),s=new Date;s.setDate(new Date().getDate()-30);let u=((null===(r=o.data)||void 0===r?void 0:r.articles)||[]).filter(e=>e.url!==n).map(e=>{let{url:t}=e;return t});return u.length||l?u:(i(),await O(e,1,"",!0,i,n))};var U=a(2888),V=a(2708),Z=a.n(V);let G=e=>{var t,a,i,o,d,_;let{env:f,post:b,tags:w,description:I,isMobileApplication:y,extra:D,bestOffers:C}=e,$=(0,g.I)(),{asPath:k}=(0,s.useRouter)(),[P,z]=(0,u.useState)(b),[T,B]=(0,u.useState)([]),A=(0,u.useRef)([]),H=(0,u.useRef)(0),U=(0,u.useRef)(!1),[V,G]=(0,u.useState)(e.disableInfiniteScroll);(0,u.useEffect)(()=>{let e=()=>{var e;let t=document.getElementById(null===(e=window.location.hash)||void 0===e?void 0:e.slice(1));t&&(0,W.Q)((0,W.n)(t)-32),history.replaceState(null,"",window.location.pathname+window.location.search)};return window.addEventListener("hashchange",e),window.location.hash?e():window.scrollTo(0,0),()=>{window.removeEventListener("hashchange",e)}},[]);let K=null===(t=P.tag_ids)||void 0===t?void 0:t.reduce((e,t)=>{let a=w.find(e=>{let{id:a}=e;return a===t}),l=k.replace("navigator-new/","navigator/"),i=l.includes((null==a?void 0:a.url)||"___");return a&&i&&e.unshift(a),a&&!i&&e.push(a),e},[]),Y=(null==K?void 0:K[0])||w[0],X=()=>{U.current=!0,H.current=1},Q=async()=>{var t;if(e.disableInfiniteScroll)return;A.current.length||(H.current++,A.current=await O(f,H.current,Y.url,U.current,X,P.url));let a=A.current.shift();if(!a){G(!0);return}let l=await (0,c.vM)(f,a),i=null===(t=l.data)||void 0===t?void 0:t.article;if(null==i?void 0:i.best_offers){let e=(0,p.v5)(C,i.best_offers);i.bestOffersTab=e}(null==i?void 0:i.title)?B(e=>[...e,i]):Q()},q=w.find(e=>{var t;let{id:a}=e;return a===(null==P?void 0:null===(t=P.tag_ids)||void 0===t?void 0:t[0])}),ee=(0,x.M)(Q,.5),et=(0,u.useMemo)(()=>"Читать статью на тему “".concat(P.title.trimEnd(),"” онлайн на сайте.  Еще больше актуальных статей").concat(q?" по теме “".concat(null==q?void 0:q.name,"” "):" ","в Журнале Финуслуги."),[w,P]),ea=(0,u.useMemo)(()=>""!==I?I:et,[I,et]),el=(()=>{switch(Y&&Y.url){case"navigator/investirovat":return{pp:"cfbl",ps:"foam",p2:"hpaj"};case"navigator/kredity":return{pp:"cfbj",ps:"foam",p2:"hpaj"};case"navigator/nakopit-i-sohranit":return{pp:"cfek",ps:"foam",p2:"hpaj"};case"navigator/zastrahovat":return{pp:"cfbk",ps:"foam",p2:"hpaj"};default:return{pp:"i",ps:"foam",p2:"hpaj"}}})(),ei=(0,L.z)({tag:{href:Y.url,label:Y.name},current:{label:P.title}}),en=(0,L.z)({includeBase:!1,tag:{href:Y.url,label:Y.name}}),er=(0,F.z)(ei),eo=(0,F.z)(en),es=JSON.stringify({"@context":"https://schema.org","@graph":[{"@type":"Article",name:P.title,headline:"".concat(P.title," - читайте на сайте Финуслуги"),description:ea,url:"".concat(h._n,"/").concat(P.url),about:{"@type":"Thing",...q&&{name:null==q?void 0:q.name,sameAs:"".concat(h._n,"/").concat(null==q?void 0:q.url)}},mainEntityOfPage:{"@type":"WebPage","@id":"".concat(h._n,"/").concat(P.url)},dateCreated:P.public_date||P.publ_date,datePublished:P.public_date||P.publ_date,dateModified:P.update_time||P.public_date,thumbnailUrl:(0,R.J)(null==P?void 0:null===(a=P.image)||void 0===a?void 0:a.file,"big",h._n),...P.author&&{author:{"@type":"Person",name:null===(i=P.author)||void 0===i?void 0:i.name,url:"".concat(h._n,"/navigator/author/").concat(null===(o=P.author)||void 0===o?void 0:o.url)}},...(null==P?void 0:P.publisher)&&{publisher:{"@type":P.publisher.type,name:P.publisher.name,url:"".concat(h._n),address:{"@type":"PostalAddress",name:P.publisher.address},logo:{"@type":"ImageObject",url:"".concat(h._n,"/icons/header_logo.svg"),width:168,height:42}}}},JSON.parse(eo)]}),{anons:eu,publ_date:ec}=P,ed=ec.split(" ")[0].split("-")[0],ep="Дарим 4000 рублей за первый вклад"===eu&&"2022"===ed||e.noIndex,em=(0,p.v5)(C,b.best_offers);return(0,l.jsxs)("main",{ref:ee,className:Z().page,children:[!D&&(0,l.jsx)(m.N,{env:f,title:P.seo_title||P.custom_title||P.title,description:P.seo_description||ea,path:k,noindex:ep,image:(0,R.J)(null==b?void 0:null===(d=b.image)||void 0===d?void 0:d.file,"big",h._n),isDetailPage:!0}),(0,l.jsxs)(n.W2,{children:[!y&&!D&&(0,l.jsx)(r.Oo,{items:ei,style:{padding:"16px 0"}}),!y&&!D&&(0,l.jsx)(N.v5,{env:f,isMobile:!0,tags:w,selectedTag:null==Y?void 0:Y.url}),(0,l.jsxs)("div",{className:Z().content,children:[(0,l.jsx)(j.F,{env:f,tags:w,selectedTag:null==Y?void 0:Y.url}),(0,l.jsxs)("div",{className:Z().main,children:[(0,l.jsx)(J,{...e,onReach:Q,handleChangePost:e=>z(e)}),(0,l.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:es}}),(0,l.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:er}}),em&&(0,l.jsx)(p.eB,{category:null!==(_=S(b.url))&&void 0!==_?_:"",tab:em}),!y&&(0,l.jsx)(v.Z,{config:$,params:el}),T.map(t=>{var a;let{bestOffersTab:i,...n}=t;return(0,l.jsxs)(u.Fragment,{children:[(0,l.jsx)(J,{extra:!0,handleChangePost:z,...e,onReach:Q,post:n}),i&&(0,l.jsx)(p.eB,{category:null!==(a=S(n.url))&&void 0!==a?a:"",tab:i})]},n.url)}),!V&&(0,l.jsx)(J,{...e,post:M.Wn,extra:!0,skeleton:!0})]})]})]}),(0,l.jsx)(E.w,{articleRef:ee})]})},J=e=>{var t,a,n,r,p,m,v,h,g;let{env:j,post:w,tags:I,ctgs:C,isMobileApplication:$,extra:M,onReach:F,skeleton:L,handleChangePost:S,disableInfiniteScroll:E}=e,{asPath:H,push:O}=(0,s.useRouter)(),[V,G]=(0,u.useState)(w.views||0),[J,K]=(0,u.useState)(!1),Y=(0,x.M)(F,.5),X=(0,u.useRef)(!M),Q=(0,u.useRef)(!1),{overlayClassName:q,overlayStyles:ee}=(0,f.I)({wrapperRef:Y}),et=(0,D.fx)(w.public_date,w.update_time),ea=(null===(a=w.content)||void 0===a?void 0:null===(t=a.filter(e=>"header"===e.type))||void 0===t?void 0:t.map(e=>{var t;return null===(t=e.data)||void 0===t?void 0:t.text}))||[],el=(0,P.I)((0,B.$)(w.anons||(null===(p=w.content)||void 0===p?void 0:null===(r=p.find(e=>e.type===d.z.Annotation))||void 0===r?void 0:null===(n=r.data)||void 0===n?void 0:n.text)||"")),ei=(null===(m=w.content)||void 0===m?void 0:m.filter(e=>!!w.anons||e.type!==d.z.Annotation))||[],en=null===(v=w.tag_ids)||void 0===v?void 0:v.reduce((e,t)=>{let a=I.find(e=>{let{id:a}=e;return a===t}),l=H.replace("navigator-new/","navigator/"),i=l.includes((null==a?void 0:a.url)||"___");return a&&i&&e.unshift(a),a&&!i&&e.push(a),e},[]),er=(null==en?void 0:en[0])||I[0],eo=(()=>{switch(er&&er.url){case"navigator/investirovat":return{pp:"cfbl",ps:"foam",p2:"hpaj"};case"navigator/kredity":return{pp:"cfbj",ps:"foam",p2:"hpaj"};case"navigator/nakopit-i-sohranit":return{pp:"cfek",ps:"foam",p2:"hpaj"};case"navigator/zastrahovat":return{pp:"cfbk",ps:"foam",p2:"hpaj"};default:return{pp:"i",ps:"foam",p2:"hpaj"}}})(),es=j.NEXT_PUBLIC_BASE_URL;(0,u.useEffect)(()=>{M||L||(Q.current=!0,(0,c.f6)(j,w.url).then(e=>{G((0,z.V)(w.url,e||w.views,1))}))},[]),(0,u.useEffect)(()=>{if(Y.current&&!L&&!E){let e=Y.current,t=()=>{if(!e||!Y.current)return;let t=Y.current.getBoundingClientRect(),a=t.top+window.scrollY,l=a+Y.current.offsetHeight,i=window.scrollY+window.innerHeight/2,n=i>a&&i<l;!n||X.current||Q.current||(Q.current=!0,(0,c.f6)(j,w.url).then(e=>{G((0,z.V)(w.url,e||w.views,1))})),n&&!X.current&&(X.current=!0,S&&S(w),O("/".concat(w.url),void 0,{shallow:!0})),n||(X.current=!1)};return document.addEventListener("scroll",t),()=>{e&&document.removeEventListener("scroll",t)}}},[]);let eu=e=>{let{index:t,post:a}=e;(0,T.I)({eventCategory:"".concat((0,A.b)("журнал"),"_").concat(location.pathname),eventActionType:T.i.link,eventActionText:(0,A.b)(a.title),eventLabel:""});let l=document.getElementById("".concat(a.id,"_content_header_").concat(t));l&&(0,W.Q)((0,W.n)(l)-32)},ec=!$&&!!ea.length&&0!==w.show_content;return(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("div",{ref:Y,className:(0,o.Z)(Z().article,{[Z().app]:$,[Z().skeleton]:L}),children:[(0,l.jsxs)("div",{className:Z().articleContentWrapper,children:[!$&&(0,l.jsxs)("div",{className:Z().topInfoWrapper,children:[(0,l.jsx)(N.Yx,{env:j,tag:er}),(0,l.jsxs)("div",{className:Z().rightInfo,children:[(0,l.jsxs)("div",{className:Z().share,onClick:()=>{(0,T.I)({eventCategory:"".concat((0,A.b)("журнал"),"_").concat(location.pathname),eventActionType:T.i.button,eventActionText:(0,A.b)("поделиться"),eventLabel:""}),K(e=>!e)},children:[(0,l.jsx)(i.IconFdsArrowForwardO,{size:24}),(0,l.jsx)("p",{className:"desktopOnly",children:"Поделиться"})]}),(0,l.jsx)(_.n,{className:(0,o.Z)(Z().soc,{[Z().show]:J}),title:w.title,url:"/".concat(w.url)})]})]}),et&&(0,l.jsx)(y,{date:(0,D.k2)(w.update_time),variant:"mobile"}),(0,l.jsx)("h1",{dangerouslySetInnerHTML:{__html:(0,P.I)(w.title)}}),(0,l.jsx)("div",{className:Z().anons,dangerouslySetInnerHTML:{__html:el}}),(0,l.jsx)(k,{post:w,BASE_URL:es,postViews:V}),!!(null==w?void 0:null===(h=w.image)||void 0===h?void 0:h.file)&&(null==w?void 0:null===(g=w.image)||void 0===g?void 0:g.file)!=="."&&(0,l.jsx)(U.t,{isLazy:!1,srcDesktop:(0,R.J)(w.image.file,"big",es),srcMobile:(0,R.J)(w.image.file,"small",es),caption:w.cover_title,captionClassName:Z().detailImageCaption,className:Z().detailImageWrapper}),ec&&(0,l.jsxs)("div",{className:Z().contentTable,children:[(0,l.jsx)("label",{children:"Содержание статьи"}),(0,l.jsx)("div",{className:Z().contentList,children:ea.map((e,t)=>(0,l.jsx)("div",{onClick:()=>eu({index:t+1,post:w}),dangerouslySetInnerHTML:{__html:e||""}},t))})]}),(0,l.jsx)(b.L,{env:j,data:ei,params:eo,post:w,ctgs:C,tags:I})]}),(0,l.jsx)("div",{className:q,style:{...ee,borderRadius:"20px"}})]})})}},6646:function(e){e.exports={overlay:"overlay_overlay__S_LwK",shine:"overlay_shine__UoVU9"}},2708:function(e){e.exports={contentTable:"NavigatorDetail_contentTable__KWjgZ",expertName:"NavigatorDetail_expertName__yLbfr",group:"NavigatorDetail_group__vb1OA",popularTitle:"NavigatorDetail_popularTitle__Feft2",popularItemCat:"NavigatorDetail_popularItemCat__traK5",popularItemTitle:"NavigatorDetail_popularItemTitle__L0HFY",article:"NavigatorDetail_article__1H_V4",skeleton:"NavigatorDetail_skeleton__vThIp",anons:"NavigatorDetail_anons__YKy3n",detailImageWrapper:"NavigatorDetail_detailImageWrapper__UWyrX",shine:"NavigatorDetail_shine__gQoSm",page:"NavigatorDetail_page__wU4Bs",content:"NavigatorDetail_content__3OnlR",main:"NavigatorDetail_main__GpWew",articleContentWrapper:"NavigatorDetail_articleContentWrapper__EfqF8",topInfoWrapper:"NavigatorDetail_topInfoWrapper__E1F9k",share:"NavigatorDetail_share__MzvJK",soc:"NavigatorDetail_soc__JTFnl",show:"NavigatorDetail_show__M8HgU",rightInfo:"NavigatorDetail_rightInfo__srdvn",articleBottomCard:"NavigatorDetail_articleBottomCard__xRPhV",catWrapper:"NavigatorDetail_catWrapper__18gpL",cat:"NavigatorDetail_cat__XQbDD",shareButton:"NavigatorDetail_shareButton__rTsxD",detailImageCaption:"NavigatorDetail_detailImageCaption__gkRYA",detailImage:"NavigatorDetail_detailImage__8q77t",detailImageM:"NavigatorDetail_detailImageM__3sJpR",contentList:"NavigatorDetail_contentList__K8JlZ",mobAppAd:"NavigatorDetail_mobAppAd__fihfG",expert:"NavigatorDetail_expert__rpM3K",expertPosition:"NavigatorDetail_expertPosition__AxXGB",shareWrapper:"NavigatorDetail_shareWrapper__weiO3",articleGridWrapper:"NavigatorDetail_articleGridWrapper__tdKxZ",fullInfoLink:"NavigatorDetail_fullInfoLink__2KvDF",popularContentWrapper:"NavigatorDetail_popularContentWrapper__HyLNV",slider:"NavigatorDetail_slider__doGWp",sliderLeftButton:"NavigatorDetail_sliderLeftButton__zcXcA",sliderRightButton:"NavigatorDetail_sliderRightButton__bIRrK",singleItem:"NavigatorDetail_singleItem__tUu90",popularItem:"NavigatorDetail_popularItem__2hyCD",popularItemImage:"NavigatorDetail_popularItemImage__GEEAk",popularItemContent:"NavigatorDetail_popularItemContent__D_aab",popularItemStatUnit:"NavigatorDetail_popularItemStatUnit__uIGqb",popularItemStat:"NavigatorDetail_popularItemStat__cd1qQ",popularItemStatLeft:"NavigatorDetail_popularItemStatLeft__SFtTF",stickySidebar:"NavigatorDetail_stickySidebar__M2MRx",sidebar:"NavigatorDetail_sidebar__4Mv5u"}},9298:function(e){e.exports={wrapper:"PostHeaderInfo_wrapper__iUNGo",info:"PostHeaderInfo_info__9xMwf",unit:"PostHeaderInfo_unit__spJLu",right:"PostHeaderInfo_right__n3D0Z",author:"PostHeaderInfo_author__lo1kv",image:"PostHeaderInfo_image__GCbNH",name:"PostHeaderInfo_name__P7sbO",position:"PostHeaderInfo_position__U6cYP",shine:"PostHeaderInfo_shine__FXTGX"}},5900:function(e){e.exports={wrapper:"PostUpdateTime_wrapper__OXMWr",desktop:"PostUpdateTime_desktop__tYjxz",mobile:"PostUpdateTime_mobile__kzJtb",shine:"PostUpdateTime_shine__G1OcW"}},9685:function(e,t,a){"use strict";a.d(t,{$:function(){return E}});var l=a(5893),i=a(6010),n=a(7294),r=a(6535),o=a(4588),s=a(4941),u=a(9194);let c=(e,t)=>(t>0&&!Number.isInteger(e)&&!Number.isNaN(e)&&String(e).split(".")[1].length>t&&(e=+e.toFixed(t)),e),d=(e,t=-1)=>(e=c(e,t),new Intl.NumberFormat("ru-RU").format(e)),p=({type:e="text",unit:t,format:a,defaultValue:l="",maxLength:i=-1}={})=>{let[o,s]=(0,n.useState)(l),u=(0,n.useRef)(o),[c,p]=(0,n.useState)(!1),m=(0,n.useCallback)((t,a)=>{"function"==typeof t&&(t=t(u.current));let l=String(t);if(!(i>-1&&l.length>i)){if(["int","float"].includes(e)){if(isNaN(+t)||"int"===e&&l.includes(".")||l.includes(" "))return;l=String(""===t?"":+t)}u.current=l,s(l),null==a||a(l)}},[i,e]),_=(0,n.useMemo)(()=>({onChange:e=>{m(e)},onFocus:()=>p(!0),onBlur:()=>p(!1)}),[m]),v=(0,n.useMemo)(()=>{let l=o,i=null;switch("currency"===a&&["int","float"].includes(e)&&""!==o&&(l=d(+o)),t){case"year":i=""===l?"":(0,r._6)(+o,"год","года","лет");break;case"day":i=""===l?"":(0,r._6)(+o,"день","дня","дней");break;default:i=""!==l&&t?t:""}return i&&["int","float"].includes(e)?`${l} ${i}`:l},[a,e,t,o]);return(0,n.useMemo)(()=>({events:_,value:o,formattedValue:v,isFocused:c,handleChange:m}),[_,v,m,c,o])},m=(0,s.g)("tax-calculator-banner","sc"),_=Object.freeze({taxCalculatorBaner:m,widget:`${m}--widget`,wrapper:`${m}__wrapper`,content:`${m}__content`,image:`${m}__image`,title:`${m}__title`,subtitle:`${m}__subtitle`,button:`${m}__button`}),v=({isFullPage:e,buttonUrl:t,assets:a})=>(0,l.jsxs)("div",{className:(0,i.Z)(_.wrapper,{[_.widget]:!e}),children:[(0,l.jsxs)("picture",{className:_.image,children:[a.mobile&&(0,l.jsx)("source",{srcSet:a.mobile,media:"(max-width: 1023.02px)"}),(0,l.jsx)("img",{src:a.desktop,alt:"Калькулятор НДФЛ",loading:e?"eager":"lazy"})]}),(0,l.jsxs)("div",{className:_.content,children:[(0,l.jsx)("p",{className:_.title,children:"Оформи налоговый вычет"}),(0,l.jsx)("p",{className:_.subtitle,children:"Вы можете подать заявление на возврат НДФЛ за прошлый год с помощью наших партнеров"}),(0,l.jsx)(o.zx,{stretch:!0,className:_.button,label:"Подать заявление",size:"s",onClick:()=>{window.open(t,"_blank")}})]})]}),h=e=>n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},n.createElement("path",{fill:"#6c6d78",d:"M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20Zm0-18a8 8 0 1 1 0 16 8 8 0 0 1 0-16Z"}),n.createElement("path",{fill:"#6c6d78",d:"M11.62 17.915a1 1 0 0 0 .76 0 1 1 0 0 0 .33-.21c.088-.097.16-.209.21-.33a.84.84 0 0 0 .08-.38 1 1 0 0 0-.29-.71 1.152 1.152 0 0 0-.33-.21 1 1 0 0 0-1.38.92c.004.265.107.518.29.71a.999.999 0 0 0 .33.21Z"}),n.createElement("path",{fill:"#6c6d78",fillRule:"evenodd",d:"M8 9.584C8 7.47 9.935 6 12 6s4 1.47 4 3.584c0 1.632-1.222 2.45-1.981 2.89h-.002c-.74.43-1.017.745-1.017 1.203V14a1 1 0 1 1-2 0v-.323c0-1.653 1.237-2.482 2.015-2.933.722-.42.985-.723.985-1.16C14 8.844 13.25 8 12 8s-2 .844-2 1.584a1 1 0 0 1-2 0Z",clipRule:"evenodd"})),g=(0,s.g)("tax-calculator","sc"),x=Object.freeze({taxCalculator:g,widget:`${g}--widget`,fullPage:`${g}--full-page`,wrapper:`${g}__wrapper`,row:`${g}__row`}),f={Январь:{num:1,genitive:"января",prepositional:"январе"},Февраль:{num:2,genitive:"февраля",prepositional:"феврале"},Март:{num:3,genitive:"марта",prepositional:"марте"},Апрель:{num:4,genitive:"апреля",prepositional:"апреле"},Май:{num:5,genitive:"мая",prepositional:"мае"},Июнь:{num:6,genitive:"июня",prepositional:"июне"},Июль:{num:7,genitive:"июля",prepositional:"июле"},Август:{num:8,genitive:"августа",prepositional:"августе"},Сентябрь:{num:9,genitive:"сентября",prepositional:"сентябре"},Октябрь:{num:10,genitive:"октября",prepositional:"октябре"},Ноябрь:{num:11,genitive:"ноября",prepositional:"ноябре"},Декабрь:{num:12,genitive:"декабря",prepositional:"декабре"}},b=[{limit:24e5,rate:.13},{limit:5e6,rate:.15},{limit:2e7,rate:.18},{limit:5e7,rate:.2},{limit:1/0,rate:.22}];b[0].limit,b[0].rate;let j=b[0].rate,N=(0,s.g)("tax-calculator-form-bonus","sc"),w=Object.freeze({taxCalculatorFormBonus:N,removeButton:`${N}__remove-button`}),I=({bonus:e,index:t,selectedMonths:a,onRemove:i,onUpdate:n})=>{let r=p({defaultValue:()=>e.value,type:"int",maxLength:20,unit:"₽",format:"currency"});return(0,l.jsxs)("div",{className:w.taxCalculatorFormBonus,children:[(0,l.jsx)(o.MA,{size:"m",label:"Сумма до налогов",value:r.isFocused?r.value:r.formattedValue,variant:"secondary",...r.events,onChange:a=>{r.events.onChange(a),n(t,{...e,value:a})}}),(0,l.jsx)(o.Ph,{options:Object.keys(f).filter(t=>!a.includes(t)||t===e.month),variant:"secondary",label:"Месяц",value:e.month,onChange:a=>n(t,{...e,month:a})}),(0,l.jsx)(o.zx,{onClick:()=>i(t),label:"Удалить",appearance:"ghost",variant:"purple",size:"xs",className:w.removeButton})]})},y=(0,s.g)("tax-calculator-form","sc"),D=Object.freeze({taxCalculatorForm:y,fullPage:`${y}--full-page`,wrapper:`${y}__wrapper`,title:`${y}__title`,subtitle:`${y}__subtitle`,fields:`${y}__fields`,bonusToggle:`${y}__bonus-toggle`,addBonusButton:`${y}__add-bonus-button`,iconPlus:`${y}__icon-plus`,tooltip:`${y}__tooltip`}),R=({salary:e,bonuses:t,setBonuses:a,isFullPage:r})=>{let[s,c]=(0,n.useState)(!1),d=t.map(e=>e.month),p=()=>{var e;let a=t.map(e=>f[e.month].num).sort((e,t)=>e-t),l=Object.keys(f).map(e=>({monthName:e,monthIndex:f[e].num})).sort((e,t)=>e.monthIndex-t.monthIndex),i=a[a.length-1],n=l.find(({monthIndex:e})=>e>i&&!a.includes(e));return n?n.monthName:(null==(e=l.find(({monthIndex:e})=>!a.includes(e)))?void 0:e.monthName)??null},m=e=>{a(t=>{let a=t.filter((t,a)=>a!==e);return a.length||c(!1),a})},_=(e,t)=>{a(a=>a.map((a,l)=>l===e?t:a))};return(0,l.jsx)("div",{className:(0,i.Z)(D.taxCalculatorForm,r&&D.fullPage),children:(0,l.jsxs)("div",{className:D.wrapper,children:[(0,l.jsx)(r?"h1":"p",{className:D.title,children:"Калькулятор НДФЛ"}),(0,l.jsx)("p",{className:D.subtitle,children:"Сервис поможет рассчитать новый размер НДФЛ по прогрессивной шкале"}),(0,l.jsxs)("div",{className:D.fields,children:[(0,l.jsx)(o.MA,{size:"m",label:"Оклад до налогов",value:e.isFocused?e.value:e.formattedValue,icon:(0,l.jsx)(o.u,{text:"Указывается сумма заработной платы до удержания налогов",position:"top",children:(0,l.jsx)(h,{className:D.tooltip})}),...e.events}),(0,l.jsx)(o.ZD,{label:"Получаю премию",value:s,onChange:()=>{if(c(e=>!e),s)a([]);else{let e=p();e&&a([{value:"100000",month:e}])}},className:D.bonusToggle,flipped:!0}),s&&(0,l.jsxs)("div",{children:[t.map((e,t)=>(0,l.jsx)(I,{bonus:e,index:t,selectedMonths:d,onRemove:m,onUpdate:_},e.month)),(0,l.jsx)(o.zx,{onClick:()=>{let e=p();e&&a(t=>[...t,{value:"100000",month:e}])},disabled:null===p(),className:D.addBonusButton,label:"Добавить еще премию",iconLeft:(0,l.jsx)(u.IconFdsPlusO,{}),appearance:"ghost",variant:"purple",size:"xs"})]})]})]})})},C=e=>{let t=Object.entries(f).find(([t,a])=>a.num===e);return t?t[0]:""},$=(e,t)=>{let a=0,l=0,i=t,n=`${100*t}%`;for(let r of b){if(e<=a)break;let o=Math.min(e-a,r.limit-a);l+=o*r.rate,a=r.limit,(i=r.rate)>t&&(n=`${100*t}%—${100*i}%`)}return{tax:l,currentRate:i,rateString:n}},k=e=>{let t=[],a=null,l=null;for(let i of e){let e=i.bonusAmount>0;a&&a.taxRate===i.taxRate&&l===e?a.endMonth=i.endMonth:(a&&t.push(a),a={...i},l=e)}return a&&t.push(a),t},M=e=>{let t=[],a=[],l=null;for(let i of e)l===i.taxRate?a.push(i):(a.length>0&&t.push(...k(a)),a=[i],l=i.taxRate);return a.length>0&&t.push(...k(a)),t},P=(e,t)=>{let a=0,l=0,i=b[0].rate,n={};t.forEach(({month:e,value:t})=>{n[f[e].num]=Math.round(Number(t))});let r=[];for(let t=f.Январь.num;t<=f.Декабрь.num;t++){let o=n[t]||0,s=e+o;a+=s;let{tax:u,currentRate:c,rateString:d}=$(a,i),p=Math.round(u-l);l=u;let m=Math.round(e/s*p),_=p-m;o>0&&(_=p-(m=Math.min(m,Math.round(e*i))));let v=e-m,h=o-_;r.push({startMonth:C(t),endMonth:C(t),income:v,taxRate:d,tax:p,bonusAmount:h}),i=c}let o=M(r),s=Math.round(a*j),u=Math.round(l-s);return{taxFixed:s,taxProgressive:Math.round(l),taxDiff:u,monthlyTaxGroups:o}},F=e=>new Intl.NumberFormat("ru-RU").format(e),L=({size:e=24})=>(0,l.jsx)("span",{style:{fontFamily:"var(--font-family-primary)",fontSize:`${e}px`},children:"₽"}),S=(0,s.g)("tax-calculator-result-head","sc"),z=Object.freeze({taxCalculatorResultHead:S,title:`${S}__title`,titleTaxAmount:`${S}__title--tax-amount`,subtitle:`${S}__subtitle`}),T=({data:e})=>{let{taxFixed:t,taxProgressive:a,taxDiff:i}=e,n=new Date().getFullYear(),r="Сумма НДФЛ не изменится",o=F(t),s=(0,l.jsxs)(l.Fragment,{children:["Ставка НДФЛ в ",n," году останется прежней — 13%"]});return 0!==i&&(r="Доход станет меньше",o=`на ${F(i)}`,s=(0,l.jsxs)(l.Fragment,{children:["В ",n," году на уплату НДФЛ уйдет ",F(a)," ",(0,l.jsx)(L,{size:18}),", а в 2024 году — ",F(t)," ",(0,l.jsx)(L,{size:18})," при той же зарплате."]})),(0,l.jsxs)("div",{className:z.taxCalculatorResultHead,children:[(0,l.jsxs)("p",{className:z.title,children:[r,(0,l.jsx)("br",{}),(0,l.jsx)("span",{className:z.titleTaxAmount,children:o})," ",(0,l.jsx)(L,{size:24}),0!==i&&"/год"]}),(0,l.jsx)("p",{className:z.subtitle,children:s})]})},B=(0,s.g)("tax-calculator-result","sc"),W=Object.freeze({taxCalculatorResult:B,taxCalculatorResultFullPage:`${B}--full-page`,title:`${B}__title`,titleTaxAmount:`${B}__title--tax-amount`,subtitle:`${B}__subtitle`,tableWrapper:`${B}__table-wrapper`,tableTitle:`${B}__table-title`,tableBody:`${B}__table-body`,tableBlock:`${B}__table-block`,tableRow:`${B}__table-row`,tableRowDottedLine:`${B}__table-row--dotted-line`,tableRowRowValue:`${B}__table-row--row-value`,tableRowFinalValue:`${B}__table-row--final-value`,tableRowRed:`${B}__table-row--red`,ndflRow:`${B}__ndfl-row`,tooltipIcon:`${B}__tooltip-icon`}),A=({taxData:e,isFullPage:t})=>{let{taxDiff:a,monthlyTaxGroups:n,taxProgressive:r}=e;return(0,l.jsxs)("div",{className:(0,i.W)(W.taxCalculatorResult,{[W.taxCalculatorResultFullPage]:t}),children:[(0,l.jsx)(T,{data:e}),(0,l.jsx)("div",{children:0!==a&&(0,l.jsxs)("div",{className:W.tableWrapper,children:[(0,l.jsxs)("p",{className:W.tableTitle,children:["Получите доход в ",new Date().getFullYear()," году "]}),(0,l.jsxs)("div",{className:W.tableBody,children:[n.map(e=>{let t=f[e.startMonth],a=e.endMonth.toLowerCase(),n=e.startMonth===e.endMonth?`В ${t.prepositional}`:`С ${t.genitive} по ${a}`;return(0,l.jsxs)("div",{className:W.tableBlock,children:[(0,l.jsxs)("div",{className:W.tableRow,children:[(0,l.jsx)("p",{children:n}),(0,l.jsx)("div",{className:W.tableRowDottedLine}),(0,l.jsxs)("p",{className:(0,i.W)(W.tableRowRowValue,{[W.tableRowRed]:"13%"!==e.taxRate}),children:[F(e.income)," ",(0,l.jsx)(L,{size:18})]})]}),e.bonusAmount>0&&(0,l.jsxs)("div",{className:W.tableRow,children:[(0,l.jsx)("p",{children:"Премия"}),(0,l.jsx)("div",{className:W.tableRowDottedLine}),(0,l.jsxs)("div",{className:W.tableRowRowValue,children:[F(e.bonusAmount)," ",(0,l.jsx)(L,{size:18})]})]}),(0,l.jsxs)("div",{className:W.tableRow,children:[(0,l.jsxs)("div",{className:W.ndflRow,children:["НДФЛ ",e.taxRate,e.taxRate.includes("—")&&(0,l.jsx)(o.u,{text:"Повышенная ставка применяется не ко всему доходу, а только к превышению над пороговым значением",position:"top",children:(0,l.jsx)("span",{className:W.tooltipIcon,children:(0,l.jsx)(h,{})})})]}),(0,l.jsx)("div",{className:W.tableRowDottedLine}),(0,l.jsxs)("p",{className:W.tableRowRowValue,children:[F(e.tax)," ",(0,l.jsx)(L,{size:18})]})]})]},a)}),(0,l.jsxs)("div",{className:W.tableRow,children:[(0,l.jsx)("p",{className:W.tableRowRowValue,children:"Итого НДФЛ"}),(0,l.jsx)("div",{className:W.tableRowDottedLine}),(0,l.jsxs)("p",{className:(0,i.W)(W.tableRowRowValue,W.tableRowFinalValue),children:[F(r)," ",(0,l.jsx)(L,{size:18})]})]})]})]})})]})},E=({className:e,isFullPage:t,bannerButtonUrl:a,assets:r})=>{let o=p({defaultValue:()=>"100000",type:"int",maxLength:20,unit:"₽",format:"currency"}),[s,u]=(0,n.useState)([]),c=P(Number(o.value),s);return(0,l.jsx)("div",{className:(0,i.Z)(x.taxCalculator,t?x.fullPage:x.widget,e),children:(0,l.jsxs)("div",{className:x.wrapper,children:[(0,l.jsxs)("div",{className:x.row,children:[(0,l.jsx)(R,{salary:o,bonuses:s,setBonuses:u,isFullPage:t}),(0,l.jsx)(A,{taxData:c,isFullPage:t})]}),(0,l.jsx)(v,{buttonUrl:a,isFullPage:t,assets:r})]})})}}}]);