1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CreativosTab-A20VaEgo.js","assets/index-C6-4kgOT.js","assets/vendor-react--UDKce57.js","assets/index-DAt2-s4a.css"])))=>i.map(i=>d[i]); 2import{u as Z,i as pe,j as e,s as ge,_ as ue}from"./index-C6-4kgOT.js";import{r as l}from"./vendor-react--UDKce57.js";import{d as Q,R as xe}from"./dia-corto-Qy3qvbbK.js";import{I as fe}from"./InsightsBanner-Cl764hUy.js";const me=l.lazy(()=>ue(()=>import("./CreativosTab-A20VaEgo.js"),__vite__mapDeps([0,1,2,3])).then(t=>({default:t.CreativosTab}))),he={SHOP_NOW:"Comprar ahora",LEARN_MORE:"Más información",SIGN_UP:"Registrarse",DOWNLOAD:"Descargar",GET_OFFER:"Recibir oferta",GET_QUOTE:"Cotizar",CONTACT_US:"Contactarnos",SUBSCRIBE:"Suscribirse",ORDER_NOW:"Pedir ahora",BOOK_NOW:"Reservar",APPLY_NOW:"Aplicar ahora",WHATSAPP_MESSAGE:"Enviar WhatsApp",MESSAGE_PAGE:"Enviar mensaje",SEE_MORE:"Ver más",NO_BUTTON:"Sin botón"};function ee(t){return he[t]||t.replace(/_/g," ").toLowerCase().replace(/\b\w/g,a=>a.toUpperCase())}const te={fresh:{label:"Fresco",bg:"rgba(16,185,129,0.15)",fg:"#059669",emoji:"ð¢"},warming:{label:"Saturando",bg:"rgba(245,158,11,0.15)",fg:"#B45309",emoji:"ð¡"},fatigued:{label:"Fatigado",bg:"rgba(249,115,22,0.18)",fg:"#C2410C",emoji:"ð "},burned:{label:"Quemado",bg:"rgba(239,68,68,0.18)",fg:"#B91C1C",emoji:"ð´"},unknown:{label:"Sin data",bg:"rgba(148,163,184,0.15)",fg:"#475569",emoji:"âª"}},B={meta:{label:"Meta",color:"#0866FF"},tiktok:{label:"TikTok",color:"#FE2C55"}},be=[{value:3,label:"Ãltimos 3 dÃas",corto:"3 dÃas"},{value:7,label:"Ãltimos 7 dÃas",corto:"7 dÃas"},{value:14,label:"Ãltimos 14 dÃas",corto:"14 dÃas"},{value:30,label:"Ãltimos 30 dÃas",corto:"1 mes"}];function j(t){return Number.isFinite(t)?Math.abs(t)>=1e3?`$${(t/1e3).toFixed(1)}k`:`$${t.toFixed(2)}`:"$0"}function A(t){return Number.isFinite(t)?t.toLocaleString("es-CO",{maximumFractionDigits:0}):"0"}function Ie({initialView:t}={}){var Y,K;const a=Z(),{user:o}=pe();o==null||o.role;const[r,d]=l.useState(null),[n,s]=l.useState(0),c=l.useRef(!1),[f,h]=l.useState(!0),[m,S]=l.useState(null),[W,$]=l.useState(7),[C,g]=l.useState(""),[u,k]=l.useState(""),[H,O]=l.useState(!1),F=!!(C&&u),[w,G]=l.useState("meta"),[E,se]=l.useState("all"),[U,q]=l.useState(null),[I,le]=l.useState(t||"overview");l.useEffect(()=>{t&&le(t)},[t]),l.useEffect(()=>{let i=!1;h(!0),S(null);const p=(F?`since=${C}&until=${u}&platform=${w}`:`days=${W}&platform=${w}`)+(c.current?"&fresco=1":"");return c.current=!1,a(`/api/creatives/overview?${p}`).then(async x=>{const v=await x.json().catch(()=>({}));if(!x.ok)throw new Error((v==null?void 0:v.error)||(v==null?void 0:v.message)||`HTTP ${x.status}`);return v}).then(x=>{i||d(x)}).catch(x=>{i||S((x==null?void 0:x.message)||"Error de red")}).finally(()=>{i||h(!1)}),()=>{i=!0}},[W,w,F,C,u,a,n]);const L=l.useMemo(()=>{if(!r)return[];let i=r.items;return E!=="all"&&(i=i.filter(p=>p.classification===E)),i},[r,E]),de=l.useMemo(()=>{if(!r)return{green:0,yellow:0,red:0,gray:0};const i={green:0,yellow:0,red:0,gray:0};for(const p of r.items)i[p.classification]+=1;return i},[r]);l.useMemo(()=>{if(!r)return{total:0,burned:0,fatigued:0,totalSpend:0,wastedSpend:0};let i=0,p=0,x=0,v=0;for(const b of r.items)x+=b.spend,b.fatigueLevel==="burned"?(i+=1,v+=b.spend):b.fatigueLevel==="fatigued"&&(p+=1);return{total:r.items.length,burned:i,fatigued:p,totalSpend:x,wastedSpend:v}},[r]);const V={overview:{emoji:"ð¨",title:"Análisis de creativos",subtitle:"Todos tus ads de Meta y TikTok con thumbnail, métricas y detector de fatiga. Te decimos cuál escalar, cuál pausar y cuándo duplicar con variación."},"ai-generator":{emoji:"ð¤",title:"Generar contenido ganador",subtitle:"La IA analiza tus creativos activos y genera variaciones de copy, sugiere CTAs alternativos y recomienda la estructura óptima de campañas."},"creativos-ia":{emoji:"â¨",title:"Studio IA",subtitle:"Sube una foto de tu producto y la IA la transforma en imagen publicitaria lista para Meta y TikTok."}}[I];return e.jsxs("div",{style:{paddingBottom:60},children:[I!=="creativos-ia"&&e.jsx(fe,{title:V.title,subtitle:V.subtitle}),e.jsx("div",{style:{padding:I!=="creativos-ia"?"14px 22px 0":"20px 22px",maxWidth:1400,margin:"0 auto"},children:I==="ai-generator"?e.jsx(Te,{platform:w,setPlatform:G}):I==="creativos-ia"?e.jsx(l.Suspense,{fallback:e.jsx("div",{style:{textAlign:"center",padding:40,color:"var(--text-muted)"},children:"Cargandoâ¦"}),children:e.jsx(me,{})}):e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{display:"flex",gap:6,marginBottom:16,justifyContent:"center",flexWrap:"wrap"},children:["meta","tiktok"].map(i=>{const p=B[i],x=w===i;return e.jsx("button",{onClick:()=>G(i),style:{padding:"10px 22px",fontSize:14,fontWeight:800,fontFamily:"inherit",background:x?p.color:"var(--bg-tertiary)",color:x?"#fff":"var(--text-primary)",border:`1px solid ${x?p.color:"var(--border)"}`,borderRadius:10,cursor:"pointer",transition:"all 0.15s",boxShadow:x?`0 2px 8px ${p.color}44`:"none"},children:p.label},i)})}),e.jsxs("div",{style:{display:"flex",gap:10,flexWrap:"wrap",marginBottom:16,justifyContent:"center",alignItems:"center"},children:[e.jsx("span",{style:{fontSize:10.5,fontWeight:800,color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.06em",marginRight:2},children:"PerÃodo"}),e.jsxs("div",{className:"date-filter-pill",children:[be.map(i=>e.jsx("button",{onClick:()=>{g(""),k(""),$(i.value)},className:`date-pill-btn${!F&&W===i.value?" active":""}`,children:i.corto},i.value)),e.jsx("button",{onClick:()=>
2{if(!C||!u){const i=new Date().toISOString().slice(0,10),p=new Date(Date.now()-7*864e5).toISOString().slice(0,10);g(p),k(i)}O(!0)},className:`date-pill-btn${F?" active":""}`,children:F?`${Q(C)} â ${Q(u)}`:"Personalizado"})]}),(H||F)&&e.jsx(xe,{desde:C,hasta:u,abierto:H,onCerrar:()=>O(!1),onChange:(i,p)=>{g(i),k(p)}}),F&&e.jsx("button",{onClick:()=>{g(""),k(""),O(!1)},title:"Volver a los perÃodos de siempre",style:{...ne,cursor:"pointer",fontWeight:700,color:"var(--text-muted)",padding:"7px 10px"},children:"â"})]}),(r==null?void 0:r.warnings)&&r.warnings.length>0&&e.jsxs("div",{style:{marginBottom:16,padding:"10px 14px",borderRadius:10,background:"rgba(245,158,11,0.10)",border:"1px solid rgba(245,158,11,0.30)",fontSize:12.5,color:"#B45309",textAlign:"center"},children:["â ",Array.from(new Set(r.warnings)).join(" · "),((Y=r==null?void 0:r.fallos)==null?void 0:Y.some(i=>i.accion==="reconectar"||i.accion==="permisos"))&&e.jsx("button",{onClick:()=>ge(),style:{marginLeft:10,background:"#B45309",color:"#fff",border:0,borderRadius:8,padding:"4px 11px",fontSize:11.5,fontWeight:800,cursor:"pointer",fontFamily:"inherit"},children:"Volver a conectar"}),((K=r==null?void 0:r.fallos)==null?void 0:K.some(i=>i.accion==="esperar"))&&e.jsx("button",{onClick:()=>{c.current=!0,s(i=>i+1)},style:{marginLeft:10,background:"#B45309",color:"#fff",border:0,borderRadius:8,padding:"4px 11px",fontSize:11.5,fontWeight:800,cursor:"pointer",fontFamily:"inherit"},children:"Reintentar"})]}),f&&e.jsx("div",{style:{textAlign:"center",color:"var(--text-muted)",padding:60,fontSize:14},children:"Cargando creativosâ¦"}),!f&&m&&e.jsxs("div",{style:{textAlign:"center",color:"#EF4444",padding:40,fontSize:14},children:["â ",m]}),!f&&!m&&L.length===0&&e.jsx("div",{style:{background:"var(--bg-card)",border:"1px dashed var(--border)",borderRadius:14,padding:40,textAlign:"center"},children:(()=>{const i=((r==null?void 0:r.fallos)||[]).find(p=>p.bloquea);return i?e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{fontSize:40,marginBottom:10},children:"ð"}),e.jsx("div",{style:{fontSize:15,fontWeight:700,color:"var(--text-primary)",marginBottom:4},children:"No pudimos traer tus creativos"}),e.jsx("div",{style:{fontSize:12.5,color:"var(--text-muted)"},children:i.texto})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{fontSize:40,marginBottom:10},children:"ð"}),e.jsx("div",{style:{fontSize:15,fontWeight:700,color:"var(--text-primary)",marginBottom:4},children:"Sin creativos en este rango"}),e.jsx("div",{style:{fontSize:12.5,color:"var(--text-muted)"},children:"Cambia el rango de fechas o conecta más cuentas en Conexiones."})]})})()}),!f&&!m&&(r==null?void 0:r.winners)&&e.jsxs(e.Fragment,{children:[e.jsx(J,{winners:r.winners.meta,platform:"meta"}),e.jsx(J,{winners:r.winners.tiktok,platform:"tiktok"})]}),!f&&!m&&r&&r.items.length>0&&e.jsx(ve,{counts:de,active:E,onSelect:i=>se(i===E?"all":i)}),!f&&!m&&L.length>0&&e.jsx(e.Fragment,{children:["meta","tiktok"].map(i=>{const p=L.filter(b=>b.platform===i);if(p.length===0)return null;const x=B[i],v=p.reduce((b,ce)=>b+ce.spend,0);return e.jsxs("div",{style:{marginBottom:28},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:10,marginBottom:12,flexWrap:"wrap"},children:[e.jsx("span",{style:{background:x.color,color:"#fff",fontSize:12,fontWeight:800,padding:"5px 12px",borderRadius:6,letterSpacing:"0.04em"},children:x.label}),e.jsxs("span",{style:{fontSize:13,fontWeight:700,color:"var(--text-primary)"},children:[p.length," ",p.length===1?"creativo":"creativos"]}),e.jsxs("span",{style:{fontSize:12,color:"var(--text-muted)"},children:["· ",j(v)," gastados"]})]}),e.jsx("div",{style:{display:"grid",gap:14,gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 280px), 1fr))"},children:p.map(b=>e.jsx(ye,{item:b,onOpen:()=>q(b)},`${b.platform}-${b.adId}`))})]},i)})}),U&&e.jsx(ze,{item:U,onClose:()=>q(null)})]})})]})}function J({winners:t,platform:a}){if(!t.topCTA&&!t.topCopy)return null;const o=t.metric==="purchases"?"compras":"impresiones",r=B[a].color;return e.jsxs("div",{style:{background:"linear-gradient(135deg, rgba(99,102,241,0.05), rgba(168,85,247,0.05))",border:"1px solid rgba(99,102,241,0.20)",borderRadius:14,padding:16,marginBottom:18},children:[e.jsxs("div",{style:{fontSize:11,fontWeight:700,color:r,textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:10,textAlign:"center"},children:["ð Lo que más vende en ",B[a].label]}),e.jsxs("div",{style:{display:"grid",gap:12,gridTemplateColumns:"repeat(auto-fit, minmax(min(100%, 280px), 1fr))"},children:[t.topCTA&&e.jsx(X,{icon:"ð¯",title:"Llamado a la acción ganador",mainText:t.topCTA.label,stats:[{label:o,value:t.metric==="purchases"?String(t.topCTA.purchases):t.topCTA.impressions.toLocaleStr
2ing("es-CO")},{label:"creativos",value:String(t.topCTA.adsCount)},{label:"gasto",value:j(t.topCTA.spend)}]}),t.topCopy&&e.jsx(X,{icon:"ð",title:"Copy ganador",mainText:`"${t.topCopy.label.length>100?t.topCopy.label.slice(0,100)+"â¦":t.topCopy.label}"`,stats:[{label:o,value:t.metric==="purchases"?String(t.topCopy.purchases):t.topCopy.impressions.toLocaleString("es-CO")},{label:"creativos",value:String(t.topCopy.adsCount)},{label:"gasto",value:j(t.topCopy.spend)}],italic:!0})]}),t.metric==="impressions"&&e.jsx("div",{style:{fontSize:11,color:"var(--text-muted)",textAlign:"center",marginTop:10,fontStyle:"italic"},children:"Sin ventas registradas todavÃa â ranking por impresiones (audiencia alcanzada)."})]})}function X({icon:t,title:a,mainText:o,stats:r,italic:d}){return e.jsxs("div",{style:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:12,padding:14,display:"flex",flexDirection:"column",gap:8},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx("span",{style:{fontSize:20},children:t}),e.jsx("span",{style:{fontSize:11,fontWeight:700,color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.06em"},children:a})]}),e.jsx("div",{style:{fontSize:15,fontWeight:700,color:"var(--text-primary)",lineHeight:1.4,fontStyle:d?"italic":"normal"},children:o}),e.jsx("div",{style:{display:"flex",gap:10,flexWrap:"wrap",marginTop:4},children:r.map((n,s)=>e.jsxs("span",{style:{fontSize:11,color:"var(--text-muted)"},children:[e.jsx("b",{style:{color:"var(--text-primary)"},children:n.value})," ",n.label]},s))})]})}const re={green:{label:"Buenos",color:"#10B981",bg:"rgba(16,185,129,0.10)",emoji:"ð¢",desc:"Para escalar ð¥"},yellow:{label:"Medios",color:"#F59E0B",bg:"rgba(245,158,11,0.10)",emoji:"ð¡",desc:"Optimiza la oferta"},red:{label:"Malos",color:"#EF4444",bg:"rgba(239,68,68,0.10)",emoji:"ð´",desc:"Pausa o renueva"},gray:{label:"Sin gasto / Bajo",color:"#94A3B8",bg:"rgba(148,163,184,0.10)",emoji:"âª",desc:"Necesitan más tiempo"}};function ve({counts:t,active:a,onSelect:o}){return e.jsx("div",{style:{display:"grid",gap:10,marginBottom:18,gridTemplateColumns:"repeat(auto-fit, minmax(170px, 1fr))"},children:["green","yellow","red","gray"].map(r=>{const d=re[r],n=a===r;return e.jsxs("button",{type:"button",onClick:()=>o(r),style:{background:n?d.color:d.bg,border:`2px solid ${d.color}`,borderRadius:12,padding:"12px 14px",cursor:"pointer",textAlign:"left",transition:"transform 0.12s",color:n?"#fff":"var(--text-primary)"},onMouseDown:s=>{s.currentTarget.style.transform="scale(0.98)"},onMouseUp:s=>{s.currentTarget.style.transform="scale(1)"},onMouseLeave:s=>{s.currentTarget.style.transform="scale(1)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:6},children:[e.jsx("span",{style:{fontSize:16},children:d.emoji}),e.jsx("span",{style:{fontSize:12.5,fontWeight:800,textTransform:"uppercase",letterSpacing:"0.04em"},children:d.label})]}),e.jsx("div",{style:{fontSize:28,fontWeight:900,lineHeight:1},children:t[r]}),e.jsx("div",{style:{fontSize:11,opacity:.85,marginTop:4},children:d.desc})]},r)})})}function ye({item:t,onOpen:a}){const o=te[t.fatigueLevel],r=B[t.platform];return re[t.classification],e.jsxs("div",{onClick:a,className:"lift",style:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:14,overflow:"hidden",cursor:"pointer",display:"flex",flexDirection:"column",transition:"border 0.15s, transform 0.15s",boxShadow:"var(--shadow-sm)"},children:[e.jsx(je,{item:t,fatigue:o,platform:r}),e.jsxs("div",{style:{padding:14,flex:1,display:"flex",flexDirection:"column",gap:10},children:[e.jsxs("div",{children:[e.jsx("div",{className:"censor-blur",style:{fontSize:13.5,fontWeight:700,color:"var(--text-primary)",lineHeight:1.3,marginBottom:2,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:t.adName||"(sin nombre)"}),e.jsxs("div",{className:"censor-blur",style:{fontSize:11,color:"var(--text-muted)",lineHeight:1.4},children:[t.accountName," · ",t.campaignName||"â"]}),e.jsx(ke,{item:t})]}),t.platform==="meta"&&e.jsxs("div",{style:{background:"rgba(99,102,241,0.04)",border:"1px solid rgba(99,102,241,0.15)",borderRadius:8,padding:"8px 10px",display:"flex",flexDirection:"column",gap:6},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"}
2,children:[e.jsx("span",{style:{fontSize:10,color:"var(--text-muted)",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em"},children:"ð¯ CTA"}),t.cta&&t.cta!=="NO_BUTTON"?e.jsx("span",{style:{background:"rgba(99,102,241,0.15)",color:"#4F46E5",fontSize:11,fontWeight:700,padding:"2px 8px",borderRadius:4},children:ee(t.cta)}):e.jsx("span",{style:{fontSize:11,color:"var(--text-muted)",fontStyle:"italic"},children:"Sin CTA detectado"})]}),e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:10,color:"var(--text-muted)",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:2},children:"ð Copy"}),t.body?e.jsxs("div",{style:{fontSize:11.5,color:"var(--text-secondary)",lineHeight:1.4,fontStyle:"italic",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical"},children:['"',t.body,'"']}):e.jsx("div",{style:{fontSize:11,color:"var(--text-muted)",fontStyle:"italic"},children:"Sin copy detectado"})]})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:6,fontSize:12},children:[e.jsx(T,{label:"Gasto",value:j(t.spend)}),e.jsx(T,{label:"CTR del enlace",value:t.ctr>0?`${t.ctr.toFixed(2)}%`:"â",accent:ae(t.ctr)||"var(--text-primary)"}),e.jsx(T,{label:"Impresiones",value:A(t.impressions)}),e.jsx(T,{label:"CPM",value:t.cpm>0?j(t.cpm):"â",accent:oe(t.cpmUsd)||"var(--text-primary)"}),e.jsx(T,{label:"Frecuencia",value:t.frequency>0?t.frequency.toFixed(1):"â",accent:ie(t.frequency)||"var(--text-primary)"}),(t.conversations||0)>0&&(t.purchases||0)===0?e.jsx(T,{label:"Conversaciones",value:A(t.conversations),accent:R}):e.jsx(T,{label:"Compras",value:A(t.purchases),accent:t.purchases>0?R:"var(--text-muted)"})]})]})]})}function je({item:t,fatigue:a,platform:o}){const r=!!t.thumbnail,d=t.platform==="tiktok"?"linear-gradient(135deg, #25F4EE 0%, #000000 50%, #FE2C55 100%)":"linear-gradient(135deg, #0866FF 0%, #19AFFF 100%)";return e.jsxs("div",{style:{position:"relative",width:"100%",aspectRatio:"16/9",background:r?"#0F172A":d,overflow:"hidden"},children:[r?e.jsx("img",{src:t.thumbnail,alt:t.adName,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:n=>{const s=n.currentTarget;s.style.display="none";const c=s.parentElement;c&&(c.style.background=d)}}):e.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:16,color:"#fff",textAlign:"center",gap:8},children:[e.jsx("span",{style:{fontSize:56,opacity:.85,lineHeight:1},children:t.format==="video"?"ð¬":t.format==="carousel"?"ð¼ï¸":"ð¸"}),e.jsxs("span",{style:{fontSize:11,opacity:.75,fontWeight:600,textShadow:"0 1px 2px rgba(0,0,0,0.3)"},children:["#",t.adId.slice(-8)]})]}),t.format==="video"&&r&&e.jsx("span",{style:{position:"absolute",bottom:8,right:8,background:"rgba(0,0,0,0.7)",color:"#fff",fontSize:10,fontWeight:700,padding:"2px 6px",borderRadius:4},children:"â¶ VIDEO"}),e.jsx("span",{style:{position:"absolute",top:8,left:8,background:o.color,color:"#fff",fontSize:10,fontWeight:800,padding:"3px 8px",borderRadius:4,letterSpacing:"0.04em"},children:o.label})]})}const Se=["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"];function Ce(t){if(!t)return null;const a=new Date(t);return Number.isFinite(a.getTime())?`${a.getDate()} ${Se[a.getMonth()]}`:null}function ke({item:t}){const a=[],o=Ce(t.createdAt);return o&&a.push(`creado ${o}`),t.cpm>0&&(t.cpm>15e3?a.push(`CPM alto $${(t.cpm/1e3).toFixed(1)}k`):t.cpm<4e3&&a.push(`CPM bajo $${(t.cpm/1e3).toFixed(1)}k`)),a.length===0?null:e.jsx("div",{style:{fontSize:10.5,color:"var(--text-muted)",marginTop:4,fontStyle:"italic"},children:a.join(" · ")})}function T({label:t,value:a,accent:o}){return e.jsxs("div",{style:{background:"var(--bg-tertiary)",borderRadius:6,padding:"5px 8px",textAlign:"center"},children:[e.jsx("div",{style:{fontSize:9.5,color:"var(--text-muted)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:1},children:t}),e.jsx("div",{style:{fontSize:12.5,fontWeight:800,color:o||"var(--text-primary)"},children:a})]})}function ze({item:t,onClose:a}){const o=te[t.fatigueLevel],r=B[t.platform],[d,n]=l.useState(!1),[s,c]=l.useState(null),f=(t.conversations||0)>0&&(t.purchases||0)===0,h=t.platform==="meta"&&t.videoId?`https://www.facebook.com/video/embed?video_id=${t.videoId}`:null;return e.jsx("div",{onClick:a,style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.55)",zIndex:9990,display:"flex",alignItems:"center",justifyContent:"center",padding:20},children:e.jsxs("div",{onClick:m=>m.stopPropagation(),style:{background:"var(--bg-card)",borderRadius:16,maxWidth:720,width:"100%",maxHeight:"90vh",overflowY:"auto",padding:24,position:"relative"},children:[e.jsx("button",{onClick:a,style:{position:"absolute",top:12,right:12,width:32,height:32,border:"none",background:"transparent",curs
2or:"pointer",fontSize:22,color:"var(--text-muted)",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"inherit"},children:"Ã"}),e.jsxs("div",{style:{display:"flex",gap:8,marginBottom:12,alignItems:"center",flexWrap:"wrap"},children:[e.jsx("span",{style:{background:r.color,color:"#fff",fontSize:11,fontWeight:800,padding:"4px 10px",borderRadius:6},children:r.label}),e.jsxs("span",{style:{background:o.bg,color:o.fg,fontSize:11,fontWeight:800,padding:"4px 10px",borderRadius:6},children:[o.emoji," ",o.label]}),t.status&&e.jsx("span",{style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)",fontSize:11,fontWeight:700,padding:"4px 10px",borderRadius:6},children:t.status})]}),e.jsx("h2",{className:"censor-blur",style:{fontSize:18,fontWeight:800,margin:"0 0 4px",color:"var(--text-primary)",lineHeight:1.3},children:t.adName||"(sin nombre)"}),e.jsxs("div",{className:"censor-blur",style:{fontSize:12.5,color:"var(--text-muted)",marginBottom:18},children:[t.accountName," · ",t.campaignName||"â",t.adsetName?` · ${t.adsetName}`:""]}),h?e.jsx("div",{style:{position:"relative",aspectRatio:s?String(s):"16/9",maxHeight:"62vh",margin:"0 auto 16px",width:s&&s<1?"auto":"100%",height:s&&s<1?"62vh":void 0,background:"#0F172A",borderRadius:10,overflow:"hidden"},children:d?e.jsx("iframe",{src:h+"&autoplay=1",style:{width:"100%",height:"100%",border:"none",background:"#0F172A"},allow:"autoplay; encrypted-media",allowFullScreen:!0,title:t.adName}):e.jsxs("button",{type:"button",onClick:m=>{m.stopPropagation(),n(!0)},"aria-label":"Reproducir "+(t.adName||"el video"),style:{position:"absolute",inset:0,width:"100%",height:"100%",padding:0,border:"none",cursor:"pointer",background:"#0F172A",display:"grid",placeItems:"center",fontFamily:"inherit"},children:[t.thumbnail&&e.jsx("img",{src:t.thumbnail,alt:"",onLoad:m=>{const S=m.currentTarget;S.naturalWidth>0&&S.naturalHeight>0&&c(S.naturalWidth/S.naturalHeight)},style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"contain"}}),e.jsx("span",{style:{position:"relative",display:"grid",placeItems:"center",width:62,height:62,borderRadius:"50%",background:"rgba(15,23,42,.72)",border:"2px solid rgba(255,255,255,.85)",color:"#fff"},children:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:e.jsx("path",{d:"M8 5v14l11-7z"})})})]})}):t.thumbnail?e.jsx("img",{src:t.thumbnail,alt:t.adName,style:{width:"100%",maxHeight:"62vh",objectFit:"contain",background:"#0F172A",borderRadius:10,marginBottom:16}}):e.jsx("div",{style:{aspectRatio:"16/9",background:"#0F172A",borderRadius:10,marginBottom:16,display:"flex",alignItems:"center",justifyContent:"center",color:"#475569",fontSize:48},children:t.format==="video"?"ð¬":"ð¼"}),t.fatigueLevel!=="fresh"&&t.fatigueLevel!=="unknown"&&e.jsxs("div",{style:{background:o.bg,color:o.fg,padding:"12px 14px",borderRadius:10,fontSize:13.5,lineHeight:1.5,fontWeight:600,marginBottom:16},children:[o.emoji," ",e.jsxs("b",{children:[o.label,"."]})," ",t.fatigueAction]}),t.platform==="meta"&&(t.cta||t.body||t.headline)&&e.jsxs("div",{style:{background:"rgba(99,102,241,0.05)",border:"1px solid rgba(99,102,241,0.20)",borderRadius:10,padding:"12px 14px",marginBottom:16,display:"flex",flexDirection:"column",gap:10},children:[t.cta&&e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:10.5,fontWeight:700,color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:3},children:"ð¯ Llamado a la acción"}),e.jsx("div",{children:e.jsx("span",{style:{background:"rgba(99,102,241,0.18)",color:"#4F46E5",fontSize:13,fontWeight:700,padding:"4px 12px",borderRadius:6},children:ee(t.cta)})})]}),t.headline&&e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:10.5,fontWeight:700,color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:3},children:"Titular"}),e.jsx("div",{style:{fontSize:14,fontWeight:700,color:"var(--text-primary)",lineHeight:1.4},children:t.headline})]}),t.body&&e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:10.5,fontWeight:700,color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:3},children:"ð Copy"}),e.jsxs("div",{style:{fontSize:13,color:"var(--text-secondary)",lineHeight:1.55,fontStyle:"italic",whiteSpace:"pre-wrap"},children:['"',t.body,'"']})]})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(120px, 1fr))",gap:8,marginBottom:16},children:[e.jsx(y,{label:"Gasto",value:j(t.spend)}),e.jsx(y,{label:"Impresiones",value:A(t.impressions)}),e.jsx(y,{label:"Clics al enlace",value:A(t.clicks),accent:Fe(t.clicks)}),e.jsx(y,{label:"CTR del enlace",value:`${t.ctr.toFixed(2)}%`,accent:ae(t.ctr)}),e.jsx(y,{label:"CPM",value:j(t.cpm),accent:oe(t.cpmUsd)}),e.jsx(y,{label:"CPC",value:j(t.cpc)}),e.jsx(y,{label:"Frecuencia",value:t.frequency.toFixed(2),accent:ie(t.frequency)}),f?e.jsxs(e.Fragment,{children:[e.jsx(y,{label:"Conversaciones",value:A(t.conversations),accent:R}),e.jsx(y,{label:"Costo por conversación",value:t.conversations>0?j(t.spend/t.conversations):"â"})]}):e.jsxs(e.Fragment,{children:[e.jsx(y,{label:"Compras",value:A(t.purchases)}),e.jsx(y,{label:"Vendido",value:j(t.revenue)}),e.jsx(y,{label:"ROAS",value:t.roas>0?`${t.roas.toFixed(2)}x`:"â",accent:t.roas>=2?R:t.roas>=1?z:N})]})]}),e.jsx("div",{style:{display:"flex",gap:8,flexWrap:"wrap",justifyContent:"center"},children:t.link&&e.jsx("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",style:{padding:"10px 18px",fontSize:13,fontWeight:700,background:"linear-gradient(135deg, #6366F1, #A855F7)",color:"#fff",border:"none",borderRadius:10,textDecoration:"none"},children:t.platform==="meta"?"Ver post original â":"Ver en TikTok Ads Manager â"})})]})})}const R="#059669",N="#DC2626",z=void 0;function ae(t){return t?t>=2?R:t<1?N:z:z}function oe(t){return t?t<=2?R:t>5?N:z:z}function ie(t){return t?t<=1.8?R:t>3?N:z:z}function Fe(t){return t?z:N}function y({label:t,value:a,accent:o}){return e.jsxs("div",{style:{background:"var(--bg-tertiary)",borderRadius:8,padding:"10px 12px",textAlign:"center"}
2,children:[e.jsx("div",{style:{fontSize:10,color:"var(--text-muted)",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:4},children:t}),e.jsx("div",{style:{fontSize:15,fontWeight:800,color:o||"var(--text-primary)"},children:a})]})}const ne={padding:"8px 12px",fontSize:12.5,fontWeight:600,background:"var(--bg-tertiary)",color:"var(--text-primary)",border:"1px solid var(--border)",borderRadius:8,fontFamily:"inherit",cursor:"pointer"};function Te({platform:t,setPlatform:a}){const o=Z(),[r,d]=l.useState(null),[n,s]=l.useState(!1),[c,f]=l.useState(null),[h,m]=l.useState(14),[S,W]=l.useState(null),$=async()=>{s(!0),f(null),d(null);try{const g=await o(`/api/creatives/ai-insights?platform=${t}&days=${h}`),u=await g.json().catch(()=>({}));if(!g.ok&&g.status!==200)throw new Error((u==null?void 0:u.message)||(u==null?void 0:u.error)||`HTTP ${g.status}`);d(u)}catch(g){f((g==null?void 0:g.message)||"Error generando análisis")}finally{s(!1)}},C=async(g,u)=>{try{await navigator.clipboard.writeText(g),W(u),setTimeout(()=>W(null),1500)}catch{}};return e.jsxs("div",{className:"ai-gen-panel",style:{paddingBottom:40},children:[e.jsx("style",{children:` 3 @media (max-width: 480px) { 4 .ai-gen-panel section, 5 .ai-gen-panel .ai-gen-card { padding: 12px 12px !important; } 6 .ai-gen-panel .ai-gen-section-title { font-size: 12.5px !important; } 7 .ai-gen-panel .ai-gen-avatar-tabs button { padding: 6px 10px !important; font-size: 11.5px !important; } 8 .ai-gen-panel .ai-gen-product-desc { font-size: 12.5px !important; line-height: 1.55 !important; } 9 .ai-gen-panel .ai-gen-copy-block { font-size: 12px !important; } 10 .ai-gen-panel .ai-gen-copy-block button { padding: 3px 7px !important; font-size: 10px !important; } 11 } 12 `}),e.jsxs("div",{style:{display:"flex",gap:10,flexWrap:"wrap",marginBottom:18,justifyContent:"center",alignItems:"center"},children:[["meta","tiktok"].map(g=>{const u=B[g],k=t===g;return e.jsx("button",{onClick:()=>a(g),style:{padding:"8px 18px",fontSize:13,fontWeight:800,fontFamily:"inherit",background:k?u.color:"var(--bg-tertiary)",color:k?"#fff":"var(--text-primary)",border:`1px solid ${k?u.color:"var(--border)"}`,borderRadius:8,cursor:"pointer"},children:u.label},g)}),e.jsxs("select",{value:h,onChange:g=>m(parseInt(g.target.value,10)),style:ne,children:[e.jsx("option",{value:7,children:"Ãltimos 7 dÃas"}),e.jsx("option",{value:14,children:"Ãltimos 14 dÃas"}),e.jsx("option",{value:30,children:"Ãltimos 30 dÃas"})]}),e.jsx("button",{onClick:$,disabled:n,className:!n&&r?"btn-ai-regen":"",style:{padding:"10px 22px",fontSize:13.5,fontWeight:800,fontFamily:"inherit",background:n?"var(--bg-tertiary)":r?"linear-gradient(120deg, #6366F1, #A855F7, #EC4899, #A855F7, #6366F1)":"linear-gradient(135deg, #6366F1, #A855F7)",backgroundSize:!n&&r?"300% 100%":"100% 100%",color:"#fff",border:"none",borderRadius:10,cursor:n?"not-allowed":"pointer",opacity:n?.7:1,transition:"transform 0.15s"},children:n?"Analizandoâ¦":r?"Volver a generar":"⨠Generar análisis IA"}),e.jsx("style",{children:` 13 .btn-ai-regen { 14 animation: ai-regen-shimmer 3s linear infinite; 15 } 16 .btn-ai-regen:hover { 17 transform: translateY(-1px); 18 box-shadow: 0 4px 20px rgba(168,85,247,0.40); 19 } 20 @keyframes ai-regen-shimmer { 21 0% { background-position: 0% 50%; } 22 100% { background-position: 300% 50%; } 23 } 24 `})]}),n&&e.jsxs("div",{style:{background:"var(--bg-card)",border:"1px dashed rgba(99,102,241,0.30)",borderRadius:14,padding:40,textAlign:"center",marginBottom:16},children:[e.jsx("svg",{width:"44",height:"44",viewBox:"0 0 24 24",fill:"none",stroke:"#6366F1",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{animation:"spin 1.2s linear infinite",display:"block",margin:"0 auto 14px"},children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),e.jsx("div",{style:{fontSize:14,fontWeight:700,color:"var(--text-primary)",marginBottom:4},children:"La IA está analizando tus creativos"}),e.jsxs("div",{style:{fontSize:12,color:"var(--text-muted)",lineHeight:1.5},children:["Identificando tus avatares · escribiendo anuncios por nivel · armando estructura",e.jsx("br",{}),e.jsx("span",{style:{fontSize:11,fontStyle:"italic"},children:"Esto toma 20-40 segundos"})]})]}),c&&e.jsxs("div",{style:{background:"rgba(239,68,68,0.10)",border:"1px solid rgba(239,68,68,0.30
24)",color:"#B91C1C",borderRadius:10,padding:14,marginBottom:16,textAlign:"center",fontSize:13},children:["â ",c]}),!n&&r&&r.error&&e.jsx("div",{style:{background:"rgba(245,158,11,0.10)",border:"1px solid rgba(245,158,11,0.30)",color:"#B45309",borderRadius:10,padding:14,marginBottom:16,textAlign:"center",fontSize:13},children:r.message||r.error}),!n&&r&&r.insights&&r.stats&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:12,padding:14,marginBottom:18,fontSize:12.5,display:"flex",gap:16,justifyContent:"center",flexWrap:"wrap",color:"var(--text-muted)"},children:[e.jsxs("span",{children:[e.jsx("b",{style:{color:"var(--text-primary)"},children:r.stats.totalAds})," creativos"]}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:[e.jsx("b",{style:{color:"var(--text-primary)"},children:r.stats.totalPurchases})," compras"]}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:[r.stats.videoCount," videos / ",r.stats.imageCount," imágenes"]})]}),e.jsx(P,{title:"ð Lo que la IA ve en tu cuenta",accent:"#6366F1",children:e.jsx("div",{className:"ai-gen-product-desc",style:{fontSize:13.5,color:"var(--text-primary)",lineHeight:1.6},children:r.insights.productDescription})}),e.jsx(Ae,{avatars:r.insights.avatars,copyText:C,copied:S}),e.jsxs(P,{title:"ð Estructura recomendada",accent:"#6366F1",children:[e.jsxs("div",{style:{display:"grid",gap:10,gridTemplateColumns:"repeat(auto-fit, minmax(min(100%, 240px), 1fr))",marginBottom:14},children:[e.jsxs("div",{style:{background:"var(--bg-tertiary)",border:"1px solid var(--border)",borderRadius:10,padding:"14px 16px"},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:8},children:e.jsx("span",{style:{background:"rgba(148,163,184,0.20)",color:"#64748B",fontSize:10,fontWeight:800,padding:"2px 8px",borderRadius:4,textTransform:"uppercase",letterSpacing:"0.06em"},children:"Ahora"})}),e.jsx("div",{style:{fontSize:13,color:"var(--text-primary)",lineHeight:1.55},children:r.insights.structure.currentSummary})]}),e.jsxs("div",{style:{background:"linear-gradient(135deg, rgba(99,102,241,0.10), rgba(168,85,247,0.10))",border:"1px solid rgba(99,102,241,0.40)",borderRadius:10,padding:"14px 16px",position:"relative"},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:8},children:e.jsx("span",{style:{background:"linear-gradient(135deg, #6366F1, #A855F7)",color:"#fff",fontSize:10,fontWeight:800,padding:"2px 8px",borderRadius:4,textTransform:"uppercase",letterSpacing:"0.06em"},children:"⨠Recomendado"})}),e.jsx("div",{style:{fontSize:14,fontWeight:800,color:"var(--text-primary)",lineHeight:1.4,marginBottom:6},children:r.insights.structure.recommendation})]})]}),e.jsxs("div",{style:{background:"var(--bg-card)",border:"1px solid var(--border)",borderLeft:"3px solid #6366F1",borderRadius:8,padding:"12px 14px"},children:[e.jsx("div",{style:{fontSize:10.5,color:"#6366F1",fontWeight:800,textTransform:"uppercase",letterSpacing:"0.06em",marginBottom:5},children:"ð¡ Por qué este cambio"}),e.jsx("div",{style:{fontSize:12.5,color:"var(--text-primary)",lineHeight:1.55},children:r.insights.structure.rationale})]})]}),e.jsx(P,{title:"ð¨ Insights sobre tus creativos",accent:"#A855F7",children:e.jsx("div",{style:{fontSize:13,color:"var(--text-primary)",lineHeight:1.6},children:r.insights.creativeInsights})})]}),!n&&!r&&!c&&e.jsxs("div",{style:{background:"var(--bg-card)",border:"1px dashed var(--border)",borderRadius:14,padding:40,textAlign:"center",color:"var(--text-muted)",fontSize:13},children:[e.jsx("div",{style:{fontSize:40,marginBottom:10},children:"ð¤"}),e.jsx("div",{style:{fontSize:14,fontWeight:700,color:"var(--text-primary)",marginBottom:4},children:"Listo para analizar tus creativos"}),e.jsx("div",{children:'Haz click en "⨠Generar análisis IA" para empezar.'})]})]})}function Ae({avatars:t,copyText:a,copied:o}){const[r,d]=l.useState(0);if(!t||t.length===0)return null;const n=t[r]||t[0];return e.jsxs("div",{style:{background:"var(--bg-card)",border:"1px solid var(--border)",borderTop:"3px solid #EC4899",borderRadius:12,padding:"14px 16px",marginBottom:14},children:[e.jsx("div",{style:{fontSize:13.5,fontWeight:800,color:"var(--text-primary)",marginBottom:12,textAlign:"center"},children:"ð¥ Avatares + anuncios listos para Meta"}),e.jsx("div",{className:"ai-gen-avatar-tabs",style:{display:"flex",gap:6,flexWrap:"wrap",marginBottom:14,justifyContent:"center"},children:t.map((s,c)=>e.jsxs("button",{onClick:()=>d(c),style:{padding:"7px 14px",fontSize:12,fontWeight:700,fontFamily:"inherit",background:r===c?"#EC4899":"var(--bg-tertiary)",color:r===c?"#fff":"var(--text-primary)",border:`1px solid ${r===c?"#EC4899":"var(--border)"}`,borderRadius:8,cursor:"pointer",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[c+1," ",s.name.split(",")[0]||`Avatar ${c+1}`]},s.id||c))}),e.jsxs("div",{style:{background:"linear-gradient(135deg, rgba(236,72,153,0.06), rgba(168,85,247,0.06))",border:"1px solid rgba(236,72,153,0.20)",borderRadius:10,padding:"12px 14px",marginBottom:12},children:[e.jsx("div",{style:{fontSize:14,fontWeight:800,color:"var(--text-primary)",marginBottom:4},children:n.name}),e.jsx("div",{style:{fontSize:12,color:"var(--text-muted)",marginBottom:10},children:n.demographics}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:10},children:[e.jsx(M,{label:"Dolor",emoji:"ð",text:n.pain,color:"#EF4444"}),e.jsx(M,{label:"Deseo",emoji:"ð«",text:n.desire,color:"#10B981"}),e.jsx(M,{label:"Objeción",emoji:"ð¤",text:n.objection,color:"#F59E0B"})]})]}),e.jsx(D,{level:"cold",label:"FrÃo",subtitle:"Aún no sabe que tiene el problema",data:n.cold,copyText:a,copied:o,avatarId:n.id,accent:"#3B82F6"}),e.jsx(D,{level:"warm",label:"Tibio",subtitle:"Sabe que existe la solución, no la tuya",data:n.warm,copyText:a,copied:o,avatarId:n.id,accent:"#F59E0B"}
24),e.jsx(D,{level:"hot",label:"Caliente",subtitle:"Listo para comprar, solo necesita la oferta",data:n.hot,copyText:a,copied:o,avatarId:n.id,accent:"#EF4444"})]})}function M({label:t,emoji:a,text:o,color:r}){return e.jsxs("div",{style:{background:"var(--bg-card)",borderRadius:8,padding:"8px 10px",borderLeft:`3px solid ${r}`},children:[e.jsxs("div",{style:{fontSize:10.5,fontWeight:700,color:r,textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:3},children:[a," ",t]}),e.jsx("div",{style:{fontSize:12,color:"var(--text-primary)",lineHeight:1.45},children:o})]})}function D({level:t,label:a,subtitle:o,data:r,copyText:d,copied:n,avatarId:s,accent:c}){const f=h=>`${s}-${t}-${h}`;return e.jsxs("div",{style:{background:"var(--bg-tertiary)",border:"1px solid var(--border)",borderRadius:10,padding:"12px 14px",marginBottom:10},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[e.jsx("span",{style:{background:c,color:"#fff",fontSize:11,fontWeight:800,padding:"2px 10px",borderRadius:4,letterSpacing:"0.04em"},children:a}),e.jsx("span",{style:{fontSize:10.5,color:"var(--text-muted)",fontStyle:"italic"},children:o})]}),e.jsx(_,{label:"Texto principal",value:r.copy,fullValue:r.copy,copyKey:f("copy"),copied:n,copyText:d}),e.jsx(_,{label:"TÃtulo",value:r.headline,maxLen:27,copyKey:f("headline"),copied:n,copyText:d}),e.jsx(_,{label:"Descripción",value:r.description,maxLen:27,copyKey:f("descr"),copied:n,copyText:d})]})}function _({label:t,value:a,fullValue:o,maxLen:r,copyKey:d,copied:n,copyText:s}){const c=a||"",f=n===d,h=r?`${c.length}/${r}`:null,m=r?c.length>r:!1;return e.jsxs("div",{style:{marginTop:10},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8,marginBottom:4},children:[e.jsx("span",{style:{fontSize:10.5,color:"var(--text-muted)",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.06em"},children:t}),e.jsxs("div",{style:{display:"flex",gap:6,alignItems:"center"},children:[h&&e.jsx("span",{style:{fontSize:10,color:m?"#EF4444":"var(--text-muted)",fontWeight:600},children:h}),e.jsx("button",{onClick:()=>s(o||c,d),style:{padding:"3px 8px",fontSize:10.5,fontWeight:700,fontFamily:"inherit",background:f?"#10B981":"var(--bg-card)",color:f?"#fff":"var(--text-secondary)",border:"1px solid var(--border)",borderRadius:5,cursor:"pointer"},children:f?"â":"ð Copiar"})]})]}),e.jsx("div",{className:"ai-gen-copy-block",style:{background:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:6,padding:"8px 10px",fontSize:12.5,color:"var(--text-primary)",lineHeight:1.5,wordBreak:"break-word"},children:c||e.jsx("span",{style:{color:"var(--text-muted)",fontStyle:"italic"},children:"(vacÃo)"})})]})}function P({title:t,accent:a,children:o}){return e.jsxs("section",{style:{background:"var(--bg-card)",border:"1px solid var(--border)",borderTop:`3px solid ${a}`,borderRadius:12,padding:"14px 16px",marginBottom:14},children:[e.jsx("div",{className:"ai-gen-section-title",style:{fontSize:13.5,fontWeight:800,color:"var(--text-primary)",marginBottom:12,textAlign:"center"},children:t}),o]})}export{Ie as CreativesOverviewTab};
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.