T.ME/BIBIL_0DAY
CasperSecurity


Server : Apache/2
System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64
User : gositeme ( 1004)
PHP Version : 8.2.29
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Directory :  /home/gositeme/domains/lavocat.ca/private_html/.next/server/chunks/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/gositeme/domains/lavocat.ca/private_html/.next/server/chunks/9949.js
"use strict";exports.id=9949,exports.ids=[9949],exports.modules={39949:(e,t,s)=>{s.a(e,async(e,a)=>{try{s.r(t),s.d(t,{default:()=>f});var r=s(8732),n=s(82015),i=s(4722),l=s(63220),o=s(22863),d=s(73392),c=s(46847),m=s(4659),x=s(42893),g=s(13221),u=s.n(g),h=s(50927),p=s(42391),y=e([l,m,x,h,p]);[l,m,x,h,p]=y.then?(await y)():y;let f=({registrationId:e,onClose:t})=>{console.log("[PrivateChat] \uD83D\uDE80 Component mounted with registrationId:",e);let{data:s}=(0,i.useSession)(),{ws:a,connected:g}=(0,d.h)(),[y,f]=(0,n.useState)(null),[b,j]=(0,n.useState)(""),[v,w]=(0,n.useState)(!1),[N,k]=(0,n.useState)(""),[S,C]=(0,n.useState)(!1),[E,L]=(0,n.useState)(new Set),[I,M]=(0,n.useState)(!1),[A,P]=(0,n.useState)(!1),[D,T]=(0,n.useState)(null),[U,F]=(0,n.useState)(null),[O,$]=(0,n.useState)(!1),W=(0,n.useRef)(null);(0,n.useRef)(null);let z=(0,n.useRef)(null),[B,R]=(0,n.useState)(null),[V,G]=(0,n.useState)(null),[H,J]=(0,n.useState)(!1),[Y,K]=(0,n.useState)(null),q=(0,n.useRef)(null),[X,_]=(0,n.useState)(null);(0,n.useEffect)(()=>{"Notification"in window&&"default"===Notification.permission&&Notification.requestPermission().then(e=>{console.log("[PrivateChat] Notification permission:",e)})},[]),(0,n.useEffect)(()=>{if(!a)return;let t=t=>{try{let a=JSON.parse(t.data);switch(console.log("Private chat WebSocket message received:",a),a.type){case"PRIVATE_MESSAGE":if(a.data.registrationId===e){let e=a.data.message.sender.id===s?.user?.id,t=y?.messages.some(e=>e.id===a.data.message.id);e||t||f(e=>e?{...e,messages:[...e.messages,a.data.message]}:null),!e&&document.hidden&&((0,x.toast)(e=>(0,r.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,r.jsx)("div",{className:"flex-shrink-0",children:(0,r.jsx)("div",{className:"w-8 h-8 bg-blue-500 rounded-full flex items-center justify-center",children:(0,r.jsx)("span",{className:"text-white text-sm font-bold",children:a.data.message.sender.name?.charAt(0)||"U"})})}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsxs)("p",{className:"font-medium text-gray-900",children:["\uD83D\uDCAC ",a.data.message.sender.name||"User"]}),(0,r.jsx)("p",{className:"text-sm text-gray-600 truncate max-w-48",children:a.data.message.content})]})]}),{duration:4e3,position:"top-right",style:{maxWidth:"350px"}}),"granted"===Notification.permission&&new Notification(`New message from ${a.data.message.sender.name||"User"}`,{body:a.data.message.content,icon:"/icons/apple-touch-icon-180x180.png"}),console.log(`[PrivateChat] 🔔 Notification shown for message from ${a.data.message.sender.name}`))}break;case"TYPING":a.data.registrationId===e&&L(e=>{let t=new Set(e);return a.data.isTyping?t.add(a.data.userName):t.delete(a.data.userName),t});break;case"webrtc-offer":K({senderId:a.senderId,signal:a.data.signal});break;case"webrtc-answer":q.current&&q.current.signal(a.data.signal);break;case"webrtc-ice-candidate":q.current&&q.current.signal(a.data.candidate);break;case"webrtc-end-call":en()}}catch(e){console.error("Error parsing private chat WebSocket message:",e)}};return a.addEventListener("message",t),()=>a.removeEventListener("message",t)},[a,e,s?.user?.id]);let Q=async()=>{try{w(!0);let t=await fetch(`/api/chat/private/${e}/messages`,{method:"GET",credentials:"same-origin"});if(!t.ok)throw Error("Failed to fetch chat");let s=await t.json();f(s),es()}catch(e){k("Failed to load chat")}finally{w(!1)}};(0,n.useEffect)(()=>{console.log("[PrivateChat] \uD83D\uDD04 registrationId effect triggered:",e),e&&(console.log("[PrivateChat] \uD83D\uDCDE Fetching chat for registration:",e),Q())},[e]);let Z=(0,n.useCallback)(t=>{if(a&&g&&s?.user?.name){C(t);try{a.send(JSON.stringify({type:"TYPING",data:{registrationId:e,userName:s.user.name,isTyping:t}}))}catch(e){console.error("Failed to send typing status:",e)}z.current&&clearTimeout(z.current),t&&(z.current=setTimeout(()=>{Z(!1)},3e3))}},[a,g,e]),ee=async()=>{if(!b.trim()||!y||!s?.user)return;let t=b.trim();j(""),Z(!1);let a={id:`temp-${Date.now()}`,content:t,type:"TEXT",createdAt:new Date().toISOString(),sender:{id:s.user.id,name:s.user.name||"Unknown",email:s.user.email||"",role:s.user.role||"USER"}};f(e=>e?{...e,messages:[...e.messages,a]}:null);try{let s=await fetch(`/api/chat/private/${e}/messages`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t})});if(!s.ok){let e="Failed to send message";try{let t=await s.json();t&&(t.error||t.message)&&(e=t.error||t.message)}catch(t){try{let t=await s.text();t&&(e=t)}catch{}}throw console.error("Send message error:",e),Error(e)}let r=await s.json();f(e=>e?{...e,messages:e.messages.map(e=>e.id===a.id?r:e)}:null)}catch(e){console.error("Error sending private message:",e),f(e=>e?{...e,messages:e.messages.filter(e=>e.id!==a.id)}:null),k(e instanceof Error&&"string"==typeof e.message&&e.message.toLowerCase().includes("message limit")?"You’ve reached the message limit. Please wait for an admin to reply before sending more messages.":e instanceof Error?e.message:"Failed to send message. Please try again.")}},et=async()=>{if(!D||!y||!s)return;$(!0);let t=new FormData;t.append("file",D),t.append("userId",s.user.id),t.append("registrationId",e);try{let e=await fetch("/api/user/upload",{method:"POST",credentials:"same-origin",body:t});if(!e.ok){let t;try{t=await e.json(),console.error("Upload error response:",t)}catch(e){console.error("Failed to parse error response:",e),t={}}throw console.error("Response status:",e.status),console.error("Response status text:",e.statusText),console.error("Response headers:",Object.fromEntries(e.headers.entries())),Error(t.message||t.error||`File upload failed (${e.status}: ${e.statusText})`)}let a=await e.json(),r={id:`temp-doc-${Date.now()}`,content:`Shared a document: ${a.name}`,type:"DOCUMENT",fileUrl:a.url,fileName:a.name,mimeType:a.type,createdAt:new Date().toISOString(),sender:{id:s.user.id,name:s.user.name||"Unknown",email:s.user.email||"",role:s.user.role||"USER"}};f(e=>e?{...e,messages:[...e.messages,r]}:null),M(!1),T(null)}catch(e){console.error("File upload error:",e),k(e.message)}finally{$(!1)}},es=()=>{W.current&&W.current.scrollIntoView({behavior:"smooth"})};(0,n.useEffect)(()=>{es()},[y?.messages]);let ea=(e,t,s)=>{let r=new(u())({initiator:s,trickle:!0,stream:t});return r.on("signal",t=>{let r=s?"webrtc-offer":"webrtc-answer";a?.readyState===WebSocket.OPEN&&a.send(JSON.stringify({type:r,data:{recipientId:e,signal:t}}))}),r.on("stream",e=>{G(e)}),r.on("icecandidate",t=>{a?.readyState===WebSocket.OPEN&&a.send(JSON.stringify({type:"webrtc-ice-candidate",data:{recipientId:e,candidate:t}}))}),r.on("close",()=>en()),r.on("error",e=>{console.error("Peer error:",e),en()}),r},er=async()=>{if(Y&&a){J(!0);try{let e=await navigator.mediaDevices.getUserMedia({video:!0,audio:!0});R(e),q.current=ea(Y.senderId,e,!1),q.current.signal(Y.signal),K(null)}catch(e){console.error("Failed to get user media for answering call",e),J(!1)}}},en=()=>{q.current&&(q.current.destroy(),q.current=null),B&&(B.getTracks().forEach(e=>e.stop()),R(null)),G(null),J(!1),K(null)};return v?(0,r.jsx)("div",{className:"text-center p-8",children:"Loading chat..."}):N?(0,r.jsx)("div",{className:"text-center p-8 text-red-500",children:N}):y?Y?(0,r.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-75 flex items-center justify-center z-50",children:(0,r.jsxs)("div",{className:"bg-white dark:bg-gray-800 p-8 rounded-lg shadow-xl text-center",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold mb-4 text-gray-900 dark:text-white",children:"Incoming Call"}),(0,r.jsx)("p",{className:"mb-6 text-gray-700 dark:text-gray-300",children:"You have an incoming video call."}),(0,r.jsxs)("div",{className:"flex justify-center space-x-4",children:[(0,r.jsx)("button",{onClick:er,className:"bg-green-500 hover:bg-green-600 text-white font-bold py-2 px-6 rounded-full transition-colors",children:"Accept"}),(0,r.jsx)("button",{onClick:()=>K(null),className:"bg-red-500 hover:bg-red-600 text-white font-bold py-2 px-6 rounded-full transition-colors",children:"Decline"})]})]})}):(0,r.jsxs)("div",{className:"fixed inset-0 bg-black bg-opacity-60 flex items-center justify-center z-50 p-4 font-sans",children:[(0,r.jsxs)(l.motion.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-gray-50 dark:bg-gray-800 rounded-lg shadow-xl w-full max-w-2xl h-[70vh] flex flex-col",children:[(0,r.jsxs)("div",{className:"bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-700 p-4 flex items-center justify-between rounded-t-lg flex-shrink-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"w-10 h-10 rounded-full bg-gradient-to-br from-green-500 to-teal-600 text-white flex items-center justify-center text-lg font-bold flex-shrink-0",children:y.registration.firstName.charAt(0).toUpperCase()}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsxs)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-200 truncate",children:[y.registration.firstName," ",y.registration.lastName]}),(0,r.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400 truncate",children:y.registration.email})]})]}),(0,r.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,r.jsx)("div",{className:`w-2.5 h-2.5 rounded-full ${g?"bg-green-500":"bg-red-500"}`,title:g?"Connected":"Disconnected"}),(0,r.jsx)("button",{onClick:t,className:"p-1 rounded-full text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),(0,r.jsxs)("div",{className:"flex-1 overflow-y-auto p-6 space-y-4",children:[0===y.messages.length?(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center h-full text-center text-gray-500 dark:text-gray-400",children:[(0,r.jsx)("div",{className:"w-20 h-20 bg-gray-200 dark:bg-gray-700 rounded-full flex items-center justify-center mb-4",children:(0,r.jsx)("svg",{className:"w-10 h-10",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})})}),(0,r.jsx)("h3",{className:"text-xl font-semibold mb-2",children:"No messages yet"}),(0,r.jsx)("p",{children:"Start the conversation by sending a message!"})]}):y.messages.map((e,t)=>{let a=e.sender.id===s?.user?.id,n=y?.messages[t-1],i=!a&&(!n||n.sender.id!==e.sender.id),l=!n||n.sender.id!==e.sender.id,d=e.sender?.name||"Unknown User",c=(0,o.GP)(new Date(e.createdAt),"HH:mm");return(0,r.jsxs)("div",{className:`flex items-start gap-3 ${l?"mt-4":"mt-1"}`,children:[(0,r.jsx)("div",{className:"w-10 flex-shrink-0",children:i&&(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(h.A,{user:e.sender,size:"sm",showStatus:!0,clickable:!0,onClick:()=>_({userId:e.sender.id,isOpen:X?.userId!==e.sender.id||!X?.isOpen})}),X?.userId===e.sender.id&&X?.isOpen&&(0,r.jsx)(p.A,{userId:e.sender.id,isOpen:!0,onClose:()=>_(null),position:"right"})]})}),(0,r.jsxs)("div",{className:`max-w-lg ${a?"ml-auto":""}`,children:[l&&(0,r.jsxs)("div",{className:`flex items-center gap-2 mb-1 ${a?"justify-end":"justify-start"}`,children:[(0,r.jsx)("p",{className:`text-xs font-medium ${a?"text-blue-600 dark:text-blue-400":"text-gray-600 dark:text-gray-400"}`,children:a?"You":(0,r.jsxs)("span",{className:"flex items-center gap-1",children:["ADMIN"===e.sender.role?"⚖️ ":"",d,e.sender.title&&(0,r.jsxs)("span",{className:"text-gray-500 dark:text-gray-400",children:["• ",e.sender.title]})]})}),(0,r.jsx)("span",{className:"text-xs text-gray-400",children:c})]}),(0,r.jsx)("div",{className:`px-4 py-2 rounded-2xl inline-block shadow-sm ${a?"bg-gradient-to-r from-blue-600 to-blue-700 text-white rounded-br-none":"bg-white text-gray-800 border border-gray-200 dark:bg-gray-700 dark:border-gray-600 dark:text-gray-200 rounded-bl-none"}`,children:"FILE"===e.type||"IMAGE"===e.type||"VIDEO"===e.type||"AUDIO"===e.type?(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("p",{className:"text-sm",children:e.content}),"IMAGE"===e.type&&e.fileUrl?(0,r.jsxs)("div",{className:"relative rounded-lg overflow-hidden cursor-pointer hover:opacity-90 transition-opacity",onClick:()=>F({url:e.fileUrl,type:e.mimeType,name:e.fileName}),children:[(0,r.jsx)("img",{src:e.fileUrl,alt:e.fileName,className:"max-w-full max-h-64 object-contain rounded-lg shadow-md",onError:e=>{e.currentTarget.style.display="none",e.currentTarget.nextElementSibling.style.display="block"}}),(0,r.jsx)("div",{className:"bg-gray-100 dark:bg-gray-600 rounded-lg p-3",style:{display:"none"},children:(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)("svg",{className:"w-5 h-5 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:"text-sm font-medium truncate",children:e.fileName}),(0,r.jsxs)("p",{className:"text-xs text-gray-500",children:[e.fileSize?`${(e.fileSize/1024).toFixed(1)} KB`:""," • Image"]})]}),(0,r.jsx)("span",{className:"text-blue-500 hover:text-blue-700 text-sm font-medium",children:"View"})]})}),(0,r.jsx)("div",{className:"absolute inset-0 bg-black bg-opacity-0 hover:bg-opacity-10 transition-all duration-200 flex items-center justify-center",children:(0,r.jsx)("div",{className:"bg-black bg-opacity-50 text-white px-3 py-1 rounded-full text-sm opacity-0 group-hover:opacity-100 transition-opacity",children:"Click to enlarge"})})]}):(0,r.jsx)("div",{className:"bg-gray-100 dark:bg-gray-600 rounded-lg p-3",children:(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)("svg",{className:"w-5 h-5 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:"text-sm font-medium truncate",children:e.fileName}),(0,r.jsxs)("p",{className:"text-xs text-gray-500",children:[e.fileSize?`${(e.fileSize/1024).toFixed(1)} KB`:""," • ",e.type]})]}),(0,r.jsx)("button",{onClick:()=>F({url:e.fileUrl,type:e.mimeType,name:e.fileName}),className:"text-blue-500 hover:text-blue-700 text-sm font-medium",children:"View"})]})})]}):(0,r.jsx)("p",{className:"text-sm",children:e.content})}),e.id.startsWith("temp-")&&(0,r.jsxs)("p",{className:"text-xs text-right text-gray-400 mt-1 flex items-center justify-end gap-1",children:[(0,r.jsx)("div",{className:"w-3 h-3 border-2 border-gray-300 border-t-blue-500 rounded-full animate-spin"}),"Sending..."]})]})]},e.id)}),E.size>0&&(0,r.jsx)("div",{className:"flex justify-start",children:(0,r.jsx)("div",{className:"bg-white dark:bg-gray-700 rounded-2xl px-4 py-2 rounded-bl-none shadow",children:(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsxs)("div",{className:"flex space-x-1",children:[(0,r.jsx)("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce"}),(0,r.jsx)("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,r.jsx)("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]}),(0,r.jsxs)("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:[Array.from(E).join(", ")," is typing..."]})]})})}),(0,r.jsx)("div",{ref:W})]}),(0,r.jsx)("div",{className:"p-4 bg-white dark:bg-gray-900 border-t border-gray-200 dark:border-gray-700",children:N&&"string"==typeof N&&N.toLowerCase().includes("message limit")?(0,r.jsx)("div",{className:"w-full flex items-center justify-center py-6",children:(0,r.jsx)("span",{className:"text-gray-500 text-base font-medium",children:"Waiting for lawyer response…"})}):(0,r.jsxs)("div",{className:"flex items-center bg-gray-100 dark:bg-gray-800 rounded-lg px-2 py-1",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,r.jsx)("button",{onClick:()=>M(!0),className:"p-2 rounded-full text-gray-500 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700",title:"Attach File",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13"})})}),s?.user.role==="ADMIN"&&y.registration.documents&&y.registration.documents.length>0&&(0,r.jsx)("button",{onClick:()=>P(!0),className:"p-2 rounded-full text-gray-500 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700",title:"Share Document",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})})]}),(0,r.jsx)("input",{type:"text",value:b,onChange:e=>{j(e.target.value),S||Z(!0)},onKeyPress:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),ee())},placeholder:"Type a message...",className:"flex-1 bg-transparent border-none focus:ring-0 text-sm px-3 text-gray-900 dark:text-gray-200 placeholder-gray-500 dark:placeholder-gray-400"}),(0,r.jsx)("button",{onClick:ee,disabled:!b.trim(),className:"p-2 rounded-full text-white bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 disabled:cursor-not-allowed transition-colors",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",viewBox:"0 0 20 20",fill:"currentColor",children:(0,r.jsx)("path",{d:"M10.894 2.553a1 1 0 00-1.788 0l-7 14a1 1 0 001.169 1.409l5-1.429A1 1 0 009 15.571V11a1 1 0 112 0v4.571a1 1 0 00.725.962l5 1.428a1 1 0 001.17-1.408l-7-14z"})})})]})})]}),(0,r.jsx)(l.AnimatePresence,{children:U&&(0,r.jsx)(l.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black bg-opacity-75 z-[60] flex items-center justify-center p-4",onClick:()=>F(null),children:(0,r.jsxs)(l.motion.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-7xl max-h-[90vh] w-full overflow-hidden",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700",children:[(0,r.jsx)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white truncate",children:U.name}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)("a",{href:U.url,download:U.name,className:"p-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",title:"Download",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),(0,r.jsx)("button",{onClick:()=>F(null),className:"p-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",title:"Close",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]}),(0,r.jsx)("div",{className:"p-4 max-h-[80vh] overflow-y-auto",children:(0,r.jsx)(c.A,{url:U.url,type:U.type,name:U.name})})]})})}),(0,r.jsx)(l.AnimatePresence,{children:I&&(0,r.jsx)(l.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black bg-opacity-50 z-[60] flex items-center justify-center p-4",onClick:()=>M(!1),children:(0,r.jsxs)(l.motion.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl p-6 w-full max-w-md",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsx)("h3",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:"Upload File"}),(0,r.jsx)("button",{onClick:()=>M(!1),className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-200",children:(0,r.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)(m.A,{onFileSelect:T,onRemoveFile:()=>T(null),selectedFile:D,uploading:O,className:"mb-4"}),D&&(0,r.jsxs)("div",{className:"flex justify-end space-x-3",children:[(0,r.jsx)("button",{onClick:()=>{M(!1),T(null)},className:"px-4 py-2 text-gray-600 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200",children:"Cancel"}),(0,r.jsx)("button",{onClick:et,disabled:O,className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg disabled:opacity-50 disabled:cursor-not-allowed",children:O?"Uploading...":"Send File"})]})]})})})]}):(0,r.jsx)("div",{className:"text-center p-8",children:"Chat not found."})};a()}catch(e){a(e)}})}};

CasperSecurity Mini