PageSourceSearch

https://knuckl.com/assets/ExternalLeads-BTnocpjA.js

js knuckl.com collected 2026-09-24 14:47:18 UTC 9,271 bytes, 1 lines download raw bytes

1import{a as n,l as Q,j as t}from"./vendor-query-BxlSJxfF.js";import{r as X}from"./lead-interest-ClOYLsIo.js";import{H}from"./Head-CFjoxvyt.js";import{a as Y,c as z,B as d,L as C,r as Z}from"./index-DO0aGFYL.js";import{E as J,f as V,a as W}from"./use-external-lead-pins-DVQQb9r4.js";import{E as ee}from"./use-external-lead-notes-BMBVFioG.js";import{a as T,e as u,n as A,f as K}from"./lead-kind-Cs-VxxJh.js";import{K as P}from"./map-pins-B0KoeByN.js";import{u as te,L as re}from"./vendor-react-DdNhUK9-.js";import{G as ae}from"./globe-BblBOU8M.js";import{S as se}from"./sparkles-B9Io74C_.js";import{M as ne}from"./map-pin-Clc12hBl.js";import{C as le}from"./clock-TDYRjmmL.js";import{L as ie}from"./lock-CWPApfun.js";import{E as oe}from"./external-link-BMHb0t-K.js";import"./vendor-supabase-Csx7YFID.js";function _e(){var j,k,v,w,_,L;te();const{tr:r}=Y(),[l,$]=n.useState(!1),[c,B]=n.useState(null),[m,M]=n.useState(null),[f,R]=n.useState(""),[x,O]=n.useState("match"),b=f.trim(),{data:a,isLoading:h,fetchNextPage:D,hasNextPage:q,isFetchingNextPage:g}=Q({queryKey:[...J,"list",l,c,m,b,x],initialPageParam:0,queryFn:({pageParam:e})=>V({onlyMyTrades:l,status:c,kind:m,q:b||null,sort:x,limit:W,offset:e}),getNextPageParam:(e,s)=>{var E;const o=s.reduce((F,I)=>{var S;return F+(((S=I.leads)==null?void 0:S.length)??0)},0);if((E=e.leads)!=null&&E.length)return o<(e.matching??e.total??0)?o:void 0}}),G=((k=(j=a==null?void 0:a.pages)==null?void 0:j[0])==null?void 0:k.paid)??!1,i=((a==null?void 0:a.pages)??[]).flatMap(e=>e.leads??[]),p=((w=(v=a==null?void 0:a.pages)==null?void 0:v[0])==null?void 0:w.total)??0,U=((L=(_=a==null?void 0:a.pages)==null?void 0:_[0])==null?void 0:L.matching)??p,y=z(),N=e=>r(`external.notes.status${e.charAt(0).toUpperCase()}${e.slice(1)}`);return t.jsxs("div",{className:"min-h-screen bg-background pb-24",children:[t.jsx(H,{title:`${r("external.feed.title")} | Knuckl`,description:r("external.feed.disclaimer"),noindex:!0}),t.jsxs("header",{className:"px-5 pt-6 pb-3",children:[t.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[t.jsx(ae,{className:"w-5 h-5 text-[hsl(var(--entity-external))]"})," ",r("external.feed.title")]}),t.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:r("external.feed.disclaimer")})]}),t.jsxs("nav",{className:"px-5 pb-4 flex gap-2",children:[t.jsx(re,{to:"/homeowner-leads",className:"px-3 h-9 inline-flex items-center rounded-full border border-border/60 text-sm text-muted-foreground",children:r("external.tabs.homeowner")}),t.jsx("span",{className:"px-3 h-9 inline-flex items-center rounded-full bg-[hsl(var(--entity-external))]/15 text-[hsl(var(--entity-external))] text-sm font-semibold",children:r("external.tabs.external")}),t.jsx("button",{type:"button","aria-pressed":l,onClick:()=>$(e=>!e),className:`px-3 h-9 inline-flex items-center rounded-full border text-sm ${l?"border-primary/60 bg-primary/10 text-primary font-semibold":"border-border/60 text-muted-foreground"}`,children:r("external.feed.myTradesOnly")})]}),t.jsxs("div",{className:"px-5 pb-4 space-y-2",children:[t.jsx("input",{type:"search",value:f,onChange:e=>R(e.target.value),placeholder:r("external.feed.searchPlaceholder"),"aria-label":r("external.feed.searchPlaceholder"),className:"w-full h-10 rounded-full border border-border/60 bg-card px-4 text-sm"}),t.jsx("div",{className:"flex gap-2",children:["match","recent","distance"].map(e=>{const s=x===e,o=r(e==="match"?"external.feed.sortMatch":e==="recent"?"external.feed.sortRecent":"external.feed.sortDistance");return t.jsx("button",{type:"button","aria-pressed":s,onClick:()=>O(e),className:`px-3 h-8 inline-flex items-center rounded-full border text-xs ${s?"border-primary/60 bg-primary/10 text-primary font-semibold":"border-border/60 text-muted-foreground"}`,children:o},e)})})]}),t.jsx("div",{role:"group","aria-label":r("external.notes.statusLabel"),className:"px-5 pb-4 flex gap-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[null,...ee].map(e=>{const s=c===e;return t.jsx("button",{type:"button","aria-pressed":s,onClick:()=>B(e),className:`shrink-0 px-3 h-8 inline-flex items-center rounded-full border text-xs ${s?"border-primary/60 bg-primary/10 text-primary font-semibold":"border-border/60 text-muted-foreground"}`,children:e?N(e):r("external.notes.allStatuses")},e??"all")})}),t.jsx("div",{role:"group","aria-label":r("external.kind.filterLabel"),className:"px-5 pb-4 flex gap-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[null,"post","permit","violation"].map(e=>{const s=m===e;return t.jsx("button",{type:"button","aria-pressed":s,onClick:()=>M(e),className:`shrink-0 px-3 h-8 inline-flex items-center rounded-full border text-xs ${s?"border-primary/60 bg-primary/10 text-primary font-semibold":"border-border/60 text-muted-foreground"}`,children:r(e?T(e):"external.kind.all")},e??"all")})}),!G&&!h&&t.jsxs("div",{className:"mx-5 mb-5 rounded-card border border-primary/40 bg-primary/10 p-4",children:[t.jsxs("div",{className:"flex items-center gap-2 font-medium",children:[t.jsx(se,{className:"w-4 h-4 text-primary"})," ",r("external.feed.paidFeature")]}),t.jsx("p",{className:"text-sm text-muted-foreground mt-1.5",children:r("external.feed.paidBody")}),p>
10&&t.jsx("p",{className:"text-sm text-primary font-medium mt-1.5",children:r("external.feed.moreNearby").replace("{count}",String(p))}),t.jsx(d,{className:"mt-3 rounded-xl h-10",onClick:()=>y.open("generic",r("external.feed.paidBody")),children:r("external.feed.startTrial")})]}),h?t.jsx("div",{className:"grid place-items-center py-20",children:t.jsx(C,{className:"w-6 h-6 animate-spin text-muted-foreground"})}):i.length===0?t.jsx("p",{className:"px-5 text-sm text-muted-foreground",children:r("external.feed.empty")}):t.jsxs("div",{className:"px-5 space-y-3",children:[i.map(e=>t.jsxs("article",{onClick:()=>X(e.id),className:"rounded-card border border-border/60 bg-card/60 p-4",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 mb-1 rounded-full text-micro font-bold uppercase tracking-wider",style:{backgroundColor:`${P[u(e)]}26`,color:P[u(e)]},children:r(`external.pinKind.${u(e)}`)}),e.source_label&&t.jsx("span",{className:"ml-1.5 text-micro text-muted-foreground uppercase tracking-wider",children:e.source_label}),e.matches_trades&&t.jsx("span",{className:"ml-1.5 inline-flex items-center px-1.5 py-0.5 mb-1 rounded-full bg-primary/15 text-primary text-micro font-bold uppercase tracking-wider",children:r("external.feed.matchesTrades")}),e.my_status&&e.my_status!=="new"&&t.jsx("span",{className:"ml-1.5 inline-flex items-center px-1.5 py-0.5 mb-1 rounded-full bg-secondary text-secondary-foreground text-micro font-bold uppercase tracking-wider",children:N(e.my_status)}),!!e.note_count&&t.jsx("span",{className:"ml-1.5 inline-flex items-center px-1.5 py-0.5 mb-1 rounded-full border border-border/60 text-muted-foreground text-micro font-bold uppercase tracking-wider",children:r("external.notes.count").replace("{n}",String(e.note_count))}),A(e.lead_kind)!=="post"&&t.jsx("span",{className:"ml-1.5 inline-flex items-center px-1.5 py-0.5 mb-1 rounded-full bg-amber-500/15 text-amber-600 dark:text-amber-400 text-micro font-bold uppercase tracking-wider",children:r(T(A(e.lead_kind)))}),t.jsx("div",{className:"font-semibold truncate",children:e.title||e.trade||r("entityLabels.external")}),e.permit_owner_type==="owner"&&t.jsx("div",{className:"text-caption text-primary mt-0.5",children:r("external.kind.ownerPulled")}),K(e.acts_by)&&t.jsx("div",{className:"text-caption text-muted-foreground mt-0.5",children:r("external.kind.actsBy").replace("{date}",K(e.acts_by))}),t.jsxs("div",{className:"text-xs text-muted-foreground mt-0.5 flex items-center gap-1",children:[t.jsx(ne,{className:"w-3 h-3"}),[e.city,e.state].filter(Boolean).join(", ")||r("external.feed.nearby"),e.distance_miles!=null&&` · ${e.distance_miles} mi`]})]}),t.jsxs("span",{className:"text-caption text-muted-foreground shrink-0 inline-flex items-center gap-1",children:[t.jsx(le,{className:"w-3 h-3"}),Z(e.posted_at)]})]}),t.jsxs("p",{className:"text-sm text-muted-foreground mt-2.5 line-clamp-3",children:[e.body,e.locked&&"…"]}),t.jsx("div",{className:"mt-3 flex items-center gap-2",children:e.locked||!e.source_url?t.jsxs(d,{variant:"outline",className:"rounded-xl h-9 text-xs",onClick:()=>y.open("generic",r("external.feed.paidBody")),children:[t.jsx(ie,{className:"w-3.5 h-3.5 mr-1.5"}),r("external.feed.startTrial")]}):t.jsxs(d,{variant:"outline",className:"rounded-xl h-9 text-xs",onClick:()=>window.open(e.source_url,"_blank","noopener,noreferrer"),children:[t.jsx(oe,{className:"w-3.5 h-3.5 mr-1.5"}),r("external.feed.openOriginal")]})})]},e.id)),t.jsx("p",{className:"text-xs text-muted-foreground text-center pt-1",children:r("external.feed.showingCount").replace("{shown}",String(i.length)).replace("{total}",String(Math.max(U,i.length)))}),q&&t.jsx(d,{variant:"outline",className:"w-full rounded-xl h-11",disabled:g,onClick:()=>void D(),children:g?t.jsx(C,{className:"w-4 h-4 animate-spin"}):r("external.feed.loadMore")})]})]})}export{_e 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.