(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[434],{59457:function(e,t,l){"use strict";var n,a,i=l(67294);function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)({}).hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e}).apply(null,arguments)}t.Z=function(e){return i.createElement("svg",o({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none"},e),n||(n=i.createElement("defs",null,i.createElement("clipPath",{id:"a"},i.createElement("path",{fill:"#fff",fillOpacity:0,d:"M0 0h16v16H0z"})))),a||(a=i.createElement("g",{clipPath:"url(#a)"},i.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M8.115 5.333a2.001 2.001 0 0 0 3.772 0h2.114a.667.667 0 0 0 0-1.333h-2.114a2.001 2.001 0 0 0-3.772 0H2a.667.667 0 0 0 0 1.333zm1.886 0a.667.667 0 1 0 0-1.333.667.667 0 0 0 0 1.333m-4 4a2 2 0 0 0-1.886 1.333H2A.667.667 0 0 0 2 12h2.114a2.001 2.001 0 0 0 3.772 0H14a.667.667 0 1 0 0-1.334H7.887a2 2 0 0 0-1.886-1.333m0 1.333a.667.667 0 1 0 0 1.334.667.667 0 0 0 0-1.334",clipRule:"evenodd"}))))}},9677:function(e,t,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/avtokredity/[[...segments]]",function(){return l(78696)}])},94781:function(e,t){"use strict";t.Z={src:"/kredity/assets/_next/static/media/banner-2.9368ea40.svg",height:218,width:318,blurWidth:0,blurHeight:0}},93842:function(e,t){"use strict";t.Z={src:"/kredity/assets/_next/static/media/banner-4.fc5b15be.svg",height:222,width:324,blurWidth:0,blurHeight:0}},48766:function(e,t,l){"use strict";l.d(t,{B:function(){return n}});let n=e=>{let t=Number(e.split(" ")[0]);return e&&!Number.isNaN(t)?t:0}},58484:function(e,t,l){"use strict";l.d(t,{V:function(){return p}});var n=l(85893),a=l(53980),i=l(86010),o=l(67294),r=l(65737),s=l(21308),u=l(94347),c=l(83226),d=l.n(c);let p=(0,o.memo)(e=>{let{region:t,town:l,subtitle:o,title:c,mainPageUrl:p}=e,{town:v,region:m}=(0,u.T)(),{handleToggleModal:_}=(0,a.ar)(),h=e=>{(0,r.l)({event:"data-event",eventAction:e,eventCategory:p})};return(0,n.jsxs)("div",{className:(0,i.Z)(d().titleWrapper,d().newTitle),children:[(0,n.jsxs)("h1",{className:d().title,children:[c," ",((null==v?void 0:v.name_p)||(null==l?void 0:l.name_p)||(null==m?void 0:m.name_p)||(null==t?void 0:t.name_p))&&(0,n.jsxs)(n.Fragment,{children:["в"," ",(0,n.jsx)("button",{onClick:()=>{_(!0),h("show_pop_up_city_modal")},className:d().link,children:(null==v?void 0:v.name_p)||(null==l?void 0:l.name_p)||(null==m?void 0:m.name_p)||(null==t?void 0:t.name_p)})]})]}),(0,n.jsx)(s.N,{tag:"p",className:d().subtitle,children:o})]})});p.displayName="RegionTitle"},37771:function(e,t,l){"use strict";l.d(t,{$m:function(){return d},F$:function(){return u},Ht:function(){return r},N2:function(){return p},QN:function(){return s},Z3:function(){return c},eT:function(){return i},oA:function(){return a},vw:function(){return o}});var n=l(73897);let a={amount:"amount",firstPayment:"first_payment",period:"period",loan:"loan",incomeProof:"income_proof",insuranceNeed:"insurance_need",vehicleState:"vehicle_state",vehicleType:"vehicle_type",stateCoFinancing:"state_co_financing",bank:"bank",order:"order",sort:"sort",page:"page",payment:"payment",borrower:"borrower"},i=[{value:"not_required",label:"Не требуется"},{value:"ndfl",label:"Справка 2-НДФЛ"},{value:"bank_form",label:"Справка по форме банка"},{value:"custom_form",label:"Альтернативные формы"}];n.u.AUTOCREDIT;let o=[{value:0,label:"Не имеет значения"},{value:1,label:"1 месяц"},{value:2,label:"2 месяца"},{value:3,label:"3 месяца"},{value:4,label:"4 месяца"},{value:5,label:"5 месяцев"},{value:6,label:"6 месяцев"},{value:9,label:"9 месяцев"},{value:12,label:"1 год"},{value:18,label:"1,5 года"},{value:24,label:"2 года"},{value:36,label:"3 года"},{value:48,label:"4 года"},{value:60,label:"5 лет"}],r=[{value:"moto",label:"Мототранспорт"},{value:"car",label:"Легковое транспорт",labelShort:"Легковое ТС"},{value:"track",label:"Грузовое транспорт",labelShort:"Грузовое ТС"},{value:"commercial",label:"Коммерческое транспорт",labelShort:"Коммерческое ТС"},{value:"water",label:"Водное транспорт",labelShort:"Водное ТС"},{value:"custom",label:"Другое"}],s=[{value:"foreign_new",label:"Иномарка с завода"},{value:"foreign_old",label:"Иномарка с пробегом"},{value:"domestic_new",label:"Отечественная с завода"},{value:"domestic_old",label:"Отечественная с пробегом"}],u=[{value:"employee_for_hire",label:"Работник по найму"},{value:"soldier",label:"Военнослужащий"},{value:"pensioner",label:"Пенсионер"},{value:"individual_entrepreneur",label:"Индивидуальный предприниматель"},{value:"civil_servant",label:"Госслужащий"},{value:"student",label:"Студент"},{value:"budgetary",label:"Бюджетник"},{value:"personal_farm_owner",label:"Владелец личного подсобного хозяйства"},{value:"nothing",label:"Иное"}],c=[{value:"not_required",label:"Не требуется"},{value:"pledge",label:"Залог"},{value:"guarantee",label:"Поручительство"},{value:"full",label:"Залог и поручительство"}],d=[{label:"По ставке",value:"rate"},{label:"По первому взносу",value:"firstPayment"}],p="Указали больше чем запрашиваете кредитных денег"},77624:function(e,t,l){"use strict";l.d(t,{n:function(){return n}});let n=(e,t)=>{var l;let n=null!==(l=null==t?void 0:t.map(e=>+e))&&void 0!==l?l:[];return[...e].sort((e,t)=>{let l=n.includes(Number(e.id)),a=n.includes(Number(t.id));return!l&&a?1:l&&!a?-1:0}).map(e=>({value:e.id,label:e.name}))}},37220:function(e,t,l){"use strict";l.d(t,{z:function(){return n}});let n=(e,t)=>(t>0&&!Number.isInteger(e)&&!Number.isNaN(e)&&String(e).split(".")[1].length>t&&(e=+e.toFixed(t)),e)},30292:function(e,t,l){"use strict";l.d(t,{G:function(){return i},b:function(){return a}});var n=l(67294);let a=(e,t,l)=>{(0,n.useEffect)(()=>{let t=setTimeout(()=>{e()},l);return()=>{clearTimeout(t)}},t)},i=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,[a,i]=(0,n.useState)(l),[o,r]=(0,n.useState)(!1),[s,u]=(0,n.useState)(null);return(0,n.useEffect)(()=>{r(!0),e().then(i).catch(u).then(()=>{r(!1)})},t),[a,o,s]}},78696:function(e,t,l){"use strict";l.r(t),l.d(t,{__N_SSP:function(){return ll},default:function(){return ln}});var n,a,i=l(85893),o=l(53980),r=l(67294),s=l(34588),u=l(25675),c=l.n(u),d=l(41664),p=l.n(d),v=l(44895),m=l(73172),_=l(77868),h=l(84444),g=l(19438),b=l(54663),f=l(72335),x=l(20070),C=l(26576);let y=[{id:1,label:"Условия",name:C.cQ.conditions},{id:2,label:"Требования к заемщику",name:C.cQ.requirements},{id:3,label:"Требование к ТС",name:C.cQ.requirementsVehicles},{id:4,label:"Погашение",name:C.cQ.redemption}];var T=l(44727);let A=e=>{let{data:t}=e,l=(0,r.useMemo)(()=>(0,x.m8)(t),[t]),n=(0,r.useMemo)(()=>y.filter(e=>l[e.name].some(e=>(0,T.B)(e.value))),[l]);return{tabsContent:l,tabsList:n}},N=(0,r.memo)(e=>{var t,l;let{data:n,bank:a,offerType:o,pageUrl:r}=e,{tabsContent:s,tabsList:u}=A({data:n});return(0,i.jsx)(f.z,{scrollBlockId:b.q6,pageUrl:r,seoText:(null==n?void 0:n.short_description)&&(null==n?void 0:n.short_description.length)>5?null==n?void 0:n.short_description:void 0,title:"Об автокредите",offerType:o,offerUpdateData:null==n?void 0:n.m_updated_at,bank:{logoMobile:null==a?void 0:a.logo_mob,description:null==a?void 0:a.short_description,url:"/banki/".concat(null==a?void 0:a.url),name:null==a?void 0:a.name,creditRating:null==a?void 0:a.credit_rating,netAssetsPlace:null==a?void 0:null===(t=a.ratings)||void 0===t?void 0:t.net_assets_place,netProfitRating:null==a?void 0:a.net_profit_rating},tabsList:u,tabsContent:s,aboutCompanyLabel:"О банке",site:null!==(l=null==a?void 0:a.site.title)&&void 0!==l?l:void 0})});N.displayName="AutoCreditAbout";var j=l(17722),k=l(94781),S=l(93842),w=l(64062),R=l(54636),L=l(73897),F=l(5753),M=l.n(F);let D=e=>{let{url:t,offerType:l,isMobile:n,className:a}=e,o=(0,r.useMemo)(()=>[{id:3,image:S.Z,text:"Перейдите на сайт банка,<br /> чтобы оформить заявку",types:[R.A.LEAD],buttonText:"Оформить на сайте банка",link:t},{id:4,image:j.Z,text:R.A.LEAD?"Этот кредит нельзя открыть через Финуслуги":"Этот автокредит сейчас нельзя открыть онлайн на Финуслугах",types:[R.A.LEAD,R.A.MASS],buttonText:"Выбрать другой автокредит",link:"/avtokredity"},{id:5,image:k.Z,text:"Чтобы оформить автокредит, обратитесь в банк",types:[R.A.MASS]}].filter(e=>e.types.find(e=>e===l)),[t,l]);return(0,i.jsx)("div",{className:M().container,children:(0,i.jsx)(w.B,{className:a,title:"Где оформить автокредит",pageUrl:L.u.AUTOCREDIT,id:b.VT,isMobile:n,slides:o})})};var I=l(86010),E=l(77019),U=l(24443),O=l(20760),P=l(48766),B=l(26024),H=l(90999),Z=l(72798),V=l(17950),W=l(41262),q=l(66566),Q=l(39918),z=l(37220),J=l(94466),G=l(93478),X=l(21172),K=l.n(X);let Y="Оформить на сайте банка",$="Где оформить автокредит",ee=e=>{var t,l,n,a;let{offerType:o,bank:u,data:c,isMobile:d,calculator:p}=e,[v,m]=(0,r.useState)(!1),_=(0,r.useRef)(null),h=(0,r.useMemo)(()=>{let{domestic_new:e,domestic_old:t,foreign_new:l,foreign_old:n}=c.vehicle_state;return!e&&!t&&l&&n?"Иномарка любая":e||t||!l||n?e||t||l||!n?e&&t&&!l&&!n?"Отечественная любая":e||!t||l||n?!e||t||l||n?e&&!t&&l&&!n?"Любое новое":!e&&t&&!l&&n?"Любое б/у":"Любое":"Отечественная новая":"Отечественная б/у":"Иномарка б/у":"Иномарка новая"},[c.vehicle_state]),f=(0,r.useCallback)(()=>{_.current&&_.current.focus()},[]),x=(0,r.useCallback)(()=>{p.amount.events.onFocus(),m(!0)},[p.amount.events]),C=(0,r.useCallback)(e=>{e&&((0,Q.D)({eventCategory:L.u.AUTOCREDIT,eventAction:Q.i.filterCatalog,eventLabel:"Платеж",eventValue:e.label}),p.setPaymentTypeValue(e.value))},[p]),y=(0,W.S_)(p.period),T=(0,r.useMemo)(()=>({values:[p.period],max:p.periodMax,min:p.periodMin===p.periodMax?p.periodMin-1:p.periodMin,onChange:e=>{p.periodMin!==p.periodMax&&p.setPeriod(e[0])},step:1,legend:[p.periodMin,p.periodMax],formatValue:e=>(0,i.jsx)("span",{className:K().legend,children:(0,W.S_)(e)})}),[p]),A=(0,r.useMemo)(()=>p.paymentTypeOptions.filter(e=>e.value===p.paymentTypeValue),[p.paymentTypeOptions,p.paymentTypeValue]),N=(0,r.useMemo)(()=>[{id:1,label:(0,W.S_)(p.period)},{id:2,label:"".concat((0,J.uf)(+p.amount.value)," ₽")}],[p.amount.value,p.period]),j=(0,r.useMemo)(()=>{var e;let t=(null===(e=c.application_term.custom_text)||void 0===e?void 0:e.from)!==void 0?(0,P.B)(c.application_term.custom_text.from):0,l=new Date;l.setDate(l.getDate()+t);let n=l.getDate(),a=l.getMonth()+1,i=l.getFullYear();return"Деньги у вас до ".concat(n," ").concat((0,q.$)("".concat(a,"-").concat(n,"-").concat(i)))},[null===(t=c.application_term.custom_text)||void 0===t?void 0:t.from]),k=Number(p.amount.value),S=(0,r.useMemo)(()=>{let e=Number(p.firstPayment.value),t=p.period,l=c.vehicle_type.text,n=p.paymentTypeValue,a=[],o=Number(e)/(Number(k)/100);Number.isInteger(o)||(o=Number(o.toFixed(5)));let r=k?(0,z.z)(o,1):0;a.push({label:"Первый взнос",value:"".concat(r,"%").replace(".",",")}),a.push({label:"Срок погашения",value:(0,W.S_)(t)});let s=c.full_price;if(s){let e=c.interest_rate;a.push({label:"ПСК",value:(0,E.W)(s),description:"ПСК (полная стоимость кредита) — это процентная ставка, отражающая все ваши затраты по кредиту за год. ПСК включает не только проценты, но и сопутствующие платежи.\n    Информация на сайте носит справочный характер. Указанные значения ПСК получены из открытых источников. Актуальная и точная информация будет содержаться в вашем кредитном договоре."},{label:"Процентная ставка",value:(0,J.sz)(Number(e.from),Number(e.to))})}return a.push({label:"Тип&#160;ТС",value:l},{label:"Состояние&#160;ТС",value:h,description:"Некоторые банки указывают, что получить кредит можно только на новый автомобиль, а для других это не принципиально."}),n&&a.push({label:"Тип платежа",value:n===V.T.annuity?"Аннуитетный":"Дифференцированный",description:(0,i.jsx)("div",{className:K().tooltipContent,children:(0,i.jsx)(B.a,{type:n})})}),a},[p.firstPayment.value,p.period,p.paymentTypeValue,c.vehicle_type.text,c.full_price,c.interest_rate,h,k]);return(0,i.jsxs)(g.t,{className:(0,I.Z)(K().container,K().containerFull),children:[(0,i.jsx)(H.F,{url:c.url,bank:{logoMob:null==u?void 0:u.logo_mob,url:"/banki/".concat(null==u?void 0:u.url),name:null!==(n=null==u?void 0:u.name)&&void 0!==n?n:c.bank_name},pageUrl:L.u.AUTOCREDIT,title:"Автокредит \xab".concat(c.title,"\xbb от ").concat(null!==(a=null==u?void 0:u.name)&&void 0!==a?a:c.bank_name),isSmall:l,isMobile:d,tagTheme:"red",className:K().promo}),(0,i.jsxs)("div",{className:K().left,children:[(0,i.jsx)(U.y,{isMobile:d,title:"Настройка автокредита",pageUrl:L.u.AUTOCREDIT,infoLink:{isShow:!d,text:"Подробнее об автокредите",idScrollBlock:b.q6,offPadding:!0,widthMaxContent:!0},items:[{elements:[{type:"input",props:{label:"Сумма",value:p.amount.isFocused?p.amount.value:p.amount.formattedValue,...p.amount.events,onFocus:x}}]},{elements:[{type:"input",props:{label:"Первый взнос",value:p.firstPayment.isFocused?p.firstPayment.value:p.firstPayment.formattedValue,...p.firstPayment.events}}]},{elements:[{type:"inputRange",props:{label:"Срок погашения",rangeProps:T,value:y}}]},{elements:[{type:"select",isHidden:!p.paymentTypeValue||p.paymentTypeOptions.length<=1,desription:p.paymentTypeValue&&(0,i.jsx)(B.a,{className:K().typeDescription,type:p.paymentTypeValue}),props:{label:"Платеж",options:p.paymentTypeOptions,onChange:C,value:A}}]}],chips:N,isShowChips:d&&!!(null==N?void 0:N.length)&&!v,isExpandSettings:v,onToggleSettings:()=>m(e=>!e)}),(0,i.jsx)(Z.S,{isSmall:!0,className:K().qrDesc})]}),(0,i.jsxs)("div",{className:K().right,children:[(0,i.jsx)(O.y,{captionTitle:j,pageUrl:L.u.AUTOCREDIT,onEdit:f,amount:Number(p.amount.value),disclaimer:"Предварительные условия. Не оферта",tag:c.online_application.commercial_desc,footerActions:(0,i.jsxs)(i.Fragment,{children:[o===R.A.LEAD&&(0,i.jsx)(s.zx,{as:"a",onClick:()=>{(0,Q.D)({eventCategory:L.u.AUTOCREDIT,eventAction:Q.i.link,eventActionText:Y,eventLabel:c.id})},href:c.online_application.url,target:"_blank",className:K().button,children:Y}),(0,i.jsx)(s.zx,{onClick:()=>{(0,Q.D)({eventCategory:L.u.AUTOCREDIT,eventAction:Q.i.button,eventActionText:$}),(0,G.l)(b.VT,{offset:d?0:-100,position:"top"})},className:K().button,variant:"secondary",children:$})]}),valuesList:S}),(0,i.jsx)(Z.S,{isSmall:!0,className:K().qrMobile})]})]})};var et=l(65737),el=l(40741),en=l(77259),ea=l(73654),ei=l.n(ea);let eo=(0,r.memo)(e=>{var t,l;let{data:n,detailData:a,className:o,onDetailInfoClick:s,onClick:u}=e,d=[],p=(0,r.useRef)(null),v=(0,r.useRef)(!1),m=(0,r.useRef)(null),_={text:"",caption:""},[h,g]=(null==a?void 0:null===(t=a.data)||void 0===t?void 0:t.online_application.commercial)===1?["Оформить",a.data.online_application.url]:["Подробнее",n.url],b=null==a?void 0:null===(l=a.data)||void 0===l?void 0:l.full_price;b&&(_.caption="ПСК",_.text=(0,E.W)(b),_.tooltipText="ПСК (полная стоимость кредита) — это процентная ставка, отражающая все ваши затраты по кредиту за год. ПСК включает не только проценты, но и сопутствующие платежи.\n        Информация на сайте носит справочный характер. Указанные значения ПСК получены из открытых источников. Актуальная и точная информация будет содержаться в вашем кредитном договоре.");let f={text:(0,J.dN)({from:n.amountFrom,to:n.amountTo}),caption:"Сумма"},x={text:"от ".concat((0,J.uf)(n.payment),"%"),caption:"Первый взнос"};d.push({label:"Заявка через сайт банка",variant:"primary"}),n.isKascko&&d.push({label:"Потребуется каско",variant:"primary"}),n.isPermanentRegistation&&d.push({label:"Постоянная регистрация",variant:"primary"});let C=e=>{(0,et.l)({event:"data-event",eventAction:e,eventCategory:L.u.AUTOCREDIT,eventLabel:n.id,eventValue:n.eventValue}),null==u||u(n)},y=(0,r.useCallback)(e=>{let[t]=e;1===t.intersectionRatio&&!v.current&&((0,et.l)({event:"data-event",eventAction:"show_in_catalog",eventCategory:L.u.AUTOCREDIT,eventLabel:n.id}),v.current=!0,p.current&&m.current&&p.current.unobserve(m.current))},[n.id]);return(0,r.useEffect)(()=>{p.current&&m.current&&p.current.unobserve(m.current),!v.current&&m.current&&(p.current=new IntersectionObserver(y,{root:null,threshold:[1]}),p.current.observe(m.current))},[y]),(0,i.jsx)("div",{ref:m,className:o,onClick:()=>C("click_button_".concat((0,el.b)("Подать заявку"))),children:(0,i.jsx)(en.J,{icon:n.logo?(0,i.jsx)("div",{className:ei().logo,children:(0,i.jsx)(c(),{width:56,height:56,src:n.logo,alt:"logo"})}):(0,i.jsx)("div",{className:ei().placeholderLogo}),companyName:n.bankName,productName:n.title,productUrl:n.url,buttonText:h,buttonUrl:g,tags:d,advantageAmountFrom:_,advantageAmountTo:x,advantageBonus:f,onDetailInfoClick:()=>{s(n),(0,Q.D)({eventCategory:L.u.AUTOCREDIT,eventAction:Q.i.button,eventActionText:"open_modal"})},className:ei().plate})})});eo.displayName="AutoCreditListItem";var er=l(13442),es=l(84135),eu=l(89504),ec=l(32244);let ed=e=>(null==e?void 0:e.online_application.commercial)===1?R.A.LEAD:R.A.MASS,ep=e=>{var t,l,n,a,i,o;let{banks:r,autoCredit:s,period:u}=e,c="/".concat(L.u.AUTOCREDIT,"/").concat(s.url),d="",p="",v=r.find(e=>+s.bank_id==+e.id);return 1===s.online_application.commercial&&3!==s.online_application.type&&(d="Подача заявки на сайте банка",p="non_commercial"),3===s.online_application.type?(d="Открытие онлайн на Финуслугах",p="platform"):1!==s.online_application.commercial&&3!==s.online_application.type&&(d="Открытие в банке"),{id:s.id,bankName:null!==(l=null==v?void 0:v.name)&&void 0!==l?l:s.bank_name,bankId:null!==(n=null==v?void 0:v.id)&&void 0!==n?n:"",isCard:!1,logo:null!==(a=null==v?void 0:v.logo_mob)&&void 0!==a?a:"",title:s.title,url:c,legalName:(e=>{if(e)try{let t=JSON.parse(e);if(Array.isArray(t))return t[0].name;return t.name}catch(t){return e}return""})("string"==typeof(null==v?void 0:v.legal_entities)?JSON.parse(null==v?void 0:v.legal_entities)[0].name:null==v?void 0:null===(t=v.legal_entities)||void 0===t?void 0:t[0].name),isKascko:1==+s.insurance_need.need,isPermanentRegistation:1==+s.registration_address.permanent,period:u||+s.period.to,rate:+s.interest_rate.from,rateTo:+s.interest_rate.to,payment:+s.first_payment.from||0,currency:"₽",detailUrl:"/".concat(L.u.AUTOCREDIT,"/").concat(s.url),notLoan:1===s.loan.not_required,incomeProof:0===s.income_proof.not_required,typeText:d,eventValue:p,serviceTooltip:null,amountFrom:Number(s.amount.from),amountTo:Number(s.amount.to),type:ed(s),site:{title:null!==(i=null==v?void 0:v.site.title)&&void 0!==i?i:null,url:null!==(o=null==v?void 0:v.site.url)&&void 0!==o?o:null}}};var ev=l(84053),em=l(94347),e_=l(5569),eh=l.n(e_);let eg=(0,r.memo)(e=>{let{bank:t,banks:l,currentCardId:n,autocredits:a,autocreditsFinuslugi:o,className:s}=e,{town:u}=(0,em.T)(),[c,d]=(0,r.useState)(),[p,v]=(0,r.useState)(null),m=(0,r.useCallback)(()=>{d(void 0)},[]),_=(0,r.useCallback)(e=>{(0,Q.D)({eventCategory:L.u.AUTOCREDIT,eventAction:Q.i.link,eventActionText:e.title,eventLabel:e.id,url:e.url})},[]),h=(0,r.useMemo)(()=>{let e=a?a.filter(e=>e.id!==n):[];return(0,ec.$)({productList:e,anotherList:e,count:eu.NU})},[a,n]),b=(0,r.useMemo)(()=>{let e=o||[];return(0,ec.$)({productList:e,anotherList:e,count:eu.wo-h.length})},[h.length,o]),f=(0,r.useMemo)(()=>({bankList:h.map(e=>ep({banks:[t],autoCredit:e})),finuslugiList:b.map(e=>ep({banks:l,autoCredit:e}))}),[t,l,h,b]),x=(0,r.useCallback)(e=>{if(!e)return;let t=[h,b].reduce((e,t)=>[...e,...t],[]).find(t=>t.id===e.id);if(t){var l,n;return{...t,site:{...e.site},bankName:e.bankName,detailUrl:null!==(l=e.detailUrl)&&void 0!==l?l:"",logo:e.logo,url:null!==(n=e.url)&&void 0!==n?n:""}}},[h,b]),C=(0,r.useCallback)(e=>{var t;d(x(e)),v(null!==(t=null==e?void 0:e.type)&&void 0!==t?t:null),e&&(0,Q.D)({eventCategory:L.u.AUTOCREDIT,eventAction:Q.i.popup,eventActionText:e.title,eventLabel:e.id})},[x]),y="".concat((0,ev.ZR)().mainBaseUrl,"/banki/").concat(t.url,"/avtokredity").concat((null==u?void 0:u.url.length)?"/reg_"+u.url:"");return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("section",{className:(0,I.Z)(eh().container,s),children:[(0,i.jsx)("h3",{className:eh().title,children:"Другие автокредиты"}),(0,i.jsxs)(g.t,{children:[!!f.bankList.length&&(0,i.jsxs)("section",{className:eh().offersListContainer,children:[(0,i.jsxs)("p",{className:eh().listTitle,children:["Автокредиты от ",t.name]}),f.bankList.map(e=>(0,i.jsx)(eo,{onDetailInfoClick:C,className:eh().listItem,data:e,onClick:_,text:"Подать заявку",detailData:{data:x(e),mainPageUrl:L.u.AUTOCREDIT}},e.url)),(0,i.jsx)(er.j,{offPadding:!0,text:"Bсе предложения от банка",href:y,target:"_blank",iconColor:"light",mainPageUrl:L.u.AUTOCREDIT})]}),!!f.finuslugiList.length&&(0,i.jsxs)("section",{className:eh().offersListContainer,children:[(0,i.jsx)("p",{className:eh().listTitle,children:"Автокредиты на Финуслугах"}),f.finuslugiList.map(e=>(0,i.jsx)(eo,{onDetailInfoClick:C,className:eh().listItem,data:e,onClick:_,text:"Подать заявку",detailData:{data:x(e),mainPageUrl:L.u.AUTOCREDIT}},e.url)),(0,i.jsx)(er.j,{offPadding:!0,text:"Bсе предложения на Финуслугах",href:"/avtokredity",target:"_blank",iconColor:"light",mainPageUrl:L.u.AUTOCREDIT})]})]})]}),(0,i.jsx)(es.h,{data:c,isOpen:!!c,onClose:m,mainPageUrl:L.u.AUTOCREDIT,offerType:p})]})});eg.displayName="AutoCreditsList";var eb=l(11163),ef=l(82080),ex=l(1998);let eC=e=>{var t,l,n,a,i;let{asPath:o}=(0,eb.useRouter)(),s=(0,ex.G)({defaultValue:()=>e.amount.from,format:"currency",type:"int",maxLength:20,unit:"₽"}),u=(0,ex.G)({format:"currency",type:"int",maxLength:20,unit:"₽"}),[c,d]=(0,r.useState)(Number(null!==(l=e.period.to)&&void 0!==l?l:1)),p=Number(null!==(n=e.period.from)&&void 0!==n?n:1),v=Number(null!==(a=e.period.to)&&void 0!==a?a:1),m=(0,r.useMemo)(()=>{let t=[];return e.repayment_procedure.annuity&&t.push({label:"Аннуитетный",value:V.T.annuity}),e.repayment_procedure.differentiated&&t.push({label:"Дифференцированный",value:V.T.differentiated}),t},[e.repayment_procedure]),[_,h]=(0,r.useState)(null!==(i=null===(t=m[0])||void 0===t?void 0:t.value)&&void 0!==i?i:null);return(0,r.useEffect)(()=>{let e=(0,ef.p)(o,"#"),t=Array.isArray(e.amount)?e.amount[0]:e.amount,l=Array.isArray(e.first_payment)?e.first_payment[0]:e.first_payment,n=Number(Array.isArray(e.period)?e.period[0]:e.period);s.handleChange(t),u.handleChange(l),!Number.isNaN(n)&&n>=p&&n<=v&&d(n)},[]),(0,r.useMemo)(()=>({amount:s,firstPayment:u,period:c,setPeriod:d,periodMin:p,periodMax:v,paymentTypeOptions:m,paymentTypeValue:_,setPaymentTypeValue:h}),[s,u,m,_,c,v,p])};var ey=l(54228),eT=l(51469),eA=l(71276),eN=l(44215),ej=l(89519),ek=l(56381),eS=l.n(ek);function ew(e){var t;let{offer:l,posts:n,questions:a,description:o,banks:r,refererTag:u,offers:d,offersFinuslugi:f}=e,x=ed(l),C=(0,ey.S0)(),y=eC(l),{region:T,town:A}=(0,em.T)(),j=r.find(e=>Number(e.id)===l.bank_id),k=(null==a?void 0:a.map(e=>({title:e.title,text:e.text.map(e=>e.data.html).join(""),plainText:e.text.map(e=>(0,m.MK)(e.data.html)).join("").trim()})))||[],S="Автокредит \xab".concat(l.title,"\xbb от ").concat(null!==(t=null==j?void 0:j.name_r)&&void 0!==t?t:"");return(0,i.jsxs)("main",{className:eS().page,children:[(0,i.jsx)(h.N,{productId:String(l.id),title:S,description:null!=o?o:""}),(0,i.jsx)(eA.o,{}),(0,i.jsx)(eT.g,{questions:k}),(0,i.jsx)("div",{className:eS().navigationWrapper,children:(0,i.jsx)(g.t,{children:(0,i.jsx)(s.Oo,{className:eS().breadcrumbs,items:(()=>{var e;let t=(null==A?void 0:A.name_p)||(null==T?void 0:T.name_p)?" в ".concat((null==A?void 0:A.name_p)||(null==T?void 0:T.name_p)):"",n="".concat((null==T?void 0:T.url)?"/reg_".concat(null==T?void 0:T.url):"").concat((null==A?void 0:A.url)?"/".concat(null==A?void 0:A.url):""),a=[{label:"Главная",href:"/"},{label:"Автокредиты".concat(t),href:"/".concat(L.u.AUTOCREDIT).concat(n)}];return u&&a.push({label:"".concat(u.name).concat(t),href:"/".concat(L.u.AUTOCREDIT,"/teg_").concat(u.url).concat(n)}),a.push({label:"".concat(null!==(e=null==j?void 0:j.name)&&void 0!==e?e:l.bank_name," Автокредит ").concat(l.title)}),a})()})})}),(0,i.jsx)(ee,{calculator:y,bank:j,offerType:x,data:l,isMobile:C}),(0,i.jsx)(g.t,{className:eS().about,children:(0,i.jsx)(N,{data:l,bank:j,offerType:x,pageUrl:L.u.AUTOCREDIT})}),(0,i.jsx)(D,{isMobile:C,offerType:x,url:l.online_application.url}),void 0!==j&&(0,i.jsx)(eg,{bank:j,banks:r,currentCardId:l.id,autocredits:d,autocreditsFinuslugi:f}),n&&(0,i.jsx)(_.S,{posts:n.posts,categories:n.ctgs,pageUrl:L.u.AUTOCREDIT}),(0,i.jsxs)("div",{className:eS().supportSection,children:[(0,i.jsx)(ej.O,{idSupport:b.Je,Image:e=>(0,i.jsx)(c(),{...e,width:555,height:344,src:v.Z,alt:"фоновое изображение"}),dataLayerPush:et.l,eventEmitter:()=>window.supportWidget.craftTalk.open()}),(0,i.jsx)(eN.B,{isAllExpanded:!0,faqBlockTitle:"",Link:e=>(0,i.jsx)(p(),{...e}),dataLayerPush:et.l,questions:k,eventCategory:"cards_support_block",href:"".concat((0,ev.ZR)().mainBaseUrl,"/help"),checkAllText:"Читать все вопросы про автокредиты"})]})]})}var eR=l(98670);l(93188);var eL=l(53850),eF=l(37771),eM=l(59457);function eD(){return(eD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)({}).hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e}).apply(null,arguments)}var eI=function(e){return r.createElement("svg",eD({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),n||(n=r.createElement("path",{fill:"#1F242E",fillRule:"evenodd",d:"M2 5a1 1 0 0 1 1-1h18a1 1 0 1 1 0 2H3a1 1 0 0 1-1-1M2 12c0-.552.482-1 1.077-1h11.846c.595 0 1.077.448 1.077 1s-.482 1-1.077 1H3.077C2.482 13 2 12.552 2 12M2 19c0-.552.5-1 1-1h6c.5 0 1 .448 1 1s-.352 1-1 1H3c-.5 0-1-.448-1-1",clipRule:"evenodd"})))},eE=l(30082),eU=l.n(eE);let eO=e=>{let t=(0,r.useRef)(null);return(0,r.useEffect)(()=>{let l=l=>{var n;let{target:a}=l;a instanceof HTMLElement&&!(null===(n=t.current)||void 0===n?void 0:n.contains(a))&&e()};return window.addEventListener("click",l),()=>{window.removeEventListener("click",l)}},[e]),t},eP=e=>{let{content:t,children:l,disabled:n,isNewSortRadios:a}=e,[o,s]=(0,r.useState)(!1),u=(0,r.useCallback)(()=>s(!0),[s]),c=(0,r.useCallback)(()=>s(!1),[s]);return(0,i.jsxs)("div",{className:(0,I.Z)(eU().wrap,a&&eU().newSortRadioWrap),onClick:u,ref:eO(c),children:[l,o&&!n&&(0,i.jsx)("div",{className:eU().content,children:t})]})};function eB(){return(eB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)({}).hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e}).apply(null,arguments)}var eH=function(e){return r.createElement("svg",eB({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},e),a||(a=r.createElement("path",{fill:"#000",d:"M12 11a1 1 0 0 0-1 1v4a1 1 0 0 0 2 0v-4a1 1 0 0 0-1-1m.38-3.92a1 1 0 0 0-.76 0 1 1 0 0 0-.33.21 1.2 1.2 0 0 0-.21.33 1 1 0 0 0 .21 1.09q.147.133.33.21A1 1 0 0 0 13 8a1.05 1.05 0 0 0-.29-.71 1 1 0 0 0-.33-.21M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20m0 18a8 8 0 1 1 0-16.001A8 8 0 0 1 12 20"})))},eZ=l(58177),eV=l.n(eZ);let eW=e=>{let{isNewSortRadios:t,isMobile:l,onChangeSort:n,isIncreaseSort:a}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("p",{className:(0,I.Z)(eV().sortTypeHead,t&&eV().newSortRadioSortTypeHead),children:[(0,i.jsx)("button",{style:{marginLeft:"0px",marginRight:l?"0px":"8px"},className:(0,I.Z)(eV().sortTypeButton,t&&eV().newSortRadioSortTypeButton),onClick:n,children:(0,i.jsx)(eI,{className:(0,I.Z)(!a&&eV().iconInverted)})}),"Сортировать"]}),t&&(0,i.jsx)("div",{className:eV().divider})]})},eq=(0,r.memo)(e=>{let{isMobile:t,onChangeSort:l,isIncreaseSort:n,onChangeSortType:a,sortTypeItems:o,sortTypeValue:r,isNewSortRadios:u}=e;return(0,i.jsxs)(i.Fragment,{children:[!u&&t&&(0,i.jsx)(eW,{onChangeSort:l,isMobile:t,isIncreaseSort:n,isNewSortRadios:u}),(0,i.jsxs)("div",{className:(0,I.Z)(eV().sortTypeContainer,u&&eV().newSortRadioSortTypeContainer),onClick:e=>e.stopPropagation(),children:[u&&(0,i.jsx)(eW,{onChangeSort:l,isMobile:t,isIncreaseSort:n,isNewSortRadios:u}),o.map(e=>(0,i.jsxs)("div",{"data-qa":"".concat(e.value,"_radio"),className:eV().sortType,children:[u?(0,i.jsx)(s.Y8,{name:e.value,value:r,checked:e.value===r,label:e.label,onChange:()=>a(e.value)}):(0,i.jsx)(s.Y8,{name:e.value,label:e.label,checked:e.value===r,className:eV().sortTypeRadio,value:e.value,onChange:()=>a(e.value)}),e.description&&(0,i.jsx)(s.u,{text:e.description,className:(0,I.Z)(eV().sortTypeButton,u&&eV().newSortRadioSortTypeButton),children:(0,i.jsx)(eH,{})})]},e.value))]})]})});eq.displayName="SortRadios";var eQ=l(5257),ez=l.n(eQ);let eJ=(0,r.memo)(e=>{let{chips:t,onClickParams:l,isIncreaseSort:n,onChangeIncreaseSort:a,sortTypeItems:o,sortTypeValue:u,onChangeSortType:c,isMobile:d,isFixed:p,portalId:v,onClickChip:m,className:_,onClickSortType:h,isNewSortRadios:b}=e,f=(0,r.useCallback)(()=>null==a?void 0:a(!n),[n,a]),x=(0,i.jsx)("div",{style:{padding:"8px",borderRadius:b?"20px":"8px",background:"white"},className:(0,I.Z)(!d&&b&&ez().sortTypeDesktop),children:(0,i.jsx)(eq,{isMobile:d,isIncreaseSort:n,onChangeSort:f,onChangeSortType:c,sortTypeItems:o,sortTypeValue:u,isNewSortRadios:b,portalId:v})}),C=o.find(e=>e.value===u);return(0,i.jsx)("div",{className:(0,I.Z)(ez().filter,b&&ez().newSortRadiosFilter,p&&ez().stuck,_),children:(0,i.jsx)(g.t,{className:ez().mainContainer,children:(0,i.jsxs)("div",{className:ez().container,children:[(0,i.jsx)(s.cL,{className:ez().chipsContainer,chips:t,value:t.map(e=>e.id),multiple:!0,activeVariant:"secondary",onChipClick:m}),(0,i.jsxs)("div",{className:ez().actionsWrapper,children:[(0,i.jsxs)("button",{className:(0,I.Z)(ez().action,ez().actionButton),onClick:l,children:[(0,i.jsx)(eM.Z,{className:ez().icon}),(0,i.jsx)("span",{className:ez().actionText,children:"Все параметры"})]}),(0,i.jsxs)("div",{className:ez().action,children:[(0,i.jsx)("button",{className:(0,I.Z)(ez().icon,ez().iconButton,!n&&ez().iconInverted),onClick:f,children:(0,i.jsx)(eI,{})}),(0,i.jsx)(eP,{content:x,disabled:d,isNewSortRadios:b,children:(0,i.jsx)("button",{onClick:h,className:(0,I.Z)(ez().actionText,ez().actionButton),"data-qa":"".concat(u,"_order"),children:(null==C?void 0:C.shortLabel)||(null==C?void 0:C.label)||"Сортировка"})})]})]})]})})})});eJ.displayName="ListFilter";var eG={src:"/kredity/assets/_next/static/media/adv-auto-desktop.6c981f82.svg",height:132,width:1110,blurWidth:0,blurHeight:0},eX={src:"/kredity/assets/_next/static/media/adv-auto-mobile.07d07b83.svg",height:132,width:343,blurWidth:0,blurHeight:0},eK=l(41172),eY=l.n(eK);let e$=(0,r.memo)(e=>{let{className:t}=e,{mainBaseUrl:l}=(0,ev.ZR)();return(0,i.jsxs)(p(),{href:"".concat(l,"/osago"),target:"_blank",className:(0,I.Z)(eY().wrapper,t),children:[(0,i.jsx)(c(),{className:(0,I.Z)(eY().bg,eY().bgDesktop),src:eG,alt:""}),(0,i.jsx)(c(),{className:(0,I.Z)(eY().bg,eY().bgMobile),src:eX,alt:""}),(0,i.jsx)(s.zx,{className:eY().button,size:"s",children:"Оформить"})]})});e$.displayName="OsagoAd";var e0=l(65848);let e1=[],e2=(e,t)=>{let{amount:l,firstPayment:n,period:a,payment:i,incomeProof:o,vehicleType:r,vehicleState:s,banks:u,insuranceNeed:c,stateCoFinancing:d,notFirstPayment:p}=e,v=[{id:eF.oA.amount,label:"Сумма кредита: ".concat(l.value?"".concat((0,J.uf)(+l.value)," ₽"):"не имеет значения")},{id:eF.oA.firstPayment,label:"Первый взнос: ".concat(n.value?"".concat((0,J.uf)(+n.value)," ₽"):"не имеет значения")}];if("number"==typeof a){let e=eF.vw.find(e=>e.value===a);e&&v.push({id:eF.oA.period,label:0===e.value?"Срок: ".concat(e.label):e.label})}if(i.value&&v.push({id:eF.oA.payment,label:"До ".concat((0,J.uf)(+i.value)," ₽ в мес")}),o.length){let e=eF.eT.filter(e=>o.includes(e.value)),t=1===e.length?e[0].label:"Подтверждение дохода: (".concat(e.length,")");v.push({id:eF.oA.period,label:t})}if(r.length){let e=eF.Ht.filter(e=>r.includes(e.value)),t=1===e.length?e[0].label:"Тип транспорта: (".concat(e.length,")");v.push({id:eF.oA.vehicleType,label:t})}if(s.length){let e=eF.QN.filter(e=>s.includes(e.value)),t=1===e.length?e[0].label:"Состояние транспорта: (".concat(e.length,")");v.push({id:eF.oA.vehicleState,label:t})}if(s.length){let e=eF.QN.filter(e=>s.includes(e.value)),t=1===e.length?e[0].label:"Состояние транспорта: (".concat(e.length,")");v.push({id:eF.oA.vehicleState,label:t})}if(s.length){let e=eF.QN.filter(e=>s.includes(e.value)),t=1===e.length?e[0].label:"Состояние транспорта: (".concat(e.length,")");v.push({id:eF.oA.vehicleState,label:t})}if(u.length){let e=t.filter(e=>u.includes(+e.value)),l=1===e.length?e[0].label:"Банки: (".concat(e.length,")");v.push({id:eF.oA.bank,label:l})}return(c&&v.push({id:eF.oA.insuranceNeed,label:"Без каско"}),d&&v.push({id:eF.oA.stateCoFinancing,label:"С господдержкой"}),p&&v.push({id:"notFirstPayment",label:"Без первого взноса"}),e1.length===v.length&&v.every((e,t)=>e.label===e1[t].label&&e.id===e1[t].id))?e1:(e1=v,v)},e3=e=>e?56:80;var e7=l(71147),e4=l(6252),e6=l(50586),e8=l.n(e6),e5=l(75340),e9=l(29023),te=l(88060),tt=l(10034),tl=l.n(tt);let tn=e=>{(0,Q.D)({eventCategory:L.u.AUTOCREDIT,eventAction:Q.i.link,eventActionText:e.title,eventLabel:e.id,url:e.url})},ta=e=>{let{filter:t,className:l,isMobile:n,bankOptions:a,banks:o,town:s,region:u}=e,c=(0,e5.lJ)(),d=(0,r.useRef)(null),p=(0,r.useRef)(()=>null),[v,m]=(0,r.useState)(!1),[_,h]=(0,r.useState)(!1),[b,f]=(0,r.useState)(null),{count:x,totalCount:C,increaseSort:y,sort:T,handleToggleModal:A,setIncreaseSort:N,setSort:j,isPageLoading:k,handleLoadMore:S,autoCredits:w,isLoading:R,amount:F,firstPayment:M,period:D}=t,[E,U]=(0,r.useState)(),O=(0,r.useMemo)(()=>e2(t,a),[a,t]),P=(0,r.useCallback)(()=>{A()},[A]),B=(0,r.useMemo)(()=>w.map(e=>{let t=ep({banks:o,autoCredit:e}),l={};F.value&&(l.amount=F.value),M.value&&(l.first_payment=M.value),D&&(l.period=D);let n=(0,e4.R)(l);return Object.keys(l).length&&(t.url="".concat(t.url,"#").concat(n)),t}),[F.value,w,o,M.value,D]),H=(0,r.useCallback)(e=>{if(!e)return;let t=w.find(t=>t.id===e.id);if(t){var l,n;return{...t,site:{...e.site},bankName:e.bankName,detailUrl:null!==(l=e.detailUrl)&&void 0!==l?l:"",logo:e.logo,url:null!==(n=e.url)&&void 0!==n?n:""}}},[w]),Z=(0,r.useCallback)(()=>{U(void 0)},[]),V=(0,r.useCallback)(e=>{var t;U(H(e)),f(null!==(t=null==e?void 0:e.type)&&void 0!==t?t:null),e&&(0,Q.D)({eventCategory:L.u.AUTOCREDIT,eventAction:Q.i.popup,eventActionText:e.title,eventLabel:e.id})},[H]);(0,r.useEffect)(()=>{window.removeEventListener("scroll",p.current);let e=e3(n);return p.current=()=>{if(!d.current)return;let{top:t}=d.current.getBoundingClientRect();m(t<e-3),h(t<=e+1)},window.addEventListener("scroll",p.current),()=>window.removeEventListener("scroll",p.current)},[n]);let W=(null==u?void 0:u.name_p)!==void 0?(null==s?void 0:s.name_p)?"в ".concat(null==s?void 0:s.name_p):"в ".concat(null==u?void 0:u.name_p):null,q=10*t.page<x;return(0,i.jsxs)("section",{className:(0,I.Z)(tl().section,l),children:[(0,i.jsx)(g.t,{children:(0,i.jsxs)("p",{className:tl().title,children:["Найдено ",x," ",(0,i.jsx)("span",{className:tl().titleHide,children:(0,e7.s)(x)})," ",W,x===C||0===x?"":"из ".concat(C)]})}),(0,i.jsx)("div",{ref:d,className:(0,I.Z)(tl().filter,tl().newLayout,{[tl().filterBottom]:v}),children:(0,i.jsx)(eJ,{chips:O,onChangeIncreaseSort:N,onChangeSortType:j,onClickChip:P,onClickParams:A,sortTypeItems:eF.$m,sortTypeValue:T,isIncreaseSort:y,isMobile:n,isFixed:_})}),(0,i.jsxs)(g.t,{children:[(0,i.jsx)("p",{className:tl().listTitle,ref:c,children:"Предложения рынка кредитов"}),(0,i.jsx)("div",{children:!R&&B.map((e,t)=>(0,i.jsxs)(r.Fragment,{children:[(0,i.jsx)(eo,{onDetailInfoClick:V,className:tl().listItem,data:e,onClick:tn,text:"Подать заявку",detailData:{data:H(e),mainPageUrl:L.u.AUTOCREDIT}},e.url),2===t&&(0,i.jsx)(e$,{className:tl().adv})]},e.id))}),R&&Array.from({length:6},(e,t)=>(0,i.jsx)(e0.O,{className:tl().listItem},t)),q&&(0,i.jsx)(te.f,{page:t.page,loading:k,onClick:S}),(0,i.jsx)(e9.i,{tag:"p",className:e8().subtitle,children:t.subtitle})]}),(0,i.jsx)(es.h,{data:E,isOpen:!!E,onClose:Z,mainPageUrl:L.u.AUTOCREDIT,offerType:b})]})};function ti(e){let t=(0,E.b)(e.full_price);return{...e,full_price:t}}async function to(e,t){let{tagUrl:l,regionUrl:n,townUrl:a,limit:i=10,...o}=e,r=function(e){let{limit:t,tagUrl:l,regionUrl:n,townUrl:a,amount:i,firstPayment:o,period:r,loan:s,incomeProof:u,insuranceNeed:c,vehicleState:d,vehicleType:p,stateCoFinancing:v,bank:m,sort:_,order:h,payment:g,page:b,borrower:f}=e,x=new URLSearchParams;return void 0!==t&&x.set("limit",String(t)),void 0!==l&&x.set("tag",l),void 0!==n&&x.set("region",n),void 0!==a&&x.set("town",a),void 0!==i&&x.set(eF.oA.amount,i),void 0!==o&&x.set(eF.oA.firstPayment,String(o)),void 0!==r&&x.set(eF.oA.period,String(r)),void 0!==s&&x.set(eF.oA.loan,s.join(",")),void 0!==u&&x.set(eF.oA.incomeProof,Array.isArray(u)?u.join(","):u),void 0!==c&&x.set(eF.oA.insuranceNeed,c?"1":"0"),void 0!==d&&x.set(eF.oA.vehicleState,d.join(",")),void 0!==p&&x.set(eF.oA.vehicleType,p.join(",")),void 0!==v&&x.set(eF.oA.stateCoFinancing,v?"1":"0"),void 0!==m&&x.set(eF.oA.bank,m.join(",")),void 0!==_&&x.set(eF.oA.sort,_),void 0!==h&&x.set(eF.oA.order,h),void 0!==g&&x.set(eF.oA.payment,g),void 0!==b&&x.set(eF.oA.page,String(b)),void 0!==f&&x.set(eF.oA.borrower,f.join(",")),x.set("archive","0"),x.toString()}({limit:i,regionUrl:n,tagUrl:l,townUrl:a,...o}),{data:s,error:u}=await (0,eR.D)("/money_data/AutoCredits.json?".concat(r),{signal:t});if(u||null===s)throw Error(null!=u?u:"Ошибка загрузки данных");if(void 0!==o.page&&1!==o.page&&0===s.autoCredits.length)throw new eL.dR("Invalid autocredits page: ".concat(o.page));return{offers:s.autoCredits.map(ti),count:s.autoCredits_count,totalCount:s.autoCredits_total_count,title:s.title,subtitle:s.subtitle,description:s.description}}l(89945),l(51138),l(96202);var tr=l(37171);function ts(e){let{banks:t,layout:l,refererTag:n,description:a,offer:o,posts:r,questions:s,offers:u,offersFinuslugi:c}=e;return(0,i.jsx)(tr.A,{data:l,children:(0,i.jsx)(ew,{offer:o,posts:r,questions:s,description:a,banks:t,refererTag:n,offers:u,offersFinuslugi:c})})}var tu=l(423),tc=l(66535),td={src:"/kredity/assets/_next/static/media/filter.0c02ec9e.svg",height:16,width:16,blurWidth:0,blurHeight:0},tp=l(65594),tv=l.n(tp);let tm=(0,r.memo)(e=>{let{count:t,onClickParams:l,onClickShow:n,isLoading:a,className:o}=e;return(0,i.jsxs)("div",{className:(0,I.Z)(tv().buttons,o),children:[(0,i.jsx)(s.zx,{variant:"secondary",size:"xs",pending:a,disabled:a,className:(0,I.Z)(tv().filterButton,tv().modalButton),onClick:e=>l(e),iconLeft:(0,i.jsx)(c(),{src:td,alt:""}),children:"Все параметры"}),(0,i.jsxs)(s.zx,{size:"xs",className:tv().filterButton,pending:a,disabled:a,onClick:n,children:["Показать ",t]})]})});tm.displayName="FilterActions";var t_=l(58484),th=l(91646),tg=l(98028),tb=l(7835),tf=l.n(tb);let tx=(0,r.memo)(e=>{let{checkedState:t,onChange:l,className:n}=e;return(0,i.jsxs)("ul",{className:(0,I.Z)(tf().wrapper,n),children:[(0,i.jsxs)("li",{className:tf().item,children:[(0,i.jsx)(s.XZ,{className:tf().checkbox,onChange:()=>l("insuranceNeed",!t.insuranceNeed),checked:t.insuranceNeed,value:t.insuranceNeed,label:"Без каско"}),(0,i.jsx)(tg.J,{content:"По закону, каско покупать необязательно, но такая страховка компенсирует вам ущерб, даже если вы виновны в ДТП. Каско можно включить в стоимость кредита.",children:(0,i.jsx)(tg.L,{className:tf().detailIcon})})]}),(0,i.jsxs)("li",{className:tf().item,children:[(0,i.jsx)(s.XZ,{className:tf().checkbox,onChange:()=>l("stateCoFinancing",!t.stateCoFinancing),checked:t.stateCoFinancing,value:t.stateCoFinancing,label:"С господдержкой"}),(0,i.jsx)(tg.J,{content:"Поддержка, при которой часть средств предоставляет государство. Их можно потратить только на автомобили определенных марок.",children:(0,i.jsx)(tg.L,{className:tf().detailIcon})})]}),(0,i.jsx)("li",{children:(0,i.jsx)(s.XZ,{className:tf().checkbox,onChange:()=>l("notFirstPayment",!t.notFirstPayment),checked:t.notFirstPayment,value:t.notFirstPayment,label:"Без первого взноса"})})]})});tx.displayName="AutoCreditsFilterDops";var tC=l(4645),ty=l.n(tC);let tT=(0,r.memo)(e=>{let{activeIds:t,items:l,onChange:n,className:a}=e,o=(e,l)=>{n(l?t.filter(t=>String(e)!==t):[...t,String(e)])};return(0,i.jsx)("div",{className:(0,I.Z)(ty().tagsWrapper,a),children:l.map(e=>{var l;let n=t.some(t=>t===e.value);return(0,i.jsx)(s.zx,{className:ty().tag,variant:n?"primary":"secondary",onClick:()=>o(e.value,n),children:null!==(l=e.labelShort)&&void 0!==l?l:e.label},e.value)})})});tT.displayName="AutoCreditsTags";var tA=l(45117),tN=l(30715),tj=l.n(tN);let tk=e=>{(0,et.l)({event:"data-event",eventAction:e,eventCategory:L.u.AUTOCREDIT})},tS=e=>{var t;let l=null!==(t=e.currentTarget.textContent)&&void 0!==t?t:"";tk("click_button_".concat((0,el.b)(l)))},tw=e=>{let{region:t,town:l,className:n,tag:a,isMobile:o,filter:u,subtitle:c,adFoxConfig:d}=e,{scrollSmooth:p}=(0,e5.vO)(),{count:v,isLoading:m,amount:_,firstPayment:h,vehicleType:g,setVehicleType:b,insuranceNeed:f,stateCoFinancing:x,notFirstPayment:C,setInsuranceNeed:y,setStateCoFinancing:T,setNotFirstPayment:A,handleToggleModal:N,firstPaymentPercent:j}=u,k=(0,r.useCallback)(e=>{tS(e),N()},[N]),S=(0,r.useCallback)(e=>{tS(e),p({offset:-90})},[p]),w=(0,r.useMemo)(()=>({insuranceNeed:f,stateCoFinancing:x,notFirstPayment:C}),[f,C,x]),R=(0,r.useCallback)((e,t)=>{switch(e){case"insuranceNeed":y(t);break;case"notFirstPayment":A(t),h.handleChange(t?"0":"");break;case"stateCoFinancing":T(t)}},[h,y,A,T]);return(0,i.jsxs)("div",{className:(0,I.Z)(n),children:[(0,i.jsxs)("div",{className:tj().pageHeadingWrap,children:[(0,i.jsx)(t_.V,{region:t,town:l,title:a&&"DEFAULT"!==a.tag_name?null==a?void 0:a.name:"Автокредиты",subtitle:c,mainPageUrl:L.u.AUTOCREDIT}),(0,i.jsx)("div",{className:tj().banner,children:(0,i.jsx)(th.Z,{config:d,params:tA.P3})})]}),(0,i.jsxs)(tc.W2,{className:tj().container,children:[(0,i.jsxs)("div",{className:tj().filter,children:[(0,i.jsxs)("div",{className:tj().fields,children:[(0,i.jsx)(s.MA,{label:"Сумма кредита",className:tj().field,value:_.isFocused?_.value:_.formattedValue,onBlur:_.events.onBlur,onFocus:_.events.onFocus,onChange:_.events.onChange}),(0,i.jsx)(s.MA,{label:"Первый взнос",className:tj().field,value:h.isFocused?h.value:h.formattedValue,rightLabel:"".concat(j,"%").replace(".",","),caption:j>100?eF.N2:void 0,state:j>100?"error":void 0,onBlur:h.events.onBlur,onFocus:h.events.onFocus,onChange:h.events.onChange})]}),!o&&(0,i.jsx)(tm,{count:v,onClickParams:k,onClickShow:S,isLoading:m})]}),(0,i.jsx)(tT,{className:tj().tagsWrapper,items:eF.Ht,activeIds:g,onChange:b}),(0,i.jsxs)("div",{children:[(0,i.jsx)("p",{className:tj().dopsTitle,children:"Дополнительно"}),(0,i.jsx)(tx,{className:tj().dops,onChange:R,checkedState:w})]}),o&&(0,i.jsx)(tm,{count:v,onClickParams:k,onClickShow:S,isLoading:m})]})]})};var tR=l(79644),tL=l(56790),tF=l(27685),tM=l.n(tF);let tD=e=>{let{isOpen:t,pageUrl:l,title:n,onCLickShow:a,onClickReset:o,onClose:u,children:c,count:d,isLoading:p}=e;(0,r.useEffect)(()=>{t&&(0,et.l)({event:"data-event",eventAction:"show_pop_up_".concat((0,el.b)(n)),eventCategory:l})},[t,l,n]);let v=e=>{var t;let n=null!==(t=e.currentTarget.textContent)&&void 0!==t?t:"";(0,et.l)({event:"data-event",eventAction:"click_button_".concat((0,el.b)(n)),eventCategory:l})},m=(0,i.jsxs)("div",{className:tM().buttonActions,children:[(0,i.jsxs)(s.zx,{className:tM().button,pending:p,disabled:p,onClick:e=>{v(e),a()},children:["Показать ",d]}),(0,i.jsx)(s.zx,{variant:"secondary",className:tM().button,disabled:p,onClick:e=>{v(e),o()},children:"Сбросить параметры"})]});return(0,i.jsx)(tL.h,{children:(0,i.jsx)(s.u_,{className:tM().mobilePopup,open:t,onClose:u,footer:{children:m},header:{title:"Все параметры"},children:(0,i.jsx)("div",{className:tM().content,children:c})})})},tI=(e,t)=>{(0,et.l)({event:"data-event",eventAction:L.u.AUTOCREDIT,eventCategory:"filter_catalog",eventLabel:(0,el.b)(e),eventValue:t})},tE=(e,t)=>{tI(e,(null!=t?t:[]).map(e=>e.label).join(","))};var tU=l(10622),tO=l.n(tU);let tP=e=>{let{filter:t,isMobile:l,bankOptions:n}=e,{handleToggleModal:a,resetFilter:o,amount:u,firstPayment:c,setPeriod:d,period:p,payment:v,incomeProof:m,setIncomeProof:_,vehicleType:h,setVehicleType:g,vehicleState:f,setVehicleState:x,borrower:C,setBorrower:y,loan:T,setLoan:A,banks:N,setBank:j,isLoading:k,insuranceNeed:S,stateCoFinancing:w,setInsuranceNeed:R,setStateCoFinancing:F,setSort:M,sort:D,notFirstPayment:E,setNotFirstPayment:U,firstPaymentPercent:O}=t,P=(0,r.useMemo)(()=>eF.vw.filter(e=>e.value===p),[p]),B=(0,r.useMemo)(()=>eF.eT.filter(e=>m.includes(e.value)),[m]),H=(0,r.useMemo)(()=>eF.Ht.filter(e=>h.includes(e.value)),[h]),Z=(0,r.useMemo)(()=>eF.QN.filter(e=>f.includes(e.value)),[f]),V=(0,r.useMemo)(()=>eF.F$.filter(e=>C.includes(e.value)),[C]),W=(0,r.useMemo)(()=>eF.Z3.filter(e=>T.includes(e.value)),[T]),q=(0,r.useMemo)(()=>n.filter(e=>N.includes(Number(e.value))),[n,N]),Q=(0,r.useCallback)(()=>{a(),(0,G.l)(b.Tm,{offset:l?0:-140,position:"top"})},[a,l]),{handleChangePeriod:z,handleChangeIncomeProf:J,handleChangeVehicleType:X,handleChangeVehicleState:K,handleChangeBorrower:Y,handleChangeLoan:$,handleChangeBanks:ee}=(0,r.useMemo)(()=>({handleChangePeriod:e=>{var t;d((null==e?void 0:e[0])&&Number(null==e?void 0:null===(t=e[0])||void 0===t?void 0:t.value)),tE("Срок",e)},handleChangeIncomeProf:e=>{var t;_(null!==(t=null==e?void 0:e.map(e=>String(e.value)))&&void 0!==t?t:[]),tE("Подтверждение дохода",e)},handleChangeVehicleType:e=>{var t;g(null!==(t=null==e?void 0:e.map(e=>String(e.value)))&&void 0!==t?t:[]),tE("Тип транспорта",e)},handleChangeVehicleState:e=>{var t;x(null!==(t=null==e?void 0:e.map(e=>String(e.value)))&&void 0!==t?t:[]),tE("Состояние транспорта",e)},handleChangeBorrower:e=>{var t;y(null!==(t=null==e?void 0:e.map(e=>String(e.value)))&&void 0!==t?t:[]),tE("Категория заемщикаа",e)},handleChangeLoan:e=>{var t;A(null!==(t=null==e?void 0:e.map(e=>String(e.value)))&&void 0!==t?t:[]),tE("Обеспечение",e)},handleChangeBanks:e=>{var t;j(null!==(t=null==e?void 0:e.map(e=>Number(e.value)))&&void 0!==t?t:[]),tE("Банки",e)}}),[j,y,_,A,d,x,g]),et=(0,r.useMemo)(()=>({insuranceNeed:S,stateCoFinancing:w,notFirstPayment:E}),[S,E,w]),el=(0,r.useCallback)((e,t)=>{switch(e){case"insuranceNeed":R(t);break;case"notFirstPayment":U(t);break;case"stateCoFinancing":F(t)}},[R,U,F]);return(0,i.jsx)(tD,{count:t.count,isMobile:l,isOpen:t.isOpenModal,pageUrl:L.u.AUTOCREDIT,title:"Все параметры",onCLickShow:Q,onClose:a,onClickReset:o,isLoading:k,children:(0,i.jsxs)("div",{className:tO().wrapper,children:[(0,i.jsxs)("div",{className:tO().fields,children:[(0,i.jsx)(s.MA,{label:"Сумма кредита",value:u.isFocused?u.value:u.formattedValue,onChange:u.events.onChange,onBlur:u.events.onBlur,onFocus:u.events.onFocus}),(0,i.jsx)(s.MA,{label:"Первый взнос",value:c.isFocused?c.value:c.formattedValue,rightLabel:"".concat(O,"%").replace(".",","),caption:O>100?eF.N2:void 0,state:O>100?"error":void 0,onChange:c.events.onChange,onBlur:c.events.onBlur,onFocus:c.events.onFocus}),(0,i.jsx)(tR.HU,{isMobile:l,value:P.length>0?P:null,onChange:z,label:"Срок",options:eF.vw}),(0,i.jsx)(s.MA,{label:"Ежемесячный платеж до",value:v.isFocused?v.value:v.formattedValue,onChange:v.events.onChange,onBlur:v.events.onBlur,onFocus:v.events.onFocus}),(0,i.jsx)(tR.HU,{isMobile:l,value:B.length>0?B:null,onChange:J,multiple:!0,label:"Подтверждение дохода",options:eF.eT}),(0,i.jsx)(tR.HU,{isMobile:l,value:H.length>0?H:null,multiple:!0,onChange:X,label:"Тип транспорта",options:eF.Ht}),(0,i.jsx)(tR.HU,{isMobile:l,value:Z.length>0?Z:null,multiple:!0,onChange:K,label:"Состояние транспорта",options:eF.QN}),(0,i.jsx)(tR.HU,{isMobile:l,value:V.length>0?V:null,multiple:!0,onChange:Y,label:"Категория заемщика",options:eF.F$}),(0,i.jsx)(tR.HU,{isMobile:l,value:W.length>0?W:null,multiple:!0,onChange:$,label:"Обеспечение",options:eF.Z3}),(0,i.jsx)(tR.HU,{isMobile:l,value:q.length>0?q:null,multiple:!0,onChange:ee,label:"Банки",search:!0,options:n})]}),(0,i.jsxs)("div",{className:tO().checkboxWrapper,children:[(0,i.jsx)("p",{className:tO().title,children:"Дополнительно:"}),(0,i.jsx)(tx,{className:tO().dops,checkedState:et,onChange:el}),(0,i.jsx)("p",{className:(0,I.Z)(tO().title,tO().titleSort),children:"Сортировать"}),eF.$m.map(e=>(0,i.jsx)(s.Y8,{label:e.label,name:e.value,value:e.value,checked:e.value===D,onChange:()=>M(e.value)},e.value))]})]})})};async function tB(e,t,l){let n=new URLSearchParams;n.set("tag_url",e),void 0!==t&&n.set("region",t),void 0!==l&&n.set("town",l);let{data:a,error:i}=await (0,eR.D)("/money_data/AutoCreditRegion.json?".concat(n));if(i||null===a)throw Error(null!=i?i:"Ошибка загрузки данных");return a}var tH=l(91886),tZ=l(60007);async function tV(e){let{data:t,error:l}=await (0,eR.D)("/money_data/AutoCredits.json?url=".concat(encodeURIComponent(e)));if(l)throw Error(l);if((null==t?void 0:t.length)!==1)throw new eL.dR;return(0,tZ.p)(t[0])}let tW=(e,t)=>{var l,n,a,i,o,r,s,u,c,d,p,v,m;let _=(0,ef.p)(e),{page:h}=_,g=String(null!==(n=null!==(l=_.amount)&&void 0!==l?l:null==t?void 0:t.filter.amount)&&void 0!==n?n:""),b=String(null!==(i=null!==(a=_.first_payment)&&void 0!==a?a:null==t?void 0:t.filter.first_payment)&&void 0!==i?i:""),f=String(null!==(r=null!==(o=_.period)&&void 0!==o?o:null==t?void 0:t.filter.period)&&void 0!==r?r:""),x=String(null!==(u=null!==(s=null==t?void 0:t.filter.payment)&&void 0!==s?s:_.payment)&&void 0!==u?u:"");return{amount:g&&!isNaN(+g)?g:"",firstPayment:b&&!isNaN(+b)?b:"",period:f&&!isNaN(+f)?+f:void 0,payment:_.payment&&!isNaN(+x)?x:"",vehicleType:null!==(c=null==t?void 0:t.filter.vehicle_type)&&void 0!==c?c:[],vehicleState:null!==(d=null==t?void 0:t.filter.vehicle_state)&&void 0!==d?d:[],borrower:null!==(p=null==t?void 0:t.filter.borrower)&&void 0!==p?p:[],loan:null!==(v=null==t?void 0:t.filter.loans)&&void 0!==v?v:[],insuranceNeed:(null==t?void 0:t.filter.insurance)===1,stateCoFinancing:(null==t?void 0:t.filter.state_co_financing)===1,incomeProof:null!==(m=null==t?void 0:t.filter.proof_income)&&void 0!==m?m:[],page:Number(h)||1}},tq=(e,t)=>{if(isNaN(e)||isNaN(t)||0===e||0===t)return 0;let l=Number(t)/(Number(e)/100);return Number.isInteger(l)||(l=Number(l.toFixed(5))),l};var tQ=l(30292);let tz=e=>{var t,l,n,a;let{region:i,tag:o,town:s,init:u}=e,{asPath:c}=(0,eb.useRouter)(),d=(0,r.useMemo)(()=>tW(c,o),[c,o]),p=(0,r.useRef)(null),v=(0,ex.G)({defaultValue:d.amount,format:"currency",type:"int",unit:"₽",maxLength:20}),m=(0,ex.G)({defaultValue:d.firstPayment,format:"currency",type:"int",unit:"₽",maxLength:20}),_=(0,ex.G)({defaultValue:d.payment,format:"currency",type:"int",unit:"₽",maxLength:20}),h=tq(+v.value,+m.value),g=v.value?(0,z.z)(null!=h?h:0,1):0,{query:b}=(0,eb.useRouter)(),[f,x]=(0,r.useState)(Number(b.page)||1),[C,y]=(0,r.useState)(u.title),[T,A]=(0,r.useState)(u.subtitle),[N,j]=(0,r.useState)(u.description),[k,S]=(0,r.useState)(!1),[w,R]=(0,r.useState)(!1),[L,F]=(0,r.useState)(null!==(t=u.count)&&void 0!==t?t:0),[M,D]=(0,r.useState)(null!==(l=u.count)&&void 0!==l?l:0),[I,E]=(0,r.useState)(!1),[U,O]=(0,r.useState)(null!==(n=u.list)&&void 0!==n?n:[]),[P,B]=(0,r.useState)(d.period),[H,Z]=(0,r.useState)(d.vehicleType),[V,W]=(0,r.useState)(d.vehicleState),[q,Q]=(0,r.useState)(d.borrower),[J,G]=(0,r.useState)(d.loan),[X,K]=(0,r.useState)([]),[Y,$]=(0,r.useState)(d.insuranceNeed),[ee,et]=(0,r.useState)(d.stateCoFinancing),[el,en]=(0,r.useState)(eF.$m[0].value),[ea,ei]=(0,r.useState)(!1),[eo,er]=(0,r.useState)(null!==(a=null==o?void 0:o.filter.proof_income)&&void 0!==a?a:[]),[es,eu]=(0,r.useState)(!1),ec=(0,r.useRef)(!0),ed=(0,r.useCallback)(()=>{E(e=>!e)},[]),ep=(0,r.useCallback)(async e=>{var t,l,n,a,r,u;p.current&&p.current.abort(),p.current=new AbortController;let c={amount:v.value,firstPayment:v.value?h:void 0,period:P,loan:J,incomeProof:eo,insuranceNeed:Y,stateCoFinancing:ee,vehicleState:V,vehicleType:H,bank:X,order:es?"desc":"asc",sort:el,payment:_.value,borrower:q};e>1?(c.page=e,R(!0)):S(!0);let d=await to({tagUrl:null==o?void 0:o.url,regionUrl:null==i?void 0:i.url,townUrl:null==s?void 0:s.url,...c},p.current.signal),m=null!==(t=null==d?void 0:d.offers)&&void 0!==t?t:[],g=null!==(l=null==d?void 0:d.title)&&void 0!==l?l:"",b=null!==(n=null==d?void 0:d.subtitle)&&void 0!==n?n:"",f=null!==(a=null==d?void 0:d.description)&&void 0!==a?a:"";F(null!==(r=null==d?void 0:d.count)&&void 0!==r?r:0),D(null!==(u=null==d?void 0:d.totalCount)&&void 0!==u?u:0),y(g),A(b),j(f),O(t=>e>1?[...t,...m]:m),R(!1),S(!1)},[v.value,X,q,h,eo,es,Y,J,_.value,P,i,el,ee,o,s,V,H]),ev=(0,r.useCallback)(()=>{x(e=>{let t=e+1;return ep(t),t})},[ep]),em=v.handleChange,e_=m.handleChange,eh=_.handleChange;(0,r.useEffect)(()=>{em(d.amount),e_(d.firstPayment),eh(d.payment),Z(d.vehicleType),W(d.vehicleState),B(d.period),Q(d.borrower),G(d.loan),$(d.insuranceNeed),et(d.stateCoFinancing),er(d.incomeProof)},[d.amount,d.borrower,d.firstPayment,d.incomeProof,d.insuranceNeed,d.loan,d.payment,d.period,d.stateCoFinancing,d.vehicleState,d.vehicleType,em,e_,eh,o]),(0,r.useEffect)(()=>{ei(!!(m.value&&"0"===m.value))},[m.value]);let eg=(0,r.useCallback)(()=>{v.handleChange(""),m.handleChange(""),_.handleChange(""),B(void 0),O([]),Z([]),W([]),Q([]),G([]),K([]),$(!1),et(!1),er([]),eu(!1)},[v,m,_]);return(0,tQ.b)(()=>{ec.current?ec.current=!1:ep(f)},[ep],300),{isLoading:k,isPageLoading:w,title:C,subtitle:T,description:N,handleLoadMore:ev,autoCredits:U,count:L,totalCount:M,page:f,period:P,setPeriod:B,amount:v,firstPayment:m,isOpenModal:I,setIsOpenModal:E,vehicleType:H,setVehicleType:Z,insuranceNeed:Y,stateCoFinancing:ee,setInsuranceNeed:$,setStateCoFinancing:et,handleToggleModal:ed,resetFilter:eg,payment:_,incomeProof:eo,setIncomeProof:er,vehicleState:V,setVehicleState:W,borrower:q,setBorrower:Q,loan:J,setLoan:G,banks:X,setBank:K,sort:el,setSort:en,increaseSort:es,setIncreaseSort:eu,notFirstPayment:ea,setNotFirstPayment:ei,firstPaymentPercent:g}};var tJ=l(61929),tG=l(77624),tX=l(93259),tK=l(42968),tY=l(23259),t$=l(30942),t0=l(93890),t1=l(12261),t2=l(38090),t3=l(22518),t7=l(91500),t4=l(97647),t6=l.n(t4);let t8=e=>{var t;let l=(null==e?void 0:null===(t=e.currentTarget)||void 0===t?void 0:t.textContent)?(0,el.b)(e.currentTarget.textContent):"glavnaya";(0,et.l)({event:"data-event",eventAction:"click_link_".concat(l),eventCategory:L.u.AUTOCREDIT})},t5=e=>{var t,l,n,a,o;let{offers:u,count:d,tag:m,tags:f,townDublicates:x,posts:C,regions:y,banks:T,title:A,subtitle:N,description:j,expertQuote:k}=e,S=(0,ey.S0)(),{region:w,town:R}=(0,em.T)(),[F,M]=(0,r.useState)(k),{asPath:D}=(0,eb.useRouter)(),E=null!==(l=null===(t=D.split("/").find(e=>e.includes("teg_")))||void 0===t?void 0:t.slice(4))&&void 0!==l?l:"DEFAULT",U=function(e,t){let[l,n]=(0,r.useState)(e);return(0,tH.r)(()=>{tV(t).then(n)},[n,t]),l}(m,E),O=function(e,t,l,n){let[a,i]=(0,r.useState)(e);return(0,tH.r)(()=>{tB(t,l,n).then(e=>{let{posts:t}=e;return i(t)})},[t,l,n]),a}(C,E,null==w?void 0:w.url,null==R?void 0:R.url),P=tz({region:w,town:R,tag:U,init:{count:d,list:u,subtitle:N,title:A,description:j}}),B=(0,t1.iN)(D);(0,tH.r)(()=>{(0,t2.r5)(B).then(M)},[B]);let H=(0,tY.I)(),Z=(0,t$.U)(),V=(0,r.useMemo)(()=>(0,tG.n)(T,P.banks),[T,P.banks]),{mainBaseUrl:W}=(0,ev.ZR)(),q=(0,r.useMemo)(()=>{var e;let{autoCredits:t}=P,l=1/0,n=0;t.forEach(e=>{let{amount:t}=e;if(t){let e=t.from?+t.from:0,a=t.to?+t.to:0;l=Math.min(l,e),n=Math.max(n,a)}});let a=null!==(e=P.description)&&void 0!==e?e:"",i='"offers":{"@type":"AggregateOffer","url":"'.concat(W).concat(D,'","priceCurrency":"').concat("RUB",'","lowPrice":"').concat((0,J.uf)(l!=1/0?l:0),'","highPrice":"').concat((0,J.uf)(n),'"}');return'{"@context":"https://schema.org","@type":"Product","name":"'.concat(P.title,'","image":"').concat(W).concat(tu.oQ,'","description":"').concat(a,'",').concat(i,"}")},[P,W,D]),Q=U&&"DEFAULT"!==U.tag_name?null==U?void 0:U.name:"Автокредиты",z=(null==R?void 0:R.name_p)||(null==w?void 0:w.name_p)?" в ".concat((null==R?void 0:R.name_p)||(null==w?void 0:w.name_p)):"",G="".concat((null==w?void 0:w.url)?"/reg_".concat(null==w?void 0:w.url):"").concat((null==R?void 0:R.url)?"/".concat(null==R?void 0:R.url):""),X=(()=>{let e=U&&"DEFAULT"!==U.tag_name?',{"@type":"ListItem","position":3,"name":"&#128181 '.concat(Q).concat(z,'","item":"').concat(W).concat(D,'"}'):"",t='{"@type":"ListItem","position":1,"name":"Финуслуги","item":"'.concat(W,'"}'),l='{"@type":"ListItem","position":2,"name":"Автокредиты'.concat(z,'","item":"').concat(W,"/").concat(L.u.AUTOCREDIT).concat(G,'"}');return"{".concat('"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":['.concat(t),",").concat(l).concat(e,"]}")})(),K=(0,r.useMemo)(()=>{let e=[];e.push(...(0,t7.a)(L.u.AUTOCREDIT,y,U,w,R,{nominativeCase:"Автокредиты",genitiveCase:"автокредитов"}));let t=f.reduce((e,t)=>{if(!1===t.url_redirect){let l=(0,tK.h)(L.u.AUTOCREDIT,t,w,R),n=(0,t0.q9)(l,t.name);e.push(n)}return e},[]);if(e.push({title:"Виды автокредитов",text:(0,i.jsx)(t0.oP,{children:t})}),w){var l,n;e.push(...null!==(n=null===(l=U.region_page)||void 0===l?void 0:l.town_content.map(e=>({title:(0,tX.Q)(e.title,w,R,x,void 0,U),text:(0,tX.Q)(e.content.map(tJ.Rp).join(""),w,R,x,void 0,U)})))&&void 0!==n?n:[])}else e.push(...U.text.map(e=>({title:(0,tX.Q)(e.title,w,R,x,void 0,U),text:(0,tX.Q)(e.content.map(tJ.Rp).join(""),w,R,x,void 0,U)})));return e},[w,f,y,U,R,x]),Y=O?C.map(e=>({...e,id:e.id,name:e.title,ctg_id:e.ctg})):[];return(0,i.jsxs)("main",{className:t6().page,children:[(0,i.jsx)(h.N,{title:null!==(n=P.title)&&void 0!==n?n:"",description:null!==(a=P.description)&&void 0!==a?a:""}),(0,i.jsx)(eA.o,{}),(0,i.jsx)("div",{className:(0,I.Z)(t6().background,"bg-".concat(Z))}),(0,i.jsx)("div",{className:t6().navigationWrapper,children:(0,i.jsxs)(g.t,{children:[(0,i.jsx)(s.Oo,{className:t6().breadcrumbs,items:(()=>{let e=[{label:"Главная",href:"/"},{label:"Автокредиты".concat(z),href:"/".concat(L.u.AUTOCREDIT).concat(G)}];return"DEFAULT"!==E&&e.push({label:"".concat(Q).concat(z),href:"/".concat(L.u.AUTOCREDIT,"/teg_").concat(E).concat(G)}),e.pop(),e.push({label:"".concat(Q).concat((null==U?void 0:U.default)?z:"")}),e})(),onClick:t8}),(0,i.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:X}})]})}),(0,i.jsx)(g.t,{children:(0,i.jsx)(tw,{region:null!=w?w:null,town:null!=R?R:null,isMobile:S,tag:U,filter:P,subtitle:null!==(o=P.subtitle)&&void 0!==o?o:"",adFoxConfig:H})}),(0,i.jsx)(ta,{banks:T,bankOptions:V,filter:P,isMobile:S,town:R,region:w}),(0,i.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:q}}),void 0!==F&&(0,i.jsx)(t3.c,{quote:F}),(0,i.jsx)(eN.B,{isAllExpanded:!0,faqBlockTitle:"",Link:e=>(0,i.jsx)(p(),{...e}),dataLayerPush:et.l,questions:K,eventCategory:"cards_support_block",href:"".concat(W,"/help"),checkAllText:"Читать все вопросы про автокредиты"}),(0,i.jsx)(tP,{bankOptions:V,isMobile:S,filter:P}),Y&&(0,i.jsx)(_.S,{posts:Y,pageUrl:L.u.AUTOCREDIT,categories:[]}),(0,i.jsx)("div",{className:t6().supportSection,children:(0,i.jsx)(ej.O,{idSupport:b.Je,Image:e=>(0,i.jsx)(c(),{...e,width:555,height:344,src:v.Z,alt:"фоновое изображение"}),dataLayerPush:et.l,eventEmitter:()=>window.supportWidget.craftTalk.open()})})]})};function t9(e){let{layout:t,root:l,banks:n,offers:a,posts:o,tags:r,tag:s,expertQuote:u}=e;return(0,i.jsx)(tr.A,{data:t,withLocationConfirm:!0,children:(0,i.jsx)(t5,{regions:l.regions,townDublicates:l.town_dublicates,banks:n,posts:o,description:a.description,offers:a.offers,count:a.count,tags:r,tag:s,totalCount:a.totalCount,title:a.title,subtitle:a.subtitle,expertQuote:null!=u?u:void 0})})}l(35388),l(44735),l(27714);var le=l(28254),lt=l(80330),ll=!0,ln=(0,r.memo)(function(e){var t,l;return(0,i.jsx)(o.sM,{children:e.isShowcase?(0,i.jsx)(le.p,{region:null!==(t=e.region)&&void 0!==t?t:void 0,town:null!==(l=e.town)&&void 0!==l?l:void 0,children:(0,i.jsx)(t9,{...e})}):(0,i.jsx)(lt.M,{children:(0,i.jsx)(ts,{...e})})})})},73654:function(e){e.exports={logo:"AutoCreditListItem_logo__KzLbz",placeholderLogo:"AutoCreditListItem_placeholderLogo__9xMXP"}},65594:function(e){e.exports={buttons:"FilterActions_buttons__M1NwR",filterButton:"FilterActions_filterButton__Nlxda",modalButton:"FilterActions_modalButton__ta3GX"}},27685:function(e){e.exports={buttonActions:"FilterModal_buttonActions__x7_d8",button:"FilterModal_button__wUY6f",content:"FilterModal_content__0T5By",mobilePopup:"FilterModal_mobilePopup__qAuSl"}},5257:function(e){e.exports={filter:"ListFilter_filter__VuF60",newSortRadiosFilter:"ListFilter_newSortRadiosFilter__kKfmj",sortTypeDesktop:"ListFilter_sortTypeDesktop__5LQyN",container:"ListFilter_container__nvtCN",modal:"ListFilter_modal__3ZmvQ",newSortRadioModal:"ListFilter_newSortRadioModal__vNMpD",modalButton:"ListFilter_modalButton__d5V_n",chipsContainer:"ListFilter_chipsContainer__tfgri",actionsWrapper:"ListFilter_actionsWrapper__m04h1",action:"ListFilter_action__WggMr",actionText:"ListFilter_actionText__11VOZ",iconButton:"ListFilter_iconButton__9o3Q7",actionButton:"ListFilter_actionButton__I4ohH",icon:"ListFilter_icon__RsoyT",iconInverted:"ListFilter_iconInverted__1MkEe",stuck:"ListFilter_stuck___Ya2T",mainContainer:"ListFilter_mainContainer__Lb5um",chipsContainerClosed:"ListFilter_chipsContainerClosed__TNa0t"}},30082:function(e){e.exports={wrap:"Dropdown_wrap__22_5K",newSortRadioWrap:"Dropdown_newSortRadioWrap__N83gl",content:"Dropdown_content__zkeB8"}},58177:function(e){e.exports={sortTypeContainer:"SortRadios_sortTypeContainer__8lU5M",newSortRadioSortTypeContainer:"SortRadios_newSortRadioSortTypeContainer__xY7lM",divider:"SortRadios_divider__P8JRR",sortType:"SortRadios_sortType__Ad5sp",sortTypeRadio:"SortRadios_sortTypeRadio__jVmAH",sortTypeTooltip:"SortRadios_sortTypeTooltip__JJNbc",sortTypeTrigger:"SortRadios_sortTypeTrigger__BgRzq",sortTypeHead:"SortRadios_sortTypeHead__VdaJc",newSortRadioSortTypeHead:"SortRadios_newSortRadioSortTypeHead__xKHHj",sortTypeButton:"SortRadios_sortTypeButton__UY3Mp",newSortRadioSortTypeButton:"SortRadios_newSortRadioSortTypeButton__wpRlC"}},41172:function(e){e.exports={wrapper:"OsagoAd_wrapper__MOwoz",bg:"OsagoAd_bg__m4rki",bgDesktop:"OsagoAd_bgDesktop__13CJL",bgMobile:"OsagoAd_bgMobile__4zRc9",button:"OsagoAd_button__2LK3h"}},83226:function(e){e.exports={title:"RegionTitle_title__ouhKs",link:"RegionTitle_link__r_rJV",titleWrapper:"RegionTitle_titleWrapper__yuBaG",newTitle:"RegionTitle_newTitle__SeVuV",subtitle:"RegionTitle_subtitle__T8Ha1"}},56381:function(e){e.exports={page:"AutoCreditDetail_page__jr_3y",supportSection:"AutoCreditDetail_supportSection__7506m",breadcrumbs:"AutoCreditDetail_breadcrumbs__XrqGb",about:"AutoCreditDetail_about__5FUQp"}},5753:function(e){e.exports={container:"AutoCreditApplySteps_container__wmZpQ"}},21172:function(e){e.exports={container:"AutoCreditInfo_container__GOscQ",containerFull:"AutoCreditInfo_containerFull__Vw68s",promo:"AutoCreditInfo_promo__Qx6R9",left:"AutoCreditInfo_left__vBExI",right:"AutoCreditInfo_right__xYmGT",qrDesc:"AutoCreditInfo_qrDesc__u6mDR",qrMobile:"AutoCreditInfo_qrMobile__lHKp1",typeDescription:"AutoCreditInfo_typeDescription__5QoBb"}},5569:function(e){e.exports={title:"AutoCreditsList_title__kiemn",offersListContainer:"AutoCreditsList_offersListContainer__44vNc",listTitle:"AutoCreditsList_listTitle__fP1nX",container:"AutoCreditsList_container__aH3my",listItem:"AutoCreditsList_listItem__Y0xBf"}},97647:function(e){e.exports={page:"AutoCredits_page__EqZNI",sectionWrapper:"AutoCredits_sectionWrapper__QwfNp",breadcrumbs:"AutoCredits_breadcrumbs__3OKah",adFox:"AutoCredits_adFox__W0ah4",background:"AutoCredits_background__EAWXM"}},30715:function(e){e.exports={pageHeadingWrap:"AutoCreditsFilter_pageHeadingWrap__HPOkm",banner:"AutoCreditsFilter_banner___JorH",container:"AutoCreditsFilter_container__TTHj_",filter:"AutoCreditsFilter_filter__Z6nkX",fields:"AutoCreditsFilter_fields__CUFW0",field:"AutoCreditsFilter_field__YsbeF",fieldIcon:"AutoCreditsFilter_fieldIcon__JjqAx",tagsWrapper:"AutoCreditsFilter_tagsWrapper__AxhCb",tag:"AutoCreditsFilter_tag__LGfem",dopsTitle:"AutoCreditsFilter_dopsTitle__SLwD5",dops:"AutoCreditsFilter_dops__31hQ1"}},7835:function(e){e.exports={wrapper:"AutoCreditsFilterDops_wrapper__8_0qa",checkbox:"AutoCreditsFilterDops_checkbox__8RLWl",item:"AutoCreditsFilterDops_item__GdL_E",detailIcon:"AutoCreditsFilterDops_detailIcon__lVAWv"}},10622:function(e){e.exports={fields:"AutoCreditsFilterModal_fields__bbPf2",checkboxWrapper:"AutoCreditsFilterModal_checkboxWrapper__LkTSZ",title:"AutoCreditsFilterModal_title__lcyEu",titleSort:"AutoCreditsFilterModal_titleSort__5yrZq",dops:"AutoCreditsFilterModal_dops__qbJ_a",wrapper:"AutoCreditsFilterModal_wrapper__WSPtT"}},10034:function(e){e.exports={title:"AutoCreditsList_title__FbtDC",listTitle:"AutoCreditsList_listTitle__UHGag",section:"AutoCreditsList_section__kDivH",titleHide:"AutoCreditsList_titleHide__AV_Pr",filter:"AutoCreditsList_filter__2OHf2",filterBottom:"AutoCreditsList_filterBottom__1_rnT",newLayout:"AutoCreditsList_newLayout__SXcV7",subtitle:"AutoCreditsList_subtitle__SiUJT",listItem:"AutoCreditsList_listItem__8sUMu",adv:"AutoCreditsList_adv__2T4FG",listContainer:"AutoCreditsList_listContainer__2BZk8","finkit-container--narrow":"AutoCreditsList_finkit-container--narrow__ziFs_"}},4645:function(e){e.exports={tagsWrapper:"AutoCreditsTags_tagsWrapper___62bH",tag:"AutoCreditsTags_tag__KsRe2"}},50586:function(e){e.exports={title:"styles_title__cObN3",list_wrap:"styles_list_wrap__z3_y1",content:"styles_content__tWscR",sort_content:"styles_sort_content__tPWO7",right_block:"styles_right_block__XypvM",viewed_offers_toggle:"styles_viewed_offers_toggle__C0ym7",subtitle:"styles_subtitle__RcERK",sort_label:"styles_sort_label__faPeq",dropdown_wrapper:"styles_dropdown_wrapper__Aj2XD"}}},function(e){e.O(0,[5249,2935,6832,2730,3888,9705,1261,8367,3996,4457,883,5579,2724,2047,6047,9858,2888,9774,179],function(){return e(e.s=9677)}),_N_E=e.O()}]);