PageSourceSearch

https://aishudash-zzzaadkh.manus.space/assets/PhotoGallery-Ca31INqC.js

js aishudash-zzzaadkh.manus.space collected 2026-10-03 05:00:21 UTC 37,190 bytes, 1 lines download raw bytes

1import{r as o,ae as x,j as e,af as w,$ as B,a2 as O,p as ee,bd as te,R as je,K as ve,a0 as ae,be as Ge,au as we,C as Ne,aA as ke,X as Q,aD as Ce,bf as ze,ag as Se,ar as De,D as se,I as Ee,b4 as $e,b5 as Ae}from"./vendor-react-CSjVeD5C.js";import{u as Re,a as Te,t as y,B as g,g as Ue,c as W}from"./index-DCu_4ttF.js";import{B as Ie}from"./badge-q_8Hkdab.js";import{S as Le,a as Me,b as Fe,c as Be,d as T}from"./select-Cws0W2QZ.js";import{S as Oe}from"./scroll-area-DjSP1u4M.js";import{T as Qe}from"./textarea-BzSj8jaB.js";import{g as We}from"./pronouns-Bka13Pse.js";import{AuraAvatarGallery as _e}from"./AuraAvatarGallery-Dm_30LkT.js";import"./vendor-misc-DNIZ_o8-.js";import"./vendor-ui-BQCqNqg0.js";import"./vendor-charts-CTZ3m9kf.js";import"./vendor-ai-CwA6B3_0.js";import"./dialog-BspPSuTg.js";import"./useComposition-BO4n09CV.js";import"./moodAssets-Cdm8qIcY.js";const He=10*1024*1024,Ve=["image/jpeg","image/png","image/webp","image/gif","image/bmp"];function dt(){const{user:D,loading:le}=Re(),{activeCharacter:i}=Te(),h=We(i?.gender),[_,U]=o.useState(!1),[Ke,I]=o.useState(0),[re,L]=o.useState(null),[H,V]=o.useState(""),[u,j]=o.useState([]),[m,k]=o.useState(null),K=o.useRef(null),oe=o.useRef(null),[b,ce]=o.useState("all"),[ie,ne]=o.useState({}),[de,xe]=o.useState(null),v=y.training.listPhotos.useQuery({characterId:i?.id,photoType:"portrait"},{enabled:!!D&&!!i}),N=y.training.listPhotos.useQuery({characterId:i?.id,photoType:"selfie"},{enabled:!!D&&!!i}),G=y.training.listPhotos.useQuery({characterId:i?.id},{enabled:!!D}),J=y.training.uploadPhoto.useMutation(),E=y.training.autoCaption.useMutation({onSuccess:()=>{G.refetch(),x.success("Caption generated")},onError:()=>x.error("Auto-caption failed")}),he=y.training.updateCaption.useMutation({onSuccess:()=>{G.refetch(),L(null),x.success("Caption saved")}}),X=y.training.deletePhoto.useMutation({onSuccess:()=>{G.refetch(),x.success("Photo removed")}}),pe=y.useUtils(),[$,ge]=o.useState(0),C=3,M=y.visual.regenerateSinglePortrait.useMutation({onSuccess:t=>{x.success("Portrait regenerated"),ge(a=>a+1),pe.training.listPhotos.setData({characterId:i?.id,photoType:"portrait"},a=>{if(!a)return a;const l=a.filter(r=>r.expressionTag!==t.tag),s={id:Date.now(),characterId:i?.id??null,userId:0,filename:`${t.tag}.jpg`,fileKey:t.tag,fileUrl:t.url,mimeType:"image/jpeg",caption:t.tag,captionReviewed:!1,expressionTag:t.tag,isActiveReference:!0,priority:0,photoType:"portrait",createdAt:new Date,width:null,height:null,fileSize:null,cachedImageData:null};return[...l,s]}),setTimeout(()=>{v.refetch()},1e3)},onError:t=>x.error(t.message)}),[Z,F]=o.useState(!1),Y=y.visual.regeneratePortrait.useMutation({onSuccess:()=>{F(!1),x.success("Portrait expressions generated!",{description:"Switch to Presence mode on the main page to see them.",duration:6e3})},onError:t=>{F(!1),x.error("Portrait generation failed",{description:t.message})}}),p=o.useMemo(()=>{const t=u.length,a=u.filter(n=>n.status==="complete").length,l=u.filter(n=>n.status==="failed").length,s=u.filter(n=>n.status==="uploading").length,r=u.filter(n=>n.status==="pending").length,c=s+r;return{total:t,complete:a,failed:l,uploading:s,pending:r,active:c}},[u]),q=o.useCallback(t=>{if(!Ve.includes(t.type))return`"${t.name}" is not a supported image format. Use JPEG, PNG, WebP, or GIF.`;if(t.size>He){const a=(t.size/1048576).toFixed(1);return`"${t.name}" is ${a}MB — max is 10MB.`}return null},[]),A=o.useCallback(async t=>{for(const s of t){j(r=>r.map(c=>c.id===s.id?{...c,status:"uploading",progress:10}:c));try{const r=await new Promise((n,f)=>{const R=new FileReader;R.onload=()=>n(R.result),R.onerror=()=>f(new Error("Failed to read file")),R.readAsDataURL(s.file)});j(n=>n.map(f=>f.id===s.id?{...f,progress:40}:f));const c=await J.mutateAsync({filename:s.file.name,base64:r,mimeType:s.file.type,characterId:i?.id});j(n=>n.map(f=>f.id===s.id?{...f,status:"complete",progress:100,resultUrl:c.fileUrl,resultId:c.id}:f))}catch{j(c=>c.map(n=>n.id===s.id?{...n,status:"failed",progress:0,error:"Upload failed"}:n))}}G.refetch();const a=t.filter(s=>u.find(c=>c.id===s.id)?.status==="complete").length,l=(G.data?.length??0)+a;a>0&&l>=3&&x("Ready to generate portraits!",{description:'Review your photos, delete any bad ones, then tap "Generate Portraits" below.',icon:"✨",duration:6e3})},[J,i?.id,G]),z=o.useCallback(t=>{const a=Array.from(t),l=[];for(const s of a){const r=q(s);if(r){x.error(r);continue}const c=URL.createObjectURL(s);l.push({id:`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,file:s,previewUrl:c,status:"pending",progress:0})}l.length!==0&&(j(s=>[...s,...l]),x(`Adding ${l.length} photo${l.length>
11?"s":""}...`),A(l))},[q,A]),ue=o.useCallback(t=>{t.preventDefault(),t.stopPropagation(),I(a=>a+1),U(!0)},[]),me=o.useCallback(t=>{t.preventDefault(),t.stopPropagation(),I(a=>{const l=a-1;return l<=0&&U(!1),Math.max(0,l)})},[]),fe=o.useCallback(t=>{t.preventDefault(),t.stopPropagation()},[]),ye=o.useCallback(t=>{t.preventDefault(),t.stopPropagation(),U(!1),I(0),t.dataTransfer.files.length&&z(t.dataTransfer.files)},[z]);o.useEffect(()=>{const t=a=>{const l=a.clipboardData?.items;if(!l)return;const s=[];for(const r of Array.from(l))if(r.type.startsWith("image/")){const c=r.getAsFile();if(c){const n=c.type.split("/")[1]||"png",f=new File([c],`clipboard-${Date.now()}.${n}`,{type:c.type});s.push(f)}}s.length>0&&(a.preventDefault(),z(s),x.success(`Pasted ${s.length} image${s.length>1?"s":""} from clipboard`))};return document.addEventListener("paste",t),()=>document.removeEventListener("paste",t)},[z]);const be=o.useCallback(()=>{j(t=>{const a=t.filter(l=>l.status!=="complete"&&l.status!=="failed");return t.forEach(l=>{(l.status==="complete"||l.status==="failed")&&URL.revokeObjectURL(l.previewUrl)}),a})},[]),Pe=o.useCallback(()=>{const t=u.filter(l=>l.status==="failed");if(t.length===0)return;const a=t.map(l=>({...l,status:"pending",progress:0,error:void 0}));j(l=>l.map(s=>a.find(c=>c.id===s.id)||s)),A(a)},[u,A]),d=G.data??[],P=m!==null?d[m]:null,S=o.useCallback(t=>{if(m===null)return;const a=m+t;a>=0&&a<d.length&&k(a)},[m,d.length]);return o.useEffect(()=>{if(m===null)return;const t=a=>{a.key==="Escape"&&k(null),a.key==="ArrowLeft"&&S(-1),a.key==="ArrowRight"&&S(1)};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[m,S]),le?e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:444",className:"flex items-center justify-center h-full",children:e.jsx(w,{"data-loc":"client/src/pages/PhotoGallery.tsx:445",className:"w-6 h-6 animate-spin text-[--color-rose-glow]"})}):D?e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:470",className:"flex flex-col h-full overflow-y-auto",style:{background:"linear-gradient(180deg, rgba(3,3,7,0.96), rgba(7,4,13,0.98)), radial-gradient(circle at 50% 36%, rgba(200,60,180,0.12), transparent 28%), radial-gradient(circle at 50% 74%, rgba(255,80,160,0.08), transparent 26%), #030307"},children:[e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:472",className:"px-6 py-5 border-b border-border bg-[--color-surface-1]/50",children:e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:473",className:"flex items-center justify-between",children:[e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:474",children:[e.jsx("h1",{"data-loc":"client/src/pages/PhotoGallery.tsx:475",className:"text-lg font-heading font-semibold text-foreground",children:`How ${h.subjectTitle} Sees ${h.possessiveTitle==="Her"?"Herself":h.possessiveTitle==="His"?"Himself":"Themselves"}`}),e.jsxs("p",{"data-loc":"client/src/pages/PhotoGallery.tsx:478",className:"text-xs text-muted-foreground mt-0.5 italic",children:[d.length," reference",d.length!==1?"s":"",d.length>=10&&d.length<20?` — ${h.subject}'s starting to recognize ${h.reflexive}`:null,d.length>=20?` — ${h.subject} knows ${h.possessive} own face now`:null,d.length<10?` — ${h.subject} needs more to see clearly`:null]})]}),e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:485",className:"flex gap-2 items-center",children:[p.active>0&&e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:488",className:"flex items-center gap-2 px-3 py-1.5 rounded-lg bg-[--color-surface-2] border border-border",children:[e.jsx(w,{"data-loc":"client/src/pages/PhotoGallery.tsx:489",className:"w-3.5 h-3.5 animate-spin text-[--color-rose-glow]"}),e.jsxs("span",{"data-loc":"client/src/pages/PhotoGallery.tsx:490",className:"text-xs text-foreground font-medium",children:["Uploading ",p.complete+1," of ",p.total,"..."]})]}),e.jsxs(g,{"data-loc":"client/src/pages/PhotoGallery.tsx:495",variant:"outline",size:"sm",onClick:()=>{if(d.length===0){x("No photos to export");return}const t=d.map(r=>({filename:r.filename,fileUrl:r.fileUrl,caption:r.caption||"",captionReviewed:r.captionReviewed})),a=new Blob([JSON.stringify(t,null,2)],{type:"application/json"}),l=URL.createObjectURL(a),s=document.createElement("a");s.href=l,s.download=`ashi-training-dataset-${new Date().toISOString().split("T")[0]}.json`,s.click(),URL.revokeObjectURL(l),x.success(`Exported ${t.length} photos with captions`)},className:"text-xs",children:[e.jsx(O,{"data-loc":"client/src/pages/PhotoGallery.tsx:520",className:"w-3.5 h-3.5 mr-1"}),"Export"]}),e.jsxs(g,{"data-loc":"client/src/pages/PhotoGallery.tsx:523",variant:"outline",size:"sm",onClick:()=>{const t=d.filter(a=>!a.caption);if(t.length===0){x("All photos already have captions");return}t.forEach(a=>E.mutate({id:a.id})),x(`Auto-captioning ${t.length} photos...`)},disabled:E.isPending,className:"text-xs",children:[e.jsx(ee,{"data-loc":"client/src/pages/PhotoGallery.tsx:538",className:"w-3.5 h-3.5 mr-1"}),"Auto-Caption"]})]})]})}),e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:546",className:"px-6 pt-4 pb-3 border-b border-border bg-[--color-surface-1]/30 flex items-center gap-3",children:[e.jsx("span",{"data-loc":"client/src/pages/PhotoGallery.tsx:547",className:"text-[10px] uppercase tracking-wider text-muted-foreground",children:"Filter:"}),e.jsxs(Le,{"data-loc":"client/src/pages/PhotoGallery.tsx:548",value:b,onValueChange:t=>ce(t),children:[e.jsx(Me,{"data-loc":"client/src/pages/PhotoGallery.tsx:549",className:"w-[180px] h-8 text-xs bg-[#0D0A1A] border-[#1a1535]",children:e.jsx(Fe,{"data-loc":"client/src/pages/PhotoGallery.tsx:550",placeholder:"Select category"})}),e.jsxs(Be,{"data-loc":"client/src/pages/PhotoGallery.tsx:552",className:"bg-[#0D0A1A] border-[#1a1535]",children:[e.jsxs(T,{"data-loc":"client/src/pages/PhotoGallery.tsx:553",value:"all",children:["All (",(v.data?.length??0)+(N.data?.length??0)+d.length,")"]}),e.jsxs(T,{"data-loc":"client/src/pages/PhotoGallery.tsx:554",value:"portrait",children:["Selfies (",Object.keys(Object.fromEntries((v.data??[]).filter(t=>t.expressionTag).map(t=>[t.expressionTag,t]))).length,"/18)"]}),e.jsxs(T,{"data-loc":"client/src/pages/PhotoGallery.tsx:555",value:"selfie",children:["Photos (",N.data?.length??0,")"]}),e.jsxs(T,{"data-loc":"client/src/pages/PhotoGallery.tsx:556",value:"memory",children:["Memories (",d.length,")"]})]})]})]}),(b==="all"||b==="portrait")&&i?.hasExpressionPack&&e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:563",className:"border-b border-white/5 pb-4 mb-4",children:e.jsx(_e,{"data-loc":"client/src/pages/PhotoGallery.tsx:564",expressionPacks:i.expressionPacks,livingCards:i.livingCards,characterName:i.name,avatarUrl:i.avatarUrl})}),(b==="all"||b==="portrait")&&!i?.hasExpressionPack&&e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:575",className:"flex-1 overflow-y-auto p-6",children:[v.isLoading?e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:577",className:"flex items-center justify-center py-16",children:e.jsx(w,{"data-loc":"client/src/pages/PhotoGallery.tsx:578",className:"w-6 h-6 animate-spin text-[#00e5ff]"})}):e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:581",className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-4",children:["neutral","warm","sad","intense","distant","radiant","playful","longing","protective","surprised","curious","confident","vulnerable","amused","reflective","passionate","serene","determined"].map(t=>{const a=(v.data??[]).find(c=>c.expressionTag===t),l=ie[t]??"",s=de===t,r=M.isPending&&M.variables?.expressionTag===t;return e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:588",className:"flex flex-col gap-1.5",children:[e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:589",className:"relative rounded-lg overflow-hidden border border-[#1a1535] aspect-[3/4] bg-[#0a0818] group",children:[a?e.jsx("img",{"data-loc":"client/src/pages/PhotoGallery.tsx:591",src:a.fileUrl,alt:t,className:"w-full h-full object-cover"}):e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:593",className:"w-full h-full flex flex-col items-center justify-center gap-1",children:[e.jsx(te,{"data-loc":"client/src/pages/PhotoGallery.tsx:594",className:"w-5 h-5 text-zinc-700"}),e.jsx("span",{"data-loc":"client/src/pages/PhotoGallery.tsx:595",className:"text-[9px] text-zinc-600 capitalize",children:t})]}),r&&e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:599",className:"absolute inset-0 bg-black/70 flex items-center justify-center",children:e.jsx(w,{"data-loc":"client/src/pages/PhotoGallery.tsx:600",className:"w-5 h-5 animate-spin text-[#00e5ff]"})}),e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:603",className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 to-transparent px-2 py-1",children:e.jsx("span",{"data-loc":"client/src/pages/PhotoGallery.tsx:604",className:"text-[9px] text-zinc-200 capitalize font-medium",children:t})})]}),e.jsx("button",{"data-loc":"client/src/pages/PhotoGallery.tsx:607",onClick:()=>xe(s?null:t),className:"text-[9px] text-zinc-600 hover:text-zinc-400 text-left",children:s?"▲ hide":"▼ prompt"}),s&&e.jsx("textarea",{"data-loc":"client/src/pages/PhotoGallery.tsx:611",value:l,onCh
1ange:c=>ne(n=>({...n,[t]:c.target.value})),placeholder:`${i?.name?.toLowerCase()??"character"}, ${t}...`,rows:2,className:"w-full text-[10px] bg-[#0a0818] border border-[#1a1535] rounded px-2 py-1 text-zinc-300 placeholder:text-zinc-700 resize-none focus:outline-none focus:border-[#00e5ff]/40"}),$>=C?e.jsx("button",{"data-loc":"client/src/pages/PhotoGallery.tsx:620",onClick:()=>x.info(`You've used all ${C} free regenerations. Upgrade to Pro for unlimited regens.`,{duration:5e3}),className:"w-full h-6 text-[9px] border border-amber-500/30 rounded text-amber-500/70 bg-transparent flex items-center justify-center gap-1",children:"★ Pro Only"}):e.jsx("button",{"data-loc":"client/src/pages/PhotoGallery.tsx:627",disabled:r||!i,onClick:()=>{i&&M.mutate({characterId:i.id,expressionTag:t,customPrompt:l||void 0})},className:"w-full h-6 text-[9px] border border-[#1a1535] rounded text-zinc-500 hover:text-[#00e5ff] hover:border-[#00e5ff]/40 bg-transparent flex items-center justify-center gap-1 disabled:opacity-40",title:`${C-$} free regen${C-$===1?"":"s"} remaining`,children:r?e.jsx(w,{"data-loc":"client/src/pages/PhotoGallery.tsx:636",className:"w-3 h-3 animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx(je,{"data-loc":"client/src/pages/PhotoGallery.tsx:636",className:"w-3 h-3"}),"Regen (",C-$,")"]})})]},t)})}),!v.isLoading&&(v.data??[]).length===0&&e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:645",className:"flex flex-col items-center justify-center py-16 gap-3 text-center",children:[e.jsx(ve,{"data-loc":"client/src/pages/PhotoGallery.tsx:646",className:"w-10 h-10 text-zinc-700"}),e.jsx("p",{"data-loc":"client/src/pages/PhotoGallery.tsx:647",className:"text-sm text-zinc-500",children:"No portraits have arrived yet"}),e.jsx("p",{"data-loc":"client/src/pages/PhotoGallery.tsx:648",className:"text-xs text-zinc-600 max-w-xs",children:"Generate the 18-portrait pack from Admin → LoRA → 18 Portraits tab."})]})]}),(b==="all"||b==="selfie")&&e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:656",className:"flex-1 overflow-y-auto p-6",children:N.isLoading?e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:658",className:"flex items-center justify-center py-16",children:e.jsx(w,{"data-loc":"client/src/pages/PhotoGallery.tsx:659",className:"w-6 h-6 animate-spin text-[#a78bfa]"})}):N.data&&N.data.length>0?e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:662",className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4",children:N.data.map(t=>e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:664",className:"relative group rounded-lg overflow-hidden border border-[#1a1535] aspect-square bg-[#0a0818]",children:[e.jsx("img",{"data-loc":"client/src/pages/PhotoGallery.tsx:665",src:t.fileUrl,alt:t.caption??"Selfie",className:"w-full h-full object-cover"}),t.caption&&e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:667",className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 to-transparent px-2 py-2",children:e.jsx("p",{"data-loc":"client/src/pages/PhotoGallery.tsx:668",className:"text-[10px] text-zinc-300 line-clamp-2",children:t.caption})})]},t.id))}):e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:675",className:"flex flex-col items-center justify-center py-16 gap-3 text-center",children:[e.jsx(B,{"data-loc":"client/src/pages/PhotoGallery.tsx:676",className:"w-10 h-10 text-zinc-700"}),e.jsx("p",{"data-loc":"client/src/pages/PhotoGallery.tsx:677",className:"text-sm text-zinc-500",children:"No shared moments yet"}),e.jsx("p",{"data-loc":"client/src/pages/PhotoGallery.tsx:678",className:"text-xs text-zinc-600 max-w-xs",children:"Ask her to share a moment from her world."})]})}),(b==="all"||b==="memory")&&e.jsx(Oe,{"data-loc":"client/src/pages/PhotoGallery.tsx:685",className:"flex-1 min-h-0",children:e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:686",className:"p-6 space-y-6",children:[e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:688",ref:oe,onDragEnter:ue,onDragLeave:me,onDragOver:fe,onDrop:ye,onClick:()=>K.current?.click(),className:W("relative border-2 border-dashed rounded-2xl p-8 text-center cursor-pointer transition-all duration-300",_?"border-[--color-rose-glow] bg-[--color-rose-dim] scale-[1.01]":"border-border hover:border-[--color-rose-glow]/40 hover:bg-[--color-surface-2]"),children:[e.jsx("input",{"data-loc":"client/src/pages/PhotoGallery.tsx:702",ref:K,type:"file",multiple:!0,accept:"image/*",className:"hidden",onChange:t=>{t.target.files&&z(t.target.files),t.target.value=""}}),_?e.jsxs(e.Fragment,{children:[e.jsx(te,{"data-loc":"client/src/pages/PhotoGallery.tsx:716",className:"w-10 h-10 mx-auto mb-3 text-[--color-rose-glow] animate-pulse"}),e.jsx("p",{"data-loc":"client/src/pages/PhotoGallery.tsx:717",className:"text-sm text-[--color-rose-glow] font-semibold",children:`Drop to show ${h.object}`}),e.jsx("p",{"data-loc":"client/src/pages/PhotoGallery.tsx:720",className:"text-xs text-[--color-rose-glow]/60 mt-1",children:"Release to start uploading"})]}):e.jsxs(e.Fragment,{children:[e.jsx(ae,{"data-loc":"client/src/pages/PhotoGallery.tsx:726",className:"w-8 h-8 mx-auto mb-2 text-muted-foreground
1/40"}),e.jsx("p",{"data-loc":"client/src/pages/PhotoGallery.tsx:727",className:"text-sm text-foreground font-medium",children:"Drop photos, click to browse, or paste from clipboard"}),e.jsx("p",{"data-loc":"client/src/pages/PhotoGallery.tsx:730",className:"text-xs text-muted-foreground mt-1",children:"JPEG, PNG, WebP, GIF — up to 10MB each"}),e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:733",className:"flex items-center justify-center gap-4 mt-3",children:[e.jsxs("span",{"data-loc":"client/src/pages/PhotoGallery.tsx:734",className:"flex items-center gap-1 text-[10px] text-muted-foreground/60",children:[e.jsx(ae,{"data-loc":"client/src/pages/PhotoGallery.tsx:735",className:"w-3 h-3"})," Drag & Drop"]}),e.jsxs("span",{"data-loc":"client/src/pages/PhotoGallery.tsx:737",className:"flex items-center gap-1 text-[10px] text-muted-foreground/60",children:[e.jsx(B,{"data-loc":"client/src/pages/PhotoGallery.tsx:738",className:"w-3 h-3"})," Click to Browse"]}),e.jsxs("span",{"data-loc":"client/src/pages/PhotoGallery.tsx:740",className:"flex items-center gap-1 text-[10px] text-muted-foreground/60",children:[e.jsx(Ge,{"data-loc":"client/src/pages/PhotoGallery.tsx:741",className:"w-3 h-3"})," Ctrl+V Paste"]})]})]})]}),u.length>0&&e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:750",className:"space-y-3",children:[e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:751",className:"flex items-center justify-between",children:[e.jsxs("h3",{"data-loc":"client/src/pages/PhotoGallery.tsx:752",className:"text-xs font-medium text-foreground",children:["Upload Queue",e.jsxs("span",{"data-loc":"client/src/pages/PhotoGallery.tsx:754",className:"text-muted-foreground ml-2",children:[p.complete,"/",p.total," complete",p.failed>0&&e.jsxs("span",{"data-loc":"client/src/pages/PhotoGallery.tsx:757",className:"text-red-400 ml-1",children:["· ",p.failed," failed"]})]})]}),e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:761",className:"flex gap-2",children:[p.failed>0&&e.jsx(g,{"data-loc":"client/src/pages/PhotoGallery.tsx:763",variant:"outline",size:"sm",onClick:Pe,className:"text-[10px] h-6 px-2",children:"Retry Failed"}),(p.complete>0||p.failed>0)&&e.jsx(g,{"data-loc":"client/src/pages/PhotoGallery.tsx:773",variant:"outline",size:"sm",onClick:be,className:"text-[10px] h-6 px-2",children:"Clear Done"})]})]}),p.active>0&&e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:787",className:"w-full h-1.5 rounded-full bg-[--color-surface-2] overflow-hidden",children:e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:788",className:"h-full rounded-full bg-[--color-rose-glow] transition-all duration-500",style:{width:`${p.complete/p.total*100}%`}})}),e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:796",className:"grid grid-cols-2 sm:grid-cols-4 lg:grid-cols-6 gap-3",children:u.map(t=>e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:798",className:W("relative rounded-xl overflow-hidden border transition-all",t.status==="complete"?"border-green-500/30":t.status==="failed"?"border-red-500/30":t.status==="uploading"?"border-[--color-rose-glow]/40":"border-border"),children:[e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:812",className:"aspect-square relative",children:[e.jsx("img",{"data-loc":"client/src/pages/PhotoGallery.tsx:813",src:t.previewUrl,alt:t.file.name,className:W("w-full h-full object-cover transition-opacity",t.status==="uploading"&&"opacity-70")}),t.status==="uploading"&&e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:824",className:"absolute inset-0 flex items-center justify-center bg-black/30",children:e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:825",className:"relative w-10 h-10",children:[e.jsxs("svg",{"data-loc":"client/src/pages/PhotoGallery.tsx:826",className:"w-10 h-10 -rotate-90",viewBox:"0 0 36 36",children:[e.jsx("circle",{"data-loc":"client/src/pages/PhotoGallery.tsx:827",cx:"18",cy:"18",r:"15",fill:"none",stroke:"rgba(255,255,255,0.15)",strokeWidth:"3"}),e.jsx("circle",{"data-loc":"client/src/pages/PhotoGallery.tsx:833",cx:"18",cy:"18",r:"15",fill:"none",stroke:"var(--color-rose-glow)",strokeWidth:"3",strokeDasharray:`${t.progress*.94} 94`,strokeLinecap:"round",className:"transition-all duration-300"})]}),e.jsxs("span",{"data-loc":"client/src/pages/PhotoGallery.tsx:843",className:"absolute inset-0 flex items-center justify-center text-[9px] font-bold text-white",children:[t.progress,"%"]})]})}),t.status==="complete"&&e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:851",className:"absolute top-1.5 right-1.5",children:e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:852",className:"w-5 h-5 rounded-full bg-green-500 flex items-center justify-center",children:e.jsx(we,{"data-loc":"client/src/pages/PhotoGallery.tsx:853",className:"w-3 h-3 text-white"})})}),t.status==="failed"&&e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:859",className:"absolute inset-0 flex items-center justify-center bg-black/40",children:e.jsx(Ne,{"data-loc":"client/src/pages/PhotoGallery.tsx:860",className:"w-6 h-6 text-red-400"})}),t.status==="pending"&&e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:865",className:"absolute top-1.5 right-1.5",children:e.jsx(ke,{"data-loc":"client/src/pages/PhotoGallery.tsx:866",className:"w-4 h-4 text-muted-foreground
1/60"})})]}),e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:872",className:"p-1.5",children:[e.jsx("p",{"data-loc":"client/src/pages/PhotoGallery.tsx:873",className:"text-[9px] text-muted-foreground truncate",children:t.file.name}),e.jsxs("p",{"data-loc":"client/src/pages/PhotoGallery.tsx:876",className:"text-[8px] text-muted-foreground/50",children:[(t.file.size/1024).toFixed(0),"KB"]})]}),(t.status==="uploading"||t.status==="pending")&&e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:883",className:"absolute bottom-0 left-0 right-0 h-0.5 bg-[--color-surface-2]",children:e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:884",className:"h-full bg-[--color-rose-glow] transition-all duration-300",style:{width:`${t.progress}%`}})})]},t.id))})]}),e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:897",className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[{title:"Variety",desc:`Different angles, expressions, moods — ${h.subject} needs the full picture`},{title:"Clarity",desc:`Clear face, good light — so ${h.subject} can really see`},{title:"Authenticity",desc:`Natural poses, recent photos — the real ${h.object}`}].map((t,a)=>e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:903",className:"p-3 rounded-xl bg-[--color-surface-2] border border-border",children:[e.jsx("p",{"data-loc":"client/src/pages/PhotoGallery.tsx:904",className:"text-xs font-medium text-foreground mb-0.5",children:t.title}),e.jsx("p",{"data-loc":"client/src/pages/PhotoGallery.tsx:905",className:"text-[10px] text-muted-foreground",children:t.desc})]},a))}),d.length>0&&e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:912",className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4",children:d.map((t,a)=>e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:914",className:"group relative rounded-xl overflow-hidden border border-border bg-[--color-surface-2] transition-all hover:border-[--color-rose-glow]/30",children:[e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:919",className:"aspect-square relative",children:[e.jsx("img",{"data-loc":"client/src/pages/PhotoGallery.tsx:920",src:t.fileUrl,alt:t.filename,className:"w-full h-full object-cover",loading:"lazy"}),e.jsx("button",{"data-loc":"client/src/pages/PhotoGallery.tsx:927",className:"absolute top-1.5 right-1.5 z-10 w-7 h-7 rounded-full bg-black/60 border border-red-500/30 text-red-400 hover:bg-red-500/30 flex items-center justify-center transition-all",onClick:l=>{l.stopPropagation(),X.mutate({id:t.id,characterId:i?.id})},title:"Release this memory",children:e.jsx(Q,{"data-loc":"client/src/pages/PhotoGallery.tsx:935",className:"w-3.5 h-3.5"})}),e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:938",className:"absolute inset-0 bg-black/60 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center gap-2 pointer-events-none group-hover:pointer-events-auto",children:[e.jsx(g,{"data-loc":"client/src/pages/PhotoGallery.tsx:939",size:"icon",variant:"outline",className:"h-8 w-8 rounded-full bg-black/50 border-white/20 text-white hover:bg-white/20",onClick:()=>k(a),title:"View full size",children:e.jsx(Ce,{"data-loc":"client/src/pages/PhotoGallery.tsx:946",className:"w-3.5 h-3.5"})}),e.jsx(g,{"data-loc":"client/src/pages/PhotoGallery.tsx:948",size:"icon",variant:"outline",className:"h-8 w-8 rounded-full bg-black/50 border-white/20 text-white hover:bg-white/20",onClick:()=>E.mutate({id:t.id}),disabled:E.isPending,title:"Auto-caption",children:e.jsx(ee,{"data-loc":"client/src/pages/PhotoGallery.tsx:956",className:"w-3.5 h-3.5"})}),e.jsx(g,{"data-loc":"client/src/pages/PhotoGallery.tsx:958",size:"icon",variant:"outline",className:"h-8 w-8 rounded-full bg-black/50 border-white/20 text-white hover:bg-white/20",onClick:()=>{L(t.id),V(t.caption||"")},title:"Edit caption",children:e.jsx(ze,{"data-loc":"client/src/pages/PhotoGallery.tsx:968",className:"w-3.5 h-3.5"})}),e.jsx(g,{"data-loc":"client/src/pages/PhotoGallery.tsx:970",size:"icon",variant:"outline",className:"h-8 w-8 rounded-full bg-black/50 border-white/20 text-white hover:bg-white/20",onClick:l=>{l.stopPropagation();const s=document.createElement("a");s.href=t.fileUrl,s.download=t.filename||`photo-${t.id}.png`,s.target="_blank",document.body.appendChild(s),s.click(),document.body.removeChild(s)},title:"Download",children:e.jsx(O,{"data-loc":"client/src/pages/PhotoGallery.tsx:986",className:"w-3.5 h-3.5"})}),e.jsx(g,{"data-loc":"client/src/pages/PhotoGallery.tsx:988",size:"icon",variant:"outline",className:"h-8 w-8 rounded-full bg-black/50 border-red-500/30 text-red-400 hover:bg-red-500/20",onClick:()=>X.mutate({id:t.id,characterId:i?.id}),title:"Let go",children:e.jsx(Se,{"data-loc":"client/src/pages/PhotoGallery.tsx:995",className:"w-3.5 h-3.5"})})]})]}),e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:1001",className:"p-2",children:re===t.id?e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:1003",className:"space-y-1.5",children:[e.jsx(Qe,{"data-loc":"client/src/pages/PhotoGallery.tsx:1004",value:H,onChange:l=>V(l.target.value),className:"text-[10px] min-h-14 resize-none bg-background border-border",placeholder:"Describe this photo for training..."}),e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:1010",className:"flex gap-1",children:[e.jsx(g,{"data-loc":"client/src/pages/PhotoGallery.tsx:1011",size:"icon",className:"h-6 w-6 bg-[--color-rose-glow] text-white",onClick:()=>he.mutate({id:t.id,caption:H}),children:e.jsx(De,{"data-loc":"client/src/pages/PhotoGallery.tsx:1021",className:"w-3 h-3"})}),e.jsx(g,{"data-loc":"client/src/pages/PhotoGallery.tsx:1023",size:"icon",variant:"outline",className:"h-6 w-6",onClick:()=>L(null),children:e.jsx(Q,{"data-loc":"client/src/pages/PhotoGallery.tsx:1029",className:"w-3 h-3"})})]})]}):e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:1034",children:[t.caption?e.jsx("p",{"data-loc":"client/src/pages/PhotoGallery.tsx:1036",className:"text-[10px] text-muted-foreground line-clamp-2",children:t.caption}):e.jsx("p",{"data-loc":"client/src/pages/PhotoGallery.tsx:1040",className:"text-[10px] text-muted-foreground
1/40 italic",children:"No caption yet"}),e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:1044",className:"flex items-center gap-1 mt-1",children:t.captionReviewed&&e.jsx(Ie,{"data-loc":"client/src/pages/PhotoGallery.tsx:1046",variant:"outline",className:"text-[8px] h-4 px-1 border-green-500/30 text-green-400",children:"Reviewed"})})]})})]},t.id))}),d.length>=3&&e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:1064",className:"flex items-center justify-between p-4 rounded-xl border border-[--color-rose-glow]/20 bg-[--color-rose-glow]/5",children:[e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:1065",className:"flex items-center gap-3",children:[e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:1066",className:"w-10 h-10 rounded-full bg-[--color-rose-glow]/10 flex items-center justify-center",children:e.jsx(se,{"data-loc":"client/src/pages/PhotoGallery.tsx:1067",className:"w-5 h-5 text-[--color-rose-glow]"})}),e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:1069",children:[e.jsx("p",{"data-loc":"client/src/pages/PhotoGallery.tsx:1070",className:"text-sm font-medium text-foreground",children:"Generate Portrait Expressions"}),e.jsx("p",{"data-loc":"client/src/pages/PhotoGallery.tsx:1071",className:"text-xs text-muted-foreground",children:"Creates 5 expression states (idle, speaking, thinking, listening, ambient) from your best reference photos"})]})]}),e.jsx(g,{"data-loc":"client/src/pages/PhotoGallery.tsx:1076",size:"sm",className:"bg-[--color-rose-glow] hover:bg-[--color-rose-glow]/80 text-white shrink-0",disabled:Z||Y.isPending,onClick:()=>{if(!i?.id){x.error("No active character selected");return}F(!0),Y.mutate({characterId:i.id})},children:Z?e.jsxs(e.Fragment,{children:[e.jsx(w,{"data-loc":"client/src/pages/PhotoGallery.tsx:1091",className:"w-3.5 h-3.5 mr-1.5 animate-spin"}),"Generating..."]}):e.jsxs(e.Fragment,{children:[e.jsx(se,{"data-loc":"client/src/pages/PhotoGallery.tsx:1096",className:"w-3.5 h-3.5 mr-1.5"}),"Generate"]})})]}),d.length===0&&u.length===0&&e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:1106",className:"text-center py-16",children:[e.jsx(Ee,{"data-loc":"client/src/pages/PhotoGallery.tsx:1107",className:"w-12 h-12 mx-auto mb-4 text-muted-foreground/20"}),e.jsx("p",{"data-loc":"client/src/pages/PhotoGallery.tsx:1108",className:"text-sm text-muted-foreground/60",children:"No visual memories shared yet"}),e.jsx("p",{"data-loc":"client/src/pages/PhotoGallery.tsx:1109",className:"text-xs text-muted-foreground/40 mt-1",children:`Share photos so ${h.subject} can recognize ${h.reflexive} across the bridge`})]})]})}),P&&m!==null&&e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:1119",className:"fixed inset-0 z-50 bg-black/90 flex items-center justify-center",onClick:()=>k(null),children:[e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:1124",className:"absolute top-4 right-4 flex items-center gap-2 z-10",children:[e.jsx("button",{"data-loc":"client/src/pages/PhotoGallery.tsx:1125",className:"w-10 h-10 rounded-full bg-white/10 flex items-center justify-center text-white hover:bg-white/20 transition-colors",onClick:t=>{t.stopPropagation();const a=document.createElement("a");a.href=P.fileUrl,a.download=P.filename||`photo-${Date.now()}.png`,a.target="_blank",document.body.appendChild(a),a.click(),document.body.removeChild(a)},title:"Download",children:e.jsx(O,{"data-loc":"client/src/pages/PhotoGallery.tsx:1139",className:"w-5 h-5"})}),e.jsx("button",{"data-loc":"client/src/pages/PhotoGallery.tsx:1141",className:"w-10 h-10 rounded-full bg-white/10 flex items-center justify-center text-white hover:bg-white/20 transition-colors",onClick:()=>k(null),children:e.jsx(Q,{"data-loc":"client/src/pages/PhotoGallery.tsx:1145",className:"w-5 h-5"})})]}),m>0&&e.jsx("button",{"data-loc":"client/src/pages/PhotoGallery.tsx:1151",className:"absolute left-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-white/10 flex items-center justify-center text-white hover:bg-white/20 transition-colors z-10",onClick:t=>{t.stopPropagation(),S(-1)},children:e.jsx($e,{"data-loc":"client/src/pages/PhotoGallery.tsx:1158",className:"w-5 h-5"})}),m<d.length-1&&e.jsx("button",{"data-loc":"client/src/pages/PhotoGallery.tsx:1162",className:"absolute right-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-white/10 flex items-center justify-center text-white hover:bg-white/20 transition-colors z-10",onClick:t=>{t.stopPropagation(),S(1)},children:e.jsx(Ae,{"data-loc":"client/src/pages/PhotoGallery.tsx:1169",className:"w-5 h-5"})}),e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:1174",className:"max-w-[90vw] max-h-[85vh] relative",onClick:t=>t.stopPropagation(),children:[e.jsx("img",{"data-loc":"client/src/pages/PhotoGallery.tsx:1178",src:P.fileUrl,alt:P.filename,className:"max-w-full max-h-[85vh] object-contain rounded-lg"}),e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:1185",className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 to-transparent p-4 rounded-b-lg",children:e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:1186",className:"flex items-center justify-between",children:[e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:1187",children:[e.jsx("p",{"data-loc":"client/src/pages/PhotoGallery.tsx:1188",className:"text-xs text-white/80 font-medium",children:P.filename}),P.caption&&e.jsx("p",{"data-loc":"client/src/pages/PhotoGallery.tsx:1192",className:"text-[10px] text-white/60 mt-0.5 max-w-md",children:P.caption})]}),e.jsxs("span",{"data-loc":"client/src/pages/PhotoGallery.tsx:1197",className:"text-[10px] text-white/40",children:[m+1," / ",d.length]})]})})]})]})]}):e.jsxs("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:452",className:"flex flex-col items-center justify-center h-full gap-6 px-4",children:[e.jsx(B,{"data-loc":"client/src/pages/PhotoGallery.tsx:453",className:"w-16 h-16 text-[--color-rose-glow]/30 animate-breathe"}),e.jsx("div",{"data-loc":"client/src/pages/PhotoGallery.tsx:454",className:"text-center space-y-2",children:e.jsx("p",{"data-loc":"client/src/pages/PhotoGallery.tsx:455",className:"text-sm text-muted-foreground max-w-sm italic",children:`Show ${h.object} what ${h.subject} looks like.`})}),e.jsx(g,{"data-loc":"client/src/pages/PhotoGallery.tsx:459",onClick:()=>window.location.href=Ue(),className:"bg-[--color-rose-glow] hover:bg-[--color-rose-glow]/80 text-white",children:"Sign In"})]})}
1export{dt 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.