@usechat/react-native 1.0.13 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,459 +1,463 @@
1
1
  'use client'
2
- "use strict";var Os=Object.create;var Zt=Object.defineProperty;var Fs=Object.getOwnPropertyDescriptor;var Hs=Object.getOwnPropertyNames;var Ns=Object.getPrototypeOf,Ws=Object.prototype.hasOwnProperty;var Us=(M,T)=>()=>(M&&(T=M(M=0)),T);var as=(M,T)=>{for(var C in T)Zt(M,C,{get:T[C],enumerable:!0})},is=(M,T,C,R)=>{if(T&&typeof T=="object"||typeof T=="function")for(let S of Hs(T))!Ws.call(M,S)&&S!==C&&Zt(M,S,{get:()=>T[S],enumerable:!(R=Fs(T,S))||R.enumerable});return M};var Q=(M,T,C)=>(C=M!=null?Os(Ns(M)):{},is(T||!M||!M.__esModule?Zt(C,"default",{value:M,enumerable:!0}):C,M)),Ks=M=>is(Zt({},"__esModule",{value:!0}),M);var zs={};as(zs,{copyToClipboard:()=>zr,isClipboardAvailable:()=>Br});var zr,Br,Bs=Us(()=>{"use strict";zr=async M=>{console.log("copyToClipboard called with text:",M);try{try{let{setStringAsync:T}=await import("expo-clipboard");console.log("expo-clipboard imported successfully"),console.log("setStringAsync function:",T),await T(M),console.log("Text copied to clipboard successfully")}catch(T){throw console.error("Failed to import expo-clipboard:",T),new Error("expo-clipboard not available")}try{let T=await import("react-native-toast-message"),C=T.default||T;console.log("react-native-toast-message imported successfully"),C.show({type:"success",text1:"Copied to clipboard",text2:"Message copied successfully",position:"bottom",visibilityTime:2e3}),console.log("Toast shown successfully")}catch(T){console.log("Toast not available, but message copied to clipboard"),console.error("Toast import error:",T)}return!0}catch(T){console.error("Failed to copy to clipboard:",T);try{let C=await import("react-native-toast-message");(C.default||C).show({type:"error",text1:"Copy failed",text2:"Failed to copy message to clipboard",position:"bottom",visibilityTime:2e3})}catch(C){console.error("Copy failed: expo-clipboard not available"),console.error("Toast import error:",C)}return!1}},Br=async()=>{try{return await import("expo-clipboard"),!0}catch{return!1}}});var an={};as(an,{AttachmentMenu:()=>Jr,Chat:()=>Or,ChatAvatar:()=>_r,ChatHeader:()=>Yr,ChatItem:()=>$r,ChatList:()=>qr,ChatListSearchBar:()=>Gr,ChatProvider:()=>Fr,ChatScreenHeader:()=>Ur,MessageInput:()=>Wr,MessageList:()=>Nr,ThemeProvider:()=>Xr,TypingIndicator:()=>Kr,defaultTheme:()=>St,getAuthState:()=>cs,getProjectId:()=>ds,initChat:()=>ms,isInitialized:()=>us,useAttachments:()=>rn,useChatConfig:()=>Hr,useChatMessages:()=>en,useChatSDK:()=>Zr,useMessageActions:()=>on,useMessageInput:()=>nn,useMessageList:()=>tn,useMessageReactions:()=>sn,useTheme:()=>Qr});module.exports=Ks(an);var nt={isInitialized:!1,projectId:null,error:null},ls=M=>{nt={isInitialized:!0,projectId:M,error:null}},bt=M=>{nt={isInitialized:!1,projectId:null,error:M}};var cs=()=>({...nt}),Tt=()=>{if(nt.error)throw new Error(`UseChat SDK initialization failed: ${nt.error}
2
+ "use strict";var tn=Object.create;var ko=Object.defineProperty;var on=Object.getOwnPropertyDescriptor;var sn=Object.getOwnPropertyNames;var nn=Object.getPrototypeOf,an=Object.prototype.hasOwnProperty;var rn=(C,R)=>()=>(C&&(R=C(C=0)),R);var Rs=(C,R)=>{for(var M in R)ko(C,M,{get:R[M],enumerable:!0})},Ss=(C,R,M,T)=>{if(R&&typeof R=="object"||typeof R=="function")for(let S of sn(R))!an.call(C,S)&&S!==M&&ko(C,S,{get:()=>R[S],enumerable:!(T=on(R,S))||T.enumerable});return C};var X=(C,R,M)=>(M=C!=null?tn(nn(C)):{},Ss(R||!C||!C.__esModule?ko(M,"default",{value:C,enumerable:!0}):M,C)),ln=C=>Ss(ko({},"__esModule",{value:!0}),C);var Ys={};Rs(Ys,{copyToClipboard:()=>Ln,isClipboardAvailable:()=>jn});var Ln,jn,Gs=rn(()=>{"use strict";Ln=async C=>{console.log("copyToClipboard called with text:",C);try{try{let{setStringAsync:R}=await import("expo-clipboard");console.log("expo-clipboard imported successfully"),console.log("setStringAsync function:",R),await R(C),console.log("Text copied to clipboard successfully")}catch(R){throw console.error("Failed to import expo-clipboard:",R),new Error("expo-clipboard not available")}try{let R=await import("react-native-toast-message"),M=R.default||R;console.log("react-native-toast-message imported successfully"),M.show({type:"success",text1:"Copied to clipboard",text2:"Message copied successfully",position:"bottom",visibilityTime:2e3}),console.log("Toast shown successfully")}catch(R){console.log("Toast not available, but message copied to clipboard"),console.error("Toast import error:",R)}return!0}catch(R){console.error("Failed to copy to clipboard:",R);try{let M=await import("react-native-toast-message");(M.default||M).show({type:"error",text1:"Copy failed",text2:"Failed to copy message to clipboard",position:"bottom",visibilityTime:2e3})}catch(M){console.error("Copy failed: expo-clipboard not available"),console.error("Toast import error:",M)}return!1}},jn=async()=>{try{return await import("expo-clipboard"),!0}catch{return!1}}});var ua={};Rs(ua,{AttachmentMenu:()=>ta,Chat:()=>Un,ChatAvatar:()=>ea,ChatHeader:()=>Zn,ChatItem:()=>Xn,ChatList:()=>Jn,ChatListSearchBar:()=>Qn,ChatProvider:()=>Kn,ChatScreenHeader:()=>Gn,I18nProvider:()=>Xt,MessageInput:()=>Yn,MessageList:()=>$n,ThemeProvider:()=>oa,TypingIndicator:()=>_n,defaultTheme:()=>Vt,defaultTranslations:()=>_t,getAuthState:()=>Is,getProjectId:()=>vs,getTranslation:()=>zt,initChat:()=>As,isInitialized:()=>Ps,isSupportedLocale:()=>Jt,useAttachments:()=>ca,useChatConfig:()=>qn,useChatMessages:()=>aa,useChatSDK:()=>na,useMessageActions:()=>ia,useMessageInput:()=>da,useMessageList:()=>ra,useMessageReactions:()=>la,useTheme:()=>sa,useTranslation:()=>as,useTranslationFunction:()=>We});module.exports=ln(ua);var lt={isInitialized:!1,projectId:null,error:null},ws=C=>{lt={isInitialized:!0,projectId:C,error:null}},Rt=C=>{lt={isInitialized:!1,projectId:null,error:C}};var Is=()=>({...lt}),At=()=>{if(lt.error)throw new Error(`UseChat SDK initialization failed: ${lt.error}
3
3
 
4
4
  Please call initChat() with a valid project ID before using any UseChat components or hooks.
5
5
 
6
6
  Example:
7
7
  import { initChat } from '@usechat/react-native';
8
- await initChat({ projectId: 'your-project-id' });`);if(!nt.isInitialized)throw new Error(`UseChat SDK is not initialized.
8
+ await initChat({ projectId: 'your-project-id' });`);if(!lt.isInitialized)throw new Error(`UseChat SDK is not initialized.
9
9
 
10
10
  Please call initChat() with a valid project ID before using any UseChat components or hooks.
11
11
 
12
12
  Example:
13
13
  import { initChat } from '@usechat/react-native';
14
- await initChat({ projectId: 'your-project-id' });`)},ds=()=>(Tt(),nt.projectId),us=()=>nt.isInitialized&&!nt.error;var ms=async M=>{let{projectId:T,apiUrl:C="http://localhost:3000/api/chat/init",debug:R=!1}=M;if(!T){let S="Project ID is required";throw bt(S),new Error(S)}try{R&&console.log(`[UseChat SDK] Validating projectId: ${T}`);let S=await fetch(C,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:T})});if(R&&console.log(`[Chat SDK] Response status: ${S.status}, ok: ${S.ok}`),!S.ok){let P=`HTTP ${S.status}: ${S.statusText}`;try{let B=await S.json();P=B.error||B.message||P}catch{try{let E=await S.text();E&&(P=`Server error: ${E}`)}catch{P=`Failed to initialize chat (HTTP ${S.status})`}}throw bt(P),new Error(P)}let A;try{let P=await S.text();if(R&&console.log(`[Chat SDK] Response text: ${P}`),!P){let B="Server returned empty response";throw bt(B),new Error(B)}A=JSON.parse(P)}catch(P){R&&console.error("[Chat SDK] JSON parse error:",P);let B="Server returned invalid JSON response";throw bt(B),new Error(B)}if(!A||typeof A!="object"){let P="Server returned invalid response format";throw bt(P),new Error(P)}let I=A;return R&&console.log(`[UseChat SDK] Successfully initialized with projectId: ${T}`),ls(T),I}catch(S){R&&console.error("[Chat SDK] Init error:",S);let A;throw S instanceof TypeError&&S.message.includes("fetch")?A="Network error: Unable to connect to server. Please check your internet connection.":S instanceof Error?A=S.message:A="Failed to initialize chat: Unknown error",A.includes("Project ID is required")||bt(A),new Error(A)}};var ve=Q(require("react")),ot=require("react-native");var eo=require("react"),gs=require("react-native"),to=require("react-native-keyboard-controller"),ps=(0,eo.createContext)(null),qs=({children:M,config:T={}})=>{let C={keyboardBehavior:"padding",keyboardVerticalOffset:60,enableReactionDetails:!0,enableMessageActions:!0,enableScrollToBottom:!0,enableTypingIndicator:!0,...T};return<ps.Provider value={{config:C}}>
15
- <to.KeyboardProvider>
16
- <to.KeyboardAvoidingView behavior={C.keyboardBehavior}style={[$s.keyboardContainer]}keyboardVerticalOffset={C.keyboardVerticalOffset}>
17
- {}
18
- {M}
19
- </to.KeyboardAvoidingView>
20
- </to.KeyboardProvider>
21
- </ps.Provider>},Uo=qs,Ht=()=>{let M=(0,eo.useContext)(ps);if(!M)throw new Error("useChatConfig must be used within a ChatProvider");return M.config},$s=gs.StyleSheet.create({container:{flex:1},keyboardContainer:{flex:1,overflow:"hidden"}});var tt=require("react"),Nt=(M={})=>{let{uploader:T,maxAttachments:C=10,maxFileSize:R=10*1024*1024,allowedTypes:S=["image/*","application/pdf","text/*"],onAttachmentAdd:A,onAttachmentRemove:I,onAttachmentUpload:P}=M,[B,E]=(0,tt.useState)([]),[v,V]=(0,tt.useState)(!1),[D,z]=(0,tt.useState)(0),L=(0,tt.useCallback)(N=>{if(B.length>=C){console.warn(`Maximum ${C} attachments allowed`);return}if(N.data?.size&&N.data.size>R){console.warn(`File size exceeds ${R/(1024*1024)}MB limit`);return}if(N.data?.type&&!S.some(Ee=>Ee.endsWith("/*")?N.data.type.startsWith(Ee.slice(0,-1)):N.data.type===Ee)){console.warn(`File type ${N.data.type} not allowed`);return}let j={...N,id:N.id||`att_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,uploadStatus:"pending",uploadProgress:0};E(oe=>[...oe,j]),A&&A(j)},[B.length,C,R,S,A]),k=(0,tt.useCallback)(N=>{E(j=>j.filter(oe=>oe.id!==N)),I&&I(N)},[I]),O=(0,tt.useCallback)(()=>{E([])},[]),F=(0,tt.useCallback)(async N=>{try{let j;switch(N){case"image":j={type:"image",data:{uri:"mock-image-uri",width:800,height:600,fileName:"image.jpg",fileSize:1024*1024}};break;case"document":j={type:"document",data:{uri:"mock-document-uri",name:"document.pdf",size:2048*1024,mimeType:"application/pdf"}};break;case"location":j={type:"location",data:{coordinates:{latitude:0,longitude:0},address:"Mock Address",timestamp:Date.now()}};break;case"contact":j={type:"contact",data:{id:"contact-1",name:"John Doe",phoneNumbers:["+1234567890"],emails:["john@example.com"]}};break;default:throw new Error(`Unsupported attachment type: ${N}`)}let oe={id:`att_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,type:N,data:j.data,fileName:j.data.fileName||j.data.name,fileSize:j.data.fileSize||j.data.size,mimeType:j.data.mimeType,uploadStatus:"pending",uploadProgress:0};L(oe)}catch(j){console.error("Error opening picker:",j)}},[L]),H=(0,tt.useCallback)(async()=>{if(!T)return console.warn("No uploader provided, skipping upload"),B;if(B.length===0)return[];V(!0),z(0);try{let N=B.map(async(J,Me)=>{try{E(Ce=>Ce.map(U=>U.id===J.id?{...U,uploadStatus:"uploading",uploadProgress:0}:U));let je=setInterval(()=>{E(Ce=>Ce.map(U=>U.id===J.id?{...U,uploadProgress:Math.min((U.uploadProgress??0)+10,90)}:U))},100),Ke=await T.upload(J.data);clearInterval(je);let Be={...J,uploadStatus:"completed",uploadProgress:100,data:{...J.data,url:Ke.url,metadata:Ke.metadata}};return E(Ce=>Ce.map(U=>U.id===J.id?Be:U)),Be}catch(je){return console.error(`Error uploading attachment ${J.id}:`,je),E(Ke=>Ke.map(Be=>Be.id===J.id?{...Be,uploadStatus:"failed",uploadProgress:0}:Be)),{...J,uploadStatus:"failed",uploadProgress:0}}}),j=await Promise.all(N),Ee=j.filter(J=>J.uploadStatus==="completed").length/j.length*100;return z(Ee),P&&P(j),j}catch(N){return console.error("Error uploading attachments:",N),B}finally{V(!1)}},[B,T,P]);return{attachments:B,openPicker:F,addAttachment:L,removeAttachment:k,clearAttachments:O,uploadAttachments:H,isUploading:v,uploadProgress:D}};var $e=require("react"),hs=(M={})=>{let{onSend:T,onFocus:C,initialValue:R="",maxLength:S=1e3}=M,[A,I]=(0,$e.useState)(R),[P,B]=(0,$e.useState)(40),[E,v]=(0,$e.useState)(!1),V=(0,$e.useCallback)(H=>{H.length<=S&&I(H)},[S]),D=(0,$e.useCallback)(H=>{if(!A.trim()&&(!H||H.length===0))return;let N=A.trim();T&&T(N,H),I(""),B(40)},[A,T]),z=(0,$e.useCallback)(()=>{v(!0),C&&C()},[C]),L=(0,$e.useCallback)(()=>{v(!1)},[]),k=(0,$e.useCallback)(H=>{B(Math.max(40,Math.min(H,120)))},[]),O=(0,$e.useCallback)(()=>{I(""),B(40)},[]),F=(0,$e.useCallback)(H=>{I(H)},[]);return{message:A,composerHeight:P,isFocused:E,handleTextChange:V,handleSend:D,handleFocus:z,handleBlur:L,handleContentSizeChange:k,clearMessage:O,setMessage:F}};var Ys=({messages:M,components:T={},renderProps:C={},onMessageSend:R,onReactionAdd:S,onReactionRemove:A,onMessageDelete:I,onActionPress:P,attachmentUploader:B,maxAttachments:E=10,maxFileSize:v=10*1024*1024,allowedFileTypes:V=["image/*","application/pdf","text/*"],enableReactionDetails:D,enableMessageActions:z=!0,enableScrollToBottom:L,enableTypingIndicator:k,isTyping:O=!1,typingUserName:F,isLoading:H=!1,loadingComponent:N})=>{let j=Ht(),[oe,Ee]=(0,ve.useState)(!1),J=T.MessageList||ut,Me=T.MessageInput||dt,je=D??j.enableReactionDetails??!0,Ke=z??j.enableMessageActions??!0,Be=L??j.enableScrollToBottom??!0,Ce=k??j.enableTypingIndicator??!0,[U,Oe]=(0,ve.useState)(null),Ze=(0,ve.useRef)(null),[Ge,Ve]=(0,ve.useState)(M||[]),qe=(0,ve.useRef)((M||[]).length+1);ve.default.useEffect(()=>{M&&(Ve(M),qe.current=M.length+1)},[M]),ve.default.useEffect(()=>{if(U&&Ze.current){let K=setTimeout(()=>{Ze.current?.focus()},150);return()=>clearTimeout(K)}},[U]);let et=Nt({uploader:B,maxAttachments:E,maxFileSize:v,allowedTypes:V}),Se=hs({onSend:(K,G)=>{if(U){let X={id:U.id,text:U.text,senderName:U.senderName,senderId:U.senderId,isMe:U.isMe,timestamp:U.timestamp,type:U.type==="image"?"image":"text",imageData:U.imageData};if(G&&G.length>0){let q=G[0],Ie={id:qe.current++,text:K.trim(),isMe:!0,timestamp:new Date().toISOString(),status:"sent",replyTo:X,attachments:G,type:q.type==="image"?"image":"text",...q.type==="image"&&q.data&&{imageData:{uri:q.data.uri||"",width:q.data.width||300,height:q.data.height||200,fileName:q.fileName||"image.jpg",fileSize:q.fileSize||0}}};Ve(_e=>[..._e,Ie]),R&&R(Ie)}else{let q={id:qe.current++,text:K.trim(),isMe:!0,timestamp:new Date().toISOString(),status:"sent",replyTo:X};Ve(Ie=>[...Ie,q]),R&&R(q)}Oe(null)}else if(G&&G.length>0){let X=G[0],q={id:qe.current++,text:K.trim(),isMe:!0,timestamp:new Date().toISOString(),status:"sent",attachments:G,type:X.type==="image"?"image":"text",...X.type==="image"&&X.data&&{imageData:{uri:X.data.uri||"",width:X.data.width||300,height:X.data.height||200,fileName:X.fileName||"image.jpg",fileSize:X.fileSize||0}}};Ve(Ie=>[...Ie,q]),R&&R(q)}else{let X={id:qe.current++,text:K.trim(),isMe:!0,timestamp:new Date().toISOString(),status:"sent"};Ve(q=>[...q,X]),R&&R(X)}et.clearAttachments()},onFocus:()=>{}}),ct=(0,ve.useCallback)((K,G)=>{console.log("\u{1F525} Chat - addReaction called with messageId:",K,"and emoji:",G),Ve(X=>X.map(q=>q.id===K?q.reactions?.find(_e=>_e.emoji===G)?{...q,reactions:q.reactions?.map(_e=>_e.emoji===G?{..._e,count:_e.count+1,users:[..._e.users,"currentUser"]}:_e)}:{...q,reactions:[...q.reactions||[],{emoji:G,count:1,users:["currentUser"]}]}:q)),S&&S(K,G)},[S]),No=(0,ve.useCallback)((K,G)=>{Ve(X=>X.map(q=>q.id===K?{...q,reactions:q.reactions?.map(Ie=>Ie.emoji===G?{...Ie,count:Math.max(0,Ie.count-1),users:Ie.users.filter(_e=>_e!=="currentUser")}:Ie).filter(Ie=>Ie.count>0)}:q)),A&&A(K,G)},[A]),Wo=(0,ve.useCallback)(K=>{Ve(G=>G.map(X=>X.id===K?{...X,deleted:!0,text:"",reactions:void 0}:X)),I&&I(K)},[I]),Pe=(0,ve.useCallback)(()=>{Oe(null)},[]),Fe=(0,ve.useCallback)(K=>{Oe(K),setTimeout(()=>{Ze.current?.focus()},100)},[]),Ft=(0,ve.useCallback)(K=>{if(oe)return;let{layout:G}=K.nativeEvent;G.height<=0||Ee(!0)},[oe]);if(H)return<ot.View style={Mt.container}>
22
- {N||<ot.View style={Mt.loadingContainer}>
14
+ await initChat({ projectId: 'your-project-id' });`)},vs=()=>(At(),lt.projectId),Ps=()=>lt.isInitialized&&!lt.error;var As=async C=>{let{projectId:R,apiUrl:M="http://localhost:3000/api/chat/init",debug:T=!1}=C;if(!R){let S="Project ID is required";throw Rt(S),new Error(S)}try{T&&console.log(`[UseChat SDK] Validating projectId: ${R}`);let S=await fetch(M,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:R})});if(T&&console.log(`[Chat SDK] Response status: ${S.status}, ok: ${S.ok}`),!S.ok){let P=`HTTP ${S.status}: ${S.statusText}`;try{let z=await S.json();P=z.error||z.message||P}catch{try{let E=await S.text();E&&(P=`Server error: ${E}`)}catch{P=`Failed to initialize chat (HTTP ${S.status})`}}throw Rt(P),new Error(P)}let A;try{let P=await S.text();if(T&&console.log(`[Chat SDK] Response text: ${P}`),!P){let z="Server returned empty response";throw Rt(z),new Error(z)}A=JSON.parse(P)}catch(P){T&&console.error("[Chat SDK] JSON parse error:",P);let z="Server returned invalid JSON response";throw Rt(z),new Error(z)}if(!A||typeof A!="object"){let P="Server returned invalid response format";throw Rt(P),new Error(P)}let I=A;return T&&console.log(`[UseChat SDK] Successfully initialized with projectId: ${R}`),ws(R),I}catch(S){T&&console.error("[Chat SDK] Init error:",S);let A;throw S instanceof TypeError&&S.message.includes("fetch")?A="Network error: Unable to connect to server. Please check your internet connection.":S instanceof Error?A=S.message:A="Failed to initialize chat: Unknown error",A.includes("Project ID is required")||Rt(A),new Error(A)}};var Pe=X(require("react")),at=require("react-native");var Do=require("react"),zs=require("react-native"),Lo=require("react-native-keyboard-controller");var st=require("react");var cn={"input.placeholder":"Type a message...","search.placeholder":"Search chats...","status.online":"Online","status.offline":"Offline","status.typing":"typing...","message.deleted":"This message was deleted","message.sending":"Sending...","message.sent":"Sent","message.delivered":"Delivered","message.read":"Read","message.failed":"Failed to send","action.reply":"Reply","action.copy":"Copy","action.delete":"Delete","action.cancel":"Cancel","action.send":"Send","action.clear":"Clear","action.clearAll":"Clear All","attachment.add":"Add attachment","attachment.remove":"Remove","attachment.clear":"Clear","attachment.attachments":"Attachments:","accessibility.back":"Go back","accessibility.send":"Send message","accessibility.attach":"Add attachment","accessibility.emoji":"Add emoji","accessibility.videoCall":"Start video call","accessibility.voiceCall":"Start voice call","accessibility.info":"Chat info","accessibility.search":"Search chats","accessibility.typing":"Someone is typing","error.fileTooLarge":"File is too large","error.invalidFileType":"Invalid file type","error.maxAttachments":"Maximum attachments reached","error.networkError":"Network error occurred","time.justNow":"Just now","time.minutesAgo":"{{count}} min ago","time.hoursAgo":"{{count}}h ago","time.daysAgo":"{{count}}d ago","time.weeksAgo":"{{count}}w ago","time.monthsAgo":"{{count}}mo ago","time.yearsAgo":"{{count}}y ago"},dn={"input.placeholder":"Napisz wiadomo\u015B\u0107...","search.placeholder":"Szukaj czat\xF3w...","status.online":"Online","status.offline":"Offline","status.typing":"pisze...","message.deleted":"Ta wiadomo\u015B\u0107 zosta\u0142a usuni\u0119ta","message.sending":"Wysy\u0142anie...","message.sent":"Wys\u0142ano","message.delivered":"Dostarczono","message.read":"Przeczytano","message.failed":"Nie uda\u0142o si\u0119 wys\u0142a\u0107","action.reply":"Odpowiedz","action.copy":"Kopiuj","action.delete":"Usu\u0144","action.cancel":"Anuluj","action.send":"Wy\u015Blij","action.clear":"Wyczy\u015B\u0107","action.clearAll":"Wyczy\u015B\u0107 wszystko","attachment.add":"Dodaj za\u0142\u0105cznik","attachment.remove":"Usu\u0144","attachment.clear":"Wyczy\u015B\u0107","attachment.attachments":"Za\u0142\u0105czniki:","accessibility.back":"Wr\xF3\u0107","accessibility.send":"Wy\u015Blij wiadomo\u015B\u0107","accessibility.attach":"Dodaj za\u0142\u0105cznik","accessibility.emoji":"Dodaj emoji","accessibility.videoCall":"Rozpocznij wideorozmow\u0119","accessibility.voiceCall":"Rozpocznij rozmow\u0119 g\u0142osow\u0105","accessibility.info":"Informacje o czacie","accessibility.search":"Szukaj czat\xF3w","accessibility.typing":"Kto\u015B pisze","error.fileTooLarge":"Plik jest za du\u017Cy","error.invalidFileType":"Nieprawid\u0142owy typ pliku","error.maxAttachments":"Osi\u0105gni\u0119to maksymaln\u0105 liczb\u0119 za\u0142\u0105cznik\xF3w","error.networkError":"Wyst\u0105pi\u0142 b\u0142\u0105d sieci","time.justNow":"W\u0142a\u015Bnie teraz","time.minutesAgo":"{{count}} min temu","time.hoursAgo":"{{count}}h temu","time.daysAgo":"{{count}}d temu","time.weeksAgo":"{{count}}t temu","time.monthsAgo":"{{count}}mies temu","time.yearsAgo":"{{count}}l temu"},_t={en:cn,pl:dn},zt=C=>_t[C]||_t.en,Jt=C=>C==="en"||C==="pl";var ns=(0,st.createContext)(void 0),Xt=({children:C,locale:R="en",fallbackLocale:M="en"})=>{let[T,S]=(0,st.useState)(R),A=(0,st.useCallback)((z,E={})=>{let k=zt(T)[z];return!k&&T!==M&&(k=zt(M)[z]),k?k.replace(/\{\{(\w+)\}\}/g,(D,V)=>E[V]?.toString()||D):(console.warn(`Translation missing for key: ${z} in locale: ${T}`),z)},[T,M]),I=(0,st.useCallback)(z=>{Jt(z)?S(z):(console.warn(`Unsupported locale: ${z}. Falling back to 'en'`),S("en"))},[]),P={t:A,locale:T,setLocale:I};return<ns.Provider value={P}>
15
+ {C}
16
+ </ns.Provider>},as=()=>{let C=(0,st.useContext)(ns);if(!C)throw new Error("useTranslation must be used within an I18nProvider");return C},We=()=>{let C=(0,st.useContext)(ns);return C?C.t:R=>R};var Vs=(0,Do.createContext)(null),un=({children:C,config:R={},locale:M="en"})=>{let T={keyboardBehavior:"padding",keyboardVerticalOffset:60,enableReactionDetails:!0,enableMessageActions:!0,enableScrollToBottom:!0,enableTypingIndicator:!0,...R};return<Xt locale={M}>
17
+ <Vs.Provider value={{config:T}}>
18
+ <Lo.KeyboardProvider>
19
+ <Lo.KeyboardAvoidingView behavior={T.keyboardBehavior}style={[mn.keyboardContainer]}keyboardVerticalOffset={T.keyboardVerticalOffset}>
23
20
  {}
24
- </ot.View>}
25
- </ot.View>;if(!oe)return<ot.View style={Mt.container}>
26
- <ot.View style={Mt.chatContainer}onLayout={Ft}>
27
- <ot.View style={Mt.loadingContainer}>{N}</ot.View>
28
- </ot.View>
29
- </ot.View>;let ns=C.renderInput;return<ot.View style={Mt.container}>
30
- <ot.View style={Mt.fill}>
31
- <J messages={Ge}isTyping={Ce?O:!1}typingUserName={F}showScrollToBottom={Be}isReplyActive={!!U}enableMessageActions={Ke}enableReactionDetails={je}onReactionAdd={ct}onReactionRemove={No}onMessageDelete={Wo}onReplyMessage={Fe}onActionPress={(K,G)=>{K==="reply"?Fe(G):P?.(K,G)}}/>
21
+ {C}
22
+ </Lo.KeyboardAvoidingView>
23
+ </Lo.KeyboardProvider>
24
+ </Vs.Provider>
25
+ </Xt>},rs=un,Zt=()=>{let C=(0,Do.useContext)(Vs);if(!C)throw new Error("useChatConfig must be used within a ChatProvider");return C.config},mn=zs.StyleSheet.create({container:{flex:1},keyboardContainer:{flex:1,overflow:"hidden"}});var nt=require("react"),Qt=(C={})=>{let{uploader:R,maxAttachments:M=10,maxFileSize:T=10*1024*1024,allowedTypes:S=["image/*","application/pdf","text/*"],onAttachmentAdd:A,onAttachmentRemove:I,onAttachmentUpload:P}=C,[z,E]=(0,nt.useState)([]),[v,k]=(0,nt.useState)(!1),[D,V]=(0,nt.useState)(0),B=(0,nt.useCallback)(N=>{if(z.length>=M){console.warn(`Maximum ${M} attachments allowed`);return}if(N.data?.size&&N.data.size>T){console.warn(`File size exceeds ${T/(1024*1024)}MB limit`);return}if(N.data?.type&&!S.some(Le=>Le.endsWith("/*")?N.data.type.startsWith(Le.slice(0,-1)):N.data.type===Le)){console.warn(`File type ${N.data.type} not allowed`);return}let O={...N,id:N.id||`att_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,uploadStatus:"pending",uploadProgress:0};E(te=>[...te,O]),A&&A(O)},[z.length,M,T,S,A]),L=(0,nt.useCallback)(N=>{E(O=>O.filter(te=>te.id!==N)),I&&I(N)},[I]),F=(0,nt.useCallback)(()=>{E([])},[]),j=(0,nt.useCallback)(async N=>{try{let O;switch(N){case"image":O={type:"image",data:{uri:"mock-image-uri",width:800,height:600,fileName:"image.jpg",fileSize:1024*1024}};break;case"document":O={type:"document",data:{uri:"mock-document-uri",name:"document.pdf",size:2048*1024,mimeType:"application/pdf"}};break;case"location":O={type:"location",data:{coordinates:{latitude:0,longitude:0},address:"Mock Address",timestamp:Date.now()}};break;case"contact":O={type:"contact",data:{id:"contact-1",name:"John Doe",phoneNumbers:["+1234567890"],emails:["john@example.com"]}};break;default:throw new Error(`Unsupported attachment type: ${N}`)}let te={id:`att_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,type:N,data:O.data,fileName:O.data.fileName||O.data.name,fileSize:O.data.fileSize||O.data.size,mimeType:O.data.mimeType,uploadStatus:"pending",uploadProgress:0};B(te)}catch(O){console.error("Error opening picker:",O)}},[B]),H=(0,nt.useCallback)(async()=>{if(!R)return console.warn("No uploader provided, skipping upload"),z;if(z.length===0)return[];k(!0),V(0);try{let N=z.map(async(Ce,Ee)=>{try{E(Ye=>Ye.map(U=>U.id===Ce.id?{...U,uploadStatus:"uploading",uploadProgress:0}:U));let Me=setInterval(()=>{E(Ye=>Ye.map(U=>U.id===Ce.id?{...U,uploadProgress:Math.min((U.uploadProgress??0)+10,90)}:U))},100),ke=await R.upload(Ce.data);clearInterval(Me);let Ae={...Ce,uploadStatus:"completed",uploadProgress:100,data:{...Ce.data,url:ke.url,metadata:ke.metadata}};return E(Ye=>Ye.map(U=>U.id===Ce.id?Ae:U)),Ae}catch(Me){return console.error(`Error uploading attachment ${Ce.id}:`,Me),E(ke=>ke.map(Ae=>Ae.id===Ce.id?{...Ae,uploadStatus:"failed",uploadProgress:0}:Ae)),{...Ce,uploadStatus:"failed",uploadProgress:0}}}),O=await Promise.all(N),Le=O.filter(Ce=>Ce.uploadStatus==="completed").length/O.length*100;return V(Le),P&&P(O),O}catch(N){return console.error("Error uploading attachments:",N),z}finally{k(!1)}},[z,R,P]);return{attachments:z,openPicker:j,addAttachment:B,removeAttachment:L,clearAttachments:F,uploadAttachments:H,isUploading:v,uploadProgress:D}};var Je=require("react"),Bs=(C={})=>{let{onSend:R,onFocus:M,initialValue:T="",maxLength:S=1e3}=C,[A,I]=(0,Je.useState)(T),[P,z]=(0,Je.useState)(40),[E,v]=(0,Je.useState)(!1),k=(0,Je.useCallback)(H=>{H.length<=S&&I(H)},[S]),D=(0,Je.useCallback)(H=>{if(!A.trim()&&(!H||H.length===0))return;let N=A.trim();R&&R(N,H),I(""),z(40)},[A,R]),V=(0,Je.useCallback)(()=>{v(!0),M&&M()},[M]),B=(0,Je.useCallback)(()=>{v(!1)},[]),L=(0,Je.useCallback)(H=>{z(Math.max(40,Math.min(H,120)))},[]),F=(0,Je.useCallback)(()=>{I(""),z(40)},[]),j=(0,Je.useCallback)(H=>{I(H)},[]);return{message:A,composerHeight:P,isFocused:E,handleTextChange:k,handleSend:D,handleFocus:V,handleBlur:B,handleContentSizeChange:L,clearMessage:F,setMessage:j}};var pn=({messages:C,components:R={},renderProps:M={},onMessageSend:T,onReactionAdd:S,onReactionRemove:A,onMessageDelete:I,onActionPress:P,attachmentUploader:z,maxAttachments:E=10,maxFileSize:v=10*1024*1024,allowedFileTypes:k=["image/*","application/pdf","text/*"],enableReactionDetails:D,enableMessageActions:V=!0,enableScrollToBottom:B,enableTypingIndicator:L,isTyping:F=!1,typingUserName:j,isLoading:H=!1,loadingComponent:N})=>{let O=Zt(),[te,Le]=(0,Pe.useState)(!1),Ce=R.MessageList||pt,Ee=R.MessageInput||mt,Me=D??O.enableReactionDetails??!0,ke=V??O.enableMessageActions??!0,Ae=B??O.enableScrollToBottom??!0,Ye=L??O.enableTypingIndicator??!0,[U,Ge]=(0,Pe.useState)(null),Oe=(0,Pe.useRef)(null),[Mt,Te]=(0,Pe.useState)(C||[]),_e=(0,Pe.useRef)((C||[]).length+1);Pe.default.useEffect(()=>{C&&(Te(C),_e.current=C.length+1)},[C]),Pe.default.useEffect(()=>{if(U&&Oe.current){let K=setTimeout(()=>{Oe.current?.focus()},150);return()=>clearTimeout(K)}},[U]);let Ze=Qt({uploader:z,maxAttachments:E,maxFileSize:v,allowedTypes:k}),we=Bs({onSend:(K,G)=>{if(U){let J={id:U.id,text:U.text,senderName:U.senderName,senderId:U.senderId,isMe:U.isMe,timestamp:U.timestamp,type:U.type==="image"?"image":"text",imageData:U.imageData};if(G&&G.length>0){let q=G[0],ve={id:_e.current++,text:K.trim(),isMe:!0,timestamp:new Date().toISOString(),status:"sent",replyTo:J,attachments:G,type:q.type==="image"?"image":"text",...q.type==="image"&&q.data&&{imageData:{uri:q.data.uri||"",width:q.data.width||300,height:q.data.height||200,fileName:q.fileName||"image.jpg",fileSize:q.fileSize||0}}};Te(Qe=>[...Qe,ve]),T&&T(ve)}else{let q={id:_e.current++,text:K.trim(),isMe:!0,timestamp:new Date().toISOString(),status:"sent",replyTo:J};Te(ve=>[...ve,q]),T&&T(q)}Ge(null)}else if(G&&G.length>0){let J=G[0],q={id:_e.current++,text:K.trim(),isMe:!0,timestamp:new Date().toISOString(),status:"sent",attachments:G,type:J.type==="image"?"image":"text",...J.type==="image"&&J.data&&{imageData:{uri:J.data.uri||"",width:J.data.width||300,height:J.data.height||200,fileName:J.fileName||"image.jpg",fileSize:J.fileSize||0}}};Te(ve=>[...ve,q]),T&&T(q)}else{let J={id:_e.current++,text:K.trim(),isMe:!0,timestamp:new Date().toISOString(),status:"sent"};Te(q=>[...q,J]),T&&T(J)}Ze.clearAttachments()},onFocus:()=>{}}),Pt=(0,Pe.useCallback)((K,G)=>{console.log("\u{1F525} Chat - addReaction called with messageId:",K,"and emoji:",G),Te(J=>J.map(q=>q.id===K?q.reactions?.find(Qe=>Qe.emoji===G)?{...q,reactions:q.reactions?.map(Qe=>Qe.emoji===G?{...Qe,count:Qe.count+1,users:[...Qe.users,"currentUser"]}:Qe)}:{...q,reactions:[...q.reactions||[],{emoji:G,count:1,users:["currentUser"]}]}:q)),S&&S(K,G)},[S]),Tt=(0,Pe.useCallback)((K,G)=>{Te(J=>J.map(q=>q.id===K?{...q,reactions:q.reactions?.map(ve=>ve.emoji===G?{...ve,count:Math.max(0,ve.count-1),users:ve.users.filter(Qe=>Qe!=="currentUser")}:ve).filter(ve=>ve.count>0)}:q)),A&&A(K,G)},[A]),ss=(0,Pe.useCallback)(K=>{Te(G=>G.map(J=>J.id===K?{...J,deleted:!0,text:"",reactions:void 0}:J)),I&&I(K)},[I]),ze=(0,Pe.useCallback)(()=>{Ge(null)},[]),Ne=(0,Pe.useCallback)(K=>{Ge(K),setTimeout(()=>{Oe.current?.focus()},100)},[]),Gt=(0,Pe.useCallback)(K=>{if(te)return;let{layout:G}=K.nativeEvent;G.height<=0||Le(!0)},[te]);if(H)return<at.View style={St.container}>
26
+ {N||<at.View style={St.loadingContainer}>
27
+ {}
28
+ </at.View>}
29
+ </at.View>;if(!te)return<at.View style={St.container}>
30
+ <at.View style={St.chatContainer}onLayout={Gt}>
31
+ <at.View style={St.loadingContainer}>{N}</at.View>
32
+ </at.View>
33
+ </at.View>;let Ts=M.renderInput;return<at.View style={St.container}>
34
+ <at.View style={St.fill}>
35
+ <Ce messages={Mt}isTyping={Ye?F:!1}typingUserName={j}showScrollToBottom={Ae}isReplyActive={!!U}enableMessageActions={ke}enableReactionDetails={Me}onReactionAdd={Pt}onReactionRemove={Tt}onMessageDelete={ss}onReplyMessage={Ne}onActionPress={(K,G)=>{K==="reply"?Ne(G):P?.(K,G)}}/>
32
36
 
33
- {ns?ns({value:Se.message,onChangeText:Se.handleTextChange,onSend:Se.handleSend,onFocus:Se.handleFocus,height:Se.composerHeight,onContentSizeChange:Se.handleContentSizeChange,replyToMessage:U,onCancelReply:Pe,attachments:et.attachments,onAttachmentAdd:et.addAttachment,onAttachmentRemove:et.removeAttachment,onAttachmentUpload:et.uploadAttachments}):<Me ref={Ze}value={Se.message}onChangeText={Se.handleTextChange}onSend={Se.handleSend}onFocus={Se.handleFocus}height={Se.composerHeight}onContentSizeChange={Se.handleContentSizeChange}replyToMessage={U}onCancelReply={Pe}onAttachmentSend={(K,G)=>{let X=K.type==="image",q={id:qe.current++,text:G?.trim()||"",isMe:!0,timestamp:new Date().toISOString(),status:"sent",type:X?"image":"text",...X&&K.data&&{imageData:{uri:K.data.uri||"",width:K.data.width||300,height:K.data.height||200,fileName:K.data.fileName||K.data.name||"image.jpg",fileSize:K.data.fileSize||K.data.size||0}}};Ve(Ie=>[...Ie,q]),R&&R(q),Se.handleTextChange("")}}/>}
37
+ {Ts?Ts({value:we.message,onChangeText:we.handleTextChange,onSend:we.handleSend,onFocus:we.handleFocus,height:we.composerHeight,onContentSizeChange:we.handleContentSizeChange,replyToMessage:U,onCancelReply:ze,attachments:Ze.attachments,onAttachmentAdd:Ze.addAttachment,onAttachmentRemove:Ze.removeAttachment,onAttachmentUpload:Ze.uploadAttachments}):<Ee ref={Oe}value={we.message}onChangeText={we.handleTextChange}onSend={we.handleSend}onFocus={we.handleFocus}height={we.composerHeight}onContentSizeChange={we.handleContentSizeChange}replyToMessage={U}onCancelReply={ze}onAttachmentSend={(K,G)=>{let J=K.type==="image",q={id:_e.current++,text:G?.trim()||"",isMe:!0,timestamp:new Date().toISOString(),status:"sent",type:J?"image":"text",...J&&K.data&&{imageData:{uri:K.data.uri||"",width:K.data.width||300,height:K.data.height||200,fileName:K.data.fileName||K.data.name||"image.jpg",fileSize:K.data.fileSize||K.data.size||0}}};Te(ve=>[...ve,q]),T&&T(q),we.handleTextChange("")}}/>}
34
38
 
35
39
  {}
36
- </ot.View>
40
+ </at.View>
37
41
 
38
42
  {}
39
- </ot.View>},Mt=ot.StyleSheet.create({container:{flex:1},chatContainer:{flex:1,overflow:"hidden"},fill:{flex:1},loadingContainer:{flex:1,justifyContent:"center",alignItems:"center"}}),Ko=Ys;var we=require("react-native"),mt=require("lucide-react-native");var ys=require("react");var oo=require("react");var St={colors:{primary:"#3B82F6",secondary:"#34B7F1",background:"#FFFFFF",surface:"#F7F8FA",surfaceSecondary:"#F3F4F6",text:"#111827",textSecondary:"#6B7280",textMuted:"#9CA3AF",border:"#E5E7EB",borderLight:"#F3F4F6",success:"#10B981",error:"#EF4444",warning:"#F59E0B",unread:"#EBF8FF",online:"#10B981",messageBubble:{sent:"#3B82F6",received:"#E5E7EB",sentText:"#FFFFFF",receivedText:"#111827"},gray:{50:"#F9FAFB",100:"#F3F4F6",200:"#E5E7EB",300:"#D1D5DB",400:"#9CA3AF",500:"#6B7280",600:"#4B5563",700:"#374151",800:"#1F2937",900:"#111827"},blue:{50:"#EBF8FF",500:"#3B82F6",600:"#2563EB"},green:{500:"#10B981"}},spacing:{xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},borderRadius:{sm:4,md:8,lg:12,xl:16,full:9999},typography:{fontFamily:"System",fontSize:{xs:12,sm:14,base:16,lg:18,xl:20,xxl:24},fontWeight:{normal:"400",medium:"500",semibold:"600",bold:"700"},lineHeight:{tight:16,normal:20,relaxed:24}}};var qo=(0,oo.createContext)(St),Gs=(M,T)=>({colors:{...M.colors,...T.colors},spacing:{...M.spacing,...T.spacing},borderRadius:{...M.borderRadius,...T.borderRadius},typography:{...M.typography,...T.typography}}),fs=({children:M,theme:T})=>{let C=(0,oo.useMemo)(()=>T?Gs(St,T):St,[T]);return<qo.Provider value={C}>{M}</qo.Provider>};var $=()=>{let M=(0,ys.useContext)(qo);if(!M)throw new Error("useTheme must be used within a ThemeProvider");return M};var _s=({name:M="George Alan",isOnline:T=!0,onBack:C=()=>{},onVideoCall:R=()=>{},onVoiceCall:S=()=>{},onInfo:A=()=>{}})=>{let I=$();return<we.View style={{flexDirection:"row",alignItems:"center",justifyContent:"space-between",borderBottomWidth:1,borderBottomColor:I.colors.borderLight,backgroundColor:I.colors.background,paddingHorizontal:I.spacing.lg,paddingVertical:I.spacing.md,zIndex:50}}>
40
- <we.View style={{flex:1,flexDirection:"row",alignItems:"center"}}>
41
- <we.TouchableOpacity onPress={C}style={{marginRight:I.spacing.md}}>
42
- <mt.ArrowLeft size={24}color={I.colors.gray[700]}/>
43
- </we.TouchableOpacity>
43
+ </at.View>},St=at.StyleSheet.create({container:{flex:1},chatContainer:{flex:1,overflow:"hidden"},fill:{flex:1},loadingContainer:{flex:1,justifyContent:"center",alignItems:"center"}}),is=pn;var Ie=require("react-native"),gt=require("lucide-react-native");var Ds=require("react");var jo=require("react");var Vt={colors:{primary:"#3B82F6",secondary:"#34B7F1",background:"#FFFFFF",surface:"#F7F8FA",surfaceSecondary:"#F3F4F6",text:"#111827",textSecondary:"#6B7280",textMuted:"#9CA3AF",border:"#E5E7EB",borderLight:"#F3F4F6",success:"#10B981",error:"#EF4444",warning:"#F59E0B",unread:"#EBF8FF",online:"#10B981",messageBubble:{sent:"#3B82F6",received:"#E5E7EB",sentText:"#FFFFFF",receivedText:"#111827"},gray:{50:"#F9FAFB",100:"#F3F4F6",200:"#E5E7EB",300:"#D1D5DB",400:"#9CA3AF",500:"#6B7280",600:"#4B5563",700:"#374151",800:"#1F2937",900:"#111827"},blue:{50:"#EBF8FF",500:"#3B82F6",600:"#2563EB"},green:{500:"#10B981"}},spacing:{xs:4,sm:8,md:12,lg:16,xl:24,xxl:32},borderRadius:{sm:4,md:8,lg:12,xl:16,full:9999},typography:{fontFamily:"System",fontSize:{xs:12,sm:14,base:16,lg:18,xl:20,xxl:24},fontWeight:{normal:"400",medium:"500",semibold:"600",bold:"700"},lineHeight:{tight:16,normal:20,relaxed:24}}};var ls=(0,jo.createContext)(Vt),gn=(C,R)=>({colors:{...C.colors,...R.colors},spacing:{...C.spacing,...R.spacing},borderRadius:{...C.borderRadius,...R.borderRadius},typography:{...C.typography,...R.typography}}),ks=({children:C,theme:R})=>{let M=(0,jo.useMemo)(()=>R?gn(Vt,R):Vt,[R]);return<ls.Provider value={M}>{C}</ls.Provider>};var $=()=>{let C=(0,Ds.useContext)(ls);if(!C)throw new Error("useTheme must be used within a ThemeProvider");return C};var hn=({name:C="George Alan",isOnline:R=!0,onBack:M=()=>{},onVideoCall:T=()=>{},onVoiceCall:S=()=>{},onInfo:A=()=>{}})=>{let I=$(),P=We();return<Ie.View style={{flexDirection:"row",alignItems:"center",justifyContent:"space-between",borderBottomWidth:1,borderBottomColor:I.colors.borderLight,backgroundColor:I.colors.background,paddingHorizontal:I.spacing.lg,paddingVertical:I.spacing.md,zIndex:50}}>
44
+ <Ie.View style={{flex:1,flexDirection:"row",alignItems:"center"}}>
45
+ <Ie.TouchableOpacity onPress={M}style={{marginRight:I.spacing.md}}>
46
+ <gt.ArrowLeft size={24}color={I.colors.gray[700]}/>
47
+ </Ie.TouchableOpacity>
44
48
 
45
- <we.View style={{flex:1,flexDirection:"row",alignItems:"center"}}>
49
+ <Ie.View style={{flex:1,flexDirection:"row",alignItems:"center"}}>
46
50
  {}
47
- <we.View style={{position:"relative",marginRight:I.spacing.md}}>
48
- <we.View style={{height:40,width:40,alignItems:"center",justifyContent:"center",borderRadius:I.borderRadius.full,backgroundColor:I.colors.gray[200]}}>
49
- <we.Text style={{fontSize:I.typography.fontSize.base,color:I.colors.text}}>
51
+ <Ie.View style={{position:"relative",marginRight:I.spacing.md}}>
52
+ <Ie.View style={{height:40,width:40,alignItems:"center",justifyContent:"center",borderRadius:I.borderRadius.full,backgroundColor:I.colors.gray[200]}}>
53
+ <Ie.Text style={{fontSize:I.typography.fontSize.base,color:I.colors.text}}>
50
54
  👤
51
- </we.Text>
52
- </we.View>
53
- {T&&<we.View style={{position:"absolute",bottom:-2,right:-2,height:12,width:12,borderRadius:I.borderRadius.full,borderWidth:1,borderColor:I.colors.background,backgroundColor:I.colors.online}}/>}
54
- </we.View>
55
+ </Ie.Text>
56
+ </Ie.View>
57
+ {R&&<Ie.View style={{position:"absolute",bottom:-2,right:-2,height:12,width:12,borderRadius:I.borderRadius.full,borderWidth:1,borderColor:I.colors.background,backgroundColor:I.colors.online}}/>}
58
+ </Ie.View>
55
59
 
56
- <we.View style={{flex:1}}>
57
- <we.Text style={{fontSize:I.typography.fontSize.lg,fontWeight:I.typography.fontWeight.semibold,color:I.colors.text}}>
58
- {M}
59
- </we.Text>
60
- <we.Text style={{fontSize:I.typography.fontSize.sm,color:I.colors.textSecondary}}>
61
- {T?"Online":"Offline"}
62
- </we.Text>
63
- </we.View>
64
- </we.View>
65
- </we.View>
60
+ <Ie.View style={{flex:1}}>
61
+ <Ie.Text style={{fontSize:I.typography.fontSize.lg,fontWeight:I.typography.fontWeight.semibold,color:I.colors.text}}>
62
+ {C}
63
+ </Ie.Text>
64
+ <Ie.Text style={{fontSize:I.typography.fontSize.sm,color:I.colors.textSecondary}}>
65
+ {P(R?"status.online":"status.offline")}
66
+ </Ie.Text>
67
+ </Ie.View>
68
+ </Ie.View>
69
+ </Ie.View>
66
70
 
67
- <we.View style={{flexDirection:"row",alignItems:"center",gap:I.spacing.lg}}>
71
+ <Ie.View style={{flexDirection:"row",alignItems:"center",gap:I.spacing.lg}}>
68
72
  {}
69
- {R&&<we.TouchableOpacity onPress={R}>
70
- <mt.Video size={24}color={I.colors.gray[700]}/>
71
- </we.TouchableOpacity>}
72
- {S&&<we.TouchableOpacity onPress={S}>
73
- <mt.Phone size={24}color={I.colors.gray[700]}/>
74
- </we.TouchableOpacity>}
75
- {A&&<we.TouchableOpacity onPress={A}>
76
- <mt.Info size={24}color={I.colors.gray[700]}/>
77
- </we.TouchableOpacity>}
78
- </we.View>
79
- </we.View>},so=_s;var Ts=require("react"),Te=require("react-native");var wt=Q(require("dayjs")),xs=Q(require("dayjs/plugin/isToday")),bs=Q(require("dayjs/plugin/isYesterday"));wt.default.extend(xs.default);wt.default.extend(bs.default);var Js=M=>{let T=(0,wt.default)(M);return T.isToday()?"Today":T.isYesterday()?"Yesterday":T.format("ddd D MMMM")},Xs=M=>(0,wt.default)(M).format("YYYY-MM-DD"),Ms=M=>{if(M.length===0)return[];let T=[],C=null;return M.forEach((R,S)=>{let A=Xs(R.timestamp);if(C!==A){let P=Js(R.timestamp),B={id:`date-${A}`,listItemType:"date-separator",date:A,displayDate:P};T.push(B),C=A}let I={...R,listItemType:"message"};T.push(I)}),T},$o=M=>(0,wt.default)(M).format("HH:mm");var Je=require("react-native");var Qs=({replyTo:M,isMyMessage:T})=>{let C=$(),R=(E,v=50)=>E.length<=v?E:E.substring(0,v)+"...",S=T?"rgba(255, 255, 255, 0.3)":C.colors.primary,A=T?"rgba(255, 255, 255, 0.8)":C.colors.primary,I=T?"rgba(255, 255, 255, 0.7)":C.colors.textSecondary,P=T?"rgba(255, 255, 255, 0.1)":C.colors.surfaceSecondary,B=M.type==="image"&&M.imageData;return<Je.View style={{marginBottom:C.spacing.sm,borderRadius:C.borderRadius.md,padding:C.spacing.sm,backgroundColor:P,borderLeftWidth:4,borderLeftColor:S}}>
80
- <Je.Text style={{fontSize:C.typography.fontSize.xs,fontWeight:C.typography.fontWeight.medium,color:A,marginBottom:C.spacing.xs}}>
81
- {M.isMe?"You":M.senderName||"Sender"}
82
- </Je.Text>
73
+ {T&&<Ie.TouchableOpacity onPress={T}>
74
+ <gt.Video size={24}color={I.colors.gray[700]}/>
75
+ </Ie.TouchableOpacity>}
76
+ {S&&<Ie.TouchableOpacity onPress={S}>
77
+ <gt.Phone size={24}color={I.colors.gray[700]}/>
78
+ </Ie.TouchableOpacity>}
79
+ {A&&<Ie.TouchableOpacity onPress={A}>
80
+ <gt.Info size={24}color={I.colors.gray[700]}/>
81
+ </Ie.TouchableOpacity>}
82
+ </Ie.View>
83
+ </Ie.View>},Eo=hn;var Hs=require("react"),Se=require("react-native");var Bt=X(require("dayjs")),Ls=X(require("dayjs/plugin/isToday")),js=X(require("dayjs/plugin/isYesterday"));Bt.default.extend(Ls.default);Bt.default.extend(js.default);var fn=C=>{let R=(0,Bt.default)(C);return R.isToday()?"Today":R.isYesterday()?"Yesterday":R.format("ddd D MMMM")},yn=C=>(0,Bt.default)(C).format("YYYY-MM-DD"),Es=C=>{if(C.length===0)return[];let R=[],M=null;return C.forEach((T,S)=>{let A=yn(T.timestamp);if(M!==A){let P=fn(T.timestamp),z={id:`date-${A}`,listItemType:"date-separator",date:A,displayDate:P};R.push(z),M=A}let I={...T,listItemType:"message"};R.push(I)}),R},cs=C=>(0,Bt.default)(C).format("HH:mm");var et=require("react-native");var xn=({replyTo:C,isMyMessage:R})=>{let M=$(),T=(E,v=50)=>E.length<=v?E:E.substring(0,v)+"...",S=R?"rgba(255, 255, 255, 0.3)":M.colors.primary,A=R?"rgba(255, 255, 255, 0.8)":M.colors.primary,I=R?"rgba(255, 255, 255, 0.7)":M.colors.textSecondary,P=R?"rgba(255, 255, 255, 0.1)":M.colors.surfaceSecondary,z=C.type==="image"&&C.imageData;return<et.View style={{marginBottom:M.spacing.sm,borderRadius:M.borderRadius.md,padding:M.spacing.sm,backgroundColor:P,borderLeftWidth:4,borderLeftColor:S}}>
84
+ <et.Text style={{fontSize:M.typography.fontSize.xs,fontWeight:M.typography.fontWeight.medium,color:A,marginBottom:M.spacing.xs}}>
85
+ {C.isMe?"You":C.senderName||"Sender"}
86
+ </et.Text>
83
87
 
84
- {B?<Je.View style={{flexDirection:"row",alignItems:"center"}}>
85
- <Je.Image source={{uri:M.imageData.uri}}style={{width:40,height:40,borderRadius:C.borderRadius.sm,marginRight:C.spacing.sm}}resizeMode="cover"/>
86
- <Je.View style={{flex:1}}>
87
- <Je.Text style={{fontSize:C.typography.fontSize.xs,color:I,fontStyle:"italic",marginBottom:C.spacing.xs}}>
88
+ {z?<et.View style={{flexDirection:"row",alignItems:"center"}}>
89
+ <et.Image source={{uri:C.imageData.uri}}style={{width:40,height:40,borderRadius:M.borderRadius.sm,marginRight:M.spacing.sm}}resizeMode="cover"/>
90
+ <et.View style={{flex:1}}>
91
+ <et.Text style={{fontSize:M.typography.fontSize.xs,color:I,fontStyle:"italic",marginBottom:M.spacing.xs}}>
88
92
  📷 Image
89
- </Je.Text>
90
- {M.text&&M.text.trim()&&<Je.Text style={{fontSize:C.typography.fontSize.sm,color:I,lineHeight:C.typography.lineHeight.tight}}>
91
- {R(M.text,30)}
92
- </Je.Text>}
93
- </Je.View>
94
- </Je.View>:<Je.Text style={{fontSize:C.typography.fontSize.sm,color:I,lineHeight:C.typography.lineHeight.tight}}>
95
- {R(M.text)}
96
- </Je.Text>}
97
- </Je.View>},It=Qs;var at=require("react"),Re=require("react-native");var{width:Yo,height:Cs}=Re.Dimensions.get("window"),Zs=({imageData:M,isMe:T,onImagePress:C,onLongPress:R})=>{let S=$(),[A,I]=(0,at.useState)(!1),[P,B]=(0,at.useState)(!1),v=(0,at.useCallback)(()=>{let O=Yo*.6,F=300;if(!M.width||!M.height)return{width:O,height:F};let H=M.width/M.height,N=O,j=N/H;return j>F&&(j=F,N=j*H),{width:Math.round(N),height:Math.round(j)}},[M.width,M.height])(),V=(0,at.useCallback)(()=>{C?C():I(!0)},[C]),D=(0,at.useCallback)(()=>{console.error("Failed to load image:",M.uri),B(!0)},[M.uri]),z=(0,at.useCallback)(()=>{I(!1)},[]),k=(0,at.useCallback)(()=>{if(!M.width||!M.height)return{width:Yo,height:Cs*.8};let O=M.width/M.height,F=Yo*.9,H=Cs*.8,N=F,j=N/O;return j>H&&(j=H,N=j*O),{width:Math.round(N),height:Math.round(j)}},[M.width,M.height])();return P?<Re.View style={[gt.errorContainer,{width:v.width,height:v.height,backgroundColor:T?S.colors.messageBubble.sent:S.colors.messageBubble.received,borderRadius:S.borderRadius.lg}]}>
98
- <Re.Text style={[gt.errorText,{color:T?S.colors.messageBubble.sentText:S.colors.messageBubble.receivedText,fontSize:S.typography.fontSize.sm}]}>
93
+ </et.Text>
94
+ {C.text&&C.text.trim()&&<et.Text style={{fontSize:M.typography.fontSize.sm,color:I,lineHeight:M.typography.lineHeight.tight}}>
95
+ {T(C.text,30)}
96
+ </et.Text>}
97
+ </et.View>
98
+ </et.View>:<et.Text style={{fontSize:M.typography.fontSize.sm,color:I,lineHeight:M.typography.lineHeight.tight}}>
99
+ {T(C.text)}
100
+ </et.Text>}
101
+ </et.View>},Dt=xn;var ct=require("react"),Re=require("react-native");var{width:ds,height:Os}=Re.Dimensions.get("window"),bn=({imageData:C,isMe:R,onImagePress:M,onLongPress:T})=>{let S=$(),[A,I]=(0,ct.useState)(!1),[P,z]=(0,ct.useState)(!1),v=(0,ct.useCallback)(()=>{let F=ds*.6,j=300;if(!C.width||!C.height)return{width:F,height:j};let H=C.width/C.height,N=F,O=N/H;return O>j&&(O=j,N=O*H),{width:Math.round(N),height:Math.round(O)}},[C.width,C.height])(),k=(0,ct.useCallback)(()=>{M?M():I(!0)},[M]),D=(0,ct.useCallback)(()=>{console.error("Failed to load image:",C.uri),z(!0)},[C.uri]),V=(0,ct.useCallback)(()=>{I(!1)},[]),L=(0,ct.useCallback)(()=>{if(!C.width||!C.height)return{width:ds,height:Os*.8};let F=C.width/C.height,j=ds*.9,H=Os*.8,N=j,O=N/F;return O>H&&(O=H,N=O*F),{width:Math.round(N),height:Math.round(O)}},[C.width,C.height])();return P?<Re.View style={[ht.errorContainer,{width:v.width,height:v.height,backgroundColor:R?S.colors.messageBubble.sent:S.colors.messageBubble.received,borderRadius:S.borderRadius.lg}]}>
102
+ <Re.Text style={[ht.errorText,{color:R?S.colors.messageBubble.sentText:S.colors.messageBubble.receivedText,fontSize:S.typography.fontSize.sm}]}>
99
103
  Failed to load image
100
104
  </Re.Text>
101
105
  </Re.View>:<>
102
- <Re.Pressable onPress={V}onLongPress={R}delayLongPress={500}>
103
- <Re.View style={[gt.imageContainer,{borderRadius:S.borderRadius.lg,overflow:"hidden"}]}>
104
- <Re.Image source={{uri:M.uri}}style={[gt.image,{width:v.width,height:v.height}]}resizeMode='cover'onError={D}/>
106
+ <Re.Pressable onPress={k}onLongPress={T}delayLongPress={500}>
107
+ <Re.View style={[ht.imageContainer,{borderRadius:S.borderRadius.lg,overflow:"hidden"}]}>
108
+ <Re.Image source={{uri:C.uri}}style={[ht.image,{width:v.width,height:v.height}]}resizeMode='cover'onError={D}/>
105
109
 
106
110
  {}
107
- <Re.View style={gt.imageOverlay}/>
111
+ <Re.View style={ht.imageOverlay}/>
108
112
  </Re.View>
109
113
  </Re.Pressable>
110
114
 
111
115
  {}
112
- <Re.Modal visible={A}transparent animationType='fade'onRequestClose={z}>
113
- <Re.Pressable style={gt.modalContainer}onPress={z}>
114
- <Re.View style={gt.modalContent}>
115
- <Re.Image source={{uri:M.uri}}style={[gt.modalImage,{width:k.width,height:k.height,borderRadius:S.borderRadius.lg}]}resizeMode='contain'/>
116
+ <Re.Modal visible={A}transparent animationType='fade'onRequestClose={V}>
117
+ <Re.Pressable style={ht.modalContainer}onPress={V}>
118
+ <Re.View style={ht.modalContent}>
119
+ <Re.Image source={{uri:C.uri}}style={[ht.modalImage,{width:L.width,height:L.height,borderRadius:S.borderRadius.lg}]}resizeMode='contain'/>
116
120
  </Re.View>
117
121
  </Re.Pressable>
118
122
  </Re.Modal>
119
- </>},gt=Re.StyleSheet.create({imageContainer:{position:"relative"},image:{backgroundColor:"#f0f0f0"},imageOverlay:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"transparent"},errorContainer:{justifyContent:"center",alignItems:"center",borderWidth:1,borderColor:"#e0e0e0"},errorText:{textAlign:"center",fontWeight:"500"},modalContainer:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.9)",justifyContent:"center",alignItems:"center"},modalContent:{justifyContent:"center",alignItems:"center"},modalImage:{backgroundColor:"transparent"}}),Mo=Zs;var st=require("react-native"),Rs=require("lucide-react-native");var er=({isMe:M,timestamp:T,senderName:C})=>{let R=$();return<st.View style={[vt.container,{alignSelf:M?"flex-end":"flex-start",maxWidth:"80%"}]}>
120
- <st.View style={[vt.messageBubble,{backgroundColor:R.colors.gray[100],borderColor:R.colors.gray[200]}]}>
121
- <st.View style={vt.content}>
122
- <Rs.Trash2 size={16}color={R.colors.gray[500]}/>
123
- <st.Text style={[vt.deletedText,{color:R.colors.gray[500]}]}>
124
- This message was deleted
125
- </st.Text>
126
- </st.View>
127
- </st.View>
128
- <st.View style={[vt.metadata,{alignSelf:M?"flex-end":"flex-start"}]}>
129
- <st.Text style={[vt.timestamp,{color:R.colors.gray[400]}]}>
130
- {T}
131
- </st.Text>
132
- </st.View>
133
- </st.View>},vt=st.StyleSheet.create({container:{marginVertical:4,marginHorizontal:15},messageBubble:{borderRadius:18,paddingHorizontal:16,paddingVertical:12,borderWidth:1,borderStyle:"dashed"},content:{flexDirection:"row",alignItems:"center",justifyContent:"center"},deletedText:{fontSize:14,fontStyle:"italic",marginLeft:8},metadata:{marginTop:4,paddingHorizontal:4},timestamp:{fontSize:11}}),Co=er;var tr=({message:M,onLongPress:T,onReactionPress:C})=>{let R=$(),S=(0,Ts.useRef)(null),A=()=>{S.current?S.current.measureInWindow((B,E,v,V)=>{let D={x:Math.round(B),y:Math.round(E),width:Math.round(v),height:Math.round(V)};T?.(M,D)}):T?.(M)},I=()=>{M.reactions&&M.reactions.length>0&&C?.(M)},P=M.type==="image"&&M.imageData;return M.deleted?<Co isMe={M.isMe}timestamp={$o(M.timestamp)}senderName={M.senderName}/>:<Te.View style={{marginBottom:R.spacing.md,alignItems:M.isMe?"flex-end":"flex-start",marginHorizontal:R.spacing.sm}}>
134
- <Te.Pressable ref={S}onLongPress={A}delayLongPress={500}style={{maxWidth:P?"75%":"80%",borderRadius:P?R.borderRadius.lg:R.borderRadius.xl,borderBottomRightRadius:M.isMe?4:P?R.borderRadius.lg:R.borderRadius.xl,borderBottomLeftRadius:M.isMe?P?R.borderRadius.lg:R.borderRadius.xl:4,paddingHorizontal:P?0:R.spacing.lg,paddingVertical:P?0:R.spacing.md,backgroundColor:P?"transparent":M.isMe?R.colors.messageBubble.sent:R.colors.messageBubble.received,overflow:"hidden"}}>
135
- {M.replyTo&&<It replyTo={M.replyTo}isMyMessage={M.isMe}/>}
123
+ </>},ht=Re.StyleSheet.create({imageContainer:{position:"relative"},image:{backgroundColor:"#f0f0f0"},imageOverlay:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"transparent"},errorContainer:{justifyContent:"center",alignItems:"center",borderWidth:1,borderColor:"#e0e0e0"},errorText:{textAlign:"center",fontWeight:"500"},modalContainer:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.9)",justifyContent:"center",alignItems:"center"},modalContent:{justifyContent:"center",alignItems:"center"},modalImage:{backgroundColor:"transparent"}}),Oo=bn;var rt=require("react-native"),Fs=require("lucide-react-native");var Cn=({isMe:C,timestamp:R,senderName:M})=>{let T=$(),S=We();return<rt.View style={[Lt.container,{alignSelf:C?"flex-end":"flex-start",maxWidth:"80%"}]}>
124
+ <rt.View style={[Lt.messageBubble,{backgroundColor:T.colors.gray[100],borderColor:T.colors.gray[200]}]}>
125
+ <rt.View style={Lt.content}>
126
+ <Fs.Trash2 size={16}color={T.colors.gray[500]}/>
127
+ <rt.Text style={[Lt.deletedText,{color:T.colors.gray[500]}]}>
128
+ {S("message.deleted")}
129
+ </rt.Text>
130
+ </rt.View>
131
+ </rt.View>
132
+ <rt.View style={[Lt.metadata,{alignSelf:C?"flex-end":"flex-start"}]}>
133
+ <rt.Text style={[Lt.timestamp,{color:T.colors.gray[400]}]}>
134
+ {R}
135
+ </rt.Text>
136
+ </rt.View>
137
+ </rt.View>},Lt=rt.StyleSheet.create({container:{marginVertical:4,marginHorizontal:15},messageBubble:{borderRadius:18,paddingHorizontal:16,paddingVertical:12,borderWidth:1,borderStyle:"dashed"},content:{flexDirection:"row",alignItems:"center",justifyContent:"center"},deletedText:{fontSize:14,fontStyle:"italic",marginLeft:8},metadata:{marginTop:4,paddingHorizontal:4},timestamp:{fontSize:11}}),Fo=Cn;var Mn=({message:C,onLongPress:R,onReactionPress:M})=>{let T=$(),S=(0,Hs.useRef)(null),A=()=>{S.current?S.current.measureInWindow((z,E,v,k)=>{let D={x:Math.round(z),y:Math.round(E),width:Math.round(v),height:Math.round(k)};R?.(C,D)}):R?.(C)},I=()=>{C.reactions&&C.reactions.length>0&&M?.(C)},P=C.type==="image"&&C.imageData;return C.deleted?<Fo isMe={C.isMe}timestamp={cs(C.timestamp)}senderName={C.senderName}/>:<Se.View style={{marginBottom:T.spacing.md,alignItems:C.isMe?"flex-end":"flex-start",marginHorizontal:T.spacing.sm}}>
138
+ <Se.Pressable ref={S}onLongPress={A}delayLongPress={500}style={{maxWidth:P?"75%":"80%",borderRadius:P?T.borderRadius.lg:T.borderRadius.xl,borderBottomRightRadius:C.isMe?4:P?T.borderRadius.lg:T.borderRadius.xl,borderBottomLeftRadius:C.isMe?P?T.borderRadius.lg:T.borderRadius.xl:4,paddingHorizontal:P?0:T.spacing.lg,paddingVertical:P?0:T.spacing.md,backgroundColor:P?"transparent":C.isMe?T.colors.messageBubble.sent:T.colors.messageBubble.received,overflow:"hidden"}}>
139
+ {C.replyTo&&<Dt replyTo={C.replyTo}isMyMessage={C.isMe}/>}
136
140
 
137
- {P?<Mo imageData={M.imageData}isMe={M.isMe}onLongPress={A}/>:<Te.Text style={{fontSize:R.typography.fontSize.base,color:M.isMe?R.colors.messageBubble.sentText:R.colors.messageBubble.receivedText}}>
138
- {M.text}
139
- </Te.Text>}
141
+ {P?<Oo imageData={C.imageData}isMe={C.isMe}onLongPress={A}/>:<Se.Text style={{fontSize:T.typography.fontSize.base,color:C.isMe?T.colors.messageBubble.sentText:T.colors.messageBubble.receivedText}}>
142
+ {C.text}
143
+ </Se.Text>}
140
144
 
141
145
  {}
142
- {P&&M.text&&M.text.trim()&&<Te.View style={{paddingHorizontal:R.spacing.lg,paddingVertical:R.spacing.md,backgroundColor:M.isMe?R.colors.messageBubble.sent:R.colors.messageBubble.received,borderRadius:R.borderRadius.lg,marginTop:R.spacing.xs}}>
143
- <Te.Text style={{fontSize:R.typography.fontSize.base,color:M.isMe?R.colors.messageBubble.sentText:R.colors.messageBubble.receivedText}}>
144
- {M.text}
145
- </Te.Text>
146
- </Te.View>}
147
- </Te.Pressable>
146
+ {P&&C.text&&C.text.trim()&&<Se.View style={{paddingHorizontal:T.spacing.lg,paddingVertical:T.spacing.md,backgroundColor:C.isMe?T.colors.messageBubble.sent:T.colors.messageBubble.received,borderRadius:T.borderRadius.lg,marginTop:T.spacing.xs}}>
147
+ <Se.Text style={{fontSize:T.typography.fontSize.base,color:C.isMe?T.colors.messageBubble.sentText:T.colors.messageBubble.receivedText}}>
148
+ {C.text}
149
+ </Se.Text>
150
+ </Se.View>}
151
+ </Se.Pressable>
148
152
 
149
153
  {}
150
- {M.reactions&&M.reactions.length>0&&<Te.TouchableOpacity onPress={I}style={{marginTop:R.spacing.xs,flexDirection:"row",alignItems:"center",backgroundColor:R.colors.background,borderRadius:R.borderRadius.full,justifyContent:M.isMe?"flex-end":"flex-start"}}>
151
- {M.reactions.map((B,E)=><Te.View key={`${B.emoji}-${E}`}style={{flexDirection:"row",alignItems:"center",padding:R.spacing.xs}}>
152
- <Te.Text style={{fontSize:R.typography.fontSize.sm}}>
153
- {B.emoji}
154
- </Te.Text>
155
- {B.count>1&&<Te.Text style={{fontSize:R.typography.fontSize.xs,color:R.colors.textSecondary,marginLeft:R.spacing.xs,fontWeight:R.typography.fontWeight.medium}}>
156
- {B.count}
157
- </Te.Text>}
158
- </Te.View>)}
159
- </Te.TouchableOpacity>}
154
+ {C.reactions&&C.reactions.length>0&&<Se.TouchableOpacity onPress={I}style={{marginTop:T.spacing.xs,flexDirection:"row",alignItems:"center",backgroundColor:T.colors.background,borderRadius:T.borderRadius.full,justifyContent:C.isMe?"flex-end":"flex-start"}}>
155
+ {C.reactions.map((z,E)=><Se.View key={`${z.emoji}-${E}`}style={{flexDirection:"row",alignItems:"center",padding:T.spacing.xs}}>
156
+ <Se.Text style={{fontSize:T.typography.fontSize.sm}}>
157
+ {z.emoji}
158
+ </Se.Text>
159
+ {z.count>1&&<Se.Text style={{fontSize:T.typography.fontSize.xs,color:T.colors.textSecondary,marginLeft:T.spacing.xs,fontWeight:T.typography.fontWeight.medium}}>
160
+ {z.count}
161
+ </Se.Text>}
162
+ </Se.View>)}
163
+ </Se.TouchableOpacity>}
160
164
 
161
- <Te.View style={{marginHorizontal:R.spacing.sm,marginTop:R.spacing.xs,flexDirection:"row",alignItems:"center",justifyContent:M.isMe?"flex-end":"flex-start"}}>
162
- <Te.Text style={{fontSize:R.typography.fontSize.xs,color:R.colors.textSecondary}}>
163
- {$o(M.timestamp)}
164
- </Te.Text>
165
- {M.isMe&&M.status&&<Te.View style={{marginLeft:R.spacing.xs}}>
166
- {M.status==="sent"&&<Te.Text style={{fontSize:R.typography.fontSize.xs,color:R.colors.gray[400]}}>
165
+ <Se.View style={{marginHorizontal:T.spacing.sm,marginTop:T.spacing.xs,flexDirection:"row",alignItems:"center",justifyContent:C.isMe?"flex-end":"flex-start"}}>
166
+ <Se.Text style={{fontSize:T.typography.fontSize.xs,color:T.colors.textSecondary}}>
167
+ {cs(C.timestamp)}
168
+ </Se.Text>
169
+ {C.isMe&&C.status&&<Se.View style={{marginLeft:T.spacing.xs}}>
170
+ {C.status==="sent"&&<Se.Text style={{fontSize:T.typography.fontSize.xs,color:T.colors.gray[400]}}>
167
171
 
168
- </Te.Text>}
169
- {M.status==="delivered"&&<Te.Text style={{fontSize:R.typography.fontSize.xs,color:R.colors.gray[400]}}>
172
+ </Se.Text>}
173
+ {C.status==="delivered"&&<Se.Text style={{fontSize:T.typography.fontSize.xs,color:T.colors.gray[400]}}>
170
174
  ✓✓
171
- </Te.Text>}
172
- {M.status==="read"&&<Te.Text style={{fontSize:R.typography.fontSize.xs,color:R.colors.primary}}>
175
+ </Se.Text>}
176
+ {C.status==="read"&&<Se.Text style={{fontSize:T.typography.fontSize.xs,color:T.colors.primary}}>
173
177
  ✓✓
174
- </Te.Text>}
175
- </Te.View>}
176
- </Te.View>
177
- </Te.View>},Ro=tr;var Z=require("react-native"),Ss=require("lucide-react-native");var or=({replyToMessage:M,onCancel:T})=>{let C=$(),R=(I,P=50)=>I.length<=P?I:I.substring(0,P)+"...",S=!!M.replyTo,A=M.type==="image"&&M.imageData;return<Z.View style={{borderBottomWidth:1,borderBottomColor:C.colors.border,backgroundColor:C.colors.surface,paddingHorizontal:C.spacing.lg,paddingVertical:C.spacing.md}}>
178
+ </Se.Text>}
179
+ </Se.View>}
180
+ </Se.View>
181
+ </Se.View>},Ho=Mn;var Z=require("react-native"),Ns=require("lucide-react-native");var Tn=({replyToMessage:C,onCancel:R})=>{let M=$(),T=(I,P=50)=>I.length<=P?I:I.substring(0,P)+"...",S=!!C.replyTo,A=C.type==="image"&&C.imageData;return<Z.View style={{borderBottomWidth:1,borderBottomColor:M.colors.border,backgroundColor:M.colors.surface,paddingHorizontal:M.spacing.lg,paddingVertical:M.spacing.md}}>
178
182
  <Z.View style={{flexDirection:"row",alignItems:"center",justifyContent:"space-between"}}>
179
- <Z.View style={{flex:1,marginRight:C.spacing.md}}>
180
- <Z.View style={{flexDirection:"row",alignItems:"center",marginBottom:C.spacing.xs}}>
181
- <Z.View style={{width:4,backgroundColor:C.colors.primary,borderRadius:C.borderRadius.full,marginRight:C.spacing.md,height:S?48:32}}/>
183
+ <Z.View style={{flex:1,marginRight:M.spacing.md}}>
184
+ <Z.View style={{flexDirection:"row",alignItems:"center",marginBottom:M.spacing.xs}}>
185
+ <Z.View style={{width:4,backgroundColor:M.colors.primary,borderRadius:M.borderRadius.full,marginRight:M.spacing.md,height:S?48:32}}/>
182
186
  <Z.View style={{flex:1}}>
183
- <Z.Text style={{fontSize:C.typography.fontSize.xs,fontWeight:C.typography.fontWeight.medium,color:C.colors.primary,marginBottom:C.spacing.xs}}>
184
- Replying to {M.isMe?"yourself":M.senderName||"sender"}
187
+ <Z.Text style={{fontSize:M.typography.fontSize.xs,fontWeight:M.typography.fontWeight.medium,color:M.colors.primary,marginBottom:M.spacing.xs}}>
188
+ Replying to {C.isMe?"yourself":C.senderName||"sender"}
185
189
  {S&&" (reply thread)"}
186
190
  </Z.Text>
187
191
 
188
192
  {}
189
- {S&&<Z.View style={{marginBottom:C.spacing.sm,padding:C.spacing.sm,backgroundColor:C.colors.surfaceSecondary,borderRadius:C.borderRadius.md,borderLeftWidth:2,borderLeftColor:C.colors.gray[300]}}>
190
- <Z.Text style={{fontSize:C.typography.fontSize.xs,color:C.colors.textSecondary,marginBottom:C.spacing.xs}}>
191
- Originally replying to: {M.replyTo.isMe?"yourself":M.replyTo.senderName||"sender"}
193
+ {S&&<Z.View style={{marginBottom:M.spacing.sm,padding:M.spacing.sm,backgroundColor:M.colors.surfaceSecondary,borderRadius:M.borderRadius.md,borderLeftWidth:2,borderLeftColor:M.colors.gray[300]}}>
194
+ <Z.Text style={{fontSize:M.typography.fontSize.xs,color:M.colors.textSecondary,marginBottom:M.spacing.xs}}>
195
+ Originally replying to: {C.replyTo.isMe?"yourself":C.replyTo.senderName||"sender"}
192
196
  </Z.Text>
193
- <Z.Text style={{fontSize:C.typography.fontSize.xs,color:C.colors.textSecondary,lineHeight:C.typography.lineHeight.tight}}>
194
- {R(M.replyTo.text,40)}
197
+ <Z.Text style={{fontSize:M.typography.fontSize.xs,color:M.colors.textSecondary,lineHeight:M.typography.lineHeight.tight}}>
198
+ {T(C.replyTo.text,40)}
195
199
  </Z.Text>
196
200
  </Z.View>}
197
201
 
198
202
  {A?<Z.View style={{flexDirection:"row",alignItems:"center"}}>
199
- <Z.Image source={{uri:M.imageData.uri}}style={{width:32,height:32,borderRadius:C.borderRadius.sm,marginRight:C.spacing.sm}}resizeMode="cover"/>
203
+ <Z.Image source={{uri:C.imageData.uri}}style={{width:32,height:32,borderRadius:M.borderRadius.sm,marginRight:M.spacing.sm}}resizeMode="cover"/>
200
204
  <Z.View style={{flex:1}}>
201
- <Z.Text style={{fontSize:C.typography.fontSize.xs,color:C.colors.gray[600],fontStyle:"italic",marginBottom:C.spacing.xs}}>
205
+ <Z.Text style={{fontSize:M.typography.fontSize.xs,color:M.colors.gray[600],fontStyle:"italic",marginBottom:M.spacing.xs}}>
202
206
  📷 Image
203
207
  </Z.Text>
204
- {M.text&&M.text.trim()&&<Z.Text style={{fontSize:C.typography.fontSize.sm,color:C.colors.gray[700],lineHeight:C.typography.lineHeight.tight}}>
205
- {R(M.text,40)}
208
+ {C.text&&C.text.trim()&&<Z.Text style={{fontSize:M.typography.fontSize.sm,color:M.colors.gray[700],lineHeight:M.typography.lineHeight.tight}}>
209
+ {T(C.text,40)}
206
210
  </Z.Text>}
207
211
  </Z.View>
208
- </Z.View>:<Z.Text style={{fontSize:C.typography.fontSize.sm,color:C.colors.gray[700],lineHeight:C.typography.lineHeight.tight}}>
209
- {R(M.text)}
212
+ </Z.View>:<Z.Text style={{fontSize:M.typography.fontSize.sm,color:M.colors.gray[700],lineHeight:M.typography.lineHeight.tight}}>
213
+ {T(C.text)}
210
214
  </Z.Text>}
211
215
  </Z.View>
212
216
  </Z.View>
213
217
  </Z.View>
214
218
 
215
- <Z.TouchableOpacity onPress={T}style={{height:32,width:32,alignItems:"center",justifyContent:"center",borderRadius:C.borderRadius.full,backgroundColor:C.colors.gray[200]}}hitSlop={{top:8,bottom:8,left:8,right:8}}>
216
- <Ss.X size={16}color={C.colors.textSecondary}/>
219
+ <Z.TouchableOpacity onPress={R}style={{height:32,width:32,alignItems:"center",justifyContent:"center",borderRadius:M.borderRadius.full,backgroundColor:M.colors.gray[200]}}hitSlop={{top:8,bottom:8,left:8,right:8}}>
220
+ <Ns.X size={16}color={M.colors.textSecondary}/>
217
221
  </Z.TouchableOpacity>
218
222
  </Z.View>
219
- </Z.View>},Wt=or;var ze=require("react"),W=require("react-native"),pt=require("lucide-react-native");var To=require("react"),ws=Q(require("rn-emoji-keyboard")),sr=({visible:M,onClose:T,onEmojiSelected:C})=>{let[R,S]=(0,To.useState)(!1);(0,To.useEffect)(()=>{S(!!M)},[M]);let A=P=>{console.log("Selected emoji:",P),C(P.emoji),S(!1),T()},I=()=>{S(!1),T()};return M?<ws.default onEmojiSelected={A}open={R}onClose={I}enableSearchBar/>:null},Pt=sr;var Mr=({visible:M,onPress:T,children:C})=>M?<W.View style={Ae.overlay}>
220
- <W.TouchableOpacity style={Ae.backdrop}onPress={T}activeOpacity={1}/>
221
- {C}
222
- </W.View>:null,{width:At,height:Go}=W.Dimensions.get("window"),Cr=({message:M,positions:T,messagePosition:C,containerRef:R,containerOffset:S,setContainerOffset:A})=>{let I=$(),P=(0,ze.useRef)(new W.Animated.Value(C.y)).current,B=(0,ze.useRef)(new W.Animated.Value(0)).current,E=(0,ze.useRef)(!1),v=M.type==="image"&&M.imageData;return(0,ze.useEffect)(()=>{E.current=!1,R.current&&R.current.measureInWindow((V,D,z,L)=>{A({x:V,y:D});let k=C.y-D,O=T.messagePreviewTop-D;P.setValue(k),B.setValue(0),requestAnimationFrame(()=>{W.Animated.parallel([W.Animated.timing(P,{toValue:O,duration:250,useNativeDriver:!1}),W.Animated.timing(B,{toValue:1,duration:250,useNativeDriver:!1})]).start(()=>{E.current=!0})})})},[T.messagePreviewTop,C.y,R]),<W.Animated.View style={{position:"absolute",top:P,left:C.x,width:C.width,height:M.replyTo?C.height+10:C.height,zIndex:1e3,opacity:B,maxWidth:v?"75%":"80%",borderRadius:v?I.borderRadius.lg:I.borderRadius.xl,paddingHorizontal:v?0:I.spacing.lg,paddingVertical:v?0:I.spacing.md,backgroundColor:v?"transparent":M.isMe?I.colors.messageBubble.sent:I.colors.messageBubble.received,overflow:"hidden"}}>
223
- {M.replyTo&&<It replyTo={M.replyTo}isMyMessage={M.isMe}/>}
223
+ </Z.View>},Co=Tn;var Be=require("react"),W=require("react-native"),ft=require("lucide-react-native");var No=require("react"),Ws=X(require("rn-emoji-keyboard")),Rn=({visible:C,onClose:R,onEmojiSelected:M})=>{let[T,S]=(0,No.useState)(!1);(0,No.useEffect)(()=>{S(!!C)},[C]);let A=P=>{console.log("Selected emoji:",P),M(P.emoji),S(!1),R()},I=()=>{S(!1),R()};return C?<Ws.default onEmojiSelected={A}open={T}onClose={I}enableSearchBar/>:null},Et=Rn;var Sn=({visible:C,onPress:R,children:M})=>C?<W.View style={Ve.overlay}>
224
+ <W.TouchableOpacity style={Ve.backdrop}onPress={R}activeOpacity={1}/>
225
+ {M}
226
+ </W.View>:null,{width:Ot,height:us}=W.Dimensions.get("window"),In=({message:C,positions:R,messagePosition:M,containerRef:T,containerOffset:S,setContainerOffset:A})=>{let I=$(),P=(0,Be.useRef)(new W.Animated.Value(M.y)).current,z=(0,Be.useRef)(new W.Animated.Value(0)).current,E=(0,Be.useRef)(!1),v=C.type==="image"&&C.imageData;return(0,Be.useEffect)(()=>{E.current=!1,T.current&&T.current.measureInWindow((k,D,V,B)=>{A({x:k,y:D});let L=M.y-D,F=R.messagePreviewTop-D;P.setValue(L),z.setValue(0),requestAnimationFrame(()=>{W.Animated.parallel([W.Animated.timing(P,{toValue:F,duration:250,useNativeDriver:!1}),W.Animated.timing(z,{toValue:1,duration:250,useNativeDriver:!1})]).start(()=>{E.current=!0})})})},[R.messagePreviewTop,M.y,T]),<W.Animated.View style={{position:"absolute",top:P,left:M.x,width:M.width,height:C.replyTo?M.height+10:M.height,zIndex:1e3,opacity:z,maxWidth:v?"75%":"80%",borderRadius:v?I.borderRadius.lg:I.borderRadius.xl,paddingHorizontal:v?0:I.spacing.lg,paddingVertical:v?0:I.spacing.md,backgroundColor:v?"transparent":C.isMe?I.colors.messageBubble.sent:I.colors.messageBubble.received,overflow:"hidden"}}>
227
+ {C.replyTo&&<Dt replyTo={C.replyTo}isMyMessage={C.isMe}/>}
224
228
 
225
229
  {v?<W.View>
226
- <W.Image source={{uri:M.imageData.uri}}style={{width:C.width,height:C.height,borderRadius:I.borderRadius.lg}}resizeMode='cover'/>
230
+ <W.Image source={{uri:C.imageData.uri}}style={{width:M.width,height:M.height,borderRadius:I.borderRadius.lg}}resizeMode='cover'/>
227
231
  {}
228
- {M.text&&M.text.trim()&&<W.View style={{paddingHorizontal:I.spacing.lg,paddingVertical:I.spacing.md,backgroundColor:M.isMe?I.colors.messageBubble.sent:I.colors.messageBubble.received,borderRadius:I.borderRadius.lg,marginTop:I.spacing.xs}}>
229
- <W.Text style={{fontSize:I.typography.fontSize.base,color:M.isMe?I.colors.messageBubble.sentText:I.colors.messageBubble.receivedText}}>
230
- {M.text}
232
+ {C.text&&C.text.trim()&&<W.View style={{paddingHorizontal:I.spacing.lg,paddingVertical:I.spacing.md,backgroundColor:C.isMe?I.colors.messageBubble.sent:I.colors.messageBubble.received,borderRadius:I.borderRadius.lg,marginTop:I.spacing.xs}}>
233
+ <W.Text style={{fontSize:I.typography.fontSize.base,color:C.isMe?I.colors.messageBubble.sentText:I.colors.messageBubble.receivedText}}>
234
+ {C.text}
231
235
  </W.Text>
232
236
  </W.View>}
233
- </W.View>:<W.Text style={{fontSize:I.typography.fontSize.base,color:M.isMe?I.colors.messageBubble.sentText:I.colors.messageBubble.receivedText}}>
234
- {M.text}
237
+ </W.View>:<W.Text style={{fontSize:I.typography.fontSize.base,color:C.isMe?I.colors.messageBubble.sentText:I.colors.messageBubble.receivedText}}>
238
+ {C.text}
235
239
  </W.Text>}
236
- </W.Animated.View>},Rr=({visible:M,onClose:T,isMyMessage:C,selectedMessage:R,messagePosition:S,onActionPress:A,onEmojiReact:I})=>{let[P,B]=(0,ze.useState)(!1),E=(0,ze.useRef)(null),[v,V]=(0,ze.useState)({x:0,y:0}),D=(0,ze.useRef)(new W.Animated.Value(0)).current,z=(0,ze.useRef)(new W.Animated.Value(0)).current,L=(0,ze.useRef)(!1),k=(0,ze.useRef)(!1),O=Me=>{A(Me),T()},F=Me=>{I?.(Me),T()},H=()=>{B(!0)},N=()=>{B(!1)},j=Me=>{I?.(Me),B(!1),T()},oe=["\u2764\uFE0F","\u{1F602}","\u{1F62E}","\u{1F622}","\u{1F621}","\u{1F44D}"],J=(()=>{if(!S)return{emojiBar:{top:Go/2-200,left:At/2-160},actionMenu:{top:Go/2+50,left:At/2-100}};let Me=320,je=60,Ke=200,Be=160,Ce=20,U=8,Oe,Ze,Ge,Ve,qe,et=Go/2,Se=je+U+S.height+U+Be,ct=et-Se/2;return Ze=ct,qe=ct+je+U,Ve=ct+je+U+S.height+U,Oe=S.x,Ge=S.x,Oe+Me>At-Ce&&(Oe=At-Me-Ce),Oe<Ce&&(Oe=Ce),Ge+Ke>At-Ce&&(Ge=At-Ke-Ce),Ge<Ce&&(Ge=Ce),{emojiBar:{top:Ze,left:Oe},actionMenu:{top:Ve,left:Ge},messagePreviewTop:qe,isNearAverageHeight:!0,isNearTop:!0,isEdgeCase:!0}})();return(0,ze.useEffect)(()=>{M&&S&&!k.current&&(D.setValue(0),z.setValue(0),setTimeout(()=>{W.Animated.sequence([W.Animated.timing(D,{toValue:1,duration:200,useNativeDriver:!1}),W.Animated.timing(z,{toValue:1,duration:200,useNativeDriver:!1})]).start(()=>{k.current=!0})},50))},[M,S,D,z]),(0,ze.useEffect)(()=>{M||(L.current=!1,k.current=!1,D.setValue(0),z.setValue(0))},[M,D,z]),M?<>
240
+ </W.Animated.View>},vn=({visible:C,onClose:R,isMyMessage:M,selectedMessage:T,messagePosition:S,onActionPress:A,onEmojiReact:I})=>{let P=We(),[z,E]=(0,Be.useState)(!1),v=(0,Be.useRef)(null),[k,D]=(0,Be.useState)({x:0,y:0}),V=(0,Be.useRef)(new W.Animated.Value(0)).current,B=(0,Be.useRef)(new W.Animated.Value(0)).current,L=(0,Be.useRef)(!1),F=(0,Be.useRef)(!1),j=Me=>{A(Me),R()},H=Me=>{I?.(Me),R()},N=()=>{E(!0)},O=()=>{E(!1)},te=Me=>{I?.(Me),E(!1),R()},Le=["\u2764\uFE0F","\u{1F602}","\u{1F62E}","\u{1F622}","\u{1F621}","\u{1F44D}"],Ee=(()=>{if(!S)return{emojiBar:{top:us/2-200,left:Ot/2-160},actionMenu:{top:us/2+50,left:Ot/2-100}};let Me=320,ke=60,Ae=200,Ye=160,U=20,Ge=8,Oe,Mt,Te,_e,Ze,we=us/2,Pt=ke+Ge+S.height+Ge+Ye,Tt=we-Pt/2;return Mt=Tt,Ze=Tt+ke+Ge,_e=Tt+ke+Ge+S.height+Ge,Oe=S.x,Te=S.x,Oe+Me>Ot-U&&(Oe=Ot-Me-U),Oe<U&&(Oe=U),Te+Ae>Ot-U&&(Te=Ot-Ae-U),Te<U&&(Te=U),{emojiBar:{top:Mt,left:Oe},actionMenu:{top:_e,left:Te},messagePreviewTop:Ze,isNearAverageHeight:!0,isNearTop:!0,isEdgeCase:!0}})();return(0,Be.useEffect)(()=>{C&&S&&!F.current&&(V.setValue(0),B.setValue(0),setTimeout(()=>{W.Animated.sequence([W.Animated.timing(V,{toValue:1,duration:200,useNativeDriver:!1}),W.Animated.timing(B,{toValue:1,duration:200,useNativeDriver:!1})]).start(()=>{F.current=!0})},50))},[C,S,V,B]),(0,Be.useEffect)(()=>{C||(L.current=!1,F.current=!1,V.setValue(0),B.setValue(0))},[C,V,B]),C?<>
237
241
  {}
238
- <Mr visible={!0}onPress={T}>
239
- <W.Pressable style={Ae.overlayPressable}onPress={T}/>
240
- </Mr>
242
+ <Sn visible={!0}onPress={R}>
243
+ <W.Pressable style={Ve.overlayPressable}onPress={R}/>
244
+ </Sn>
241
245
 
242
- <W.View ref={E}style={{position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none"}}>
246
+ <W.View ref={v}style={{position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none"}}>
243
247
  {}
244
248
  </W.View>
245
249
 
246
250
  {}
247
- {S&&R&&<Cr message={R}positions={J}messagePosition={S}containerRef={E}containerOffset={v}setContainerOffset={V}/>}
251
+ {S&&T&&<In message={T}positions={Ee}messagePosition={S}containerRef={v}containerOffset={k}setContainerOffset={D}/>}
248
252
 
249
253
  {}
250
- <W.Animated.View style={[Ae.emojiBar,{position:"absolute",top:J.emojiBar.top-(v.y||0),left:J.emojiBar.left,opacity:D,pointerEvents:"auto"}]}>
251
- <W.ScrollView horizontal showsHorizontalScrollIndicator={!1}contentContainerStyle={Ae.emojiContainer}>
252
- {oe.map((Me,je)=><W.TouchableOpacity key={je}style={Ae.emojiButton}onPress={()=>F(Me)}>
253
- <W.Text style={Ae.emojiText}>{Me}</W.Text>
254
+ <W.Animated.View style={[Ve.emojiBar,{position:"absolute",top:Ee.emojiBar.top-(k.y||0),left:Ee.emojiBar.left,opacity:V,pointerEvents:"auto"}]}>
255
+ <W.ScrollView horizontal showsHorizontalScrollIndicator={!1}contentContainerStyle={Ve.emojiContainer}>
256
+ {Le.map((Me,ke)=><W.TouchableOpacity key={ke}style={Ve.emojiButton}onPress={()=>H(Me)}>
257
+ <W.Text style={Ve.emojiText}>{Me}</W.Text>
254
258
  </W.TouchableOpacity>)}
255
- <W.TouchableOpacity style={Ae.addEmojiButton}onPress={H}>
256
- <pt.Plus size={20}color='#666'/>
259
+ <W.TouchableOpacity style={Ve.addEmojiButton}onPress={N}>
260
+ <ft.Plus size={20}color='#666'/>
257
261
  </W.TouchableOpacity>
258
262
  </W.ScrollView>
259
263
  </W.Animated.View>
260
264
 
261
265
  {}
262
- <W.Animated.View style={[Ae.actionMenu,{position:"absolute",top:J.actionMenu.top-(v.y||0)+(R?.replyTo?10:0),left:J.actionMenu.left,opacity:z,pointerEvents:"auto"}]}>
263
- <W.View style={Ae.actionItems}>
266
+ <W.Animated.View style={[Ve.actionMenu,{position:"absolute",top:Ee.actionMenu.top-(k.y||0)+(T?.replyTo?10:0),left:Ee.actionMenu.left,opacity:B,pointerEvents:"auto"}]}>
267
+ <W.View style={Ve.actionItems}>
264
268
  {}
265
- <W.TouchableOpacity style={Ae.actionRow}onPress={()=>O("reply")}>
266
- <pt.Reply size={18}color='#333'/>
267
- <W.Text style={Ae.actionLabel}>Reply</W.Text>
269
+ <W.TouchableOpacity style={Ve.actionRow}onPress={()=>j("reply")}>
270
+ <ft.Reply size={18}color='#333'/>
271
+ <W.Text style={Ve.actionLabel}>{P("action.reply")}</W.Text>
268
272
  </W.TouchableOpacity>
269
273
 
270
274
  {}
271
- <W.TouchableOpacity style={Ae.actionRow}onPress={()=>O("copy")}>
272
- <pt.Copy size={18}color='#333'/>
273
- <W.Text style={Ae.actionLabel}>Copy</W.Text>
275
+ <W.TouchableOpacity style={Ve.actionRow}onPress={()=>j("copy")}>
276
+ <ft.Copy size={18}color='#333'/>
277
+ <W.Text style={Ve.actionLabel}>{P("action.copy")}</W.Text>
274
278
  </W.TouchableOpacity>
275
279
 
276
280
  {}
277
- {C&&<W.TouchableOpacity style={Ae.actionRow}onPress={()=>O("delete")}>
278
- <pt.Trash2 size={18}color='#ff4444'/>
279
- <W.Text style={[Ae.actionLabel,{color:"#ff4444"}]}>
280
- Delete
281
+ {M&&<W.TouchableOpacity style={Ve.actionRow}onPress={()=>j("delete")}>
282
+ <ft.Trash2 size={18}color='#ff4444'/>
283
+ <W.Text style={[Ve.actionLabel,{color:"#ff4444"}]}>
284
+ {P("action.delete")}
281
285
  </W.Text>
282
286
  </W.TouchableOpacity>}
283
287
  </W.View>
284
288
  </W.Animated.View>
285
289
 
286
290
  {}
287
- <Pt visible={P}onClose={N}onEmojiSelected={j}/>
288
- </>:null},Ae=W.StyleSheet.create({spotlightOverlay:{position:"absolute",top:0,left:0,right:0,bottom:0},overlayPressable:{flex:1,backgroundColor:"transparent"},emojiBar:{backgroundColor:"white",borderRadius:25,paddingHorizontal:12,paddingVertical:8,shadowColor:"#000",shadowOffset:{width:0,height:4},shadowOpacity:.25,shadowRadius:12,elevation:12,zIndex:1001,maxWidth:320},emojiContainer:{flexDirection:"row",alignItems:"center",paddingHorizontal:4},emojiButton:{width:36,height:36,borderRadius:18,backgroundColor:"#f8f9fa",justifyContent:"center",alignItems:"center",marginHorizontal:3},emojiText:{fontSize:18},addEmojiButton:{width:36,height:36,borderRadius:18,backgroundColor:"#f8f9fa",justifyContent:"center",alignItems:"center",marginHorizontal:3},actionMenu:{backgroundColor:"white",borderRadius:12,shadowColor:"#000",shadowOffset:{width:0,height:4},shadowOpacity:.25,shadowRadius:12,elevation:12,zIndex:1001,minWidth:160,maxWidth:200},actionItems:{paddingVertical:4},actionRow:{flexDirection:"row",alignItems:"center",paddingVertical:12,paddingHorizontal:16,minHeight:44},actionLabel:{fontSize:15,color:"#333",marginLeft:12,fontWeight:"500"},hiddenEmojiInput:{position:"absolute",left:-9999,opacity:0,height:0,width:0},overlay:{...W.StyleSheet.absoluteFillObject,zIndex:1e3},backdrop:{...W.StyleSheet.absoluteFillObject,backgroundColor:"rgba(0, 0, 0, 0.8)"}}),So=Rr;var zt=require("react"),_=require("react-native"),Is=Q(require("react-native-actions-sheet"));var Tr=({visible:M,onClose:T,reactions:C,messageText:R,onAddReaction:S,onRemoveReaction:A})=>{let I=(0,zt.useRef)(null),[P,B]=(0,zt.useState)(!1);(0,zt.useEffect)(()=>{M?I.current?.show():I.current?.hide()},[M]);let v=(()=>{let F=[];return C.forEach(H=>{let N=[{id:"1",name:"You",avatar:"\u{1F464}"},{id:"2",name:"Anna",avatar:"\u{1F469}"},{id:"3",name:"Young Beetle",avatar:"\u{1F697}"},{id:"4",name:"Lele",avatar:"\u{1F3AD}"},{id:"5",name:"Needle",avatar:"\u{1F3E0}"}];for(let j=0;j<Math.min(H.count,N.length);j++)F.push({id:`${H.emoji}-${j}`,name:N[j].name,avatar:N[j].avatar,emoji:H.emoji,timestamp:new Date().toISOString()})}),F})(),V=C.reduce((F,H)=>F+H.count,0),D=F=>{console.log("Remove reaction called with:",F),console.log("onRemoveReaction prop exists:",!!A),console.log("User is current user:",F.name==="You"),F.name==="You"&&A?(console.log("Calling onRemoveReaction with emoji:",F.emoji),A(F.emoji)):console.log("Not calling onRemoveReaction because:",{isCurrentUser:F.name==="You",hasCallback:!!A})},z=()=>{I.current?.hide(),T(),setTimeout(()=>{B(!0)},300)},L=()=>{B(!1)},k=F=>{console.log("Selected emoji from picker:",F),S?.(F),B(!1),T()},O=()=>{I.current?.hide(),T()};return<>
289
- <Is.default ref={I}onClose={O}containerStyle={ee.container}headerAlwaysVisible={!0}gestureEnabled={!0}closeOnTouchBackdrop={!0}>
291
+ <Et visible={z}onClose={O}onEmojiSelected={te}/>
292
+ </>:null},Ve=W.StyleSheet.create({spotlightOverlay:{position:"absolute",top:0,left:0,right:0,bottom:0},overlayPressable:{flex:1,backgroundColor:"transparent"},emojiBar:{backgroundColor:"white",borderRadius:25,paddingHorizontal:12,paddingVertical:8,shadowColor:"#000",shadowOffset:{width:0,height:4},shadowOpacity:.25,shadowRadius:12,elevation:12,zIndex:1001,maxWidth:320},emojiContainer:{flexDirection:"row",alignItems:"center",paddingHorizontal:4},emojiButton:{width:36,height:36,borderRadius:18,backgroundColor:"#f8f9fa",justifyContent:"center",alignItems:"center",marginHorizontal:3},emojiText:{fontSize:18},addEmojiButton:{width:36,height:36,borderRadius:18,backgroundColor:"#f8f9fa",justifyContent:"center",alignItems:"center",marginHorizontal:3},actionMenu:{backgroundColor:"white",borderRadius:12,shadowColor:"#000",shadowOffset:{width:0,height:4},shadowOpacity:.25,shadowRadius:12,elevation:12,zIndex:1001,minWidth:160,maxWidth:200},actionItems:{paddingVertical:4},actionRow:{flexDirection:"row",alignItems:"center",paddingVertical:12,paddingHorizontal:16,minHeight:44},actionLabel:{fontSize:15,color:"#333",marginLeft:12,fontWeight:"500"},hiddenEmojiInput:{position:"absolute",left:-9999,opacity:0,height:0,width:0},overlay:{...W.StyleSheet.absoluteFillObject,zIndex:1e3},backdrop:{...W.StyleSheet.absoluteFillObject,backgroundColor:"rgba(0, 0, 0, 0.8)"}}),Wo=vn;var Ft=require("react"),_=require("react-native"),Us=X(require("react-native-actions-sheet"));var Pn=({visible:C,onClose:R,reactions:M,messageText:T,onAddReaction:S,onRemoveReaction:A})=>{let I=(0,Ft.useRef)(null),[P,z]=(0,Ft.useState)(!1);(0,Ft.useEffect)(()=>{C?I.current?.show():I.current?.hide()},[C]);let v=(()=>{let j=[];return M.forEach(H=>{let N=[{id:"1",name:"You",avatar:"\u{1F464}"},{id:"2",name:"Anna",avatar:"\u{1F469}"},{id:"3",name:"Young Beetle",avatar:"\u{1F697}"},{id:"4",name:"Lele",avatar:"\u{1F3AD}"},{id:"5",name:"Needle",avatar:"\u{1F3E0}"}];for(let O=0;O<Math.min(H.count,N.length);O++)j.push({id:`${H.emoji}-${O}`,name:N[O].name,avatar:N[O].avatar,emoji:H.emoji,timestamp:new Date().toISOString()})}),j})(),k=M.reduce((j,H)=>j+H.count,0),D=j=>{console.log("Remove reaction called with:",j),console.log("onRemoveReaction prop exists:",!!A),console.log("User is current user:",j.name==="You"),j.name==="You"&&A?(console.log("Calling onRemoveReaction with emoji:",j.emoji),A(j.emoji)):console.log("Not calling onRemoveReaction because:",{isCurrentUser:j.name==="You",hasCallback:!!A})},V=()=>{I.current?.hide(),R(),setTimeout(()=>{z(!0)},300)},B=()=>{z(!1)},L=j=>{console.log("Selected emoji from picker:",j),S?.(j),z(!1),R()},F=()=>{I.current?.hide(),R()};return<>
293
+ <Us.default ref={I}onClose={F}containerStyle={Q.container}headerAlwaysVisible={!0}gestureEnabled={!0}closeOnTouchBackdrop={!0}>
290
294
  {}
291
- <_.View style={ee.header}>
292
- <_.Text style={ee.title}>{V} reactions</_.Text>
293
- <_.TouchableOpacity onPress={O}style={ee.closeButton}>
294
- <_.Text style={ee.closeText}>✕</_.Text>
295
+ <_.View style={Q.header}>
296
+ <_.Text style={Q.title}>{k} reactions</_.Text>
297
+ <_.TouchableOpacity onPress={F}style={Q.closeButton}>
298
+ <_.Text style={Q.closeText}>✕</_.Text>
295
299
  </_.TouchableOpacity>
296
300
  </_.View>
297
301
 
298
302
  {}
299
- <_.View style={ee.messagePreview}>
300
- <_.Text style={ee.messageText}numberOfLines={2}>
301
- {R}
303
+ <_.View style={Q.messagePreview}>
304
+ <_.Text style={Q.messageText}numberOfLines={2}>
305
+ {T}
302
306
  </_.Text>
303
307
  </_.View>
304
308
 
305
309
  {}
306
- <_.View style={ee.reactionButtons}>
310
+ <_.View style={Q.reactionButtons}>
307
311
  {}
308
312
 
309
- {C.map((F,H)=><_.View key={H}style={ee.reactionButton}>
310
- <_.Text style={ee.reactionEmoji}>{F.emoji}</_.Text>
311
- <_.Text style={ee.reactionCount}>{F.count}</_.Text>
313
+ {M.map((j,H)=><_.View key={H}style={Q.reactionButton}>
314
+ <_.Text style={Q.reactionEmoji}>{j.emoji}</_.Text>
315
+ <_.Text style={Q.reactionCount}>{j.count}</_.Text>
312
316
  </_.View>)}
313
317
  </_.View>
314
318
 
315
319
  {}
316
- <_.ScrollView style={ee.userReactionsList}showsVerticalScrollIndicator={!1}>
317
- {v.map(F=>{let H=F.name==="You",N=H?_.TouchableOpacity:_.View;return<N key={F.id}style={[ee.userReactionItem,H&&ee.tappableUserReactionItem]}onPress={H?()=>D(F):void 0}activeOpacity={H?.7:1}>
318
- <_.View style={ee.userInfo}>
319
- <_.Text style={ee.userAvatar}>{F.avatar}</_.Text>
320
- <_.View style={ee.userDetails}>
321
- <_.Text style={ee.userName}>{F.name}</_.Text>
322
- {H&&<_.Text style={ee.removeText}>Tap to remove</_.Text>}
320
+ <_.ScrollView style={Q.userReactionsList}showsVerticalScrollIndicator={!1}>
321
+ {v.map(j=>{let H=j.name==="You",N=H?_.TouchableOpacity:_.View;return<N key={j.id}style={[Q.userReactionItem,H&&Q.tappableUserReactionItem]}onPress={H?()=>D(j):void 0}activeOpacity={H?.7:1}>
322
+ <_.View style={Q.userInfo}>
323
+ <_.Text style={Q.userAvatar}>{j.avatar}</_.Text>
324
+ <_.View style={Q.userDetails}>
325
+ <_.Text style={Q.userName}>{j.name}</_.Text>
326
+ {H&&<_.Text style={Q.removeText}>Tap to remove</_.Text>}
323
327
  </_.View>
324
328
  </_.View>
325
- <_.View style={ee.userReactionEmoji}>
326
- <_.Text style={ee.emojiText}>{F.emoji}</_.Text>
329
+ <_.View style={Q.userReactionEmoji}>
330
+ <_.Text style={Q.emojiText}>{j.emoji}</_.Text>
327
331
  </_.View>
328
332
  </N>})}
329
333
  </_.ScrollView>
330
- </Is.default>
334
+ </Us.default>
331
335
 
332
336
  {}
333
- <Pt visible={P}onClose={L}onEmojiSelected={k}/>
334
- </>},ee=_.StyleSheet.create({container:{backgroundColor:"white",borderTopLeftRadius:20,borderTopRightRadius:20,paddingTop:20,paddingBottom:40,maxHeight:"70%"},header:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:20,paddingBottom:15,borderBottomWidth:1,borderBottomColor:"#f0f0f0"},title:{fontSize:18,fontWeight:"600",color:"#333"},closeButton:{padding:5},closeText:{fontSize:18,color:"#666",fontWeight:"500"},messagePreview:{paddingHorizontal:20,paddingVertical:15,borderBottomWidth:1,borderBottomColor:"#f0f0f0"},messageText:{fontSize:14,color:"#666",lineHeight:20},reactionButtons:{flexDirection:"row",paddingHorizontal:20,paddingVertical:15,gap:10},addReactionButton:{flexDirection:"row",alignItems:"center",backgroundColor:"#f8f9fa",borderWidth:1,borderColor:"#e9ecef",borderRadius:20,paddingHorizontal:12,paddingVertical:8},addReactionIcon:{fontSize:16,marginRight:4},addReactionText:{fontSize:14,color:"#666",fontWeight:"500"},reactionButton:{flexDirection:"row",alignItems:"center",backgroundColor:"#28a745",borderRadius:20,paddingHorizontal:12,paddingVertical:8},reactionEmoji:{fontSize:16,marginRight:4},reactionCount:{fontSize:14,color:"white",fontWeight:"600"},userReactionsList:{paddingHorizontal:20,paddingTop:10},userReactionItem:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:12,borderBottomWidth:1,borderBottomColor:"#f8f9fa"},tappableUserReactionItem:{backgroundColor:"#f8f9fa",borderRadius:8,paddingHorizontal:8,marginVertical:2},userInfo:{flexDirection:"row",alignItems:"center",flex:1},userAvatar:{fontSize:24,marginRight:12},userDetails:{flex:1},userName:{fontSize:16,fontWeight:"500",color:"#333"},removeText:{fontSize:12,color:"#dc3545",marginTop:2,fontWeight:"500"},userReactionEmoji:{backgroundColor:"#f8f9fa",borderRadius:16,paddingHorizontal:8,paddingVertical:4},emojiText:{fontSize:16}}),Io=Tr;var Bt=Q(require("react")),Xe=require("react-native"),vs=Q(require("react-native-actions-sheet")),Ps=require("lucide-react-native"),Ct=(0,Bt.forwardRef)(({onOptionSelect:M,options:T},C)=>{let R=Bt.default.useRef(null);(0,Bt.useImperativeHandle)(C,()=>({show:()=>R.current?.show(),hide:()=>R.current?.hide()}));let S=A=>{M(A),R.current?.hide()};return<vs.default ref={R}headerAlwaysVisible gestureEnabled={!0}statusBarTranslucent drawUnderStatusBar={!1}containerStyle={{borderTopLeftRadius:20,borderTopRightRadius:20}}>
335
- <Xe.View style={{padding:20,width:"100%"}}>
337
+ <Et visible={P}onClose={B}onEmojiSelected={L}/>
338
+ </>},Q=_.StyleSheet.create({container:{backgroundColor:"white",borderTopLeftRadius:20,borderTopRightRadius:20,paddingTop:20,paddingBottom:40,maxHeight:"70%"},header:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:20,paddingBottom:15,borderBottomWidth:1,borderBottomColor:"#f0f0f0"},title:{fontSize:18,fontWeight:"600",color:"#333"},closeButton:{padding:5},closeText:{fontSize:18,color:"#666",fontWeight:"500"},messagePreview:{paddingHorizontal:20,paddingVertical:15,borderBottomWidth:1,borderBottomColor:"#f0f0f0"},messageText:{fontSize:14,color:"#666",lineHeight:20},reactionButtons:{flexDirection:"row",paddingHorizontal:20,paddingVertical:15,gap:10},addReactionButton:{flexDirection:"row",alignItems:"center",backgroundColor:"#f8f9fa",borderWidth:1,borderColor:"#e9ecef",borderRadius:20,paddingHorizontal:12,paddingVertical:8},addReactionIcon:{fontSize:16,marginRight:4},addReactionText:{fontSize:14,color:"#666",fontWeight:"500"},reactionButton:{flexDirection:"row",alignItems:"center",backgroundColor:"#28a745",borderRadius:20,paddingHorizontal:12,paddingVertical:8},reactionEmoji:{fontSize:16,marginRight:4},reactionCount:{fontSize:14,color:"white",fontWeight:"600"},userReactionsList:{paddingHorizontal:20,paddingTop:10},userReactionItem:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:12,borderBottomWidth:1,borderBottomColor:"#f8f9fa"},tappableUserReactionItem:{backgroundColor:"#f8f9fa",borderRadius:8,paddingHorizontal:8,marginVertical:2},userInfo:{flexDirection:"row",alignItems:"center",flex:1},userAvatar:{fontSize:24,marginRight:12},userDetails:{flex:1},userName:{fontSize:16,fontWeight:"500",color:"#333"},removeText:{fontSize:12,color:"#dc3545",marginTop:2,fontWeight:"500"},userReactionEmoji:{backgroundColor:"#f8f9fa",borderRadius:16,paddingHorizontal:8,paddingVertical:4},emojiText:{fontSize:16}}),Uo=Pn;var Ht=X(require("react")),tt=require("react-native"),Ks=X(require("react-native-actions-sheet")),qs=require("lucide-react-native"),It=(0,Ht.forwardRef)(({onOptionSelect:C,options:R},M)=>{let T=Ht.default.useRef(null);(0,Ht.useImperativeHandle)(M,()=>({show:()=>T.current?.show(),hide:()=>T.current?.hide()}));let S=A=>{C(A),T.current?.hide()};return<Ks.default ref={T}headerAlwaysVisible gestureEnabled={!0}statusBarTranslucent drawUnderStatusBar={!1}containerStyle={{borderTopLeftRadius:20,borderTopRightRadius:20}}>
339
+ <tt.View style={{padding:20,width:"100%"}}>
336
340
 
337
341
  {}
338
- <Xe.View style={{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:20}}>
339
- <Xe.Text style={{fontSize:18,fontWeight:"600",color:"#1F2937"}}>
342
+ <tt.View style={{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:20}}>
343
+ <tt.Text style={{fontSize:18,fontWeight:"600",color:"#1F2937"}}>
340
344
  Share Content
341
- </Xe.Text>
342
- <Xe.TouchableOpacity onPress={()=>R.current?.hide()}>
343
- <Ps.X size={24}color="#6B7280"/>
344
- </Xe.TouchableOpacity>
345
- </Xe.View>
345
+ </tt.Text>
346
+ <tt.TouchableOpacity onPress={()=>T.current?.hide()}>
347
+ <qs.X size={24}color="#6B7280"/>
348
+ </tt.TouchableOpacity>
349
+ </tt.View>
346
350
 
347
351
  {}
348
- <Xe.View style={{flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between",paddingBottom:20}}>
349
- {T.map(A=>{let I=A.icon;return<Xe.TouchableOpacity key={A.id}style={{width:"30%",aspectRatio:1,marginBottom:20,alignItems:"center",justifyContent:"center"}}onPress={()=>S(A.id)}>
350
- <Xe.View style={{width:60,height:60,borderRadius:30,backgroundColor:"#F3F4F6",alignItems:"center",justifyContent:"center",marginBottom:8}}>
352
+ <tt.View style={{flexDirection:"row",flexWrap:"wrap",justifyContent:"space-between",paddingBottom:20}}>
353
+ {R.map(A=>{let I=A.icon;return<tt.TouchableOpacity key={A.id}style={{width:"30%",aspectRatio:1,marginBottom:20,alignItems:"center",justifyContent:"center"}}onPress={()=>S(A.id)}>
354
+ <tt.View style={{width:60,height:60,borderRadius:30,backgroundColor:"#F3F4F6",alignItems:"center",justifyContent:"center",marginBottom:8}}>
351
355
  <I size={24}color={A.color}/>
352
- </Xe.View>
353
- <Xe.Text style={{fontSize:12,color:"#6B7280",textAlign:"center",fontWeight:"500"}}>
356
+ </tt.View>
357
+ <tt.Text style={{fontSize:12,color:"#6B7280",textAlign:"center",fontWeight:"500"}}>
354
358
  {A.label}
355
- </Xe.Text>
356
- </Xe.TouchableOpacity>})}
357
- </Xe.View>
358
- </Xe.View>
359
- </vs.default>});Ct.displayName="AttachmentMenu";var vo=require("react"),De=require("react-native"),Sr=({isVisible:M})=>{let T=(0,vo.useRef)(new De.Animated.Value(0)).current;return(0,vo.useEffect)(()=>{if(!M){T.setValue(0);return}let C=De.Animated.loop(De.Animated.sequence([De.Animated.timing(T,{toValue:1,duration:1200,useNativeDriver:!0}),De.Animated.timing(T,{toValue:0,duration:1200,useNativeDriver:!0})]));return C.start(),()=>{C.stop()}},[M,T]),M?<De.View style={Vt.container}>
360
- <De.View style={Vt.bubble}>
361
- <De.View style={Vt.dotsContainer}>
362
- <De.Animated.View style={[Vt.dot,{opacity:T.interpolate({inputRange:[0,.5,1],outputRange:[.3,1,.3]}),transform:[{translateY:T.interpolate({inputRange:[0,.5,1],outputRange:[0,-4,0]})}]}]}/>
363
- <De.Animated.View style={[Vt.dot,{opacity:T.interpolate({inputRange:[.33,.83,1.33],outputRange:[.3,1,.3]}),transform:[{translateY:T.interpolate({inputRange:[.33,.83,1.33],outputRange:[0,-4,0]})}]}]}/>
364
- <De.Animated.View style={[Vt.dot,{opacity:T.interpolate({inputRange:[.66,1.16,1.66],outputRange:[.3,1,.3]}),transform:[{translateY:T.interpolate({inputRange:[.66,1.16,1.66],outputRange:[0,-4,0]})}]}]}/>
359
+ </tt.Text>
360
+ </tt.TouchableOpacity>})}
361
+ </tt.View>
362
+ </tt.View>
363
+ </Ks.default>});It.displayName="AttachmentMenu";var Ko=require("react"),De=require("react-native"),An=({isVisible:C})=>{let R=(0,Ko.useRef)(new De.Animated.Value(0)).current;return(0,Ko.useEffect)(()=>{if(!C){R.setValue(0);return}let M=De.Animated.loop(De.Animated.sequence([De.Animated.timing(R,{toValue:1,duration:1200,useNativeDriver:!0}),De.Animated.timing(R,{toValue:0,duration:1200,useNativeDriver:!0})]));return M.start(),()=>{M.stop()}},[C,R]),C?<De.View style={Nt.container}>
364
+ <De.View style={Nt.bubble}>
365
+ <De.View style={Nt.dotsContainer}>
366
+ <De.Animated.View style={[Nt.dot,{opacity:R.interpolate({inputRange:[0,.5,1],outputRange:[.3,1,.3]}),transform:[{translateY:R.interpolate({inputRange:[0,.5,1],outputRange:[0,-4,0]})}]}]}/>
367
+ <De.Animated.View style={[Nt.dot,{opacity:R.interpolate({inputRange:[.33,.83,1.33],outputRange:[.3,1,.3]}),transform:[{translateY:R.interpolate({inputRange:[.33,.83,1.33],outputRange:[0,-4,0]})}]}]}/>
368
+ <De.Animated.View style={[Nt.dot,{opacity:R.interpolate({inputRange:[.66,1.16,1.66],outputRange:[.3,1,.3]}),transform:[{translateY:R.interpolate({inputRange:[.66,1.16,1.66],outputRange:[0,-4,0]})}]}]}/>
365
369
  </De.View>
366
370
  </De.View>
367
- </De.View>:null},Vt=De.StyleSheet.create({container:{paddingHorizontal:15,paddingVertical:5},bubble:{backgroundColor:"#fff",borderRadius:18,paddingHorizontal:12,paddingVertical:8,alignSelf:"flex-start",maxWidth:"80%"},senderNameContainer:{marginBottom:4},senderName:{fontSize:12,color:"#666",fontWeight:"500"},dotsContainer:{flexDirection:"row",alignItems:"center",justifyContent:"center"},dot:{width:6,height:6,borderRadius:3,backgroundColor:"#999",marginHorizontal:3}}),Dt=Sr;var Po=Q(require("react")),kt=require("react-native"),As=require("lucide-react-native");var wr=({visible:M,onPress:T,isReplyActive:C=!1})=>{let R=$(),S=Po.default.useRef(new kt.Animated.Value(0)).current,[A,I]=Po.default.useState(!1);return Po.default.useEffect(()=>{kt.Animated.timing(S,{toValue:M?1:0,duration:200,useNativeDriver:!0}).start(()=>{I(M)})},[M,S]),!M&&!A?null:<kt.Pressable onPress={T}hitSlop={{top:10,bottom:10,left:10,right:10}}>
368
- {({pressed:P})=><kt.Animated.View style={[{position:"absolute",bottom:40,right:R.spacing.lg,zIndex:9999,width:32,height:32,backgroundColor:R.colors.background,borderRadius:R.borderRadius.xl,justifyContent:"center",alignItems:"center",shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:3.84,elevation:5,opacity:S,transform:P?[{scale:.95}]:[]}]}>
369
- <As.ChevronDown size={20}color={R.colors.text}/>
370
- </kt.Animated.View>}
371
- </kt.Pressable>},Ao=wr;var Ut=require("react-native");var Ir=({displayDate:M})=>{let T=$();return<Ut.View style={{marginVertical:T.spacing.lg,alignItems:"center"}}>
372
- <Ut.View style={{borderRadius:T.borderRadius.full,backgroundColor:T.colors.surfaceSecondary,paddingHorizontal:T.spacing.md,paddingVertical:T.spacing.xs}}>
373
- <Ut.Text style={{fontSize:T.typography.fontSize.xs,color:T.colors.textSecondary,fontWeight:T.typography.fontWeight.medium}}>
374
- {M}
375
- </Ut.Text>
376
- </Ut.View>
377
- </Ut.View>},Bo=Ir;var He=Q(require("react")),Ye=require("react-native"),Lt=require("lucide-react-native");var Qe=require("react"),te=require("react-native"),ke=require("lucide-react-native");var vr={maxWidth:1920,maxHeight:1920,quality:.8,format:"jpeg"},_o=async(M,T={})=>{try{let C;try{C=await import("expo-image-manipulator")}catch(V){console.log("expo-image-manipulator not available, returning original image info:",V);let z=`image_${Date.now()}.jpg`;return{uri:M,width:1920,height:1920,fileName:z}}let R={...vr,...T};console.log("Starting image compression...",{uri:M,options:R});let S=await C.manipulateAsync(M,[],{});console.log("Original image info:",{width:S.width,height:S.height,uri:S.uri});let A=[];if(R.maxWidth||R.maxHeight){let{width:V,height:D}=S,z=V,L=D;if(R.maxWidth&&V>R.maxWidth){let k=R.maxWidth/V;z=R.maxWidth,L=D*k}if(R.maxHeight&&L>R.maxHeight){let k=R.maxHeight/L;L=R.maxHeight,z=z*k}(z!==V||L!==D)&&(A.push({resize:{width:Math.round(z),height:Math.round(L)}}),console.log("Resizing image:",{from:{width:V,height:D},to:{width:Math.round(z),height:Math.round(L)}}))}let I={compress:R.quality,format:R.format==="png"?C.SaveFormat?.PNG:C.SaveFormat?.JPEG};console.log("Applying compression with options:",I);let P=await C.manipulateAsync(M,A,I);console.log("Image compression completed:",{originalUri:M,compressedUri:P.uri,finalDimensions:{width:P.width,height:P.height}});let B=Date.now(),E=R.format==="png"?"png":"jpg",v=`compressed_image_${B}.${E}`;return{uri:P.uri,width:P.width,height:P.height,fileName:v}}catch(C){console.error("Error compressing image:",C);let R=C instanceof Error?C.message:"Unknown error";throw new Error(`Failed to compress image: ${R}`)}},Jo=(M,T)=>M>3e3||T>3e3?{maxWidth:1920,maxHeight:1920,quality:.7,format:"jpeg"}:M>1920||T>1920?{maxWidth:1920,maxHeight:1920,quality:.8,format:"jpeg"}:{quality:.9,format:"jpeg"};var Pr=[{id:"photo",label:"Photo",icon:ke.Image,color:"#3B82F6"},{id:"camera",label:"Camera",icon:ke.Camera,color:"#6B7280"},{id:"location",label:"Location",icon:ke.MapPin,color:"#10B981"},{id:"contact",label:"Contact",icon:ke.User,color:"#6B7280"},{id:"document",label:"Document",icon:ke.FileText,color:"#3B82F6"},{id:"poll",label:"Poll",icon:ke.BarChart3,color:"#F59E0B"},{id:"event",label:"Event",icon:ke.Calendar,color:"#EF4444"}],Vo=M=>{let T=(0,Qe.useRef)(null),C=(0,Qe.useCallback)(async()=>{console.log("Photo selection initiated");try{let v;try{v=await import("expo-image-picker")}catch(z){console.log("expo-image-picker not available:",z),te.Alert.alert("Feature Not Available","Photo selection requires expo-image-picker to be installed. Please install expo-image-picker to use this feature.",[{text:"OK"}]);return}console.log("Requesting photo library permissions...");let{status:V}=await v.requestMediaLibraryPermissionsAsync();if(console.log("Photo library permission status:",V),V!=="granted"){te.Alert.alert("Permission needed","Please grant photo library access to select images.");return}console.log("Waiting for UI to stabilize..."),await new Promise(z=>setTimeout(()=>z(void 0),300)),console.log("Launching image picker...");let D=await v.launchImageLibraryAsync({mediaTypes:"images",allowsEditing:!0,aspect:[4,3],quality:.8,allowsMultipleSelection:!1});if(console.log("Image picker result:",D),!D.canceled&&D.assets&&D.assets.length>0){let z=D.assets[0];console.log("Photo selected successfully:",z.uri);try{console.log("Starting image compression...");let L=Jo(z.width||1920,z.height||1920),k=await _o(z.uri,L);console.log("Image compression completed:",k),M?.({type:"image",data:{...k,originalFileSize:z.fileSize}})}catch(L){console.error("Image compression failed:",L),te.Alert.alert("Compression Error","Failed to compress image. Sending original image.",[{text:"OK"}]),M?.({type:"image",data:{uri:z.uri,width:z.width,height:z.height,fileSize:z.fileSize,fileName:z.fileName||"image.jpg"}})}}else console.log("Photo selection was canceled by user")}catch(v){console.error("Error in photo selection process:",v),te.Alert.alert("Photo Selection Error","Failed to open photo library. Please try again or check your device permissions.",[{text:"OK"}])}},[M]),R=(0,Qe.useCallback)(async()=>{console.log("Camera capture initiated");try{let v;try{v=await import("expo-image-picker")}catch(z){console.log("expo-image-picker not available:",z),te.Alert.alert("Feature Not Available","Camera capture requires expo-image-picker to be installed. Please install expo-image-picker to use this feature.",[{text:"OK"}]);return}console.log("Requesting camera permissions...");let{status:V}=await v.requestCameraPermissionsAsync();if(console.log("Camera permission status:",V),V!=="granted"){te.Alert.alert("Permission needed","Please grant camera access to take photos.");return}console.log("Waiting for UI to stabilize..."),await new Promise(z=>setTimeout(()=>z(void 0),300)),console.log("Launching camera...");let D=await v.launchCameraAsync({allowsEditing:!0,aspect:[4,3],quality:.8,mediaTypes:"images"});if(console.log("Camera result:",D),!D.canceled&&D.assets&&D.assets.length>0){let z=D.assets[0];console.log("Photo captured successfully:",z.uri);try{console.log("Starting camera image compression...");let L=Jo(z.width||1920,z.height||1920),k=await _o(z.uri,L);console.log("Camera image compression completed:",k),M?.({type:"image",data:{...k,originalFileSize:z.fileSize}})}catch(L){console.error("Camera image compression failed:",L),te.Alert.alert("Compression Error","Failed to compress captured image. Sending original image.",[{text:"OK"}]),M?.({type:"image",data:{uri:z.uri,width:z.width,height:z.height,fileSize:z.fileSize,fileName:z.fileName||"camera_photo.jpg"}})}}else console.log("Camera capture was canceled by user")}catch(v){console.error("Error in camera capture process:",v),te.Alert.alert("Camera Error","Failed to open camera. Please try again or check your device permissions.",[{text:"OK"}])}},[M]),S=(0,Qe.useCallback)(async()=>{console.log("Location sharing initiated");try{let v;try{v=await import("expo-location")}catch(k){console.log("expo-location not available:",k),te.Alert.alert("Feature Not Available","Location sharing requires expo-location to be installed. Please install expo-location to use this feature.",[{text:"OK"}]);return}console.log("Requesting location permissions...");let{status:V}=await v.requestForegroundPermissionsAsync();if(console.log("Location permission status:",V),V!=="granted"){te.Alert.alert("Permission needed","Please grant location access to share your location.");return}console.log("Getting current location...");let D=await v.getCurrentPositionAsync({accuracy:v.Accuracy.High});console.log("Getting address from coordinates...");let z=await v.reverseGeocodeAsync({latitude:D.coords.latitude,longitude:D.coords.longitude}),L={coordinates:{latitude:D.coords.latitude,longitude:D.coords.longitude},address:z[0]||null,timestamp:D.timestamp};console.log("Location shared successfully:",L.coordinates),M?.({type:"location",data:L})}catch(v){console.error("Error in location sharing process:",v),te.Alert.alert("Location Error","Failed to get your location. Please try again or check your device permissions.",[{text:"OK"}])}},[M]),A=(0,Qe.useCallback)(async()=>{try{let v;try{v=await import("expo-contacts")}catch(D){console.log("expo-contacts not available:",D),te.Alert.alert("Feature Not Available","Contact sharing requires expo-contacts to be installed. Please install expo-contacts to use this feature.",[{text:"OK"}]);return}let{status:V}=await v.requestPermissionsAsync();if(V!=="granted"){te.Alert.alert("Permission needed","Please grant contacts access to share contacts.");return}te.Alert.alert("Contact Sharing","Contact selection feature is coming soon! This would open a contact picker.",[{text:"OK",onPress:()=>console.log("Contact sharing acknowledged")}])}catch(v){console.error("Error accessing contacts:",v),te.Alert.alert("Error","Failed to access contacts. Please try again.")}finally{T.current?.hide()}},[]),I=(0,Qe.useCallback)(async()=>{console.log("Document selection initiated");try{let v;try{v=await import("expo-document-picker")}catch(D){console.log("expo-document-picker not available:",D),te.Alert.alert("Feature Not Available","Document selection requires expo-document-picker to be installed. Please install expo-document-picker to use this feature.",[{text:"OK"}]);return}console.log("Waiting for UI to stabilize..."),await new Promise(D=>setTimeout(()=>D(void 0),300)),console.log("Launching document picker...");let V=await v.getDocumentAsync({type:"*/*",copyToCacheDirectory:!0,multiple:!1});if(console.log("Document picker result:",V),!V.canceled&&V.assets&&V.assets.length>0){let D=V.assets[0];console.log("Document selected successfully:",D.name),M?.({type:"document",data:{uri:D.uri,name:D.name,size:D.size,mimeType:D.mimeType}})}else console.log("Document selection was canceled by user")}catch(v){console.error("Error in document selection process:",v),te.Alert.alert("Document Selection Error","Failed to open document picker. Please try again.",[{text:"OK"}])}},[M]),P=(0,Qe.useCallback)(()=>{te.Alert.alert("Create Poll","Poll creation feature is coming soon! This would open a poll creation interface.",[{text:"OK",onPress:()=>console.log("Poll creation acknowledged")}])},[]),B=(0,Qe.useCallback)(()=>{te.Alert.alert("Create Event","Event creation feature is coming soon! This would open an event creation interface.",[{text:"OK",onPress:()=>console.log("Event creation acknowledged")}])},[]),E=(0,Qe.useCallback)(async v=>{console.log(`Selected attachment option: ${v}`);try{switch(v){case"photo":await C();break;case"camera":await R();break;case"location":await S();break;case"contact":await A();break;case"document":await I();break;case"poll":P();break;case"event":B();break;default:console.warn(`Unknown attachment option: ${v}`)}}catch(V){console.error(`Error handling ${v}:`,V),te.Alert.alert("Error",`Failed to handle ${v}. Please try again.`)}},[C,R,S,A,I,P,B]);return{menuRef:T,handleOptionSelect:E,options:Pr}};var Y=Q(require("react")),Kt=(M={})=>{let{initialValue:T="",initialHeight:C=50,onValueChange:R,onHeightChange:S,onSend:A,onAttachmentSend:I,onReplyCancel:P,onFocus:B,onBlur:E,maxHeight:v=100,minHeight:V=50,maxLength:D=1e3,placeholder:z="Type a message..."}=M,L=(0,Y.useRef)(null),[k,O]=Y.default.useState(T),[F,H]=Y.default.useState(C),[N,j]=Y.default.useState(!1),[oe,Ee]=Y.default.useState(null),[J,Me]=Y.default.useState([]),je=Y.default.useMemo(()=>({value:k,height:F,isFocused:N,replyToMessage:oe,attachments:J}),[k,F,N,oe,J]),Ke=(0,Y.useCallback)(Pe=>{O(Pe),R?.(Pe)},[R]),Be=(0,Y.useCallback)(Pe=>{let Fe=Math.max(V,Math.min(v,Pe));H(Fe),S?.(Fe)},[V,v,S]),Ce=(0,Y.useCallback)(()=>{j(!0),B?.()},[B]),U=(0,Y.useCallback)(()=>{j(!1),E?.()},[E]),Oe=(0,Y.useCallback)(Pe=>{let{height:Fe}=Pe.nativeEvent.contentSize,Ft=Math.max(V,Math.min(v,Fe+16));Be(Ft)},[V,v,Be]),Ze=(0,Y.useCallback)(()=>{A&&(k||J.length>0)&&(A(k,J,oe),O(T),Me([]),Ee(null),H(C))},[A,k,J,oe,T,C]),Ge=(0,Y.useCallback)(Pe=>{I?(I(Pe,k),k&&O(T)):Me(Fe=>[...Fe,{...Pe,id:Date.now().toString()}])},[I,k,T]),Ve=(0,Y.useCallback)(Pe=>{Me(Fe=>[...Fe,Pe])},[]),qe=(0,Y.useCallback)(Pe=>{Me(Fe=>Fe.filter(Ft=>Ft.id!==Pe))},[]),et=(0,Y.useCallback)(()=>{Me([])},[]),Se=(0,Y.useCallback)(()=>{Ee(null),P?.()},[P]),ct=(0,Y.useCallback)(()=>{L.current?.focus()},[]),No=Y.default.useMemo(()=>({setValue:Ke,setHeight:Be,setFocus:j,setReplyToMessage:Ee,addAttachment:Ve,removeAttachment:qe,clearAttachments:et,sendMessage:Ze,cancelReply:Se,focusInput:ct,handleAttachmentSelected:Ge,handleContentSizeChange:Oe,handleFocus:Ce,handleBlur:U}),[Ke,Be,j,Ee,Ve,qe,et,Ze,Se,ct,Ge,Oe,Ce,U]),Wo=Y.default.useMemo(()=>({textInputRef:L}),[]);return{state:je,actions:No,refs:Wo}},Ha=(0,Y.createContext)(null);var dt=(0,He.forwardRef)(({value:M,onChangeText:T,onSend:C,onFocus:R,height:S,onContentSizeChange:A,replyToMessage:I,onCancelReply:P,onAttachmentSend:B},E)=>{let v=$(),V=(0,He.useRef)(null);(0,He.useImperativeHandle)(E,()=>({focus:()=>{V.current?.focus()}}));let{state:D,actions:z}=Kt({initialValue:M,initialHeight:S,onValueChange:T,onHeightChange:A,onSend:C,onAttachmentSend:B,onReplyCancel:P,onFocus:R});He.default.useEffect(()=>{M!==D.value&&z.setValue(M)},[M,D.value,z]),He.default.useEffect(()=>{S!==D.height&&z.setHeight(S)},[S,D.height,z]),He.default.useEffect(()=>{I!==D.replyToMessage&&z.setReplyToMessage(I||null)},[I,D.replyToMessage,z]),He.default.useEffect(()=>{if(I&&V.current){let O=setTimeout(()=>{V.current?.focus()},100);return()=>clearTimeout(O)}},[I]);let L=(0,He.useCallback)(O=>{if(console.log("Attachment selected:",O),B)B(O,M.trim()||void 0),M.trim()&&T("");else switch(O.type){case"image":console.log("Image attachment ready to send:",{uri:O.data.uri,dimensions:{width:O.data.width,height:O.data.height},fileName:O.data.fileName});break;case"document":console.log("Document attachment ready to send:",{name:O.data.name,size:O.data.size});break;case"location":console.log("Location attachment ready to send:",O.data.coordinates);break;case"contact":console.log("Contact attachment ready to send:",O.data);break;default:console.log("Other attachment ready to send:",O)}},[B,M,T]),k=Vo(L);return<>
378
- {I&&P&&<Wt replyToMessage={I}onCancel={P}/>}
379
- <Ye.View style={{borderTopWidth:1,borderTopColor:v.colors.borderLight,backgroundColor:v.colors.background}}>
380
- <Ye.View style={{flexDirection:"row",alignItems:"center",backgroundColor:v.colors.background,paddingHorizontal:v.spacing.lg,paddingVertical:v.spacing.sm,minHeight:S}}>
381
- <Ye.TouchableOpacity style={{marginRight:v.spacing.md}}onPress={()=>k.menuRef.current?.show()}>
382
- <Lt.Plus size={24}color={v.colors.textSecondary}/>
383
- </Ye.TouchableOpacity>
371
+ </De.View>:null},Nt=De.StyleSheet.create({container:{paddingHorizontal:15,paddingVertical:5},bubble:{backgroundColor:"#fff",borderRadius:18,paddingHorizontal:12,paddingVertical:8,alignSelf:"flex-start",maxWidth:"80%"},senderNameContainer:{marginBottom:4},senderName:{fontSize:12,color:"#666",fontWeight:"500"},dotsContainer:{flexDirection:"row",alignItems:"center",justifyContent:"center"},dot:{width:6,height:6,borderRadius:3,backgroundColor:"#999",marginHorizontal:3}}),Wt=An;var qo=X(require("react")),Ut=require("react-native"),$s=require("lucide-react-native");var zn=({visible:C,onPress:R,isReplyActive:M=!1})=>{let T=$(),S=qo.default.useRef(new Ut.Animated.Value(0)).current,[A,I]=qo.default.useState(!1);return qo.default.useEffect(()=>{Ut.Animated.timing(S,{toValue:C?1:0,duration:200,useNativeDriver:!0}).start(()=>{I(C)})},[C,S]),!C&&!A?null:<Ut.Pressable onPress={R}hitSlop={{top:10,bottom:10,left:10,right:10}}>
372
+ {({pressed:P})=><Ut.Animated.View style={[{position:"absolute",bottom:40,right:T.spacing.lg,zIndex:9999,width:32,height:32,backgroundColor:T.colors.background,borderRadius:T.borderRadius.xl,justifyContent:"center",alignItems:"center",shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:3.84,elevation:5,opacity:S,transform:P?[{scale:.95}]:[]}]}>
373
+ <$s.ChevronDown size={20}color={T.colors.text}/>
374
+ </Ut.Animated.View>}
375
+ </Ut.Pressable>},$o=zn;var Mo=require("react-native");var Vn=({displayDate:C})=>{let R=$();return<Mo.View style={{marginVertical:R.spacing.lg,alignItems:"center"}}>
376
+ <Mo.View style={{borderRadius:R.borderRadius.full,backgroundColor:R.colors.surfaceSecondary,paddingHorizontal:R.spacing.md,paddingVertical:R.spacing.xs}}>
377
+ <Mo.Text style={{fontSize:R.typography.fontSize.xs,color:R.colors.textSecondary,fontWeight:R.typography.fontWeight.medium}}>
378
+ {C}
379
+ </Mo.Text>
380
+ </Mo.View>
381
+ </Mo.View>},Yo=Vn;var Ue=X(require("react")),Xe=require("react-native"),Kt=require("lucide-react-native");var ot=require("react"),ee=require("react-native"),Fe=require("lucide-react-native");var Bn={maxWidth:1920,maxHeight:1920,quality:.8,format:"jpeg"},ms=async(C,R={})=>{try{let M;try{M=await import("expo-image-manipulator")}catch(k){console.log("expo-image-manipulator not available, returning original image info:",k);let V=`image_${Date.now()}.jpg`;return{uri:C,width:1920,height:1920,fileName:V}}let T={...Bn,...R};console.log("Starting image compression...",{uri:C,options:T});let S=await M.manipulateAsync(C,[],{});console.log("Original image info:",{width:S.width,height:S.height,uri:S.uri});let A=[];if(T.maxWidth||T.maxHeight){let{width:k,height:D}=S,V=k,B=D;if(T.maxWidth&&k>T.maxWidth){let L=T.maxWidth/k;V=T.maxWidth,B=D*L}if(T.maxHeight&&B>T.maxHeight){let L=T.maxHeight/B;B=T.maxHeight,V=V*L}(V!==k||B!==D)&&(A.push({resize:{width:Math.round(V),height:Math.round(B)}}),console.log("Resizing image:",{from:{width:k,height:D},to:{width:Math.round(V),height:Math.round(B)}}))}let I={compress:T.quality,format:T.format==="png"?M.SaveFormat?.PNG:M.SaveFormat?.JPEG};console.log("Applying compression with options:",I);let P=await M.manipulateAsync(C,A,I);console.log("Image compression completed:",{originalUri:C,compressedUri:P.uri,finalDimensions:{width:P.width,height:P.height}});let z=Date.now(),E=T.format==="png"?"png":"jpg",v=`compressed_image_${z}.${E}`;return{uri:P.uri,width:P.width,height:P.height,fileName:v}}catch(M){console.error("Error compressing image:",M);let T=M instanceof Error?M.message:"Unknown error";throw new Error(`Failed to compress image: ${T}`)}},ps=(C,R)=>C>3e3||R>3e3?{maxWidth:1920,maxHeight:1920,quality:.7,format:"jpeg"}:C>1920||R>1920?{maxWidth:1920,maxHeight:1920,quality:.8,format:"jpeg"}:{quality:.9,format:"jpeg"};var kn=[{id:"photo",label:"Photo",icon:Fe.Image,color:"#3B82F6"},{id:"camera",label:"Camera",icon:Fe.Camera,color:"#6B7280"},{id:"location",label:"Location",icon:Fe.MapPin,color:"#10B981"},{id:"contact",label:"Contact",icon:Fe.User,color:"#6B7280"},{id:"document",label:"Document",icon:Fe.FileText,color:"#3B82F6"},{id:"poll",label:"Poll",icon:Fe.BarChart3,color:"#F59E0B"},{id:"event",label:"Event",icon:Fe.Calendar,color:"#EF4444"}],Go=C=>{let R=(0,ot.useRef)(null),M=(0,ot.useCallback)(async()=>{console.log("Photo selection initiated");try{let v;try{v=await import("expo-image-picker")}catch(V){console.log("expo-image-picker not available:",V),ee.Alert.alert("Feature Not Available","Photo selection requires expo-image-picker to be installed. Please install expo-image-picker to use this feature.",[{text:"OK"}]);return}console.log("Requesting photo library permissions...");let{status:k}=await v.requestMediaLibraryPermissionsAsync();if(console.log("Photo library permission status:",k),k!=="granted"){ee.Alert.alert("Permission needed","Please grant photo library access to select images.");return}console.log("Waiting for UI to stabilize..."),await new Promise(V=>setTimeout(()=>V(void 0),300)),console.log("Launching image picker...");let D=await v.launchImageLibraryAsync({mediaTypes:"images",allowsEditing:!0,aspect:[4,3],quality:.8,allowsMultipleSelection:!1});if(console.log("Image picker result:",D),!D.canceled&&D.assets&&D.assets.length>0){let V=D.assets[0];console.log("Photo selected successfully:",V.uri);try{console.log("Starting image compression...");let B=ps(V.width||1920,V.height||1920),L=await ms(V.uri,B);console.log("Image compression completed:",L),C?.({type:"image",data:{...L,originalFileSize:V.fileSize}})}catch(B){console.error("Image compression failed:",B),ee.Alert.alert("Compression Error","Failed to compress image. Sending original image.",[{text:"OK"}]),C?.({type:"image",data:{uri:V.uri,width:V.width,height:V.height,fileSize:V.fileSize,fileName:V.fileName||"image.jpg"}})}}else console.log("Photo selection was canceled by user")}catch(v){console.error("Error in photo selection process:",v),ee.Alert.alert("Photo Selection Error","Failed to open photo library. Please try again or check your device permissions.",[{text:"OK"}])}},[C]),T=(0,ot.useCallback)(async()=>{console.log("Camera capture initiated");try{let v;try{v=await import("expo-image-picker")}catch(V){console.log("expo-image-picker not available:",V),ee.Alert.alert("Feature Not Available","Camera capture requires expo-image-picker to be installed. Please install expo-image-picker to use this feature.",[{text:"OK"}]);return}console.log("Requesting camera permissions...");let{status:k}=await v.requestCameraPermissionsAsync();if(console.log("Camera permission status:",k),k!=="granted"){ee.Alert.alert("Permission needed","Please grant camera access to take photos.");return}console.log("Waiting for UI to stabilize..."),await new Promise(V=>setTimeout(()=>V(void 0),300)),console.log("Launching camera...");let D=await v.launchCameraAsync({allowsEditing:!0,aspect:[4,3],quality:.8,mediaTypes:"images"});if(console.log("Camera result:",D),!D.canceled&&D.assets&&D.assets.length>0){let V=D.assets[0];console.log("Photo captured successfully:",V.uri);try{console.log("Starting camera image compression...");let B=ps(V.width||1920,V.height||1920),L=await ms(V.uri,B);console.log("Camera image compression completed:",L),C?.({type:"image",data:{...L,originalFileSize:V.fileSize}})}catch(B){console.error("Camera image compression failed:",B),ee.Alert.alert("Compression Error","Failed to compress captured image. Sending original image.",[{text:"OK"}]),C?.({type:"image",data:{uri:V.uri,width:V.width,height:V.height,fileSize:V.fileSize,fileName:V.fileName||"camera_photo.jpg"}})}}else console.log("Camera capture was canceled by user")}catch(v){console.error("Error in camera capture process:",v),ee.Alert.alert("Camera Error","Failed to open camera. Please try again or check your device permissions.",[{text:"OK"}])}},[C]),S=(0,ot.useCallback)(async()=>{console.log("Location sharing initiated");try{let v;try{v=await import("expo-location")}catch(L){console.log("expo-location not available:",L),ee.Alert.alert("Feature Not Available","Location sharing requires expo-location to be installed. Please install expo-location to use this feature.",[{text:"OK"}]);return}console.log("Requesting location permissions...");let{status:k}=await v.requestForegroundPermissionsAsync();if(console.log("Location permission status:",k),k!=="granted"){ee.Alert.alert("Permission needed","Please grant location access to share your location.");return}console.log("Getting current location...");let D=await v.getCurrentPositionAsync({accuracy:v.Accuracy.High});console.log("Getting address from coordinates...");let V=await v.reverseGeocodeAsync({latitude:D.coords.latitude,longitude:D.coords.longitude}),B={coordinates:{latitude:D.coords.latitude,longitude:D.coords.longitude},address:V[0]||null,timestamp:D.timestamp};console.log("Location shared successfully:",B.coordinates),C?.({type:"location",data:B})}catch(v){console.error("Error in location sharing process:",v),ee.Alert.alert("Location Error","Failed to get your location. Please try again or check your device permissions.",[{text:"OK"}])}},[C]),A=(0,ot.useCallback)(async()=>{try{let v;try{v=await import("expo-contacts")}catch(D){console.log("expo-contacts not available:",D),ee.Alert.alert("Feature Not Available","Contact sharing requires expo-contacts to be installed. Please install expo-contacts to use this feature.",[{text:"OK"}]);return}let{status:k}=await v.requestPermissionsAsync();if(k!=="granted"){ee.Alert.alert("Permission needed","Please grant contacts access to share contacts.");return}ee.Alert.alert("Contact Sharing","Contact selection feature is coming soon! This would open a contact picker.",[{text:"OK",onPress:()=>console.log("Contact sharing acknowledged")}])}catch(v){console.error("Error accessing contacts:",v),ee.Alert.alert("Error","Failed to access contacts. Please try again.")}finally{R.current?.hide()}},[]),I=(0,ot.useCallback)(async()=>{console.log("Document selection initiated");try{let v;try{v=await import("expo-document-picker")}catch(D){console.log("expo-document-picker not available:",D),ee.Alert.alert("Feature Not Available","Document selection requires expo-document-picker to be installed. Please install expo-document-picker to use this feature.",[{text:"OK"}]);return}console.log("Waiting for UI to stabilize..."),await new Promise(D=>setTimeout(()=>D(void 0),300)),console.log("Launching document picker...");let k=await v.getDocumentAsync({type:"*/*",copyToCacheDirectory:!0,multiple:!1});if(console.log("Document picker result:",k),!k.canceled&&k.assets&&k.assets.length>0){let D=k.assets[0];console.log("Document selected successfully:",D.name),C?.({type:"document",data:{uri:D.uri,name:D.name,size:D.size,mimeType:D.mimeType}})}else console.log("Document selection was canceled by user")}catch(v){console.error("Error in document selection process:",v),ee.Alert.alert("Document Selection Error","Failed to open document picker. Please try again.",[{text:"OK"}])}},[C]),P=(0,ot.useCallback)(()=>{ee.Alert.alert("Create Poll","Poll creation feature is coming soon! This would open a poll creation interface.",[{text:"OK",onPress:()=>console.log("Poll creation acknowledged")}])},[]),z=(0,ot.useCallback)(()=>{ee.Alert.alert("Create Event","Event creation feature is coming soon! This would open an event creation interface.",[{text:"OK",onPress:()=>console.log("Event creation acknowledged")}])},[]),E=(0,ot.useCallback)(async v=>{console.log(`Selected attachment option: ${v}`);try{switch(v){case"photo":await M();break;case"camera":await T();break;case"location":await S();break;case"contact":await A();break;case"document":await I();break;case"poll":P();break;case"event":z();break;default:console.warn(`Unknown attachment option: ${v}`)}}catch(k){console.error(`Error handling ${v}:`,k),ee.Alert.alert("Error",`Failed to handle ${v}. Please try again.`)}},[M,T,S,A,I,P,z]);return{menuRef:R,handleOptionSelect:E,options:kn}};var Y=X(require("react")),To=(C={})=>{let{initialValue:R="",initialHeight:M=50,onValueChange:T,onHeightChange:S,onSend:A,onAttachmentSend:I,onReplyCancel:P,onFocus:z,onBlur:E,maxHeight:v=100,minHeight:k=50,maxLength:D=1e3,placeholder:V="Type a message..."}=C,B=(0,Y.useRef)(null),[L,F]=Y.default.useState(R),[j,H]=Y.default.useState(M),[N,O]=Y.default.useState(!1),[te,Le]=Y.default.useState(null),[Ce,Ee]=Y.default.useState([]),Me=Y.default.useMemo(()=>({value:L,height:j,isFocused:N,replyToMessage:te,attachments:Ce}),[L,j,N,te,Ce]),ke=(0,Y.useCallback)(ze=>{F(ze),T?.(ze)},[T]),Ae=(0,Y.useCallback)(ze=>{let Ne=Math.max(k,Math.min(v,ze));H(Ne),S?.(Ne)},[k,v,S]),Ye=(0,Y.useCallback)(()=>{O(!0),z?.()},[z]),U=(0,Y.useCallback)(()=>{O(!1),E?.()},[E]),Ge=(0,Y.useCallback)(ze=>{let{height:Ne}=ze.nativeEvent.contentSize,Gt=Math.max(k,Math.min(v,Ne+16));Ae(Gt)},[k,v,Ae]),Oe=(0,Y.useCallback)(()=>{A&&(L||Ce.length>0)&&(A(L,Ce,te),F(R),Ee([]),Le(null),H(M))},[A,L,Ce,te,R,M]),Mt=(0,Y.useCallback)(ze=>{I?(I(ze,L),L&&F(R)):Ee(Ne=>[...Ne,{...ze,id:Date.now().toString()}])},[I,L,R]),Te=(0,Y.useCallback)(ze=>{Ee(Ne=>[...Ne,ze])},[]),_e=(0,Y.useCallback)(ze=>{Ee(Ne=>Ne.filter(Gt=>Gt.id!==ze))},[]),Ze=(0,Y.useCallback)(()=>{Ee([])},[]),we=(0,Y.useCallback)(()=>{Le(null),P?.()},[P]),Pt=(0,Y.useCallback)(()=>{B.current?.focus()},[]),Tt=Y.default.useMemo(()=>({setValue:ke,setHeight:Ae,setFocus:O,setReplyToMessage:Le,addAttachment:Te,removeAttachment:_e,clearAttachments:Ze,sendMessage:Oe,cancelReply:we,focusInput:Pt,handleAttachmentSelected:Mt,handleContentSizeChange:Ge,handleFocus:Ye,handleBlur:U}),[ke,Ae,O,Le,Te,_e,Ze,Oe,we,Pt,Mt,Ge,Ye,U]),ss=Y.default.useMemo(()=>({textInputRef:B}),[]);return{state:Me,actions:Tt,refs:ss}},si=(0,Y.createContext)(null);var mt=(0,Ue.forwardRef)(({value:C,onChangeText:R,onSend:M,onFocus:T,height:S,onContentSizeChange:A,replyToMessage:I,onCancelReply:P,onAttachmentSend:z},E)=>{let v=$(),k=We(),D=(0,Ue.useRef)(null);(0,Ue.useImperativeHandle)(E,()=>({focus:()=>{D.current?.focus()}}));let{state:V,actions:B}=To({initialValue:C,initialHeight:S,onValueChange:R,onHeightChange:A,onSend:M,onAttachmentSend:z,onReplyCancel:P,onFocus:T});Ue.default.useEffect(()=>{C!==V.value&&B.setValue(C)},[C,V.value,B]),Ue.default.useEffect(()=>{S!==V.height&&B.setHeight(S)},[S,V.height,B]),Ue.default.useEffect(()=>{I!==V.replyToMessage&&B.setReplyToMessage(I||null)},[I,V.replyToMessage,B]),Ue.default.useEffect(()=>{if(I&&D.current){let j=setTimeout(()=>{D.current?.focus()},100);return()=>clearTimeout(j)}},[I]);let L=(0,Ue.useCallback)(j=>{if(console.log("Attachment selected:",j),z)z(j,C.trim()||void 0),C.trim()&&R("");else switch(j.type){case"image":console.log("Image attachment ready to send:",{uri:j.data.uri,dimensions:{width:j.data.width,height:j.data.height},fileName:j.data.fileName});break;case"document":console.log("Document attachment ready to send:",{name:j.data.name,size:j.data.size});break;case"location":console.log("Location attachment ready to send:",j.data.coordinates);break;case"contact":console.log("Contact attachment ready to send:",j.data);break;default:console.log("Other attachment ready to send:",j)}},[z,C,R]),F=Go(L);return<>
382
+ {I&&P&&<Co replyToMessage={I}onCancel={P}/>}
383
+ <Xe.View style={{borderTopWidth:1,borderTopColor:v.colors.borderLight,backgroundColor:v.colors.background}}>
384
+ <Xe.View style={{flexDirection:"row",alignItems:"center",backgroundColor:v.colors.background,paddingHorizontal:v.spacing.lg,paddingVertical:v.spacing.sm,minHeight:S}}>
385
+ <Xe.TouchableOpacity style={{marginRight:v.spacing.md}}onPress={()=>F.menuRef.current?.show()}>
386
+ <Kt.Plus size={24}color={v.colors.textSecondary}/>
387
+ </Xe.TouchableOpacity>
384
388
 
385
- <Ye.View style={{flex:1,flexDirection:"row",alignItems:"center",borderRadius:v.borderRadius.full,backgroundColor:v.colors.surfaceSecondary,paddingHorizontal:v.spacing.lg,paddingVertical:6}}>
386
- <Ye.TextInput ref={V}style={{flex:1,fontSize:v.typography.fontSize.base,maxHeight:70,minHeight:18,paddingTop:Ye.Platform.OS==="ios"?6:3,paddingBottom:Ye.Platform.OS==="ios"?6:3,color:v.colors.text}}value={M}onChangeText={T}placeholder='Type a message...'placeholderTextColor={v.colors.textMuted}multiline maxLength={1e3}onFocus={R}onContentSizeChange={z.handleContentSizeChange}returnKeyType='default'textAlignVertical='center'/>
387
- </Ye.View>
389
+ <Xe.View style={{flex:1,flexDirection:"row",alignItems:"center",borderRadius:v.borderRadius.full,backgroundColor:v.colors.surfaceSecondary,paddingHorizontal:v.spacing.lg,paddingVertical:6}}>
390
+ <Xe.TextInput ref={D}style={{flex:1,fontSize:v.typography.fontSize.base,maxHeight:70,minHeight:18,paddingTop:Xe.Platform.OS==="ios"?6:3,paddingBottom:Xe.Platform.OS==="ios"?6:3,color:v.colors.text}}value={C}onChangeText={R}placeholder={k("input.placeholder")}placeholderTextColor={v.colors.textMuted}multiline maxLength={1e3}onFocus={T}onContentSizeChange={B.handleContentSizeChange}returnKeyType='default'textAlignVertical='center'/>
391
+ </Xe.View>
388
392
 
389
- <Ye.TouchableOpacity onPress={C}style={{marginLeft:v.spacing.md,height:40,width:40,alignItems:"center",justifyContent:"center",borderRadius:v.borderRadius.full,backgroundColor:M.trim()?v.colors.primary:v.colors.gray[300]}}disabled={!M.trim()}>
390
- {M.trim()?<Lt.Send size={18}color='white'/>:<Lt.Mic size={18}color='white'/>}
391
- </Ye.TouchableOpacity>
392
- </Ye.View>
393
- </Ye.View>
393
+ <Xe.TouchableOpacity onPress={M}style={{marginLeft:v.spacing.md,height:40,width:40,alignItems:"center",justifyContent:"center",borderRadius:v.borderRadius.full,backgroundColor:C.trim()?v.colors.primary:v.colors.gray[300]}}disabled={!C.trim()}>
394
+ {C.trim()?<Kt.Send size={18}color='white'/>:<Kt.Mic size={18}color='white'/>}
395
+ </Xe.TouchableOpacity>
396
+ </Xe.View>
397
+ </Xe.View>
394
398
 
395
- <Ct ref={k.menuRef}onOptionSelect={k.handleOptionSelect}options={k.options}/>
396
- </>});dt.displayName="MessageInput";var Do=require("react-native"),Xo=require("lucide-react-native");var Lo=Q(require("react"));var ht=Q(require("react"));var ko=require("react");function qt(M,T={}){let{initialNumToRender:C=20,maxToRenderPerBatch:R=10,windowSize:S=10}=T,A=(0,ko.useMemo)(()=>Ms(M).reverse(),[M]),I=(0,ko.useCallback)(P=>P.listItemType==="date-separator"?P.id:P.id.toString(),[]);return{messageItems:A,keyExtractor:I,flatListProps:{initialNumToRender:C,maxToRenderPerBatch:R,windowSize:S,inverted:!0,showsVerticalScrollIndicator:!1,keyboardShouldPersistTaps:"handled",removeClippedSubviews:!1,scrollEventThrottle:16}}}var Ne=require("react");function Qo(M={}){let{scrollThreshold:T=50,autoScrollToBottom:C=!0}=M,R=(0,Ne.useRef)(null),[S,A]=(0,Ne.useState)({isNearBottom:!0,isNearTop:!1,showScrollToBottomButton:!1}),I=(0,Ne.useRef)(0),P=(0,Ne.useCallback)(L=>{let{contentOffset:k,contentSize:O,layoutMeasurement:F}=L.nativeEvent,H=k.y,N=Math.abs(H)<T,j=Math.abs(H)>O.height-F.height-T;A({isNearBottom:N,isNearTop:j,showScrollToBottomButton:!N})},[T]),B=(0,Ne.useCallback)(L=>{let k=L>I.current;return I.current=L,k},[]),E=(0,Ne.useCallback)(()=>{},[]),v=(0,Ne.useCallback)((L=!0)=>{R.current&&R.current.scrollToOffset({offset:0,animated:L})},[]),V=(0,Ne.useCallback)((L,k=!0)=>{R.current&&R.current.scrollToOffset({offset:L,animated:k})},[]),D=(0,Ne.useCallback)((L,k=!0)=>{R.current&&R.current.scrollToIndex({index:L,animated:k})},[]),z=(0,Ne.useCallback)(L=>{B(L)&&C&&R.current&&setTimeout(()=>{v()},100)},[B,C,v]);return{flatListRef:R,scrollState:S,handleScroll:P,handleContentSizeChange:E,handleNewMessages:z,scrollToEnd:v,scrollToOffset:V,scrollToIndex:D}}var Et=require("react");function $t(M={}){let{enableMessageActions:T=!0}=M,[C,R]=(0,Et.useState)({actionSheetVisible:!1,selectedMessage:null,messagePosition:void 0}),S=(0,Et.useCallback)((P,B)=>{T&&R({actionSheetVisible:!0,selectedMessage:P,messagePosition:B})},[T]),A=(0,Et.useCallback)(()=>{R({actionSheetVisible:!1,selectedMessage:null,messagePosition:void 0})},[]),I=(0,Et.useCallback)((P,B)=>{if(!C.selectedMessage)return;let{selectedMessage:E}=C;switch(P){case"reply":B?.onReply?.(E);break;case"copy":if(B?.onCopy)B.onCopy(E);else{let v=E.type==="image"&&E.imageData?E.text||"Image message":E.text;Promise.resolve().then(()=>(Bs(),zs)).then(({copyToClipboard:V})=>{V(v)}).catch(()=>{console.log("Clipboard functionality not available")})}break;case"delete":B?.onDelete?.(E.id);break;default:B?.onCustomAction?.(P,E);break}A()},[C.selectedMessage,A]);return{actionState:C,handleMessageLongPress:S,handleActionSheetClose:A,handleActionPress:I}}var it=require("react");function Yt(M={}){let{enableReactionDetails:T=!0}=M,[C,R]=(0,it.useState)({isReactionDetailsVisible:!1,selectedReactions:[],selectedMessageText:""}),[S,A]=(0,it.useState)(null),I=(0,it.useCallback)(V=>{T&&V.reactions&&V.reactions.length>0&&(A(V),R({isReactionDetailsVisible:!0,selectedReactions:V.reactions,selectedMessageText:V.text}))},[T]),P=(0,it.useCallback)(()=>{R({isReactionDetailsVisible:!1,selectedReactions:[],selectedMessageText:""}),A(null)},[]),B=(0,it.useCallback)((V,D)=>{S&&D?.(S.id,V),P()},[S,P]),E=(0,it.useCallback)((V,D)=>{S&&D?.(S.id,V),P()},[S,P]),v=(0,it.useCallback)((V,D)=>{S&&D?.(S.id,V)},[S]);return{reactionState:C,selectedMessage:S,handleReactionPress:I,handleReactionDetailsClose:P,handleAddReaction:B,handleRemoveReaction:E,handleEmojiReact:v}}var Gt=require("react");function Zo(){let[M,T]=(0,Gt.useState)({replyToMessage:null}),C=(0,Gt.useCallback)(S=>{T({replyToMessage:S})},[]),R=(0,Gt.useCallback)(()=>{T({replyToMessage:null})},[]);return{replyState:M,setReplyToMessage:C,clearReply:R}}var Vs=(0,ht.createContext)(null);function jt(){let M=(0,ht.useContext)(Vs);if(!M)throw new Error("useMessageListContext must be used within MessageListProvider");return M}function _t({children:M,messages:T,config:C={},...R}){let S=qt(T,C),A=Qo(C),I=$t(C),P=Yt(C),B=Zo();ht.default.useEffect(()=>{A.handleNewMessages(T.length)},[T.length,A.handleNewMessages]);let E=(0,ht.useMemo)(()=>({messageList:S,scroll:A,actions:I,reactions:P,reply:B,config:C,callbacks:R}),[S,A,I,P,B,C,R]);return<Vs.Provider value={E}>
397
- {M}
398
- </Vs.Provider>}var Jt=require("react"),Ot=require("react-native");var ft={Provider:_t,Container:({children:M,style:T})=><Ot.View style={[Ds.container,T]}>{M}</Ot.View>,Messages:({renderMessage:M,style:T})=>{let{messageList:C,scroll:R,actions:S,reactions:A,callbacks:I}=jt(),P=(0,Jt.useCallback)(({item:E,index:v})=>M&&E.listItemType!=="date-separator"?M({message:E,index:v})||null:E.listItemType==="date-separator"?<Bo date={E.date}displayDate={E.displayDate}/>:<Ro message={E}onLongPress={S.handleMessageLongPress}onReactionPress={A.handleReactionPress}onReactionRemove={I.onReactionRemove}/>,[S.handleMessageLongPress,A.handleReactionPress,I.onReactionRemove,M]),B=(0,Jt.useCallback)(E=>{R.handleScroll(E);let{isNearBottom:v,isNearTop:V}=R.scrollState;I.onScrollPositionChange?.(v,V),v&&I.onScrollToBottom?.(),V&&I.onScrollToTop?.()},[R.handleScroll,R.scrollState,I]);return<Ot.FlatList ref={R.flatListRef}data={C.messageItems}renderItem={P}keyExtractor={C.keyExtractor}contentContainerStyle={[Ds.contentContainer,T]}onContentSizeChange={R.handleContentSizeChange}onScroll={B}{...C.flatListProps}/>},TypingIndicator:({isVisible:M})=>M?<Dt isVisible={M}/>:null,ScrollButton:({visible:M,isReplyActive:T,onPress:C})=>{let{scroll:R}=jt();return<Ao visible={M??R.scrollState.showScrollToBottomButton}onPress={C??R.scrollToEnd}isReplyActive={T}/>},ActionSheet:()=>{let{actions:M,reactions:T,reply:C,callbacks:R,config:S}=jt(),A=(0,Jt.useCallback)(P=>{M.handleActionPress(P,{onReply:B=>{C.setReplyToMessage(B),R.onReplyMessage?.(B)},onDelete:R.onMessageDelete,onCustomAction:R.onActionPress})},[M.handleActionPress,C.setReplyToMessage,R]),I=(0,Jt.useCallback)(P=>{console.log("\u{1F525} MessageListCompound - handleEmojiReact called with emoji:",P);let B=M.actionState.selectedMessage;console.log("\u{1F525} MessageListCompound - selectedMessage:",B?.id,"callbacks.onReactionAdd exists:",!!R.onReactionAdd),B&&R.onReactionAdd?(console.log("\u{1F525} MessageListCompound - Calling onReactionAdd for message:",B.id,"emoji:",P),R.onReactionAdd(B.id,P)):console.log("\u{1F525} MessageListCompound - NOT calling onReactionAdd. selectedMessage:",!!B,"callback exists:",!!R.onReactionAdd)},[M.actionState.selectedMessage,R.onReactionAdd]);return S.enableMessageActions?<So visible={M.actionState.actionSheetVisible}onClose={M.handleActionSheetClose}isMyMessage={M.actionState.selectedMessage?.isMe||!1}selectedMessage={M.actionState.selectedMessage||void 0}messagePosition={M.actionState.messagePosition}onActionPress={A}onEmojiReact={I}/>:null},ReactionDetails:()=>{let{reactions:M,callbacks:T,config:C}=jt();return C.enableReactionDetails?<Io visible={M.reactionState.isReactionDetailsVisible}onClose={M.handleReactionDetailsClose}reactions={M.reactionState.selectedReactions}messageText={M.reactionState.selectedMessageText}onRemoveReaction={R=>M.handleRemoveReaction(R,T.onReactionRemove)}/>:null}},Ds=Ot.StyleSheet.create({container:{flex:1},contentContainer:{paddingVertical:16}});var ut=(0,Lo.forwardRef)(({messages:M,isTyping:T,showScrollToBottom:C=!1,isReplyActive:R=!1,...S},A)=>{let I={scrollThreshold:S.scrollThreshold,autoScrollToBottom:S.autoScrollToBottom,enableMessageActions:S.enableMessageActions,enableReactionDetails:S.enableReactionDetails},P={onScrollToBottom:S.onScrollToBottom,onScrollToTop:S.onScrollToTop,onScrollPositionChange:S.onScrollPositionChange,onReactionAdd:S.onReactionAdd,onReactionRemove:S.onReactionRemove,onMessageDelete:S.onMessageDelete,onReplyMessage:S.onReplyMessage,onActionPress:S.onActionPress};return Lo.default.useImperativeHandle(A,()=>({scrollToEnd:(B=!0)=>{},scrollToOffset:(B,E=!0)=>{},scrollToIndex:(B,E=!0)=>{}}),[]),<_t messages={M}config={I}{...P}>
399
- <ft.Container>
400
- <ft.Messages/>
401
- <ft.TypingIndicator isVisible={T}/>
402
- <ft.ScrollButton visible={C?void 0:!1}isReplyActive={R}/>
403
- <ft.ActionSheet/>
404
- <ft.ReactionDetails/>
405
- </ft.Container>
406
- </_t>});ut.displayName="MessageList";var ks=Q(require("react"));function Le(M){let T=ks.default.forwardRef((R,S)=>(Tt(),<M{...R}ref={S}/>)),C=M.displayName||M.name||"Component";return T.displayName=`RequireAuth(${C})`,T}function rt(M){return(...T)=>(Tt(),M(...T))}var Eo=require("react-native");var We=require("react-native");var yt=require("react-native");var Vr=({avatar:M,isOnline:T=!1,size:C="medium"})=>{let R=$(),S=()=>{switch(C){case"small":return{width:32,height:32};case"large":return{width:64,height:64};default:return{width:48,height:48}}},A=()=>{switch(C){case"small":return{width:12,height:12};case"large":return{width:24,height:24};default:return{width:16,height:16}}},I=S(),P=A(),E=(()=>{switch(C){case"small":return 14;case"large":return 28;default:return 20}})();return<yt.View style={{position:"relative"}}>
407
- {M&&M.trim()!==""?<yt.Image source={{uri:M}}style={[I,{borderRadius:R.borderRadius.full}]}resizeMode="cover"/>:<yt.View style={[I,{borderRadius:R.borderRadius.full,backgroundColor:R.colors.primary,justifyContent:"center",alignItems:"center"}]}>
408
- <yt.Text style={{color:R.colors.background,fontSize:E,fontWeight:"600"}}>
399
+ <It ref={F.menuRef}onOptionSelect={F.handleOptionSelect}options={F.options}/>
400
+ </>});mt.displayName="MessageInput";var _o=require("react-native"),gs=require("lucide-react-native");var Xo=X(require("react"));var yt=X(require("react"));var Jo=require("react");function Ro(C,R={}){let{initialNumToRender:M=20,maxToRenderPerBatch:T=10,windowSize:S=10}=R,A=(0,Jo.useMemo)(()=>Es(C).reverse(),[C]),I=(0,Jo.useCallback)(P=>P.listItemType==="date-separator"?P.id:P.id.toString(),[]);return{messageItems:A,keyExtractor:I,flatListProps:{initialNumToRender:M,maxToRenderPerBatch:T,windowSize:S,inverted:!0,showsVerticalScrollIndicator:!1,keyboardShouldPersistTaps:"handled",removeClippedSubviews:!1,scrollEventThrottle:16}}}var Ke=require("react");function hs(C={}){let{scrollThreshold:R=50,autoScrollToBottom:M=!0}=C,T=(0,Ke.useRef)(null),[S,A]=(0,Ke.useState)({isNearBottom:!0,isNearTop:!1,showScrollToBottomButton:!1}),I=(0,Ke.useRef)(0),P=(0,Ke.useCallback)(B=>{let{contentOffset:L,contentSize:F,layoutMeasurement:j}=B.nativeEvent,H=L.y,N=Math.abs(H)<R,O=Math.abs(H)>F.height-j.height-R;A({isNearBottom:N,isNearTop:O,showScrollToBottomButton:!N})},[R]),z=(0,Ke.useCallback)(B=>{let L=B>I.current;return I.current=B,L},[]),E=(0,Ke.useCallback)(()=>{},[]),v=(0,Ke.useCallback)((B=!0)=>{T.current&&T.current.scrollToOffset({offset:0,animated:B})},[]),k=(0,Ke.useCallback)((B,L=!0)=>{T.current&&T.current.scrollToOffset({offset:B,animated:L})},[]),D=(0,Ke.useCallback)((B,L=!0)=>{T.current&&T.current.scrollToIndex({index:B,animated:L})},[]),V=(0,Ke.useCallback)(B=>{z(B)&&M&&T.current&&setTimeout(()=>{v()},100)},[z,M,v]);return{flatListRef:T,scrollState:S,handleScroll:P,handleContentSizeChange:E,handleNewMessages:V,scrollToEnd:v,scrollToOffset:k,scrollToIndex:D}}var qt=require("react");function So(C={}){let{enableMessageActions:R=!0}=C,[M,T]=(0,qt.useState)({actionSheetVisible:!1,selectedMessage:null,messagePosition:void 0}),S=(0,qt.useCallback)((P,z)=>{R&&T({actionSheetVisible:!0,selectedMessage:P,messagePosition:z})},[R]),A=(0,qt.useCallback)(()=>{T({actionSheetVisible:!1,selectedMessage:null,messagePosition:void 0})},[]),I=(0,qt.useCallback)((P,z)=>{if(!M.selectedMessage)return;let{selectedMessage:E}=M;switch(P){case"reply":z?.onReply?.(E);break;case"copy":if(z?.onCopy)z.onCopy(E);else{let v=E.type==="image"&&E.imageData?E.text||"Image message":E.text;Promise.resolve().then(()=>(Gs(),Ys)).then(({copyToClipboard:k})=>{k(v)}).catch(()=>{console.log("Clipboard functionality not available")})}break;case"delete":z?.onDelete?.(E.id);break;default:z?.onCustomAction?.(P,E);break}A()},[M.selectedMessage,A]);return{actionState:M,handleMessageLongPress:S,handleActionSheetClose:A,handleActionPress:I}}var dt=require("react");function wo(C={}){let{enableReactionDetails:R=!0}=C,[M,T]=(0,dt.useState)({isReactionDetailsVisible:!1,selectedReactions:[],selectedMessageText:""}),[S,A]=(0,dt.useState)(null),I=(0,dt.useCallback)(k=>{R&&k.reactions&&k.reactions.length>0&&(A(k),T({isReactionDetailsVisible:!0,selectedReactions:k.reactions,selectedMessageText:k.text}))},[R]),P=(0,dt.useCallback)(()=>{T({isReactionDetailsVisible:!1,selectedReactions:[],selectedMessageText:""}),A(null)},[]),z=(0,dt.useCallback)((k,D)=>{S&&D?.(S.id,k),P()},[S,P]),E=(0,dt.useCallback)((k,D)=>{S&&D?.(S.id,k),P()},[S,P]),v=(0,dt.useCallback)((k,D)=>{S&&D?.(S.id,k)},[S]);return{reactionState:M,selectedMessage:S,handleReactionPress:I,handleReactionDetailsClose:P,handleAddReaction:z,handleRemoveReaction:E,handleEmojiReact:v}}var Io=require("react");function fs(){let[C,R]=(0,Io.useState)({replyToMessage:null}),M=(0,Io.useCallback)(S=>{R({replyToMessage:S})},[]),T=(0,Io.useCallback)(()=>{R({replyToMessage:null})},[]);return{replyState:C,setReplyToMessage:M,clearReply:T}}var _s=(0,yt.createContext)(null);function $t(){let C=(0,yt.useContext)(_s);if(!C)throw new Error("useMessageListContext must be used within MessageListProvider");return C}function Po({children:C,messages:R,config:M={},...T}){let S=Ro(R,M),A=hs(M),I=So(M),P=wo(M),z=fs();yt.default.useEffect(()=>{A.handleNewMessages(R.length)},[R.length,A.handleNewMessages]);let E=(0,yt.useMemo)(()=>({messageList:S,scroll:A,actions:I,reactions:P,reply:z,config:M,callbacks:T}),[S,A,I,P,z,M,T]);return<_s.Provider value={E}>
401
+ {C}
402
+ </_s.Provider>}var Ao=require("react"),Yt=require("react-native");var xt={Provider:Po,Container:({children:C,style:R})=><Yt.View style={[Js.container,R]}>{C}</Yt.View>,Messages:({renderMessage:C,style:R})=>{let{messageList:M,scroll:T,actions:S,reactions:A,callbacks:I}=$t(),P=(0,Ao.useCallback)(({item:E,index:v})=>C&&E.listItemType!=="date-separator"?C({message:E,index:v})||null:E.listItemType==="date-separator"?<Yo date={E.date}displayDate={E.displayDate}/>:<Ho message={E}onLongPress={S.handleMessageLongPress}onReactionPress={A.handleReactionPress}onReactionRemove={I.onReactionRemove}/>,[S.handleMessageLongPress,A.handleReactionPress,I.onReactionRemove,C]),z=(0,Ao.useCallback)(E=>{T.handleScroll(E);let{isNearBottom:v,isNearTop:k}=T.scrollState;I.onScrollPositionChange?.(v,k),v&&I.onScrollToBottom?.(),k&&I.onScrollToTop?.()},[T.handleScroll,T.scrollState,I]);return<Yt.FlatList ref={T.flatListRef}data={M.messageItems}renderItem={P}keyExtractor={M.keyExtractor}contentContainerStyle={[Js.contentContainer,R]}onContentSizeChange={T.handleContentSizeChange}onScroll={z}{...M.flatListProps}/>},TypingIndicator:({isVisible:C})=>C?<Wt isVisible={C}/>:null,ScrollButton:({visible:C,isReplyActive:R,onPress:M})=>{let{scroll:T}=$t();return<$o visible={C??T.scrollState.showScrollToBottomButton}onPress={M??T.scrollToEnd}isReplyActive={R}/>},ActionSheet:()=>{let{actions:C,reactions:R,reply:M,callbacks:T,config:S}=$t(),A=(0,Ao.useCallback)(P=>{C.handleActionPress(P,{onReply:z=>{M.setReplyToMessage(z),T.onReplyMessage?.(z)},onDelete:T.onMessageDelete,onCustomAction:T.onActionPress})},[C.handleActionPress,M.setReplyToMessage,T]),I=(0,Ao.useCallback)(P=>{console.log("\u{1F525} MessageListCompound - handleEmojiReact called with emoji:",P);let z=C.actionState.selectedMessage;console.log("\u{1F525} MessageListCompound - selectedMessage:",z?.id,"callbacks.onReactionAdd exists:",!!T.onReactionAdd),z&&T.onReactionAdd?(console.log("\u{1F525} MessageListCompound - Calling onReactionAdd for message:",z.id,"emoji:",P),T.onReactionAdd(z.id,P)):console.log("\u{1F525} MessageListCompound - NOT calling onReactionAdd. selectedMessage:",!!z,"callback exists:",!!T.onReactionAdd)},[C.actionState.selectedMessage,T.onReactionAdd]);return S.enableMessageActions?<Wo visible={C.actionState.actionSheetVisible}onClose={C.handleActionSheetClose}isMyMessage={C.actionState.selectedMessage?.isMe||!1}selectedMessage={C.actionState.selectedMessage||void 0}messagePosition={C.actionState.messagePosition}onActionPress={A}onEmojiReact={I}/>:null},ReactionDetails:()=>{let{reactions:C,callbacks:R,config:M}=$t();return M.enableReactionDetails?<Uo visible={C.reactionState.isReactionDetailsVisible}onClose={C.handleReactionDetailsClose}reactions={C.reactionState.selectedReactions}messageText={C.reactionState.selectedMessageText}onRemoveReaction={T=>C.handleRemoveReaction(T,R.onReactionRemove)}/>:null}},Js=Yt.StyleSheet.create({container:{flex:1},contentContainer:{paddingVertical:16}});var pt=(0,Xo.forwardRef)(({messages:C,isTyping:R,showScrollToBottom:M=!1,isReplyActive:T=!1,...S},A)=>{let I={scrollThreshold:S.scrollThreshold,autoScrollToBottom:S.autoScrollToBottom,enableMessageActions:S.enableMessageActions,enableReactionDetails:S.enableReactionDetails},P={onScrollToBottom:S.onScrollToBottom,onScrollToTop:S.onScrollToTop,onScrollPositionChange:S.onScrollPositionChange,onReactionAdd:S.onReactionAdd,onReactionRemove:S.onReactionRemove,onMessageDelete:S.onMessageDelete,onReplyMessage:S.onReplyMessage,onActionPress:S.onActionPress};return Xo.default.useImperativeHandle(A,()=>({scrollToEnd:(z=!0)=>{},scrollToOffset:(z,E=!0)=>{},scrollToIndex:(z,E=!0)=>{}}),[]),<Po messages={C}config={I}{...P}>
403
+ <xt.Container>
404
+ <xt.Messages/>
405
+ <xt.TypingIndicator isVisible={R}/>
406
+ <xt.ScrollButton visible={M?void 0:!1}isReplyActive={T}/>
407
+ <xt.ActionSheet/>
408
+ <xt.ReactionDetails/>
409
+ </xt.Container>
410
+ </Po>});pt.displayName="MessageList";var Xs=X(require("react"));function He(C){let R=Xs.default.forwardRef((T,S)=>(At(),<C{...T}ref={S}/>)),M=C.displayName||C.name||"Component";return R.displayName=`RequireAuth(${M})`,R}function it(C){return(...R)=>(At(),C(...R))}var Zo=require("react-native");var qe=require("react-native");var bt=require("react-native");var En=({avatar:C,isOnline:R=!1,size:M="medium"})=>{let T=$(),S=()=>{switch(M){case"small":return{width:32,height:32};case"large":return{width:64,height:64};default:return{width:48,height:48}}},A=()=>{switch(M){case"small":return{width:12,height:12};case"large":return{width:24,height:24};default:return{width:16,height:16}}},I=S(),P=A(),E=(()=>{switch(M){case"small":return 14;case"large":return 28;default:return 20}})();return<bt.View style={{position:"relative"}}>
411
+ {C&&C.trim()!==""?<bt.Image source={{uri:C}}style={[I,{borderRadius:T.borderRadius.full}]}resizeMode="cover"/>:<bt.View style={[I,{borderRadius:T.borderRadius.full,backgroundColor:T.colors.primary,justifyContent:"center",alignItems:"center"}]}>
412
+ <bt.Text style={{color:T.colors.background,fontSize:E,fontWeight:"600"}}>
409
413
  👤
410
- </yt.Text>
411
- </yt.View>}
414
+ </bt.Text>
415
+ </bt.View>}
412
416
 
413
417
  {}
414
- {T&&<yt.View style={[P,{position:"absolute",bottom:-2,right:-2,backgroundColor:R.colors.online,borderRadius:R.borderRadius.full,borderWidth:2,borderColor:R.colors.background}]}/>}
415
- </yt.View>},Xt=Vr;var Dr=({item:M,onPress:T})=>{let C=$(),R=M.unreadCount&&M.unreadCount>0;return<We.TouchableOpacity style={{flexDirection:"row",alignItems:"center",paddingHorizontal:C.spacing.lg,paddingVertical:C.spacing.md,borderBottomWidth:1,borderBottomColor:C.colors.borderLight,backgroundColor:R?C.colors.unread:C.colors.background}}onPress={()=>T(M)}>
416
- <We.View style={{marginRight:C.spacing.md}}>
417
- <Xt avatar={M.avatar}isOnline={M.isOnline}size="medium"/>
418
- </We.View>
418
+ {R&&<bt.View style={[P,{position:"absolute",bottom:-2,right:-2,backgroundColor:T.colors.online,borderRadius:T.borderRadius.full,borderWidth:2,borderColor:T.colors.background}]}/>}
419
+ </bt.View>},Vo=En;var On=({item:C,onPress:R})=>{let M=$(),T=C.unreadCount&&C.unreadCount>0;return<qe.TouchableOpacity style={{flexDirection:"row",alignItems:"center",paddingHorizontal:M.spacing.lg,paddingVertical:M.spacing.md,borderBottomWidth:1,borderBottomColor:M.colors.borderLight,backgroundColor:T?M.colors.unread:M.colors.background}}onPress={()=>R(C)}>
420
+ <qe.View style={{marginRight:M.spacing.md}}>
421
+ <Vo avatar={C.avatar}isOnline={C.isOnline}size="medium"/>
422
+ </qe.View>
419
423
 
420
- <We.View style={{flex:1,marginRight:C.spacing.md}}>
424
+ <qe.View style={{flex:1,marginRight:M.spacing.md}}>
421
425
  {}
422
- <We.View style={{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:C.spacing.xs}}>
423
- <We.Text style={{fontSize:C.typography.fontSize.base,flex:1,fontWeight:R?C.typography.fontWeight.bold:C.typography.fontWeight.semibold,color:C.colors.text}}>
424
- {M.name}
425
- </We.Text>
426
- <We.Text style={{fontSize:C.typography.fontSize.sm,marginLeft:C.spacing.sm,color:R?C.colors.gray[700]:C.colors.textSecondary,fontWeight:R?C.typography.fontWeight.medium:C.typography.fontWeight.normal}}>
427
- {M.time}
428
- </We.Text>
429
- </We.View>
426
+ <qe.View style={{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:M.spacing.xs}}>
427
+ <qe.Text style={{fontSize:M.typography.fontSize.base,flex:1,fontWeight:T?M.typography.fontWeight.bold:M.typography.fontWeight.semibold,color:M.colors.text}}>
428
+ {C.name}
429
+ </qe.Text>
430
+ <qe.Text style={{fontSize:M.typography.fontSize.sm,marginLeft:M.spacing.sm,color:T?M.colors.gray[700]:M.colors.textSecondary,fontWeight:T?M.typography.fontWeight.medium:M.typography.fontWeight.normal}}>
431
+ {C.time}
432
+ </qe.Text>
433
+ </qe.View>
430
434
 
431
435
  {}
432
- <We.View style={{flexDirection:"row",alignItems:"center"}}>
433
- <We.Text style={{fontSize:C.typography.fontSize.sm,flex:1,color:R?C.colors.gray[800]:C.colors.textSecondary,fontWeight:R?C.typography.fontWeight.medium:C.typography.fontWeight.normal}}numberOfLines={1}>
434
- {M.message}
435
- </We.Text>
436
- {M.unreadCount&&<We.View style={{width:20,height:20,backgroundColor:C.colors.primary,borderRadius:C.borderRadius.full,alignItems:"center",justifyContent:"center",marginLeft:C.spacing.sm}}>
437
- <We.Text style={{fontSize:C.typography.fontSize.xs,color:"white",fontWeight:C.typography.fontWeight.bold}}>
438
- {M.unreadCount}
439
- </We.Text>
440
- </We.View>}
441
- </We.View>
442
- </We.View>
443
- </We.TouchableOpacity>},Qt=Dr;var kr=({chats:M,onChatPress:T,onRefresh:C,refreshing:R=!1})=>{let S=({item:A})=><Qt item={A}onPress={T}/>;return<Eo.FlatList data={M}renderItem={S}keyExtractor={A=>A.id}showsVerticalScrollIndicator={!1}style={{flex:1}}refreshControl={C?<Eo.RefreshControl refreshing={R}onRefresh={C}tintColor="#007AFF"colors={["#007AFF"]}/>:void 0}/>},es=kr;var jo=require("react-native");var Lr=({title:M})=>{let T=$();return<jo.View style={{backgroundColor:T.colors.background,paddingHorizontal:T.spacing.lg,paddingVertical:T.spacing.lg,borderBottomWidth:1,borderBottomColor:T.colors.borderLight}}>
444
- <jo.Text style={{fontSize:T.typography.fontSize.xxl,fontWeight:T.typography.fontWeight.bold,color:T.colors.text}}>
445
- {M}
446
- </jo.Text>
447
- </jo.View>},ts=Lr;var xt=require("react-native"),Oo=require("lucide-react-native");var Er=({value:M,onChangeText:T,onClear:C,placeholder:R="Search chats..."})=>{let S=$();return<xt.View style={{backgroundColor:S.colors.background,paddingHorizontal:S.spacing.lg,paddingVertical:S.spacing.md,borderBottomWidth:1,borderBottomColor:S.colors.borderLight}}>
448
- <xt.View style={{position:"relative"}}>
449
- <xt.View style={{position:"absolute",left:S.spacing.md,top:"50%",transform:[{translateY:-10}],zIndex:10}}>
450
- <Oo.Search size={20}color={S.colors.textMuted}/>
451
- </xt.View>
436
+ <qe.View style={{flexDirection:"row",alignItems:"center"}}>
437
+ <qe.Text style={{fontSize:M.typography.fontSize.sm,flex:1,color:T?M.colors.gray[800]:M.colors.textSecondary,fontWeight:T?M.typography.fontWeight.medium:M.typography.fontWeight.normal}}numberOfLines={1}>
438
+ {C.message}
439
+ </qe.Text>
440
+ {C.unreadCount&&<qe.View style={{width:20,height:20,backgroundColor:M.colors.primary,borderRadius:M.borderRadius.full,alignItems:"center",justifyContent:"center",marginLeft:M.spacing.sm}}>
441
+ <qe.Text style={{fontSize:M.typography.fontSize.xs,color:"white",fontWeight:M.typography.fontWeight.bold}}>
442
+ {C.unreadCount}
443
+ </qe.Text>
444
+ </qe.View>}
445
+ </qe.View>
446
+ </qe.View>
447
+ </qe.TouchableOpacity>},Bo=On;var Fn=({chats:C,onChatPress:R,onRefresh:M,refreshing:T=!1})=>{let S=({item:A})=><Bo item={A}onPress={R}/>;return<Zo.FlatList data={C}renderItem={S}keyExtractor={A=>A.id}showsVerticalScrollIndicator={!1}style={{flex:1}}refreshControl={M?<Zo.RefreshControl refreshing={T}onRefresh={M}tintColor="#007AFF"colors={["#007AFF"]}/>:void 0}/>},ys=Fn;var Qo=require("react-native");var Hn=({title:C})=>{let R=$();return<Qo.View style={{backgroundColor:R.colors.background,paddingHorizontal:R.spacing.lg,paddingVertical:R.spacing.lg,borderBottomWidth:1,borderBottomColor:R.colors.borderLight}}>
448
+ <Qo.Text style={{fontSize:R.typography.fontSize.xxl,fontWeight:R.typography.fontWeight.bold,color:R.colors.text}}>
449
+ {C}
450
+ </Qo.Text>
451
+ </Qo.View>},xs=Hn;var Ct=require("react-native"),es=require("lucide-react-native");var Nn=({value:C,onChangeText:R,onClear:M,placeholder:T})=>{let S=$(),I=We()("search.placeholder");return<Ct.View style={{backgroundColor:S.colors.background,paddingHorizontal:S.spacing.lg,paddingVertical:S.spacing.md,borderBottomWidth:1,borderBottomColor:S.colors.borderLight}}>
452
+ <Ct.View style={{position:"relative"}}>
453
+ <Ct.View style={{position:"absolute",left:S.spacing.md,top:"50%",transform:[{translateY:-10}],zIndex:10}}>
454
+ <es.Search size={20}color={S.colors.textMuted}/>
455
+ </Ct.View>
452
456
 
453
- <xt.TextInput value={M}onChangeText={T}placeholder={R}placeholderTextColor={S.colors.textMuted}style={{backgroundColor:S.colors.surfaceSecondary,borderRadius:S.borderRadius.full,paddingLeft:48,paddingRight:40,paddingVertical:S.spacing.md,color:S.colors.text,fontSize:S.typography.fontSize.base}}autoCapitalize="none"autoCorrect={!1}clearButtonMode="never"/>
457
+ <Ct.TextInput value={C}onChangeText={R}placeholder={T||I}placeholderTextColor={S.colors.textMuted}style={{backgroundColor:S.colors.surfaceSecondary,borderRadius:S.borderRadius.full,paddingLeft:48,paddingRight:40,paddingVertical:S.spacing.md,color:S.colors.text,fontSize:S.typography.fontSize.base}}autoCapitalize="none"autoCorrect={!1}clearButtonMode="never"/>
454
458
 
455
- {M.length>0&&<xt.TouchableOpacity onPress={C}style={{position:"absolute",right:S.spacing.md,top:"50%",transform:[{translateY:-10}]}}hitSlop={{top:10,bottom:10,left:10,right:10}}>
456
- <Oo.X size={20}color={S.colors.textMuted}/>
457
- </xt.TouchableOpacity>}
458
- </xt.View>
459
- </xt.View>},os=Er;var lt=require("react"),Fo=Q(require("dayjs")),Rt=(0,Fo.default)(),Ls=Rt.subtract(1,"day"),Es=Rt.subtract(2,"day"),js=Rt.subtract(3,"day"),jr=[{id:1,text:"Hi! How are you?",isMe:!1,timestamp:js.hour(10).minute(30).toISOString(),senderName:"Anna"},{id:2,text:"Hey! Great, thanks! And you?",isMe:!0,timestamp:js.hour(10).minute(31).toISOString(),reactions:[{emoji:"\u2764\uFE0F",count:1,users:["anna"]}]},{id:3,text:"Good too! What are we doing tonight?",isMe:!1,timestamp:Es.hour(14).minute(20).toISOString(),senderName:"Anna"},{id:4,text:"Maybe we could go to the movies?",isMe:!0,timestamp:Es.hour(14).minute(25).toISOString(),reactions:[{emoji:"\u{1F44D}",count:2,users:["anna","me"]},{emoji:"\u{1F3AC}",count:1,users:["anna"]}]},{id:5,text:"Good idea! I'll check the showtimes",isMe:!1,timestamp:Ls.hour(9).minute(15).toISOString(),senderName:"Anna"},{id:6,text:"Great! What movies are you interested in?",isMe:!0,timestamp:Ls.hour(9).minute(20).toISOString()},{id:7,text:"Maybe something action or comedy?",isMe:!1,timestamp:Rt.hour(8).minute(30).toISOString(),senderName:"Anna",reactions:[{emoji:"\u{1F602}",count:1,users:["me"]},{emoji:"\u{1F3AD}",count:1,users:["anna"]}]},{id:8,text:"Sounds great! I'll check what's playing",isMe:!0,timestamp:Rt.hour(8).minute(35).toISOString()},{id:9,text:"Perfect! What time should we meet?",isMe:!1,timestamp:Rt.hour(9).minute(10).toISOString(),senderName:"Anna",replyTo:{id:8,text:"Sounds great! I'll check what's playing",senderName:void 0,isMe:!0,type:"text"}},{id:10,text:"How about 7:00 PM? The show is at 8:00 PM",isMe:!0,timestamp:Rt.hour(9).minute(15).toISOString(),reactions:[{emoji:"\u{1F44D}",count:1,users:["anna"]},{emoji:"\u23F0",count:1,users:["me"]}]}],ss=M=>{let T=jr.map(v=>v.isMe?v:{...v,senderName:M||v.senderName}),[C,R]=(0,lt.useState)(T),S=(0,lt.useCallback)((v,V)=>{if(console.log("sendMessage called with text:",v,"and replyTo:",V),!v.trim())return;let D={id:Date.now(),text:v.trim(),isMe:!0,timestamp:(0,Fo.default)().toISOString(),status:"sent",replyTo:V};R(z=>[...z,D]),setTimeout(()=>{R(z=>z.map(L=>L.id===D.id?{...L,status:"delivered"}:L))},1e3),setTimeout(()=>{R(z=>z.map(L=>L.id===D.id?{...L,status:"read"}:L))},3e3)},[]),A=(0,lt.useCallback)((v,V,D)=>{let z={id:Date.now(),text:V||"",isMe:!0,timestamp:(0,Fo.default)().toISOString(),status:"sent",type:"image",imageData:v,replyTo:D};R(L=>[...L,z]),setTimeout(()=>{R(L=>L.map(k=>k.id===z.id?{...k,status:"delivered"}:k))},1e3),setTimeout(()=>{R(L=>L.map(k=>k.id===z.id?{...k,status:"read"}:k))},3e3)},[]),I=(0,lt.useCallback)((v,V)=>{R(D=>D.map(z=>z.id===v?{...z,status:V}:z))},[]),P=(0,lt.useCallback)((v,V)=>{R(D=>D.map(z=>{if(z.id===v){let L=z.reactions||[],k=L.findIndex(O=>O.emoji===V);if(k>=0){let O=[...L];return O[k]={...O[k],count:O[k].count+1,users:[...O[k].users,"me"]},{...z,reactions:O}}else{let O={emoji:V,count:1,users:["me"]};return{...z,reactions:[...L,O]}}}return z}))},[]),B=(0,lt.useCallback)((v,V)=>{console.log("removeReaction 1212121 called with messageId:",v,"and emoji:",V),R(D=>D.map(z=>{if(z.id===v){let L=z.reactions||[],k=L.findIndex(O=>O.emoji===V);if(k>=0){let O=L[k];if(O.count>1){let F=[...L];return F[k]={...O,count:O.count-1,users:O.users.filter(H=>H!=="me")},{...z,reactions:F}}else return{...z,reactions:L.filter(F=>F.emoji!==V)}}}return z}))},[]),E=(0,lt.useCallback)(v=>{console.log("deleteMessage called with messageId:",v),R(V=>{let D=V.map(z=>z.id===v?{...z,deleted:!0}:z);return console.log("Message marked as deleted:",v),D})},[]);return{messages:C,sendMessage:S,sendImageMessage:A,updateMessageStatus:I,addReaction:P,deleteMessage:E,removeReaction:B}};var Ue=require("react");var rs=(M={})=>{Tt();let[T,C]=(0,Ue.useState)(M.initialMessages||[]),[R,S]=(0,Ue.useState)(!1),A=(0,Ue.useCallback)((L,k)=>{let O={id:Date.now(),text:L,isMe:!0,timestamp:new Date().toISOString(),status:"sent",replyTo:k?{id:k.id,text:k.text,senderName:k.senderName,isMe:k.isMe}:void 0};C(F=>[O,...F])},[]),I=(0,Ue.useCallback)(L=>{C(k=>[L,...k])},[]),P=(0,Ue.useCallback)((L,k)=>{C(O=>O.map(F=>F.id===L?{...F,...k}:F))},[]),B=(0,Ue.useCallback)(L=>{C(k=>k.filter(O=>O.id!==L))},[]),E=(0,Ue.useCallback)((L,k)=>{C(O=>O.map(F=>{if(F.id!==L)return F;let H=F.reactions||[];if(H.find(j=>j.emoji===k))return{...F,reactions:H.map(j=>j.emoji===k?{...j,count:j.count+1,users:[...j.users,"current-user"]}:j)};{let j={emoji:k,count:1,users:["current-user"]};return{...F,reactions:[...H,j]}}}))},[]),v=(0,Ue.useCallback)((L,k)=>{C(O=>O.map(F=>{if(F.id!==L)return F;let H=F.reactions||[],N=H.find(j=>j.emoji===k);return N?N.count<=1?{...F,reactions:H.filter(j=>j.emoji!==k)}:{...F,reactions:H.map(j=>j.emoji===k?{...j,count:j.count-1,users:j.users.filter(oe=>oe!=="current-user")}:j)}:F}))},[]),V=(0,Ue.useCallback)(L=>{S(L)},[]),D=(0,Ue.useCallback)(()=>{C(M.initialMessages||[]),S(!1)},[M.initialMessages]),z=(0,Ue.useCallback)(L=>T.find(k=>k.id===L),[T]);return{messages:T,isTyping:R,sendMessage:A,addReaction:E,removeReaction:v,setMessages:C,addMessage:I,updateMessage:P,deleteMessage:B,setTyping:V,resetChat:D,getMessageById:z}};var Ho=require("react");var Or=Le(Ko),Fr=Le(Uo),Hr=rt(Ht),Nr=Le(ut),Wr=Le(dt),Ur=Le(so),Kr=Le(Dt),qr=Le(es),$r=Le(Qt),Yr=Le(ts),Gr=Le(os),_r=Le(Xt),Jr=Le(Ct),Xr=Le(fs),Qr=rt($),Zr=rt(rs),en=rt(ss),tn=rt(qt),on=rt($t),sn=rt(Yt),rn=rt(Nt),nn=rt(Kt);0&&(module.exports={AttachmentMenu,Chat,ChatAvatar,ChatHeader,ChatItem,ChatList,ChatListSearchBar,ChatProvider,ChatScreenHeader,MessageInput,MessageList,ThemeProvider,TypingIndicator,defaultTheme,getAuthState,getProjectId,initChat,isInitialized,useAttachments,useChatConfig,useChatMessages,useChatSDK,useMessageActions,useMessageInput,useMessageList,useMessageReactions,useTheme});
459
+ {C.length>0&&<Ct.TouchableOpacity onPress={M}style={{position:"absolute",right:S.spacing.md,top:"50%",transform:[{translateY:-10}]}}hitSlop={{top:10,bottom:10,left:10,right:10}}>
460
+ <es.X size={20}color={S.colors.textMuted}/>
461
+ </Ct.TouchableOpacity>}
462
+ </Ct.View>
463
+ </Ct.View>},bs=Nn;var ut=require("react"),ts=X(require("dayjs")),vt=(0,ts.default)(),Zs=vt.subtract(1,"day"),Qs=vt.subtract(2,"day"),en=vt.subtract(3,"day"),Wn=[{id:1,text:"Hi! How are you?",isMe:!1,timestamp:en.hour(10).minute(30).toISOString(),senderName:"Anna"},{id:2,text:"Hey! Great, thanks! And you?",isMe:!0,timestamp:en.hour(10).minute(31).toISOString(),reactions:[{emoji:"\u2764\uFE0F",count:1,users:["anna"]}]},{id:3,text:"Good too! What are we doing tonight?",isMe:!1,timestamp:Qs.hour(14).minute(20).toISOString(),senderName:"Anna"},{id:4,text:"Maybe we could go to the movies?",isMe:!0,timestamp:Qs.hour(14).minute(25).toISOString(),reactions:[{emoji:"\u{1F44D}",count:2,users:["anna","me"]},{emoji:"\u{1F3AC}",count:1,users:["anna"]}]},{id:5,text:"Good idea! I'll check the showtimes",isMe:!1,timestamp:Zs.hour(9).minute(15).toISOString(),senderName:"Anna"},{id:6,text:"Great! What movies are you interested in?",isMe:!0,timestamp:Zs.hour(9).minute(20).toISOString()},{id:7,text:"Maybe something action or comedy?",isMe:!1,timestamp:vt.hour(8).minute(30).toISOString(),senderName:"Anna",reactions:[{emoji:"\u{1F602}",count:1,users:["me"]},{emoji:"\u{1F3AD}",count:1,users:["anna"]}]},{id:8,text:"Sounds great! I'll check what's playing",isMe:!0,timestamp:vt.hour(8).minute(35).toISOString()},{id:9,text:"Perfect! What time should we meet?",isMe:!1,timestamp:vt.hour(9).minute(10).toISOString(),senderName:"Anna",replyTo:{id:8,text:"Sounds great! I'll check what's playing",senderName:void 0,isMe:!0,type:"text"}},{id:10,text:"How about 7:00 PM? The show is at 8:00 PM",isMe:!0,timestamp:vt.hour(9).minute(15).toISOString(),reactions:[{emoji:"\u{1F44D}",count:1,users:["anna"]},{emoji:"\u23F0",count:1,users:["me"]}]}],Cs=C=>{let R=Wn.map(v=>v.isMe?v:{...v,senderName:C||v.senderName}),[M,T]=(0,ut.useState)(R),S=(0,ut.useCallback)((v,k)=>{if(console.log("sendMessage called with text:",v,"and replyTo:",k),!v.trim())return;let D={id:Date.now(),text:v.trim(),isMe:!0,timestamp:(0,ts.default)().toISOString(),status:"sent",replyTo:k};T(V=>[...V,D]),setTimeout(()=>{T(V=>V.map(B=>B.id===D.id?{...B,status:"delivered"}:B))},1e3),setTimeout(()=>{T(V=>V.map(B=>B.id===D.id?{...B,status:"read"}:B))},3e3)},[]),A=(0,ut.useCallback)((v,k,D)=>{let V={id:Date.now(),text:k||"",isMe:!0,timestamp:(0,ts.default)().toISOString(),status:"sent",type:"image",imageData:v,replyTo:D};T(B=>[...B,V]),setTimeout(()=>{T(B=>B.map(L=>L.id===V.id?{...L,status:"delivered"}:L))},1e3),setTimeout(()=>{T(B=>B.map(L=>L.id===V.id?{...L,status:"read"}:L))},3e3)},[]),I=(0,ut.useCallback)((v,k)=>{T(D=>D.map(V=>V.id===v?{...V,status:k}:V))},[]),P=(0,ut.useCallback)((v,k)=>{T(D=>D.map(V=>{if(V.id===v){let B=V.reactions||[],L=B.findIndex(F=>F.emoji===k);if(L>=0){let F=[...B];return F[L]={...F[L],count:F[L].count+1,users:[...F[L].users,"me"]},{...V,reactions:F}}else{let F={emoji:k,count:1,users:["me"]};return{...V,reactions:[...B,F]}}}return V}))},[]),z=(0,ut.useCallback)((v,k)=>{console.log("removeReaction 1212121 called with messageId:",v,"and emoji:",k),T(D=>D.map(V=>{if(V.id===v){let B=V.reactions||[],L=B.findIndex(F=>F.emoji===k);if(L>=0){let F=B[L];if(F.count>1){let j=[...B];return j[L]={...F,count:F.count-1,users:F.users.filter(H=>H!=="me")},{...V,reactions:j}}else return{...V,reactions:B.filter(j=>j.emoji!==k)}}}return V}))},[]),E=(0,ut.useCallback)(v=>{console.log("deleteMessage called with messageId:",v),T(k=>{let D=k.map(V=>V.id===v?{...V,deleted:!0}:V);return console.log("Message marked as deleted:",v),D})},[]);return{messages:M,sendMessage:S,sendImageMessage:A,updateMessageStatus:I,addReaction:P,deleteMessage:E,removeReaction:z}};var $e=require("react");var Ms=(C={})=>{At();let[R,M]=(0,$e.useState)(C.initialMessages||[]),[T,S]=(0,$e.useState)(!1),A=(0,$e.useCallback)((B,L)=>{let F={id:Date.now(),text:B,isMe:!0,timestamp:new Date().toISOString(),status:"sent",replyTo:L?{id:L.id,text:L.text,senderName:L.senderName,isMe:L.isMe}:void 0};M(j=>[F,...j])},[]),I=(0,$e.useCallback)(B=>{M(L=>[B,...L])},[]),P=(0,$e.useCallback)((B,L)=>{M(F=>F.map(j=>j.id===B?{...j,...L}:j))},[]),z=(0,$e.useCallback)(B=>{M(L=>L.filter(F=>F.id!==B))},[]),E=(0,$e.useCallback)((B,L)=>{M(F=>F.map(j=>{if(j.id!==B)return j;let H=j.reactions||[];if(H.find(O=>O.emoji===L))return{...j,reactions:H.map(O=>O.emoji===L?{...O,count:O.count+1,users:[...O.users,"current-user"]}:O)};{let O={emoji:L,count:1,users:["current-user"]};return{...j,reactions:[...H,O]}}}))},[]),v=(0,$e.useCallback)((B,L)=>{M(F=>F.map(j=>{if(j.id!==B)return j;let H=j.reactions||[],N=H.find(O=>O.emoji===L);return N?N.count<=1?{...j,reactions:H.filter(O=>O.emoji!==L)}:{...j,reactions:H.map(O=>O.emoji===L?{...O,count:O.count-1,users:O.users.filter(te=>te!=="current-user")}:O)}:j}))},[]),k=(0,$e.useCallback)(B=>{S(B)},[]),D=(0,$e.useCallback)(()=>{M(C.initialMessages||[]),S(!1)},[C.initialMessages]),V=(0,$e.useCallback)(B=>R.find(L=>L.id===B),[R]);return{messages:R,isTyping:T,sendMessage:A,addReaction:E,removeReaction:v,setMessages:M,addMessage:I,updateMessage:P,deleteMessage:z,setTyping:k,resetChat:D,getMessageById:V}};var os=require("react");var Un=He(is),Kn=He(rs),qn=it(Zt),$n=He(pt),Yn=He(mt),Gn=He(Eo),_n=He(Wt),Jn=He(ys),Xn=He(Bo),Zn=He(xs),Qn=He(bs),ea=He(Vo),ta=He(It),oa=He(ks),sa=it($),na=it(Ms),aa=it(Cs),ra=it(Ro),ia=it(So),la=it(wo),ca=it(Qt),da=it(To);0&&(module.exports={AttachmentMenu,Chat,ChatAvatar,ChatHeader,ChatItem,ChatList,ChatListSearchBar,ChatProvider,ChatScreenHeader,I18nProvider,MessageInput,MessageList,ThemeProvider,TypingIndicator,defaultTheme,defaultTranslations,getAuthState,getProjectId,getTranslation,initChat,isInitialized,isSupportedLocale,useAttachments,useChatConfig,useChatMessages,useChatSDK,useMessageActions,useMessageInput,useMessageList,useMessageReactions,useTheme,useTranslation,useTranslationFunction});