PageSourceSearch

https://www.intelital.com/_next/static/chunks/pages/admin/training-data-0a2748aa9e5e99f1.js

js intelital.com collected 2026-10-02 01:33:42 UTC 23,716 bytes, 1 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="19bc5aaa-02c6-4a28-8d2f-a3b4927d63bb",e._sentryDebugIdIdentifier="sentry-dbid-19bc5aaa-02c6-4a28-8d2f-a3b4927d63bb")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5235],{44734:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(77161).A)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},54114:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});var a=s(37876);function r({children:e}){return(0,a.jsx)("div",{className:"w-full h-full flex flex-row bg-surface overflow-hidden",children:(0,a.jsx)("div",{className:"flex-1 min-w-0 overflow-hidden",children:e})})}s(14232)},60265:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(77161).A)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},61081:(e,t,s)=>{"use strict";s.d(t,{A:()=>c});var a=s(37876),r=s(14232),l=s(4033),n=s(56572);let d=(0,s(77161).A)("loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);var o=s(5164),i=s(98477);function c({onOrgSelect:e,selectedOrgId:t}){let[s,c]=(0,r.useState)([]),[x,u]=(0,r.useState)(!0),[g,h]=(0,r.useState)(null),[m,p]=(0,r.useState)(!1),[b,f]=(0,r.useState)(null),[y,j]=(0,r.useState)(!1),v=(0,r.useRef)(null),N=(0,r.useRef)(null),[k,w]=(0,r.useState)(null);(0,r.useEffect)(()=>{let e=!0;(async()=>{try{let{data:t}=await l.N.auth.getSession();if(!e)return;f(t.session?.access_token||null)}catch{if(!e)return;f(null)}})();let{data:t}=l.N.auth.onAuthStateChange((t,s)=>{e&&f(s?.access_token||null)});return()=>{e=!1,t.subscription.unsubscribe()}},[]),(0,r.useEffect)(()=>{(async()=>{if(b)try{u(!0),h(null);let s=await fetch(`/api/admin/list-orgs?_t=${Date.now()}`,{headers:{Authorization:`Bearer ${b}`},cache:"no-store"}).catch(e=>{throw console.error("Fetch error:",e),Error(`Network error: ${e?.message||"Failed to reach server"}`)});if(412===s.status){c([]),j(!0);return}if(401===s.status||403===s.status){f(null),c([]),h("Not authorized");return}let a=await s.json().catch(()=>({}));if(!s.ok){let e=String(a?.error||"");if(412===s.status||a?.mfaRequired||e.toLowerCase().includes("mfa required")){c([]),j(!0);return}throw Error(e||`Server error (${s.status})`)}let r=(a.orgs||[]).filter(e=>{let t=String(e.classification||"").toLowerCase().trim();return!!t&&!["innactive"].includes(t)});if(c(r),!t&&r&&r.length>0){let t=r.find(e=>"intelital"===String(e?.name||"").trim().toLowerCase());e((t||r[0]).id)}}catch(e){console.error("Error loading orgs:",e),h(e.message||"Failed to load organizations")}finally{u(!1)}})()},[b,e,t]);let _=s.find(e=>e.id===t);(0,r.useEffect)(()=>{if(m&&v.current){let e=v.current.getBoundingClientRect();w({top:e.bottom+8,left:e.left})}},[m]),(0,r.useEffect)(()=>{if(!m)return;let e=e=>{let t=e.target;v.current?.contains(t)||N.current?.contains(t)||p(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[m]);let S=x?(0,a.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 bg-surface-alt rounded-lg border border-border/50",children:[(0,a.jsx)(d,{className:"h-4 w-4 animate-spin text-fg-secondary"}),(0,a.jsx)("span",{className:"text-sm text-fg-secondary",children:"Loading organizations..."})]}):g?(0,a.jsx)("div",{className:"px-4 py-2 bg-red-500/10 rounded-lg border border-red-500/30 text-sm text-red-500",children:g}):0===s.length?(0,a.jsx)("div",{className:"px-4 py-2 bg-surface-alt rounded-lg border border-border/50 text-sm text-fg-secondary",children:"No organizations found"}):(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("button",{ref:v,onClick:()=>p(!m),className:"flex items-center gap-2 px-3 py-1.5 rounded-md border border-transparent text-sm bg-brand text-fg-onBrand shadow-sm transition-colors hover:bg-brand-dark",children:[(0,a.jsx)("span",{className:"font-medium",children:_?.name||"Select org"}),(0,a.jsx)(o.A,{className:`h-4 w-4 transition-transform ${m?"rotate-180":""}`})]}),m&&k&&(0,i.createPortal)((0,a.jsx)("div",{ref:N,className:"fixed w-64 bg-surface-alt rounded-lg border border-border/50 shadow-xl z-[9999] max-h-96 overflow-y-auto",style:{to
1p:k.top,left:k.left},children:s.map(s=>(0,a.jsxs)("button",{onClick:()=>{e(s.id),p(!1)},className:`w-full text-left px-4 py-3 text-sm transition-colors ${t===s.id?"bg-brand/10 text-brand font-medium":"text-text hover:bg-surface/50"}`,children:[(0,a.jsx)("div",{className:"font-medium",children:s.name}),s.domain&&(0,a.jsx)("div",{className:"text-xs text-fg-secondary",children:s.domain})]},s.id))}),document.body)]});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.H,{isOpen:y,onClose:()=>{j(!1)},onSuccess:()=>{j(!1)}}),S]})}},76028:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(77161).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},78267:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(77161).A)("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]])},78800:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>N});var a=s(37876),r=s(14232),l=s(89099),n=s(60265),d=s(5164),o=s(76028),i=s(44734),c=s(78267),x=s(5002),u=s(99584),g=s(75304),h=s(61081),m=s(54114);function p(e){let t=[e.target_like,e.target_call,e.target_won,e.target_days_to_call],s=t.filter(e=>null==e).length;return 0===s?"complete":s===t.length?"missing":"partial"}let b={complete:"#1F5B69",partial:"#9E9A91",missing:"#7F0C50"};function f(e,t){return e.length?Math.round(e.filter(e=>null!==e[t]&&void 0!==e[t]).length/e.length*100):0}function y({pct:e}){return(0,a.jsx)("div",{className:"mt-1 h-1 w-full rounded-full bg-border/30 overflow-hidden",children:(0,a.jsx)("div",{style:{width:`${e}%`,background:e>=80?"#1F5B69":e>
1=40?"#9E9A91":"#7F0C50",height:"100%",borderRadius:9999}})})}function j({val:e}){return null==e?(0,a.jsx)("span",{style:{color:"#7F0C50",background:"rgba(127,12,80,0.08)",borderRadius:4,padding:"1px 6px",fontSize:11},children:"null"}):(0,a.jsx)("span",{style:{color:e?"#1F5B69":"#9E9A91",background:e?"rgba(31,91,105,0.1)":"rgba(158,154,145,0.12)",borderRadius:4,padding:"1px 6px",fontSize:11,fontWeight:500},children:e?"✓":"✗"})}function v({val:e}){return null==e||""===e?(0,a.jsx)("span",{style:{color:"#7F0C50",background:"rgba(127,12,80,0.08)",borderRadius:4,padding:"1px 6px",fontSize:11},children:"null"}):(0,a.jsx)("span",{children:String(e)})}function N(){var e;let{user:t,loading:s}=(0,u.A)(),N=(0,l.useRouter)(),{accessToken:k,adminAllowed:w,adminChecked:_,mfaRequired:S}=(0,g.v)();(0,r.useEffect)(()=>{s||t||N.replace(`/login?redirectedFrom=${encodeURIComponent(N.asPath||"/admin/training-data")}`)},[s,N,t]);let F="string"==typeof N.query.orgId?N.query.orgId:"",[C,A]=(0,r.useState)(F);(0,r.useEffect)(()=>{!C&&F&&A(F)},[F,C]);let[M,R]=(0,r.useState)(null),[B,E]=(0,r.useState)(null),[T,z]=(0,r.useState)(!1),[L,$]=(0,r.useState)(!1),[q,I]=(0,r.useState)(500),[D,O]=(0,r.useState)(0),[P,H]=(0,r.useState)(null),[U,W]=(0,r.useState)(null),[X,J]=(0,r.useState)("all"),[V,G]=(0,r.useState)(!1),[K,Q]=(0,r.useState)(!1),[Y,Z]=(0,r.useState)("all"),ee=(0,r.useRef)(0),et=!s&&t&&_,es=async(e,t)=>{if(!k)return;let s=++ee.current;z(!0),E(null);try{let a="number"==typeof t?.offset&&Number.isFinite(t.offset)?Math.max(0,Math.trunc(t.offset)):D,r=new URLSearchParams({orgId:e,limit:String(q),offset:String(a),_t:String(Date.now())}),l=await fetch(`/api/admin/training-data/dashboard?${r}`,{headers:{Authorization:`Bearer ${k}`},cache:"no-store"}),n=await l.json().catch(()=>({}));if(s!==ee.current)return;if(!l.ok)throw Error(n?.error||"Failed to load training-data dashboard");R(n),O(n?.paging?.offset??a)}catch(e){R(null),E(e?.message||"Failed to load dashboard")}finally{z(!1)}},ea=async e=>{if(k&&e){$(!0),E(null);try{let t=await fetch("/api/admin/training-data/clean",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${k}`},body:JSON.stringify({orgId:e,dryRun:!1,action:"run",steps:{deterministic:!0,llmFillMissing:!1,llmValidate:!1}})}),s=await t.json().catch(()=>({}));if(!t.ok)throw Error(s?.error||"Failed to sync training_leads");await es(e)}catch(e){E(e?.message||"Failed to sync training_leads")}finally{$(!1)}}};(0,r.useEffect)(()=>{C&&k&&w&&es(C,{offset:0})},[C,k,w,q]);let er=(0,r.useMemo)(()=>Object.entries(M?.stats?.overlaysByStatus||{}).map(([e,t])=>({status:e,count:t})).sort((e,t)=>t.count-e.count),[M]),el=(0,r.useMemo)(()=>{let e=M?.rows||[];return"all"!==X&&(e=e.filter(e=>(e.overlay_status||"(none)")===X)),V&&(e=e.filter(e=>"missing"===p(e))),K&&(e=e.filter(e=>e.feedback_count>0)),P&&U&&(e=[...e].sort((e,t)=>{let s=e[P]??"",a=t[P]??"",r=s<a?-1:+(s>a);return"asc"===U?r:-r})),e},[M,K,V,X,U,P]),en=M?.rows||[],ed=M?.paging?.total??en.length,eo=(M?.paging?.offset??D)+1,ei=(M?.paging?.offset??D)+en.length,ec=(M?.paging?.offset??D)>0,ex=ei<ed;function eu(e){P===e?(W(e=>"asc"===e?"desc":"desc"===e?null:"asc"),"desc"===U&&H(null)):(H(e),W("asc"))}function eg({col:e}){return P!==e?(0,a.jsx)("span",{style:{opacity:.3},children:(0,a.jsx)(n.A,{className:"inline h-3 w-3"})}):"asc"===U?(0,a.jsx)(n.A,{className:"inline h-3 w-3",style:{color:"#1F5B69"}}):(0,a.jsx)(d.A,{className:"inline h-3 w-3",style:{color:"#1F5B69"}})}let eh="all"===Y||"features"===Y,em="all"===Y||"targets"===Y,ep=(0,r.useMemo)(()=>Array.from(new Set((M?.rows||[]).map(e=>e.overlay_status||"(none)"))),[M]),eb=[V,K,"all"!==X].filter(Boolean).length;return et?w?S?(0,a.jsx)(m.A,{children:(0,a.jsx)("div",{className:"p-6",children:(0,a.jsx)("div",{className:"rounded-lg border border-border/60 bg-surface-alt p-4",children:(0,a.jsx)("div",{className:"text-sm text-fg-secondary",children:"MFA required"})})})}):(0,a.jsx)(m.A,{children:(0,a.jsx)("div",{className:"w-full h-full overflow-auto",children:(0,a.jsxs)("div",{className:"p-6 max-w-[1400px] mx-auto",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-2xl font-semibold text-text",children:"Training Data"}),(0,a.jsx)("div",{className:"text-sm text-fg-secondary",children:"Inspect lead funnel labels + data quality before model prep."})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(h.A,{selectedOrgId:C,onOrgSelect:A}),(0,a.jsxs)("div",{className:"flex items-center gap-1 rounded-md border border-border/60 bg-surface-alt p-1",children:[(0,a.jsx)("button",{className:"px-2.5 py-1 rounded text-xs font-medium",style:{background:"#1F5B69",color:"#fff"},onClick:()=>N.push("/admin/training-data"),children:"1. Sync & view"}),(0,a.jsx)("button",{className:"px-2.5 py-1 rounded text-xs text-fg-secondary hover:text-text",onClick:()=>{let e=C?`?orgId=${encodeURIComponent(C)}`:"";N.push(`/admin/training-data/cleaning${e}`)},children:"2. Clean"})]}),(0,a.jsxs)("button",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-md border border-border/60 bg-surface-alt text-sm text-text hover:bg-surface",onClick:()=>{C&&ea(C)},disabled:!C||L||T,title:"Rebuild training_leads from leads/prospects/overlays/feedback (preserving existing non-empty edits)",children:[L?(0,a.jsx)(o.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(i.A,{className:"h-4 w-4"}),"Sync training_leads"]}),(0,a.jsxs)("button",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-md border border-border/60 bg-surface-alt text-sm text-text hover:bg-surface",onClick:()=>{C&&es(C)},disabled:!C||T,children:[T?(0,a.jsx)(o.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(i.A,{className:"h-4 w-4"}),"Refresh"]})]})]}),(0,a.jsxs)("div",{className:"mt-3 flex items-center justify-between gap-3 flex-wrap",children:[(0,a.jsx)("div",{className:"text-xs text-fg-secondary",children:ed>0?(0,a.jsxs)("span",{children:["Showing ",(0,a.jsx)("strong",{children:eo}),"–",(0,a.jsx)("strong",{children:ei})," of ",(0,a.jsx)("strong",{children:ed})]}):(0,a.jsx)("span",{children:"Showing 0 rows"})}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("select",{value:String(q),onChange:e=>{let t=Number(e.target.value),s=Number.isFinite(t)?Math.max(50,Math.min(2e3,t)):500;O(0),I(s)},className:"text-xs px-2 py-1.5 rounded-md border border-border/60 bg-surface text-fg-secondary",children:[100,250,500,1e3,2e3].map(e=>(0,a.jsxs)("option",{value:String(e),children:[e," / page"]},e))}),(0,a.jsx)("button",{className:"text-xs px-3 py-1.5 rounded-md border border-border/60 bg-surface-alt text-text hover:bg-surface disabled:opacity-50",disabled:!C||T||!ec,onClick:()=>
1{C&&es(C,{offset:Math.max(0,(M?.paging?.offset??D)-q)})},children:"Prev"}),(0,a.jsx)("button",{className:"text-xs px-3 py-1.5 rounded-md border border-border/60 bg-surface-alt text-text hover:bg-surface disabled:opacity-50",disabled:!C||T||!ex,onClick:()=>{C&&es(C,{offset:(M?.paging?.offset??D)+q})},children:"Next"})]})]}),B&&(0,a.jsx)("div",{className:"mt-4 rounded-lg border border-red-500/30 bg-red-500/10 p-4 text-sm text-red-500",children:B}),(0,a.jsx)("div",{className:"mt-6 grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",children:[{label:"Leads (loaded)",value:M?.stats?.leadsTotal??"—",sub:M?.stats?.trainingLeadsTotal!=null&&M?.stats?.leadsTotal?`${Math.round(M.stats.trainingLeadsTotal/M.stats.leadsTotal*100)}% labeled`:null,pct:M?.stats?.trainingLeadsTotal!=null&&M?.stats?.leadsTotal?Math.round(M.stats.trainingLeadsTotal/M.stats.leadsTotal*100):null},{label:"Companies",value:M?.stats?.companiesTotal??"—",sub:null,pct:null},{label:"Training rows",value:M?.stats?.trainingLeadsTotal??"—",sub:null,pct:null},{label:"Overlays",value:M?.stats?.overlaysTotal??"—",sub:null,pct:null},{label:"Feedback rows",value:M?.stats?.feedbackTotal??"—",sub:null,pct:null},{label:"Avg rating",value:("number"==typeof(e=M?.stats?.feedbackAvgRating)&&Number.isFinite(e)?e.toFixed(2):"")||"—",sub:null,pct:null}].map(e=>(0,a.jsxs)("div",{className:"rounded-lg border border-border/60 bg-surface-alt p-4",children:[(0,a.jsx)("div",{className:"text-xs text-fg-secondary",children:e.label}),(0,a.jsx)("div",{className:"text-2xl font-semibold text-text mt-1",children:e.value}),e.sub&&(0,a.jsx)("div",{className:"text-xs mt-1",style:{color:"#1F5B69"},children:e.sub}),null!==e.pct&&(0,a.jsx)("div",{className:"mt-2 h-1 w-full rounded-full overflow-hidden",style:{background:"rgba(158,154,145,0.2)"},children:(0,a.jsx)("div",{style:{width:`${e.pct}%`,background:"#1F5B69",height:"100%",borderRadius:9999,transition:"width 0.4s ease"}})})]},e.label))}),(0,a.jsx)("div",{className:"mt-4 flex flex-wrap gap-2",children:er.map(e=>{let t=M?.stats?.overlaysTotal||1,s=Math.round(e.count/t*100);return(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-full px-3 py-1 text-xs border border-border/60 bg-surface-alt",children:[(0,a.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:"attempting_contact"===e.status?"#1F5B69":"#9E9A91",display:"inline-block",flexShrink:0}}),(0,a.jsx)("span",{className:"text-fg-secondary",children:e.status}),(0,a.jsx)("span",{className:"font-medium text-text",children:e.count}),(0,a.jsxs)("span",{className:"text-fg-secondary",children:["(",s,"%)"]})]},e.status)})}),(0,a.jsxs)("div",{className:"mt-6 rounded-lg border border-border/60 bg-surface-alt overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border/60 flex-wrap",children:[(0,a.jsxs)("div",{className:"text-sm font-medium text-text flex items-center gap-2",children:[(0,a.jsx)(c.A,{className:"h-4 w-4",style:{color:"#1F5B69"}}),"training_leads",el.length!==en.length&&(0,a.jsxs)("span",{className:"text-xs px-2 py-0.5 rounded-full",style:{background:"rgba(127,12,80,0.1)",color:"#7F0C50"},children:[el.length," / ",en.length]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 ml-auto flex-wrap",children:[(0,a.jsxs)("select",{value:X,onChange:e=>J(e.target.value),className:"text-xs px-2 py-1.5 rounded-md border border-border/60 bg-surface text-fg-secondary",children:[(0,a.jsx)("option",{value:"all",children:"All statuses"}),ep.map(e=>(0,a.jsx)("option",{value:e,children:e},e))]}),(0,a.jsx)("button",{onClick:()=>G(e=>!e),className:"text-xs px-3 py-1.5 rounded-full border transition-all",style:{borderColor:V?"#7F0C50":"rgba(158,154,145,0.4)",background:V?"rgba(127,12,80,0.1)":"transparent",color:V?"#7F0C50":"var(--text-secondary)"},children:"Missing targets only"}),(0,a.jsx)("button",{onClick:()=>Q(e=>!e),className:"text-xs px-3 py-1.5 rounded-full border transition-all",style:{borderColor:K?"#1F5B69":"rgba(158,154,145,0.4)",background:K?"rgba(31,91,105,0.1)":"transparent",color:K?"#1F5B69":"var(--text-secondary)"},children:"Has feedback"}),eb>0&&(0,a.jsxs)("button",{onClick:()=>{J("all"),G(!1),Q(!1)},className:"text-xs px-2 py-1.5 rounded-md text-fg-secondary flex items-center gap-1 hover:text-text",children:[(0,a.jsx)(x.A,{className:"h-3 w-3"})," Clear"]}),(0,a.jsx)("div",{className:"flex rounded-md border border-border/60 overflow-hidden",children:["all","features","targets"].map(e=>(0,a.jsx)("button",{onClick:()=>Z(e),className:"text-xs px-2 py-1.5 transition-all",style:{background:Y===e?"#1F5B69":"transparent",color:Y===e?"#fff":"var(--text-secondary)"},children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-4 px-4 py-2 border-b border-border/40 text-xs text-fg-secondary",children:[(0,a.jsx)("span",{className:"font-medium",children:"Row quality:"}),[{label:"Complete",color:"#1F5B69"},{label:"Partial",color:"#9E9A91"},{label:"Missing targets",color:"#7F0C50"}].map(e=>(0,a.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{style:{display:"inline-block",width:3,height:14,borderRadius:2,background:e.color}}),e.label]},e.label))]}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",style:{minWidth:900},children:[(0,a.jsxs)("thead",{children:[(0,a.jsxs)("tr",{style:{background:"rgba(31,91,105,0.04)",borderBottom:"1px solid rgba(158,154,145,0.2)"},children:[eh&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("th",{colSpan:5,className:"text-left px-4 py-1.5 text-xs font-medium tracking-wide uppercase",style:{color:"#1F5B69",borderRight:em?"2px solid rgba(31,91,105,0.15)":void 0},children:"Features"}),em&&(0,a.jsx)("th",{colSpan:4})]}),!eh&&em&&(0,a.jsx)("th",{colSpan:4,className:"text-left px-4 py-1.5 text-xs font-medium tracking-wide uppercase",style:{color:"#7F0C50"},children:"Targets"})]}),(0,a.jsxs)("tr",{style:{borderBottom:"1px solid rgba(158,154,145,0.2)"},children:[eh&&(0,a.jsx)(a.Fragment,{children:[{key:"company_name",label:"Company"},{key:"company_domain",label:"Domain"},{key:"company_industry",label:"Industry"}
1,{key:"company_size",label:"Employees"},{key:"lead_title",label:"Lead title"}].map((e,t,s)=>(0,a.jsxs)("th",{className:"text-left px-4 py-2 cursor-pointer select-none",style:{borderRight:t===s.length-1&&em?"2px solid rgba(31,91,105,0.15)":void 0},onClick:()=>eu(e.key),children:[(0,a.jsxs)("div",{className:"flex items-center gap-1 text-xs font-medium text-fg-secondary whitespace-nowrap",children:[e.label," ",(0,a.jsx)(eg,{col:e.key})]}),en.length>0&&(0,a.jsx)(y,{pct:f(en,e.key)})]},e.key))}),em&&(0,a.jsx)(a.Fragment,{children:[{key:"target_like",label:"Like"},{key:"target_call",label:"Call"},{key:"target_won",label:"Won"},{key:"target_days_to_call",label:"Days to call"}].map(e=>(0,a.jsxs)("th",{className:"text-left px-4 py-2 cursor-pointer select-none",style:{background:"rgba(31,91,105,0.03)"},onClick:()=>eu(e.key),children:[(0,a.jsxs)("div",{className:"flex items-center gap-1 text-xs font-medium whitespace-nowrap",style:{color:"#1F5B69"},children:[e.label," ",(0,a.jsx)(eg,{col:e.key})]}),en.length>0&&(0,a.jsx)(y,{pct:f(en,e.key)})]},e.key))})]})]}),(0,a.jsx)("tbody",{children:0===el.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:9,className:"px-4 py-8 text-center text-sm text-fg-secondary",children:0===en.length?"No data loaded":"No rows match current filters"})}):el.map(e=>{let t=p(e);return(0,a.jsxs)("tr",{className:"border-t border-border/30 hover:bg-surface/50 transition-colors",style:{borderLeft:`3px solid ${b[t]}`},children:[eh&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("td",{className:"px-4 py-2.5",style:{borderRight:em?"2px solid rgba(31,91,105,0.08)":void 0},children:(0,a.jsx)("div",{className:"text-text font-medium text-xs leading-tight",children:e.company_name||(0,a.jsx)("span",{style:{color:"#7F0C50",fontSize:11},children:"null"})})}),(0,a.jsx)("td",{className:"px-4 py-2.5 text-xs text-fg-secondary",children:(0,a.jsx)(v,{val:e.company_domain})}),(0,a.jsx)("td",{className:"px-4 py-2.5 text-xs text-fg-secondary",children:(0,a.jsx)(v,{val:e.company_industry})}),(0,a.jsx)("td",{className:"px-4 py-2.5 text-xs text-fg-secondary",children:(0,a.jsx)(v,{val:e.company_size})}),(0,a.jsx)("td",{className:"px-4 py-2.5 text-xs text-fg-secondary",style:{borderRight:em?"2px solid rgba(31,91,105,0.08)":void 0},children:(0,a.jsx)(v,{val:e.lead_title})})]}),em&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("td",{className:"px-4 py-2.5",style:{background:"rgba(31,91,105,0.02)"},children:(0,a.jsx)(j,{val:e.target_like})}),(0,a.jsx)("td",{className:"px-4 py-2.5",style:{background:"rgba(31,91,105,0.02)"},children:(0,a.jsx)(j,{val:e.target_call})}),(0,a.jsx)("td",{className:"px-4 py-2.5",style:{background:"rgba(31,91,105,0.02)"},children:(0,a.jsx)(j,{val:e.target_won})}),(0,a.jsx)("td",{className:"px-4 py-2.5 text-xs",style:{background:"rgba(31,91,105,0.02)"},children:null!==e.target_days_to_call&&void 0!==e.target_days_to_call?(0,a.jsxs)("span",{style:{color:e.target_days_to_call>30?"#7F0C50":"#1F5B69",fontWeight:500},children:[e.target_days_to_call,"d"]}):(0,a.jsx)("span",{style:{color:"#7F0C50",background:"rgba(127,12,80,0.08)",borderRadius:4,padding:"1px 6px",fontSize:11},children:"null"})})]})]},e.lead_id)})})]})}),(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 border-t border-border/40 text-xs text-fg-secondary",children:[(0,a.jsxs)("span",{children:["Showing ",(0,a.jsx)("strong",{children:el.length})," of"," ",(0,a.jsx)("strong",{children:en.length})," leads"]}),(0,a.jsx)("div",{className:"flex items-center gap-4",children:["complete","partial","missing"].map(e=>{let t=en.filter(t=>p(t)===e).length;return(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:b[e]}}),e,": ",t]},e)})})]})]})]})})}):(0,a.jsx)(m.A,{children:(0,a.jsx)("div",{className:"p-6",children:(0,a.jsx)("div",{className:"rounded-lg border border-border/60 bg-surface-alt p-4",children:(0,a.jsx)("div",{className:"text-sm text-fg-secondary",children:"Not authorized"})})})}):null}},81284:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/training-data",function(){return s(78800)}])}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=81284)),_N_E=e.O()}]);

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.