PageSourceSearch

https://orne-ai-launchpad.lovable.app/assets/AdminBlogSeo-BnoKjmbY.js

js orne-ai-launchpad.lovable.app collected 2026-10-03 03:35:18 UTC 23,284 bytes, 16 lines download raw bytes

1import{c as le,ac as Pe,r as x,ai as Se,ad as $e,j as t,af as Q,ag as se,ah as qe,aH as Ee,am as G,aA as Re,ay as Ie,aB as re,Q as B,a as Ae,J as L,K as z,I as H,O as Me,L as Be,N as Te,E as Le,aC as ze,ax as I}from"./index-A3FuQDYt.js";import{A as De}from"./AdminShell-DgkNfpuj.js";import{u as Ke}from"./index-Ybl3JpUq.js";import{C as Oe}from"./check-DR6wOCf0.js";import{a as ae}from"./seo-audit-B6ZV7Tf_.js";import{B as Fe,s as Qe}from"./relatedProducts-BZ26LBLG.js";import{L as V}from"./loader-circle-CBfn6mAQ.js";import{T as ne}from"./triangle-alert-CBo_95DS.js";import"./useAdminAuth-Clekj91V.js";import"./gauge-BMhIb7vc.js";import"./activity-BfSXTgiG.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const He=le("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const Ve=le("SquareCheck",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var X="Checkbox",[Ue,$t]=Pe(X),[Ge,We]=Ue(X),de=x.forwardRef((e,r)=>{const{__scopeCheckbox:c,name:i,checked:m,defaultChecked:p,required:l,disabled:u,value:n="on",onCheckedChange:g,form:C,...N}=e,[h,b]=x.useState(null),j=Se(r,_=>b(_)),P=x.useRef(!1),S=h?C||!!h.closest("form"):!0,[v=!1,E]=$e({prop:m,defaultProp:p,onChange:g}),q=x.useRef(v);return x.useEffect(()=>{const _=h==null?void 0:h.form;if(_){const M=()=>E(q.current);return _.addEventListener("reset",M),()=>_.removeEventListener("reset",M)}},[h,E]),t.jsxs(Ge,{scope:c,state:v,disabled:u,children:[t.jsx(Q.button,{type:"button",role:"checkbox","aria-checked":A(v)?"mixed":v,"aria-required":l,"data-state":fe(v),"data-disabled":u?"":void 0,disabled:u,value:n,...N,ref:j,onKeyDown:se(e.onKeyDown,_=>{_.key==="Enter"&&_.preventDefault()}),onClick:se(e.onClick,_=>{E(M=>A(M)?!0:!M),S&&(P.current=_.isPropagationStopped(),P.current||_.stopPropagation())})}),S&&t.jsx(Xe,{control:h,bubbles:!P.current,name:i,value:n,checked:v,required:l,disabled:u,form:C,style:{transform:"translateX(-100%)"},defaultChecked:A(p)?!1:p})]})});de.displayName=X;var ue="CheckboxIndicator",me=x.forwardRef((e,r)=>{const{__scopeCheckbox:c,forceMount:i,...m}=e,p=We(ue,c);return t.jsx(qe,{present:i||A(p.state)||p.state===!0,children:t.jsx(Q.span,{"data-state":fe(p.state),"data-disabled":p.disabled?"":void 0,...m,ref:r,style:{pointerEvents:"none",...e.style}})})});me.displayName=ue;var Xe=e=>{const{control:r,checked:c,bubbles:i=!0,defaultChecked:m,...p}=e,l=x.useRef(null),u=Ke(c),n=Ee(r);x.useEffect(()=>{const C=l.current,N=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(N,"checked").set;if(u!==c&&b){const j=new Event("click",{bubbles:i});C.indeterminate=A(c),b.call(C,A(c)?!1:c),C.dispatchEvent(j)}},[u,c,i]);const g=x.useRef(A(c)?!1:c);return t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:m??g.current,...p,tabIndex:-1,ref:l,style:{...e.style,...n,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function A(e){return e==="indeterminate"}function fe(e){return A(e)?"indeterminate":e?"checked":"unchecked"}var pe=de,Je=me;const xe=x.forwardRef(({className:e,...r},c)=>t.jsx(pe,{ref:c,className:G("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...r,children:t.jsx(Je,{className:G("flex items-center justify-center text-current"),children:t.jsx(Oe,{className:"h-4 w-4"})})}));xe.displayName=pe.displayName;function Ye(e,r=[]){let c=[];function i(p,l){const u=x.createContext(l),n=c.length;c=[...c,l];function g(N){const{scope:h,children:b,...j}=N,P=(h==null?void 0:h[e][n])||u,S=x.useMemo(()=>j,Object.values(j));return t.jsx(P.Provider,{value:S,children:b})}function C(N,h){const b=(h==null?void 0:h[e][n])||u,j=x.useContext(b);if(j)return j;if(l!==void 0)return l;throw new Error(`\`${N}\` must be used within \`${p}\``)}return g.displayName=p+"Provider",[g,C]}const m=()=>{const p=c.map(l=>x.createContext(l));return function(u){const n=(u==null?void 0:u[e])||p;return x.useMemo(()=>({[`__scope${e}`]:{...u,[e]:n}}),[u,n])}};return m.scopeName=e,[i,Ze(m,...r)]}function Ze(...e){const r=e[0];if(e.length===1)return r;const c=()=>{const i=e.map(m=>({useScope:m(),scopeName:m.scopeName}));return function(p){const l=i.reduce((u,{useScope:n,scopeName:g})=>{const N=n(p)[`__scope${g}`];return{...u,...N}},{});return x.useMemo(()=>({[`__scope${r.scopeName}`]:l}),[l])}};return c.scopeName=r.scopeName,c}var J="Progress",Y=100,[et,qt]=Ye(J),[tt,st]=et(J),he=x.forwardRef((e,r)=>{const{__scopeProgress:c,value:i=null,max:m,getValueLabel:p=rt,...l}=e;(m||m===0)&&!oe(m)&&console.error(at(`${m}`,"Progress"));const u=oe(m)?m:Y;i!==null&&!ie(i,u)&&console.error(nt(`${i}`,"Progress"));const n=ie(i,u)?i:null,g=K(n)?p(n,u):void 0;return t.jsx(tt,{scope:c,value:n,max:u,children:t.jsx(Q.div,{"aria-valuemax":u,"aria-valuemin":0,"aria-valuenow":K(n)?n:void 0,"aria-valuetext":g,role:"progressbar","data-state":be(n,u),"data-value":n??void 0,"data-max":u,...l,ref:r})})});he.displayName=J;var ge="ProgressIndicator",ve=x.forwardRef((e,r)=>{const{__scopeProgress:c,...i}=e,m=st(ge,c);return t.jsx(Q.div,{"data-state":be(m.value,m.max),"data-value":m.value??void 0,"data-max":m.max,...i,ref:r})});ve.displayName=ge;function rt(e,r){return`${Math.round(e/r*100)}%`}function be(e,r){return e==null?"indeterminate":e===r?"complete":"loading"}function K(e){return typeof e=="number"}function oe(e){return K(e)&&!isNaN(e)&&e>0}function ie(e,r){return K(e)&&!isNaN(e)&&e<=r&&e>=0}function at(e,r){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${r}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Y}\`.`}function nt(e,r){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${r}\`. The \`value\` prop must be:
12  - a positive number
13  - less than the value passed to \`max\` (or ${Y} if no \`max\` prop is set)
14  - \`null\` or \`undefined\` if the progress is indeterminate.
15
16Defaulting to \`null\`.`}var je=he,ot=ve;const W=x.forwardRef(({className:e,value:r,...c},i)=>t.jsx(je,{ref:i,className:G("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...c,children:t.jsx(ot,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(r||0)}%)`}})}));W.displayName=je.displayName;const we="orne-faq",U=e=>e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"");function O(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function it(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function F(e){return e.replace(/<(script|style)[\s\S]*?<\/\1>/gi," ").replace(/<[^>]*>/g," ").replace(/&nbsp;/g," ").replace(/&[a-z]+;/gi," ").replace(/\s+/g," ").trim()}function ce(e){const r=F(e);
16return r?r.split(/\s+/).filter(Boolean).length:0}function ke(e){return[...e.matchAll(/<h([1-6])[^>]*>([\s\S]*?)<\/h\1>/gi)].map(r=>F(r[2]??"")).filter(Boolean)}function ct(e){return[...e.matchAll(/<img[^>]*src=["']([^"']+)["']/gi)].map(r=>r[1]??"")}function ye(e){return e.includes(we)||/<h2[^>]*>\s*Perguntas frequentes/i.test(e)}function lt(e,r=3){const c=(e.related_products||[]).map(i=>Fe.find(m=>m.slug===i)).filter(i=>!!i);return c.length?c.slice(0,r):Qe(e).filter(i=>i.score>=9).slice(0,r).map(i=>i.product)}function dt(e){return e.href??e.to??"/"}function ut(e,r){const c=e.lastIndexOf("<",r),i=e.lastIndexOf(">",r);return c>i}function mt(e,r,c=3){const i=[];if(!e||r.length===0)return{html:e,applied:i};const m=[...e.matchAll(/<p[^>]*>[\s\S]*?<\/p>/gi)].map(n=>({text:n[0],index:n.index??0}));if(m.length===0)return{html:e,applied:i};const p=new Set,l=[];for(const n of r){if(i.length>=c)break;const g=dt(n);if(e.includes(`href="${g}"`)||e.includes(`href='${g}'`))continue;const C=[n.name,...n.terms.filter(h=>h.weight>=3).map(h=>h.term)];let N=!1;for(const h of C){if(N)break;if(h.length<4)continue;const b=new RegExp(`(?<![\\w-])${it(h)}(?![\\w-])`,"i");for(let j=0;j<m.length&&!N;j++){if(p.has(j))continue;const P=m[j];if(/<a[\s>]/i.test(P.text))continue;const S=b.exec(P.text);if(!S||S.index===void 0||ut(P.text,S.index))continue;const v=S[0],E=P.index+S.index,_=g.startsWith("http")?`<a href="${g}" target="_blank" rel="noopener">${O(v)}</a>`:`<a href="${g}">${O(v)}</a>`;l.push({start:E,end:E+v.length,html:_}),p.add(j),i.push({product:n.name,anchor:v,href:g}),N=!0}}}if(l.length===0)return{html:e,applied:i};l.sort((n,g)=>g.start-n.start);let u=e;for(const n of l)u=u.slice(0,n.start)+n.html+u.slice(n.end);return{html:u,applied:i}}function ft(e){if(e.length===0)return"";const r=e.map(c=>`<h3>${O(c.q)}</h3><p>${O(c.a)}</p>`).join("");return`<h2 id="${we}">Perguntas frequentes</h2>${r}`}function pt(e,r){const c=ce(e),i=ce(r);
16if(i<c)return{ok:!1,reason:`texto ficaria menor (${c} para ${i} palavras)`};for(const l of ct(e))if(!r.includes(l))return{ok:!1,reason:"uma imagem do post desapareceria"};const m=U(F(r));for(const l of ke(e))if(!m.includes(U(l)))return{ok:!1,reason:`o subtítulo "${l}" desapareceria`};const p=[...e.matchAll(/<p[^>]*>([\s\S]*?)<\/p>/gi)].map(l=>F(l[1]??"")).filter(l=>l.length>40);for(const l of p){const u=U(l).slice(0,40);if(u&&!m.includes(u))return{ok:!1,reason:"um parágrafo original desapareceria"}}return{ok:!0}}function xt(e,r,c){const i=e??"",{html:m,applied:p}=mt(i,c),l=r.length>0&&!ye(i),u=l?ft(r):"",n=u?`${m}${u}`:m,g=pt(i,n);return{content:g.ok?n:i,changed:g.ok&&n!==i,faqAdded:l?r.length:0,links:p,integrity:g}}const ht=e=>new Promise(r=>setTimeout(r,e));function D(e){return e>=80?"text-emerald-400":e>=60?"text-amber-400":"text-destructive"}function gt(e){return e>=80?"bg-emerald-400":e>=60?"bg-amber-400":"bg-destructive"}function Et(){const{toast:e}=Re(),r=Ie(),[c,i]=x.useState(new Set),[m,p]=x.useState({}),[l,u]=x.useState(null),[n,g]=x.useState(null),[C,N]=x.useState(null),h=x.useRef(!1),{data:b=[],isLoading:j}=re({queryKey:["admin-blog-seo-posts"],queryFn:async()=>{const{data:s,error:a}=await I.from("posts").select("*").order("published_at",{ascending:!1,nullsFirst:!1});if(a)throw a;return s??[]}}),{data:P=[]}=re({queryKey:["admin-post-revisions"],queryFn:async()=>{const{data:s,error:a}=await I.from("post_revisions").select("id, post_id, created_at").order("created_at",{ascending:!1});if(a)throw a;return s??[]}}),S=x.useMemo(()=>{const s=new Map;for(const a of P)s.has(a.post_id)||s.set(a.post_id,a.id);return s},[P]),v=x.useMemo(()=>{const s=new Map;for(const a of b)s.set(a.id,ae({title:a.title,seoTitle:a.seo_title,seoDescription:a.seo_description,excerpt:a.excerpt,contentHtml:a.content,slug:a.slug,coverUrl:a.cover_image,focusKeyword:a.focus_keyword??"",relatedProducts:a.related_products}));return s},[b]),E=x.useMemo(()=>[...b].sort((s,a)=>{var d,f;return(((d=v.get(s.id))==null?void 0:d.score)??0)-(((f=v.get(a.id))==null?void 0:f.score)??0)}),[b,v]),q=x.useMemo(()=>{var T;const s=b.map(k=>{var y;return((y=v.get(k.id))==null?void 0:y.score)??0}),a=s.filter(k=>k>=80).length,d=s.filter(k=>k>=60&&k<80).length,f=s.filter(k=>k<60).length,o=s.length?Math.round(s.reduce((k,y)=>k+y,0)/s.length):0,w=new Map;for(const k of b)for(const y of((T=v.get(k.id))==null?void 0:T.items)??[])y.status!=="pass"&&w.set(y.label,(w.get(y.label)??0)+1);const $=[...w.entries()].sort((k,y)=>y[1]-k[1]).slice(0,6);return{good:a,mid:d,weak:f,average:o,topIssues:$,total:b.length}},[b,v]),_=s=>i(a=>{const d=new Set(a);return d.has(s)?d.delete(s):d.add(s),d}),M=s=>i(new Set(b.filter(a=>{var d;return(((d=v.get(a.id))==null?void 0:d.score)??0)<s}).map(a=>a.id)));async function Z(s){const a=lt(s,3),{data:d,error:f}=await I.functions.invoke("content-enhance",{body:{title:s.title,content:s.content??"",excerpt:s.excerpt??"",seoTitle:s.seo_title??"",seoDescription:s.seo_description??"",focusKeyword:s.focus_keyword??"",slug:s.slug,headings:ke(s.content??""),products:a.map($=>$.name)}});if(f)throw f;if(d!=null&&d.error)throw new Error(d.error);const o=d,w=xt(s.content??"",o.faq??[],a);return{payload:o,result:w,products:a}}function ee(s,a,d){return ae({title:s.title,seoTitle:a.seo_title||s.seo_title,seoDescription:a.seo_description||s.seo_description,excerpt:a.excerpt||s.excerpt,contentHtml:d,slug:s.slug,coverUrl:s.cover_image,focusKeyword:a.focus_keyword||s.focus_keyword||"",relatedProducts:s.related_products}).score}const Ne=async s=>{var a;N(s.id);try{const{payload:d,result:f}=await Z(s);g({postId:s.id,title:s.title,focusKeyword:d.focus_keyword,seoTitle:d.seo_title,seoDescription:d.seo_description,excerpt:d.excerpt,faq:d.faq??[],links:f.links,integrity:f.integrity.ok?"Conteúdo original preservado integralmente.":`Bloqueado: ${f.integrity.reason}`,before:((a=v.get(s.id))==null?void 0:a.score)??0,after:ee(s,d,f.content)})}catch(d){e({title:"Não foi possível simular",description:(d==null?void 0:d.message)??"Tente novamente.",variant:"destructive"})}finally{N(null)}},_e=async()=>{var a;const s=[...c];if(s.length!==0){h.current=!1,u({total:s.length,done:0});for(let d=0;d<s.length&&!h.current;d++){const f=b.find(o=>o.id===s[d]);if(f){p(o=>({...o,[f.id]:{status:"running"}}));try{const{payload:o,result:w}=await Z(f);if(!w.integrity.ok){p(R=>({...R,[f.id]:{status:"skipped",message:w.integrity.reason}})),u(R=>R&&{...R,done:R.done+1});continue}const $=((a=v.get(f.id))==null?void 0:a.score)??0,T=ee(f,o,w.content),{error:k}=await I.from("post_revisions").insert([{post_id:f.id,title:f.title,content:f.content,excerpt:f.excerpt,seo_title:f.seo_title,seo_description:f.seo_description,focus_keyword:f.focus_keyword??null,faq:f.faq??null,source:"bulk-seo"}]);if(k)throw k;const y={content:w.content,seo_score:T};o.focus_keyword&&(y.focus_keyword=o.focus_keyword),o.seo_title&&(y.seo_title=o.seo_title),o.seo_description&&(y.seo_description=o.seo_de
16scription),o.excerpt&&(f.excerpt??"").trim().length<60&&(y.excerpt=o.excerpt),(o.faq??[]).length&&(y.faq=o.faq);const{error:te}=await I.from("posts").update(y).eq("id",f.id);if(te)throw te;p(R=>({...R,[f.id]:{status:"done",before:$,after:T}}))}catch(o){p(w=>({...w,[f.id]:{status:"error",message:(o==null?void 0:o.message)??"Falha inesperada."}}))}u(o=>o&&{...o,done:o.done+1}),await ht(1200)}}await r.invalidateQueries({queryKey:["admin-blog-seo-posts"]}),await r.invalidateQueries({queryKey:["admin-post-revisions"]}),await r.invalidateQueries({queryKey:["posts"]}),u(null),i(new Set),e({title:"Varredura concluída",description:"Confira o resultado post a post."})}},Ce=async s=>{const a=S.get(s.id);if(!a||!window.confirm(`Restaurar a versão anterior de "${s.title}"?`))return;const{data:d,error:f}=await I.from("post_revisions").select("*").eq("id",a).maybeSingle();if(f||!d){e({title:"Versão anterior não encontrada",variant:"destructive"});return}const o=d,{error:w}=await I.from("posts").update({title:o.title,content:o.content,excerpt:o.excerpt,seo_title:o.seo_title,seo_description:o.seo_description,focus_keyword:o.focus_keyword,faq:o.faq}).eq("id",s.id);if(w){e({title:"Erro ao restaurar",description:w.message,variant:"destructive"});return}await I.from("post_revisions").delete().eq("id",a),await r.invalidateQueries({queryKey:["admin-blog-seo-posts"]}),await r.invalidateQueries({queryKey:["admin-post-revisions"]}),p($=>({...$,[s.id]:{status:"idle"}})),e({title:"Versão anterior restaurada"})};return t.jsxs(De,{title:"Qualidade SEO e GEO",description:"Varredura de todos os posts com a mesma metodologia do revisor do editor, com melhoria em lote que só acrescenta conteúdo.",actions:t.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.jsxs(B,{variant:"outline",size:"sm",className:"gap-2",onClick:()=>M(80),children:[t.jsx(Ve,{className:"h-4 w-4"}),"Selecionar abaixo de 80"]}),t.jsxs(B,{size:"sm",className:"gap-2",disabled:c.size===0||l!==null,onClick:_e,children:[l?t.jsx(V,{className:"h-4 w-4 animate-spin"}):t.jsx(Ae,{className:"h-4 w-4"}),"Melhorar com IA (",c.size,")"]})]}),children:[l&&t.jsx(L,{className:"mb-6 border-primary/30 bg-card/60",children:t.jsxs(z,{className:"space-y-3 p-5",children:[t.jsxs("div",{className:"flex items-center justify-between text-sm",children:[t.jsxs("span",{children:["Processando ",l.done," de ",l.total," posts. Um por vez, para não sobrecarregar a IA."]}),t.jsx(B,{variant:"ghost",size:"sm",onClick:()=>h.current=!0,children:"Parar após o atual"})]}),t.jsx(W,{value:l.done/l.total*100})]})}),t.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[{label:"Posts analisados",value:q.total,tone:"text-foreground"},{label:"Nota média",value:q.average,tone:D(q.average)},{label:"Bons (80+)",value:q.good,tone:"text-emerald-400"},{label:"Fracos (abaixo de 60)",value:q.weak,tone:"text-destructive"}].map(s=>t.jsx(L,{className:"bg-card/50",children:t.jsxs(z,{className:"p-5",children:[t.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.25em] text-muted-foreground/70",children:s.label}),t.jsx("p",{className:`mt-2 text-3xl font-light ${s.tone}`,children:s.value})]})},s.label))}),q.topIssues.length>0&&t.jsx(L,{className:"mt-6 bg-card/50",children:t.jsxs(z,{className:"p-5",children:[t.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.25em] text-sky-400",children:"Problemas mais frequentes"}),t.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:q.topIssues.map(([s,a])=>t.jsxs(H,{variant:"outline",className:"border-border/60 font-normal",children:[s,t.jsx("span",{className:"ml-2 text-muted-foreground",children:a})]},s))})]})}),n&&t.jsx(L,{className:"mt-6 border-sky-400/30 bg-card/60",children:t.jsxs(z,{className:"space-y-4 p-5",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("p",{className:"text-sm font-medium",children:["Simulação: ",n.title]}),t.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[t.jsx("span",{className:D(n.before),children:n.before}),t.jsx(Me,{className:"h-4 w-4 text-muted-foreground"}),t.jsx("span",{className:D(n.after),children:n.after}),t.jsx(B,{variant:"ghost",size:"sm",onClick:()=>g(null),children:"Fechar"})]})]}),t.jsxs("dl",{className:"space-y-1 text-xs text-muted-foreground",children:[t.jsxs("div",{children:[t.jsx("dt",{className:"inline text-muted-foreground
16/70",children:"Palavra-chave: "}),t.jsx("dd",{className:"inline",children:n.focusKeyword||"-"})]}),t.jsxs("div",{children:[t.jsx("dt",{className:"inline text-muted-foreground/70",children:"Título SEO: "}),t.jsx("dd",{className:"inline",children:n.seoTitle||"-"})]}),t.jsxs("div",{children:[t.jsx("dt",{className:"inline text-muted-foreground/70",children:"Meta: "}),t.jsx("dd",{className:"inline",children:n.seoDescription||"-"})]}),t.jsxs("div",{children:[t.jsx("dt",{className:"inline text-muted-foreground/70",children:"Resumo: "}),t.jsx("dd",{className:"inline",children:n.excerpt||"-"})]})]}),n.faq.length>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-foreground/80",children:"Bloco de perguntas que seria acrescentado ao fim do post"}),t.jsx("ul",{className:"mt-2 space-y-2",children:n.faq.map((s,a)=>t.jsxs("li",{className:"text-xs text-muted-foreground",children:[t.jsx("span",{className:"text-foreground/75",children:s.q})," ",s.a]},a))})]}),n.links.length>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-xs text-foreground/80",children:"Links internos que seriam criados"}),t.jsx("ul",{className:"mt-2 space-y-1",children:n.links.map((s,a)=>t.jsxs("li",{className:"text-xs text-muted-foreground",children:['"',s.anchor,'" aponta para ',s.href," (",s.product,")"]},a))})]}),t.jsx("p",{className:"text-xs text-emerald-400/90",children:n.integrity})]})}),t.jsx(L,{className:"mt-6 bg-card/50",children:t.jsx(z,{className:"p-0",children:j?t.jsxs("div",{className:"flex items-center justify-center gap-2 p-10 text-sm text-muted-foreground",children:[t.jsx(V,{className:"h-4 w-4 animate-spin"}),"Analisando os posts..."]}):t.jsx("ul",{className:"divide-y divide-border/50",children:E.map(s=>{const a=v.get(s.id),d=(a==null?void 0:a.score)??0,f=((a==null?void 0:a.items)??[]).filter($=>$.status!=="pass"),o=m[s.id],w=S.has(s.id);return t.jsxs("li",{className:"flex flex-wrap items-start gap-4 p-4",children:[t.jsx(xe,{checked:c.has(s.id),onCheckedChange:()=>_(s.id),className:"mt-1","aria-label":`Selecionar ${s.title}`}),t.jsxs("div",{className:"w-16 shrink-0",children:[t.jsx("p",{className:`text-2xl font-light leading-none ${D(d)}`,children:d}),t.jsx("div",{className:"mt-2 h-1 w-full overflow-hidden rounded-full bg-foreground
16/10",children:t.jsx("div",{className:`h-full ${gt(d)}`,style:{width:`${d}%`}})})]}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx(Be,{to:`/admin/post/${s.id}/edit`,className:"truncate text-sm font-medium hover:text-primary",children:s.title}),s.status!=="published"&&t.jsx(H,{variant:"outline",className:"border-border/60 text-[10px]",children:"rascunho"}),ye(s.content??"")&&t.jsx(H,{variant:"outline",className:"border-emerald-400/40 text-[10px] text-emerald-400",children:"com FAQ"})]}),t.jsx("p",{className:"mt-1 line-clamp-1 text-xs text-muted-foreground",children:f.length===0?"Tudo em ordem.":f.map($=>$.label).join(" · ")}),(o==null?void 0:o.status)==="done"&&t.jsxs("p",{className:"mt-2 flex items-center gap-2 text-xs text-emerald-400",children:[t.jsx(Te,{className:"h-3.5 w-3.5"}),"Melhorado: ",o.before," para ",o.after]}),(o==null?void 0:o.status)==="skipped"&&t.jsxs("p",{className:"mt-2 flex items-center gap-2 text-xs text-amber-400",children:[t.jsx(ne,{className:"h-3.5 w-3.5"}),"Não aplicado (",o.message,"). Revisar à mão."]}),(o==null?void 0:o.status)==="error"&&t.jsxs("p",{className:"mt-2 flex items-center gap-2 text-xs text-destructive",children:[t.jsx(ne,{className:"h-3.5 w-3.5"}),o.message]})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[t.jsxs(B,{variant:"ghost",size:"sm",className:"gap-2",disabled:C!==null||l!==null,onClick:()=>Ne(s),children:[C===s.id?t.jsx(V,{className:"h-3.5 w-3.5 animate-spin"}):t.jsx(Le,{className:"h-3.5 w-3.5"}),"Simular"]}),w&&t.jsxs(B,{variant:"ghost",size:"sm",className:"gap-2",onClick:()=>Ce(s),children:[t.jsx(He,{className:"h-3.5 w-3.5"}),"Desfazer"]}),t.jsx(B,{variant:"ghost",size:"icon",asChild:!0,"aria-label":"Ver post no site",children:t.jsx("a",{href:`/blog/${s.slug}`,target:"_blank",rel:"noopener",children:t.jsx(ze,{className:"h-3.5 w-3.5"})})})]}),(o==null?void 0:o.status)==="running"&&t.jsx("div",{className:"w-full",children:t.jsx(W,{value:60,className:"h-1"})})]},s.id)})})})}),t.jsx("p",{className:"mt-6 text-xs text-muted-foreground",children:"A melhoria em lote nunca reescreve nem apaga o texto existente: ela acrescenta o bloco de perguntas no fim e cria links internos em trechos que já estavam escritos. Antes de gravar, cada post passa por uma checagem de integridade e a versão anterior fica guardada para desfazer."})]})}export{Et 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.