1import{b as g,j as e,S as U}from"./index-BuL9-q1n.js";function P(n){const t=[],s=n.querySelector("title");t.push({key:"title",value:s?.textContent??""}),n.querySelectorAll("meta").forEach(a=>{const o=a.getAttribute("property")||a.getAttribute("name"),l=a.getAttribute("content");!o||l==null||t.push({key:o,value:l})});const h=[];n.querySelectorAll("link[rel]").forEach(a=>{const o=a.getAttribute("rel")||"",l=a.getAttribute("href")||"";["canonical","alternate","icon","manifest"].includes(o)&&h.push({key:o,value:l})});const b=[];return n.querySelectorAll('script[type="application/ld+json"]').forEach(a=>{const o=a.textContent||"";try{b.push({raw:o,parsed:JSON.parse(o)})}catch(l){b.push({raw:o,parsed:null,error:l.message})}}),{metas:t,links:h,jsonLd:b}}function q(){return P(document)}async function z(n){const t=await T(n);return P(t)}async function T(n){const s=await(await fetch(n,{headers:{Accept:"text/html"}})).text();return new DOMParser().parseFromString(s,"text/html")}const F=/\[object Object\]|^undefined$|^null$|^NaN$/;function R(n){const t=[],s=n.querySelector("footer");if(!s)return t.push({area:"footer",rule:"<footer>-Landmark vorhanden",ok:!1,detail:"Kein <footer>-Element gefunden."}),t;t.push({area:"footer",rule:"<footer>-Landmark vorhanden",ok:!0,detail:"OK"});const h=Array.from(s.querySelectorAll("a"));t.push({area:"footer.links",rule:"Mindestens ein Link im Footer",ok:h.length>0,detail:`${h.length} Link(s) gefunden`}),h.forEach((i,f)=>{const d=i.getAttribute("href")??"",N=i.getAttribute("target"),j=(i.getAttribute("rel")??"").toLowerCase(),$=i.getAttribute("aria-label")||i.textContent?.trim()||i.querySelector("img")?.getAttribute("alt")||"",S=`#${f+1} [${($||d).slice(0,40)}]`;t.push({area:"footer.link",rule:`${S} â href gesetzt`,ok:d.length>0&&!F.test(d),detail:d||"(leer)"}),t.push({area:"footer.link",rule:`${S} â Accessible Name vorhanden`,ok:$.length>0,detail:$||"(fehlt)"}),N==="_blank"&&t.push({area:"footer.link",rule:`${S} â rel enthält noopener+noreferrer (target=_blank)`,ok:j.includes("noopener")&&(j.includes("noreferrer")||j.includes("noreferer")),detail:j||"(rel fehlt)"});const v=Array.from(i.attributes).filter(w=>F.test(w.value));t.push({area:"footer.link",rule:`${S} â keine ungültigen Attributwerte`,ok:v.length===0,detail:v.length===0?"OK":v.map(w=>`${w.name}="${w.value}"`).join(", ")})}),Array.from(s.querySelectorAll("img")).forEach((i,f)=>{const d=i.getAttribute("alt"),N=i.getAttribute("src")??"",j=`#${f+1} [${(d||N).slice(0,40)}]`;t.push({area:"footer.img",rule:`${j} â alt-Attribut vorhanden`,ok:d!==null,detail:d===null?"alt fehlt komplett":d===""?'alt="" (dekorativ)':d}),t.push({area:"footer.img",rule:`${j} â src gesetzt`,ok:N.length>0&&!F.test(N),detail:N||"(leer)"})});const a=s.querySelector("#pewl");t.push({area:"provenExpert",rule:"Widget-Container #pewl vorhanden",ok:a!==null,detail:a?"OK":'Kein <div id="pewl"> im Footer'});const o=a?.closest("figure")??s.querySelector("noscript")?.closest("figure");t.push({area:"provenExpert",rule:"in semantisches <figure> eingebettet",ok:o!==null,detail:o?"OK":"Kein umschlieÃendes <figure>"});const l=o?.querySelector("figcaption");t.push({area:"provenExpert",rule:"<figcaption> mit Inhalt vorhanden",ok:!!l&&(l.textContent?.trim().length??0)>0,detail:l?.textContent?.trim()||"(fehlt)"});const x=s.querySelector('a[href*="provenexpert"]'),A=s.querySelector("noscript");let p=null,y=null;if(A?.textContent)try{p=new DOMParser().parseFromString(`<div>${A.textContent}</div>`,"text/html").querySelector('a[href*="provenexpert"]'),y=p?.querySelector("img")??null}catch{}const m=x??p,E=x?"sichtbarer Link":p?"noscript-Fallback":null;if(t.push({area:"provenExpert",rule:"ProvenExpert-Link (sichtbar oder noscript-Fallback) vorhanden",ok:m!==null,detail:m?`${E}: ${m.getAttribute("href")??""}`:"Kein Link mit href*=provenexpert gefunden."}),!m)return t;const k=(m.getAttribute("rel")??"").toLowerCase();t.push({area:"provenExpert",rule:"rel enthält noopener, noreferrer und nofollow",ok:["noopener","noreferrer","nofollow"].every(i=>k.includes(i)),detail:k||"(rel fehlt)"}),t.push({area:"provenExpert",rule:"target=_blank gesetzt",ok:m.getAttribute("target")==="_blank",detail
1:m.getAttribute("target")??"(fehlt)"});const C=x?.getAttribute("aria-label")?.trim()||x?.textContent?.trim()||p?.getAttribute("aria-label")?.trim()||"";t.push({area:"provenExpert",rule:"Accessible Name beschreibend (>= 10 Zeichen)",ok:C.length>=10,detail:C||"(fehlt)"});const O=(x??p)?.getAttribute("title")??"";t.push({area:"provenExpert",rule:"title-Attribut vorhanden",ok:O.trim().length>0,detail:O||"(fehlt)"});const c=y??x?.querySelector("img");if(!c)t.push({area:"provenExpert",rule:"Siegel-Bild vorhanden",ok:!1,detail:"Kein <img> im Link"});else{const i=c.getAttribute("alt")??"";t.push({area:"provenExpert",rule:"Bild-alt beschreibend (>= 10 Zeichen)",ok:i.trim().length>=10,detail:i||"(fehlt)"}),t.push({area:"provenExpert",rule:"loading=lazy gesetzt",ok:c.getAttribute("loading")==="lazy",detail:c.getAttribute("loading")??"(fehlt)"}),t.push({area:"provenExpert",rule:"decoding=async gesetzt",ok:c.getAttribute("decoding")==="async",detail:c.getAttribute("decoding")??"(fehlt)"}),t.push({area:"provenExpert",rule:"width & height gesetzt (CLS-Schutz)",ok:!!c.getAttribute("width")&&!!c.getAttribute("height"),detail:`${c.getAttribute("width")??"?"}x${c.getAttribute("height")??"?"}`});const f=Array.from(c.attributes).filter(d=>F.test(d.value));t.push({area:"provenExpert",rule:"Bild ohne ungültige Attributwerte",ok:f.length===0,detail:f.length===0?"OK":f.map(d=>`${d.name}="${d.value}"`).join(", ")})}return t}function V(n){for(const t of n.jsonLd){const s=t.parsed;if(s&&s["@type"]==="VideoObject")return s}return null}function D(n,t){return n.metas.find(s=>s.key===t)?.value}function _(n){return Array.isArray(n)?n.map(String):typeof n=="string"?[n]:[]}function W(n){const t=U.latestVideo,s=`https://www.youtube.com/watch?v=${t.videoId}`,h=`https://www.youtube.com/embed/${t.videoId}`,b=`https://i.ytimg.com/vi/${t.videoId}/maxresdefault.jpg`,a=V(n),o=[],l=(A,p,y,m,E)=>{const k=y??"(fehlt)";o.push({field:A,expected:p,actual:k,source:m,ok:y!==void 0&&y===p,note:E})};l("title",t.title,a?.name,"VideoObject.name");const x=_(a?.thumbnailUrl);return l("thumbnailUrl",b,x[0],"VideoObject.thumbnailUrl[0]",x.length>1?`+${x.length-1} weitere`:void 0),l("uploadDate",t.uploadDate,a?.uploadDate,"VideoObject.uploadDate"),l("embedUrl",h,a?.embedUrl,"VideoObject.embedUrl"),l("embedUrl",h,D(n,"twitter:player"),"meta[twitter:player]"),l("watchUrl",s,a?.contentUrl,"VideoObject.contentUrl"),l("watchUrl",s,D(n,"og:video"),"meta[og:video]"),l("watchUrl",s,D(n,"og:video:url"),"meta[og:video:url]"),l("watchUrl",s,D(n,"og:video:secure_url"),"meta[og:video:secure_url]"),o}function J(){const[n,t]=g.useState(null),[s,h]=g.useState("/"),[b,a]=g.useState("/"),[o,l]=g.useState(null),[x,A]=g.useState(!1),[p,y]=g.useState(null),[m,E]=g.useState("/"),[k,C]=g.useState(null),[O,c]=g.useState(!1),[i,f]=g.useState(null);g.useEffect(()=>{t(q())},[]),g.useEffect(()=>{d("/"),N("/")},[]);async function d(r){A(!0),y(null);try{const u=r===window.location.pathname?q():await z(r);l(u)}catch(u){y(u.message),l(null)}finally{A(!1)}}async function N(r){c(!0),f(null);try{const u=r===window.location.pathname?document:await T(r);C(R(u))}catch(u){f(u.message),C(null)}finally{c(!1)}}if(!n)return e.jsx("div",{className:"p-8",children:"Lade Head-Informationenâ¦"});const j=n.metas.filter(r=>r.key.startsWith("og:")),$=n.metas.filter(r=>r.key.startsWith("twitter:")),S=n.metas.filter(r=>!r.key.startsWith("og:")&&!r.key.startsWith("twitter:")),v=o?W(o):[],w=v.filter(r=>!r.ok).length,I=o?V(o):null;return e.jsxs("main",{className:"mx-auto max-w-5xl px-4 py-10",children:[e.jsx("h1",{className:"text-3xl font-bold text-primary",children:"SEO Debug"}),e.jsxs("p",{className:"mt-2 text-sm text-foreground/70",children:["Prüft Head-Tags, JSON-LD und Konsistenz der YouTube-Video-Metadaten. Per"," ",e.jsx("code",{children:"noindex"})," ausgeschlossen."]}),e.jsxs("section",{className:"mt-6 rounded-lg border-2 border-primary/30 bg-card p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsx("h2",{className:"text-xl font-bold text-primary",children:"Konsistenz-Check: VideoObject â OG-Tags â SITE.latestVideo"}),e.jsx("span",{className:`rounded px-2 py-0.5 text-xs font-bold ${w===0?"bg-green-100 text-green-900":"bg-red-100 text-red-900"}`,children:x?"prüfeâ¦":w===0?`OK · ${v.length} Felder`:`${w} Abweichung(en)`})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[e.jsx("label",{className:"text-sm font-semibold",children:"Quell-Seite:"}),e.jsx("input",{value:b,onChange:r=>a(r.target.value),className:"flex-1 rounded border border-border bg-background px-2 py-1 text-sm"}),e.jsx("button",{onClick:()=>d(b),className:"rounded bg-primary px-3 py-1 text-sm font-semibold text-primary-foreground",children:"Prüfen"})]}),p&&e.jsxs("p",{className:"mt-3 rounded bg-red-100 p-2 text-sm text-red-900",children:["Fehler beim Laden: ",p]}),o&&!I&&e.jsxs("p",{className:"mt-3 rounded bg-yellow-100 p-2 text-sm text-yellow-900",children:["Auf ",e.jsx("code",{children:b})," wurde kein ",e.jsx("code",{children:"VideoObject"}),"-JSON-LD gefunden â Konsistenz-Check nicht aussagekräftig."]}),v.length>0&&e.jsx("div",{className:"mt-4 overflow-x-auto rounded-md border border-border",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-muted text-left text-xs uppercase",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-3 py-2",children:"Status"}),e.jsx("th",{className:"px-3 py-2",children:"Feld"}),e.jsx("th",{className:"px-3 py-2",children:"Quelle"}),e.jsx("th",{className:"px-3 py-2",children:"Erwartet (SITE)"}),e.jsx("th",{className:"px-3 py-2",children:"Tatsächlich"})]})}),e.jsx("tbody",{children:v.map((r,u)=>e.jsxs("tr",{className:`border-t border-border ${r.ok?"bg-green-50":"bg-red-50"}`,children:[e.jsx("td",{className:"px-3 py-2 align-top",children:e.jsx("span",{className:`inline-block rounded px-2 py-0.5 text-xs font-bold ${r.ok?"bg-green-200 text-green-900":"bg-red-200 text-red-900"}`,children:r.ok?"OK":"DIFF"})}),e.jsx("td",{className:"px-3 py-2 align-top font-mono text-xs",children:r.field}),e.jsx("td",{className:"px-3 py-2 align-top font-mono text-xs",children:r.source}),e.jsx("td",{className:"px-3 py-2 align-top break-all font-mono text-xs",children:r.expected}),e.jsxs("td",{className:`px-3 py-2 align-top break-all font-mono text-xs ${r.ok?"":"font-bold text-red-900"}`,children:[r.actual,r.note&&e.jsxs("span",{className:"ml-2 text-foreground
1/60",children:["(",r.note,")"]})]})]},u))})]})})]}),e.jsxs("section",{className:"mt-6 rounded-lg border-2 border-primary/30 bg-card p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsx("h2",{className:"text-xl font-bold text-primary",children:"Footer- & ProvenExpert-Validator"}),e.jsx(M,{loading:O,checks:k})]}),e.jsxs("p",{className:"mt-1 text-xs text-foreground/70",children:["Prüft ",e.jsx("code",{children:"<footer>"}),"-Links und das ProvenExpert-Siegel auf ungültige Attribute, korrektes ",e.jsx("code",{children:"rel"}),"/",e.jsx("code",{children:"aria-label"}),"/",e.jsx("code",{children:"alt"})," sowie semantische ",e.jsx("code",{children:"<figure>"}),"-Struktur."]}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[e.jsx("label",{className:"text-sm font-semibold",children:"Quell-Seite:"}),e.jsx("input",{value:m,onChange:r=>E(r.target.value),className:"flex-1 rounded border border-border bg-background px-2 py-1 text-sm"}),e.jsx("button",{onClick:()=>N(m),className:"rounded bg-primary px-3 py-1 text-sm font-semibold text-primary-foreground",children:"Prüfen"})]}),i&&e.jsxs("p",{className:"mt-3 rounded bg-red-100 p-2 text-sm text-red-900",children:["Fehler: ",i]}),k&&k.length>0&&e.jsx("div",{className:"mt-4 overflow-x-auto rounded-md border border-border",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-muted text-left text-xs uppercase",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-3 py-2",children:"Status"}),e.jsx("th",{className:"px-3 py-2",children:"Bereich"}),e.jsx("th",{className:"px-3 py-2",children:"Regel"}),e.jsx("th",{className:"px-3 py-2",children:"Detail"})]})}),e.jsx("tbody",{children:k.map((r,u)=>e.jsxs("tr",{className:`border-t border-border ${r.ok?"bg-green-50":"bg-red-50"}`,children:[e.jsx("td",{className:"px-3 py-2 align-top",children:e.jsx("span",{className:`inline-block rounded px-2 py-0.5 text-xs font-bold ${r.ok?"bg-green-200 text-green-900":"bg-red-200 text-red-900"}`,children:r.ok?"OK":"FAIL"})}),e.jsx("td",{className:"px-3 py-2 align-top font-mono text-xs",children:r.area}),e.jsx("td",{className:"px-3 py-2 align-top text-xs",children:r.rule}),e.jsx("td",{className:`px-3 py-2 align-top break-all font-mono text-xs ${r.ok?"":"font-bold text-red-900"}`,children:r.detail})]},u))})]})})]}),e.jsxs("div",{className:"mt-8 flex flex-wrap items-center gap-2 rounded-md border border-border bg-card p-3",children:[e.jsx("label",{className:"text-sm font-semibold",children:"Andere Route öffnen:"}),e.jsx("input",{value:s,onChange:r=>h(r.target.value),className:"flex-1 rounded border border-border bg-background px-2 py-1 text-sm"}),e.jsx("a",{href:s,className:"rounded bg-primary px-3 py-1 text-sm font-semibold text-primary-foreground",children:"Ãffnen"}),e.jsx("button",{onClick:()=>t(q()),className:"rounded border border-border px-3 py-1 text-sm",children:"Neu einlesen"})]}),e.jsx(L,{title:`Open Graph (${j.length})`,children:e.jsx(K,{rows:j})}),e.jsx(L,{title:`Twitter Cards (${$.length})`,children:e.jsx(K,{rows:$})}),e.jsx(L,{title:`Sonstige Meta (${S.length})`,children:e.jsx(K,{rows:S})}),e.jsx(L,{title:`Links (${n.links.length})`,children:e.jsx(K,{rows:n.links})}),e.jsx(L,{title:`JSON-LD (${n.jsonLd.length})`,children:n.jsonLd.map((r,u)=>e.jsxs("div",{className:"mb-4 rounded-md border border-border bg-card p-3",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between text-xs",children:[e.jsxs("span",{className:"font-semibold text-primary",children:["#",u+1," ",r.parsed?`@type: ${r.parsed["@type"]??"â"}`:"PARSE ERROR"]}),r.error&&e.jsx("span",{className:"text-destructive",children:r.error})]}),e.jsx("pre",{className:"max-h-96 overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-3 text-xs",children:r.parsed?JSON.stringify(r.parsed,null,2):r.raw})]},u))})]})}function L({title:n,children:t}){return e.jsxs("section",{className:"mt-8",children:[e.jsx("h2",{className:"mb-3 text-xl font-bold text-primary",children:n}),t]})}function M({loading:n,checks:t}){if(n)return e.jsx("span",{className:"rounded bg-muted px-2 py-0.5 text-xs font-bold",children:"prüfeâ¦"});if(!t)return e.jsx("span",{className:"rounded bg-muted px-2 py-0.5 text-xs font-bold",children:"â"});const s=t.filter(h=>!h.ok).length;return e.jsx("span",{className:`rounded px-2 py-0.5 text-xs font-bold ${s===0?"bg-green-100 text-green-900":"bg-red-100 text-red-900"}`,children:s===0?`OK · ${t.length} Checks`:`${s} Fehler / ${t.length}`})}function K({rows:n}){return n.length===0?e.jsx("p",{className:"text-sm text-foreground
1/60",children:"Keine Einträge."}):e.jsx("div",{className:"overflow-x-auto rounded-md border border-border",children:e.jsx("table",{className:"w-full text-sm",children:e.jsx("tbody",{children:n.map((t,s)=>e.jsxs("tr",{className:"border-t border-border first:border-t-0",children:[e.jsx("td",{className:"w-1/3 bg-muted px-3 py-2 align-top font-mono text-xs",children:t.key}),e.jsx("td",{className:"break-all px-3 py-2 align-top",children:t.value})]},s))})})})}export{J as component};
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.