1import{g as C,h as S,k as P,r as c,d as f,aq as A,j as e,S as F,L as m,E}from"./index-B3rTWz36.js";import{u as H}from"./useMutation-CKcfiSBh.js";import{S as L}from"./SiteFooter-DjghSlDE.js";const G=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],h=C("shield-alert",G),B=S({method:"POST"}).handler(P("052114bec396cc47485a9d8217967af9f6acb60d4a789c99713ac01e716e4963"));function d(r){return r==null?"â":r.toFixed(r%1===0?0:1)}function s({label:r,value:a,accent:i}){return e.jsxs("div",{className:"rounded-md bg-[color:var(--bg-2)] px-4 py-4 text-center",children:[e.jsx("div",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:r}),e.jsx("div",{className:`mt-1.5 text-base font-semibold tabular-nums ${i?"text-[color:var(--cert-red-deep)] underline decoration-1 underline-offset-2":"text-foreground"}`,children:a})]})}function u({url:r,label:a}){return e.jsxs("figure",{className:"min-w-0",children:[e.jsx("div",{className:"relative aspect-[5/7] overflow-hidden rounded-md border border-rule bg-[color:var(--bg-2)] p-2",children:r?e.jsx("img",{src:r,alt:`${a} of the certified card`,className:"h-full w-full object-contain",loading:"lazy"}):e.jsx("div",{className:"flex h-full items-center justify-center font-mono text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:"No image"})}),e.jsx("figcaption",{className:"mt-2 text-center font-mono text-[10px] uppercase tracking-[0.18em] text-muted-foreground",children:a})]})}function b({certNumber:r,title:a}){return e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"According to the database, the requested certification number is defined as the following:"}),e.jsx("div",{className:"mt-5 inline-flex min-w-[260px] items-center justify-center rounded-md border-2 border-[color:var(--cert-red)] bg-card px-8 py-3",children:e.jsxs("span",{className:"font-mono text-sm font-semibold tracking-[0.08em] text-foreground",children:["#",r]})}),e.jsx("h2",{className:"mx-auto mt-6 max-w-2xl font-display text-2xl font-semibold uppercase leading-snug tracking-tight md:text-[1.75rem]",children:a})]})}function M({cert:r}){const a=r.scanMode!=="identify",i=r.fullGrade??r.centeringGrade,x=[r.year,r.brand,r.set,r.player,r.cardNumber?`#${r.cardNumber}`:null,r.variant].filter(Boolean).join(" ")||"CHCK certified card";return e.jsxs("div",{className:"overflow-hidden rounded-xl border border-rule bg-card px-5 py-8 md:px-10 md:py-10",children:[e.jsx(b,{certNumber:r.slug,title:x}),e.jsxs("div",{className:"mx-auto mt-8 grid max-w-lg grid-cols-2 gap-5",children:[e.jsx(u,{url:r.frontUrl,label:"Front"}),e.jsx(u,{url:r.backUrl,label:"Back"})]}),e.jsx("div",{className:"mx-auto mt-8 grid max-w-lg grid-cols-2 gap-4",children:a?e.jsxs(e.Fragment,{children:[e.jsx(s,{label:"Item grade",value:d(i)}),e.jsx(s,{label:"Centering",value:d(r.centeringGrade)}),e.jsx(s,{label:"Corners",value:d(r.cornersGrade)}),e.jsx(s,{label:"Edges",value:d(r.edgesGrade)}),e.jsx(s,{label:"Surface",value:d(r.surfaceGrade)}),e.jsx(s,{label:"Issued",value:new Date(r.issuedAt).toLocaleDateString()})]}):e.jsxs(e.Fragment,{children:[e.jsx(s,{label:"Category",value:r.category??"â"}),e.jsx(s,{label:"Issued",value:new Date(r.issuedAt).toLocaleDateString()})]})}),e.jsxs("div",{className:"mx-auto mt-8 grid max-w-lg grid-cols-1 gap-4 sm:grid-cols-2",children:[e.jsx(m,{to:"/c/$slug",params:{slug:r.slug},className:"inline-flex items-center justify-center gap-2 rounded-full bg-foreground px-6 py-3 text-sm font-medium text-background transition hover:opacity-90",children:"View full certificate"}),e.jsx(m,{to:"/search",className:"inline-flex items-center justify-center gap-2 rounded-full border border-rule bg-card px-6 py-3 text-sm font-medium text-foreground transition hover:border-foreground
1/40",children:"Browse registry"})]})]})}function R({psa:r}){const a=r.gradeDescription||[r.year,r.brand,r.subject,r.cardNumber?`#${r.cardNumber}`:null,r.variety].filter(Boolean).join(" ")||`PSA cert ${r.certNumber}`;return e.jsxs("div",{className:"overflow-hidden rounded-xl border border-rule bg-card px-5 py-8 md:px-10 md:py-10",children:[e.jsx(b,{certNumber:r.certNumber,title:a}),e.jsxs("div",{className:"mx-auto mt-8 grid max-w-lg grid-cols-2 gap-5",children:[e.jsx(u,{url:r.frontUrl,label:"Front"}),e.jsx(u,{url:r.backUrl,label:"Back"})]}),e.jsxs("div",{className:"mx-auto mt-8 grid max-w-lg grid-cols-2 gap-4",children:[e.jsx(s,{label:"Item grade",value:r.grade??"â"}),e.jsx(s,{label:"PSA estimate",value:r.psaEstimate??"â"}),e.jsx(s,{label:"PSA population",value:r.totalPopulation!=null?r.totalPopulation.toLocaleString():"â",accent:r.totalPopulation!=null}),e.jsx(s,{label:"PSA pop higher",value:r.populationHigher!=null?r.populationHigher.toLocaleString():"â"})]}),e.jsxs("div",{className:"mx-auto mt-8 grid max-w-lg grid-cols-1 gap-4 sm:grid-cols-2",children:[e.jsxs("a",{href:`https://www.psacard.com/cert/${r.certNumber}`,target:"_blank",rel:"noreferrer noopener",className:"inline-flex items-center justify-center gap-2 rounded-full bg-foreground px-6 py-3 text-sm font-medium text-background transition hover:opacity-90",children:["View on PSA ",e.jsx(E,{className:"h-3.5 w-3.5"})]}),e.jsx(m,{to:"/services",className:"inline-flex items-center justify-center gap-2 rounded-full border border-rule bg-card px-6 py-3 text-sm font-medium text-foreground transition hover:border-foreground
1/40",children:"Grade with CHCK"})]})]})}function K(){const[r,a]=c.useState(""),i=f(A),x=f(B),[p,j]=c.useState(null),[g,v]=c.useState(null),[n,N]=c.useState(null),o=H({mutationFn:async t=>{const l=t.replace(/[^0-9]/g,""),[w,k]=await Promise.all([l.length>=5?x({data:{certNumber:l}}):Promise.resolve(null),t.length>=3?i({data:{slug:t}}).catch(()=>null):Promise.resolve(null)]);return{psa:w,cert:k}},onSuccess:(t,l)=>{N(t.psa),v(t.cert??null),j(l)}});function y(t){t.preventDefault();const l=r.trim().replace(/[^A-Za-z0-9_-]/g,"");l.length<3||o.mutate(l)}return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsxs("main",{className:"mx-auto max-w-4xl px-6 py-12",children:[e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border border-[color:var(--cert-red)]/30 bg-[color:var(--cert-red)]/8 px-3 py-1",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-[color:var(--cert-red)]"}),e.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.2em] text-[color:var(--cert-red-deep)]",children:"Cert lookup"})]}),e.jsx("h1",{className:"mt-4 font-display text-[clamp(2rem,5vw,3.25rem)] font-light leading-tight",children:"Cert Verification"}),e.jsx("p",{className:"mx-auto mt-3 max-w-2xl text-muted-foreground",children:"Search PSA's certification database by cert number â grade, label, population and PSA's own front and back images. CHCK certificates are searched at the same time."})]}),e.jsxs("form",{onSubmit:y,className:"mx-auto mt-8 flex max-w-xl flex-col gap-2 sm:flex-row sm:items-center",children:[e.jsx("label",{htmlFor:"cert-number",className:"sr-only",children:"Enter a PSA or CHCK cert number"}),e.jsxs("div",{className:"relative flex-1",children:[e.jsx(F,{className:"pointer-events-none absolute left-4 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx("input",{id:"cert-number",value:r,onChange:t=>a(t.target.value),placeholder:"Enter a cert number, e.g. 49402445",autoComplete:"off",spellCheck:!1,inputMode:"numeric",className:"w-full rounded-full border border-rule bg-[color:var(--bg-2)] py-3 pl-11 pr-4 font-mono text-sm tracking-[0.08em] focus:outline-none focus:ring-2 focus:ring-[color:var(--cert-red)]/40"})]}),e.jsx("button",{type:"submit",disabled:o.isPending,className:"rounded-full border border-rule bg-card px-8 py-3 text-sm font-semibold text-foreground transition hover:border-foreground
1/40 disabled:opacity-50",children:o.isPending?"Searchingâ¦":"Search"})]}),e.jsxs("section",{className:"mt-8 space-y-6",children:[o.isError&&e.jsx("p",{className:"text-sm text-destructive",children:"Couldn't complete that lookup. Please try again."}),!o.isPending&&n?.ok&&e.jsx(R,{psa:n}),!o.isPending&&n&&!n.ok&&n.error&&e.jsxs("div",{className:"rounded-xl border border-rule bg-card p-5",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 text-[color:var(--cert-red-deep)]",children:[e.jsx(h,{className:"h-4 w-4"}),e.jsx("span",{className:"font-mono text-[11px] uppercase tracking-[0.18em]",children:"PSA lookup unavailable"})]}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:n.error})]}),!o.isPending&&g&&e.jsx(M,{cert:g}),!o.isPending&&p&&!g&&n&&!n.ok&&!n.error&&e.jsxs("div",{className:"rounded-xl border border-rule bg-card p-5",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 text-[color:var(--cert-red-deep)]",children:[e.jsx(h,{className:"h-4 w-4"}),e.jsx("span",{className:"font-mono text-[11px] uppercase tracking-[0.18em]",children:"No match"})]}),e.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["Cert ",e.jsx("code",{className:"font-mono text-foreground",children:p})," was not found in PSA's or CHCK's database. It may be mistyped, or from another grading company."]})]})]}),e.jsx("section",{className:"mt-12 grid gap-4 md:grid-cols-3",children:[{title:"Security: a buyer's guide",body:"Cert numbers are public. Always buy certified cards from sources you trust, and match the images on the cert page to the card in hand.",to:"/services"},{title:"CHCK grading standards",body:"Read how centering, corners, edges and surface roll up into a final grade, grade by grade.",to:"/services"},{title:"Browse the registry",body:"Search every certificate by player, year, set or brand instead of by cert number.",to:"/search"}].map(t=>e.jsxs(m,{to:t.to,className:"group rounded-xl border border-rule bg-card p-5 transition hover:-translate-y-0.5 hover:border-[color:var(--cert-red)]/50",children:[e.jsx("h3",{className:"font-display text-base leading-snug",children:t.title}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:t.body}),e.jsx("span",{className:"mt-3 inline-block font-mono text-[10px] uppercase tracking-[0.18em] text-[color:var(--cert-red-deep)]",children:"Learn more â"})]},t.title))}),e.jsx("p",{className:"mt-10 text-xs leading-relaxed text-muted-foreground",children:"Note: verifying a certification number does not eliminate risk. Counterfeiters may reuse real cert numbers on fake slabs. Compare the front and back images shown on the cert page with the item you are buying, and purchase from reputable sellers."})]}),e.jsx(L,{})]})}export{K 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.