PageSourceSearch

https://sharvarok.com/_next/static/chunks/8073-0c1985c1c313813d.js

js sharvarok.com collected 2026-10-02 00:56:31 UTC 12,312 bytes, 1 lines download raw bytes

1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a5d55ea8-c6ce-454d-b853-82b75e71fea6",e._sentryDebugIdIdentifier="sentry-dbid-a5d55ea8-c6ce-454d-b853-82b75e71fea6")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8073],{58073:function(e,t,a){"use strict";a.d(t,{default:function(){return f}});var s=a(57437),n=a(2265),l=a(42586),i=a(92840),r=a(83464),o=a(8946),c=a.n(o),d=a(3579),m=a(8714),u=a.n(m),p=e=>{let{categories:t=[],value:a=[],onChange:i=()=>{},name:r="categoryId",className:o=""}=e,m=(0,l.useTranslations)("SearchBar"),p=(0,l.useLocale)(),{ref:h,isComponentVisible:x,setIsComponentVisible:g}=(0,d.Z)(!1),f=e=>(null==e?void 0:e["name_".concat(p)])||(null==e?void 0:e.name_en)||"",v=(0,n.useMemo)(()=>c().orderBy(t.filter(e=>0===e.parentId),[e=>f(e)],["asc"]).map(e=>({parent:e,children:c().orderBy(t.filter(t=>t.parentId===e.id),[e=>f(e)],["asc"])}
1)),[t,p]),b=new Set(a),w=(e,t)=>{let a=new Set(b);a.has(e)?a.delete(e):(t.forEach(e=>a.delete(e)),a.add(e)),i([...a])},j=(e,t,a)=>{let s=new Set(b);s.has(t)&&(s.delete(t),a.forEach(e=>s.add(e))),s.has(e)?s.delete(e):s.add(e),a.length>0&&a.every(e=>s.has(e))&&(a.forEach(e=>s.delete(e)),s.add(t)),i([...s])},y=(0,n.useMemo)(()=>{if(!a.length)return null;if(1===a.length){let e=t.find(e=>e.id===a[0]);return e?f(e):null}return m("inputs.categoriesselected",{count:a.length})},[a,t,p,m]);return(0,s.jsxs)("div",{className:u().wrapper,ref:h,children:[(0,s.jsx)("input",{type:"hidden",name:r,value:a.join(",")}),(0,s.jsxs)("button",{type:"button",className:"form-control form-control-lg ".concat(u().trigger," ").concat(o),onClick:()=>g(!x),"aria-haspopup":"listbox","aria-expanded":x,children:[(0,s.jsx)("span",{className:"".concat(u().triggerLabel," ").concat(y?"":u().placeholder),children:null!=y?y:m("inputs.allcategories")}),(0,s.jsx)("span",{className:"".concat(u().caret," ").concat(x?u().caretOpen:""),"aria-hidden":"true",children:"▾"})]}),x?(0,s.jsxs)("div",{className:u().menu,role:"listbox",children:[v.map(e=>{let{parent:t,children:a}=e,l=a.map(e=>e.id),i=b.has(t.id),r=l.some(e=>b.has(e));return(0,s.jsxs)(n.Fragment,{children:[(0,s.jsxs)("button",{type:"button",className:"".concat(u().row," ").concat(u().parentRow),onClick:()=>w(t.id,l),children:[(0,s.jsx)("input",{type:"checkbox",className:"form-check-input mt-0 ".concat(u().checkbox),checked:i,ref:e=>{e&&(e.indeterminate=!i&&r)},readOnly:!0}),f(t)]}),a.map(e=>(0,s.jsxs)("button",{type:"button",className:"".concat(u().row," ").concat(u().childRow),disabled:e.isReadonly,onClick:()=>j(e.id,t.id,l),children:[(0,s.jsx)("input",{type:"checkbox",className:"form-check-input mt-0 ".concat(u().checkbox),checked:i||b.has(e.id),readOnly:!0}),f(e)]},e.id))]},t.id)}),a.length>0?(0,s.jsx)("div",{className:u().footer,children:(0,s.jsx)("button",{type:"button",className:u().reset,onClick:()=>i([]),children:m("inputs.clearcategories")})}):null]}):null]})},h=e=>{let{query:t,onSelect:a,onClose:i,isVisible:o}
1=e,[d,m]=(0,n.useState)([]),[u,p]=(0,n.useState)(!1),h=(0,l.useLocale)(),x=(0,n.useRef)(null),g=c().debounce(async e=>{if(!e||e.length<2){m([]),p(!1);return}p(!0);try{let t=await r.Z.get("/api/search/suggestions",{params:{q:e,locale:h}});m(t.data||[])}catch(e){console.error("Error fetching suggestions:",e),m([])}finally{p(!1)}},300);return((0,n.useEffect)(()=>(t&&o?g(t):m([]),()=>{g.cancel()}),[t,o]),(0,n.useEffect)(()=>{let e=e=>{x.current&&!x.current.contains(e.target)&&i()};return o&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[o,i]),o&&(u||0!==d.length))?(0,s.jsx)("div",{ref:x,className:"position-absolute w-100 bg-white border rounded shadow-sm",style:{top:"100%",zIndex:1e3,maxHeight:"300px",overflowY:"auto"},children:u?(0,s.jsx)("div",{className:"p-3 text-center text-muted",children:(0,s.jsx)("div",{className:"spinner-border spinner-border-sm",role:"status",children:(0,s.jsx)("span",{className:"visually-hidden",children:"Loading..."})})}):(0,s.jsx)("ul",{className:"list-unstyled mb-0",children:d.map((e,t)=>(0,s.jsx)("li",{className:"border-bottom",children:(0,s.jsx)("button",{type:"button",className:"btn btn-link w-100 text-start p-3 border-0 rounded-0",onClick:()=>a(e),style:{textDecoration:"none"},children:(0,s.jsxs)("div",{className:"d-flex align-items-center",children:[(0,s.jsx)("div",{className:"me-2",children:"category"===e.type?(0,s.jsx)("i",{className:"bi bi-tag text-primary"}):(0,s.jsx)("i",{className:"bi bi-geo-alt text-success"})}),(0,s.jsx)("div",{children:(0,s.jsx)("div",{className:"fw-normal text-dark",children:e.text})})]})})},"".concat(e.type,"-").concat(e.id)))})}):null};let x=i.ZP.div.withConfig({componentId:"sc-4ace6445-0"})([".sow-search-mobile{position:unset !important;}form.sow-search{.fi-search,.fi-pin-2,.fi-circle-spin{top:calc(50% + 0.5rem) !important;margin-top:0 !important;padding-top:0 !important;transform:translateY(-50%);line-height:1;}.fi-search,.fi-pin-2{margin-left:1.25rem !important;}}@media only screen and (max-width:768px){form{&.sow-search-mobile{.sow-search-container{position:static;}}}form.sow-search{padding:0.5rem !important;.row{row-gap:0.5rem;}.pt-3{padding:0 !important;}.sow-col-category .pt-3{padding-right:0.25rem !important;}.sow-col-city .pt-3{padding-left:0.25rem !important;}.form-control-lg{font-size:0.85rem;min-height:auto;padding:0.45rem 0.8rem 0.45rem 1.65rem;border-radius:0.375rem;}.form-control-lg.px-5{padding-left:2.05rem !important;}[aria-haspopup='listbox'].form-control-lg{padding-left:0.8rem !important;}.fi-search,.fi-pin-2,.fi-circle-spin{top:50% !important;margin:0 !important;padding:0 !important;transform:translateY(-50%);font-size:0.9rem !important;}.fi-search{left:0.7rem !important;}.fi-pin-2{left:0.95rem !important;}.fi-circle-spin{left:auto !important;right:0.7rem !important;}.btn-lg{font-size:0.9rem;padding-top:0.5rem;padding-bottom:0.5rem;}}}"]);x.displayName="SearchBarWrapper";let g=i.ZP.div.withConfig({componentId:"sc-4ace6445-1"})([".sow-search-content{@media only screen and (min-width:768px){max-height:unset;}}"]);g.displayName="SOWSearchContainer";var f=e=>{let{query:t="",loc:a="",locId:i=0,st:o="",categories:c=[],inCategoryIds:m=[],showTitle:u=!1,sectionClassName:f="py-1 py-lg-3",wrapperClassName:v="container"}=e,b=(0,l.useTranslations)("SearchBar"),w=(0,l.useLocale)(),[j,y]=(0,n.useState)(t),[N,_]=(0,n.use
1State)(m),[k,S]=(0,n.useState)(a),[C,E]=(0,n.useState)(i),[I,L]=(0,n.useState)(o),[R,D]=(0,n.useState)([]),[O,Z]=(0,n.useState)([]),[B,F]=(0,n.useState)(!1),[q,z]=(0,n.useState)(!1),{ref:P,isComponentVisible:T,setIsComponentVisible:W}=(0,d.Z)(!1),Y=e=>{if(!e)return S(""),E(0),L(""),Z([]),!1;F(!0),r.Z.get("/api/cities",{params:{q:e,limit:10}}).then(e=>{var t,a,s,n;F(!1),console.log(">>> response",null==e?void 0:e.data),D(null==e?void 0:null===(a=e.data)||void 0===a?void 0:null===(t=a.data)||void 0===t?void 0:t.results),Z((null==e?void 0:null===(n=e.data)||void 0===n?void 0:null===(s=n.data)||void 0===s?void 0:s.states)||[])}).catch(e=>{F(!1),console.error(">>> cities",e)})};return(0,n.useEffect)(()=>{console.log(k),Y(k)},[k]),(0,s.jsx)("section",{className:f,children:(0,s.jsxs)(x,{className:v,children:[u?(0,s.jsx)("h1",{className:"h5 mb-3 text-secondary text-center-xs fw-normal",children:b("title")}):null,(0,s.jsxs)("form",{method:"get",action:"/".concat(w,"/search"),className:"sow-search sow-search-mobile bg-white rounded shadow-xs px-2 pb-3",children:[(0,s.jsx)("input",{type:"hidden",name:"locId",value:C}),(0,s.jsx)("input",{type:"hidden",name:"st",value:I}),(0,s.jsxs)("div",{className:"row g-0",children:[(0,s.jsx)("div",{className:c.length>0?"col-12 col-md-4":"col-12 col-md-7",children:(0,s.jsxs)("div",{className:"px-2 pt-3 position-relative",children:[(0,s.jsx)("input",{type:"text",name:"q",placeholder:b("inputs.queryplaceholder"),className:"form-control form-control-lg px-5",required:!0,value:j,onChange:e=>{var t;return y(null==e?void 0:null===(t=e.target)||void 0===t?void 0:t.value)},onFocus:()=>z(!0)}),(0,s.jsx)("i",{className:"fi fi-search position-absolute top-0 start-0 mx-4 mt-4 pt-1 text-muted fs-4"}),(0,s.jsx)(h,{query:j,isVisible:q,onSelect:e=>{"category"===e.type?y(e.value):"location"===e.type&&(S(e.value),E(e.id),L("")),z(!1)},onClose:()=>z(!1)})]})}),c.length>0?(0,s.jsx)("div",{className:"col-6 col-md-3 sow-col-category",children:(0,s.jsx)("div",{className:"px-2 pt-3 position-relative",children:(0,s.jsx)(p,{name:"categoryId",value:N,categories:c,onChange:_})})}):null,(0,s.jsxs)("div",{className:c.length>0?"col-6 col-md-3 sow-col-city":"col-12 col-md-3",ref:P,onFocus:()=>W(!0),children:[(0,s.jsx)("div",{className:"w-100",children:(0,s.jsx)("div",{className:"input-group-over d-flex align-items-center w-100 h-100",children:(0,s.jsxs)("div",{className:"px-2 pt-3 position-relative w-100",children:[(0,s.jsx)("input",{className:"form-control form-control-lg px-5",type:"text",name:"loc",placeholder:b("inputs.searchplaceholder"),autoCorrect:"false",autoComplete:"false",value:k,onChange:e=>{var t;S(null==e?void 0:null===(t=e.target)||void 0===t?void 0:t.value),E(0),L("")}}),(0,s.jsx)("i",{className:"fi fi-pin-2 position-absolute top-0 start-0 mx-4 mt-4 pt-1 text-muted fs-4"}),B?(0,s.jsx)("i",{className:"fi fi-circle-spin fi-spin position-absolute top-0 end-0 mx-4 mt
1-4 pt-1 text-muted fs-4"}):null]})})}),(0,s.jsx)(g,{className:"w-auto ms-2 px-0 py-0 my-4 shadow-md ".concat(((null==R?void 0:R.length)>0||(null==O?void 0:O.length)>0)&&T?"sow-search-container":"d-none"),id:"sow-search-container",children:(0,s.jsx)("div",{className:"sow-search-container-wrapper",children:(null==R?void 0:R.length)>0||(null==O?void 0:O.length)>0?(0,s.jsx)("div",{className:"sow-search-content rounded w-auto p-3 scrollable-vertical",children:(0,s.jsx)(e=>{let{results:t,states:a}=e,n=(null==a?void 0:a.length)>0,l=(null==t?void 0:t.length)>0;return n||l?(0,s.jsxs)(s.Fragment,{children:[n?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"text-muted text-uppercase small px-3 pb-1",children:b("location.statesgroup")}),(0,s.jsx)("ul",{className:"list-unstyled list-suggestion mb-2",children:a.map(e=>(0,s.jsx)("li",{className:"list-item",children:(0,s.jsx)("a",{href:"#",onClick:t=>{t.preventDefault(),t.stopPropagation(),S("".concat(e.name," (").concat(e.code,")")),E(0),L(e.code),W(!1)},children:b("location.wholestate",{state:e.name,code:e.code})})},"st-".concat(e.code)))})]}):null,l?(0,s.jsxs)(s.Fragment,{children:[n?(0,s.jsx)("div",{className:"text-muted text-uppercase small px-3 pb-1",children:b("location.citiesgroup")}):null,(0,s.jsx)("ul",{className:"list-unstyled list-suggestion",children:t.map((e,t)=>{let a="".concat(e.city,", ").concat(e.state);return(0,s.jsx)("li",{className:"list-item",children:(0,s.jsx)("a",{href:"#",onClick:t=>{t.preventDefault(),t.stopPropagation(),S(a),E(e.id),L(""),W(!1)},children:a})},t)})})]}):null]}):null},{results:R,states:O})}):null})})]}),(0,s.jsx)("div",{className:"col-12 col-md-2",children:(0,s.jsx)("div",{className:"px-2 pt-3 position-relative",children:(0,s.jsxs)("button",{type:"submit",className:"btn btn-lg btn-primary w-100",disabled:!j,children:[(0,s.jsx)("span",{className:"px-2",children:b("buttons.search")}),(0,s.jsx)("i",{className:"fi fi-arrow-end"})]})})})]})]})]})})}},3579:function(e,t,a){"use strict";a.d(t,{Z:function(){return n}});var s=a(2265);
1function n(e){let[t,a]=(0,s.useState)(e),n=(0,s.useRef)(null),l=e=>{n.current&&!n.current.contains(e.target)&&a(!1)};return(0,s.useEffect)(()=>(document.addEventListener("click",l,!0),()=>{document.removeEventListener("click",l,!0)}),[]),{ref:n,isComponentVisible:t,setIsComponentVisible:a}}},8714:function(e){e.exports={wrapper:"multiselect_wrapper__C_Kxx",trigger:"multiselect_trigger__2s_Zk",triggerLabel:"multiselect_triggerLabel__oeBlx",placeholder:"multiselect_placeholder__W1A5O",caret:"multiselect_caret__3rNOB",caretOpen:"multiselect_caretOpen__56Szn",menu:"multiselect_menu__yoe_2",row:"multiselect_row__zYWUg",parentRow:"multiselect_parentRow__SQuDX",childRow:"multiselect_childRow__AXwng",checkbox:"multiselect_checkbox__F9vge",footer:"multiselect_footer__fwX55",reset:"multiselect_reset__IGw9C"}}}]);

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.