(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3340],{5805:(e,t,i)=>{"use strict";i.d(t,{SW:()=>n,Ss:()=>l,Wi:()=>a});var s=i(4997);let r="/new",n=e=>e===r||e.startsWith(`${r}/`),o=()=>"true"!==(0,s.p)().NEXT_PUBLIC_USE_MP_SC_ORGANIZATION,a=e=>e===r||e===`${r}/`?"/":e.startsWith(`${r}/`)?e.slice(r.length):e,l=(e,t=o())=>{if(!t||e===r||e.startsWith(`${r}/`))return e;if(e.startsWith("http://")||e.startsWith("https://"))try{let t=new URL(e);return t.pathname=l(t.pathname,!0),`${t.origin}${t.pathname}${t.search}${t.hash}`}catch{return e}let i=e.startsWith("/")?e:`/${e}`;return`${r}${i}`}},7479:e=>{e.exports={sortTypeContainer:"SortRadios_sortTypeContainer__rw38k",newSortRadioSortTypeContainer:"SortRadios_newSortRadioSortTypeContainer__gAisM",divider:"SortRadios_divider__lEkM5",sortType:"SortRadios_sortType__Qj4aq",sortTypeRadio:"SortRadios_sortTypeRadio__xtm9_",sortTypeTooltip:"SortRadios_sortTypeTooltip__Mroph",sortTypeTrigger:"SortRadios_sortTypeTrigger__rCqZy",sortTypeHead:"SortRadios_sortTypeHead__1jHka",newSortRadioSortTypeHead:"SortRadios_newSortRadioSortTypeHead___pSLe",sortTypeButton:"SortRadios_sortTypeButton__O_Kyq",newSortRadioSortTypeButton:"SortRadios_newSortRadioSortTypeButton__7MmTc"}},34557:(e,t,i)=>{"use strict";i.d(t,{X:()=>r});var s=i(81853);let r=e=>(e||0===e)&&"number"==typeof e?(0,s.N)(e,2):null},42003:(e,t,i)=>{"use strict";i.d(t,{x:()=>y});var s=i(95155),r=i(12115),n=i(84685),o=i(24691),a=i(25032),l=i(66216),c=i(37940),d=i(14347),u=i(29722),_=i(27757),p=i(89584),h=i(7479),m=i.n(h);let C=({isMobile:e,onChangeSort:t,isIncreaseSort:i})=>(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("p",{className:(0,u.A)(m().sortTypeHead),children:[(0,s.jsx)("button",{style:{marginLeft:"0px",marginRight:e?"0px":"8px"},className:(0,u.A)(m().sortTypeButton),onClick:t,children:(0,s.jsx)(n.yZ$,{className:(0,u.A)(!i&&m().iconInverted)})}),"Сортировать"]})}),S=(0,r.memo)(({isMobile:e,onChangeSort:t,isIncreaseSort:i,onChangeSortType:r,sortTypeItems:n,sortTypeValue:o,isNewSortRadios:a})=>(0,s.jsxs)(s.Fragment,{children:[!a&&e&&(0,s.jsx)(C,{onChangeSort:t,isMobile:e,isIncreaseSort:i}),(0,s.jsxs)("div",{className:(0,u.A)(m().sortTypeContainer,a&&m().newSortRadioSortTypeContainer),onClick:e=>e.stopPropagation(),children:[a&&(0,s.jsx)(C,{onChangeSort:t,isMobile:e,isIncreaseSort:i}),n.map(e=>(0,s.jsx)("div",{"data-qa":`${e.value}_radio`,className:m().sortType,children:(0,s.jsx)(p.s,{onChange:()=>{r(e.value)},name:`${e.value}_radio`,label:e.label,checked:e.value===o,className:m().sortTypeRadio,value:e.value})},e.value))]})]}));S.displayName="SortRadios";var x=i(72435);let R=12;var f=i(60863),T=i.n(f);let y=(0,r.memo)(({isClose:e,chips:t,onClickParams:i,isIncreaseSort:p,onChangeIncreaseSort:h,sortTypeItems:m,sortTypeValue:C,onChangeSortType:f,isFixed:y,portalId:v,onClickChip:j,className:g,isNewSortRadios:N})=>{let L=(0,d.nu)("m"),{containerRef:w,isOverflow:F,minLength:k,handleCompute:b}=(({length:e,isActive:t=!0,gap:i=R,rows:s=1})=>{let[n,o]=(0,r.useState)(!1),a=(0,r.useRef)([]),l=(0,r.useRef)(null),c=(0,r.useRef)(null),d=(0,r.useRef)(()=>null),u=(0,r.useRef)(0),[_,p]=(0,r.useState)(e),h=(0,r.useRef)(((e=300)=>{let t=null;return i=>{t&&clearInterval(t),t=setTimeout(i,e)}})(700)),m=(0,r.useCallback)(()=>{o(!1),setTimeout(()=>{let t=c.current?.getBoundingClientRect().width??0,r=1,n=0,l=0;for(let e=0;e<=a.current.length;e++){let o=a.current[e];if(!o)continue;let c=o.getBoundingClientRect().width+i;if(c>=t&&(c=t),(n+=c)>=t*r){if(r>=s){n-=c;break}n>t*r&&(n+=t*r-(n-c)),r++}l++}o(e>l),p(l),u.current=n})},[i,e,s]);return(0,r.useEffect)(()=>{if(window.removeEventListener("resize",d.current),t)return d.current=()=>h.current(m),d.current(),window.addEventListener("resize",d.current),()=>window.removeEventListener("resize",d.current)},[m,t]),(0,r.useEffect)(()=>{if(n){let e=(c.current?.getBoundingClientRect().width??0)*s,t=(l.current?.getBoundingClientRect().width??0)+u.current-e;t>0&&p(e=>{let s=0;for(let r=e;r>=0;r--){let e=a.current[r],n=e?.getBoundingClientRect().width;if(e&&n&&(s++,(t-=n+i)<=0))break}return e-s})}},[i,n,s]),{isOverflow:n,minLength:_,chipsRef:a,buttonRef:l,containerRef:c,handleCompute:m}})({length:t.length,isActive:!L}),[B,$]=(0,r.useState)(!1),M=L?k:4,A=L?F:B,[E,I]=(0,r.useState)(!1),[W,z]=(0,r.useState)(!1),[H,P]=(0,r.useState)(!1),q=t.length-M,Z=(0,r.useMemo)(()=>[{id:"overflow",label:`${E?"Скрыть":"Ещё"} ${q}`}],[E,q]),O=(0,r.useCallback)(()=>{L?z(e=>!e):I(e=>!e)},[L]),Q=(0,r.useRef)(void 0);(0,r.useEffect)(()=>{let t=Q.current;if(void 0===e)return;let i=L?W:E;if(!i||t===e){Q.current=e;return}(t!==e||i)&&(O(),Q.current=e)},[O,e,L,W,E]);let U=(0,r.useCallback)(()=>{z(!1),setTimeout(()=>i?.(),300)},[i]),D=()=>P(e=>!e),J=(0,r.useCallback)(()=>h?.(!p),[p,h]);(0,r.useEffect)(()=>{L&&($(!1),$(t.length>4))},[t.length,L]),(0,r.useEffect)(()=>{b()},[b,y]);let K=(0,s.jsx)("div",{className:(0,u.A)(!L&&N&&T().sortTypeDesktop),children:(0,s.jsx)(S,{isMobile:L,isIncreaseSort:p,onChangeSort:J,onChangeSortType:f,sortTypeItems:m,sortTypeValue:C,isNewSortRadios:N,portalId:v})}),V=m.find(e=>e.value===C);return(0,s.jsxs)("div",{className:(0,u.A)(T().filter,N&&T().newSortRadiosFilter,y&&T().stuck,g),children:[(0,s.jsx)(l.m,{className:T().mainContainer,children:(0,s.jsxs)("div",{className:T().container,children:[(0,s.jsxs)("div",{className:(0,u.A)(T().chipsContainer,!E&&T().chipsContainerClosed),ref:w,children:[(0,s.jsx)(a.C,{size:"l",onChipClick:e=>j?.(e),className:T().chips,variant:"secondary",chips:t.slice(0,L||E||!A?t.length:M)}),!L&&F&&q>0&&(0,s.jsx)(a.C,{size:"l",className:T().chips,variant:"secondary",chips:Z,onChipClick:O})]}),(0,s.jsxs)("div",{className:T().actionsWrapper,children:[(0,s.jsxs)("button",{className:(0,u.A)(T().action,T().actionButton),onClick:i,children:[(0,s.jsx)(n.uJ7,{size:22,className:T().icon}),(0,s.jsx)("span",{className:T().actionText,children:"Все параметры"})]}),(0,s.jsxs)("div",{className:T().action,children:[(0,s.jsx)("button",{className:(0,u.A)(T().icon,T().iconButton,!p&&T().iconInverted),onClick:L&&y?D:J,children:(0,s.jsx)(n.yZ$,{size:22})}),(0,s.jsxs)(c.ms,{opened:!L&&H,placement:"bottom-end",onToggle:D,children:[(0,s.jsx)(c.uu,{children:(0,s.jsx)("span",{className:(0,u.A)(T().actionText,T().actionButton),"data-qa":`${C}_order`,children:V?.shortLabel||V?.label||"Сортировка"})}),(0,s.jsx)(c.pm,{children:K})]})]})]})]})}),(0,s.jsxs)(_.Z,{id:v,children:[(0,s.jsx)(x.L,{footer:(0,s.jsx)(o.$,{className:T().modalButton,onClick:U,label:"Изменить параметры"}),className:(0,u.A)(T().modal,N&&T().newSortRadioModal),isOpen:W,onClose:O,children:(0,s.jsx)("div",{className:T().chipsContainerModal,children:(0,s.jsx)(a.C,{chips:t,className:T().chips,size:"l",variant:"secondary",onChipClick:U})})}),(0,s.jsx)(x.L,{className:(0,u.A)(T().modal,N&&T().newSortRadioModal),isSmallPopup:N,onClose:D,isOpen:!!(H&&L),footer:(0,s.jsx)(o.$,{size:N?"s":"m",className:T().modalButton,label:"Применить",onClick:D}),children:K})]})]})});y.displayName="ListFilter"},60863:e=>{e.exports={filter:"ListFilter_filter__E5PHL",newSortRadiosFilter:"ListFilter_newSortRadiosFilter__2dflS",sortTypeDesktop:"ListFilter_sortTypeDesktop__Yef7U",container:"ListFilter_container__Molcd",modal:"ListFilter_modal__0Q3R9",newSortRadioModal:"ListFilter_newSortRadioModal__5K1jd",modalButton:"ListFilter_modalButton__0Q3M3",chipsContainerModal:"ListFilter_chipsContainerModal__h_MAJ",chipsContainer:"ListFilter_chipsContainer__jKEfP",chips:"ListFilter_chips__bWY2z",chipsContainerClosed:"ListFilter_chipsContainerClosed__RmbSt",actionsWrapper:"ListFilter_actionsWrapper__87DPh",action:"ListFilter_action__AVlfa",actionText:"ListFilter_actionText__6vJqS",iconButton:"ListFilter_iconButton__nt1oX",actionButton:"ListFilter_actionButton__hRj9y",icon:"ListFilter_icon__G3naU",iconInverted:"ListFilter_iconInverted__zfVvQ",stuck:"ListFilter_stuck__CJKpN",mainContainer:"ListFilter_mainContainer__13FFs",chip:"ListFilter_chip__QBtZg"}},81853:(e,t,i)=>{"use strict";function s(e,t=2){return+e.toFixed(t)}i.d(t,{N:()=>s})}}]);