1import{_ as P}from"./uNecWPRX.js";import{_ as z,ar as O,i as V,z as $,f as H,o,g as k,b as i,w as c,p as q,a as e,k as n,A as K,c as a,l as u,F as m,m as w,t as p,d as j,ag as Q,T as U,S as G,E as J,r as h,j as B}from"./CsyhkCrC.js";import{u as W,b as X,r as Y,A as Z,o as ee,M as D}from"./ASYW0CCz.js";import{u as te}from"./C7PVeIDF.js";import{u as se}from"./CgFyd5Ic.js";const oe={class:"fixed inset-0 z-[100] bg-white flex flex-col sm:hidden"},re={class:"px-4 py-3 border-b border-gray-100 flex items-center gap-3 bg-white shrink-0"},ae={class:"flex-1 relative"},le={class:"relative w-full"},ne=["onSubmit"],ie=["value","onInput"],ue=["onClick"],ce={class:"flex-1 overflow-y-auto bg-white"},de={key:0,class:"py-2"},pe={class:"w-14 h-14 rounded-md overflow-hidden bg-white shrink-0 border border-gray-100 p-1 flex items-center justify-center"},ge=["src","alt"],fe={key:1,class:"w-full h-full bg-gray-50 flex items-center justify-center"},ye={class:"flex-1 min-w-0"},he={class:"text-[15px] font-semibold text-gray-800 truncate leading-tight mb-1"},xe={key:0,class:"text-xs text-primary font-medium flex gap-1 items-center"},me={key:0},ve={key:1,class:"text-gray-300"},be={key:2,class:"text-gray-500"},_e={class:"text-right shrink-0"},ke={class:"text-[14px] font-bold text-gray-900"},we={key:0,class:"text-[11px] text-gray-400 line-through"},Ce={key:1,class:"p-8 text-center text-gray-500"},Ie={class:"font-semibold text-gray-800"},Se={key:0,class:"divide-y divide-gray-50 border-t border-gray-50"},Me={class:"text-[15px] font-medium text-textDark group-hover:text-primary transition-colors"},je={class:"text-[15px] font-medium text-textDark group-hover:text-primary transition-colors"},Be={key:1,class:"py-8 flex justify-center"},De="prod_ENPATILER",Te={__name:"MobileSearchOverlay",setup(Le){const T=W(),x=O("mobileSearchOpen",()=>!1),d=h(""),v=h(null),L=V(),{toUrlSlug:N}=te(),b=h(!1),_=h([]),C=h([]),I=async r=>{if(r){document.body.style.overflow="hidden",await J();for(let t=0;t<20&&!document.getElementById("mobileSearchInput");t++)await new Promise(f=>setTimeout(f,25));S(),_.value.length||setTimeout(()=>{A()},300)}else document.body.style.overflow=""};$(x,I),H(()=>{x.value&&I(!0)});const A=async()=>{try{const[r,t]=await Promise.all([B("/ecommerce/categories?include_tags=true"),B("/ecommerce/brands?filter=featured&per_page=10")]);r?.success&&(_.value=r.data.categories.slice(0,5)||[]),t?.success&&(C.value=t.data.brands.slice(0,10)||[])}catch{}finally{b.value=!0}},S=()=>{const r=document.getElementById("mobileSearchInput");r?r.focus():v.value&&v.value.focus()},g=()=>{x.value=!1,setTimeout(()=>{d.value=""},300)},E=r=>{!r||!r.trim()||(g(),L.push({path:"/ara",query:{q:r.trim()}}))},{clickedProduct:F}=se(),R=r=>{g(),F(r.objectID,{queryID:r.__queryID,position:r.__position})},M=r=>r?new Intl.NumberFormat("tr-TR",{minimumFractionDigits:2,maximumFractionDigits:2}).format(r):"0.00";return(r,t)=>{const f=P;return o(),k(G,{to:"body"},[i(U,{name:"slide-up"},{default:c(()=>[q(e("div",oe,[i(n(X),{"index-name":De,"search-client":n(T),class:"flex flex-col h-full w-full"},{default:c(()=>[i(n(Y),{hitsPerPage:10,optionalFilters:["in_stock:1<score=1>"],clickAnalytics:!0}),e("div",re,[e("button",{onClick:g,class:"p-2 -ml-2 text-textDark hover:bg-gray-50 rounded-full transition-colors flex shrink-0"},[...t[0]||(t[0]=[e("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e("div",ae,[i(n(Z),null,{default:c(({currentRefinement:l,refine:s})=>[e("div",le,[t[2]||(t[2]=e("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 absolute left-3 top-1/2 -translate-y-1/2 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),e("form",{onSubmit:K(y=>E(l),["prevent"]),class:"m-0 p-0 block w-full"},[e("input",{id:"mobileSearchInput",ref_key:"searchInputRef",ref:v,value:l,onInput:y=>{s(y.currentTarget.value),d.value=y.currentTarget.value},type:"text",placeholder:"Ãrün, marka veya kategori ara...",class:"w-full bg-gray-100 rounded-full py-2 pl-10 pr-10 text-[16px] focus:outline-none focus:ring-1 focus:ring-primary/50 text-textDark border border-transparent focus:border-primary/30 transition-all font-sans"},null,40,ie)],40,ne),l?(o(),a("button",{key:0,onClick:y=>
1{s(""),d.value="",S()},class:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 p-1 bg-gray-200 rounded-full hover:bg-gray-300 transition-colors"},[...t[1]||(t[1]=[e("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-3 w-3",viewBox:"0 0 20 20",fill:"currentColor"},[e("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)])],8,ue)):u("",!0)])]),_:1})])]),e("div",ce,[d.value.length>0?(o(),k(n(ee),{key:0},{default:c(({items:l})=>[l.length>0?(o(),a("div",de,[t[4]||(t[4]=e("div",{class:"px-5 py-2 text-[11px] font-bold text-gray-400 uppercase tracking-wider bg-gray-50/50"},"ÃRÃNLER",-1)),(o(!0),a(m,null,w(l,s=>(o(),k(f,{key:s.objectID,to:`/urun/${s.slug}`,onClick:y=>R(s),class:"flex items-center gap-4 px-5 py-3 hover:bg-gray-50 transition-colors border-b border-gray-100/50 block"},{default:c(()=>[e("div",pe,[s.image?(o(),a("img",{key:0,src:s.image,alt:s.name,class:"w-full h-full object-contain"},null,8,ge)):(o(),a("div",fe,[...t[3]||(t[3]=[e("svg",{class:"h-6 w-6 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})],-1)])]))]),e("div",ye,[e("h4",he,[i(n(D),{attribute:"name",hit:s},null,8,["hit"])]),s.brand||s.category?(o(),a("p",xe,[s.brand?(o(),a("span",me,[i(n(D),{attribute:"brand",hit:s},null,8,["hit"])])):u("",!0),s.brand&&s.category?(o(),a("span",ve,"â¢")):u("",!0),s.category?(o(),a("span",be,p(s.category),1)):u("",!0)])):u("",!0)]),e("div",_e,[e("div",ke,p(M(s.price))+" âº",1),s.has_discount?(o(),a("div",we,p(M(s.compare_price))+" âº",1)):u("",!0)])]),_:2},1032,["to","onClick"]))),128))])):(o(),a("div",Ce,[t[5]||(t[5]=e("div",{class:"w-16 h-16 mx-auto mb-4 bg-gray-50 rounded-full flex items-center justify-center"},[e("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-8 w-8 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1)),t[6]||(t[6]=j(' "',-1)),e("span",Ie,p(d.value),1),t[7]||(t[7]=j('" ile eÅleÅen bir ürün bulamadık. ',-1))]))]),_:1})):(o(),a(m,{key:1},[b.value?(o(),a("ul",Se,[(o(!0),a(m,null,w(_.value,l=>(o(),a("li",{key:"cat-"+l.id},[i(f,{to:`/${n(N)(l.slug)}`,onClick:g,class:"flex items-center justify-between px-5 py-3.5 hover:bg-gray-50 group"},{default:c(()=>[e("span",Me,p(l.name),1),t[8]||(t[8]=e("span",{class:"text-xs text-gray-400 group-hover:text-primary/70 transition-colors"},"Kategori",-1))]),_:2},1032,["to"])]))),128)),(o(!0),a(m,null,w(C.value,l=>(o(),a("li",{key:"brand-"+l.id},[i(f,{to:`/marka/${l.slug||l.id}`,onClick:g,class:"flex items-center justify-between px-5 py-3.5 hover:bg-gray-50 group"},{default:c(()=>[e("span",je,p(l.name),1),t[9]||(t[9]=e("span",{class:"text-xs text-gray-400 group-hover:text-primary/70 transition-colors"},"Marka",-1))]),_:2},1032,["to"])]))),128))])):u("",!0),!b.value&&!d.value?(o(),a("div",Be,[...t[10]||(t[10]=[e("div",{class:"w-6 h-6 border-2 border-primary border-t-transparent rounded-full animate-spin"},null,-1)])])):u("",!0)],64))])]),_:1},8,["search-client"])],512),[[Q,n(x)]])]),_:1})])}}},Pe=z(Te,[["__scopeId","data-v-50d132c8"]]);export{Pe as default};
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.