PageSourceSearch

https://www.bspb.ru/_next/static/chunks/5684-08475a8d3f3f1077.js

js bspb.ru collected 2026-10-09 16:48:00 UTC 10,192 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5684],{12102:function(e,n,t){t.d(n,{Z:function(){return i}});let i={FaqPageSchemaAttr:{itemScope:!0,itemType:"https://schema.org/FAQPage"},QuestionSchemaAttr:{itemScope:!0,itemType:"https://schema.org/Question",itemProp:"mainEntity"},AnswerSchemaAttr:{itemScope:!0,itemType:"https://schema.org/Answer",itemProp:"acceptedAnswer"},fields:{text:{itemProp:"text"},name:{itemProp:"name"},headline:{itemProp:"headline"},alternativeHeadline:{itemProp:"alternativeHeadline"}}}},81323:function(e,n,t){t.d(n,{Z:function(){return filter_Filter}});var i=t(85893),l=t(29222),r=t(31708),o=t(23100),a=t(776),c=t(67294),d=t(31086),s=t(90061),u=t(11163),p=t(21179),hooks_useSelectFilter=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,{width:n}=(0,p.i)(),t=(0,u.useRouter)(),[i,l]=(0,c.useState)(e),[r,o]=(0,c.useState)([]);return(0,c.useEffect)(()=>{if(!(null==r?void 0:r.length))return;if(!window.location.hash){l(void 0);return}let e=window.location.hash.split("-"),n=(null==e?void 0:e[1])?r.findIndex(n=>(null==n?void 0:n.anchorName)===e[1]):r.findIndex(n=>(null==n?void 0:n.anchorName)===e[0].slice(1));-1===n&&l(void 0),l({children:[],parent:null,...r[n]})},[r]),(0,c.useEffect)(()=>{var e,l;let{slug:o,...a}=t.query;if(null==i?void 0:i.anchorName){if(n<1024&&(null===(e=i.parent)||void 0===e?void 0:e.anchorName)){t.replace({pathname:window.location.pathname,query:a,hash:"".concat(i.parent.anchorName,"-").concat(null==i?void 0:i.anchorName)},void 0,{shallow:!0});return}if(r.length){if(null==i?void 0:null===(l=i.parent)||void 0===l?void 0:l.anchorName){let{href:e}=window.location;t.replace({pathname:window.location.pathname,query:a,hash:"".concat(e.split("#")[1].split("-")[0],"-").concat(null==i?void 0:i.anchorName," ")},void 0,{shallow:!0});return}void 0===i&&t.replace("".concat(window.location.pathname),void 0,{scroll:!1,shallow:!0}),t.replace({pathname:window.location.pathname,query:a,hash:null==i?void 0:i.anchorName},void 0,{shallow:!0})}}},[i]),[i,l,o]},f=t(71338),v=t(41597),filter_Filter=e=>{let{children:n,categories:t,getData:u,titleComponet:p,disabledScrollToCategory:m=!1,disabledScrollToFilterButton:g=!1,isBgButtonPrimary:w=!0}=e,{isMobile:x}=(0,v.k)(),[y,b]=(0,c.useState)(!1),[k,j,S]=hooks_useSelectFilter(),C=(0,c.useRef)(null),E=(0,c.useRef)(null),T=(0,c.useCallback)(()=>b(e=>!e),[]),B=(0,c.useCallback)(()=>{C.current&&x&&(0,f.W)(C,s.LI+12)},[x]);return(0,c.useEffect)(()=>{null!==k&&k!==E.current&&(E.current=k,u(k),x&&!g&&B())},[k,u,x,B]),(0,c.useEffect)(()=>{t&&S(t)},[t,S]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.z,{ref:C,onClick:T,w:"100%",mb:{base:"space.20",sm:0},display:{base:"flex",sm:"none"},variant:"primary",children:"Фильтры"}),(0,i.jsxs)(r.r,{templateColumns:{base:"repeat(1, 1fr)",sm:"repeat(3, 1fr)"},children:[void 0!==x&&(x?(0,i.jsx)(o.xu,{display:{base:"block",sm:"none"},children:(0,i.jsx)(d.LJ,{selected:k,onConfirm:j,list:(0,d.zW)(t),onClose:T,isOpen:y,titleComponet:p})}):(0,i.jsx)(a.P,{colSpan:1,display:{base:"none",sm:"grid"},children:(0,i.jsx)(d.fS,{categorySelect:k,onCategorySelect:j,list:(0,d.zW)(t),titleComponet:p,disabledScrollToCategory:m,isBgButtonPrimary:w})})),n]})]})}},31086:function(e,n,t){t.d(n,{LJ:function(){return FilterBackdrop},fS:function(){return TreeMenu},zW:function(){return formatter}}),t(81323);var i=t(85893),l=t(91669),r=t(94060),o=t(80552),a=t(95319),c=t(204),d=t(29222),s=t(67294),u=t(71143),p=t(15695),f=t(52982),v=t(35393),m=t(11274);let getFormatedList=e=>{let n=[],t=1,recursive=function(e,i){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;for(let r of(t=l,e)){let e={...r,depth:t};i&&(e={...e,parent:i}),n.push(e),r.children.length&&(t+=1,recursive(r.children,r,t))}t=1};return recursive(e,null),n},groupBy=(e,n)=>e.reduce((e,t)=>((e[t[n]]=e[t[n]]||[]).push(t),e),{}),range=e=>Array(e).fill(1).map((e,n)=>e+n),FilterBackdrop=e=>{let{isOpen:n,onClose:t,onConfirm:g,selected:w,list:x,titleComponet:y}=e,[b,k]=(0,s.useState)(1),[j,{set:S,remove:C,reset:E,setAll:T}]=(0,u.Z)(new Map),B=(0,s.useMemo)(()=>
1getFormatedList(x),[x]),[P,N]=(0,s.useState)(!1);(0,s.useEffect)(()=>{if(!w)return;let e=B.find(e=>e.id===w.id),n={},getParent=(e,t)=>{n={[t]:e,...n},e.parent&&getParent(e.parent,t-1)};getParent(e,e.depth),E(),T(n),k(Object.keys(n).length)},[n]);let I=(0,s.useCallback)(()=>{let e=groupBy(B,"depth"),n=range(b).map(n=>e[n]);return n.map((e,n)=>{var t,c,d,s;let u=null==e?void 0:e.filter(e=>{var t,i;return void 0===j["".concat(n)]||(null===(t=j["".concat(n)])||void 0===t?void 0:t.id)==(null===(i=e.parent)||void 0===i?void 0:i.id)});return(0,i.jsxs)(l.g,{align:"flex-start",spacing:"space.20",children:[(0,i.jsx)(m.Z,{children:null!==(d=null===(t=j["".concat(n)])||void 0===t?void 0:t.label)&&void 0!==d?d:"Категории"}),(0,i.jsx)(r.E,{children:(0,i.jsx)(o.E,{spacing:"space.12",children:null==u?void 0:u.map(e=>{var t,l;return(0,i.jsx)(o.U,{onClick:()=>{var n;if((null===(n=j[e.depth])||void 0===n?void 0:n.id)===e.id){for(let n=Object.keys(j).length-e.depth;n>=0;n--)C(e.depth+n);k(e.depth),N(!0)}},onChange:()=>{var n,t;if(!P&&(null===(n=j[e.depth])||void 0===n?void 0:n.id)!==e.id){S(e.depth,e);let n=e.children.length?e.depth+1:e.depth;if(k(n),e.depth<Object.keys(j).length)for(let n=Object.keys(j).length;n>e.depth;n--)C(n)}(0,p.B)({action:p.yk.CLICK,label:"filter_".concat(y,"_").concat(null!==(t=e.label)&&void 0!==t?t:e.name),category:p.pN.BUTTON}),N(!1)},children:(0,i.jsx)(a.Y,{variant:"filter-item",isChecked:(null===(t=j[n+1])||void 0===t?void 0:t.id)===e.id,children:null!==(l=e.label)&&void 0!==l?l:e.name})},"category-".concat(e.name))})})})]},"cat-".concat(null!==(s=null===(c=j["".concat(n)])||void 0===c?void 0:c.name)&&void 0!==s?s:"major"))})},[B,b,j,P]);return(0,i.jsx)(f.l.Backdrop,{variant:"backdropFilter",onClose:t,isOpen:n,headerContent:(0,i.jsx)(v.Z,{variant:"h2",children:"Фильтры"}),children:(0,i.jsxs)(c.k,{direction:"column",gap:"space.20",children:[(0,i.jsx)(l.g,{borderTopLeftRadius:"16px",borderTopRightRadius:"16px",zIndex:10,align:"flex-start",spacing:"space.20",children:I()}),(0,i.jsx)(d.z,{w:"100%",onClick:()=>{g(j[Object.keys(j).pop()]),t()},children:"Применить"})]})})},formatter=e=>{let n=e.reduce((e,n,t)=>null===n.parent?{[n.id]:{index:t,children:{}},...e}:e,{}),t=e.reduce((e,n,t)=>(null===n.parent||(e.hasOwnProperty(n.parent.id)||(e[n.parent.id]={index:t,children:{}}),e[n.parent.id].children={...e[n.parent.id].children,[n.id]:{index:t}}),e),{...n}),i=Object.keys(n).map(t=>({...e[n[t].index],children:[]}));return i.forEach(n=>{let l=function addNode(n){var i;if(!(null===(i=t[n.id])||void 0===i?void 0:i.children))return null;let l=Object.keys(t[n.id].children);if(!l.length)return null;l.forEach(i=>{let l=t[n.id].children[i].index;n.children.push({...e[l],children:[]});let r=n.children[n.children.length-1],o=addNode(r);return o||r})}(n);l&&i.push(l)}),i};var g=t(5077),w=t(77484),x=t(64657),y=t(36024),b=t(12102);let TreeMenu=e=>{var n,t;let{list:l,onCategorySelect:r,categorySelect:o,titleComponet:a,disabledScrollToCategory:c=!1,isBgButtonPrimary:d=!0,...u}=e,[f,m]=(0,s.useState)(null),[k,j]=(0,s.useState)([]),S=(0,s.useRef)(null),[C,E]=(0,s.useState)(!1),recursive=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$",t=[];return e.forEach((e,l)=>{var o,c;let d=k.findIndex(e=>e==="".concat(n,"-").concat(l)),s=-1!==d,u=k.findIndex(e=>e.includes("".concat(n,"-"))),f=-1!==u;t.push((0,i.jsxs)(g.Q,{id:"category-".concat(e.id),children:[(0,i.jsx)(w.K,{onClick:()=>{var t;(0,p.B)({action:p.yk.CLICK,label:"filter_".concat(a,"_").concat(null!==(t=e.label)&&void 0!==t?t:e.name),category:p.pN.BUTTON}),j(e=>s?e.slice(0,d):(f&&e.splice(u),e.push("".concat(n,"-").concat(l)),e)),r(n=>{var t;if((null==n?void 0:n.id)!==(null==e?void 0:e.id)&&(null==n?void 0:null===(t=n.parent)||void 0===t?void 0:t.id)!==e.id)return e})},ref:s?S:null,children:(0,i.jsx)(v.Z,{variant:"h3",...b.Z.fields.headline,children:null!==(c=e.label)&&void 0!==c?c:e.name})}),(null==e?void 0:null===(o=e.children)||void 0===o?void 0:o.length)>0&&createAccordion(e.children,"".concat(n,"-").concat(l))]},e.id))}),t},createAccordion=(e,n)=>{let t=k.findIndex(e=>e.includes("".concat(n,"-"))),l=-1!==t?parseInt(k[t].split("-").pop()):null;return(0,i.jsx)(x.H,{children:(0,i.jsx)(y.U,{index:l,defaultChecked:!1,variant:"tree-menu",customProps:{isBgButtonPrimary:d},allowToggle:!0,children:recursive(e,n)})})};return(0,s.useEffect)(()=>{m(recursive(l))},[l,k]),(0,s.useEffect)(()=>
1{if(!o||k.length)return;if(!(null==o?void 0:o.parent)){j(["$-".concat(l.findIndex(e=>e.id===o.id))]);return}let e=[o.id],n=o;for(;n.parent;)n=n.parent,e.push(n.id);let t=l,i="$",r=[];for(let n=e.length-1;n>=0;--n){let l=t.findIndex(t=>t.id===e[n]);t=t[l].children,i+="-".concat(l),r.push(i)}r.push(),j(r)},[o]),(0,s.useEffect)(()=>{if(!c&&S.current&&!C){let e=window.location.hash;e&&(S.current.scrollIntoView({behavior:"smooth",block:"start"}),E(!0))}},[f,k,C]),(0,i.jsx)(y.U,{allowToggle:!0,paddingRight:{sm:"space.20",md:"space.40"},pos:"sticky",top:"100px",variant:"tree-menu",customProps:{isBgButtonPrimary:d},index:(null==k?void 0:null===(n=k[0])||void 0===n?void 0:n.slice(2))?parseInt(null==k?void 0:null===(t=k[0])||void 0===t?void 0:t.slice(2)):null,...u,children:f})}},21179:function(e,n,t){t.d(n,{i:function(){return useWindowSize}});var i=t(67294);let getSize=()=>({width:window.innerWidth,height:window.innerHeight}),l={width:0,height:0},useWindowSize=()=>{let[e,n]=(0,i.useState)(l);return(0,i.useEffect)(()=>n(getSize()),[]),(0,i.useEffect)(()=>{let h=()=>n(getSize());return window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)},[]),e}},71338:function(e,n,t){t.d(n,{W:function(){return scrollToElementByRef}});let scroll=(e,n)=>{let t=e.current.getBoundingClientRect().top+window.pageYOffset-n;window.scrollTo({top:t,behavior:"smooth"})},scrollToElementByRef=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(e){if(t){let i=setTimeout(()=>scroll(e,n),t);return()=>clearTimeout(i)}scroll(e,n)}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.