1import{r as i,j as e}from"./react-vendor-D653VjAu.js";import{e as M,t as L,a as S}from"./signature-D5L3rz-k.js";const f=[{id:"black",label:"Black",rgb:[26,26,26]},{id:"blue",label:"Blue",rgb:[26,58,143]},{id:"red",label:"Red",rgb:[154,27,27]},{id:"violet",label:"Violet",rgb:[88,40,130]}],T=t=>e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",width:t.size||20,height:t.size||20,...t,children:[e.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.jsx("polyline",{points:"17 8 12 3 7 8"}),e.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),U=t=>e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",width:t.size||18,height:t.size||18,...t,children:[e.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e.jsx("polyline",{points:"7 10 12 15 17 10"}),e.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]});function m({children:t}){return e.jsx("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-zinc-900 border border-zinc-800 text-[11px] text-zinc-400",children:t})}function b({step:t,title:s,children:h,right:d}){return e.jsxs("section",{className:"rounded-2xl border border-zinc-800 bg-zinc-950/60 p-5 sm:p-6",children:[e.jsxs("header",{className:"flex items-center gap-3 mb-4",children:[e.jsx("span",{className:"w-6 h-6 rounded-full bg-zinc-800 text-zinc-300 text-[11px] font-bold grid place-items-center",children:t}),e.jsx("h2",{className:"text-[11px] font-bold tracking-[0.14em] text-zinc-400 uppercase flex-1",children:s}),d]}),h]})}function E(t,s=1600){return new Promise((h,d)=>{const x=URL.createObjectURL(t),a=new Image;a.onload=()=>{URL.revokeObjectURL(x);const p=Math.min(1,s/Math.max(a.width,a.height)),o=document.createElement("canvas");o.width=Math.max(1,Math.round(a.width*p)),o.height=Math.max(1,Math.round(a.height*p)),o.getContext("2d").drawImage(a,0,0,o.width,o.height),h(o)},a.onerror=()=>{URL.revokeObjectURL(x),d(new Error("That file could not be read as an image."))},a.src=x})}function P(t){const s=document.createElement("canvas");return s.width=t.width,s.height=t.height,s.getContext("2d").drawImage(t,0,0),s}function D({showNotification:t}){const[s,h]=i.useState(null),[d,x]=i.useState(.5),[a,p]=i.useState("black"),[o,j]=i.useState(!1),[k,u]=i.useState(""),y=i.useRef(null),g=i.useRef(null),w=i.useRef(null),v=f.find(n=>n.id===a)||f[0];i.useEffect(()=>{if(!s){g.current=null;return}let n=!1;try{const l=M(P(s),d),c=L(l,10);if(S(c,v.rgb),n)return;g.current=c;const r=y.current;if(r){const I=r.parentElement?.clientWidth||480,N=Math.min(1,I/c.width,260/c.height);r.width=Math.max(1,Math.round(c.width*N)),r.height=Math.max(1,Math.round(c.height*N));const z=r.getContext("2d");z.clearRect(0,0,r.width,r.height),z.drawImage(c,0,0,r.width,r.height)}u("")}catch(l){u(l.message||"Could not process that image.")}return()=>{n=!0}},[s,d,a,v.rgb]);const C=i.useCallback(async n=>
1{if(n){if(!n.type.startsWith("image/")){u("Choose a photo of your thumbprint â JPG, PNG or HEIC.");return}j(!0),u("");try{const l=await E(n);h(l),t?.("Thumbmark captured â adjust the cleanup below","success")}catch(l){u(l.message)}finally{j(!1)}}},[t]),R=i.useCallback(()=>{const n=g.current;n&&n.toBlob(l=>{if(!l)return;const c=URL.createObjectURL(l),r=document.createElement("a");r.href=c,r.download="thumbmark.png",r.click(),setTimeout(()=>URL.revokeObjectURL(c),4e3),t?.("Saved thumbmark.png","success")},"image/png")},[t]);return e.jsxs("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 py-6",children:[e.jsxs("div",{className:"mb-7",children:[e.jsxs("h1",{className:"text-2xl sm:text-[30px] leading-[1.15] font-black text-white tracking-tight",children:["Make a clean"," ",e.jsx("span",{className:"underline decoration-zinc-700 decoration-2 underline-offset-[6px]",children:"thumbmark"})," ","from your own print"]}),e.jsx("p",{className:"text-zinc-400 text-sm mt-2.5 max-w-xl leading-relaxed",children:"Ink your thumb, press it on white paper, and photograph it. The ridges are lifted off the paper onto a transparent background, ready to drop into a form. Everything runs in your browser â the photo is never uploaded."}),e.jsxs("div",{className:"flex flex-wrap gap-2 mt-4",children:[e.jsx(m,{children:"Transparent PNG"}),e.jsx(m,{children:"No upload"}),e.jsx(m,{children:"No watermark"}),e.jsx(m,{children:"No sign-up"}),e.jsx(m,{children:"Free"})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs(b,{step:"1",title:"Photograph your thumbprint",children:[e.jsx("input",{ref:w,type:"file",accept:"image/*",capture:"environment",className:"sr-only",onChange:n=>C(n.target.files?.[0])}),e.jsxs("button",{type:"button",onClick:()=>w.current?.click(),disabled:o,"aria-busy":o||void 0,className:"w-full border-2 border-dashed border-zinc-800 hover:border-zinc-600 rounded-xl py-10 grid place-items-center gap-3 text-zinc-400 hover:text-zinc-200 transition-colors disabled:opacity-60",children:[e.jsx("span",{className:"w-12 h-12 rounded-full bg-zinc-900 grid place-items-center",children:e.jsx(T,{size:22})}),e.jsx("span",{className:"font-semibold text-zinc-200",children:o?"Reading photoâ¦":s?"Use a different photo":"Take or choose a photo"}),e.jsx("span",{className:"text-xs",children:"Ink pad or stamp pad, white paper, good light â never leaves your device"})]}),k&&e.jsx("p",{role:"alert",className:"mt-3 text-sm text-red-400",children:k})]}),s&&e.jsxs(e.Fragment,{children:[e.jsxs(b,{step:"2",title:"Clean it up",children:[e.jsx("div",{className:"rounded-xl bg-[repeating-conic-gradient(#e4e4e7_0_25%,#fafafa_0_50%)] bg-[length:16px_16px] p-4 grid place-items-center min-h-[140px]",children:e.jsx("canvas",{ref:y,className:"max-w-full"})}),e.jsxs("label",{className:"block mt-5",children:[e.jsxs("span",{className:"flex items-center justify-between text-xs text-zinc-400 mb-2",children:[e.jsx("span",{className:"font-semibold text-zinc-300",children:"Sensitivity"}),e.jsxs("span",{className:"tabular-nums",children:[Math.round(d*100),"%"]})]}),e.jsx("input",{type:"range",min:"0",max:"1",step:"0.02",value:d,onChange:n=>x(parseFloat(n.target.value)),className:"w-full h-1.5 accent-white cursor-pointer rounded-full"}),e.jsxs("span",{className:"flex justify-between text-[10px] text-zinc-500 mt-1",children:[e.jsx("span",{children:"keep only the darkest ridges"}),e.jsx("span",{children:"keep faint detail too"})]})]}),e.jsxs("div",{className:"mt-5",children:[e.jsx("span",{className:"block text-xs font-semibold text-zinc-300 mb-2",children:"Ink colour"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:f.map(n=>e.jsxs("button",{type:"button",onClick:()=>p(n.id),"aria-pressed":a===n.id,className:`px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors ${a===n.id?"border-zinc-400 text-white bg-zinc-800":"border-zinc-800 text-zinc-400 hover:text-zinc-200"}`,children:[e.jsx("span",{className:"inline-block w-2.5 h-2.5 rounded-full mr-2 align-middle",style:{background:`rgb(${n.rgb.join(",")})`}}),n.label]},n.id))}),e.jsx("p",{className:"text-[11px] text-zinc-500 mt-2",children:"Many government and bank forms specify black or blue. Check the form before you pick."})]})]}),e.jsxs(b,{step:"3",title:"Save it",children:[e.jsxs("button",{type:"button",onClick:R,className:"w-full sm:w-auto inline-flex items-center justify-center gap-2 px-5 py-3 rounded-xl bg-white text-black font-semibold hover:bg-zinc-200 transition-colors",children:[e.jsx(U,{})," Download transparent PNG"]}),e.jsxs("p",{className:"text-xs text-zinc-500 mt-3 leading-relaxed",children:["The PNG has a transparent background, so it sits on a form without a white box around it. To place it directly on a PDF, open"," ",e.jsx("a",{href:"/sign-pdf",className:"text-zinc-300 underline underline-offset-2",children:"Sign PDF"})," ","and add it as an image, or"," ",e.jsx("a",{href:"/edit-pdf-text",className:"text-zinc-300 underline underline-offset-2",children:"Edit PDF"})," ","to position it precisely."]})]})]}),e.jsx("p",{className:"text-[11px] text-zinc-600 leading-relaxed pt-2",children:"This tool digitises a thumbprint you make yourself. It does not generate synthetic fingerprints â putting an invented biometric on an official document is forgery. Use your own print, and only where the form asks for one."})]})]})}export{D 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.