1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5717],{85717:(e,r,t)=>{t.r(r),t.d(r,{BlogSearchDialog:()=>y});var a=t(46520),s=t(36336),l=t(13940),n=t(35621),c=t.n(n),i=t(61368),o=t(44244),m=t(25470),d=t(36539),x=t(26756),g=t(49892),h=t(41077),p=t(50977);let b="blog:recent-searches";function f(){try{let e=localStorage.getItem(b);return e?JSON.parse(e):[]}catch{return[]}}function u(e,r){if(!r.trim())return e;let t=r.toLowerCase().replace(/Ñ/g,"е").split(/\s+/).filter(Boolean);if(0===t.length)return e;let s=RegExp(`(${t.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})`,"gi");return e.replace(/Ñ/gi,"е").split(s).map((e,r)=>s.test(e)?(0,a.jsx)("mark",{className:"bg-amber-100 text-amber-900 rounded px-0.5",children:e},r):(0,a.jsx)("span",{children:e},r))}function y(){let e,r,t,n,y,v,k,_,S,C,A,$,E,L,R,z,K,O,T,I,M,B,D,F,J,P,W,q,G=(0,s.c)(57),[H,Q]=(0,l.useState)(!1),[U,V]=(0,l.useState)("");G[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],G[0]=e):e=G[0];let[X,Y]=(0,l.useState)(e),Z=(0,l.useRef)(null);G[1]===Symbol.for("react.memo_cache_sentinel")?(r=[],G[1]=r):r=G[1];let[ee,er]=(0,l.useState)(r),[et,ea]=(0,l.useState)(!0),[es,el]=(0,l.useState)(!1);G[2]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{let e=new AbortController;return fetch("/api/blog/search",{signal:e.signal}).then(async e=>{if(!e.ok)throw Error("Search unavailable");let r=await e.json();er(Array.isArray(r.articles)?r.articles:[])}).catch(()=>{e.signal.aborted||el(!0)}).finally(()=>{e.signal.aborted||ea(!1)}),()=>e.abort()},n=[],G[2]=t,G[3]=n):(t=G[2],n=G[3]),(0,l.useEffect)(t,n),G[4]!==ee?(y=function(e,r=8){let t=new Map;for(let r of e)for(let e of r.tags)t.set(e,(t.get(e)||0)+1);return[...t].map(([e,r])=>({tag:e,count:r})).sort((e,r)=>r.count-e.count).slice(0,r)}(ee),G[4]=ee,G[5]=y):y=G[5];let en=y;if(G[6]!==ee){let e;(e=new h.A({fields:["title","excerpt","category","tags","keywords"],storeFields:["slug","title","excerpt","category","tags","badge","heroImage","readingTimeMin"],tokenize:e=>e.toLowerCase().replace(/Ñ/g,"е").split(/[^a-zа-Ñ0-9]+/u).filter(e=>e.length>=2),processTerm:e=>{var r;return(r=e.toLowerCase().replace(/Ñ/g,"е")).length<5?r:r.replace(/(?:оваÑÑ|еваÑÑ|иÑоваÑÑ|изаÑиÑ|ение|оÑÑÑ|ÑÑÑÑ)$/u,"").replace(/(?:ами|Ñми|ого|его|омÑ|емÑ|Ñми|ими)$/u,"").replace(/(?:ой|аÑ|ÑÑ|ое|ие|Ñе|аÑ
|ÑÑ
|ом|ем|ам|Ñм|ов|ев|ей)$/u,"").replace(/(?:ÑÑ|ло|ла|ли|ÑÑ|иÑ|аÑ|ÑÑ|ÑÑ|ÑÑ|им|ем)$/u,"").replace(/(?:ка|ки|кой|ке|кÑ|ков|каÑ
)$/u,"").replace(/(?:а|Ñ|и|Ñ|Ñ|е|о|Ñ)$/u,"")},searchOptions:{boost:{title:3,tags:2.5,keywords:2,excerpt:1},prefix:!0,fuzzy:.2,combineWith:"OR"}})).addAll(ee),v=e,G[6]=ee,G[7]=v}else v=G[7];let ec=v;e:{let e;if(!U.trim()){let e;G[8]===Symbol.for("react.memo_cache_sentinel")?(e=[],G[8]=e):e=G[8],k=e;break e}G[9]!==ec||G[10]!==U?(e=ec.search(U).slice(0,8),G[9]=ec,G[10]=U,G[11]=e):e=G[11],k=e}let ei=k;G[12]===Symbol.for("react.memo_cache_sentinel")?(_=()=>{let e=function(e){(e.metaKey||e.ctrlKey)&&"k"===e.key.toLowerCase()&&(e.preventDefault(),Q(w)),"Escape"===e.key&&Q(!1)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},S=[],G[12]=_,G[13]=S):(_=G[12],S=G[13]),(0,l.useEffect)(_,S),G[14]!==H?(A=()=>{H?(Y(f()),setTimeout(()=>Z.current?.focus(),50)):V("")},C=[H],G[14]=H,G[15]=C,G[16]=A):(C=G[15],A=G[16]),(0,l.useEffect)(A,C),G[17]!==U?($=()=>{U.trim()&&function(e){if(!e.trim())return;let r=f().filter(r=>r!==e),t=[e,...r].slice(0,5);localStorage.setItem(b,JSON.stringify(t))}(U.trim()),Q(!1)},G[17]=U,G[18]=$):$=G[18];let eo=$;if(!H){let e,r;return G[19]===Symbol.for("react.memo_cache_sentinel")?(e=()=>Q(!0),G[19]=e):e=G[19],G[20]===Symbol.for("react.memo_cache_sentinel")?(r=(0,a.jsxs)("button",{onClick:e,className:"group inline-flex items-center gap-2 rounded-lg border border-gray-200 bg-white px-3 py-2 text-sm text-gray-500 transition-colors hover:border-amber-300 hover:bg-amber-50/40 hover:text-amber-900",children:[(0,a.jsx)(i.A,{className:"h-4 w-4"}),(0,a.jsx)("span",{children:"ÐайÑи ÑÑаÑÑÑ..."}),(0,a.jsx)("kbd",{className:"ml-auto hidden rounded border border-gray-200 bg-gray-50 px-1.5 py-0.5 font-mono text-[10px] font-medium text-gray-500 group-hover:border-amber-200 sm:inline",children:"âK"})]}),G[20]=r):r=G[20],r}return G[21]===Symbol.for("react.memo_cache_sentinel")?(E=()=>Q(!1),G[21]=E):E=G[21],G[22]===Symbol.for("react.memo_cache_sentinel")?(L=(0,a.jsx)(i.A,{className:"h-4 w-4 shrink-0 text-gray-400"}),G[22]=L):L=G[22],G[23]===Symbol.for("react.memo_cache_sentinel")?(R=e=>V(e.target.value),G[23]=R):R=G[23],G[24]!==U?(z=(0,a.jsx)("input",{ref:Z,value:U,onChange:R,placeholder:"ÐоиÑк по ÑÑаÑÑÑм, Ñемам, Ñегам...",className:"flex-1 bg-transparent text-base text-gray-900 placeholder:text-gray-400 focus:outline-none"}),G[24]=U,G[25]=z):z=G[25],G[26]===Symbol.for("react.memo_cache_sentinel")?(K=()=>Q(!1),G[26]=K):K=G[26],G[27]===Symbol.for("react.memo_cache_sentinel")?(O=(0,a.jsx)("button",{onClick:K,className:"shrink-0 rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-700","aria-label":"ÐакÑÑÑÑ Ð¿Ð¾Ð¸Ñк",children:(0,a.jsx)(o.A,{className:"h-4 w-4"})}),G[27]=O):O=G[27],G[28]!==z?(T=(0,a.jsxs)("div",{className:"flex items-center gap-3 border-b border-gray-100 px-4 py-3",children:[L,z,O]}),G[28]=z,G[29]=T):T=G[29],G[30]!==es||G[31]!==et?(I=(et||es)&&(0,a.jsx)("p",{role:"status",className:"px-4 py-3 text-sm text-gray-500",children:et?"ÐагÑÑжаем опÑбликованнÑе ÑÑаÑÑиâ¦":"Ðе ÑдалоÑÑ Ð·Ð°Ð³ÑÑзиÑÑ Ð¿Ð¾Ð¸Ñк. ÐбновиÑе ÑÑÑаниÑÑ Ð¸Ð»Ð¸ вÑбеÑиÑе каÑегоÑиÑ."}),G[30]=es,G[31]=et,G[32]=I):I=G[32],G[33]!==eo||G[34]!==es||G[35]!==et||G[36]!==U||G[37]!==ei?(M=U.trim()&&!et&&!es&&(0,a.jsx)(a.Fragment,{children:0===ei.length?(0,a.jsxs)("div",{className:"px-4 py-10 text-center text-sm text-gray-400",children:["ÐиÑего не наÑли по запÑоÑÑ ",(0,a.jsxs)("span",{className:"font-medium text-gray-700",children:["\xab",U,"\xbb"]}),".",(0,a.jsx)("br",{}),"ÐопÑобÑй дÑÑгÑÑ ÑоÑмÑлиÑÐ¾Ð²ÐºÑ Ð¸Ð»Ð¸ вÑбеÑи Ñег ниже."]}):(0,a.jsx)("div",{className:"py-2",children:ei.map(e=>(0,a.jsxs)(c(),{href:`/blog/${e.slug}`,onClick:eo,className:"flex items-start gap-3 px-4 py-3 transition-colors hover:bg-amber-50/40",children:[(0,a.jsx)("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-amber-100 text-base",children:p.R.find(r=>r.slug===e.category)?.emoji??"\uD83D\uDCC4"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"line-clamp-2 text-sm font-semibold text-gray-900",children:u(e.title,U)}),(0,a.jsx)("div",{className:"mt-0.5 line-clamp-2 text-xs text-gray-500",children:u(e.excerpt,U)}),(0,a.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-gray-400",children:[(0,a.jsx)("span",{className:"rounded-md bg-gray-100 px-1.5 py-0.5 font-medium",children:p.R.find(r=>r.slug===e.category)?.label??e.category}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-0.5",children:[(0,a.jsx)(m.A,{className:"h-3 w-3"}),e.readingTimeMin," мин"]}),e.tags.slice(0,2).map(j)]})]})]},e.slug))})}),G[33]=eo,G[34]=es,G[35]=et,G[36]=U,G[37]=ei,G[38]=M):M=G[38],G[39]!==ee||G[40]!==es||G[41]!==et||G[42]!==U||G[43]!==X||G[44]!==en?(B=!U.trim()&&(0,a.jsxs)("div",{className:"px-4 py-4",children:[(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-gray-400",children:[(0,a.jsx)(d.A,{className:"h-3 w-3"})," ÐаÑегоÑии"]}),(0,a.jsx)("div",{className:"grid gap-1.5 sm:grid-cols-2",children:p.R.map(e=>(0,a.jsxs)(c(),{href:`/blog?category=${e.slug}`,onClick:()=>Q(!1),className:"flex items-center gap-2.5 rounded-lg border border-gray-200 bg-white px-3 py-2 text-sm transition-colors hover:border-amber-300 hover:bg-amber-50/40",children:[(0,a.jsx)("span",{className:"text-base",children:e.emoji}),(0,a.jsx)("span",{className:"font-medium text-gray-900",children:e.label})]},e.slug))})]}),X.length>0&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-gray-400",children:[(0,a.jsx)(m.A,{className:"h-3 w-3"})," Ðедавние"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:X.map(e=>(0,a.jsxs)("button",{onClick:()=>V(e),className:"inline-flex items-center gap-1.5 rounded-md border border-gray-200 bg-white px-2.5 py-1 text-xs text-gray-700 hover:border-amber-300 hover:bg-amber-50/40",children:[(0,a.jsx)(i.A,{className:"h-3 w-3 text-gray-400"}),e]},e))})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-gray-400",children:[(0,a.jsx)(x.A,{className:"h-3 w-3"})," ÐопÑлÑÑнÑе Ñеги"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:en.map(e=>{let{tag:r,count:t}=e;return(0,a.jsxs)(c(),{href:`/blog?tag=${r}`,onClick:()=>Q(!1),className:"inline-flex items-center gap-1 rounded-md border border-gray-200 bg-white px-2.5 py-1 text-xs hover:border-amber-300 hover:bg-amber-50/40",children:[(0,a.jsxs)("span",{className:"font-medium text-amber-800",children:["#",r]}),(0,a.jsx)("span",{className:"text-gray-400",children:t})]},r)})})]}),(0,a.jsxs)("div",{className:"mt-4 border-t border-gray-100 pt-3 text-xs text-gray-400",children:[(0,a.jsx)(g.A,{className:"mr-1 inline-block h-3 w-3"}),et?"ÐагÑÑзка каÑалогаâ¦":es?"ÐаÑалог поиÑка вÑеменно недоÑÑÑпен":`ÐÑего ${ee.length} опÑбликованнÑÑ
ÑÑаÑей в блоге`]})]}),G[39]=ee,G[40]=es,G[41]=et,G[42]=U,G[43]=X,G[44]=en,G[45]=B):B=G[45],G[46]!==I||G[47]!==M||G[48]!==B?(D=(0,a.jsxs)("div",{className:"max-h-[60vh] overflow-y-auto",children:[I,M,B]}),G[46]=I,G[47]=M,G[48]=B,G[49]=D):D=G[49],G[50]===Symbol.for("react.memo_cache_sentinel")?(F=(0,a.jsx)("kbd",{className:"rounded border border-gray-200 bg-white px-1 py-0.5 font-mono text-[10px]",children:"ââ"}),G[50]=F):F=G[50],G[51]===Symbol.for("react.memo_cache_sentinel")?(J=(0,a.jsx)("kbd",{className:"ml-2 roun
1ded border border-gray-200 bg-white px-1 py-0.5 font-mono text-[10px]",children:"âµ"}),G[51]=J):J=G[51],G[52]===Symbol.for("react.memo_cache_sentinel")?(P=(0,a.jsxs)("span",{children:[F," навигаÑиÑ",J," оÑкÑÑÑÑ",(0,a.jsx)("kbd",{className:"ml-2 rounded border border-gray-200 bg-white px-1 py-0.5 font-mono text-[10px]",children:"Esc"})," закÑÑÑÑ"]}),G[52]=P):P=G[52],G[53]===Symbol.for("react.memo_cache_sentinel")?(W=(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 border-t border-gray-100 bg-gray-50/50 px-4 py-2 text-[11px] text-gray-500",children:[P,(0,a.jsxs)("span",{className:"hidden sm:inline",children:[(0,a.jsx)("kbd",{className:"rounded border border-gray-200 bg-white px-1 py-0.5 font-mono text-[10px]",children:"âK"})," в лÑбом меÑÑе"]})]}),G[53]=W):W=G[53],G[54]!==T||G[55]!==D?(q=(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/50 p-4 pt-[10vh] backdrop-blur-sm",onClick:E,children:(0,a.jsxs)("div",{className:"w-full max-w-2xl overflow-hidden rounded-2xl border border-gray-200 bg-white shadow-2xl",onClick:N,children:[T,D,W]})}),G[54]=T,G[55]=D,G[56]=q):q=G[56],q}function j(e){return(0,a.jsxs)("span",{className:"text-amber-700",children:["#",e]},e)}function N(e){return e.stopPropagation()}function w(e){return!e}}}]);
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.