1import{p as je,i as ve,j as e,w as ye,x as Ne,y as ke,z as Fe,u as Ce}from"./index-B4Uy4NJO.js";import{r,J as d,a3 as _e,Q as Se,W as le,o as ie,O as Le,aL as Pe,l as Ae,p as R,ax as Re,a7 as Ee,z as Te,a0 as ne,a1 as Ue,G as De,ap as Be,X as Ie}from"./lucide-mMo7nqgk.js";import{n as $e,p as He}from"./reportExport-BGriXW13.js";import"./vendor-Cv6_TLXB.js";import"./framer-mxZmfqgM.js";const j=[{id:"overview",label:"Overview",description:"Executive summary and key scores"},{id:"instant-actions",label:"Instant Actions",description:"High-priority quick fixes"},{id:"clinical-evidence",label:"Evidence",description:"Visual snapshots & annotations"},{id:"ia-architecture",label:"Architecture",description:"Information structure & flow"},{id:"problem-finder",label:"Problem Finder",description:"Identified friction points"},{id:"ui-audit",label:"UI Audit",description:"Visual design & components"},{id:"ux-audit",label:"UX Audit",description:"Usability & user flow audit"},{id:"trust-emotion",label:"Trust & Emotion",description:"Credibility and user sentiment"},{id:"usage-context",label:"Usage & Context",description:"Device & behavioral context"},{id:"heuristics",label:"Heuristics",description:"Nielsen & usability heuristics"},{id:"ux-laws",label:"UX Laws",description:"Psychological UX principles"},{id:"roadmap",label:"Roadmap",description:"Prioritized remediation phases"},{id:"impact-3",label:"Impact 3",description:"Top 3 high-leverage transformations"},{id:"verdict",label:"Verdict",description:"Final summary & recommendations"}],Ve=()=>{var se,te,ae,re;const{id:i}=je(),E=ve(),[oe,v]=r.useState(!0),[T,U]=r.useState(!1),[m,D]=r.useState(!1),[B,I]=r.useState(!1),[y,$]=r.useState(!1),[H,O]=r.useState(!1),[q,M]=r.useState(null),[a,p]=r.useState(null),[c,W]=r.useState(""),[N,z]=r.useState(""),[x,k]=r.useState(""),[u,F]=r.useState("#635FF4"),[b,C]=r.useState("#4F46E5"),[_,V]=r.useState(""),[S,G]=r.useState(""),[L,X]=r.useState("Book a Strategy Call"),[P,J]=r.useState(""),[h,g]=r.useState([]),[de,K]=r.useState(!1),[Q,ce]=r.useState(null),[xe,Y]=r.useState(!1),me=async()=>{if(i)try{v(!0),M(null);const s=await ye(i);if(!s.success||!s.data)throw new Error(s.error||"Failed to load client report.");const t=s.data;p(t),W(t.report_name||""),z(t.brand_name||""),k(t.brand_logo_url||""),F(t.primary_color||"#635FF4"),C(t.accent_color||"#4F46E5"),V(t.agency_website||""),G(t.agency_email||""),X(t.cta_text||"Book a Strategy Call"),J(t.cta_url||"");const l=Array.isArray(t.hidden_sections)?t.hidden_sections:[];g(Array.from(new Set(l.map($e)))),v(!1)}catch(s){M(s.message||"Failed to load client report."),v(!1)}};r.useEffect(()=>{me()},[i]);const pe=s=>{g(t=>t.includes(s)?t.filter(l=>l!==s):[...t,s])},ue=()=>{g([])},be=()=>{g(j.map(s=>s.id))},he=async s=>{var l;const t=(l=s.target.files)==null?void 0:l[0];if(t){if(!t.type.startsWith("image/")){alert("Please upload a valid image file (PNG, JPG, SVG, WebP).");return}if(t.size>5*1024*1024){alert("Logo image size must be under 5MB.");return}$(!0);try{const n=await Ce(t);n.success&&n.url?k(n.url):alert(n.error||"Failed to upload logo.")}catch(n){alert("Logo upload failed: "+n.message)}finally{$(!1)}}},ge=async s=>{if(s.preventDefault(),!!i){if(!c.trim()){alert("Report name cannot be empty.");return}U(!0);try{const t=await Fe(i,{report_name:c.trim(),brand_name:N.trim()||void 0,brand_logo_url:x.trim()||void 0,primary_color:u.trim()||void 0,accent_color:b.trim()||void 0,agency_website:_.trim()||void 0,agency_email:S.trim()||void 0,cta_text:L.trim()||void 0,cta_url:P.trim()||void 0,hidden_sections:h});if(!t.success||!t.data)throw new Error(t.error||"Failed to update client report.");p(l=>l?{...l,...t.data}:null),alert("Client report changes saved successfully!")}catch(t){alert(t.message||"Failed to save changes.")}finally{U(!1)}}},Z=async()=>{if(i){D(!0);try{const s=await Ne(i);if(!s.success||!s.data)throw new Error(s.error||"Failed to publish report.");p(t=>t?{...t,...s.data}:null)}catch(s){alert(s.message||"Failed to publish report.")}finally{D(!1)}}},fe=async()=>{if(i&&confirm("Are you sure you want to disable this shared report? Prospects clicking the public link will no longer see the report.")){I(!0);try{const s=await ke(i);if(!s.success||!s.data)throw new Error(s.error||"Failed to disable report.");p(t=>t?{...t,...s.data}:null)}catch(s){alert(s.message||"Failed to disable report.")}finally{I(!1)}}},f=a!=null&&a.agency_slug&&(a!=null&&a.report_slug)?`${window.location.origin}/r/${a.agency_slug}/${a.report_slug}`:a!=null&&a.share_token?`${window.location.origin}/r/${a.share_token}`:"",we=()=>{f&&(navigator.clipboard.writeText(f),O(!0),setTimeout(()=>O(!1),2500))},ee=async()=>{var s;if(!((s=a==null?void 0:a.audit_request)!=null&&s.report_url)){alert("Source report file is not available.");return}K(!0),Y(!0);try{const t=await fetch(a.audit_request.report_url,{mode:"cors"});if(!t.ok)throw new Error("Could not fetch master audit report HTML.");const l=await t.text(),n=He(l,{report_name:c,brand_name:N,brand_logo_url:x,primary_color:u,accent_color:b,agency_website:_,agency_email:S,cta_text:L,cta_url:P,hidden_sections:h});ce(n)}catch(t){alert("Failed to render preview: "+t.message)}finally{Y(!1)}};if(oe)return e.jsxs("div",{className:"min-h-screen bg-[#FDFCFB] flex flex-col items-center justify-center space-y-4",children:[e.jsx(d,{className:"w-8 h-8 text-[#635FF4] animate-spin"}),e.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-widest",children:"Loading client report..."})]});if(q||!a)return e.jsx("div",{className:"min-h-screen bg-[#FDFCFB] flex items-center justify-center p-6",children:e.jsxs("div",{className:"max-w-md w-full bg-white p-8 rounded-3xl border border-red-100 shadow-xl text-center space-y-4",children:[e.jsx("div",{className:"w-14 h-14 bg-red-50 text-red-500 rounded-2xl flex items-center justify-center mx-auto",children:e.jsx(_e,{className:"w-7 h-7"})}),e.jsx("h2",{className:"text-xl font-bold text-slate-900",children:"Report Not Found"}),e.jsx("p",{className:"text-sm text-slate-500 leading-relaxed",children:q||"Could not load report."}),e.jsx("button",{onClick:()=>E("/my-reports"),className:"w-full py-3 bg-slate-900 hover:bg-[#635FF4] text-white rounded-xl text-xs font-bold uppercase tracking-wide transition-all",children:"Back to My Reports"})]})});const A=a.status==="draft",o=a.status==="published",w=a.status==="disabled";return e.jsxs("div",{className:"min-h-screen bg-[#FDFCFB] text-slate-900 pb-24 font-sans",children:[e.jsx("header",{className:"sticky top-0 z-40 bg-white/85 backdrop-blur-md border-b border-slate-100 px-4 md:px-8 py-4",children:e.jsxs("div",{className:"max-w-5xl mx-auto flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{type:"button",onClick:()=>E("/my-reports"),className:"p-2 rounded-xl hover:bg-slate-100 text-slate-400 hover:text-slate-900 transition-colors",children:e.jsx(Se,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h1",{className:"text-base font-bold text-slate-900 truncate max-w-xs sm:max-w-sm md:max-w-md",children:a.report_name}),e.jsx("span",{className:`text-[10px] font-extrabold uppercase px-2.5 py-0.5 rounded-full border ${o?"bg-emerald-50 text-emerald-700 border-emerald-200":w?"bg-rose-50 text-rose-700 border-rose-200":"bg-amber-50 text-amber-700 border-amber-200"}`,children:a.status})]}),e.jsx("p",{className:"text-xs text-slate-400 font-medium",children:"Manage branding, preview, and share with your prospect"})]})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("button",{type:"button",onClick:ee,className:"flex items-center gap-1.5 px-3.5 py-2 rounded-xl bg-slate-100 hover:bg-slate-200 text-slate-700 text-xs font-bold transition-all active:scale-95",children:[e.jsx(le,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:"Preview Report"})]})})]})}),e.jsxs("main",{className:"max-w-5xl mx-auto px-4 md:px-8 py-8 space-y-8",children:[e.jsxs("div",{className:`p-6 rounded-3xl border shadow-sm transition-all ${o?"bg-gradient-to-br from-emerald-50/60 via-white to-indigo-50/30 border-emerald-200/80":w?"bg-gradient-to-br from-rose-50/50 via-white to-slate-50 border-rose-200":"bg-gradient-to-br from-indigo-50/60 via-white to-purple-50/30 border-indigo-200/80"}`,children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`w-2.5 h-2.5 rounded-full ${o?"bg-emerald-500 animate-pulse":w?"bg-rose-500":"bg-amber-500"}`}),e.jsx("h2",{className:"text-base font-black text-slate-900",children:o?"Live Public Share Link":A?"Report is in Draft Mode":"Sharing is Disabled"})]}),e.jsx("p",{className:"text-xs text-slate-600 max-w-xl leading-relaxed font-medium",children:o?"Your prospect can open this branded link without logging in. The master audit remains untouched.":A?"Review your branding settings and preview the report. When you are ready, click Publish to generate a prospect link.":"This shared report is currently disabled. Prospects visiting the link will see an unavailable message."})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3 shrink-0",children:[A&&e.jsxs("button",{type:"button",onClick:Z,disabled:m,className:"px-5 py-3 rounded-2xl bg-[#635FF4] hover:bg-[#524ee5] text-white text-xs font-bold uppercase tracking-wider shadow-lg shadow-indigo-600/20 transition-all active:scale-95 disabled:opacity-50 flex items-center gap-2",children:[m?e.jsx(d,{className:"w-4 h-4 animate-spin"}):e.jsx(ie,{className:"w-4 h-4"}),e.jsx("span",{children:"Publish & Share"})]}),o&&e.jsxs(e.Fragment,{children:[e.jsxs("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"px-4 py-2.5 rounded-xl bg-slate-900 hover:bg-[#635FF4] text-white text-xs font-bold transition-all flex items-center gap-1.5 shadow-sm active:scale-95",children:[e.jsx("span",{children:"Open Live Report"}),e.jsx(Le,{className:"w-3.5 h-3.5"})]}),e.jsxs("button",{type:"button",onClick:fe,disabled:B,className:"px-3 py-2.5 rounded-xl border border-rose-200 text-rose-600 hover:bg-rose-50 text-xs font-bold transition-all flex items-center gap-1.5",title:"Disable sharing",children:[B?e.jsx(d,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(Pe,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"Disable Link"})]})]}),w&&e.jsxs("button",{type:"button",onClick:Z,disabled:m,className:"px-5 py-3 rounded-2xl bg-emerald-600 hover:bg-emerald-700 text-white text-xs font-bold uppercase tracking-wider shadow-lg shadow-emerald-600/20 transition-all active:scale-95 flex items-center gap-2",children:[m?e.jsx(d,{className:"w-4 h-4 animate-spin"}):e.jsx(Ae,{className:"w-4 h-4"}),e.jsx("span",{children:"Re-Publish Link"})]})]})]}),o&&e.jsxs("div",{className:"mt-5 pt-4 border-t border-emerald-200/50 flex flex-col sm:flex-row items-stretch sm:items-center gap-2",children:[e.jsx("div",{className:"flex-1 px-4 py-2.5 bg-white/90 border border-slate-200 rounded-xl text-xs font-mono text-slate-700 truncate select-all",children:f}),e.jsx("button",{type:"button",onClick:we,className:`px-4 py-2.5 rounded-xl font-bold text-xs uppercase tracking-wider transition-all flex items-center justify-center gap-2 shadow-sm ${H?"bg-emerald-600 text-white shadow-emerald-600/20":"bg-slate-900 hover:bg-[#635FF4] text-white"}`,children:H?e.jsxs(e.Fragment,{children:[e.jsx(R,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"Link Copied!"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Re,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"Copy Link"})]})})]})]}),e.jsxs("form",{onSubmit:ge,className:"grid grid-cols-1 lg:grid-cols-12 gap-8",children:[e.jsxs("div",{className:"lg:col-span-7 space-y-6",children:[e.jsxs("div",{className:"bg-white p-6 rounded-2xl border border-slate-100 shadow-sm space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 pb-2 border-b border-slate-50",children:[e.jsx(Ee,{className:"w-4 h-4 text-indigo-600"}),e.jsx("h3",{className:"text-sm font-bold text-slate-900",children:"Report Details"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 uppercase tracking-wider mb-1.5",children:"Report Title"}),e.jsx("input",{type:"text",required:!0,value:c,onChange:s=>W(s.target.value),className:"w-full px-3.5 py-2.5 bg-slate-50 border border-slate-200 rounded-xl text-sm font-medium text-slate-900 focus:outline-none focus:border-[#635FF4]"})]})]}),e.jsxs("div",{className:"bg-white p-6 rounded-2xl border border-slate-100 shadow-sm space-y-5",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 pb-3 border-b border-slate-100",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Te,{className:"w-4 h-4 text-indigo-600"}),e.jsx("h3",{className:"text-sm font-bold text-slate-900 uppercase tracking-wider",children:"Content"}),e.jsxs("span",{className:"ml-1 text-[11px] font-bold px-2.5 py-0.5 rounded-full bg-indigo-50 text-[#635FF4] border border-indigo-100",children:[j.length-h.length," of ",j.length," Visible"]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("button",{type:"button",onClick:ue,className:"px-3 py-1.5 rounded-lg bg-slate-100 hover:bg-indigo-50 hover:text-[#635FF4] text-slate-700 text-xs font-bold transition-all active:scale-95",children:"SHOW ALL"}),e.jsx("button",{type:"button",onClick:be,className:"px-3 py-1.5 rounded-lg bg-slate-100 hover:bg-rose-50 hover:text-rose-600 text-slate-700 text-xs font-bold transition-all active:scale-95",children:"HIDE ALL"})]})]}),e.jsx("p",{className:"text-xs text-slate-500 leading-relaxed font-medium",children:"Choose which sections are displayed to your client. Unchecked sections will be dynamically hidden in both the live shared report and client export."}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2.5 pt-1",children:j.map(s=>
1{const t=!h.includes(s.id);return e.jsxs("div",{onClick:()=>pe(s.id),className:`p-3 rounded-xl border transition-all cursor-pointer select-none flex items-start gap-3 ${t?"bg-white border-indigo-200/90 shadow-sm hover:border-indigo-400":"bg-slate-50 border-slate-200/80 opacity-60 hover:opacity-80"}`,children:[e.jsx("div",{className:`w-5 h-5 rounded-md flex items-center justify-center shrink-0 mt-0.5 transition-colors ${t?"bg-[#635FF4] text-white":"border-2 border-slate-300 bg-white"}`,children:t&&e.jsx(R,{className:"w-3.5 h-3.5 stroke-[3]"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between gap-1",children:[e.jsx("p",{className:`text-xs font-bold truncate ${t?"text-slate-900":"text-slate-500 line-through"}`,children:s.label}),e.jsx("span",{className:`text-[9px] font-black uppercase tracking-wider px-1.5 py-0.5 rounded ${t?"bg-emerald-50 text-emerald-700":"bg-slate-200/60 text-slate-500"}`,children:t?"ON":"OFF"})]}),e.jsx("p",{className:"text-[10px] text-slate-400 font-medium truncate mt-0.5",children:s.description})]})]},s.id)})})]}),e.jsxs("div",{className:"bg-white p-6 rounded-2xl border border-slate-100 shadow-sm space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-2 pb-2 border-b border-slate-50",children:[e.jsx(ne,{className:"w-4 h-4 text-indigo-600"}),e.jsx("h3",{className:"text-sm font-bold text-slate-900 uppercase tracking-wider",children:"Branding"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 uppercase tracking-wider mb-1.5",children:"Agency / Brand Name"}),e.jsx("input",{type:"text",value:N,onChange:s=>z(s.target.value),placeholder:"e.g. Acme Studio",className:"w-full px-3.5 py-2.5 bg-slate-50 border border-slate-200 rounded-xl text-sm font-medium text-slate-900 focus:outline-none focus:border-[#635FF4]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 uppercase tracking-wider mb-1.5",children:"Agency Logo"}),e.jsxs("div",{className:"flex items-center gap-4",children:[x?e.jsx("div",{className:"relative w-16 h-16 rounded-xl border border-slate-200 bg-slate-50 p-2 flex items-center justify-center shrink-0",children:e.jsx("img",{src:x,alt:"Logo",className:"max-w-full max-h-full object-contain"})}):e.jsx("div",{className:"w-16 h-16 rounded-xl border border-dashed border-slate-200 bg-slate-50 flex items-center justify-center text-slate-300 shrink-0",children:e.jsx(ne,{className:"w-6 h-6"})}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsxs("label",{className:"inline-flex items-center gap-2 px-3.5 py-2 rounded-xl bg-slate-100 hover:bg-slate-200 text-slate-700 text-xs font-bold cursor-pointer transition-all active:scale-95",children:[y?e.jsx(d,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(Ue,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:y?"Uploading...":"Upload New Logo"}),e.jsx("input",{type:"file",accept:"image/png, image/jpeg, image/svg+xml, image/webp",onChange:he,disabled:y,className:"hidden"})]}),e.jsx("input",{type:"url",value:x,onChange:s=>k(s.target.value),placeholder:"Logo URL",className:"w-full px-3 py-1.5 bg-slate-50 border border-slate-200 rounded-lg text-xs font-medium text-slate-700 focus:outline-none focus:border-[#635FF4]"})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 pt-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 uppercase tracking-wider mb-1.5",children:"Primary Brand Color"}),e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("input",{type:"color",value:u,onChange:s=>F(s.target.value),className:"w-10 h-10 rounded-xl border border-slate-200 cursor-pointer p-0.5 bg-white shrink-0"}),e.jsx("input",{type:"text",value:u,onChange:s=>F(s.target.value),className:"flex-1 px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs font-mono text-slate-800 uppercase focus:outline-none focus:border-[#635FF4]"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 uppercase tracking-wider mb-1.5",children:"Accent Color"}),e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("input",{type:"color",value:b,onChange:s=>C(s.target.value),className:"w-10 h-10 rounded-xl border border-slate-200 cursor-pointer p-0.5 bg-white shrink-0"}),e.jsx("input",{type:"text",value:b,onChange:s=>C(s.target.value),className:"flex-1 px-3 py-2 bg-slate-50 border border-slate-200 rounded-xl text-xs font-mono text-slate-800 uppercase focus:outline-none focus:border-[#635FF4]"})]})]})]})]}),e.jsxs("div",{className:"bg-white p-6 rounded-2xl border border-slate-100 shadow-sm space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 pb-2 border-b border-slate-50",children:[e.jsx(De,{className:"w-4 h-4 text-indigo-600"}),e.jsx("h3",{className:"text-sm font-bold text-slate-900",children:"Agency Contact Info"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 uppercase tracking-wider mb-1.5",children:"Agency Website"}
1),e.jsx("input",{type:"url",value:_,onChange:s=>V(s.target.value),placeholder:"https://youragency.com",className:"w-full px-3.5 py-2.5 bg-slate-50 border border-slate-200 rounded-xl text-sm font-medium text-slate-900 focus:outline-none focus:border-[#635FF4]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 uppercase tracking-wider mb-1.5",children:"Contact Email"}),e.jsx("input",{type:"email",value:S,onChange:s=>G(s.target.value),placeholder:"[email protected]",className:"w-full px-3.5 py-2.5 bg-slate-50 border border-slate-200 rounded-xl text-sm font-medium text-slate-900 focus:outline-none focus:border-[#635FF4]"})]})]})]}),e.jsxs("div",{className:"bg-white p-6 rounded-2xl border border-slate-100 shadow-sm space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 pb-2 border-b border-slate-50",children:[e.jsx(ie,{className:"w-4 h-4 text-indigo-600"}),e.jsx("h3",{className:"text-sm font-bold text-slate-900",children:"Client Call to Action (CTA)"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 uppercase tracking-wider mb-1.5",children:"CTA Button Text"}),e.jsx("input",{type:"text",value:L,onChange:s=>X(s.target.value),placeholder:"e.g. Book a Strategy Call",className:"w-full px-3.5 py-2.5 bg-slate-50 border border-slate-200 rounded-xl text-sm font-medium text-slate-900 focus:outline-none focus:border-[#635FF4]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-bold text-slate-700 uppercase tracking-wider mb-1.5",children:"CTA Target URL"}),e.jsx("input",{type:"url",value:P,onChange:s=>J(s.target.value),placeholder:"https://calendly.com/your-agency",className:"w-full px-3.5 py-2.5 bg-slate-50 border border-slate-200 rounded-xl text-sm font-medium text-slate-900 focus:outline-none focus:border-[#635FF4]"})]})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("button",{type:"submit",disabled:T,className:"py-3 px-6 rounded-xl bg-slate-900 hover:bg-[#635FF4] text-white font-bold text-xs uppercase tracking-wider shadow-md transition-all active:scale-95 disabled:opacity-50 flex items-center justify-center gap-2",children:[T?e.jsx(d,{className:"w-4 h-4 animate-spin"}):e.jsx(R,{className:"w-4 h-4"}),e.jsx("span",{children:"Save Changes"})]}),e.jsxs("button",{type:"button",onClick:ee,className:"py-3 px-5 rounded-xl border border-slate-200 text-slate-700 hover:bg-slate-100 font-bold text-xs uppercase tracking-wider transition-all flex items-center gap-1.5",children:[e.jsx(le,{className:"w-4 h-4"}),e.jsx("span",{children:"Preview"})]})]})]}),e.jsxs("div",{className:"lg:col-span-5 space-y-6",children:[e.jsxs("div",{className:"bg-white p-6 rounded-2xl border border-slate-100 shadow-sm space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between pb-2 border-b border-slate-50",children:[e.jsx("h4",{className:"text-xs font-bold text-slate-900 uppercase tracking-wider",children:"Source Audit Details"}),e.jsx("span",{className:"text-[10px] font-bold text-emerald-600 bg-emerald-50 px-2 py-0.5 rounded-full border border-emerald-200",children:"Master Report Verified"})]}),e.jsxs("div",{className:"space-y-2 text-xs",children:[e.jsxs("div",{className:"flex justify-between py-1 border-b border-slate-50",children:[e.jsx("span",{className:"text-slate-400",children:"Audited Target:"}),e.jsx("span",{className:"font-bold text-slate-800 truncate max-w-[200px]",children:((se=a.audit_request)==null?void 0:se.input_value)||"Website"})]}),e.jsxs("div",{className:"flex justify-between py-1 border-b border-slate-50",children:[e.jsx("span",{className:"text-slate-400",children:"Audit Type:"}),e.jsx("span",{className:"font-bold text-slate-800",children:((te=a.audit_request)==null?void 0:te.audit_type)||"Full Audit"})]}),((ae=a.audit_request)==null?void 0:ae.overall_score)!==void 0&&((re=a.audit_request)==null?void 0:re.overall_score)!==null&&e.jsxs("div",{className:"flex justify-between py-1 border-b border-slate-50",children:[e.jsx("span",{className:"text-slate-400",children:"Overall Score:"}),e.jsxs("span",{className:"font-extrabold text-emerald-600",children:[a.audit_request.overall_score,"/100"]})]}),e.jsxs("div",{className:"flex justify-between py-1",children:[e.jsx("span",{className:"text-slate-400",children:"Audit ID:"}),e.jsxs("span",{className:"font-mono text-slate-500 text-[11px]",children:["#",a.audit_request_id.substring(0,8)]})]})]})]}),e.jsxs("div",{className:"p-5 bg-indigo-50/40 rounded-2xl border border-indigo-100/60 space-y-2.5 text-xs text-slate-600 leading-relaxed",children:[e.jsxs("div",{className:"flex items-center gap-2 text-indigo-700 font-bold",children:[e.jsx(Be,{className:"w-4 h-4"}),e.jsx("span",{children:"Isolated Client Report Pipeline"})]}),e.jsx("p",{children:"Published client reports remain available while sharing is enabled. Prospect views do n
1ot start the standard report expiration timer."})]})]})]})]}),de&&e.jsxs("div",{className:"fixed inset-0 z-[99999] bg-slate-900/80 backdrop-blur-sm flex flex-col",children:[e.jsxs("div",{className:"h-14 bg-slate-900 border-b border-slate-800 px-6 flex items-center justify-between text-white shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-indigo-500 animate-pulse"}),e.jsxs("p",{className:"text-xs font-bold uppercase tracking-wider",children:["Branded Preview: ",e.jsx("strong",{className:"text-white",children:c})]})]}),e.jsx("button",{type:"button",onClick:()=>K(!1),className:"p-2 text-slate-400 hover:text-white rounded-xl hover:bg-slate-800 transition-colors",children:e.jsx(Ie,{className:"w-5 h-5"})})]}),e.jsx("div",{className:"flex-1 bg-slate-100 relative",children:xe?e.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center space-y-3 bg-white",children:[e.jsx(d,{className:"w-8 h-8 text-[#635FF4] animate-spin"}),e.jsx("p",{className:"text-xs font-bold text-slate-400 uppercase tracking-widest",children:"Transforming HTML preview..."})]}):Q?e.jsx("iframe",{srcDoc:Q,title:"Client Report Preview",className:"w-full h-full border-none bg-white",sandbox:"allow-scripts allow-same-origin allow-popups allow-forms"}):e.jsx("div",{className:"p-12 text-center text-slate-400",children:"Failed to render preview."})})]})]})};export{Ve as ClientReportManage,j as REPORT_SECTIONS};
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.