PageSourceSearch

https://clearsell.app/assets/competitive-recon-Ba3u1Kvt.js

js clearsell.app collected 2026-10-02 01:14:45 UTC 70,664 bytes, 79 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CQsCPMiJ.js","assets/index-n47SFyYV.css"])))=>i.map(i=>d[i]);
2import{a as c,U as he,j as e,ao as K,a5 as ue,ac as be,a3 as ye,n as oe,e as je,h as ve,aO as Se,aq as ke,ad as Ne,ay as we,T as ze,A as J,C as ee}from"./index-CQsCPMiJ.js";import{u as Ce,S as Fe}from"./share-scan-button-D0tFtsjv.js";import{T as te}from"./teaser-lock-BFpG8wYr.js";import{L as Z,I as se,B as re}from"./shared-BZeBVdot.js";import{C as Me}from"./client-workspace-selector-DoTRKb5I.js";import{A as Te,a as Re}from"./analyst-panel-B4A1VvUr.js";import{P as Ae}from"./post-scan-value-card-CJLB286p.js";import{T as _e,a as We,b as Be,H as Pe,f as Ie}from"./tool-input-shared-r1WFv50V.js";import{F as De}from"./FrustrationHeatmap-_FVkqkU5.js";import{F as $e}from"./FrustrationSeverityMap-BCGBa4Dp.js";import{S as ce,M as le,C as de}from"./swords-T_xM10kf.js";import{T as Le}from"./target-bgIQYqmS.js";import"./share-2-CtjU6YXA.js";import"./link-2-CKeuY6Yf.js";import"./download-BXR6uZUs.js";import"./star-XwHECkEX.js";import"./use-admin-lmsoZXf6.js";const Oe="",ie=[{id:"executive_summary",label:"Executive Summary",default:!0},{id:"frustration_matrix",label:"Frustration Matrix",default:!0},{id:"clusters",label:"Competitive Clusters",default:!0},{id:"white_space",label:"White Space Opportunities (Top 3)",default:!0},{id:"vulnerability_cascade",label:"Vulnerability Cascade (Top 10)",default:!0},{id:"client_position",label:"Client Position Assessment",default:!0},{id:"battle_plan",label:"Battle Plan — Immediate Actions",default:!0}];function pe({open:t,onClose:s,reconId:i,reconName:o,clientAsin:a,workspaceId:p,defaultClientName:r,hasClientPosition:d}){const[m,j]=c.useState(""),[N,x]=c.useState(""),[v,F]=c.useState(""),[h,n]=c.useState([]),[f,u]=c.useState(!1),[b,$]=c.useState(null),{toast:_}=he();c.useEffect(()=>{if(!t){j(""),x(""),F(""),n([]),u(!1),$(null);return}j(o||"Competitive Intelligence Report"),r&&x(r),p&&$(p);const g=ie.filter(y=>y.default).filter(y=>y.id!=="client_position"||d).map(y=>y.id);n(g)},[t,o,p,r,d]);const M=g=>{n(y=>y.includes(g)?y.filter(I=>I!==g):[...y,g])},G=async()=>{if(!m.trim()){_({title:"Report title required",variant:"destructive"});return}if(h.length===0){_({title:"Select at least one section",variant:"destructive"});return}u(!0);try{const g=await fetch(`${Oe}/api/agency/reports/competitive-recon/generate`,{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-Token":oe()||""},credentials:"include",body:JSON.stringify({competitiveReconId:i,reportTitle:m.trim(),clientName:N.trim()||null,agencyNotes:v.trim()||null,sections:h,workspaceId:b})});if(!g.ok){const H=await g.json().catch(()=>({error:"Generation failed"}));throw new Error(H.error||"Generation failed")}const y=await g.blob(),I=URL.createObjectURL(y),W=document.createElement("a");W.href=I;const A=g.headers.get("Content-Disposition")?.match(/filename="(.+)"/);W.download=A?.[1]||"recon-report.pdf",W.click(),URL.revokeObjectURL(I),_({title:"Report generated",description:"PDF downloaded successfully"}),s()}catch(g){_({title:"Generation failed",description:g.message,variant:"destructive"})}finally{u(!1)}};if(!t)return null;const w=ie.filter(g=>g.id!=="client_position"||d);return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[e.jsx("div",{className:"absolute inset-0 bg-black/70 backdrop-blur-sm",onClick:s}),e.jsxs("div",{className:"relative w-full max-w-2xl max-h-[90vh] overflow-y-auto rounded-2xl border border-white/10 bg-[#0F1117] shadow-2xl",children:[e.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between p-5 border-b border-white/10 bg-[#0F1117]",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-purple-500/10",children:e.jsx(K,{className:"w-5 h-5 text-purple-400"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-bold text-white",children:"Export to White-Label PDF"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Generate a branded competitive recon report"})]})]}),e.jsx("button",{onClick:s,className:"p-2 rounded-lg hover:bg-white/5 text-muted-foreground hover:text-white transition-colors",children:e.jsx(ue,{className:"w-5 h-5"})})]}),e.jsxs("div",{className:"p-5 space-y-5",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(Z,{className:"text-sm text-muted-foreground",children:"Report Title *"}),e.jsx(se,{value:m,onChange:g=>j(g.target.value),maxLength:200,className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx(Z,{className:"text-sm text-muted-foreground",children:"Client Name"}),e.jsx(se,{value:N,onChange:g=>x(g.target.value),placeholder:"Acme Corp",className:"mt-1"})]})]}),!p&&e.jsx(Me,{value:b,onChange:$}),e.jsxs("div",{children:[e.jsx(Z,{className:"text-sm text-muted-foreground mb-2 block",children:"Report Sections"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:w.map(g=>{const y=h.includes(g.id);return e.jsxs("button",{onClick:()=>M(g.id),className:`flex items-center gap-2 px-3 py-2 rounded-lg text-left text-sm transition-colors ${y?"bg-purple-500/10 text-white border border-purple-500/20":"text-muted-foreground border border-white/5 hover:border-white/10"}`,children:[e.jsx("div",{className:`w-4 h-4 rounded flex items-center justify-center border ${y?"bg-purple-500 border-purple-500":"border-white/20"}`,children:y&&e.jsx(be,{className:"w-2.5 h-2.5 text-white"})}),g.label]},g.id)})})]}),e.jsxs("div",{children:[e.jsx(Z,{className:"text-sm text-muted-foreground",children:"Strategic Recommendations (optional)"}
2),e.jsx("textarea",{value:v,onChange:g=>F(g.target.value),maxLength:2e3,rows:3,placeholder:"Add your own strategic notes for the client...",className:"mt-1 w-full rounded-xl border border-white/10 bg-white/5 px-4 py-3 text-sm text-white placeholder:text-muted-foreground/50 focus:outline-none focus:ring-2 focus:ring-purple-500/40 resize-none"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[v.length,"/2000"]})]})]}),e.jsxs("div",{className:"sticky bottom-0 flex items-center justify-between p-5 border-t border-white/10 bg-[#0F1117]",children:[e.jsxs("p",{className:"text-xs text-muted-foreground",children:[h.length," section",h.length!==1?"s":""," selected · No credits consumed"]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(re,{variant:"outline",onClick:s,disabled:f,children:"Cancel"}),e.jsx(re,{onClick:G,disabled:f||h.length===0||!m.trim(),className:"bg-purple-600 hover:bg-purple-700 text-white",children:f?e.jsxs(e.Fragment,{children:[e.jsx(ye,{className:"w-4 h-4 animate-spin mr-2"}),"Generating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(K,{className:"w-4 h-4 mr-2"}),"Generate Report"]})})]})]})]})]})}function Q(t){return typeof t=="number"?t:parseFloat((t||"0").replace(/[^0-9.]/g,""))||0}function Ee(t){if(typeof t=="string"&&t.startsWith("$"))return t;const s=typeof t=="number"?t:Q(t);return s>0?`$${s.toFixed(2)}`:"N/A"}function Ue(t){return t.split(/\s+/).slice(0,2).map(s=>s[0]?.toUpperCase()||"").join("")}function Ge({critical:t,total:s}){const i=t>3?"high":t>0?"med":"low",a={high:{bg:"rgba(239,68,68,.08)",color:"#EF4444"},med:{bg:"rgba(255,184,0,.08)",color:"#FFB800"},low:{bg:"rgba(0,255,127,.08)",color:"#00FF7F"}}[i],p=t>0?`${t} critical${s?` / ${s}`:""}`:`${s||0} total`;return e.jsx("span",{style:{fontFamily:"var(--mono, 'DM Mono', monospace)",fontSize:10,fontWeight:700,padding:"3px 8px",borderRadius:5,whiteSpace:"nowrap",background:a.bg,color:a.color},children:p})}function Ve({rating:t}){const s=Math.floor(t),i=t-s>=.3;let o="";for(let a=0;a<s;a++)o+="★";for(i&&s<5&&(o+="★");o.length<5;)o+="☆";return e.jsxs("span",{children:[e.jsx("span",{style:{color:"#FFB800",fontSize:10,letterSpacing:-1},children:o.slice(0,s+(i?1:0))}),e.jsx("span",{style:{color:"rgba(255,184,0,0.3)",fontSize:10,letterSpacing:-1},children:o.slice(s+(i?1:0))})," ",e.jsx("span",{style:{fontSize:11,color:"#8888a0"},children:t.toFixed(1)})]})}function qe({competitors:t,categoryName:s,onRowClick:i}){const[o,a]=c.useState(null),[p,r]=c.useState(!0),[d,m]=c.useState(!1),j=c.useRef(null),N=c.useCallback(n=>{j.current=n,n&&(new ResizeObserver(u=>{for(const b of u)m(b.contentRect.width<700)}).observe(n),m(n.offsetWidth<700))},[]);if(!t||t.length===0)return null;const x=n=>{o===n?r(!p):(a(n),r(!0))},v=[...t].sort((n,f)=>{if(!o)return n.isClient&&!f.isClient?-1:!n.isClient&&f.isClient?1:0;let u,b;switch(o){case"price":u=Q(n.price),b=Q(f.price);break;case"review_count":u=n.review_count,b=f.review_count;break;case"rating":u=n.rating,b=f.rating;break;case"frustration_count":u=n.frustration_count??0,b=f.frustration_count??0;break;default:if(u=n[o]||"",b=f[o]||"",typeof u=="string")return p?u.localeCompare(b):b.localeCompare(u)}return p?u-b:b-u}),F=[s,`${t.length} competitors`,"Click column headers to sort"].filter(Boolean).join(" · "),h={fontFamily:"var(--mono, 'DM Mono', monospace)",fontSize:8,color:"#50506a",textTransform:"uppercase",letterSpacing:1,padding:"10px 8px",textAlign:"left",borderBottom:"2px solid #1a1a2a",cursor:"pointer",whiteSpace:"nowrap",userSelect:"none"};return e.jsxs("div",{ref:N,style:{background:"#0e0e16",border:"1px solid #1a1a2a",borderRadius:16,padding:24,marginBottom:20},children:[e.jsx("div",{style:{fontFamily:"var(--mono, 'DM Mono', monospace)",fontSize:9,color:"#00FF7F",textTransform:"uppercase",letterSpacing:2,marginBottom:12},children:"Competitive Recon"}),e.jsx("div",{style:{fontSize:18,fontWeight:800,color:"#f0f0f5",marginBottom:4,fontFamily:"'DM Sans', sans-serif"},children:"Competitor Overview"}),e.jsx("div",{style:{fontSize:12,color:"#50506a",marginBottom:16},children:F}),e.jsx("div",{style:{overflowX:"auto",WebkitOverflowScrolling:"touch"},children:e.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{style:{...h,width:60},children:"Image"}),e.jsxs("th",{style:h,onClick:()=>x("title"),children:["Product ",e.jsx("span",{style:{fontSize:8,marginLeft:3,opacity:.3},children:"↕"})]}),e.jsxs("th",{style:h,onClick:()=>x("brand"),children:["Brand ",e.jsx("span",{style:{fontSize:8,marginLeft:3,opacity:.3},children:"↕"})]}),e.jsxs("th",{style:h,onClick:()=>x("price"),children:["Price ",e.jsx("span",{style:{fontSize:8,marginLeft:3,opacity:.3},children:"↕"})]}),e.jsxs("th",{style:h,onClick:()=>x("rating"),children:["Rating ",e.jsx("span",{style:{fontSize:8,marginLeft:3,opacity:.3},children:"↕"})]}),e.jsxs("th",{style:h,onClick:()=>x("review_count"),children:["Reviews ",e.jsx("span",{style:{fontSize:8,marginLeft:3,opacity:.3},children:"↕"})]}),e.jsxs("th",{style:h,onClick:()=>x("frustration_count"),children:["Frustrations ",e.jsx("span",{style:{fontSize:8,marginLeft:3,opacity:.3},children:"↕"})]})]})}),e.jsx("tbody",{children:v.map(n=>e.jsxs("tr",{onClick:()=>i?.(n.asin),onMouseEnter:f=>{f.currentTarget.style.background="rgba(255,255,255,.015)"},onMouseLeave:f=>{f.currentTarget.style.background=n.isClient?"rgba(0,255,127,.02)":"transparent"},style:{borderLeft:n.isClient?"3px solid #00FF7F":"3px solid transparent",background:n.isClient?"rgba(0,255,127,.02)":"transparent",curs
2or:i?"pointer":"default"},children:[e.jsx("td",{style:{padding:"10px 8px",borderBottom:"1px solid rgba(26,26,42,.4)",verticalAlign:"middle"},children:n.isClient?e.jsx("div",{style:{width:40,height:40,borderRadius:8,background:"rgba(0,255,127,.08)",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--mono, 'DM Mono', monospace)",fontSize:9,fontWeight:700,color:"#00FF7F"},children:"YOU"}):n.product_image?e.jsx("img",{src:n.product_image,alt:"",style:{width:40,height:40,borderRadius:8,objectFit:"cover",background:"#1a1a2e"},loading:"lazy"}):e.jsx("div",{style:{width:40,height:40,borderRadius:8,background:"#1a1a2e",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--mono, 'DM Mono', monospace)",fontSize:10,fontWeight:700,color:"#50506a"},children:Ue(n.title)})}),e.jsxs("td",{style:{padding:"10px 8px",borderBottom:"1px solid rgba(26,26,42,.4)",verticalAlign:"middle"},children:[e.jsx("div",{style:{fontSize:11,fontWeight:600,color:n.isClient?"#00FF7F":"#f0f0f5",maxWidth:240,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.title}),e.jsx("div",{style:{fontFamily:"var(--mono, 'DM Mono', monospace)",fontSize:9,color:"#50506a"},children:n.asin})]}),e.jsx("td",{style:{padding:"10px 8px",borderBottom:"1px solid rgba(26,26,42,.4)",fontSize:11,color:n.isClient?"#00FF7F":"#8888a0",verticalAlign:"middle",fontWeight:n.isClient?600:400},children:n.isClient?"You":n.brand}),e.jsx("td",{style:{padding:"10px 8px",borderBottom:"1px solid rgba(26,26,42,.4)",fontSize:11,color:"#8888a0",verticalAlign:"middle"},children:Ee(n.price)}),e.jsx("td",{style:{padding:"10px 8px",borderBottom:"1px solid rgba(26,26,42,.4)",verticalAlign:"middle"},children:e.jsx(Ve,{rating:n.rating})}),e.jsx("td",{style:{padding:"10px 8px",borderBottom:"1px solid rgba(26,26,42,.4)",fontSize:11,color:"#8888a0",verticalAlign:"middle"},children:n.review_count?.toLocaleString()}),e.jsx("td",{style:{padding:"10px 8px",borderBottom:"1px solid rgba(26,26,42,.4)",verticalAlign:"middle"},children:e.jsx(Ge,{critical:n.critical_count??0,total:n.frustration_count??0})})]},n.asin))})]})})]})}const U="";function He(t){return t<=15?10:t<=30?15:25}function Ye(t){return[...new Set(t.split(/[\n,\s]+/).map(s=>s.trim().toUpperCase()).filter(s=>/^[A-Z0-9]{10}$/.test(s)))]}function Ct(){const{user:t}=je(),{decrementCredits:s,rollbackCredits:i,refreshCredits:o}=Ce(),[,a]=ve(),p=t?.tier||"free",d=t?.isAdmin||Se(p,"competitive-recon"),[m,j]=c.useState(null),[N,x]=c.useState([]),[v,F]=c.useState(""),[h,n]=c.useState(""),[f,u]=c.useState(""),[b,$]=c.useState(null),[_,M]=c.useState("idle"),[G,w]=c.useState(""),[g,y]=c.useState(null),[I,W]=c.useState(0),[q,A]=c.useState([]),[H,X]=c.useState(null),[Y,D]=c.useState(!1),[L,T]=c.useState(!1),[B,V]=c.useState(null),S=c.useMemo(()=>Ye(f),[f]),C=c.useMemo(()=>{const l=h.toUpperCase().trim();return l&&/^[A-Z0-9]{10}$/.test(l)?S.filter(O=>O!==l):S},[S,h]),R=He(C.length);if(c.useEffect(()=>{d&&(fetch(`${U}/api/competitive-recon/usage`,{credentials:"include"}).then(l=>l.ok?l.json():null).then(l=>l&&j(l)).catch(()=>{}),fetch(`${U}/api/competitive-recon/audits`,{credentials:"include"}).then(l=>l.ok?l.json():null).then(l=>l&&A(l)).catch(()=>{}),fetch(`${U}/api/workspaces`,{credentials:"include"}).then(l=>l.ok?l.json():null).then(l=>l&&x(l)).catch(()=>{}))},[d]),!d)return e.jsx(te,{toolSlug:"competitive-recon",toolName:"Competitive Recon",children:e.jsx("div",{style:{padding:32,textAlign:"center",color:"#666"},children:"Competitive Recon requires Agency tier."})});async function z(l){try{const O=await fetch(`${U}/api/competitive-recon/audits/${l}`,{credentials:"include"});if(!O.ok)throw new Error("Failed to load");const E=await O.json();y(E),W(0),M("complete"),X(l)}catch{w("Failed to load report")}}async function ge(){if(!v.trim()){w("Please enter a recon name");return}if(C.length<5){w("Minimum 5 valid competitor ASINs required");return}if(C.length>50){w("Maximum 50 ASINs per audit");return}w(""),M("validating");const l=C.length<=15?10:C.length<=30?15:25,O=s(l);try{M("analyzing");const E=await fetch(`${U}/api/competitive-recon/audit`,{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-Token":oe()||""},credentials:"include",body:JSON.stringify({reconName:v.trim(),clientAsin:h.trim()||null,competitorAsins:C,workspaceId:b})});if(!E.ok){const k=await E.json().catch(()=>({}));if(k.error==="upgrade_required"){i(O),D(!0),M("idle");return}throw new Error(k.message||"Audit failed")}M("aggregating");const xe=await E.json();y(xe),W(0),M("complete"),o();try{ke(async()=>{const{trackScanRun:k}=await import("./index-CQsCPMiJ.js").then(fe=>fe.bH);return{trackScanRun:k}},__vite__mapDeps([0,1])).then(({trackScanRun:k})=>{k({toolName:"competitive_recon"})})}catch{}fetch(`${U}/api/competitive-recon/audits`,{credentials:"include"}).then(k=>k.ok?k.json():null).then(k=>k&&A(k)).catch(()=>{}),fetch(`${U}/api/competitive-recon/usage`,{credentials:"include"}).then(k=>k.ok?k.json():null).then(k=>k&&j(k)).catch(()=>{})}
2catch(E){i(O),w(E.message||"Something went wrong"),M("idle")}}function me(){y(null),M("idle"),W(0),X(null),w("")}return _!=="idle"&&_!=="complete"?e.jsx(Je,{phase:_,asinCount:C.length,onCancel:()=>{M("idle"),w("")}}):_==="complete"&&g?e.jsx(Qe,{report:g,activeTab:I,setActiveTab:W,onReset:me,navigate:a,user:t,analystData:B,setAnalystData:V}):e.jsxs("div",{className:"ti-page",children:[e.jsx("style",{children:_e}),Y&&e.jsx(te,{toolSlug:"competitive-recon",toolName:"Competitive Recon",children:e.jsx("div",{})}),g&&e.jsx(pe,{open:L,onClose:()=>T(!1),reconId:g.id,reconName:g.reconName,clientAsin:g.clientAsin,workspaceId:g.workspaceId,hasClientPosition:!!g.clientPosition}),e.jsx(We,{icon:e.jsxs("svg",{viewBox:"0 0 18 18",width:"40",height:"40",fill:"none",stroke:"#00FF7F",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"9",cy:"9",r:"7"}),e.jsx("circle",{cx:"9",cy:"9",r:"4"}),e.jsx("circle",{cx:"9",cy:"9",r:"1.5",fill:"#00FF7F",stroke:"none"})]}),title:"Competitive Recon",tag:"Paste up to 50 competitor ASINs. Get a complete competitive intelligence report in minutes."}),e.jsx(Be,{toolName:"Competitive Recon",children:"We scrape every competitor listing, pull review sentiment, pricing history, and keyword rankings — then build a side-by-side intelligence report showing exactly where each competitor is weak and where you can win."}),e.jsxs("div",{className:"ti-input-card",children:[e.jsx("div",{className:"ti-label",children:"Recon Name"}),e.jsx("input",{type:"text",className:"ti-text-input",value:v,onChange:l=>F(l.target.value),placeholder:"e.g., FreshPaws Q2 2026 Competitive Landscape",maxLength:200}),e.jsxs("div",{className:"ti-label",style:{marginTop:16},children:["Your Client's ASIN ",e.jsx("span",{style:{opacity:.4},children:"(optional)"})]}),e.jsx("div",{className:"ti-helper-text",children:"If provided, we'll show exactly where your client stands vs every competitor."}),e.jsx("input",{type:"text",className:"ti-textarea",value:h,onChange:l=>n(l.target.value),placeholder:"e.g., B0ABC12345",maxLength:10,style:{resize:"none"}}),e.jsx("div",{className:"ti-label",style:{marginTop:16},children:"Competitor ASINs"}),e.jsx("textarea",{className:"ti-textarea",value:f,onChange:l=>u(l.target.value),placeholder:"Paste ASINs — one per line or comma-separated",rows:6}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:6},children:[e.jsx("span",{className:"ti-helper-text",children:C.length>0?`${C.length} ASINs entered`:"Min 5, max 50 ASINs"}),C.length>=5&&e.jsxs("span",{className:"ti-counter",children:[R," credits"]})]}),N.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"ti-label",style:{marginTop:16},children:"Assign to Client"}),e.jsxs("select",{value:b||"",onChange:l=>$(l.target.value?Number(l.target.value):null),className:"ti-text-input",children:[e.jsx("option",{value:"",children:"None"}),N.map(l=>e.jsx("option",{value:l.id,children:l.clientName},l.id))]})]}),G&&e.jsx("div",{className:"ti-error",children:G}),e.jsxs("button",{className:"ti-run-btn",onClick:ge,disabled:C.length<5||!v.trim(),children:["Run Recon ",C.length>=5?`→ ${R} credits`:"→"]}),m&&e.jsxs("div",{className:"ti-credit-cost",style:{marginTop:12},children:[m.auditsUsedThisPeriod,"/",m.auditsLimit," audits this period · ",e.jsxs("strong",{children:[m.creditsAvailable," credits available"]})]})]}),q.length>0&&e.jsx(Pe,{label:"Past Audits",children:q.map(l=>e.jsxs("button",{className:"ti-history-card",onClick:()=>z(l.id),children:[e.jsx("div",{className:"ti-h-thumb",children:"🎯"}),e.jsxs("div",{className:"ti-h-info",children:[e.jsx("div",{className:"ti-h-name",children:l.reconName}),e.jsxs("div",{className:"ti-h-meta",children:[l.productsAnalyzed," products · ",l.creditsUsed," cr · ",Ie(l.createdAt)]})]}),e.jsx("div",{className:"ti-h-view",children:"View →"})]},l.id))})]})}const Xe=`
3:root{--card:#111118;--border:#1e1e2a;--bh:#2a2a38;--green:#00FF7F;--gdim:rgba(0,255,127,0.08);--w:#f0f0f5;--g3:#999;--g5:#666;--g7:#444;--red:#ff4d6a;--amber:#ffb84d;--blue:#4da6ff;--purple:#c084fc;--cr:#ff4d6a;--cr-dim:rgba(255,77,106,0.08);--cr-lo:rgba(255,77,106,0.15)}
4.cr-hero{position:relative;display:flex;flex-direction:column;align-items:center;padding:16px 0 8px;margin-bottom:4px;transition:opacity 1s ease}
5.cr-hero.faded{opacity:.2;pointer-events:none}
6.cr-vw{position:relative;width:150px;height:150px;margin-bottom:12px}
7.cr-rng{position:absolute;border-radius:50%;animation:cr-rp 3s ease-in-out infinite}
8@keyframes cr-rp{0%,100%{opacity:.3;transform:scale(1)}50%{opacity:.7;transform:scale(1.03)}}
9.cr-glw{position:absolute;inset:15px;border-radius:50%;animation:cr-gp 2s ease-in-out infinite}
10@keyframes cr-gp{0%,100%{opacity:.3;transform:scale(1)}50%{opacity:.8;transform:scale(1.08)}}
11.cr-fl{animation:cr-fy 4s ease-in-out infinite}
12@keyframes cr-fy{0%,100%{transform:translateY(0)}50%{transform:translateY(-5px)}}
13.cr-pt{position:absolute;width:2px;height:2px;border-radius:50%;opacity:0;animation:cr-pf 3s ease-in-out infinite}
14@keyframes cr-pf{0%{opacity:0;transform:translate(0,0) scale(0)}20%{opacity:.7;transform:translate(var(--dx),var(--dy)) scale(1)}80%{opacity:.5}100%{opacity:0;
14transform:translate(calc(var(--dx)*2),calc(var(--dy)*2)) scale(0)}}
15.cr-pip{display:flex;align-items:center;justify-content:center;gap:0;margin-bottom:4px}
16.cr-pip-s{display:flex;align-items:center;gap:4px;font-size:11px;font-weight:500}
17.cr-pip-d{width:18px;height:18px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:9px;flex-shrink:0;border:2px solid var(--border);color:var(--g7);transition:all .4s}
18.cr-pip-d.done{border-color:var(--cr);background:var(--cr);color:#0a0a0f}
19.cr-pip-d.active{border-color:var(--blue);color:var(--blue);animation:cr-pp 1.5s ease-in-out infinite}
20@keyframes cr-pp{0%,100%{box-shadow:none}50%{box-shadow:0 0 8px rgba(255,77,106,.3)}}
21.cr-pip-l{color:var(--g7);transition:color .3s;font-size:10px}
22.cr-pip-l.done{color:var(--cr)}.cr-pip-l.active{color:var(--blue)}
23.cr-pip-c{flex:1;height:2px;background:var(--border);margin:0 4px;position:relative;overflow:hidden;max-width:40px}
24.cr-pip-cf{position:absolute;left:0;top:0;bottom:0;width:0%;transition:width 1s ease;background:var(--cr)}
25.cr-sts{text-align:center;margin-bottom:4px}
26.cr-sts-m{font-size:13px;font-weight:600;color:var(--w);margin-bottom:2px}
27.cr-sts-s{font-size:12px;color:var(--g5)}
28.cr-mp{height:3px;background:var(--border);border-radius:2px;overflow:hidden;margin-bottom:20px}
29.cr-mpf{height:100%;border-radius:2px;width:0%;transition:width .5s ease;background:linear-gradient(90deg,var(--blue),var(--cr))}
30.cr-sg{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:20px}
31.cr-sc{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:16px 18px;position:relative;overflow:hidden;min-height:115px;transition:border-color .3s}
32.cr-sc.fw{grid-column:1/-1}
33.cr-sc-bar{position:absolute;top:0;left:0;right:0;height:3px;border-radius:3px 3px 0 0;background:var(--border);transition:background .3s}
34.cr-sc.scanning .cr-sc-bar{background:var(--blue);animation:cr-bp 1.5s ease-in-out infinite}
35@keyframes cr-bp{0%,100%{opacity:.4}50%{opacity:1}}
36.cr-sc-hd{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
37.cr-sc-hl{display:flex;align-items:center;gap:8px}
38.cr-sc-icon{font-size:14px}
39.cr-sc-title{font-size:13px;font-weight:600;color:var(--w)}
40.cr-sc-badge{font-size:10px;font-family:'DM Mono',monospace;font-weight:600;padding:2px 8px;border-radius:4px;letter-spacing:.3px}
41.cr-sc-badge.w{background:rgba(255,255,255,.04);color:var(--g7)}
42.cr-sc-badge.an{background:rgba(255,77,106,.1);color:var(--cr);animation:cr-bdp 1.5s ease-in-out infinite}
43@keyframes cr-bdp{0%,100%{opacity:1}50%{opacity:.5}}
44.cr-sml{display:flex;flex-direction:column;gap:6px}
45.cr-sm{height:8px;border-radius:4px;background:linear-gradient(90deg,var(--border) 25%,#1a1a28 50%,var(--border) 75%);background-size:200% 100%;animation:cr-sa 1.5s infinite}
46@keyframes cr-sa{0%{background-position:200% 0}100%{background-position:-200% 0}}
47.cr-sm1{width:85%}.cr-sm2{width:70%}.cr-sm3{width:55%}
48.cr-sc-result{display:none}
49.cr-sc.done .cr-sml{display:none}
50.cr-sc.done .cr-sc-result{display:block}
51.cr-score-row{display:flex;align-items:center;gap:10px;margin-bottom:4px}
52.cr-score-num{font-size:26px;font-weight:800;font-family:'DM Mono',monospace;line-height:1}
53.cr-score-bar{flex:1;height:6px;background:var(--border);border-radius:3px;overflow:hidden}
54.cr-score-fill{height:100%;border-radius:3px;width:0;transition:width .8s ease}
55.cr-verdict{font-size:11px;color:var(--g5);line-height:1.4}
56.cr-sc-g .cr-score-num{color:var(--green)}.cr-sc-g .cr-score-fill{background:var(--green)}.cr-sc-g .cr-sc-bar{background:var(--green)}.cr-sc-g .cr-sc-badge{background:rgba(0,255,127,.1);color:var(--green)}
57.cr-sc-lg .cr-score-num{color:#66ffaa}.cr-sc-lg .cr-score-fill{background:#66ffaa}.cr-sc-lg .cr-sc-bar{background:#66ffaa}.cr-sc-lg .cr-sc-badge{background:rgba(102,255,170,.1);color:#66ffaa}
58.cr-sc-a .cr-score-num{color:var(--amber)}.cr-sc-a .cr-score-fill{background:var(--amber)}.cr-sc-a .cr-sc-bar{background:var(--amber)}.cr-sc-a .cr-sc-badge{background:rgba(255,184,77,.1);color:var(--amber)}
59.cr-sc-r .cr-score-num{color:var(--red)}.cr-sc-r .cr-score-fill{background:var(--red)}.cr-sc-r .cr-sc-bar{background:var(--red)}.cr-sc-r .cr-sc-badge{background:rgba(255,77,106,.1);color:var(--red)}
60.cr-oc{background:var(--card);border:1px solid var(--border);border-radius:14px;padding:28px;text-align:center;opacity:0;transform:translateY(12px);transition:all .8s ease;margin-bottom:16px}
61.cr-oc.show{opacity:1;transform:translateY(0)}
62.cr-oc-label{font-size:10px;color:var(--g5);text-transform:uppercase;letter-spacing:2px;font-family:'DM Mono',monospace;margin-bottom:10px}
63.cr-oc-ring{width:130px;height:130px;margin:0 auto 14px;position:relative}
64.cr-oc-ring svg{width:130px;height:130px;transform:rotate(-90deg)}
65.cr-ring-bg{fill:none;stroke:var(--border);stroke-width:6}
66.cr-ring-fill{fill:none;stroke-width:6;stroke-linecap:round;stroke-dasharray:339.292;stroke-dashoffset:339.292;transition:stroke-dashoffset 1.5s ease}
67.cr-oc-num{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center}
68.cr-oc-val{font-size:40px;font-weight:800;font-family:'DM Mono',monospace;line-height:1}
69.cr-oc-max{font-size:11px;color:var(--g5);font-family:'DM Mono',monospace}
70.cr-oc-grade{font-size:14px;font-family:'DM Mono',monospace;font-weight:700;text-transform:uppercase;letter-spacing:2px;margin-bottom:6px}
71.cr-oc-desc{font-size:12px;color:var(--g5);line-height:1.5;max-width:420px;margin:0 auto 16px}
72.cr-oc-cta{display:inline-flex;align-items:center;gap:6px;padding:12px 28px;background:var(--cr);color:#fff;font-size:14px;font-weight:700;border:none;border-radius:8px;cursor:pointer;font-family:inherit}
73.cr-oc-cta:hover{filter:brightness(1.1)}
74.cr-cn{background:rgba(255,77,106,.04);border:1px solid rgba(255,77,106,.1);border-radius:10px;padding:12px;text-align:center;font-size:13px;font-weight:600;color:var(--cr);margin-bottom:8px}
75.cr-cl{text-align:center;font-size:12px;color:var(--g7);cursor:pointer;text-decoration:underline;border:none;background:none;font-family:inherit;display:block;margin:0 auto}
76@media(max-width:600px){.cr-sg{grid-template-columns:1fr}}
77`,P=[{key:"clusters",icon:"📈",label:"Competitive Clusters",scanMsg:"Identifying clusters...",fw:!1},{key:"vulnerability",icon:"⚠️",label:"Vulnerability Cascade",scanMsg:"Building vulnerability cascade...",fw:!1},{key:"whitespace",icon:"🗳️",label:"White Space",scanMsg:"Mapping white space...",fw:!1},{key:"pricing",icon:"💰",label:"Pricing Landscape",scanMsg:"Charting pricing landscape...",fw:!1},{key:"battleplan",icon:"⚔️",label:"Three-Tier Battle Plan",scanMsg:"Generating battle plan...",fw:!0},{key:"summary",icon:"📊",label:"Recon Summary",scanMsg:"Finalizing recon report...",fw:!0}],ne=[{m:"Grouping competitors by positioning...",s:"Identifying clusters..."},{m:"Analyzing weaknesses across all targets...",s:"Building vulnerability cascade..."},{m:"Locating undefended market positions...",s:"Mapping white space..."},{m:"Analyzing price dynamics...",s:"Charting pricing landscape..."},{m:"Creating 3-tier strategic action plan...",s:"Generating battle plan..."},{m:"Compiling intelligence summary...",s:"Finalizing recon report..."}];function Ze(t){return t>=80?"cr-sc-g":t>=60?"cr-sc-lg":t>=40?"cr-sc-a":"cr-sc-r"}function Ke(){return e.jsxs("svg",{className:"cr-fl",viewBox:"0 0 150 150",width:"150",height:"150",fill:"none",children:[e.jsx("circle",{cx:"50",cy:"75",r:"30",stroke:"rgba(255,77,106,.2)",strokeWidth:"1",fill:"none",children:e.jsx("animate",{attributeName:"r",values:"28;32;28",dur:"2.5s",repeatCount:"indefinite"})}),e.jsx("circle",{cx:"100",cy:"75",r:"30",stroke:"rgba(255,77,106,.2)",strokeWidth:"1",fill:"none",children:e.jsx("animate",{attributeName:"r",values:"28;32;28",dur:"2.5s",repeatCount:"indefinite",begin:".3s"})}),e.jsx("circle",{cx:"50",cy:"75",r:"18",stroke:"rgba(255,77,106,.12)",strokeWidth:".5",fill:"none",strokeDasharray:"4 4",children:e.jsx("animate",{attributeName:"stroke-dashoffset",values:"0;8",dur:"2s",repeatCount:"indefinite"})}),e.jsx("circle",{cx:"100",cy:"75",r:"18",stroke:"rgba(255,77,106,.12)",strokeWidth:".5",fill:"none",strokeDasharray:"4 4",children:e.jsx("animate",{attributeName:"stroke-dashoffset",values:"0;-8",dur:"2s",repeatCount:"indefinite"})}),e.jsx("circle",{cx:"50",cy:"75",r:"6",fill:"rgba(255,77,106,.1)",stroke:"#ff4d6a",strokeWidth:"1",children:e.jsx("animate",{attributeName:"r",values:"5;8;5",dur:"3s",repeatCount:"indefinite"})}),e.jsx("circle",{cx:"100",cy:"75",r:"6",fill:"rgba(255,77,106,.1)",stroke:"#ff4d6a",strokeWidth:"1",children:e.jsx("animate",{attributeName:"r",values:"5;8;
775",dur:"3s",repeatCount:"indefinite",begin:".5s"})}),e.jsx("line",{x1:"50",y1:"45",x2:"50",y2:"105",stroke:"rgba(255,77,106,.08)",strokeWidth:".5"}),e.jsx("line",{x1:"20",y1:"75",x2:"80",y2:"75",stroke:"rgba(255,77,106,.08)",strokeWidth:".5"}),e.jsx("line",{x1:"100",y1:"45",x2:"100",y2:"105",stroke:"rgba(255,77,106,.08)",strokeWidth:".5"}),e.jsx("line",{x1:"70",y1:"75",x2:"130",y2:"75",stroke:"rgba(255,77,106,.08)",strokeWidth:".5"}),e.jsx("rect",{x:"68",y:"68",width:"14",height:"14",rx:"3",stroke:"rgba(255,77,106,.15)",strokeWidth:".5",fill:"none"}),e.jsxs("g",{children:[e.jsx("animateTransform",{attributeName:"transform",type:"rotate",values:"0 50 75;360 50 75",dur:"4s",repeatCount:"indefinite"}),e.jsx("path",{d:"M50 57 A18 18 0 0 1 68 75",stroke:"#ff4d6a",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",opacity:".5"})]}),e.jsxs("g",{children:[e.jsx("animateTransform",{attributeName:"transform",type:"rotate",values:"360 100 75;0 100 75",dur:"4s",repeatCount:"indefinite"}),e.jsx("path",{d:"M100 57 A18 18 0 0 1 118 75",stroke:"#ff4d6a",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",opacity:".5"})]})]})}function Je({phase:t,asinCount:s,onCancel:i}){const[o,a]=c.useState(()=>P.map(()=>"waiting")),[p,r]=c.useState(()=>P.map(()=>null)),[d,m]=c.useState(()=>P.map(()=>null)),[j,N]=c.useState(0),[x,v]=c.useState(`Scanning ${s} competitors across 6 recon dimensions...`),[F,h]=c.useState("Grouping competitors by positioning..."),[n,f]=c.useState(0),[u,b]=c.useState(!1),[$,_]=c.useState(!1),[M,G]=c.useState(!1),[w,g]=c.useState(!1),[y,I]=c.useState(!1),[W,q]=c.useState(339.292),[A]=c.useState(()=>Math.floor(Math.random()*4)+3),H=c.useRef(!1);c.useEffect(()=>{f(1),b(!0)},[]),c.useEffect(()=>{if(H.current)return;H.current=!0;const D=P.map(()=>Math.floor(Math.random()*40)+50),L=["Multiple competitive clusters identified","Cascading weaknesses found across competitors","Undefended market positions detected","Pricing gaps and opportunities mapped","3-tier attack strategy generated","Full competitive intelligence compiled"];let T=0;const B=1200;function V(){if(T>=P.length){f(3),v("Competitive recon scan complete"),h(`${P.length} of ${P.length} sections analyzed`),N(100),I(!0),setTimeout(()=>{g(!0),setTimeout(()=>{const R=2*Math.PI*54,z=A/s*100;q(R-R*Math.min(z,100)/100)},200)},600);return}const S=T;a(R=>{const z=[...R];return z[S]="scanning",z}),v(ne[S].m),h(ne[S].s),N(Math.round((S+.5)/P.length*100)),S===2&&(f(2),_(!0)),S===4&&(f(3),G(!0));const C=2e3+Math.random()*1500;setTimeout(()=>{a(R=>{const z=[...R];return z[S]="done",z}),r(R=>{const z=[...R];return z[S]=D[S],z}),m(R=>{const z=[...R];return z[S]=L[S],z}),N(Math.round((S+1)/P.length*100)),T++,setTimeout(V,300)},C)}setTimeout(V,B)},[s,A]);const X=A>=5?"ATTACK READY":A>=3?"OPPORTUNITY":"HOLD POSITION",Y=A>=5?"#ff4d6a":A>=3?"#ffb84d":"#666";return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:Xe}}),e.jsxs("div",{style:{maxWidth:780,margin:"0 auto",padding:"28px 24px 60px"},children:[e.jsx("h1",{style:{fontSize:24,fontWeight:700,letterSpacing:"-.3px",marginBottom:4,color:"#f0f0f5"},children:"Competitive Recon"}),e.jsx("div",{style:{fontSize:14,color:"#999",marginBottom:24},children:"Intelligence scan in progress..."}),e.jsxs("div",{style:{background:"#111118",border:"1px solid #1e1e2a",borderRadius:12,padding:"14px 18px",marginBottom:20,display:"flex",alignItems:"center",gap:14},children:[e.jsx("div",{style:{width:48,height:48,borderRadius:10,display:"flex",alignItems:"center",justifyContent:"center",fontSize:22,background:"rgba(255,77,106,.08)",border:"1px solid rgba(255,77,106,.15)",flexShrink:0},children:"🎯"}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsxs("div",{style:{fontSize:14,fontWeight:600,color:"#f0f0f5"},children:[s," Competitors Under Surveillance"]}),e.jsx("div",{style:{fontSize:11,color:"#666",fontFamily:"'DM Mono', monospace",marginTop:2},children:"Competitive Intelligence Scan"})]}),e.jsx("div",{style:{padding:"6px 14px",borderRadius:8,fontSize:12,fontWeight:600,fontFamily:"'DM Mono', monospace",background:"rgba(255,77,106,.12)",color:"#ff4d6a",border:"1px solid rgba(255,77,106,.2)",flexShrink:0},children:"🔭 Recon Scan"})]}),e.jsxs("div",{className:`cr-hero${y?" faded":""}`,children:[e.jsxs("div",{className:"cr-vw",children:[e.jsx("div",{className:"cr-rng",style:{inset:-14,border:"1px solid rgba(255,77,106,.12)"}}),e.jsx("div",{className:"cr-rng",style:{inset:-30,border:"1px solid rgba(255,77,106,.06)",animationDelay:".5s"}}
77),e.jsx("div",{className:"cr-glw",style:{background:"radial-gradient(circle,rgba(255,77,106,.15) 0%,transparent 70%)"}}),e.jsx("div",{className:"cr-pt",style:{top:"20%",left:"8%","--dx":"12px","--dy":"-16px",background:"#ff4d6a"}}),e.jsx("div",{className:"cr-pt",style:{top:"65%",left:"88%","--dx":"-10px","--dy":"12px",background:"#ff4d6a",animationDelay:".5s"}}),e.jsx("div",{className:"cr-pt",style:{top:"40%",left:"92%","--dx":"-16px","--dy":"-6px",background:"#ff4d6a",animationDelay:"1s"}}),e.jsx("div",{className:"cr-pt",style:{top:"78%",left:"15%","--dx":"14px","--dy":"8px",background:"#ff4d6a",animationDelay:"1.5s"}}),e.jsx(Ke,{})]}),e.jsxs("div",{className:"cr-pip",children:[e.jsxs("div",{className:"cr-pip-s",children:[e.jsx("div",{className:`cr-pip-d${n>=1?" done":""}`,children:n>=1?"✓":"○"}),e.jsx("span",{className:`cr-pip-l${n>=1?" done":""}`,children:"Collect"})]}),e.jsx("div",{className:"cr-pip-c",children:e.jsx("div",{className:"cr-pip-cf",style:{width:u?"100%":"0%"}})}),e.jsxs("div",{className:"cr-pip-s",children:[e.jsx("div",{className:`cr-pip-d${n>=2?" done":n>=1?" active":""}`,children:n>=2?"✓":"○"}),e.jsx("span",{className:`cr-pip-l${n>=2?" done":n>=1?" active":""}`,children:"Analyze"})]}),e.jsx("div",{className:"cr-pip-c",children:e.jsx("div",{className:"cr-pip-cf",style:{width:$?"100%":"0%"}})}),e.jsxs("div",{className:"cr-pip-s",children:[e.jsx("div",{className:`cr-pip-d${n>=3?" done":n>=2?" active":""}`,children:n>=3?"✓":"○"}),e.jsx("span",{className:`cr-pip-l${n>=3?" done":n>=2?" active":""}`,children:"Map"})]}),e.jsx("div",{className:"cr-pip-c",children:e.jsx("div",{className:"cr-pip-cf",style:{width:M?"100%":"0%"}})}),e.jsxs("div",{className:"cr-pip-s",children:[e.jsx("div",{className:`cr-pip-d${w?" done":n>=3?" active":""}`,children:w?"✓":"○"}),e.jsx("span",{className:`cr-pip-l${w?" done":n>=3?" active":""}`,children:"Strategy"})]})]}),e.jsxs("div",{className:"cr-sts",children:[e.jsx("div",{className:"cr-sts-m",children:x}),e.jsx("div",{className:"cr-sts-s",children:F})]})]}),e.jsx("div",{className:"cr-mp",children:e.jsx("div",{className:"cr-mpf",style:{width:`${j}%`}})}),e.jsx("div",{className:"cr-sg",children:P.map((D,L)=>{const T=o[L],B=p[L],V=d[L],S=B!==null?Ze(B):"";return e.jsxs("div",{className:`cr-sc${D.fw?" fw":""}${T==="scanning"?" scanning":""}${T==="done"?` done ${S}`:""}`,children:[e.jsx("div",{className:"cr-sc-bar"}),e.jsxs("div",{className:"cr-sc-hd",children:[e.jsxs("div",{className:"cr-sc-hl",children:[e.jsx("span",{className:"cr-sc-icon",children:D.icon}),e.jsx("span",{className:"cr-sc-title",children:D.label})]}),e.jsx("span",{className:`cr-sc-badge${T==="waiting"?" w":T==="scanning"?" an":""}`,children:T==="waiting"?"Waiting":T==="scanning"?"Scanning":`${B}/100`})]}),e.jsxs("div",{className:"cr-sml",children:[e.jsx("div",{className:"cr-sm cr-sm1"}),e.jsx("div",{className:"cr-sm cr-sm2"}),e.jsx("div",{className:"cr-sm cr-sm3"})]}),e.jsxs("div",{className:"cr-sc-result",children:[e.jsxs("div",{className:"cr-score-row",children:[e.jsx("span",{className:"cr-score-num",children:B}),e.jsx("div",{className:"cr-score-bar",children:e.jsx("div",{className:"cr-score-fill",style:{width:T==="done"&&B!==null?`${B}%`:"0%"}})})]}),e.jsx("div",{className:"cr-verdict",children:V})]})]},D.key)})}),e.jsxs("div",{className:`cr-oc${w?" show":""}`,children:[e.jsx("div",{className:"cr-oc-label",children:"Competitive Landscape"}),e.jsxs("div",{className:"cr-oc-ring",children:[e.jsxs("svg",{viewBox:"0 0 130 130",children:[e.jsx("circle",{className:"cr-ring-bg",cx:"65",cy:"65",r:"54"}),e.jsx("circle",{className:"cr-ring-fill",cx:"65",cy:"65",r:"54",stroke:Y,style:{strokeDashoffset:W}})]}),e.jsxs("div",{className:"cr-oc-num",children:[e.jsx("div",{className:"cr-oc-val",style:{color:Y},children:A}),e.jsx("div",{className:"cr-oc-max",children:"in Strike Zone"})]})]}),e.jsx("div",{className:"cr-oc-grade",style:{color:Y},children:X}),e.jsx("div",{className:"cr-oc-desc",children:"Finalizing your full competitive intelligence report with strategic battle plan..."})]}),!w&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"cr-cn",children:["⚡ Competitive Recon uses ",s<=15?10:s<=30?15:25," credits"]}),e.jsx("button",{className:"cr-cl",onClick:i,children:"Cancel Scan"})]})]})]})}const ae=[{label:"Market Overview",icon:le}
77,{label:"Clusters",icon:Ne},{label:"White Space",icon:Le},{label:"Vulnerabilities",icon:we},{label:"Client Position",icon:de},{label:"Battle Plan",icon:ce}];function Qe({report:t,activeTab:s,setActiveTab:i,onReset:o,navigate:a,user:p,analystData:r,setAnalystData:d}){const m=p?.tier||"free",j=p?.isAdmin,[N,x]=c.useState(!1),v=!!t.clientPosition,F=v?ae:ae.filter((f,u)=>u!==4),h=t.battlePlan?.executive_summary,n=()=>{switch(F[s]?.label){case"Market Overview":return e.jsx(st,{report:t});case"Clusters":return e.jsx(rt,{report:t});case"White Space":return e.jsx(it,{report:t});case"Vulnerabilities":return e.jsx(nt,{report:t,navigate:a});case"Client Position":return e.jsx(at,{report:t});case"Battle Plan":return e.jsx(ot,{report:t,navigate:a});default:return null}};return e.jsxs("div",{className:"max-w-7xl mx-auto p-4 md:p-8 space-y-6",children:[t&&e.jsx(pe,{open:N,onClose:()=>x(!1),reconId:t.id,reconName:t.reconName,clientAsin:t.clientAsin,workspaceId:t.workspaceId,hasClientPosition:v}),e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{style:{fontSize:22,fontWeight:700,color:"#f0f0f5",letterSpacing:"-0.5px"},children:t.reconName}),e.jsxs("p",{style:{fontSize:13,color:"#999",marginTop:4,fontFamily:"'DM Mono', monospace"},children:[t.productsAnalyzed," products analyzed · ",t.creditsUsed," credits · ",new Date(t.createdAt).toLocaleDateString(),t.clientAsin&&e.jsxs("span",{children:[" · Client: ",e.jsx("span",{style:{fontFamily:"'DM Mono', monospace",color:"#00FF7F"},children:t.clientAsin})]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[t?.id!=null&&e.jsx(Fe,{scanType:"recon",scanId:t.id,productName:t.reconName,tweetData:{text:`ClearSell analyzed ${t.productProfiles?.length||0} competitors in "${t.reconName}".
78
79Run your own recon free:`}}),m==="agency"||j?e.jsxs("button",{onClick:()=>x(!0),className:"flex items-center gap-1.5",style:{padding:"8px 16px",fontSize:14,border:"1px solid rgba(167,139,250,0.2)",borderRadius:8,color:"#a78bfa",cursor:"pointer",transition:"all 0.15s",background:"transparent"},children:[e.jsx(K,{className:"w-3.5 h-3.5"})," Export PDF"]}):e.jsxs("button",{disabled:!0,className:"flex items-center gap-1.5",style:{padding:"8px 16px",fontSize:14,border:"1px solid rgba(255,255,255,0.1)",borderRadius:8,color:"rgba(102,102,102,0.5)",cursor:"not-allowed",background:"transparent"},title:"White-label PDF export requires Agency tier",children:[e.jsx(K,{className:"w-3.5 h-3.5"})," Export PDF ",e.jsx("span",{style:{fontSize:10,marginLeft:4,opacity:.6},children:"Agency"})]}),e.jsx("button",{onClick:o,style:{padding:"8px 16px",fontSize:14,border:"1px solid rgba(255,255,255,0.1)",borderRadius:8,color:"#666",cursor:"pointer",transition:"all 0.15s",background:"transparent"},children:"Run Another Audit"}),t?.id!=null&&e.jsx(Te,{sourceType:"competitive_recon",sourceId:t.id,buttonText:"What's my strategy here?",onResponse:d})]})]}),r&&t?.id!=null&&e.jsx(Re,{data:r,sourceType:"competitive_recon",sourceId:t.id,onClose:()=>d(null),onUpdate:d}),h&&e.jsxs("div",{style:{background:"linear-gradient(90deg, rgba(0,255,127,0.06), rgba(0,255,127,0.02))",border:"1px solid rgba(0,255,127,0.15)",borderRadius:14,padding:24},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12},children:[e.jsx(ce,{style:{width:18,height:18,color:"#00FF7F"}}),e.jsx("h3",{style:{fontSize:11,fontWeight:600,color:"#00FF7F",textTransform:"uppercase",letterSpacing:1,fontFamily:"'DM Mono', monospace"},children:"Executive Summary"})]}),e.jsx("p",{style:{color:"rgba(240,240,245,0.9)",lineHeight:1.7,fontSize:14},children:h})]}),e.jsx("div",{style:{display:"flex",gap:0,overflowX:"auto",borderBottom:"1px solid #1e1e2a"},children:F.map((f,u)=>{const b=f.icon;return e.jsxs("button",{onClick:()=>i(u),style:{display:"flex",alignItems:"center",gap:8,padding:"10px 16px",fontSize:13,fontWeight:500,whiteSpace:"nowrap",cursor:"pointer",transition:"all 0.15s",background:"transparent",border:"none",borderBottom:`2px solid ${s===u?"#00FF7F":"transparent"}`,color:s===u?"#00FF7F":"#666",fontFamily:"inherit"},children:[e.jsx(b,{className:"w-4 h-4"}),f.label]},f.label)})}),e.jsx("div",{children:n()}),e.jsx(Ae,{tool:"competitive-recon",analysisId:t?.id,dynamicCount:t?.productsAnalyzed}),e.jsx("div",{style:{textAlign:"center",marginTop:14,fontSize:10,fontFamily:"'DM Mono', monospace",color:"#444",letterSpacing:"0.5px"},children:"Analysis by Claude · Anthropic"})]})}function et({severity:t}
79){const s={critical:{bg:"rgba(255,77,106,0.2)",color:"#ff4d6a",border:"rgba(255,77,106,0.3)"},high:{bg:"rgba(255,184,77,0.2)",color:"#ffb84d",border:"rgba(255,184,77,0.3)"},medium:{bg:"rgba(255,184,77,0.2)",color:"#ffb84d",border:"rgba(255,184,77,0.3)"},low:{bg:"rgba(77,166,255,0.2)",color:"#4da6ff",border:"rgba(77,166,255,0.3)"}},i=s[t]||s.medium;return e.jsx("span",{style:{display:"inline-flex",padding:"2px 8px",borderRadius:9999,fontSize:10,fontWeight:600,textTransform:"uppercase",background:i.bg,color:i.color,border:`1px solid ${i.border}`},children:t})}function tt({size:t}){const s={massive:{bg:"rgba(0,255,127,0.2)",color:"#00FF7F",border:"rgba(0,255,127,0.3)"},significant:{bg:"rgba(77,166,255,0.2)",color:"#4da6ff",border:"rgba(77,166,255,0.3)"},moderate:{bg:"rgba(255,184,77,0.2)",color:"#ffb84d",border:"rgba(255,184,77,0.3)"},niche:{bg:"rgba(102,102,102,0.2)",color:"#999",border:"rgba(102,102,102,0.3)"}},i=s[t]||s.moderate;return e.jsx("span",{style:{display:"inline-flex",padding:"2px 8px",borderRadius:9999,fontSize:10,fontWeight:600,textTransform:"uppercase",background:i.bg,color:i.color,border:`1px solid ${i.border}`},children:t})}function st({report:t}){const s=t.marketFrustrationMatrix||[],i=t.productProfiles||[],o=i.map(r=>({asin:r.asin,title:r.title||r.product_name||r.asin,brand:r.brand||"",price:r.price||"N/A",rating:r.rating||0,review_count:r.review_count||r.reviewCount||0,product_image:r.image||r.product_image,frustration_count:r.frustration_count||(r.frustrations?.length??s.filter(d=>(d.affected_products||[]).some(m=>m.asin===r.asin)).length),critical_count:r.critical_count||s.filter(d=>d.severity==="critical"&&(d.affected_products||[]).some(m=>m.asin===r.asin)).length,isClient:r.asin===t.clientAsin})),a=s.length>0&&i.length>0?{frustrations:s.map(r=>r.frustration),competitors:i.map(r=>{const d={};return s.forEach(m=>{const j=(m.affected_products||[]).some(x=>x.asin===r.asin);if((m.solved_by||[]).some(x=>x.asin===r.asin))d[m.frustration]="solved";else if(j){const x={critical:9,high:7.5,medium:6,moderate:6,low:3};d[m.frustration]=x[m.severity?.toLowerCase?.()]||5}else d[m.frustration]=null}),{name:r.title?.split(" ").slice(0,3).join(" ")||r.brand||r.asin,asin:r.asin,product_image:r.image||r.product_image,isClient:r.asin===t.clientAsin,scores:d}})}:null,p=s.map(r=>{const d={critical:9,high:7.5,medium:6,moderate:6,low:3};return{name:r.frustration,severity:d[r.severity?.toLowerCase?.()]||5,mentions:r.frequency||1,competitors_addressing:(r.solved_by||[]).length,total_competitors:i.length}});return e.jsxs("div",{className:"space-y-6",children:[o.length>0&&e.jsx(qe,{competitors:o,categoryName:t.reconName}),a&&e.jsx(De,{data:a}),p.length>0&&e.jsx($e,{patterns:p}),e.jsxs("div",{children:[e.jsx("h3",{style:{fontSize:16,fontWeight:600,color:"#f0f0f5",marginBottom:16},children:"Frustration Matrix"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full",style:{fontSize:14},children:[e.jsx("thead",{children:e.jsxs("tr",{style:{borderBottom:"1px solid #1e1e2a"},children:[e.jsx("th",{style:{textAlign:"left",padding:"10px 12px",fontSize:10,color:"#666",fontWeight:500,fontFamily:"'DM Mono', monospace",textTransform:"uppercase",letterSpacing:1,position:"sticky",left:0,background:"#0a0a0f",zIndex:10,minWidth:200},children:"Frustration"}),e.jsx("th",{style:{textAlign:"center",padding:"10px 8px",fontSize:10,color:"#666",fontWeight:500,fontFamily:"'DM Mono', monospace",textTransform:"uppercase",letterSpacing:1,minWidth:60},children:"Severity"}),e.jsx("th",{style:{textAlign:"center",padding:"10px 8px",fontSize:10,color:"#666",fontWeight:500,fontFamily:"'DM Mono', monospace",textTransform:"uppercase",letterSpacing:1,minWidth:80},children:"Frequency"}),i.slice(0,20).map(r=>e.jsx("th",{className:"text-center",style:{padding:"12px 4px",minWidth:40},title:r.title,children:e.jsx("span",{className:"block truncate",style:{fontSize:10,color:"rgba(102,102,102,0.6)",maxWidth:40},children:r.asin.slice(-4)})},r.asin))]})}),e.jsx("tbody",{children:s.map((r,d)=>{const j=(r.percentage||0)>=70,N=r.solved_by||[];return e.jsxs("tr",{style:{borderBottom:"1px solid rgba(255,255,255,0.05)"},onMouseEnter:x=>x.currentTarget.style.background="rgba(255,255,255,0.03)",onMouseLeave:x=>x.currentTarget.style.background="transparent",children:[e.jsx("td",{className:"sticky left-0 z-10",style:{padding:"10px 12px",background:"#0a0a0f"},children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{style:{color:"#f0f0f5",fontSize:14},children:r.frustration}),j&&e.jsx("span",{style:{padding:"2px 6px",background:"rgba(255,77,106,0.2)",color:"#ff4d6a",border:"1px solid rgba(255,77,106,0.3)",borderRadius:4,fontSize:9,fontWeight:700,textTransform:"uppercase"},children:"Market-Wide"}),N.length>0&&e.jsx("span",{style:{padding:"2px 6px",background:"rgba(0,255,127,0.2)",color:"#00FF7F",border:"1px solid rgba(0,255,127,0.3)",borderRadius:4,fontSize:9,fontWeight:700,textTransform:"uppercase"},children:"Solved"})]})}),e.jsx("td",{className:"text-center",style:{padding:"10px 8px"},children:e.jsx(et,{severity:r.severity})}),e.jsxs("td",{className:"text-center",style:{padding:"10px 8px",color:"#666"},children:[r.frequency,"/",r.total_products]}),i.slice(0,20).map(x=>{const v=(r.affected_products||[]).some(h=>h.asin===x.asin),F=N.some(h=>h.asin===x.asin);return e.jsx("td",{className:"text-center",style:{padding:"10px 4px"},children:F?e.jsx("div",{className:"mx-auto flex items-center justify-center",style:{width:16,height:16,borderRadius:4,background:"rgba(0,255,127,0.2)"},children:e.jsx(ee,{className:"w-3 h-3",style:{color:"#00FF7F"}})}):v?e.jsx("div",{className:"mx-auto",style:{width:16,height:16,borderRadius:4,background:"rgba(255,77,106,0.3)"}}):e.jsx("div",{className:"mx-auto",style:{width:16,height:16,borderRadius:4,background:"rgba(255,255,255,0.05)"}})},x.asin)})]},d)})})]})}),e.jsxs("div",{className:"flex items-center gap-4",style:{marginTop:12,fontSize:12,color:"#666"},children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{style:{width:12,height:12,borderRadius:4,background:"rgba(255,77,106,0.3)"}})," Has frustration"]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"flex items-center justify-center",style:{width:12,height:12,borderRadius:4,background:"rgba(0,255,127,0.2)"},children:e.jsx(ee,{style:{width:8,height:8,color:"#00FF7F"}})}
79)," Solved it"]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{style:{width:12,height:12,borderRadius:4,background:"rgba(255,255,255,0.05)"}})," Not affected"]})]})]}),i.length>0&&e.jsxs("div",{style:{background:"#111118",border:"1px solid #1e1e2a",borderRadius:14,padding:20},children:[e.jsx("h3",{style:{fontSize:16,fontWeight:600,color:"#f0f0f5",marginBottom:16},children:"Market Snapshot"}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-4",children:[e.jsxs("div",{style:{background:"rgba(255,255,255,0.02)",borderRadius:10,padding:16,textAlign:"center"},children:[e.jsx("p",{style:{fontSize:10,color:"#666",textTransform:"uppercase",letterSpacing:1,fontFamily:"'DM Mono', monospace"},children:"Avg Rating"}),e.jsx("p",{style:{fontSize:24,fontWeight:700,color:"#f0f0f5",marginTop:4},children:(i.reduce((r,d)=>r+(d.rating||0),0)/i.length).toFixed(1)})]}),e.jsxs("div",{style:{background:"rgba(255,255,255,0.02)",borderRadius:10,padding:16,textAlign:"center"},children:[e.jsx("p",{style:{fontSize:10,color:"#666",textTransform:"uppercase",letterSpacing:1,fontFamily:"'DM Mono', monospace"},children:"Products"}),e.jsx("p",{style:{fontSize:24,fontWeight:700,color:"#f0f0f5",marginTop:4},children:i.length})]}),e.jsxs("div",{style:{background:"rgba(255,255,255,0.02)",borderRadius:10,padding:16,textAlign:"center"},children:[e.jsx("p",{style:{fontSize:10,color:"#666",textTransform:"uppercase",letterSpacing:1,fontFamily:"'DM Mono', monospace"},children:"Price Range"}),e.jsx("p",{style:{fontSize:18,fontWeight:700,color:"#f0f0f5",marginTop:4},children:(()=>{const r=i.map(d=>parseFloat((d.price||"0").replace(/[^0-9.]/g,""))).filter(d=>d>0);return r.length===0?"N/A":`$${Math.min(...r).toFixed(0)} — $${Math.max(...r).toFixed(0)}`})()})]}),e.jsxs("div",{style:{background:"rgba(255,255,255,0.02)",borderRadius:10,padding:16,textAlign:"center"},children:[e.jsx("p",{style:{fontSize:10,color:"#666",textTransform:"uppercase",letterSpacing:1,fontFamily:"'DM Mono', monospace"},children:"Rating Spread"}),e.jsx("div",{className:"flex items-end justify-center gap-1",style:{marginTop:8,height:32},children:[1,2,3,4,5].map(r=>{const d=i.filter(j=>Math.round(j.rating||0)===r).length,m=i.length>0?d/i.length*100:0;return e.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[e.jsx("div",{style:{width:16,background:"rgba(0,255,127,0.3)",borderRadius:"4px 4px 0 0",height:`${Math.max(m*.3,2)}px`}}),e.jsxs("span",{style:{fontSize:9,color:"#666"},children:[r,"★"]})]},r)})})]})]})]})]})}function rt({report:t}){const s=t.competitiveClusters||[];return e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{style:{fontSize:16,fontWeight:600,color:"#f0f0f5"},children:"Competitive Clusters"}),e.jsx("p",{style:{fontSize:13,color:"#999"},children:"Groups of competitors that share the same weakness profiles."}),e.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:s.map((i,o)=>e.jsxs("div",{className:"space-y-3",style:{background:"#111118",border:"1px solid #1e1e2a",borderRadius:14,padding:20},children:[e.jsxs("div",{children:[e.jsx("h4",{style:{fontSize:16,fontWeight:600,color:"#f0f0f5"},children:i.name}),e.jsx("p",{style:{fontSize:14,color:"#666",marginTop:4},children:i.description})]}),e.jsxs("div",{children:[e.jsxs("p",{style:{fontSize:12,color:"#666",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:8},children:["Products (",(i.products||[]).length,")"]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:(i.products||[]).map((a,p)=>e.jsx("span",{style:{padding:"4px 8px",background:"rgba(255,255,255,0.05)",borderRadius:4,fontSize:12,color:"rgba(255,255,255,0.8)",fontFamily:"'DM Mono', monospace"},children:a.product_name?.slice(0,30)||a.asin},p))})]}),e.jsxs("div",{children:[e.jsx("p",{style:{fontSize:12,color:"#666",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:6},children:"Shared Weaknesses"}),e.jsx("ul",{className:"space-y-1",children:(i.shared_weaknesses||[]).map((a,p)=>e.jsxs("li",{className:"flex items-start gap-1.5",style:{fontSize:14,color:"rgba(255,77,106,0.8)"},children:[e.jsx("span",{style:{color:"#ff4d6a",marginTop:4},children:"·"}),a]},p))})]}),e.jsxs("div",{style:{paddingTop:8,borderTop:"1px solid rgba(255,255,255,0.05)"},children:[e.jsx("p",{style:{fontSize:12,color:"#666",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:4},children:"How to Beat"}),e.jsx("p",{style:{fontSize:14,color:"rgba(0,255,127,0.8)"},children:i.how_to_beat})]})]},o))})]})}function it({report:t}){const s=t.whiteSpaceAnalysis||[],i=["massive","significant","moderate","niche"],o=[...s].sort((a,p)=>i.indexOf(a.opportunity_size)-i.indexOf(p.opportunity_size));return e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{style:{fontSize:16,fontWeight:600,color:"#f0f0f5"},children:"White Space Opportunities"}),e.jsx("p",{style:{fontSize:13,color:"#999"},children:"Positioning no competitor currently occupies."}),e.jsx("div",{className:"space-y-4",children:o.map((a,p)=>e.jsxs("div",{className:"space-y-3",style:{background:"#111118",border:"1px solid #1e1e2a",borderRadius:14,padding:20},children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx("h4",{className:"flex-1",style:{fontSize:16,fontWeight:600,color:"#f0f0f5"},children:a.opportunity}),e.jsx(tt,{size:a.opportunity_size})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("p",{style:{fontSize:12,color:"#666",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:4},children:"Why Vacant"}),e.jsx("p",{style:{fontSize:14,color:"rgba(255,255,255,0.7)"},children:a.why_vacant})]}),e.jsxs("div",{children:[e.jsx("p",{style:{fontSize:12,color:"#666",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:4},children:"Target Product"}),e.jsx("p",{style:{fontSize:14,color:"rgba(255,255,255,0.7)"},children:a.target_product})]})]}),e.jsxs("div",{style:{paddingTop:8,borderTop:"1px solid rgba(255,255,255,0.05)"},children:[e.jsx("p",{style:{fontSize:12,color:"#666",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:4},children:"Target Messaging"}),e.jsxs("p",{style:{fontSize:14,color:"rgba(0,255,127,0.8)",fontStyle:"italic"},children:['"',a.target_messaging,'"']})]})]},p))})]})}function nt({report:t,navigate:s}){const i=t.vulnerabilityCascade||[],o=t.productProfiles||[];return e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{style:{fontSize:16,fontWeight:600,color:"#f0f0f5"},children:"Vulnerability Cascade"}),e.jsx("p",{style:{fontSize:13,color:"#999"},children:"All products ranked from most to least vulnerable."}),e.jsx("div",{className:"space-y-3",children:i.map((a,p)=>{const r=o.find(m=>m.asin===a.asin),d=p<3;return e.jsx("div",{style:{background:"#111118",border:`1px solid ${d?"rgba(255,77,106,0.25)":"#1e1e2a"}`,borderRadius:14,padding:16},children:e.jsxs("div",{className:"flex items-start gap-4",children:[r?.image&&e.jsx("img",{src:r.image,alt:"",className:"flex-shrink-0",style:{width:56,height:56,objectFit:"cover",borderRadius:8,background:"rgba(255,255,255,0.05)"},loading:"lazy",width:56,height:56}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("span",{style:{fontSize:14,fontWeight:600,color:"#f0f0f5"},children:["#",p+1]}),e.jsx("span",{className:"truncate",style:{fontSize:14,color:"#f0f0f5"},children:a.product_name}),d&&e.jsx("span",{style:{padding:"2px 6px",background:"rgba(255,77,106,0.2)",color:"#ff4d6a",border:"1px solid rgba(255,77,106,0.3)",borderRadius:4,fontSize:9,fontWeight:700,textTransform:"uppercase"},children:"Strike Zone"})]}),e.jsxs("div",{className:"flex items-center gap-3",style:{marginTop:4,fontSize:12,color:"#666"},children:[e.jsx("span",{style:{fontFamily:"'DM Mono', monospace"},children:a.asin}),e.jsxs("span",{children:["★ ",a.rating]}
79),e.jsxs("span",{children:[a.review_count?.toLocaleString()," reviews"]}),e.jsx("span",{style:{color:"rgba(102,102,102,0.6)"},children:a.ease_of_displacement})]}),e.jsxs("div",{className:"flex items-center gap-2",style:{marginTop:8},children:[e.jsx("div",{className:"flex-1 overflow-hidden",style:{height:8,background:"rgba(255,255,255,0.05)",borderRadius:9999,maxWidth:200},children:e.jsx("div",{style:{height:"100%",borderRadius:9999,width:`${a.vulnerability_rating/10*100}%`,background:a.vulnerability_rating>=7?"#ff4d6a":a.vulnerability_rating>=4?"#ffb84d":"#00FF7F"}})}),e.jsxs("span",{style:{fontSize:12,fontWeight:600,color:"#f0f0f5"},children:[a.vulnerability_rating,"/10"]})]}),e.jsx("p",{style:{fontSize:12,color:"#666",marginTop:6},children:a.primary_vulnerability}),a.fatal_weakness&&e.jsxs("p",{style:{fontSize:12,color:"rgba(255,77,106,0.7)",marginTop:4},children:[e.jsx("span",{style:{fontWeight:600},children:"Fatal weakness:"})," ",a.fatal_weakness]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5 flex-shrink-0",children:[e.jsxs("button",{onClick:()=>s(`/dashboard/frustration-finder?asin=${a.asin}`),className:"flex items-center gap-1",style:{padding:"6px 10px",fontSize:11,fontWeight:500,background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:8,color:"#f0f0f5",cursor:"pointer",transition:"all 0.15s"},children:["Deep Scan ",e.jsx(J,{className:"w-3 h-3"})]}),e.jsxs("button",{onClick:()=>s(`/dashboard/rufus-grader?asin=${a.asin}`),className:"flex items-center gap-1",style:{padding:"6px 10px",fontSize:11,fontWeight:500,background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:8,color:"#f0f0f5",cursor:"pointer",transition:"all 0.15s"},children:["Rufus Grade ",e.jsx(J,{className:"w-3 h-3"})]})]})]})},p)})})]})}function at({report:t}){const s=t.clientPosition;if(!s)return e.jsx("p",{style:{color:"#666"},children:"No client position data available."});const i={leading:{bg:"rgba(0,255,127,0.2)",color:"#00FF7F",border:"rgba(0,255,127,0.3)"},competitive:{bg:"rgba(77,166,255,0.2)",color:"#4da6ff",border:"rgba(77,166,255,0.3)"},trailing:{bg:"rgba(255,184,77,0.2)",color:"#ffb84d",border:"rgba(255,184,77,0.3)"},critical:{bg:"rgba(255,77,106,0.2)",color:"#ff4d6a",border:"rgba(255,77,106,0.3)"}},o=i[s.net_position]||i.competitive;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{style:{background:"#111118",border:"1px solid #1e1e2a",borderRadius:14,padding:24},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:16},children:[e.jsx(de,{style:{width:22,height:22,color:"#00FF7F"}}),e.jsx("h3",{style:{fontSize:16,fontWeight:600,color:"#f0f0f5"},children:"Client Position Assessment"})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-3",style:{marginBottom:24},children:[e.jsxs("div",{style:{background:"rgba(255,255,255,0.02)",borderRadius:10,padding:16,textAlign:"center"},children:[e.jsx("p",{style:{fontSize:10,color:"#666",textTransform:"uppercase",letterSpacing:1,fontFamily:"'DM Mono', monospace"},children:"Overall Rank"}),e.jsx("p",{style:{fontSize:24,fontWeight:700,color:"#f0f0f5",marginTop:4,fontFamily:"'DM Mono', monospace"},children:s.overall_rank})]}),e.jsxs("div",{style:{background:"rgba(255,255,255,0.02)",borderRadius:10,padding:16,textAlign:"center"},children:[e.jsx("p",{style:{fontSize:10,color:"#666",textTransform:"uppercase",letterSpacing:1,fontFamily:"'DM Mono', monospace"},children:"Vulnerability"}),e.jsxs("p",{style:{fontSize:24,fontWeight:700,color:"#f0f0f5",marginTop:4,fontFamily:"'DM Mono', monospace"},children:[s.vulnerability_rating,"/10"]})]}),e.jsxs("div",{style:{background:"rgba(255,255,255,0.02)",borderRadius:10,padding:16,textAlign:"center"},children:[e.jsx("p",{style:{fontSize:10,color:"#666",textTransform:"uppercase",letterSpacing:1,fontFamily:"'DM Mono', monospace"},children:"Net Position"}),e.jsx("span",{style:{display:"inline-flex",marginTop:8,padding:"4px 12px",borderRadius:9999,fontSize:12,fontWeight:600,textTransform:"uppercase",background:o.bg,color:o.color,border:`1px solid ${o.border}`},children:s.net_position})]})]}),e.jsxs("div",{style:{background:"rgba(255,255,255,0.02)",borderRadius:10,padding:16,marginBottom:16},children:[e.jsx("p",{style:{fontSize:12,color:"#666",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:4},children:"Cluster Membership"}),e.jsx("p",{style:{fontSize:14,color:"#f0f0f5"},children:s.cluster_membership})]}),e.jsx("p",{style:{color:"rgba(255,255,255,0.8)",lineHeight:1.7},children:s.position_summary})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[e.jsxs("div",{style:{background:"#111118",border:"1px solid #1e1e2a",borderRadius:14,padding:20}
79,children:[e.jsx("p",{style:{fontSize:10,color:"#666",textTransform:"uppercase",letterSpacing:1,fontFamily:"'DM Mono', monospace",marginBottom:12},children:"Shared Frustrations"}),e.jsx("ul",{className:"space-y-1.5",children:(s.shared_frustrations||[]).map((a,p)=>e.jsxs("li",{className:"flex items-start gap-1.5",style:{fontSize:14,color:"rgba(255,184,77,0.8)"},children:[e.jsx("span",{style:{marginTop:2},children:"·"}),a]},p))})]}),e.jsxs("div",{style:{background:"#111118",border:"1px solid #1e1e2a",borderRadius:14,padding:20},children:[e.jsx("p",{style:{fontSize:10,color:"#666",textTransform:"uppercase",letterSpacing:1,fontFamily:"'DM Mono', monospace",marginBottom:12},children:"Unique Weaknesses"}),e.jsx("ul",{className:"space-y-1.5",children:(s.unique_weaknesses||[]).map((a,p)=>e.jsxs("li",{className:"flex items-start gap-1.5",style:{fontSize:14,color:"rgba(255,77,106,0.8)"},children:[e.jsx("span",{style:{marginTop:2},children:"·"}),a]},p))})]}),e.jsxs("div",{style:{background:"#111118",border:"1px solid #1e1e2a",borderRadius:14,padding:20},children:[e.jsx("p",{style:{fontSize:10,color:"#666",textTransform:"uppercase",letterSpacing:1,fontFamily:"'DM Mono', monospace",marginBottom:12},children:"Competitive Advantages"}),e.jsx("ul",{className:"space-y-1.5",children:(s.competitive_advantages||[]).map((a,p)=>e.jsxs("li",{className:"flex items-start gap-1.5",style:{fontSize:14,color:"rgba(0,255,127,0.8)"},children:[e.jsx("span",{style:{marginTop:2},children:"·"}),a]},p))})]})]})]})}function ot({report:t,navigate:s}){const i=t.battlePlan;return i?e.jsxs("div",{className:"space-y-8",children:[e.jsx("div",{className:"flex flex-wrap gap-2",children:s&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>s("/dashboard/ai-copywriter"),className:"flex items-center gap-1.5",style:{padding:"8px 16px",fontSize:13,fontWeight:500,background:"rgba(167,139,250,0.12)",border:"1px solid rgba(167,139,250,0.2)",borderRadius:8,color:"#a78bfa",cursor:"pointer",transition:"all 0.15s"},children:[e.jsx(ze,{className:"w-3.5 h-3.5"})," Write listing copy for this market ",e.jsx(J,{className:"w-3 h-3"})]}),e.jsxs("button",{onClick:()=>s("/dashboard/niche-scanner"),className:"flex items-center gap-1.5",style:{padding:"8px 16px",fontSize:13,fontWeight:500,background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:8,color:"#f0f0f5",cursor:"pointer",transition:"all 0.15s"},children:[e.jsx(le,{className:"w-3.5 h-3.5"})," Niche Scanner for broader market view ",e.jsx(J,{className:"w-3 h-3"})]})]})}),e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:16},children:[e.jsx("div",{style:{width:32,height:32,borderRadius:8,background:"rgba(0,255,127,0.12)",display:"flex",alignItems:"center",justifyContent:"center",color:"#00FF7F",fontSize:14,fontWeight:700},children:"1"}),e.jsxs("div",{children:[e.jsx("h3",{style:{fontSize:15,fontWeight:600,color:"#f0f0f5"},children:"Immediate Actions"}),e.jsx("p",{style:{fontSize:11,color:"#666",fontFamily:"'DM Mono', monospace"},children:"0-30 days · No product changes needed"})]})]}),e.jsx("div",{className:"space-y-3",children:(i.immediate_actions||[]).map((o,a)=>e.jsx("div",{style:{background:"#111118",border:"1px solid #1e1e2a",borderRadius:14,padding:16},children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",style:{marginBottom:4},children:[e.jsxs("span",{style:{fontSize:12,fontWeight:700,color:"rgba(0,255,127,0.6)"},children:["#",o.priority]}),e.jsx("h4",{style:{fontSize:14,fontWeight:600,color:"#f0f0f5"},children:o.action})]}),e.jsx("p",{style:{fontSize:12,color:"#666"},children:o.rationale}),o.exploits_gap&&e.jsxs("p",{style:{fontSize:12,color:"rgba(0,255,127,0.6)",marginTop:4},children:["Exploits: ",o.exploits_gap]})]}),e.jsxs("div",{className:"flex flex-col items-end gap-1 flex-shrink-0",children:[e.jsx(ct,{effort:o.effort}),o.expected_impact&&e.jsx("span",{style:{fontSize:10,color:"#666"},children:o.expected_impact})]})]})},a))})]}),e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:16},children:[e.jsx("div",{style:{width:32,height:32,borderRadius:8,background:"rgba(77,166,255,0.12)",display:"flex",alignItems:"center",justifyContent:"center",color:"#4da6ff",fontSize:14,fontWeight:700},children:"2"}),e.jsxs("div",{children:[e.jsx("h3",{style:{fontSize:15,fontWeight:600,color:"#f0f0f5"},children:"Product Improvements"}),e.jsx("p",{style:{fontSize:11,color:"#666",fontFamily:"'DM Mono', monospace"},children:"30-90 days · Physical product changes"})]})]}),e.jsx("div",{className:"space-y-3",children:(i.product_improvements||[]).map((o,a)=>e.jsx("div",{style:{background:"#111118",border:"1px solid #1e1e2a",borderRadius:14,padding:16},children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",style:{marginBottom:4},children:[e.jsxs("span",{style:{fontSize:12,fontWeight:700,color:"rgba(77,166,255,0.6)"},children:["#",o.priority]}),e.jsx("h4",{style:{fontSize:14,fontWeight:600,color:"#f0f0f5"},children:o.improvement})]}),e.jsxs("p",{style:{fontSize:12,color:"#666"},children:["Solves: ",o.solves_frustration]}),o.implementation_note&&e.jsx("p",{style:{fontSize:12,color:"rgba(102,102,102,0.6)",marginTop:4},children:o.implementation_note})]}),e.jsxs("div",{className:"flex flex-col items-end gap-1 flex-shrink-0",children:[e.jsxs("span",{style:{fontSize:12,color:"#666"},children:[o.competitors_with_problem," competitors affected"]}),e.jsx(lt,{impact:o.differentiation_impact})]})]})},a))})]}),e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:16},children:[e.jsx("div",{style:{width:32,height:32,borderRadius:8,background:"rgba(167,139,250,0.12)",display:"flex",alignItems:"center",justifyContent:"center",color:"#a78bfa",fontSize:14,fontWeight:700},children:"3"}),e.jsxs("div",{children:[e.jsx("h3",{style:{fontSize:15,fontWeight:600,color:"#f0f0f5"},children:"Market Domination"}),e.jsx("p",{style:{fontSize:11,color:"#666",fontFamily:"'DM Mono', monospace"},children:"90-180 days · Long-term strategic plays"})]})]}),e.jsx("div",{className:"space-y-3",children:(i.market_domination||[]).map((o,a)=>e.jsx("div",{style:{background:"#111118",border:"1px solid #1e1e2a",borderRadius:14,padding:16},children:e.jsx("div",{className:"flex items-start justify-between gap-3",children:e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",style:{marginBottom:4},children:[e.jsxs("span",{style:{fontSize:12,fontWeight:700,color:"rgba(167,139,250,0.6)"},children:["#",o.priority]}),e.jsx("h4",{style:{fontSize:14,fontWeight:600,color:"#f0f0f5"},children:o.strategy})]}),e.jsxs("p",{style:{fontSize:12,color:"#666"},children:["Builds moat: ",o.builds_moat]}),e.jsxs("div",{className:"flex items-center gap-3",style:{marginTop:6,fontSize:12,color:"rgba(102,102,102,0.6)"},children:[e.jsx("span",{children:o.timeline}),o.requires&&e.jsxs("span",{children:["Requires: ",o.requires]})]})]})})},a))})]})]}):e.jsx("p",{style:{color:"#999"},children:"No battle plan available."})}function ct({effort:t}){const s={low:{bg:"rgba(0,255,127,0.2)",color:"#00FF7F"},medium:{bg:"rgba(255,184,77,0.2)",color:"#ffb84d"},high:{bg:"rgba(255,77,106,0.2)",color:"#ff4d6a"}},i=s[t]||s.medium;return e.jsxs("span",{style:{padding:"2px 8px",borderRadius:4,fontSize:10,fontWeight:600,textTransform:"uppercase",background:i.bg,color:i.color},children:[t," effort"]})}function lt({impact:t}){const s={high:{bg:"rgba(0,255,127,0.2)",color:"#00FF7F"},medium:{bg:"rgba(77,166,255,0.2)",color:"#4da6ff"},low:{bg:"rgba(102,102,102,0.2)",color:"#999"}},i=s[t]||s.medium;return e.jsxs("span",{style:{padding:"2px 8px",borderRadius:4,fontSize:10,fontWeight:600,textTransform:"uppercase",background:i.bg,color:i.color},children:[t," impact"]})}export{Ct 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.