PageSourceSearch

https://ruffruffletsplay.com/assets/scan-CP0nPeEC.js

js ruffruffletsplay.com collected 2026-10-07 13:26:41 UTC 6,295 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.esm-CEhI24ro.js","assets/vendor-react-BZ84NtM-.js"])))=>i.map(i=>d[i]);
2import{u as k,d as R,c as g,x as b,_}from"./index-MiEay11t.js";import{a as o,j as e}from"./vendor-react-BZ84NtM-.js";import{u as L}from"./vendor-router-BLlC8-tP.js";import{Q}from"./index-DDod9xeN.js";import{a0 as T,Q as E,al as j,aQ as P,a as N,ax as w,au as U,L as $}from"./vendor-icons-D9mgJH_A.js";import"./vendor-query-CRLLNKPD.js";import"./vendor-radix-xUlI7J_i.js";import"./vendor-motion-Dm8BzVd-.js";const q=o.lazy(()=>_(()=>import("./index.esm-CEhI24ro.js"),__vite__mapDeps([0,1])).then(a=>({default:a.Scanner}))),A=new Set([window.location.host,"ruffruffletsplay.com","www.ruffruffletsplay.com","ruff-ruff-lets-play.replit.app"]),y="ruffruff:qrUser";function I(){try{const a=localStorage.getItem(y);if(!a)return null;const n=JSON.parse(a);if(n&&typeof n.id=="string")return n}catch{}return null}function K(){const[,a]=L(),[n,m]=o.useState(null),[d,x]=o.useState("myqr"),[f,i]=o.useState(!1),{user:s}=k(),{toast:h}=R(),[u,v]=o.useState(()=>I());o.useEffect(()=>{if(!s?.id||u?.id===s.id)return;const t={id:s.id,firstName:s.firstName??void 0,lastName:s.lastName??void 0};try{localStorage.setItem(y,JSON.stringify(t))}catch{}v(t)},[s?.id,s?.firstName,s?.lastName,u?.id]);const c=s??u,C=t=>{if(t){if(t.startsWith("ruffruff://user/")){const r=t.split("ruffruff://user/")[1];if(r&&r!==s?.id){a(`/connect/${r}`);return}else if(r){a(`/profile/${r}`);return}}const p=t.match(/\/connect\/([a-zA-Z0-9_-]+)/);if(p?.[1]){const r=p[1];r!==s?.id?a(`/connect/${r}`):a(`/profile/${r}`);return}try{const r=new URL(t);if(A.has(r.host)){a(b(r.pathname+r.search));return}}catch{}if(t.startsWith("/")){a(b(t));return}m("Invalid QR Code. This doesn't look like a RuffRuff code."),setTimeout(()=>m(null),3e3)}},S=window.location.origin+"/".replace(/\/+$/,""),l=c?`${S}/connect/${c.id}`:"";return e.jsxs("div",{className:"max-w-md mx-auto min-h-[80vh] flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[e.jsx("button",{onClick:()=>a("/"),className:"p-2 -ml-2 text-muted-foreground",children:e.jsx(T,{})}),e.jsx("h1",{className:"text-2xl font-display font-bold",children:"QR Code"})]}),e.jsxs("div",{className:"flex bg-muted rounded-2xl p-1 mb-8",children:[e.jsxs("button",{onClick:()=>x("myqr"),className:g("flex-1 py-3 rounded-xl font-bold text-sm transition-all flex items-center justify-center gap-2",d==="myqr"?"bg-card shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.jsx(E,{className:"w-4 h-4"})," My QR Code"]}),e.jsxs("button",{onClick:()=>x("scan"),className:g("flex-1 py-3 rounded-xl font-bold text-sm transition-all flex items-center justify-center gap-2",d==="scan"?"bg-card shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.jsx(j,{className:"w-4 h-4"})," Scan"]})]}),d==="myqr"?e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center",children:[e.jsx("div",{className:"bg-card p-6 rounded-3xl shadow-lg border border-border/30 mb-6",children:l?e.jsx(Q,{value:l,size:200,level:"L",fgColor:"hsl(222, 47%, 11%)"}):e.jsx("div",{className:"w-[200px] h-[200px] flex items-center justify-center text-muted-foreground text-sm",children:"Loading..."})}),e.jsxs("h2",{className:"text-xl font-display font-bold mb-1",children:[c?.firstName," ",c?.lastName]}),e.jsx("p",{className:"text-muted-foreground text-sm mb-4",children:"Share this code to let others connect with you"}),e.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-widest font-bold mb-6",children:"Scan to Connect"}),e.jsxs("div",{className:"w-full max-w-sm space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 bg-muted/30 rounded-xl px-3 py-2.5 border border-border/20",children:[e.jsx(P,{className:"w-4 h-4 text-muted-foreground/50 shrink-0"}),e.jsx("span",{className:"text-xs text-muted-foreground truncate flex-1",children:l}),e.jsx("button",{onClick:()=>{navigator.clipboard.writeText(l),i(!0),h({title:"Profile link copied!"}),setTimeout(()=>i(!1),2e3)},className:"shrink-0 p-1.5 rounded-lg hover:bg-muted/40 transition-colors",children:f?e.jsx(N,{className:"w-4 h-4 text-green-500"}):e.jsx(w,{className:"w-4 h-4 text-muted-foreground"})})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:()=>{navigator.clipboard.writeText(l),i(!0),h({title:"Profile link copied!"}),setTimeout(()=>i(!1),2e3)},className:"flex-1 flex items-center justify-center gap-2 py-2.5 rounded-xl font-bold text-sm bg-muted/40 hover:bg-muted/60 transition-colors",children:[f?e.jsx(N,{className:"w-4 h-4 text-green-500"}):e.jsx(w,{className:"w-4 h-4"}),f?"Copied!":"Copy Link"]}),typeof navigator.share=="function"&&e.jsxs("button",{onClick:()=>{navigator.share({title:`${s?.firstName}'s RuffRuff Profile`,text:`Check out ${s?.firstName}'s dogs on RuffRuff Let's Play!`,url:l}).catch(()=>{})},className:"flex-1 flex items-center justify-center gap-2 py-2.5 rounded-xl font-bold text-sm bg-[#f26b28] text-white hover:shadow-lg transition-all",children:[e.jsx(U,{className:"w-4 h-4"})," Share"]})]})]})]}):e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center",children:[e.jsx("div",{className:"w-20 h-20 bg-primary/10 rounded-full flex items-center justify-center text-primary mb-6",children:e.jsx(j,{className:"w-10 h-10"})}),e.jsx("p",{className:"text-center text-muted-foreground mb-8 px-4",children:"Point your camera at another user's profile QR code to quickly connect and view their dogs."}),e.jsxs("div",{className:"w-full aspect-square max-w-sm rounded-[2rem] overflow-hidden shadow-2xl border-4 border-white bg-black relative",children:[e.jsx(o.Suspense,{fallback:e.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-white/70",children:e.jsx($,{className:"w-8 h-8 animate-spin"})}),children:e.jsx(q,{onScan:t=>C(t[0].rawValue),onError:t=>console.error(t),components:{onOff:!1,torch:!0,zoom:!1,finder:!1}})}),e.jsx("div",{className:"absolute inset-0 pointer-events-none border-2 border-primary/50 m-12 rounded-xl"})]}),n&&e.jsx("div",{className:"mt-6 bg-destructive/10 text-destructive px-4 py-2 rounded-lg font-bold text-sm text-center",children:n})]})]})}export{K 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.