PageSourceSearch

https://planeta-avtodv.ru/_next/static/chunks/pages/search-54880c916b52991d.js

js planeta-avtodv.ru collected 2026-10-08 10:01:04 UTC 10,171 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9603],{8266:function(e,a,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/search",function(){return t(5032)}])},9400:function(e,a,t){"use strict";t.d(a,{o:function(){return n.Z}});var n=t(4635)},223:function(e,a,t){"use strict";var n=t(5893),r=t(7294),l=t(1163),i=t(1358),s=t.n(i);let o=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"Pagination_Label Pagination_Label--mobile","aria-hidden":"true",children:"‹"}),(0,n.jsx)("span",{className:"Pagination_Label Pagination_Label--desktop",children:"Назад"})]}),c=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"Pagination_Label Pagination_Label--desktop",children:"Вперёд"}),(0,n.jsx)("span",{className:"Pagination_Label Pagination_Label--mobile","aria-hidden":"true",children:"›"})]}),u=e=>{let a=Number.parseInt((Array.isArray(e)?e[0]:e)||"1",10);return Number.isFinite(a)&&a>0?a:1},d=(e,a)=>{let[t,n]=e.split("#",2),r=t.indexOf("?"),l=-1===r?t:t.slice(0,r),i=new URLSearchParams(-1===r?"":t.slice(r+1));i.delete("page"),a>1&&i.set("page",a.toString());let s=i.toString();return`${l}${s?`?${s}`:""}${n?`#${n}`:""}`};a.Z=({totalPages:e,currentPage:a,ariaLabel:t="Постраничная навигация"})=>{let i=(0,l.useRouter)(),x=r.useRef(null),m=Number.isFinite(e)?Math.max(0,Math.floor(e)):0,p=u(i.query.page),g=Math.min("number"==typeof a&&Number.isInteger(a)&&a>0?a:p,Math.max(1,m));return(r.useEffect(()=>{var e;let a=null===(e=x.current)||void 0===e?void 0:e.querySelector('[role="navigation"]');null==a||a.setAttribute("aria-label",t)},[t,m]),m<=1)?null:(0,n.jsx)("div",{className:"PaginationNav",ref:x,children:(0,n.jsx)(s(),{pageCount:m,pageRangeDisplayed:3,marginPagesDisplayed:1,forcePage:g-1,onPageChange:({selected:e})=>{let a=d(i.asPath,e+1);a!==i.asPath&&i.push(a,void 0,{scroll:!0})},hrefBuilder:e=>d(i.asPath,e),hrefAllControls:!0,breakLabel:"…",breakAriaLabels:{forward:"Перейти вперёд по страницам",backward:"Перейти назад по страницам"},previousLabel:o,previousAriaLabel:"Предыдущая страница",nextLabel:c,nextAriaLabel:"Следующая страница",ariaLabelBuilder:(e,a)=>a?`Страница ${e}, текущая`:`Перейти на страницу ${e}`,containerClassName:"Pagination",pageClassName:"Pagination_Item",pageLinkClassName:"Pagination_Link",activeClassName:"Pagination_Item--active",activeLinkClassName:"Pagination_Link--active",breakClassName:"Pagination_Item Pagination_Item--break",breakLinkClassName:"Pagination_Link Pagination_Link--break",previousClassName:"Pagination_Item Pagination_Item--control",previousLinkClassName:"Pagination_Link Pagination_Link--control",nextClassName:"Pagination_Item Pagination_Item--control",nextLinkClassName:"Pagination_Link Pagination_Link--control",disabledClassName:"Pagination_Item--disabled",disabledLinkClassName:"Pagination_Link--disabled",renderOnZeroPageCount:null})})}},5032:function(e,a,t){"use strict";t.r(a),t.d(a,{default:function(){return L}});var n=t(5893),r=t(7294),l=t(7866),i=t(9400),s=t(223),o=t(1163),c=t(8100),u=t(4335),d=t(1655),x=t(6418),m=t(9008),p=t.n(m),g=t(4458),h=t(1664),b=t.n(h);let f="inline-flex min-h-[32px] max-w-full min-w-0 items-center gap-[6px] rounded-[4px] border-0 bg-[#f3f3f3] px-[9px] py-[6px] text-[13px] font-normal leading-[1.25] text-[#303030] no-underline hover:bg-[#e7e7e7] hover:text-black focus-visible:outline focus-visible:outline-[3px] focus-visible:outline-offset-2 focus-visible:outline-[rgba(217,159,20,0.32)]",v="text-[12px] font-normal text-[#777]",P=e=>Array.isArray(e)?e[0]:e;var j=({facets:e,activeGroupId:a,totalItems:t})=>{let l=(0,o.useRouter)(),[i,s]=r.useState(!1);if(e.length<2)return null;let c=e.slice(0,8),u=a?e.find(e=>e.id===a):void 0,d=u&&!c.some(e=>e.id===u.id)?[...c.slice(0,7),u]:c,m=i?e:d,p=Math.max(0,e.length-8),g=e=>({pathname:"/search",query:{query:P(l.query.query)||"",query_index:P(l.query.query_index)||"all",...e?{group:e}:{}}}),h=e=>{(0,x.T5)({query:P(l.query.query)||"",query_index:P(l.query.query_index)||"all",group_id:e.id,group_title:e.title,group_count:e.count,total_items:t})};return(0,n.jsx)("nav",{className:"mb-[14px] sm:mb-[18px]","aria-label":"Уточнить результаты по категории",children:(0,n.jsxs)("div",{className:"flex flex-wrap gap-[7px]",children:[(0,n.jsxs)(b(),{href:g(),className:`${f} ${a?"":"bg-[#fff3cf] text-black hover:bg-[#fff3cf]"}`,"aria-current":a?void 0:"page",children:[(0,n.jsx)("span",{className:"min-w-0 max-w-full [overflow-wrap:anywhere] sm:[overflow-wrap:normal]",children:"Все группы"}),(0,n.jsx)("span",{className:`${v} ${a?"":"text-[#4d3a00]"}
1`,children:t.toLocaleString("ru-RU")})]}),m.map(e=>{let t=e.id===a;return(0,n.jsxs)(b(),{href:g(e.id),className:`${f} ${t?"bg-[#fff3cf] text-black hover:bg-[#fff3cf]":""}`,"aria-current":t?"page":void 0,onClick:()=>h(e),children:[(0,n.jsx)("span",{className:"min-w-0 max-w-full [overflow-wrap:anywhere] sm:[overflow-wrap:normal]",children:e.title}),(0,n.jsx)("span",{className:`${v} ${t?"text-[#4d3a00]":""}`,children:e.count.toLocaleString("ru-RU")})]},e.id)}),p>0?(0,n.jsx)("button",{type:"button",className:"inline-flex min-h-[32px] max-w-full min-w-0 cursor-pointer items-center gap-[6px] rounded-[4px] border-0 bg-[#f3f3f3] px-[9px] py-[6px] text-left text-[13px] font-normal leading-[1.25] text-[#555] hover:bg-[#e7e7e7] hover:text-black focus-visible:outline focus-visible:outline-[3px] focus-visible:outline-offset-2 focus-visible:outline-[rgba(217,159,20,0.32)] sm:text-center","aria-expanded":i,onClick:()=>s(e=>!e),children:i?"Скрыть":`Ещё ${p}`}):null]})})};let y=e=>Array.isArray(e)?e[0]:e,_=({query:e,page:a,queryIndex:t,group:n})=>{let r=new URLSearchParams({query:e,page:a,query_index:t});return n&&r.set("group",n),`search?${r.toString()}`},N=()=>{var e;let a=(0,o.useRouter)(),t=y(a.query.query),u=y(a.query.query_index)||"all",d=t?_({query:t,page:y(a.query.page)||"1",queryIndex:u,group:y(a.query.group)}):null,{data:m}=(0,c.ZP)(d),h=`${t||""}\u0000${u}`,b=r.useRef();m&&d&&(b.current={context:h,data:m});let f=m||((null===(e=b.current)||void 0===e?void 0:e.context)===h?b.current.data:void 0),v=!!(d&&!m),P=r.useRef(new Set),N=null==m?void 0:m.activeGroupId,k=null==m?void 0:m.page,L=null==m?void 0:m.query,w=null==m?void 0:m.totalItems,$=null==m?void 0:m.totalUnfilteredItems,T=null==m?void 0:m.searchMode;return r.useEffect(()=>{if(!L||void 0===k||void 0===w)return;let e=$??w,a=`${L}\u0000${u}\u0000${k}`,t=!P.current.has(a);t&&P.current.add(a),!N&&t&&(0,x.E7)({query:L,total_entries:e,page:k,search_mode:T}),(0,g.vL)(L,e)},[N,k,L,u,T,w,$]),(0,n.jsxs)(n.Fragment,{children:["      ",(0,n.jsx)(p(),{children:((null==f?void 0:f.query)||t)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("title",{children:[(null==f?void 0:f.query)||t," купить в интернет магазине Планета-Авто."]}),(0,n.jsx)("meta",{name:"description",content:`
2    Купить ${(null==f?void 0:f.query)||t} по самым выгодным ценам в интернет магазине Планета-Авто. Купить ${(null==f?void 0:f.query)||t} оптом и в розницу. ${(null==f?void 0:f.page)&&f.page>1?`Страница ${f.page}`:""}`})]})}),(0,n.jsxs)(l.Z,{children:[!f&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"SearchResults_Header",children:(0,n.jsx)("h1",{children:t?`Результаты поиска: ${t}`:"Поиск товаров"})}),(0,n.jsx)(q,{})]}),f&&(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"SearchResults_Header",children:[(0,n.jsxs)("h1",{children:["Результаты поиска: ",f.query]}),(0,n.jsxs)("span",{children:["Найдено товаров: ",f.totalItems??0]})]}),(0,n.jsx)(j,{facets:f.categoryFacets||[],activeGroupId:f.activeGroupId,totalItems:f.totalUnfilteredItems??f.totalItems},f.query),v?(0,n.jsx)(q,{}):(0,n.jsxs)(n.Fragment,{children:[0===f.totalItems?(0,n.jsx)("div",{children:"Ничего не найдено."}):null,(0,n.jsx)(i.o,{items:f.items})]}),(0,n.jsx)(s.Z,{totalPages:f.totalPages||0,currentPage:f.page,ariaLabel:"Пагинация результатов поиска"})]})]})]})},q=()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(k,{}),(0,n.jsx)(k,{}),(0,n.jsx)(k,{}),(0,n.jsx)(k,{}),(0,n.jsx)(k,{}),(0,n.jsx)(k,{}),(0,n.jsx)(k,{}),(0,n.jsx)(k,{})]}),k=()=>(0,n.jsxs)("div",{className:"ProductTable-row",children:[(0,n.jsx)("div",{className:"ProductTable-cell-image",children:(0,n.jsx)(d.ZP,{height:60})}),(0,n.jsxs)("div",{className:"ProductTable-content",children:[(0,n.jsxs)("div",{className:"ProductTable-content-props ProductTable-cell",children:[(0,n.jsx)("span",{className:"ProductTable-content-props-title",children:(0,n.jsx)(d.ZP,{})}),(0,n.jsx)("span",{className:"ProductTable-content-props-value",children:(0,n.jsx)(d.ZP,{})}),(0,n.jsx)("span",{className:"ProductTable-content-props-title",children:(0,n.jsx)(d.ZP,{})}),(0,n.jsx)("span",{className:"ProductTable-content-props-value",children:(0,n.jsx)(d.ZP,{})})]}),(0,n.jsx)("div",{className:"ProductTable-content-body ProductTable-cell",style:{marginTop:"5px",marginRight:10,borderRight:"1px solid #d9d9d9"},children:(0,n.jsx)("div",{className:"ProductTable-cell-title",children:(0,n.jsx)(d.ZP,{})})}),(0,n.jsx)("div",{className:"ProductTable-cell-price ProductTable-cell",style:{marginTop:"5px"},children:(0,n.jsx)(d.ZP,{})}),(0,n.jsx)("div",{className:"ProductTable-cell ProductTable-cell-qty",style:{marginTop:"6px"},children:(0,n.jsx)("div",{style:{fontSize:13},children:(0,n.jsx)(d.ZP,{})})}),(0,n.jsx)("div",{className:"ProductTable-cell-form ProductTable-cell",children:(0,n.jsx)(d.ZP,{height:30})})]})]});N.getInitialProps=async e=>{var a;
2let t=_({query:y(e.query.query)||"",page:y(e.query.page)||"1",queryIndex:y(e.query.query_index)||"all",group:y(e.query.group)}),n={};(null===(a=e.req.cookies)||void 0===a?void 0:a.token)&&(n={Authorization:e.req.cookies.token});let r=await u.hi.get(t,{headers:n});return{[t]:r.data}};var L=N}},function(e){e.O(0,[7272,5886,9921,4635,2888,9774,179],function(){return e(e.s=8266)}),_N_E=e.O()}]);

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.