PageSourceSearch

https://fitnessprofi.lovable.app/assets/SearchListings-D8gCri9U.js

js fitnessprofi.lovable.app collected 2026-10-03 03:31:37 UTC 24,802 bytes, 11 lines download raw bytes

vendor: 5,988 bytes, lines 1-11
1import{c as _e,l as Ye,e as Ze,r as l,m as Ge,j as e,g as Y,f as Z,P as J,n as Xe,i as We,o as Je,d as Qe,a as et,u as tt,s as $,X as U}from"./index-DfbPMtFZ.js";import{u as rt,I as re,B as L}from"./Combination-DdoM_vzj.js";import{S as ne,a as ie,b as oe,c as ce,d as W}from"./select-BpTHHfDC.js";import{H as st,S as pe,B as q,f as at,F as nt}from"./Footer-DkkU8vMF.js";import{C as le,a as ve}from"./card-DN9U93Ar.js";import{c as Pe}from"./index-BdQq_4o_.js";import{u as it}from"./index-DL1OQS8_.js";import{L as V}from"./label-BPIIdxfs.js";import{D as ye,a as je,b as be,c as Se,d as we}from"./dialog-CUfzLZNo.js";import{P as Ne}from"./ProductCard-DMbfcClq.js";import{F as ot}from"./FavoriteButton-BuMmWnPt.js";import{S as ct}from"./SEOHead-CT9CEd2t.js";import{p as se,b as lt}from"./seoData-Zu0mqGag.js";import{M as dt}from"./map-pin-BpPyR111.js";import"./chevron-down-B7uBTmvX.js";import"./shield-gTmsYmaS.js";import"./avatar-BJUSXNbd.js";import"./LikeButton-hgR9MF0H.js";import"./useSocial-8SE6rbm7.js";import"./imageOptimization-CudCDZ50.js";import"./star-DebO7FFT.js";import"./calendar-AeHpRayc.js";import"./eye-CWNprXLp.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const ut=_e("Bookmark",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const ht=_e("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);var Re=["PageUp","PageDown"],De=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Ee={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},G="Slider",[de,mt,ft]=Ye(G),[Me,tr]=Ze(G,[ft]),[xt,ae]=Me(G),Be=l.forwardRef((r,s)=>{const{name:n,min:i=0,max:d=100,step:m=1,orientation:o="horizontal",disabled:u=!1,minStepsBetweenThumbs:x=0,defaultValue:N=[i],value:j,onValueChange:h=()=>{},onValueCommit:g=()=>{},inverted:b=!1,form:R,...S}=r,v=l.useRef(new Set),p=l.useRef(0),k=o==="horizontal"?gt:pt,[y=[],I]=Ge({prop:j,defaultProp:N,onChange:_=>{var T;(T=[...v.current][p.current])==null||T.focus(),h(_)}}),D=l.useRef(y);function P(_){const z=St(y,_);A(_,z)}function Q(_){A(_,p.current)}function a(){const _=D.current[p.current];y[p.current]!==_&&g(y)}function A(_,z,{commit:T}={commit:!1}){const C=kt(m),H=_t(Math.round((_-i)/m)*m+i,C),O=Pe(H,[i,d]);I((M=[])=>{const F=jt(M,O,z);if(Ct(F,x*m)){p.current=F.indexOf(O);const ee=String(F)!==String(M);return ee&&T&&g(F),ee?F:M}else return M})}return e.jsx(xt,{scope:r.__scopeSlider,name:n,disabled:u,min:i,max:d,valueIndexToChangeRef:p,thumbs:v.current,values:y,orientation:o,form:R,children:e.jsx(de.Provider,{scope:r.__scopeSlider,children:e.jsx(de.Slot,{scope:r.__scopeSlider,children:e.jsx(k,{"aria-disabled":u,"data-disabled":u?"":void 0,...S,ref:s,onPointerDown:Y(S.onPointerDown,()=>{u||(D.current=y)}),min:i,max:d,inverted:b,onSlideStart:u?void 0:P,onSlideMove:u?void 0:Q,onSlideEnd:u?void 0:a,onHomeKeyDown:()=>!u&&A(i,0,{commit:!0}),onEndKeyDown:()=>!u&&A(d,y.length-1,{commit:!0}),onStepKeyDown:({event:_,direction:z})=>{if(!u){const H=Re.includes(_.key)||_.shiftKey&&De.includes(_.key)?10:1,O=p.current,M=y[O],F=m*H*z;A(M+F,O,{commit:!0})}}})})})})});Be.displayName=G;var[Le,Ae]=Me(G,{startEdge:"left",endEdge:"right",size:"width",direction:1}),gt=l.forwardRef((r,s)=>{const{min:n,max:i,dir:d,inverted:m,onSlideStart:o,onSlideMove:u,onSlideEnd:x,onStepKeyDown:N,...j}=r,[h,g]=l.useState(null),b=Z(s,k=>g(k)),R=l.useRef(void 0),S=rt(d),v=S==="ltr",p=v&&!m||!v&&m;function E(k){const y=R.current||h.getBoundingClientRect(),I=[0,y.width],P=fe(I,p?[n,i]:[i,n]);return R.current=y,P(k-y.left)}return e.jsx(Le,{scope:r.__scopeSlider,startEdge:p?"left":"right",endEdge:p?"right":"left",direction:p?1:-1,size:"width",children:e.jsx(ze,{dir:S,"data-orientation":"horizontal",...j,ref:b,style:{...j.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:k=>{const y=E(k.clientX);o==null||o(y)},onSlideMove:k=>{const y=E(k.clientX);u==null||u(y)},onSlideEnd:()=>{R.current=void 0,x==null||x()},onStepKeyDown:k=>{const I=Ee[p?"from-left":"from-right"].includes(k.key);N==null||N({event:k,direction:I?-1:1})}})})}),pt=l.forwardRef((r,s)=>{const{min:n,max:i,inverted:d,onSlideStart:m,onSlideMove:o,onSlideEnd:u,onStepKeyDown:x,...N}=r,j=l.useRef(null),h=Z(s,j),g=l.useRef(void 0),b=!d;function R(S){const v=g.current||j.current.getBoundingClientRect(),p=[0,v.height],k=fe(p,b?[i,n]:[n,i]);return g.current=v,k(S-v.top)}return e.jsx(Le,{scope:r.__scopeSlider,startEdge:b?"bottom":"top",endEdge:b?"top":"bottom",size:"height",direction:b?1:-1,children:e.jsx(ze,{"data-orientation":"vertical",...N,ref:h,style:{...N.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:S=>{const v=R(S.clientY);m==null||m(v)},onSlideMove:S=>{const v=R(S.clientY);o==null||o(v)},onSlideEnd:()=>{g.current=void 0,u==null||u()},onStepKeyDown:S=>{const p=Ee[b?"from-bottom":"from-top"].includes(S.key);x==null||x({event:S,direction:p?-1:1})}})})}),ze=l.forwardRef((r,s)=>{const{__scopeSlider:n,onSlideStart:i,onSlideMove:d,onSlideEnd:m,onHomeKeyDown:o,onEndKeyDown:u,onStepKeyDown:x,...N}=r,j=ae(G,n);return e.jsx(J.span,{...N,ref:s,onKeyDown:Y(r.onKeyDown,h=>
vendor: 2,813 bytes, line 11
11{h.key==="Home"?(o(h),h.preventDefault()):h.key==="End"?(u(h),h.preventDefault()):Re.concat(De).includes(h.key)&&(x(h),h.preventDefault())}),onPointerDown:Y(r.onPointerDown,h=>{const g=h.target;g.setPointerCapture(h.pointerId),h.preventDefault(),j.thumbs.has(g)?g.focus():i(h)}),onPointerMove:Y(r.onPointerMove,h=>{h.target.hasPointerCapture(h.pointerId)&&d(h)}),onPointerUp:Y(r.onPointerUp,h=>{const g=h.target;g.hasPointerCapture(h.pointerId)&&(g.releasePointerCapture(h.pointerId),m(h))})})}),Fe="SliderTrack",Ve=l.forwardRef((r,s)=>{const{__scopeSlider:n,...i}=r,d=ae(Fe,n);return e.jsx(J.span,{"data-disabled":d.disabled?"":void 0,"data-orientation":d.orientation,...i,ref:s})});Ve.displayName=Fe;var ue="SliderRange",Ie=l.forwardRef((r,s)=>{const{__scopeSlider:n,...i}=r,d=ae(ue,n),m=Ae(ue,n),o=l.useRef(null),u=Z(s,o),x=d.values.length,N=d.values.map(g=>Oe(g,d.min,d.max)),j=x>1?Math.min(...N):0,h=100-Math.max(...N);return e.jsx(J.span,{"data-orientation":d.orientation,"data-disabled":d.disabled?"":void 0,...i,ref:u,style:{...r.style,[m.startEdge]:j+"%",[m.endEdge]:h+"%"}})});Ie.displayName=ue;var he="SliderThumb",Te=l.forwardRef((r,s)=>{const n=mt(r.__scopeSlider),[i,d]=l.useState(null),m=Z(s,u=>d(u)),o=l.useMemo(()=>i?n().findIndex(u=>u.ref.current===i):-1,[n,i]);return e.jsx(vt,{...r,ref:m,index:o})}),vt=l.forwardRef((r,s)=>{const{__scopeSlider:n,index:i,name:d,...m}=r,o=ae(he,n),u=Ae(he,n),[x,N]=l.useState(null),j=Z(s,E=>N(E)),h=x?o.form||!!x.closest("form"):!0,g=Xe(x),b=o.values[i],R=b===void 0?0:Oe(b,o.min,o.max),S=bt(i,o.values.length),v=g==null?void 0:g[u.size],p=v?wt(v,R,u.direction):0;return l.useEffect(()=>{if(x)return o.thumbs.add(x),()=>{o.thumbs.delete(x)}},[x,o.thumbs]),e.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[u.startEdge]:`calc(${R}% + ${p}px)`},children:[e.jsx(de.ItemSlot,{scope:r.__scopeSlider,children:e.jsx(J.span,{role:"slider","aria-label":r["aria-label"]||S,"aria-valuemin":o.min,"aria-valuenow":b,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...m,ref:j,style:b===void 0?{display:"none"}:r.style,onFocus:Y(r.onFocus,()=>{o.valueIndexToChangeRef.current=i})})}),h&&e.jsx(Ke,{name:d??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:b},i)]})});Te.displayName=he;var yt="RadioBubbleInput",Ke=l.forwardRef(({__scopeSlider:r,value:s,...n},i)=>{const d=l.useRef(null),m=Z(d,i),o=it(s);return l.useEffect(()=>{const u=d.current;if(!u)return;const x=window.HTMLInputElement.prototype,j=Object.getOwnPropertyDescriptor(x,"value").set;if(o!==s&&j){const h=new Event("input",{bubbles:!0});j.call(u,s),u.dispatchEvent(h)}},[o,s]),e.jsx(J.input,{style:{display:"none"},...n,ref:m,defaultValue:s})});
11Ke.displayName=yt;function jt(r=[],s,n){const i=[...r];return i[n]=s,i.sort((d,m)=>d-m)}function Oe(r,s,n){const m=100/(n-s)*(r-s);return Pe(m,[0,100])}function bt(r,s){return s>2?`Value ${r+1} of ${s}`:s===2?["Minimum","Maximum"][r]:void 0}function St(r,s){if(r.length===1)return 0;const n=r.map(d=>Math.abs(d-s)),i=Math.min(...n);return n.indexOf(i)}function wt(r,s,n){const i=r/2,m=fe([0,50],[0,i]);return(i-m(s)*n)*n}function Nt(r){return r.slice(0,-1).map((s,n)=>r[n+1]-s)}function Ct(r,s){if(s>0){const n=Nt(r);return Math.min(...n)>=s}return!0}function fe(r,s){return n=>{if(r[0]===r[1]||s[0]===s[1])return s[0];const i=(s[1]-s[0])/(r[1]-r[0]);return s[0]+i*(n-r[0])}}function kt(r){return(String(r).split(".")[1]||"").length}function _t(r,s){const n=Math.pow(10,s);return Math.round(r*n)/n}var qe=Be,Pt=Ve,Rt=Ie,Dt=Te;const me=l.forwardRef(({className:r,...s},n)=>e.jsxs(qe,{ref:n,className:We("relative flex w-full touch-none select-none items-center",r),...s,children:[e.jsx(Pt,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:e.jsx(Rt,{className:"absolute h-full bg-primary"})}),e.jsx(Dt,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));me.displayName=qe.displayName;const Ce=[{value:"krafttraining",label:"Krafttraining"},{value:"cardio",label:"Cardio"},{value:"functional",label:"Functional Training"},{value:"yoga",label:"Yoga & Pilates"},{value:"zubehoer",label:"Zubehör"}],ke=[{value:"neu",label:"Neu"},{value:"sehr-gut",label:"Sehr gut"},{value:"gut",label:"Gut"},{value:"akzeptabel",label:"Akzeptabel"}],Et=[{value:"created_at-desc",label:"Neueste zuerst"},{value:"created_at-asc",label:"Älteste zuerst"},{value:"price-asc",label:"Preis aufsteigend"},{value:"price-desc",label:"Preis absteigend"},{value:"title-asc",label:"A-Z"},{value:"title-desc",label:"Z-A"}],rr=()=>{var xe,ge;const[r,s]=Je(),[n,i]=l.useState([]),[d,m]=l.useState([]),[o,u]=l.useState(!1),[x,N]=l.useState(0),[j,h]=l.useState(!1),[g,b]=l.useState(!1),[R,S]=l.useState(!1),[v,p]=l.useState(""),[E,k]=l.useState([]),[y,I]=l.useState(!0),{user:D}=Qe(),{toast:P}=et(),Q=tt(),[a,A]=l.useState({query:r.get("q")||"",category:r.get("category")||"",condition:r.get("condition")||"",priceMin:Number(r.get("priceMin"))||0,priceMax:Number(r.get("priceMax"))||1e4,location:r.get("location")||"",locationRadius:Number(r.get("locationRadius"))||50,brand:r.get("brand")||"",sortBy:r.get("sortBy")||"created_at",sortOrder:r.get("sortOrder")||"desc"});l.useEffect(()=>{z(),_()},[a]),l.useEffect(()=>{D&&M()},[D]),l.useEffect(()=>{T()},[]);const _=()=>{const t=new URLSearchParams;Object.entries(a).forEach(([f,c])=>{c&&c!==""&&c!==0&&t.set(f,c.toString())}),s(t)},z=async()=>{u(!0);try{const{data:t,error:f}=await $.rpc("get_safe_public_listings");if(f)throw f;let c=t||[];if(a.query){const w=a.query.toLowerCase();c=c.filter(B=>B.title.toLowerCase().includes(w)||B.description.toLowerCase().includes(w))}if(a.category&&(c=c.filter(w=>w.category===a.category)),a.condition&&(c=c.filter(w=>w.condition===a.condition)),a.priceMin>0&&(c=c.filter(w=>w.price>=a.priceMin)),a.priceMax<1e4&&(c=c.filter(w=>w.price<=a.priceMax)),a.location){const w=a.location.toLowerCase();c=c.filter(B=>{var K;return(K=B.display_location)==null?void 0:K.toLowerCase().includes(w)})}if(a.brand){const w=a.brand.toLowerCase();c=c.filter(B=>B.title.toLowerCase().includes(w)||B.description.toLowerCase().includes(w))}c.sort((w,B)=>{let K,X;switch(a.sortBy){case"price":K=w.price,X=B.price;break;case"title":K=w.title.toLowerCase(),X=B.title.toLowerCase();break;case"created_at":default:K=new Date(w.created_at).getTime(),X=new Date(B.created_at).getTime()}return a.sortOrder==="asc"?K>X?1:-1:K<X?1:-1});const Ue=c.slice(0,50);i(Ue),N(c.length)}catch(t){console.error("Error searching listings:",t),P({title:"Suchfehler",description:"Die Suche konnte nicht ausgeführt werden.",variant:"destructive"})}finally{u(!1)}},T=async()=>{try{const{data:t,error:f}=await $.rpc("get_featured_listings");if(f)throw f;m(t||[])}catch(t){console.error("Error loading featured listings:",t)}},C=(t,f)=>{A(c=>({...c,[t]:f}))},H=()=>{A({query:"",category:"",condition:"",priceMin:0,priceMax:1e4,location:"",locationRadius:50,brand:"",sortBy:"created_at",sortOrder:"desc"})},O=async()=>
11{if(!D){P({title:"Anmeldung erforderlich",description:"Bitte melden Sie sich an, um Suchen zu speichern.",variant:"destructive"});return}if(!v.trim()){P({title:"Name erforderlich",description:"Bitte geben Sie einen Namen für die Suche ein.",variant:"destructive"});return}try{const{error:t}=await $.from("saved_searches").insert({user_id:D.id,name:v.trim(),search_params:a,notifications_enabled:y});if(t)throw t;P({title:"Suche gespeichert",description:y?"Sie erhalten Benachrichtigungen bei neuen Angeboten.":"Ihre Suche wurde gespeichert."}),b(!1),p(""),I(!0),M()}catch(t){console.error("Error saving search:",t),P({title:"Fehler",description:"Die Suche konnte nicht gespeichert werden.",variant:"destructive"})}},M=async()=>{if(D)try{const{data:t,error:f}=await $.from("saved_searches").select("*").eq("user_id",D.id).order("created_at",{ascending:!1});if(f)throw f;k(t||[])}catch(t){console.error("Error loading saved searches:",t)}},F=t=>{A(t.search_params),S(!1),P({title:"Suche geladen",description:`"${t.name}" wurde geladen.`})},ee=async t=>{try{const{error:f}=await $.from("saved_searches").delete().eq("id",t);if(f)throw f;P({title:"Suche gelöscht",description:"Die gespeicherte Suche wurde entfernt."}),M()}catch(f){console.error("Error deleting saved search:",f),P({title:"Fehler",description:"Die Suche konnte nicht gelöscht werden.",variant:"destructive"})}},He=async(t,f)=>{try{const{error:c}=await $.from("saved_searches").update({notifications_enabled:!f}).eq("id",t);if(c)throw c;P({title:f?"Benachrichtigungen deaktiviert":"Benachrichtigungen aktiviert",description:f?"Sie erhalten keine Alerts mehr.":"Sie erhalten Alerts bei neuen Angeboten."}),M()}catch(c){console.error("Error toggling notifications:",c),P({title:"Fehler",description:"Einstellungen konnten nicht aktualisiert werden.",variant:"destructive"})}},te=Object.values(a).filter(t=>t&&t!==""&&t!==0&&t!==1e4&&t!==50&&t!=="created_at"&&t!=="desc").length,$e=[{name:"Home",url:"/"},{name:"Suchen",url:"/search"}];return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(ct,{title:`${a.query?`${a.query} - `:""}${se.search.title}`,description:a.query?`Suche nach ${a.query} auf Fitnessprofi. ${se.search.description}`:se.search.description,keywords:se.search.keywords,structuredData:lt($e),canonicalUrl:`https://fitnessprofi.at/search${a.query?`?q=${encodeURIComponent(a.query)}`:""}`}),e.jsx(st,{}),e.jsxs("div",{className:"container mx-auto px-4 py-8",children:[e.jsx("div",{className:"mb-8",children:e.jsxs("div",{className:"flex flex-col lg:flex-row gap-4",children:[e.jsx("div",{className:"flex-1",children:e.jsxs("div",{className:"relative",children:[e.jsx(pe,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-5 w-5"}),e.jsx(re,{type:"text",placeholder:"Fitnessgeräte suchen...",value:a.query,onChange:t=>C("query",t.target.value),className:"pl-12 h-12 text-lg"})]})}),e.jsxs(L,{variant:"outline",onClick:()=>h(!j),className:"h-12 px-6",children:[e.jsx(ht,{className:"h-5 w-5 mr-2"}),"Filter",te>0&&e.jsx(q,{variant:"destructive",className:"ml-2 h-5 w-5 p-0 text-xs",children:te})]}),D&&e.jsxs(e.Fragment,{children:[e.jsxs(ye,{open:g,onOpenChange:b,children:[e.jsx(je,{asChild:!0,children:e.jsxs(L,{variant:"outline",className:"h-12 px-6",children:[e.jsx(ut,{className:"h-5 w-5 mr-2"}),"Suche speichern"]})}),e.jsxs(be,{children:[e.jsx(Se,{children:e.jsx(we,{children:"Suche speichern"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(V,{htmlFor:"search-name",children:"Name der Suche"}),e.jsx(re,{id:"search-name",value:v,onChange:t=>p(t.target.value),placeholder:"z.B. Laufbänder unter 500€"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("input",{type:"checkbox",id:"notifications",checked:y,onChange:t=>I(t.target.checked),className:"h-4 w-4"}),e.jsx(V,{htmlFor:"notifications",className:"cursor-pointer",children:"Benachrichtigungen bei neuen Angeboten aktivieren"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(L,{onClick:O,className:"flex-1",children:"Speichern"}),e.jsx(L,{variant:"outline",onClick:()=>b(!1),children:"Abbrechen"})]})]})]})]}),e.jsxs(ye,{open:R,onOpenChange:S,children:[e.jsx(je,{asChild:!0,children:e.jsxs(L,{variant:"outline",className:"h-12 px-6",children:[e.jsx(at,{className:"h-5 w-5 mr-2"}),"Gespeicherte Suchen",E.length>0&&e.jsx(q,{variant:"secondary",className:"ml-2",children:E.length})]})}),e.jsxs(be,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[e.jsx(Se,{children:e.jsx(we,{children:"Gespeicherte Suchen"})}),e.jsx("div",{className:"space-y-3",children:E.length===0?e.jsx("p",{className:"text-center text-muted-foreground py-8",children:"Keine gespeicherten Suchen vorhanden"}):E.map(t=>e.jsx(le,{className:"p-4",children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"font-semibold",children:t.name}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:Object.entries(t.search_params).filter(([f,c])=>c&&c!==""&&c!==0&&c!==1e4&&c!==50).map(([f,c])=>`${f}: ${c}`).join(", ")})]}),e.jsxs("div",{className:"flex gap-2 ml-4",children:[e.jsx(L,{size:"sm",variant:t.notifications_enabled?"default":"outline",onClick:()=>He(t.id,t.notifications_enabled),title:t.notifications_enabled?"Benachrichtigungen deaktivieren":"Benachrichtigungen aktivieren",children:"🔔"}),e.jsx(L,{size:"sm",onClick:()=>
11F(t),children:"Laden"}),e.jsx(L,{size:"sm",variant:"destructive",onClick:()=>ee(t.id),children:e.jsx(U,{className:"h-4 w-4"})})]})]})},t.id))})]})]})]})]})}),j&&e.jsx(le,{className:"mb-8",children:e.jsxs(ve,{className:"p-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Kategorie"}),e.jsxs(ne,{value:a.category,onValueChange:t=>C("category",t),children:[e.jsx(ie,{children:e.jsx(oe,{placeholder:"Alle Kategorien"})}),e.jsxs(ce,{children:[e.jsx(W,{value:"",children:"Alle Kategorien"}),Ce.map(t=>e.jsx(W,{value:t.value,children:t.label},t.value))]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Zustand"}),e.jsxs(ne,{value:a.condition,onValueChange:t=>C("condition",t),children:[e.jsx(ie,{children:e.jsx(oe,{placeholder:"Alle Zustände"})}),e.jsxs(ce,{children:[e.jsx(W,{value:"",children:"Alle Zustände"}),ke.map(t=>e.jsx(W,{value:t.value,children:t.label},t.value))]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Standort"}),e.jsxs("div",{className:"relative",children:[e.jsx(dt,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-4 w-4"}),e.jsx(re,{type:"text",placeholder:"Stadt oder PLZ",value:a.location,onChange:t=>C("location",t.target.value),className:"pl-10"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Marke"}),e.jsx(re,{type:"text",placeholder:"z.B. Technogym, Life Fitness...",value:a.brand,onChange:t=>C("brand",t.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Sortierung"}),e.jsxs(ne,{value:`${a.sortBy}-${a.sortOrder}`,onValueChange:t=>{const[f,c]=t.split("-");C("sortBy",f),C("sortOrder",c)},children:[e.jsx(ie,{children:e.jsx(oe,{})}),e.jsx(ce,{children:Et.map(t=>e.jsx(W,{value:t.value,children:t.label},t.value))})]})]})]}),a.location&&e.jsxs("div",{className:"mt-6",children:[e.jsxs(V,{className:"text-sm font-medium",children:["Umkreis: ",a.locationRadius," km"]}),e.jsx("div",{className:"mt-4 px-2",children:e.jsx(me,{value:[a.locationRadius],onValueChange:([t])=>C("locationRadius",t),max:200,min:5,step:5,className:"w-full"})})]}),e.jsxs("div",{className:"mt-6",children:[e.jsxs(V,{className:"text-sm font-medium",children:["Preis: €",a.priceMin," - €",a.priceMax===1e4?"10000+":a.priceMax]}),e.jsx("div",{className:"mt-4 px-2",children:e.jsx(me,{value:[a.priceMin,a.priceMax],onValueChange:([t,f])=>{C("priceMin",t),C("priceMax",f)},max:1e4,min:0,step:50,className:"w-full"})})]}),te>0&&e.jsx("div",{className:"mt-6 flex justify-end",children:e.jsxs(L,{variant:"outline",onClick:H,children:[e.jsx(U,{className:"h-4 w-4 mr-2"}),"Filter zurücksetzen"]})})]})}),d.length>0&&e.jsx("div",{className:"mb-12",children:e.jsx(le,{className:"bg-gradient-to-br from-accent/10 to-accent/5 border-accent/20",children:e.jsxs(ve,{className:"p-6",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold flex items-center gap-2",children:"⭐ Featured Angebote"}),e.jsx("p",{className:"text-muted-foreground",children:"Premium-Angebote unserer verifizierten Verkäufer"})]}),e.jsxs(q,{variant:"secondary",className:"text-lg px-4 py-2",children:[d.length," Premium"]})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:d.slice(0,6).map(t=>e.jsx(Ne,{listing:t,onClick:()=>Q(`/buy/${t.id}`)},t.id))})]})})}),e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Suchergebnisse"}),e.jsx("p",{className:"text-muted-foreground",children:o?"Suche läuft...":`${x} Anzeigen gefunden`})]}),te>0&&e.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.query&&e.jsxs(q,{variant:"secondary",className:"gap-1",children:['"',a.query,'"',e.jsx(U,{className:"h-3 w-3 cursor-pointer",onClick:()=>C("query","")})]}),a.category&&e.jsxs(q,{variant:"secondary",className:"gap-1",children:[(xe=Ce.find(t=>t.value===a.category))==null?void 0:xe.label,e.jsx(U,{className:"h-3 w-3 cursor-pointer",onClick:()=>C("category","")})]}),a.condition&&e.jsxs(q,{variant:"secondary",className:"gap-1",children:[(ge=ke.find(t=>t.value===a.condition))==null?void 0:ge.label,e.jsx(U,{className:"h-3 w-3 cursor-pointer",onClick:()=>C("condition","")})]}),a.location&&e.jsxs(q,{variant:"secondary",className:"gap-1",children:["📍 ",a.location,e.jsx(U,{className:"h-3 w-3 cursor-pointer",onClick:()=>C("location","")})]})]})]}),o?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[...Array(6)].map((t,f)=>e.jsx("div",{className:"animate-pulse",children:e.jsx("div",{className:"bg-muted rounded-lg h-64"})},f))}):n.length===0?e.jsxs("div",{className:"text-center py-16",children:[e.jsx(pe,{className:"h-16 w-16 text-muted-foreground mx-auto mb-4"}),e.jsx("h2",{className:"text-xl font-semibold mb-2",children:"Keine Ergebnisse gefunden"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Versuchen Sie es mit anderen Suchbegriffen oder weniger Filtern."}),e.jsx(L,{onClick:H,variant:"outline",children:"Filter zurücksetzen"})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:n.map(t=>e.jsxs("div",{className:"relative group",children:[e.jsx(Ne,{listing:{id:t.
11id,title:t.title,description:t.description,price:t.price,status:t.status,created_at:t.created_at,category:t.category,size:t.size,condition:t.condition,display_location:t.display_location,images:t.images,quantity:t.quantity},onClick:()=>Q(`/buy/${t.id}`)}),D&&e.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx(ot,{listingId:t.id})})]},t.id))}),n.length>0&&n.length<x&&e.jsx("div",{className:"text-center mt-8",children:e.jsxs(L,{variant:"outline",size:"lg",children:["Mehr laden (",x-n.length," weitere)"]})})]}),e.jsx(nt,{})]})};export{rr 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.