import{k as c,j as a}from"./vendor.e6eaca24.js";import{b as o,u as n,a as i,t as m,E as d}from"./index.c6944236.js";import{P as u}from"./PreviewSearch.7b29c032.js";import{a as P}from"./utils.47c10adb.js";const h=o.serverPreference.pagination.searchProblemsPreview;let S=r=>{const t=n("components.problem_search");return a(u,{className:r.className,placeholder:r.placeholder||t(".placeholder"),noResultsMessage:t(".no_result"),onGetResultKey:e=>e.meta.id,onSearch:async e=>{if(e.startsWith("*")&&(e=e.substr(1)),!e)return[];const{requestError:s,response:l}=await i.problem.queryProblemSet(Object.assign({locale:o.locale},r.queryParameters,{keyword:e,keywordMatchesId:!0,titleOnly:!0,skipCount:0,takeCount:h}));if(s)m.error(s(t));else return l.result;return[]},onRenderResult:e=>a(d,{children:a("div",{className:"title",children:P(e.meta,e.title,t)})}),onResultSelect:r.onResultSelect,onEnterPress:r.onEnterPress})};var w=c(S);export{w as P};
