(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,88673,e=>{"use strict";var t,l=e.i(94246),a=e.i(37819),n=((t={}).link="link",t.button="button",t.popup="popup",t.popdown="popdown",t.filterCatalog="filter_catalog",t.utm="utm",t.banner="banner",t.input_field="input_field",t.field="field",t);e.s(["DataLayerActionType",()=>n,"handelDataLayerPush",0,({eventCategory:e,eventAction:t,eventActionText:n="",eventLabel:s,eventValue:i,url:r})=>{let o=i;"boolean"==typeof i&&(o=i?"on":"off");let u=!0;"filter_catalog"!==t?u=/[а-я]/i.test(n.toLowerCase()):"string"==typeof s&&(u=/[а-я]/i.test(s.toLowerCase()));let d="filter_catalog"!==t?{event:"data-event",eventCategory:e,eventAction:({link:"click_link_",button:"click_button_",popup:"show_pop_up_",popdown:"close_pop_up_",utm:"save_utm",banner:"click_banner_",input_field:"input_field_",field:"click_field_"})[t]+(0,a.translit)(n),eventLabel:s,eventValue:o,url:r}:{event:"data-event",eventAction:e,eventCategory:t,eventLabel:"string"!=typeof s||u?s:(0,a.translit)(s),eventValue:o,url:r};(0,l.dataLayerPush)(d)}])},51284,e=>{e.v({container:"LogosList-module-scss-module__OhiBXq__container",img:"LogosList-module-scss-module__OhiBXq__img",item:"LogosList-module-scss-module__OhiBXq__item",itemNum:"LogosList-module-scss-module__OhiBXq__itemNum",shine:"LogosList-module-scss-module__OhiBXq__shine"})},68466,e=>{e.v({logos:"OffersWrapper-module-scss-module__fDHQIG__logos",offersWrapper:"OffersWrapper-module-scss-module__fDHQIG__offersWrapper",shine:"OffersWrapper-module-scss-module__fDHQIG__shine",title:"OffersWrapper-module-scss-module__fDHQIG__title"})},32847,66035,25635,e=>{"use strict";var t=e.i(43476),l=e.i(7670),a=e.i(71645),n=e.i(82372);let s=e=>(0,n.callApi)({url:`/money_data/Fk.json${e?"?bic="+e:""}`}),i=({children:e,observerEvent:l,hideEvent:n,threshold:s,...i})=>{let o=(0,a.useRef)(null);return(0,a.useEffect)(()=>{l&&o.current&&r(o.current,l,n,s)},[]),(0,t.jsx)("div",{...i,ref:o,children:e})},r=(e,t,l,a=.5)=>{e&&new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting?t&&t():l&&l()})},{threshold:a}).observe(e)};var o=e.i(65018),u=e.i(231);let d=async(e,t,l)=>{let a=u.appLocalStorage.getItem("cached_requests")||{},n=a[e],s=Number(n?.timestamp);if(!n||Date.now()-s>2592e6){let n=await t(...l);return a[e]={timestamp:String(Date.now()),data:n},u.appLocalStorage.setItem("cached_requests",JSON.stringify(a)),n}return n.data},c=["sberbank","vtb","gazprombank","alfabank","mkb","rosselhozbank","sovcombank","rossijskij_kapital","rosbank","yandeks_bank"];var m=e.i(51284);let p=(0,a.memo)(({className:e})=>{let n,r,u=(0,o.useMedia)("lg"),p=(0,a.useRef)(!1),[f,_]=(0,a.useState)([]),g=(n=[],r=[],[...f].sort(()=>.5-Math.random()).forEach(e=>{let t=(({url:e,logo_mob:t,logo:l,name:a})=>{let n=t||l;return n?.includes("http")?{id:e,src:n,name:a}:null})(e);if(!t)return;let l=(({url:e})=>c.includes(e))(e);l&&n.length<4&&n.push(t),!l&&r.length<6&&r.push(t)}),r=r.slice(0,6-n.length),[...n,...r].sort(()=>.5-Math.random())),v=u?g.slice(0,3):g;return(0,t.jsxs)(i,{className:(0,l.default)(m.default.container,e),observerEvent:()=>{p.current||(p.current=!0,d("/money_data/Fk.json",s,[]).then(e=>_(e.data?.banks||[])))},children:[v.map(e=>(0,t.jsx)("picture",{className:m.default.item,children:(0,t.jsx)("img",{className:m.default.img,src:e.src,alt:e.name,width:48,height:48})},e.id)),(0,t.jsxs)("div",{className:(0,l.default)(m.default.item,m.default.itemNum),children:["+",f.length-g.length]})]})});p.displayName="LogosList";var f=e.i(68466);e.s(["OffersWrapper",0,({children:e,className:a,title:n})=>(0,t.jsxs)("div",{className:(0,l.default)(f.default.offersWrapper,a),children:[(0,t.jsx)("div",{className:f.default.title,children:n}),e,(0,t.jsx)(p,{className:f.default.logos})]})],66035),e.s([],32847),e.s(["DEFAULT_PERIODS",0,[{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 лет"}],"DISCOUNT_OPTIONS",0,[{value:"travels",label:"Путешествия"},{value:"refuellings",label:"Заправки"},{value:"trade_networks",label:"Торговые сети"},{value:"charity",label:"Благотворительность"},{value:"discount_program",label:"Дисконтная программа"},{value:"custom",label:"Другое"}]],25635)},21590,e=>{"use strict";e.s(["getDebounceFunction",0,(e=300)=>{let t=null;return l=>{t&&clearInterval(t),t=setTimeout(l,e)}}])},18492,e=>{e.v({inputs:"DebitCardsOffers-module-scss-module__MmotTG__inputs",shine:"DebitCardsOffers-module-scss-module__MmotTG__shine"})},20212,e=>{"use strict";var t=e.i(43476),l=e.i(71645);e.i(34348);var a=e.i(47611),n=e.i(16727),s=e.i(91390);e.i(89485);var i=e.i(23179),r=e.i(14044),o=e.i(7670),u=e.i(30083),d=e.i(54061),c=e.i(2404);let m=(0,d.g)("input-autocomplete"),p={input:m,pending:`${m}__pending`,pendingIcon:`${m}__pending-icon`,empty:`${m}__empty`,emptyText:`${m}__empty-text`,emptyDescription:`${m}__empty-description`,options:`${m}__options`,optionIcon:`${m}__option-icon`,button:`${m}__button`,states:{selected:`${m}--selected`}},f=({items:e,itemSize:a,renderItem:n,overscan:s=2,outerRef:i,itemsContainerClassname:r})=>{let[o,u]=(0,l.useState)({start:0,end:0}),d=(0,l.useCallback)(()=>{if(!i.current)return;let t=i.current.clientHeight,l=i.current.scrollTop;u({start:Math.max(0,Math.floor(l/a)-s),end:Math.min(e.length,Math.ceil((l+t)/a)+s)})},[a,e.length,i,s]);(0,l.useLayoutEffect)(()=>{d()},[d]),(0,l.useEffect)(()=>{let e=i.current;if(!e)return;let t=()=>d();e.addEventListener("scroll",t);let l=new ResizeObserver(()=>d());return l.observe(e),()=>{e.removeEventListener("scroll",t),l.disconnect()}},[d,i]);let c=e.length*a+16,m=e.slice(o.start,o.end),p={position:"absolute",top:0,height:m.length*a,transform:`translateY(${o.start*a}px)`,width:"100%",margin:0};return(0,t.jsx)("div",{style:{position:"relative",height:c,width:"auto",margin:"-8px"},children:(0,t.jsx)("ul",{className:r,style:p,role:"listbox",children:m.map((e,t)=>n(e,o.start+t))},"options")})};function _({inputValue:e,mappedOptions:a,pending:s=!1,optionsEmptyText:r="Нет результатов",optionsEmptyDescription:d,contentInnerRef:m,withVirtualize:g=!1,handleOptionClick:v}){let b=(0,l.useId)();if(s)return(0,t.jsx)("div",{className:p.pending,children:(0,t.jsx)(c.P,{className:p.pendingIcon,children:(0,t.jsx)(n.S,{})})});if((null==e?void 0:e.length)&&!a.length)return(0,t.jsxs)("div",{className:p.empty,children:[(0,t.jsx)("div",{className:p.emptyText,children:r}),d&&(0,t.jsx)("div",{className:p.emptyDescription,children:d})]});let h=e=>(0,t.jsx)(i.g,{role:"option","aria-selected":e.selected,as:"li",disabled:e.disabled,label:e.label,caption:e.caption,focused:e.active,onClick:()=>v(e),append:(0,t.jsx)(c.P,{className:(0,o.default)(p.optionIcon,{[p.states.selected]:e.selected}),style:{fontSize:24},children:(0,t.jsx)(u.S,{})})},JSON.stringify(e.value));return g?(0,t.jsx)(f,{outerRef:m,items:a,itemSize:40,renderItem:h,itemsContainerClassname:p.options}):(0,t.jsx)("ul",{className:p.options,id:b,role:"listbox",children:a.map(h)},"options")}let g=(0,l.forwardRef)(({value:e,selectedValue:a,label:o,options:d=[],state:c,icon:m,rightLabel:f,slotLeft:g,desktopMaxHeight:v,pending:b=!1,buttonLabel:h="Выбрать",optionValue:y="value",optionLabel:j="label",optionCaption:x="caption",optionDisabled:S="disabled",variant:N="primary",size:k="m",disabled:C=!1,caption:I,hasCaption:L=!1,keepFocus:O=!1,optionsEmptyText:D="Нет результатов",optionsEmptyDescription:w,withVirtualize:T,onChange:$,onSelect:E,onFocus:R,onBlur:M,onKeydown:A,dataQa:B,dataId:P,className:W,style:q,...z},U)=>{let[F,H]=(0,l.useState)(!1),[G,Q]=(0,l.useState)(""),X=(0,l.useRef)(null),V=(0,l.useRef)(null),K=(0,l.useRef)(null),J=(0,l.useRef)(null),Y=(0,i.k)("m");(0,l.useImperativeHandle)(U,()=>V.current);let Z=(0,l.useMemo)(()=>Y?F&&(d.length>0||!!G||b):F,[G,Y,F,d.length,b]),ee=(0,l.useMemo)(()=>d.map((e,t)=>{let l=(0,u.g)(e,y,e),n=(0,u.g)(a,y,a);return{index:t,value:l,label:(0,u.g)(e,j,e),caption:(0,u.g)(e,x),disabled:(0,u.g)(e,S),selected:n===l,original:e}}),[x,S,j,y,d,a]),et=(0,l.useMemo)(()=>ee.find(({selected:e})=>e),[ee]);(0,l.useEffect)(()=>{e||a?e&&Q(e):Q("")},[e]),(0,l.useEffect)(()=>{a&&Q((0,u.g)(a,j,a))},[]),(0,l.useEffect)(()=>{F||(et?el(et.label):ea())},[F]);let el=e=>{Q(e),null==$||$(e)},ea=e=>{null==E||E(e)},en=()=>{H(!1)},es=e=>{null==M||M(e)};return(0,t.jsx)("div",{ref:U,className:p.input,"data-id":P,"data-qa":B,children:(0,t.jsxs)(i.D,{opened:Z,onToggle:H,width:"inherit",placement:"bottom",mobileFullHeight:!0,desktopMaxHeight:v,footer:Y||!a?void 0:(0,t.jsx)(n.a,{label:h,disabled:!a,className:p.button,onClick:()=>{en()}}),heading:Y?void 0:(0,t.jsx)(s.I,{inputRef:K,className:W,style:q,value:G,label:o,rightLabel:f,slotLeft:g,icon:m,state:c,caption:I,hasCaption:L,onChange:el,onBlur:es,...z}),dataQa:(0,r.g)(`${B}-dropdown`,!!B),children:[(0,t.jsx)(i.h,{asChild:!0,children:(0,t.jsx)(s.I,{value:G,label:o,rightLabel:f,slotLeft:g,icon:m,size:k,variant:N,state:c,disabled:C,caption:I,hasCaption:L,...{onClick:void 0,onChange:el,onFocus:e=>{H(!0),Y||(e.preventDefault(),setTimeout(()=>{var e;null==(e=K.current)||e.focus()},100)),null==R||R(e)},onBlur:es,onKeyDown:e=>{"Tab"===e.key&&en(),null==A||A(e)}},ref:X,inputRef:V,...z,dataQa:(0,r.g)(`${B}-dropdown-input`,!!B)})}),(0,t.jsx)(i.a,{contentInnerRef:J,children:(0,t.jsx)(_,{inputValue:G,mappedOptions:ee,pending:b,optionsEmptyText:D,optionsEmptyDescription:w,handleOptionClick:e=>{var t;if(el(e.label),ea(e.original),Y){if(O){null==(t=V.current)||t.focus();return}en()}},contentInnerRef:J,withVirtualize:T})})]})})});g.displayName="InputAutocomplete";var v=e.i(14087),b=e.i(62798),h=e.i(67638),y=e.i(82372),j=e.i(231);let x={id:0,name:"Вся Россия"},S=[{id:1095,main:1,name:"Москва",name_p:"Москве",name_r:"Москвы",parentId:76,url:"moskva"},{id:1096,main:1,name:"Санкт-Петербург",name_p:"Санкт-Петербурге",name_r:"Санкт-Петербурга",parentId:77,url:"sankt-peterburg"},{id:720,main:1,name:"Новосибирск",name_p:"Новосибирске",name_r:"Новосибирска",parentId:53,url:"novosibirsk"},{id:894,main:1,name:"Екатеринбург",name_p:"Екатеринбурге",name_r:"Екатеринбурга",parentId:65,url:"ekaterinburg"},{id:691,main:1,name:"Нижний Новгород",name_p:"Нижнем Новгороде",name_r:"Нижнего Новгорода",parentId:51,url:"nizhniy_novgorod"}];e.i(32847);var N=e.i(66035),k=e.i(25635),C=e.i(21590),I=e.i(88673),L=e.i(18492);let O=(0,C.getDebounceFunction)(750),D=()=>{let e,n,s,i=(0,h.getEnvValue)().NEXT_PUBLIC_BASE_URL,[r,u]=(0,l.useState)(null),[d,c]=(0,l.useState)(["trade_networks"]),[m,p]=(0,l.useState)(["21"]),[f,_]=(0,l.useState)([]),[C,D]=(0,l.useState)([]),{regionOptions:w,handleRegionChange:T,selectedRegion:$,selectedTown:E}=(e=>{let[t,a]=(0,l.useState)(null),[n,s]=(0,l.useState)(null),i=j.appLocalStorage.getItem("user_town"),r=j.appLocalStorage.getItem("user_region"),o=j.appLocalStorage.getItem("auto_region"),u=j.appLocalStorage.getItem("auto_town"),d=(0,l.useMemo)(()=>{let e=((i||r)??(u||o)??x).id,t=((i||r)??(u||o)??x).name;return{value:t+e,label:t}},[]),[c,m]=(0,l.useState)(d),p=(0,l.useMemo)(()=>e.map(e=>({...e,towns:e.towns.map(t=>({...t,parentId:e.id}))})),[e]),f=(0,l.useMemo)(()=>{let e=p.map(({towns:e})=>e).reduce((e,t)=>[...e,...t],[]).filter(e=>!S.find(t=>t.name===e.name));return[...S,...e]},[p]);return{regionValue:c,regionOptions:(0,l.useMemo)(()=>[x,...f,...p].map(e=>({value:e.name+e.id,label:e.name,url:e.id})),[p,f]),handleRegionChange:(0,l.useCallback)(e=>{if(!e)return;m(e[0]);let t=null,l=null;x.name!==e[0].label&&(l=(t=f.find(t=>t.name===e[0].label)??null)?p.find(e=>e.id===Number(t?.parentId))??null:p.find(t=>t.name===e[0].label)??null),a(l),s(t)},[p,f]),selectedRegion:t,selectedTown:n}})(C),[R,M]=(0,l.useState)([]),[A,B]=(0,l.useState)([]),[P,W]=(0,l.useState)(""),q=(0,l.useRef)(""),z=(e=[],d&&d.length&&e.push(`discounts=${d.join(",")}`),m&&m.length&&e.push(`card_type=${m.join(",")}`),f&&f.length&&e.push(`bank=${f.join(",")}`),$&&e.push(`region=${$.url}`),E&&e.push(`town=${E.url}`),e.length?e.join("&"):"");(0,l.useEffect)(()=>{z!==q.current&&(O(()=>{let e;(e=`limit=1${z.length?"&"+z:""}`,(0,y.callApi)({url:`/money_data/DebitCards.json?${e}`})).then(e=>{u(e.data?.debitCards_count||null)})}),q.current=z)},[z]),(0,l.useEffect)(()=>{(0,y.callApi)({url:"/money_data/Root.json"}).then(e=>{D(e.data?.regions||[]),M(e.data?.companies||[])}),(0,y.callApi)({url:"/money_data/CardData.json",config:{signal:void 0}}).then(e=>{B(e.data?.card_types||[])})},[]);let U=`${i}/debetovye_karty`+(z.length?"?"+z:""),F=`${r||0} ${(0,b.pluralize)(r||0,"предложение","предложения","предложений")}`,H=(n=f?.map(e=>+e)??[],[...R].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}))),G=[...A.map(e=>({value:String(e.id),label:e.title})),{value:"custom",label:"Другое"}];return(0,t.jsxs)(N.OffersWrapper,{className:(0,o.default)(L.default.debitCardsOffersWrapper,"disableContentBlocksStyles"),title:"Дебетовые карты",children:[(0,t.jsxs)("div",{className:L.default.inputs,children:[(0,t.jsx)(v.Select,{value:k.DISCOUNT_OPTIONS.filter(e=>d.includes(e.value)),multiple:!0,onChange:e=>c(e?.map(({value:e})=>String(e))||[]),label:"Скидки и бонусы",options:k.DISCOUNT_OPTIONS,variant:"secondary"}),(0,t.jsx)(v.Select,{value:G.filter(e=>m.includes(e.value)),multiple:!0,onChange:e=>p(e?.map(e=>String(e.value))||[]),label:"Тип карты",options:G,variant:"secondary"}),(0,t.jsx)(v.Select,{value:H.filter(e=>f.includes(Number(e.value))),multiple:!0,onChange:e=>_(e?.map(e=>Number(e.value))||[]),label:"Банки",options:H,variant:"secondary"}),(0,t.jsx)(g,{variant:"secondary",label:"Мое местоположение",value:P,options:w.filter(e=>e.label.includes(P)),onChange:W,onSelect:e=>e?T([e]):null})]}),(0,t.jsx)(a.Button,{as:"a",className:L.default.button,label:`Смотреть ${F}`,variant:"primary",size:"s",href:U,onClick:(s=I.DataLayerActionType.button,()=>{(0,I.handelDataLayerPush)({eventCategory:"main_top_offers_block",eventAction:s,eventActionText:"смотреть",eventLabel:"debit_cards_calculator_top_offers",eventValue:void 0})})})]})};e.s(["DebitCardsOffers",0,D],2932),e.s([],23833),e.i(23833),e.i(2932),e.s(["DebitCardsOffers",0,D],20212)},44446,e=>{e.n(e.i(20212))}]);