!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{};e.SENTRY_RELEASE={id:"70ce8fb39136189ecf2a91fe0be2cf2d93e87014"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e5c0dae2-ccae-4f39-bd8f-babbc4ebdbaa",e._sentryDebugIdIdentifier="sentry-dbid-e5c0dae2-ccae-4f39-bd8f-babbc4ebdbaa")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7366],{7697:e=>{e.exports={linkWrapper:"CheckFullInfoLink_linkWrapper__MewQV",width:"CheckFullInfoLink_width__wZeUL",padding:"CheckFullInfoLink_padding__Lh4bJ",link:"CheckFullInfoLink_link__7whuk",icon:"CheckFullInfoLink_icon__fQD9U",light:"CheckFullInfoLink_light__lJeRc",white:"CheckFullInfoLink_white__MzFzv"}},17462:(e,t,n)=>{"use strict";n.d(t,{LK:()=>s,R:()=>a});let s="https://lk.finuslugi.ru/registration/",a="https://assets.finuslugi.ru/mp-assets/docs/main-documents/regulation_review_procedure/regulation_review_procedure.pdf"},24356:(e,t,n)=>{Promise.resolve().then(n.bind(n,4558)),Promise.resolve().then(n.bind(n,12696)),Promise.resolve().then(n.bind(n,60231))},27828:(e,t,n)=>{"use strict";n.d(t,{e:()=>c});var s=n(95155),a=n(12115),i=n(27290),o=n(29427),l=n(18403),r=n(7697),d=n.n(r);let c=(0,a.memo)(({onClick:e,text:t,href:n,target:r,iconColor:c="light",mainPageUrl:u,offPadding:_,widthMaxContent:p,className:g,icon:m})=>{let h=(0,a.useCallback)(e=>n?(0,s.jsx)("a",{onClick:e.onClick,href:n,target:r,...e}):(0,s.jsx)("button",{onClick:e.onClick,...e}),[n,r]),y=m||i.JuQ;return(0,s.jsx)("div",{className:(0,o.A)(d().linkWrapper,{[d().padding]:!_,[d().width]:p},g),onClick:()=>{(0,l._)({eventCategory:u,eventActionType:l.y.link,eventActionText:t,eventLabel:n})},children:(0,s.jsxs)(h,{onClick:e,className:d().link,children:[t,(0,s.jsx)(y,{size:22,className:(0,o.A)(d().icon,d()[c])})]})})});c.displayName="CheckFullInfoLink"},37205:e=>{e.exports={content:"BonusDetailModal_content__ZK4uH",buttonActions:"BonusDetailModal_buttonActions__Uqy9m",button:"BonusDetailModal_button__dQ7ho",mobilePopup:"BonusDetailModal_mobilePopup__RMlmv",body:"BonusDetailModal_body__2Dx_j",imageWrapper:"BonusDetailModal_imageWrapper__z2Nv_",bgImg:"BonusDetailModal_bgImg__YBbTU",bgImgM:"BonusDetailModal_bgImgM__CEAmL",img:"BonusDetailModal_img__xqlRm",imgM:"BonusDetailModal_imgM__P7j9e",gradient:"BonusDetailModal_gradient__daMJE",chips:"BonusDetailModal_chips__K0LKN",title:"BonusDetailModal_title__W0pYn",info:"BonusDetailModal_info__AaeMF",file:"BonusDetailModal_file__bgsKu",promocode:"BonusDetailModal_promocode__vGFCJ",leftShape:"BonusDetailModal_leftShape__rJkgZ",dots:"BonusDetailModal_dots__0RRq8",rightShape:"BonusDetailModal_rightShape__ZEWcA",code:"BonusDetailModal_code__4u0IF",codeButton:"BonusDetailModal_codeButton__7CeEk",copied:"BonusDetailModal_copied__iyOtr"}},48923:(e,t,n)=>{"use strict";n.d(t,{p:()=>u});var s=n(63867),a=n(47812);n(52474);let i=0,o=[],l=new Map,r=async()=>{i>=24&&await new Promise(e=>{o.push(e)}),i+=1},d=async e=>{await r();try{return await e()}finally{i=Math.max(0,i-1),o.shift()?.()}},c=async({url:e,endpoint:t,method:n,config:a,env:i})=>{let o=new AbortController,l=setTimeout(()=>o.abort(),1e4),r=()=>o.abort();a?.signal?.aborted&&o.abort(),a?.signal?.addEventListener("abort",r,{once:!0});let d=performance.now();try{let l=await (0,s.OT)(e,{baseURL:t,method:n,headers:{...a?.headers},...a,signal:o.signal,timeout:1e4,retry:0,next:{revalidate:Number(i.REVALIDATE_REQUEST_VALUE)||1800}}),r=performance.now()-d;return console.warn(`Запрос ${t}${e} занял ${r.toFixed(2)} ms`),{data:l,error:null}}catch(n){return n.status??n.statusCode,console.error("Ошибка запроса",`${n}: ${t}${e}`),{data:null,error:n||"Unknown error"}}finally{clearTimeout(l),a?.signal?.removeEventListener("abort",r)}},u=async({url:e,options:t={},config:n})=>{let s=(0,a.px)(),i=((e,t)=>{let{isBFF:n,isMpScApi:s,isGlossary:a,isPageContent:i,isMpScRedirects:o,isDisclosure:l}=t;return s?`${e.NEXT_PUBLIC_BASE_URL}/sc`:e.NEXT_PUBLIC_BASE_URL})(s,t),o=(n?.method||"GET").toUpperCase();if(!i)return console.error("Ошибка запроса: API endpoint не задан",e),{data:null,error:"API endpoint is not configured"};let r=()=>d(()=>c({url:e,endpoint:i,method:o,config:n,env:s}));if(n?.signal||"GET"!==o&&"HEAD"!==o)return r();var u=`${o}:${i}${e}`;let _=l.get(u);if(_)return _;let p=r().finally(()=>{l.delete(u)});return l.set(u,p),p}},60231:(e,t,n)=>{"use strict";n.d(t,{Bonus:()=>F});var s=n(95155),a=n(12115),i=n(27290),o=n(25069),l=n(13622),r=n(42687),d=n(45822),c=n(80512),u=n(29427),_=n(48923);let p=async({page:e,productTypeId:t,sort:n})=>{let s=t?`&productTypeId=${t}`:"",a=`&sortDirection=${n||"DESC"}`;return(await (0,_.p)({url:`/api/v1/bonuses/active?page=${e}&rowsPerPage=6&isShownLk=true${s}${a}`,options:{isMpScApi:!0}})).data||{}},g=async(e="DESC")=>{let t=await (0,_.p)({url:`/api/v1/bonuses/grouped?limit=6&isShownLk=true&sortDirection=${e}`,options:{isMpScApi:!0}});return t.data?.filter(e=>Array.isArray(e.data)&&e.data.length>0)||[]},m=async e=>(await (0,_.p)({url:"/api/v1/bonuses/promocodes?page=0&rowsPerPage=10",options:{isMpScApi:!0},config:{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({promotionId:e,isShownLk:!0})}})).data||{promocodes:[]};var h=n(27828),y=n(18403),x=n(75461),b=n(91421),f=n.n(b);let v=({data:e,onClick:t,loading:n,loadingBtn:a})=>{let i=(0,x.Y)(e.endDate);return(0,s.jsxs)("div",{className:(0,u.A)(f().wrapper,{[f().loading]:n}),onClick:t,"data-sentry-component":"BonusCard","data-sentry-source-file":"BonusCard.tsx",children:[(0,s.jsx)("div",{className:f().imageWrapper,children:e.image&&(0,s.jsx)("img",{src:e.image.src,srcSet:`${e.image.src}, ${e.image.x2} 2x`,alt:"bg"})}),(0,s.jsx)("div",{className:f().chips,children:e.endDate&&(0,s.jsx)("label",{children:`до ${i}`})}),(0,s.jsxs)("div",{className:f().text,children:[(0,s.jsx)("div",{className:f().title,children:e.title}),e.importantConditions&&(0,s.jsx)("div",{className:f().description,children:e.importantConditions})]}),(0,s.jsx)(l.$,{className:f().button,label:"Подробнее",size:"s",pending:n||a,"data-sentry-element":"Button","data-sentry-source-file":"BonusCard.tsx"})]})};var B=n(60773),C=n(47812);let k={src:"/service-main/_next/static/media/percent.c854cbab.svg",height:141,width:109,blurWidth:0,blurHeight:0};var j=n(31689),S=n(93070),A=n(2199),M=n(17462),D=n(37205),w=n.n(D);let N=e=>{let[t,n]=(0,a.useState)(!1),o=(0,d.nu)("l"),r=(0,d.qK)();(0,a.useEffect)(()=>{n(!1)},[e.isOpen]);let c=e.data;if(!c)return null;let _=(0,x.Y)(c.endDate),p=Array(r&&o?11:10).fill("");return(0,s.jsxs)("div",{className:w().body,onKeyDown:t=>{"Enter"===t.key&&e.onClose()},"data-sentry-component":"BonusDetailModalContent","data-sentry-source-file":"BonusDetailModal.tsx",children:[(0,s.jsx)("div",{className:w().imageWrapper,children:c.image&&(0,s.jsx)("img",{src:c.image.src,srcSet:`${c.image.src}, ${c.image.x2} 2x`,alt:"bg"})}),(0,s.jsx)("div",{className:w().chips,children:c.endDate&&(0,s.jsx)("label",{children:`до ${_}`})}),(0,s.jsx)("div",{className:w().title,children:c.title}),(0,s.jsx)("div",{className:w().info,dangerouslySetInnerHTML:{__html:c.importantConditions||""}}),c.rulesUrl&&(0,s.jsxs)("a",{className:w().file,href:`${e.assetsUrl}/mp-assets/${c.rulesUrl}`,onClick:()=>{(0,y._)({eventCategory:"skachat_pdf_fayl_iz_popup",eventActionType:y.y.link,eventActionText:"skachat_pdf_fayl",eventLabel:`${e.assetsUrl}/mp-assets/${c.rulesUrl}`})},children:[(0,s.jsx)(i.Aiu,{}),"Подробности акции.PDF"]}),c.code&&(0,s.jsxs)("div",{className:(0,u.A)(w().promocode,{[w().copied]:t}),children:[(0,s.jsx)("div",{className:w().leftShape}),(0,s.jsx)("div",{className:w().dots,children:p.map((e,t)=>(0,s.jsx)("div",{},t))}),(0,s.jsxs)("div",{className:w().rightShape,children:[(0,s.jsx)("div",{className:w().code,children:c.code}),(0,s.jsxs)("div",{className:w().codeButton,onClick:()=>((0,y._)({eventCategory:"",eventActionType:y.y.button,eventActionText:"copi_promokod",eventLabel:`номер промокода ${c.code}`}),n(!0),navigator.clipboard.writeText(c.code||""),!1),children:[t?(0,s.jsx)(i.gyK,{}):(0,s.jsx)(i.VT4,{}),t?"Скопировано":"Скопировать промокод"]})]}),(0,s.jsx)(B.default,{src:k,alt:"%"})]}),(0,s.jsx)("div",{className:w().buttonActions,children:(0,s.jsx)(l.$,{as:"a",href:M.LK,size:"m",className:w().button,label:"Зарегистрироваться на Финуслугах",onClick:()=>{(0,y._)({eventCategory:"aktsii_spetspredlozheniya_popup",eventActionType:y.y.button,eventActionText:"Зарегистрироваться на Финуслугах",eventLabel:"perekhod_na_/registration"})},"data-sentry-element":"Button","data-sentry-source-file":"BonusDetailModal.tsx"})})]})},I=e=>{let t=(0,C.px)(),n=(0,d.nu)("l"),a=(0,d.qK)()&&n;return(0,s.jsxs)(j.Z,{"data-sentry-element":"Portal","data-sentry-component":"BonusDetailModal","data-sentry-source-file":"BonusDetailModal.tsx",children:[!a&&(0,s.jsx)(S._,{rowTitle:!0,titleAlign:"center",contentClassName:w().content,isOpen:e.isOpen,onClose:e.onClose,width:"628px",children:(0,s.jsx)(N,{...e,assetsUrl:t.NEXT_PUBLIC_S3_ASSETS})}),a&&(0,s.jsx)(A.L,{className:(0,u.A)(w().mobilePopup),contentClassName:w().content,isOpen:e.isOpen,onClose:e.onClose,children:(0,s.jsx)(N,{...e,assetsUrl:t.NEXT_PUBLIC_S3_ASSETS})})]})},T=["App","Bonus","Enshurence","Finuslugi","fruit_box","Girl_calculate","Identification","Money_save","Money_transfer_2","Money","Signature","Success"],L=e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Math.abs(t)};var E=n(81696),$=n.n(E);let P="Акции и спецпредложения",U=({isIncreaseSort:e,setIsIncreaseSort:t})=>(0,s.jsxs)("button",{type:"button",className:(0,u.A)($().sortButton),onClick:()=>t(!e),"data-sentry-component":"SortButton","data-sentry-source-file":"Bonus.tsx",children:[e?(0,s.jsx)(i.yZ$,{size:22}):(0,s.jsx)(i.EBK,{size:22}),(0,s.jsx)("span",{children:"По дате"})]}),F=({tagsData:e})=>{let t=(0,d.nu)("l"),n=(0,d.qK)()&&t,[i,_]=(0,a.useState)(null),[x,b]=(0,a.useState)(e),[f,B]=(0,a.useState)([]),[k,j]=(0,a.useState)(!1),S=x.findIndex(({id:e})=>e===i)||0,A=S>-1?S:0,M=f.length&&k?f:x,D=f.length&&k?B:b,w=M[A],N=w?.data||[],[E,F]=(0,a.useState)(null),[W,K]=(0,a.useState)(!1),[R,z]=(0,a.useState)(!1),[O,q]=(0,a.useState)(null),G=(e=>{let t=(0,C.px)(),n=T.map(e=>({src:`${t.NEXT_PUBLIC_S3_ASSETS}/mp-assets/images/bonus/${e}.png`,x2:`${t.NEXT_PUBLIC_S3_ASSETS}/mp-assets/images/bonus/${e}2.png`})),s=[],a=[];for(let t of e){s.length||s.push(...n);let e=L(t.title)%s.length,i=s[e];a.push({...t,image:i}),s.splice(e,1)}return a})(N),J=e=>{(0,y._)({eventCategory:"click_top_element",eventActionType:y.y.button,eventActionText:e?"element_po_ubyvaniyu":"element_po_vozrastaniyu",eventLabel:"По дате"}),f.length||(z(!0),g("ASC").then(e=>{B(e?.map(e=>({...e,hasMore:e.data.length>=6,page:0}))||[]),z(!1)})),j(e)};return(0,s.jsxs)("main",{className:$().page,"data-sentry-component":"Bonus","data-sentry-source-file":"Bonus.tsx",children:[(0,s.jsxs)(r.m,{"data-sentry-element":"Container","data-sentry-source-file":"Bonus.tsx",children:[(0,s.jsx)(o.B,{style:{padding:"16px 0"},items:[{href:"/",label:"Главная"},{label:P}],"data-sentry-element":"Breadcrumbs","data-sentry-source-file":"Bonus.tsx"}),(0,s.jsx)("h1",{className:$().title,children:P}),G.length>0?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:$().filters,children:[(0,s.jsxs)(r.m,{className:$().chips,children:[n&&(0,s.jsx)(U,{isIncreaseSort:k,setIsIncreaseSort:J}),x.map(({id:e,name:t},n)=>(0,s.jsx)("div",{className:(0,u.A)({[$().selected]:n===A}),onClick:()=>{(0,y._)({eventCategory:"click_top",eventActionType:y.y.chip,eventActionText:t||"",eventLabel:t}),_(e||null)},children:t},e||t))]}),!n&&(0,s.jsx)(U,{isIncreaseSort:k,setIsIncreaseSort:J})]}),(0,s.jsx)("div",{className:$().grid,children:G.map((e,t)=>(0,s.jsx)(v,{data:e,onClick:()=>{(0,y._)({eventCategory:"popup_aktsii",eventActionType:y.y.offer,eventActionText:e.title}),q(e.id),m(e.id).then(({promocodes:t})=>{let n=new Date,s=t.filter(({appliesFrom:e,appliesTo:t})=>new Date(e)<=n&&n<=new Date(t));F({...e,code:s[0]?.code||""})}).finally(()=>q(null))},loading:R,loadingBtn:e.id===O},t))}),w?.hasMore&&(0,s.jsx)("div",{className:$().pagination,children:(0,s.jsx)(l.$,{label:"Показать еще",variant:"secondary",onClick:()=>{(0,y._)({eventCategory:"aktsii_spetspredlozheniya",eventActionType:y.y.button,eventActionText:"Показать еще"}),K(!0),p({page:w.page+1,productTypeId:i,sort:k?"ASC":"DESC"}).then(e=>{let t=e.promotions||[],n=e.pagination||{};D(e=>{let s=[...e],a={...w,data:[...w.data,...t],hasMore:w.page+2<(n.totalPages||0),page:w.page+1};return s[A]=a,s}),K(!1)})},pending:W})})]}):(0,s.jsx)(c.ErrorPageWidget,{title:"Сейчас нет активных акций — но вы не потеряете выгоду",subtitle:"Переходите к лучшим предложениям на маркетплейсе",buttonText:"Перейти",className:$().emptyListWidget}),(0,s.jsx)(h.e,{className:$().fullInfoLink,mainPageUrl:"aktsii_spetspredlozheniya",href:"https://finuslugi.ru/disclosure?anchor=documents",target:"_self",text:"Завершенные акции","data-sentry-element":"CheckFullInfoLink","data-sentry-source-file":"Bonus.tsx"})]}),(0,s.jsx)(I,{data:E,isOpen:!!E,onClose:()=>F(null),"data-sentry-element":"BonusDetailModal","data-sentry-source-file":"Bonus.tsx"})]})}},75461:(e,t,n)=>{"use strict";n.d(t,{Y:()=>i});var s=n(17359),a=n(63390);function i(e,t){let{format:n="dd.MM.yyyy"}=t??{};try{let t="string"==typeof e?new Date(e):e;return(0,s.GP)(t,n,{locale:a.ru})}catch{return"string"==typeof e?e:e.toString()}}},81696:e=>{e.exports={page:"Bonus_page__mIpwn",title:"Bonus_title__burQb",filters:"Bonus_filters__dsGlw",chips:"Bonus_chips__47fDo",sortChip:"Bonus_sortChip__wHIwv",selected:"Bonus_selected__VqAVC",sort:"Bonus_sort__qfnJa",grid:"Bonus_grid__6hvY2",pagination:"Bonus_pagination__OZ1_9",emptyListWidget:"Bonus_emptyListWidget__4azBT",sortButton:"Bonus_sortButton__jmAcg",fullInfoLink:"Bonus_fullInfoLink___rFln"}},91421:e=>{e.exports={wrapper:"BonusCard_wrapper__maKLU",loading:"BonusCard_loading__jTpML",imageWrapper:"BonusCard_imageWrapper__5ASsX",text:"BonusCard_text__9G6R2",chips:"BonusCard_chips__KASKR",bgImg:"BonusCard_bgImg__FP__a",bgImgM:"BonusCard_bgImgM___cDSd",img:"BonusCard_img__gmTQV",imgM:"BonusCard_imgM__8nK9b",gradient:"BonusCard_gradient__yuPMG",title:"BonusCard_title__Hc0Uh",description:"BonusCard_description__0lWCI",button:"BonusCard_button__ndixu"}}},e=>{e.O(0,[621,4653,4341,6604,7261,7984,7864,504,5449,9793,8441,2374,7358],()=>e(e.s=24356)),_N_E=e.O()}]);
//# debugId=e5c0dae2-ccae-4f39-bd8f-babbc4ebdbaa