1import{m as $e,u as Te,r as i,l as Fe,i as j,z as Le,A as T,V as h,j as e,N as de,L as ue,p as He,a5 as ze,X as F,a6 as Be}from"./index-CjBBelq3.js";import{b as Oe}from"./index-B1D6mEZN.js";const De=()=>{var ce;const s=(ce=$e().state)==null?void 0:ce.myData,me=Te(),[v,N]=i.useState([]),[D,W]=i.useState([]),[ge,se]=i.useState(!1),[fe,re]=i.useState(!1),[L,V]=i.useState([]),[q,xe]=i.useState(1),[y,K]=i.useState(!1),[A,ae]=i.useState(!0),[_,pe]=i.useState(!0),[w,oe]=i.useState(null),[he,ne]=i.useState(""),[X,Y]=i.useState(null),[we,J]=i.useState(!1),[c,H]=i.useState(null),[z,ie]=i.useState(!1),[P,M]=i.useState(null),p=i.useRef(null),Q=i.useRef({scrollTop:0,scrollHeight:0}),[k,be]=i.useState(null),[Z,le]=i.useState("");i.useEffect(()=>{s!=null&&s.id&&(ee(1,!0),je(),ye(),Ae())},[s==null?void 0:s.id]),i.useEffect(()=>{Fe("masters",t=>{be(t)})},[]),i.useEffect(()=>{const t="https://list.divinetalk.live",r=j("userData");if(!(r!=null&&r.id)){console.error("User ID not found in local storage for socket connection.");return}w&&(console.log("Disconnecting old socket before creating new one..."),w.disconnect());const a=Le(t,{transports:["websocket"],withCredentials:!0,query:{userId:r.id,astrologerId:s==null?void 0:s.id}});return a.on("connect",()=>{console.log("Socket connected â
",a.id)}),a.on("connect_error",l=>{console.error("Socket connection error â",l)}),a.on("disconnect",l=>{oe(null)}),oe(a),()=>{a.disconnect()}},[s==null?void 0:s.id]),i.useEffect(()=>{if(!w)return;const t=r=>{var x;const a=r==null?void 0:r.msgData;if(!a||!a.id||typeof a.message!="string"){console.warn("Received invalid message data or missing ID:",r);return}const l=(x=j("userData"))==null?void 0:x.id;if(!(a.astrologer_id===(s==null?void 0:s.id)&&a.customer_id===l||a.astrologer_id===l&&a.customer_id===(s==null?void 0:s.id)))return;let u=!1;const g=p.current,o=200;if(g){const{scrollTop:m,scrollHeight:d,clientHeight:n}=g;u=m+n>=d-o||a.send_by===0}else u=!0;N(m=>{const d=m.findIndex(f=>f.id===a.id||typeof f.id=="string"&&f.id.startsWith("temp-")&&f.message===a.message&&f.customer_id===a.customer_id);let n;return d===-1?n=[...m,a]:(n=[...m],typeof n[d].id=="string"&&n[d].id.startsWith("temp-")&&n[d].message===a.message?n[d]=a:n[d].id===a.id?n[d]={...n[d],...a}:n=[...m,a]),n.sort((f,O)=>new Date(f.created_at)-new Date(O.created_at)),n}),u&&setTimeout(()=>{I("smooth")},50)};return w.on("chat-assist-message-sent",t),()=>{w&&w.off("chat-assist-message-sent",t)}},[w,s==null?void 0:s.id]);const I=(t="smooth")=>{p.current&&requestAnimationFrame(()=>{if(p.current){const r=p.current.scrollHeight;p.current.scrollTo({top:r,behavior:t})}})};i.useEffect(()=>{!_&&v.length>0&&setTimeout(()=>{p.current&&I("auto")},100)},[_,v.length]);const ee=i.useCallback(async(t,r=!1)=>{var l,u,g,o,x,m,d;if(!(s!=null&&s.id)||y||!r&&!A){r&&K(!1);return}K(!0),!r&&p.current&&(Q.current={scrollTop:p.current.scrollTop,scrollHeight:p.current.scrollHeight});const a={astrologer_id:s.id,page:t,ecom_id:0};try{const n=await T.getChatAssistAstroData(a),f=Array.isArray((l=n==null?void 0:n.data)==null?void 0:l.data)?n.data.data:[],O=(g=(u=n==null?void 0:n.data)==null?void 0:u.meta)==null?void 0:g.total,G=(x=(o=n==null?void 0:n.data)==null?void 0:o.meta)==null?void 0:x.per_page;let E=!1;f.length>0?G!==void 0&&f.length<G&&((d=(m=n==null?void 0:n.data)==null?void 0:m.meta)==null?void 0:d.current_page)===lastPage?E=!1:O!==void 0&&G!==void 0?E=O>t*G:E=!0:E=!1,ae(E),N(S=>{const $=new Set(S.map(b=>b.id)),R=f.filter(b=>(b==null?void 0:b.id)&&typeof b.message=="string"&&!$.has(b.id)),U=r?R:[...R,...S];return U.sort((b,Ee)=>new Date(b.created_at)-new Date(Ee.created_at)),U}),(f.length>0||t===1)&&xe(t),!r&&p.current&&f.length>0&&requestAnimationFrame(()=>{setTimeout(()=>{const S=p.current,$=Q.current;if(S&&$.scrollHeight!==0){const R=S.scrollHeight,U=$.scrollHeight,b=R-U;S.scrollTop=$.scrollTop+b}},50)})}catch{r&&N([]),ae(!1),h.error("Failed to load chat messages.")}finally{K(!1),r&&pe(!1)}},[s==null?void 0:s.id,y,A,Q,q]),te=i.useCallback(()=>{const t=p.current;if(!t||y||!A||_)return;const{scrollTop:r}=t;r<100&&ee(q+1)},[y,A,q,ee,_]);i.useEffect(()=>{const t=p.current;if(t)return t.addEventListener("scroll",te),()=>{t.removeEventListener("scroll",te)}},[te]);const je=async()=>
1{try{const t=await T.getMessageTemplateForChatAssist();(t==null?void 0:t.status_code)===200&&Array.isArray(t.data)?V(t.data):V([])}catch{V([]),h.error("Failed to load message templates.")}},ye=i.useCallback(async()=>{try{const t=await T.getAllGifts();(t==null?void 0:t.status_code)===200&&Array.isArray(t.data)?W(t.data):W([])}catch(t){console.error("Error fetching gifts:",t),W([]),h.error("Failed to load gifts.")}},[]),_e=()=>se(!0),C=()=>se(!1),ve=()=>{H(null),M(null),re(!0)},B=()=>{re(!1),H(null),M(null)},Ne=t=>{var a,l;const r=L.find(u=>u.id===t);if(r&&w){const u=(a=j("userData"))==null?void 0:a.id;if(!u){console.error("User ID not found in local storage."),h.error("User not logged in."),C();return}if(!(s!=null&&s.id)){console.error("Astrologer ID not available."),h.error("Astrologer information missing."),C();return}const g=`temp-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,o={userType:"customer",msgData:{id:g,message:r.title,response:null,customer_id:u,productPrice:null,astrologer_id:s.id,send_by:0,msg_type:0,suggested_remedies_id:0,created_at:new Date().toISOString(),profile_image:((l=j("userData"))==null?void 0:l.avatar)||null,product_id:null,is_pooja_product:0,product:null,new_product:null,shop_id:null,is_ecom:0,ecom_id:0,is_suspicious:0,seen_status:0},custId:u,astroId:s.id,message:r.title,is_ecom:0,ecom_id:0};N(x=>{const d=[...x.filter(n=>n.id!==g),o.msgData];return d.sort((n,f)=>new Date(n.created_at)-new Date(f.created_at)),d}),w.emit("send-chat-assist-message",o),setTimeout(()=>{I("smooth")},50)}else r?w||(console.error("Socket is not connected."),h.error("Chat service not available. Please try again later.")):console.warn("Selected message template not found.");C()},ke=()=>{var l,u;le("");const t=(l=j("userData"))==null?void 0:l.id,r=`temp-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,a={userType:"customer",msgData:{id:r,message:Z,response:null,customer_id:t,productPrice:null,astrologer_id:s.id,send_by:0,msg_type:0,suggested_remedies_id:0,created_at:new Date().toISOString(),profile_image:((u=j("userData"))==null?void 0:u.avatar)||null,product_id:null,is_pooja_product:0,product:null,new_product:null,shop_id:null,is_ecom:0,ecom_id:0,is_suspicious:0,seen_status:0},custId:t,astroId:s.id,message:Z,is_ecom:0,ecom_id:0};N(g=>{const x=[...g.filter(m=>m.id!==r),a.msgData];return x.sort((m,d)=>new Date(m.created_at)-new Date(d.created_at)),x}),w.emit("send-chat-assist-message",a),setTimeout(()=>{I("smooth")},50),C()},Ce=t=>{H(t),M(null)},Se=async()=>{var u,g;if(!(c!=null&&c.id)){h.warn("Please select a gift first.");return}if(!(s!=null&&s.id)){h.error("Astrologer data missing.");return}if(z||P!==null)return;const t=(u=j("userData"))==null?void 0:u.id;if(!t){console.error("User ID not found in local storage."),h.error("User not logged in."),B();return}M(c.id),ie(!0);const r=`temp-gift-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,a={userType:"customer",msgData:{id:r,message:`1 ${c.gift_name}`,response:null,customer_id:t,productPrice:c.gift_price,astrologer_id:s.id,send_by:0,msg_type:7,suggested_remedies_id:0,created_at:new Date().toISOString(),profile_image:((g=j("userData"))==null?void 0:g.avatar)||null,product_id:c.id,is_pooja_product:1,product:null,new_product:null,shop_id:null,is_ecom:0,ecom_id:0,is_suspicious:0,seen_status:0},custId:t,astroId:s.id,message:`1 ${c.gift_name}`,is_ecom:0,ecom_id:0};N(o=>{const m=[...o.filter(d=>d.id!==r),a.msgData];return m.sort((d,n)=>new Date(d.created_at)-new Date(n.created_at)),m}),w.emit("send-chat-assist-message",a),setTimeout(()=>{I("smooth")},50);const l={astrologer_id:s.id,gift_id:c.id,quantity:1};try{const o=await T.sendGift(l);(o==null?void 0:o.status_code)===200?h.success("Gift sent successfully!"):h.error((o==null?void 0:o.message)||"Failed to send gift via API.")}catch(o){console.error("Error sending gift API call:",o),h.error("An error occurred while sending the gift.")}finally{await new Promise(o=>setTimeout(o,700)),ie(!1),M(null),H(null),B()}},Ae=i.useCallback(async()=>{var t,r;try{const a={astroid:s==null?void 0:s.id,userid:j("userData").id},l=await T.getAstroCustOfferData(a);((t=l==null?void 0:l.status)==null?void 0:t.code)===200&&Y((r=l==null?void 0:l.data)==null?void 0:r._source)}catch{setAstroamout([])}},[]),Pe=()=>{if(!(s!=null&&s.id)){h.error("Astrologer data missing.");return}s==null||s.id,s==null||s.name,s==null||s.image,ne("chat"),Y(X),J(!0)},Me=()=>{if(!(s!=null&&s.id)){h.error("Astrologer data missing.");return}s==null||s.id,s==null||s.name,s==null||s.image,ne("call"),Y(X),J(!0)},Ie=()=>me(-1);return s?e.jsxs(e.Fragment,{children:[e.jsx(de,{}),e.jsxs("div",{className:"px-6 lg:px-11 xl:px-40 flex flex-col h-[82vh] mt-4 lg:mt-8 bg-white rounded-lg font-poppins",children:[e.jsxs("div",{className:"flex flex-wrap items-center",children:[e.jsxs("span",{className:"hidden md:inline-flex gap-5 justify-center items-center font-medium text-[15px]",children:[e.jsx(ue,{to:"/",children:e.jsx("img",{src:He,alt:"home"})}),"> ",e.jsx("span",{children:"Chat Assistance"})]}),e.jsxs("span",{className:"md:hidden font-medium text-base space-x-5",children:[e.jsx("span",{className:"text-[24px] font-light align-middle",children:e.jsx(ue,{to:"/",children:"<"})}),e.jsx("span",{className:"",children:"Chat Assistance"})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between p-3 border-b border-gray-200 shadow-sm gap-2 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center space-x-3",children:[e.jsx("button",{onClick:Ie,className:"text-gray-600 hover:text-gray-900 p-1","aria-label":"Go back",children:e.jsx(ze,{size:24})}),e.jsx("img",{src:s.image?`https://divineprod.s3.ap-south-1.amazonaws.com/${s.image}`:F,alt:s.name||"Astrologer",className:"w-10 h-10 rounded-full object-cover border border-pink-200 flex-shrink-0",onError:t=>{t.target.onerror=null,t.target.src=F}}),e.jsx("span",{className:"font-Poppins text-[#0E2339] text-[18px] sm:text-[20px] font-medium",children:s.name||"Astrologer"})]}),e.jsxs("div",{className:"flex flex-wrap sm:flex-nowrap justify-end items-center gap-2 mt-2 sm:mt-0",children:[e.jsxs("button",{className:"flex flex-col items-center px-3 py-1.5 text-gray-700 rounded-md text-sm hover:bg-gray-100 transition duration-150",onClick:Pe,children:[e.jsx("img",{src:"/chat.png",className:"w-4 h-4 opacity-80",alt:"Chat icon"}),e.jsx("p",{className:"text-xs mt-1",children:"Chat"})]}),e.jsxs("button",{className:"flex flex-col items-center px-3 py-1.5 text-gray-700 rounded-md text-sm hover:bg-gray-100 transition duration-150",onClick:Me,children:[e.jsx("img",{src:"/call.png",className:"w-4 h-4 opacity-80",alt:"Call icon"}),e.jsx("p",{className:"text-xs mt-1",children:"Call"})]})]})]}),e.jsxs("div",{ref:p,className:"flex-grow p-4 w-full overflow-y-auto space-y-4 flex flex-col custom-scrollbar",children:[y&&!_&&e.jsxs("div",{className:"text-center py-2 flex justify-center items-center text-gray-500 text-sm flex-shrink-0",children:[e.jsxs("svg",{className:"animate-spin h-4 w-4 mr-2 text-gray-500",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Loading older messages..."]}),y&&_?e.jsxs("div",{className:"text-center text-gray-500 mt-10 flex justify-center items-center flex-col flex-grow",children:[e.jsxs("svg",{className:"animate-spin h-8 w-8 text-gray-500",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),e.jsx("span",{className:"ml-2",children:"Loading messages..."})]}):Array.isArray(v)&&v.length>0?v.map((t,r)=>{var g;if(!t||typeof t.message!="string"||!t.created_at)return console.warn("Skipping invalid message:",t),null;const a=`${t.id||`idx-${r}`}-${t.created_at}`,l=t.send_by===0;let u="Invalid Date";try{const o=new Date(t.created_at);if(!isNaN(o.getTime())){const x={day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0};
1u=o.toLocaleString("en-GB",x)}}catch(o){console.error("Error formatting date:",t.created_at,o)}if(t.msg_type===0||t.msg_type===1||t.msg_type===6)return e.jsxs("div",{className:`flex items-end space-x-1 ${l?"justify-end":""}`,children:[!l&&e.jsx("img",{src:s.image?`https://divineprod.s3.ap-south-1.amazonaws.com/${s.image}`:F,alt:s.name||"Astrologer",className:"w-8 h-8 sm:w-9 sm:h-9 rounded-full object-cover self-start border border-pink-200 flex-shrink-0",onError:o=>{o.target.onerror=null,o.target.src=F}}),e.jsx("div",{className:"m-0.5 inline-block",children:e.jsxs("div",{className:`${l?"bg-[#FCDEE0] rounded-br-none text-gray-800":"rounded-tl-none bg-white text-gray-700 border border-gray-200"} rounded-2xl p-3 shadow-sm max-w-[85vw] sm:max-w-md md:max-w-lg break-words`,children:[e.jsx("p",{className:"text-sm",children:t.message}),e.jsx("p",{className:`text-[10px] mt-1 text-right ${l?"text-pink-600 opacity-80":"text-gray-500"}`,children:u})]})})]},a);if(t.msg_type===7&&l){const o=t.product||t.new_product,x=(o==null?void 0:o.gift_name)||((g=t.message)==null?void 0:g.replace("1 ",""))||"a gift",m=(o==null?void 0:o.full_gift_image)||(o==null?void 0:o.gift_image);return e.jsx("div",{className:"flex justify-center w-full my-2 flex-shrink-0",children:e.jsxs("div",{className:"flex items-center bg-[#EF5862BF] text-[#FFFFFF] text-sm font-medium px-4 py-2 rounded-full shadow-sm max-w-xs text-center",children:[e.jsx("img",{className:"mr-3",src:"./gift1.webp",alt:""}),"You have sent ",t.message," gift",m&&e.jsx("img",{src:m,alt:x,className:"w-6 h-6 ml-2 object-contain"})]})},a)}return null}):!y&&e.jsx("div",{className:"text-center text-gray-500 mt-10 flex-grow flex items-center justify-center",children:e.jsx("p",{children:"No messages yet. Send a message to start the chat!"})}),!A&&!_&&v.length>0&&e.jsx("div",{className:"text-center text-gray-400 text-xs py-2 flex-shrink-0",children:"End of messages."})]}),(k==null?void 0:k.offOnMessagingAssistant)==0&&e.jsxs("div",{className:"flex flex-nowrap items-center gap-2 p-3 bg-white border-t border-gray-200 flex-shrink-0",children:[(k==null?void 0:k.chatAssistanceTemplateMessage)==1?e.jsx("button",{className:"flex-grow bg-[#EF5862] text-white rounded-md py-2 px-4 text-center text-sm font-medium hover:bg-[#d34852] focus:outline-none focus:ring-2 focus-ring-pink-400 focus:ring-opacity-50 transition duration-150",onClick:_e,"aria-label":"Send a predefined message",children:"Send Message"}):e.jsxs("div",{className:" flex gap-2 w-full",children:[e.jsx("input",{type:"text",value:Z,className:"w-full border border-gray-300 rounded-md px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-pink-400",placeholder:"Enter your name",onChange:t=>le(t.target.value)}),e.jsx("button",{className:"w-12 bg-[#EF5862] text-white rounded-full h-12 text-center text-sm font-medium hover:bg-[#d34852] focus:outline-none focus:ring-2 focus:ring-pink-400 focus:ring-opacity-50 transition duration-150 flex items-center justify-center ","aria-label":"Send a predefined message",children:e.jsx(Oe,{className:"text-white text-base",onClick:ke})})]}),e.jsx("button",{className:"text-pink-500 hover:text-pink-700 p-2 flex-shrink-0 transition duration-150",onClick:ve,"aria-label":"Send a gift",children:e.jsx("img",{src:"/gift.png",alt:"Gift icon",className:"w-6 h-6 opacity-80"})})]}),ge&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 z-40",onClick:C,"aria-hidden":"true"}),e.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-50 p-4 sm:p-6",children:e.jsxs("div",{className:"relative flex flex-col items-center w-full max-w-md
1sm:max-w-lg",children:[e.jsx("button",{onClick:C,className:"mb-3 w-8 h-8 sm:w-10 sm:h-10 flex items-center justify-center bg-gray-400 hover:bg-gray-500 rounded-full text-white focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2","aria-label":"Close message popup",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 sm:h-6 sm:w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),e.jsxs("div",{className:"bg-white rounded-2xl shadow-xl w-full max-w-md sm:max-w-lg p-6 flex flex-col max-h-[80vh]",children:[e.jsx("h2",{className:"text-[20px] font-semibold font-[Poppins] text-center text-[#0E2339] mb-6 flex-shrink-0",children:"Select Message to Send!"}),e.jsx("div",{className:"space-y-1 overflow-y-auto custom-scrollbar pr-2 flex-grow",children:Array.isArray(L)&&L.length>0?L.map((t,r)=>e.jsx("div",{onClick:()=>Ne(t.id),className:"py-3 px-3 text-gray-700 font-Poppins text-[15px] border-b border-gray-100 last:border-b-0 cursor-pointer hover:bg-gray-50 transition duration-150 ease-in-out rounded-md",children:t.title},t.id||`msg-template-${r}-${t.title}`)):e.jsx("div",{className:"text-center font-Poppins text-gray-500 p-4 flex-grow flex items-center justify-center",children:"No message templates available."})})]})]})})]}),fe&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 z-40",onClick:B,"aria-hidden":"true"}),e.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-50 p-4 sm:p-6",children:e.jsxs("div",{className:"relative flex flex-col items-center w-full max-w-md
1sm:max-w-lg",children:[e.jsx("button",{onClick:B,className:"mb-3 w-8 h-8 sm:w-10 sm:h-10 flex items-center justify-center bg-gray-400 hover:bg-gray-500 rounded-full text-white focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2","aria-label":"Close gift popup",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 sm:h-6 sm:w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),e.jsxs("div",{className:"bg-white rounded-2xl shadow-xl w-full max-w-md sm:max-w-lg p-6 flex flex-col max-h-[85vh]",children:[e.jsx("h2",{className:"text-[20px] font-semibold font-[Poppins] text-center text-[#0E2339] mb-6 flex-shrink-0",children:"Select Gift to Send!"}),e.jsx("div",{className:"space-y-1 flex-grow overflow-y-auto custom-scrollbar pr-2",children:Array.isArray(D)&&D.length>0?e.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-4 gap-3",children:D.map(t=>e.jsxs("div",{id:`gift-item-${t.id}`,onClick:()=>Ce(t),className:`text-center p-2 rounded-lg transition-all duration-300 ease-in-out flex flex-col justify-center items-center cursor-pointer h-[100px] border-2 2 ${(c==null?void 0:c.id)===t.id?"border-pink-500 bg-pink-50":"border-transparent hover:bg-gray-50"} 3 ${P===t.id?"opacity-0 scale-50":""} // <-- Animation classes applied here 4 `,children:[e.jsx("img",{src:t.full_gift_image,onError:r=>{r.target.onerror=null,r.target.src=F},alt:t.gift_name,className:"w-[50px] h-[50px] sm:w-[60px] sm:h-[60px] mx-auto mb-1 object-contain pointer-events-none"}),e.jsx("span",{className:"block text-[10px] leading-tight text-gray-600 font-medium line-clamp-2",children:t.gift_name}),e.jsxs("span",{className:"block text-xs font-Poppins text-blue-600 font-semibold mt-0.5",children:["â¹",t.gift_price]})]},t.id))}):e.jsx("div",{className:"flex-grow flex items-center justify-center",children:e.jsx("p",{className:"text-sm text-gray-500 text-center py-10",children:"No gifts available currently."})})}),c!==null&&e.jsx("div",{className:"mt-auto pt-3 border-t border-gray-100 flex-shrink-0",children:e.jsx("button",{onClick:Se,disabled:z||P!==null||!(c!=null&&c.id),className:`w-full py-2 px-4 rounded-lg text-white text-sm font-Poppins font-medium flex items-center justify-center gap-2 transition duration-150 5 ${z||P!==null||!(c!=null&&c.id)?"bg-gray-400 cursor-not-allowed":"bg-gradient-to-r from-green-500 to-teal-500 hover:from-green-600 hover:to-teal-600"}`,children:z?e.jsxs(e.Fragment,{children:[e.jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Sending..."]}):P!==null?"Processing...":`Send ${(c==null?void 0:c.gift_name)||"Gift"} (â¹${(c==null?void 0:c.gift_price)||"?"})`})})]})]})})]}),we&&e.jsx(Be,{onClose:()=>J(!1),astrologerData:X,consultationType:he})]}),e.jsx("style",{jsx:!0,children:` 6 .custom-scrollbar::-webkit-scrollbar {
7 width: 8px; 8 } 9 .custom-scrollbar::-webkit-scrollbar-track { 10 background: #f1f1f1; 11 border-radius: 10px; 12 } 13 .custom-scrollbar::-webkit-scrollbar-thumb { 14 background: #888; 15 border-radius: 10px; 16 } 17 .custom-scrollbar::-webkit-scrollbar-thumb:hover { 18 background: #555; 19 } 20 `})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center h-screen",children:[e.jsx(de,{}),e.jsx("p",{className:"text-gray-600 mt-10",children:"Loading astrologer details or data missing..."})]})};export{De as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.