PageSourceSearch

https://www.drivers4me.com/_next/static/chunks/2632.c4bda2cb085470b8.js

js drivers4me.com collected 2026-10-02 01:29:45 UTC 111,765 bytes, 7 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2632],{2632:(e,t,r)=>{let s;r.r(t),r.d(t,{default:()=>ef});var a=r(95155),l=r(12115),i=r(67909);function n(e){let{url:t,onPageCountChange:s}=e,[i,n]=(0,l.useState)(0),[o,d]=(0,l.useState)(600),[c,u]=(0,l.useState)(null),[m,p]=(0,l.useState)(!1);if((0,l.useEffect)(()=>{d(Math.min(window.innerWidth-32,800)),Promise.all([r.e(2084),r.e(5376),r.e(8664)]).then(r.bind(r,38664)).then(e=>{e.pdfjs.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${e.pdfjs.version}/build/pdf.worker.min.mjs`,u({Document:e.Document,Page:e.Page})})},[]),!c)return(0,a.jsx)("div",{className:"text-gray-400 text-sm py-10",children:"Loading PDF…"});let{Document:f,Page:h}=c;return m?(0,a.jsxs)("div",{className:"flex flex-col items-center gap-3 text-white py-10",children:[(0,a.jsx)("p",{className:"text-gray-400 text-sm",children:"Could not load PDF"}),(0,a.jsx)("a",{href:t,target:"_blank",rel:"noreferrer",className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 rounded text-white text-sm",children:"Download instead"})]}):(0,a.jsx)(f,{file:t,onLoadSuccess:e=>{let{numPages:t}=e;n(t),s(t)},onLoadError:()=>p(!0),loading:(0,a.jsx)("div",{className:"text-gray-400 text-sm py-10",children:"Loading PDF…"}),children:Array.from({length:i},(e,t)=>(0,a.jsxs)("div",{className:"flex flex-col items-center",children:[(0,a.jsx)(h,{pageNumber:t+1,width:o,renderTextLayer:!1,renderAnnotationLayer:!1,className:"shadow-xl"}),t<i-1&&(0,a.jsxs)("div",{className:"w-full flex items-center gap-2 px-4 py-2",children:[(0,a.jsx)("div",{className:"flex-1 h-px bg-white/10"}),(0,a.jsxs)("span",{className:"text-xs text-white/30",children:[t+1," / ",i]}),(0,a.jsx)("div",{className:"flex-1 h-px bg-white/10"})]})]},t+1))})}var o=r(1213),d=r(33229),c=r(56479);let u=(0,c.A)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),m=(0,c.A)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]),p=(0,c.A)("ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]]),f=(0,c.A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),h=(0,c.A)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]),g=(0,c.A)("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]),x=(0,c.A)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]),b=new Uint8Array(16);function y(){if(!s){if("undefined"==typeof crypto||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");s=crypto.getRandomValues.bind(crypto)}return s(b)}let v=[];for(let e=0;e<256;++e)v.push((e+256).toString(16).slice(1));function w(e,t=0){return(v[e[t+0]]+v[e[t+1]]+v[e[t+2]]+v[e[t+3]]+"-"+v[e[t+4]]+v[e[t+5]]+"-"+v[e[t+6]]+v[e[t+7]]+"-"+v[e[t+8]]+v[e[t+9]]+"-"+v[e[t+10]]+v[e[t+11]]+v[e[t+12]]+v[e[t+13]]+v[e[t+14]]+v[e[t+15]]).toLowerCase()}let _={};function j(e,t,r,s,a,l,i=0){if(e.length<16)throw Error("Random bytes length must be >= 16");if(l){if(i<0||i+16>l.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`)}else l=new Uint8Array(16),i=0;t??=Date.now(),r??=0,s??=(e[8]<<8|e[9])&16383,a??=e.slice(10,16);let n=((0xfffffff&(t+=122192928e5))*1e4+r)%0x100000000;l[i++]=n>>>24&255,l[i++]=n>>>16&255,l[i++]=n>>>8&255,l[i++]=255&n;let o=t/0x100000000*1e4&0xfffffff;l[i++]=o>>>8&255,l[i++]=255&o,l[i++]=o>>>24&15|16,l[i++]=o>>>16&255,l[i++]=s>>>8|128,l[i++]=255&s;for(let e=0;e<6;
1++e)l[i++]=a[e];return l}let k=function(e,t,r){let s,a=e?._v6??!1;if(e){let t=Object.keys(e);1===t.length&&"_v6"===t[0]&&(e=void 0)}if(e)s=j(e.random??e.rng?.()??y(),e.msecs,e.nsecs,e.clockseq,e.node,t,r);else{var l,i,n;let e=Date.now(),o=y();l=_,i=e,n=o,l.msecs??=-1/0,l.nsecs??=0,i===l.msecs?(l.nsecs++,l.nsecs>=1e4&&(l.node=void 0,l.nsecs=0)):i>l.msecs?l.nsecs=0:i<l.msecs&&(l.node=void 0),l.node||(l.node=n.slice(10,16),l.node[0]|=1,l.clockseq=(n[8]<<8|n[9])&16383),l.msecs=i,s=j(o,_.msecs,_.nsecs,a?void 0:_.clockseq,a?void 0:_.node,t,r)}return t??w(s)},N={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},C=function(e,t,r){if(N.randomUUID&&!t&&!e)return N.randomUUID();var s=e,a=r;let l=(s=s||{}).random??s.rng?.()??y();if(l.length<16)throw Error("Random bytes length must be >= 16");if(l[6]=15&l[6]|64,l[8]=63&l[8]|128,t){if((a=a||0)<0||a+16>t.length)throw RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[a+e]=l[e];return t}return w(l)};var T=r(94343),S=r(6663),D=r(80361),$=r(10540),L=r(67278),R=r(52958);function A(e){let{lat:t,lng:r,onClose:s,onLocationSelect:i,showSelectButton:n=!1}=e,{isLoaded:o,loadError:d}=(0,R._)(),[c,u]=(0,l.useState)({lat:Number(t),lng:Number(r)}),[m,p]=(0,l.useState)(""),[f,h]=(0,l.useState)(n),g=(0,l.useRef)(i);(0,l.useEffect)(()=>{g.current=i},[i]);let x=(0,l.useRef)(!1);(0,l.useCallback)(()=>{let e=`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(`${c.lat},${c.lng}`)}`;window.open(e,"_blank","noopener,noreferrer")},[c]);let b=(0,l.useCallback)(e=>{e.latLng&&n&&u({lat:e.latLng.lat(),lng:e.latLng.lng()})},[n]),y=(0,l.useCallback)(e=>{e.latLng&&n&&(x.current=!0,u({lat:e.latLng.lat(),lng:e.latLng.lng()}))},[n]);return((0,l.useEffect)(()=>{o&&window.google?.maps?.Geocoder&&new window.google.maps.Geocoder().geocode({location:c},(e,t)=>{if("OK"===t&&e?.[0]){let t=e[0].formatted_address;p(t),x.current&&(x.current=!1,g.current?.(c.lat,c.lng,t||"Selected Location"))}})},[o,c.lat,c.lng]),d)?(0,a.jsx)("div",{children:"Map failed to load"}):o?(0,a.jsxs)("div",{className:"w-full h-full flex flex-col",children:[(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(L.u6,{mapContainerStyle:{width:"100%",height:"100%"},center:c,zoom:15,onClick:b,children:(0,a.jsx)(L.pH,{position:c,draggable:n,onDragEnd:y})})}),m&&(0,a.jsxs)("div",{className:"p-3 bg-gray-50 border-t text-sm text-gray-700",children:[(0,a.jsx)("strong",{children:"Selected Location:"})," ",m]})]}):(0,a.jsx)("div",{children:"Loading map…"})}let M=JSON.parse('[{"featureType":"administrative.locality","elementType":"labels.text","stylers":[{"color":"#556275"}]},{"featureType":"administrative.locality","elementType":"labels.text.stroke","stylers":[{"color":"#e9edf3"}]},{"featureType":"administrative.neighborhood","elementType":"labels.text.fill","stylers":[{"color":"#90a8dd"}]},{"featureType":"landscape","elementType":"geometry.fill","stylers":[{"color":"#e6e9ec"}]},{"featureType":"landscape.man_made","elementType":"geometry.fill","stylers":[{"color":"#e6e9ec"}]},{"featureType":"landscape.man_made","elementType":"geometry.stroke","stylers":[{"color":"#e6e9ec"}]},{"featureType":"landscape.natural.terrain","stylers":[{"color":"#e6e9ec"},{"visibility":"off"}]},{"featureType":"poi","elementType":"geometry.fill","stylers":[{"color":"#e6e9ec"}]},{"featureType":"poi","elementType":"labels.icon","stylers":[{"saturation":-100}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#6890df"},{"saturation":-65},{"lightness":-20}]},{"featureType":"poi.park","elementType":"geometry.fill","stylers":[{"color":"#a7dfb6"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#5ea678"},{"saturation":-25}]},{"featureType":"road","elementType":"labels.icon","stylers":[{"saturation":-30},{"lightness":10}]},{"featureType":"road.arterial","elementType":"geometry.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"road.arterial","elementType":"geometry.stroke","stylers":[{"color":"#ffffff"}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#a6b5db"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#96acd0"}]},{"featureType":"road.highway.controlled_access","elementType":"geometry.fill","stylers":[{"color":"#8b9fd4"}]},{"featureType":"road.highway.controlled_access","elementType":"geometry.stroke","stylers":[{"color":"#7996c9"}]},{"featureType":"road.local","elementType":"geometry.fill","stylers":[{"color":"#ffffff"}]},{"featureType":"road.local","elementType":"geometry.stroke","stylers":[{"color":"#ffffff"}]},{"featureType":"transit","elementType":"labels.icon","stylers":[{"saturation":-65}]},{"featureType":"transit.line","elementType":"geometry.fill","stylers":[{"color":"#29b4e3"},{"saturation":-60},{"lightness":60}]},{"featureType":"transit.line","elementType":"geometry.stroke","stylers":[{"color":"#29b4e3"},{"saturation":-60},{"lightness":60}]},{"featureType":"transit.station.airport","elementType":"geometry.fill","stylers":[{"color":"#c9d4e3"}]},{"featureType":"transit.station.rail","elementType":"labels.text","stylers":[{"saturation":-40},{"lightness":5}]},{"featureType":"water","elementType":"geometry.fill","stylers":[{"color":"#acd5f5"}]}]'),F=JSON.parse('[{"elementType":"labels.text.fill","stylers":[{"color":"#7DB7CF"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#2B2E35"}]},{"featureType":"administrative","elementType":"geometry.fill","stylers":[{"color":"#3E434C"}]},{"featureType":"administrative.country","elementType":"geometry.stroke","stylers":[{"color":"#967868"}]},{"featureType":"administrative.land_parcel","elementType":"geometry.stroke","stylers":[{"visibility":"off"}]},{"featureType":"administrative.locality","elementType":"labels.text.fill","stylers":[{"color":"#A0BFF9"}]},{"featureType":"administrative.neighborhood","elementType":"labels.text.fill","stylers":[{"color":"#7D91
1B6"}]},{"featureType":"administrative.province","elementType":"geometry.stroke","stylers":[{"color":"#967868"}]},{"featureType":"landscape","elementType":"geometry.fill","stylers":[{"color":"#183B49"}]},{"featureType":"landscape","elementType":"geometry.stroke","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"geometry.fill","stylers":[{"color":"#102731"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#7DB7CF"}]},{"featureType":"poi.attraction","elementType":"labels.icon","stylers":[{"color":"#1f4e61"}]},{"featureType":"poi.business","elementType":"labels.icon","stylers":[{"color":"#1f4e61"}]},{"featureType":"poi.government","elementType":"labels.icon","stylers":[{"color":"#1f4e61"}]},{"featureType":"poi.medical","elementType":"labels.icon","stylers":[{"color":"#1f4e61"}]},{"featureType":"poi.park","elementType":"geometry.fill","stylers":[{"color":"#102731"},{"visibility":"on"}]},{"featureType":"poi.park","elementType":"labels.icon","stylers":[{"color":"#027a48"},{"visibility":"on"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#59A882"}]},{"featureType":"poi.place_of_worship","elementType":"labels.icon","stylers":[{"color":"#1f4e61"}]},{"featureType":"poi.school","elementType":"labels.icon","stylers":[{"color":"#1f4e61"}]},{"featureType":"poi.sports_complex","elementType":"labels.icon","stylers":[{"color":"#1f4e61"}]},{"featureType":"road","elementType":"geometry.fill","stylers":[{"color":"#09171D"}]},{"featureType":"road","elementType":"geometry.stroke","stylers":[{"color":"#262933"}]},{"featureType":"road","elementType":"labels.icon","stylers":[{"saturation":-10},{"visibility":"on"}]},{"featureType":"road","elementType":"labels.text.fill","stylers":[{"color":"#D4D4D6"}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#09171D"}]},{"featureType":"road.highway","elementType":"geometry.stroke","stylers":[{"color":"#27627A"}]},{"featureType":"road.highway.controlled_access","elementType":"geometry.fill","stylers":[{"color":"#0E1828"}]},{"featureType":"transit","elementType":"labels.icon","stylers":[{"saturation":-30},{"lightness":-50}]},{"featureType":"transit.line","elementType":"geometry","stylers":[{"color":"#222937"},{"visibility":"on"}]},{"featureType":"transit.station","stylers":[{"visibility":"off"}]},{"featureType":"transit.station.airport","elementType":"geometry","stylers":[{"color":"#1F4E61"},{"visibility":"on"}]},{"featureType":"transit.station.airport","elementType":"labels","stylers":[{"visibility":"on"}]},{"featureType":"transit.station.airport","elementType":"labels.text.fill","stylers":[{"color":"#DFF6FF"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#2F7592"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#7DB7CF"}]}]');function E(e){return e.map(e=>{let t=[];for(let r of(e.featureType&&t.push(`feature:${e.featureType}`),e.elementType&&t.push(`element:${e.elementType}`),e.stylers))for(let[e,s]of Object.entries(r))"string"==typeof s&&s.startsWith("#")?t.push(`${e}:0x${s.slice(1)}`):t.push(`${e}:${s}`);return`&style=${encodeURIComponent(t.join("|"))}`}).join("")}let B=E(M),I=E(F),U=14/30,O=null;async function z(e){let t=await fetch(e);if(!t.ok)throw Error(`Failed fetching map: ${t.status}`);let r=await t.blob();return await createImageBitmap(r)}function P(e,t,r){let s=256*Math.pow(2,r)*2,a=Math.max(Math.min(Math.sin(e*Math.PI/180),.9999),-.9999);return{x:s*(.5+t/360),y:s*(.5-Math.log((1+a)/(1-a))/(4*Math.PI))}}function V(e,t,r,s,a,l,i){let n=P(e,t,a),o=P(r,s,a);return{px:n.x-o.x+l/2,py:n.y-o.y+i/2}}async function W(e,t,r,s,a){let l=await (!O&&(O=new Promise((e,t)=>{let r=new Image;r.onload=()=>e(r),r.onerror=e=>t(e),r.src=`data:image/svg+xml;utf8,${encodeURIComponent('<svg width="140" height="300" viewBox="0 0 14 30" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6.97656 18.0469C9.72521 18.0469 11.954 20.275 11.9541 23.0234C11.9541 25.772 9.72527 28 6.97656 28C4.22801 27.9998 2 25.7719 2 23.0234C2.0001 20.2751 4.22807 18.0471 6.97656 18.0469Z" fill="#3288FF" stroke="#DFEEFF" stroke-width="2"/><path d="M6.75977 1.5C4.23984 1.5 2.19729 3.54271 2.19727 6.0625C2.19727 8.58231 4.23982 10.625 6.75977 10.625C9.27963 10.6249 11.3223 8.58225 11.3223 6.0625C11.3222 3.54278 9.27961 1.5001 6.75977 1.5Z" fill="white" stroke="#D92D20" stroke-width="3"/><path d="M5.37891 17.2137V11.5193V11.1621H8.16967V17.6474C8.16967 19.7458 7.70979 21.8187 6.8224 23.7202C5.87163 21.6829 5.37891 19.4619 5.37891 17.2137Z" fill="#D92D20"/></svg>')}`})),O),i=s*U;e.save(),e.beginPath(),e.ellipse(t,r+3,.45*i,.14*i,0,0,2*Math.PI),e.fillStyle="rgba(0,0,0,0.25)",e.fill(),e.drawImage(l,t-i/2,r-s,i,s),e.restore(
1)}async function H(e){let{lat:t,lng:r,locationLabel:s="Here",apiKey:a="",sizeChoice:l=1,markerSize:i=120,markerFillDay:n=[255,80,80],markerFillDark:o=[255,80,80],zoomDay:d=14,zoomDark:c=14}=e,u=1===l?800:900,m=1===l?600:350;async function p(e,l,n){let o=function(e,t,r,s,a,l){let i=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return`https://maps.googleapis.com/maps/api/staticmap?center=${e},${t}&zoom=${l}&size=${s}x${a}&scale=2&maptype=roadmap${i?I:B}&key=${r}`}(t,r,a,u,m,l,e),d=await z(o),c=document.createElement("canvas");c.width=d.width,c.height=d.height;let p=c.getContext("2d");if(!p)throw Error("Failed to get canvas context");p.drawImage(d,0,0);let f=c.width,h=c.height;V(t,r,t,r,l,f,h);let g=V(t,r,t,r,l,f,h),x={px:Math.round(g.px),py:Math.round(g.py)},b=`rgb(${n[0]},${n[1]},${n[2]})`;await W(p,x.px,x.py,i,b);let y=s.length>15?s.slice(0,15)+"...":s,v=function(){let e=i*U,t=x.py-i,r=[{x:x.px+8,y:t-70-8},{x:x.px-280-8,y:t-70-8},{x:x.px+8,y:x.py+8},{x:x.px-280-8,y:x.py+8}],s=x.px-e/2,a=x.px+e/2,l=x.py;for(let e of r){if(e.x<0||e.y<0||e.x+280>f||e.y+70>h)continue;let r=e.x,i=e.x+280,n=e.y,o=e.y+70;if(i<s||r>a||o<t||n>l)return e}return{x:Math.min(Math.max(0,x.px+20),f-280),y:Math.min(Math.max(0,x.py+20),h-70)}}();!function(e,t,r,s,a){var l;let i=arguments.length>5&&void 0!==arguments[5]&&arguments[5];e.font="22px DejaVu Sans, Arial, sans-serif";let n=Math.round(60+e.measureText(t).width+22),o=Math.round(46);e.save(),l=.28*o,e.beginPath(),e.moveTo(r+l,s),e.lineTo(r+n-l,s),e.quadraticCurveTo(r+n,s,r+n,s+l),e.lineTo(r+n,s+o-l),e.quadraticCurveTo(r+n,s+o,r+n-l,s+o),e.lineTo(r+l,s+o),e.quadraticCurveTo(r,s+o,r,s+o-l),e.lineTo(r,s+l),e.quadraticCurveTo(r,s,r+l,s),e.closePath(),e.fillStyle=i?"rgba(28,28,28,1)":"rgba(255,255,255,1)",e.fill(),e.beginPath(),e.arc(r+22+12,s+o/2,12,0,2*Math.PI),e.fillStyle=a,e.fill(),e.fillStyle=i?"rgba(255,255,255,1)":"rgba(0,0,0,1)",e.textBaseline="middle",e.fillText(t,r+22+24+14,s+o/2),e.restore()}(p,y,Math.round(v.x),Math.round(v.y),b,e);let w=await new Promise(e=>c.toBlob(t=>e(t),"image/png")),_=URL.createObjectURL(w);return{blob:w,url:_}}let f=await p(!1,d,n),h=await p(!0,c,o);return{day:f.blob,dark:h.blob,dayUrl:f.url,darkUrl:h.url}}let q=e=>{let{className:t=""}=e;return(0,a.jsxs)("svg",{className:t,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 2.66732C7.08504 2.66704 6.1854 2.90215 5.38757 3.35005C4.58973 3.79794 3.92054 4.44356 3.44434 5.22483C2.96813 6.00609 2.70092 6.89673 2.66841 7.81112C2.63589 8.7255 2.83916 9.63287 3.25867 10.446C3.32882 10.5813 3.35047 10.7366 3.32 10.886L2.856 13.1447L5.11467 12.6807C5.26404 12.6502 5.41933 12.6718 5.55467 12.742C6.27221 13.1116 7.06429 13.3135 7.8712 13.3325C8.67811 13.3515 9.47882 13.1871 10.213 12.8518C10.9471 12.5164 11.5956 12.0187 12.1095 11.3963C12.6234 10.7739 12.9893 10.043 13.1797 9.25864C13.3701 8.47427 13.3799 7.65693 13.2086 6.8682C13.0372 6.07947 12.689 5.33992 12.1903 4.70529C11.6916 4.07066 11.0553 3.5575 10.3295 3.20448C9.60364 2.85147 8.80714 2.6678 8 2.66732ZM1.33334 8.00065C1.33334 4.31865 4.318 1.33398 8 1.33398C11.682 1.33398 14.6667 4.31865 14.6667 8.00065C14.6667 11.6827 11.682 14.6673 8 14.6673C7.01762 14.6684 6.04721 14.4517 5.15867 14.0327L2.13334 14.654C2.02527 14.6761 1.91342 14.6711 1.80778 14.6393C1.70215 14.6076 1.60605 14.5501 1.52809 14.4721C1.45012 14.394 1.39274 14.2979 1.36108 14.1922C1.32942 14.0866 1.32447 13.9747 1.34667 13.8667L1.96667 10.842C1.54809 9.95334 1.33179 8.98294 1.33334 8.00065Z",fill:"#09171D"}),(0,a.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.19534 6.19571C6.32035 6.07073 6.48989 6.00052 6.66667 6.00052C6.84345 6.00052 7.01298 6.07073 7.138 6.19571L8 7.05771L8.862 6.19571C8.9235 6.13204 8.99706 6.08125 9.0784 6.04631C9.15974 6.01137 9.24722 5.99298 9.33574 5.99221C9.42425 5.99144 9.51204 6.00831 9.59397 6.04183C9.6759 6.07535 9.75034 6.12486 9.81293 6.18745C9.87553 6.25005 9.92503 6.32448 9.95855 6.40641C9.99207 6.48834 10.0089 6.57613 10.0082 6.66465C10.0074 6.75317 9.98901 6.84065 9.95407 6.92198C9.91913 7.00332 9.86834 7.07688 9.80467 7.13838L8.94267 8.00038L9.80467 8.86238C9.92611 8.98811 9.9933 9.15652 9.99179 9.33131C9.99027 9.50611 9.92015 9.67332 9.79655 9.79693C9.67294 9.92053 9.50573 9.99064 9.33094 9.99216C9.15614 9.99368 8.98774 9.92649 8.862 9.80505L8 8.94305L7.138 9.80505C7.01227 9.92649 6.84387 9.99368 6.66907 9.99216C6.49427 9.99064 6.32706 9.92053 6.20346 9.79693C6.07985 9.67332 6.00974 9.50611 6.00822 9.33131C6.0067 9.15652 6.0739 8.98811 6.19534 8.86238L7.05734 8.00038L6.19534 7.13838C6.
107036 7.01336 6.00014 6.84382 6.00014 6.66705C6.00014 6.49027 6.07036 6.32073 6.19534 6.19571Z",fill:"#09171D"})]})},Z=e=>{let{className:t=""}=e;return(0,a.jsxs)("svg",{className:t,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.99999 2.66732C7.08503 2.66704 6.18538 2.90215 5.38755 3.35005C4.58972 3.79794 3.92053 4.44356 3.44432 5.22483C2.96812 6.00609 2.70091 6.89673 2.66839 7.81112C2.63588 8.7255 2.83915 9.63287 3.25865 10.446C3.3288 10.5813 3.35045 10.7366 3.31999 10.886L2.85599 13.1447L5.11465 12.6807C5.26402 12.6502 5.41931 12.6718 5.55465 12.742C6.2722 13.1116 7.06427 13.3135 7.87119 13.3325C8.6781 13.3515 9.4788 13.1871 10.213 12.8518C10.9471 12.5164 11.5956 12.0187 12.1095 11.3963C12.6234 10.7739 12.9893 10.043 13.1797 9.25864C13.3701 8.47427 13.3799 7.65693 13.2085 6.8682C13.0372 6.07947 12.689 5.33992 12.1903 4.70529C11.6916 4.07066 11.0553 3.5575 10.3295 3.20448C9.60363 2.85147 8.80712 2.6678 7.99999 2.66732ZM1.33332 8.00065C1.33332 4.31865 4.31799 1.33398 7.99999 1.33398C11.682 1.33398 14.6667 4.31865 14.6667 8.00065C14.6667 11.6827 11.682 14.6673 7.99999 14.6673C7.0176 14.6684 6.04719 14.4517 5.15865 14.0327L2.13332 14.654C2.02526 14.6761 1.9134 14.6711 1.80777 14.6393C1.70214 14.6076 1.60603 14.5501 1.52807 14.4721C1.45011 14.394 1.39273 14.2979 1.36106 14.1922C1.3294 14.0866 1.32445 13.9747 1.34665 13.8667L1.96665 10.842C1.54808 9.95334 1.33178 8.98294 1.33332 8.00065Z",fill:"#F7FDFF"}),(0,a.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.19544 6.19571C6.32045 6.07073 6.48999 6.00052 6.66677 6.00052C6.84354 6.00052 7.01308 6.07073 7.1381 6.19571L8.0001 7.05771L8.8621 6.19571C8.9236 6.13204 8.99716 6.08125 9.0785 6.04631C9.15983 6.01137 9.24732 5.99298 9.33583 5.99221C9.42435 5.99144 9.51214 6.00831 9.59407 6.04183C9.676 6.07535 9.75044 6.12486 9.81303 6.18745C9.87563 6.25005 9.92513 6.32448 9.95865 6.40641C9.99217 6.48834 10.009 6.57613 10.0083 6.66465C10.0075 6.75317 9.98911 6.84065 9.95417 6.92198C9.91923 7.00332 9.86844 7.07688 9.80477 7.13838L8.94277 8.00038L9.80477 8.86238C9.92621 8.98811 9.9934 9.15652 9.99188 9.33131C9.99037 9.50611 9.92025 9.67332 9.79665 9.79693C9.67304 9.92053 9.50583 9.99064 9.33104 9.99216C9.15624 9.99368 8.98784 9.92649 8.8621 9.80505L8.0001 8.94305L7.1381 9.80505C7.01237 9.92649 6.84397 9.99368 6.66917 9.99216C6.49437 9.99064 6.32716 9.92053 6.20356 9.79693C6.07995 9.67332 6.00984 9.50611 6.00832 9.33131C6.0068 9.15652 6.074 8.98811 6.19544 8.86238L7.05744 8.00038L6.19544 7.13838C6.07045 7.01336 6.00024 6.84382 6.00024 6.66705C6.00024 6.49027 6.07045 6.32073 6.19544 6.19571Z",fill:"#F7FDFF"})]})},J=[{code:1,label:"Admin Unresponsive",icon:"/assets/support/admin_unresponsive.svg"},{code:2,label:"Unfair Policies",icon:"/assets/support/unfair_policies.svg"},{code:4,label:"System Malfunction",icon:"/assets/support/system_malfunction.svg"},{code:8,label:"Poor Communication",icon:"/assets/support/poor_communication.svg"},{code:16,label:"Closed Without Resolution",icon:"/assets/support/closed_without_resolution.svg"}];function K(e){let{isOpen:t,onSubmit:r}=e,[s,i]=(0,l.useState)(0),[n,o]=(0,l.useState)(null),[d,c]=(0,l.useState)(""),[u,m]=(0,l.useState)(0);if((0,l.useEffect)(()=>{t&&(i(0),c(""),m(0))},[t]),!t)return null;let p=s>0&&s<=3;return(0,a.jsx)("div",{"aria-modal":!0,role:"dialog",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",children:(0,a.jsxs)("div",{className:"w-full max-w-lg rounded-3xl bg-white dark:bg-[#0D2B36] px-6 pb-8 pt-4 shadow-2xl",children:[(0,a.jsx)("p",{className:"text-center font-semibold text-slate-900 dark:text-white mb-4",style:{fontFamily:"Inter",fontSize:"12px",lineHeight:"120%",letterSpacing:"0%"},children:"Submit Ratings"}),(0,a.jsxs)("div",{className:"rounded-2xl border border-slate-100 dark:border-[#183B49] bg-slate-50 dark:bg-[#183B49] px-5 py-5",children:[(0,a.jsxs)("h3",{className:"text-center text-lg font-bold text-slate-900 dark:text-white leading-snug",children:["Please rate your Drivers4Me",(0,a.jsx)("br",{}),"Support experience"]}),(0,a.jsx)("p",{className:"mt-2 text-center text-sm text-slate-500 dark:text-slate-400",children:"Your feedback helps us improve our support."}),(0,a.jsx)("div",{className:"mt-5 flex items-center justify-center gap-3",children:[1,2,3,4,5].map(e=>{let t=(n??s)>=e;return(0,a.jsx)("button",{onClick:()=>i(e),onMouseEnter:()=>o(e),onMouseLeave:()=>o(null),"aria-label":`${e} star`,className:"inline-flex p-0.5",children:(0,a.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)("path",{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z",fill:t?"#F6BB00":"none",stroke:t?"#F6BB00":"#98A2A3",strokeWidth:"2"})})},e)})})]}),p&&(0,a.jsxs)("div",{className:"mt-4",children:[(0,a.jsx)("p",{className:"mb-3 text-center text-sm font-semibold text-slate-700 dark:text-slate-200",children:"What went wrong?"}),(0,a.jsx)("div",{className:"flex flex-wrap justify-center gap-2",children:J.map(e=>{let t=(u&e.code)!=0;return(0,a.jsxs)("button",{onClick:()=>{var t;return t=e.code,void m(e=>{let r=e^t,s=J.filter(e=>(r&e.code)!=0).map(e=>e.label);return console.log("Reason codes:",r,"| Selected:",s),r})},className:`rounded-full border px-4 py-1.5 text-sm font-medium transition-colors ${t?"border-[#2F7592] bg-[#2F7592] text-white":"border-slate-300 dark:border-[#1F4E61] bg-white dark:bg-[#1F4E61] text-slate-600 dar
1k:text-slate-300 hover:border-[#2F7592] hover:text-[#2F7592] dark:hover:border-[#2F7592] dark:hover:text-white"}`,children:[(0,a.jsx)("img",{src:e.icon,alt:e.label,className:"inline-block mr-1.5 w-4 h-4 align-middle"}),e.label]},e.code)})}),(0,a.jsx)("textarea",{value:d,onChange:e=>c(e.target.value),placeholder:"Enter your feedback",rows:3,maxLength:1e3,className:"mt-4 w-full resize-none rounded-xl border border-slate-200 dark:border-[#1F4E61] bg-slate-50 dark:bg-[#1F4E61] px-4 py-3 text-sm text-slate-700 dark:text-white placeholder-slate-400 dark:placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-[#2F7592]"})]}),(0,a.jsxs)("button",{disabled:0===s||p&&0===u&&""===d.trim(),onClick:()=>r(s,d,u),className:`mt-5 relative flex w-full items-center justify-center rounded-2xl px-6 py-4 text-base font-semibold transition-all ${0===s||p&&0===u&&""===d.trim()?"bg-slate-300 dark:bg-white/10 cursor-not-allowed text-slate-400 dark:text-white/30":"bg-[#27627A] dark:bg-[#2F7592] text-white hover:brightness-95"}`,children:[(0,a.jsx)("span",{children:"Submit"}),(0,a.jsx)("span",{className:`absolute right-4 flex h-8 w-8 items-center justify-center rounded-full ${0===s||p&&0===u&&""===d.trim()?"bg-slate-200 dark:bg-white/10":"bg-yellow-400"}`,children:(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#1F4E61",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:"M7 17L17 7M17 7H7M17 7v10"})})})]})]})})}let Y="/assets/icons/default_profile_image.svg",G=e=>{let{rating:t}=e,r=parseFloat(Number(t).toFixed(2));return(0,a.jsx)("div",{className:"flex items-center gap-1",children:[void 0,void 0,void 0,void 0,void 0].map((e,t)=>{let s=t+1,l=0;return r>=s?l=100:r<s&&r>s-1&&(l=100*(r-Math.floor(r))),(0,a.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",className:"text-gray-300 dark:text-blue-700",children:[(0,a.jsx)("path",{d:"M12 .587l3.668 7.568 8.332 1.151-6.064 5.787 1.48 8.257L12 18.896l-7.416 4.454 1.48-8.257L0 9.306l8.332-1.151z",fill:"currentColor"}),(0,a.jsx)("clipPath",{id:`clip-${t}`,children:(0,a.jsx)("rect",{x:"0",y:"0",width:`${l}%`,height:"100%"})}),(0,a.jsx)("path",{d:"M12 .587l3.668 7.568 8.332 1.151-6.064 5.787 1.48 8.257L12 18.896l-7.416 4.454 1.48-8.257L0 9.306l8.332-1.151z",fill:"#facc15",clipPath:`url(#clip-${t})`})]},t)})})};function Q(e){let{mapSrc:t="/assets/support/static.png",avatarSrc:r="/assets/icons/system-avatar.jpg",total:s="₹3506",date:l="06 Oct-04:19",tripId:i=3258741,status:n="Completed",duration:o="4hr:30min",trip_route_icon:d="/assets/icons/hatchback.png",trip_type_icon:c="/assets/icons/hatchback.png",car_type_icon:u="/assets/icons/hatchback.png",trip_type:m="Round",car_type:p="Hatchback",trip_route:f="On-Way",driverName:h="Abdur rahman",driverRating:g=4.9,driverReviews:x="1.5k reviews",content:b="Hello, how can I help you?",is_night:y=0,is_overtime:v=0,is_mine:w=!1,message_status:_=0,message_type:j="issue_selected",sender_name:k="You"}=e,N=null,C="issue_selected"===j,T=e=>!!e&&""!==e.trim()&&"unknown"!==e.trim().toLowerCase();return w&&(3===_?N=(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"#667085",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"})}):1===_?N=(0,a.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"#667085",children:[(0,a.jsx)("path",{d:"M1.5 13.5l4.5 4.5 12-12-1.5-1.5-10.5 10.5-3-3z"}),(0,a.jsx)("path",{d:"M6 13.5l4.5 4.5 12-12-1.5-1.5-10.5 10.5-3-3z"})]}):2===_?N=(0,a.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"#34B7F1",children:[(0,a.jsx)("path",{d:"M1.5 13.5l4.5 4.5 12-12-1.5-1.5-10.5 10.5-3-3z"}),(0,a.jsx)("path",{d:"M6 13.5l4.5 4.5 12-12-1.5-1.5-10.5 10.5-3-3z"})]}):0===_&&(N=(0,a.jsx)("span",{className:"text-xs text-red-400",children:"Failed"}))),(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"max-w-sm mx-auto",children:[(0,a.jsxs)("div",{className:"relative bg-white dark:bg-blue-800 rounded-2xl shadow-md overflow-hidden",style:{width:402},children:[(0,a.jsxs)("div",{className:"bg-[#16758a] dark:bg-[#09171D] text-white px-4 py-2 rounded-t-2xl flex items-center justify-between",children:[(0,a.jsxs)("div",{className:`flex-1 ${C?"text-left":"text-right"}`,children:[!C&&(0,a.jsx)("div",{className:"text-[15px] font-semibold opacity-90",children:w?"You"
1:k}),(0,a.jsx)("div",{className:`
2      text-sm leading-relaxed mt-1
3      ${C?"text-left text-md":""}
4    `,children:b})]}),(0,a.jsx)("div",{className:"ml-3 w-8 h-8 rounded-full bg-white/10 flex items-center justify-center flex-shrink-0",children:(0,a.jsxs)("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"#fff",strokeOpacity:"0.2"}),(0,a.jsx)("circle",{cx:"12",cy:"9",r:"1.6",fill:"#fff"}),(0,a.jsx)("rect",{x:"9",y:"13",width:"6",height:"2",rx:"1",fill:"#fff"})]})})]}),(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsx)("div",{className:"rounded-xl overflow-hidden bg-[#f3f6f7] dark:bg-blue-700",children:(0,a.jsx)("img",{src:t,alt:"trip map",className:"w-full h-36 object-cover"})}),(0,a.jsxs)("div",{className:"mt-4 grid grid-cols-3 gap-3 items-start",children:[(0,a.jsxs)("div",{className:"col-span-2",children:[(0,a.jsxs)("div",{className:"text-lg font-semibold dark:text-white",children:["Total: ",(0,a.jsx)("span",{className:"text-[#0b2e2b] dark:text-white",children:s})]}),(0,a.jsxs)("div",{className:"text-xs text-[#6b7280] dark:text-gray-400 mt-1",children:[l," | Booking : ",i]}),(0,a.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[T(n)&&(0,a.jsx)("span",{className:"px-3 py-1 rounded-full bg-gray-100 dark:bg-navy-600 text-xs text-gray-700 dark:text-gray-200",children:n}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[1===y&&(0,a.jsx)("button",{className:"w-8 h-8 rounded-full bg-white dark:bg-blue-700 shadow-md flex items-center justify-center text-xs",children:(0,a.jsx)("img",{src:"/assets/support/night_time.svg",alt:"Night trip"})}),1===v&&(0,a.jsx)("button",{className:"w-8 h-8 rounded-full bg-white dark:bg-blue-700 shadow-md flex items-center justify-center text-xs",children:(0,a.jsx)("img",{src:"/assets/support/overtime.svg",alt:"Overtime trip"})})]})]}),(0,a.jsxs)("div",{className:"mt-3 text-sm text-[#6b7280] dark:text-gray-300 flex items-center gap-4",children:[T(m)&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-14 h-14 rounded-xl overflow-hidden bg-white dark:bg-blue-700 shadow-sm flex items-center justify-center",children:(0,a.jsx)("img",{src:c,alt:"car",className:"w-full h-full object-contain p-2"})}),(0,a.jsx)("span",{className:"text-xs",children:m})]}),T(o)&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-12 h-12 rounded-xl overflow-hidden bg-white dark:bg-blue-700 shadow-sm flex items-center justify-center",children:(0,a.jsx)("img",{src:"/assets/support/time.svg",alt:"car",className:"w-full h-full object-contain p-2"})}),(0,a.jsx)("span",{className:"text-xs",children:o})]}),T(f)&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-12 h-12 rounded-xl overflow-hidden bg-white dark:bg-blue-700 shadow-sm flex items-center justify-center",children:(0,a.jsx)("img",{src:d,alt:"car",className:"w-full h-full object-contain p-2"})}),(0,a.jsx)("span",{className:"text-xs",children:f})]})]})]}),(0,a.jsx)("div",{className:"col-span-1 flex flex-col items-center",children:(0,a.jsx)("div",{className:"w-16 h-16 rounded-xl overflow-hidden bg-white dark:bg-blue-700 shadow-sm flex items-center justify-center",children:(0,a.jsx)("img",{src:u,alt:"car",className:"vehicle-img w-full h-full object-contain p-2"})})})]}),(0,a.jsxs)("div",{className:"mt-4 border-t border-slate-200 dark:border-blue-700 pt-3 flex items-center gap-3",children:[(0,a.jsx)("div",{className:"w-12 h-12 rounded-full overflow-hidden",children:(0,a.jsx)("img",{src:r,alt:"driver avatar",className:"w-full h-full object-cover",onError:e=>{let t=e.currentTarget;if(t.src.endsWith(Y)){t.onerror=null;return}t.onerror=null,t.src=Y}})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("div",{className:"font-semibold text-sm dark:text-white",children:h}),(0,a.jsx)("div",{className:"text-xs text-[#6b7280] dark:text-gray-300 flex items-center gap-2",children:(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(G,{rating:g}),(0,a.jsxs)("span",{className:"ml-1",children:[Number(g).toFixed(1)," (",x,")"]})]})})]})]})]})]}),(0,a.jsxs)("div",{className:"text-[11px] text-[#6b7280] dark:text-gray-400 mt-1 flex gap-1 items-center justify-end w-full",children:[(0,a.jsx)("span",{children:new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}),N&&(0,a.jsx)("span",{className:"flex items-center",children:N})]})]})})}var X=r(74602),ee=r(56504),et=r(84631);let er=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","text/plain"],es=["image/jpeg","image/png","image/webp","image/heic","image/gif",...er],ea=["audio/webm","audio/mpeg","audio/mp4","audio/ogg","audio/wav"],el=e=>`${Math.round(e/1048576)} MB`,ei=e=>er.includes(e.toLowerCase()),en=e=>{let t=(e.type||"").toLowerCase(),r=ei(t)?0xa00000:5242880;return e.size>r?{ok:!1,reason:`File too large (max ${el(r)})`}:t&&!es.includes(t)?{ok:!1,reason:`File type not allowed (${t||"unknown"})`}:{ok:!0}
4},eo=(0,i.default)(()=>r.e(4090).then(r.bind(r,94090)),{loadableGenerated:{webpack:()=>[94090]},ssr:!1}),ed={id:k(),sender_id:"bot",sender_name:"D4M Bot",message_type:"bot",room:"",content:"Hi,Please select the trip for which you seek help.",created_at:new Date().toISOString(),status:1},ec="bot-followup-trip",eu={id:ec,sender_id:"bot",sender_name:"D4M Bot",message_type:"bot",room:"",content:"Please select the issue you're facing with this trip.",created_at:new Date().toISOString(),status:1},em={id:k(),sender_id:"bot",sender_name:"D4M Bot",message_type:"bot",room:"",content:"Please select the issue you're facing.",created_at:new Date().toISOString(),status:1};function ep(e){let{url:t}=e,[r,s]=l.useState(null),[i,n]=l.useState(!1);return(l.useEffect(()=>{s(null),n(!1),fetch(t).then(e=>e.text()).then(s).catch(()=>n(!0))},[t]),i)?(0,a.jsx)("div",{className:"flex items-center justify-center h-full text-gray-400 text-sm",children:"Could not load file."}):null===r?(0,a.jsx)("div",{className:"flex items-center justify-center h-full text-gray-400 text-sm",children:"Loading…"}):(0,a.jsx)("div",{className:"h-full overflow-y-auto p-6",children:(0,a.jsx)("pre",{className:"text-gray-100 text-sm whitespace-pre-wrap break-words font-mono leading-relaxed",children:r})})}function ef(e){let{showBotMessage:t=!0,showbookingAdminBotMessage:s=!1,showbookingDriverBotMessage:i=!1,driverchat:c="",room_name:b="",onBackProp:y,tripActualEndDatetime:v,tripEndDate:w,tripEndTime:_,driverName:j=""}=e,{showToast:k}=(0,et.d)(),[N,L]=(0,l.useState)([]),[R,M]=(0,l.useState)(""),[F,E]=(0,l.useState)({}),[B,I]=(0,l.useState)(null),U=(0,l.useRef)(null),[O,z]=(0,l.useState)(null),[P,V]=(0,l.useState)(new Set),[W,J]=(0,l.useState)({}),[Y,G]=(0,l.useState)(!0),[er,es]=(0,l.useState)(!1),[ef,eh]=(0,l.useState)("none"),[eg,ex]=(0,l.useState)(!0),[eb,ey]=(0,l.useState)(null),ev=(0,l.useRef)(0),ew=(0,l.useRef)(!1),e_=(0,o.wA)(),[ej,ek]=(0,l.useState)([]),[eN,eC]=(0,l.useState)(!0),[eT,eS]=(0,l.useState)(!1),[eD,e$]=(0,l.useState)(!1),[eL,eR]=(0,l.useState)(null),[eA,eM]=(0,l.useState)(!0),eF=(0,o.d4)(S.t6),eE=(0,o.d4)(S.mK),[eB,eI]=(0,l.useState)(null),[eU,eO]=(0,l.useState)(null),ez=(0,l.useRef)(null),eP=(0,l.useRef)(null),[eV,eW]=(0,l.useState)(!1),eH=(0,o.d4)(S.UA),eq=(0,l.useRef)(null),eZ=(0,l.useRef)(null),[eJ,eK]=(0,l.useState)(!1),eY=(0,l.useRef)(b||B?.toString()||""),eG=(0,l.useRef)(null),eQ=(0,l.useRef)(C()),eX=(0,l.useRef)(null),e0=(0,l.useRef)(null),e1=(0,l.useRef)(null),[e2,e6]=(0,l.useState)([]),[e3,e4]=(0,l.useState)(null),[e5,e9]=(0,l.useState)(null),[e8,e7]=(0,l.useState)(0),te=(0,l.useRef)("");(0,l.useEffect)(()=>{navigator.geolocation&&navigator.geolocation.getCurrentPosition(e=>{let t={lat:e.coords.latitude,lng:e.coords.longitude},r=Object.keys($.qF).find(e=>(0,D.So)(t,Number(e)));eq.current={...t,region:r?Number(r):void 0},window.google?.maps?.Geocoder&&new window.google.maps.Geocoder().geocode({location:t},(e,s)=>{if("OK"===s&&e?.[0]){let s=e[0].address_components||[],a=s.find(e=>e.types.includes("sublocality_level_1"))?.short_name,l=s.find(e=>e.types.includes("locality"))?.short_name,i=a&&l?`${a}, ${l}`:a||l||e[0].formatted_address.split(",")[0].trim();eq.current={...t,region:r?Number(r):void 0,address:i}}})},()=>{},{enableHighAccuracy:!1,timeout:5e3})},[]);let tt=e=>({booking_id:e.booking_id,date:e.startdate??e.starttime??e.endtime??e.timestamp??e.created_at??null,booking_code:e.booking_code??e.booking_id??e.book_id??e.trans??null,status:((e,t)=>{if(t<0)return"Cancelled";switch(e){case 0:return"Completed";case 1:return"Stop Pics";case 2:return"Reached Destination";case 3:return"Trip started";case 4:return"Start Pics";case 5:return"Reached Source";case 6:return"On my way";case 7:return"Upcoming";case 8:return"Searching for driver";case -1:return"Cancelled";default:return`Status ${e}`}})(e.trip_status,e.booking_valid)}),tr=(0,l.useRef)(null),ts=(0,l.useRef)({}),ta=(0,l.useRef)({}),tl=function(e,t,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=(0,l.useRef)(new Map),i=(0,l.useRef)(null);return(0,l.useEffect)(()=>
4(i.current=new IntersectionObserver(r=>{r.forEach(r=>{if(r.isIntersecting){let s=r.target.getAttribute("data-id");if(s){let r=e.find(e=>e.id===s);r&&void 0!==r.status&&2!==r.status&&t(r)}}})},{root:r?.current??null,threshold:s.threshold??.5}),a.current.forEach(e=>{e&&i.current?.observe(e)}),()=>{i.current&&(a.current.forEach(e=>{try{i.current?.unobserve(e)}catch(e){}}),i.current.disconnect(),i.current=null)}),[e,r,t,s.threshold]),a}(N,e=>{!(P.has(e.id)||rl(e))&&eZ.current&&(eZ.current.emit("message_read",{message_id:e.id,client_uuid:e.client_uuid,room:eY.current,reader_id:B}),V(t=>{let r=new Set(t);return r.add(e.id),r}))},e0,{threshold:.5}),[ti,tn]=(0,l.useState)("");function to(e){let t=Array.isArray(e)?[...e]:[];return t.some(e=>e.id===ed.id)||eY.current,t}(0,l.useEffect)(()=>{let e=localStorage.getItem("persist:root");if(!e){I(null),z(null),eG.current=null;return}let t=JSON.parse(e),r=t?.auth?JSON.parse(t.auth):null,s=r?.user?.id??null,a=r?.user?.firstName??null,l=r?.user?.lastName??null,i=`${a??""} ${l??""}`.trim();s?(U.current=String(s),I(String(s)),z(i||null)):(U.current=null,I(null),z(null)),eG.current=r?.token??null},[]),(0,l.useEffect)(()=>{B&&e();async function e(){try{let e=await (0,T.mc)(eG.current),t=(Array.isArray(e?.bookings)?e.bookings:Array.isArray(e?.data?.bookings)?e.data.bookings:Array.isArray(e)?e:[]).map(tt);ek(t.slice(0,3)),t&&0!==t.length?eW(!1):(eW(!0),eC(!1))}catch(e){}}},[B]);let td=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];L(e=>{if(e.some(e=>e.id===ec))return e;let t=-1;for(let r=e.length-1;r>=0;r--)if(e[r]?.message_type==="system_resolved"){t=r;break}return(t>=0?e.slice(t+1):e).some(e=>e?.message_type==="issue_selected")?e:[...e,{...eu,room:eY.current,created_at:new Date().toISOString()}]}),eC(!1),eS(!!e),setTimeout(()=>eX.current?.scrollIntoView({behavior:"auto",block:"end"}),50)};function tc(e){Array.isArray(e)||(e=[]);let t=-1;for(let r=e.length-1;r>=0;r--)if("system_resolved"===(e[r]?.message_type??e[r]?.type)){t=r;break}let r=t>=0?e.slice(t+1):e;return{hasIssueSelected:r.some(e=>e?.message_type==="issue_selected"),hasTripSelected:r.some(e=>e?.message_type==="trip_selected"&&e?.message_type!=="issue_selected"),consideredMessages:r}}let tu=e=>{let t="Customer Support";return e.assigned_time_d4m&&(t=e.assigned_time_d4m),e.assigned_admin_first_response_time&&(t+=` • ${e.assigned_admin_first_response_time}`),t},[tm,tp]=(0,l.useState)(!1),tf=async()=>{if(ew.current||er||!eg||!eb)return;ew.current=!0,es(!0);let e=eY.current;try{let t=e0.current;t&&(ev.current=t.scrollHeight);let r=await (0,T.Vv)(e,eG.current,20,eb),s=Array.isArray(r?.messages)?r.messages:[];s.length>0?(L(e=>{let t=new Set(e.map(e=>e.message_id||e.id)),r=s.filter(e=>!t.has(e.message_id||e.id));return 0===r.length?e:[...r,...e]}),ex(r.has_more||!1),ey(s[0].message_id||s[0].id),setTimeout(()=>{if(t){let e=t.scrollHeight-ev.current;t.scrollTop=e}},0)):ex(!1)}catch(e){}finally{es(!1),ew.current=!1}};async function th(){let e=eY.current;try{let t=await (0,T.Am)(e,eG.current),r=Array.isArray(t?.messages)?t.messages:[];if(r.length){L(e=>{let t=new Set(e.map(e=>e.id)),s=r.filter(e=>!t.has(e.id));return[...e,...s]});let e=r.some(e=>e?.message_type==="issue_selected"||e?.type==="issue_selected"),t=r.some(e=>e?.message_type==="trip_selected"||e?.type==="trip_selected");e?(eC(!1),eS(!1)):t&&(eC(!1),td(!0)),r.forEach(e=>{e.id&&(eZ.current?.emit("message_received",{message_id:e.id,room:e.room}),"me"!==e.sender_id&&(null==B||String(e.sender_id)!==B)&&eZ.current?.emit("message_read",{message_id:e.id,client_uuid:e.client_uuid,room:e.room,reader_id:B}))})}else L(e=>t_(e))}catch(e){}}async function tg(e,t){if(t&&window.AudioContext)try{let r=await e.arrayBuffer();if(0===r.byteLength)return;let s=new AudioContext,a=(await s.decodeAudioData(r)).getChannelData(0),l=t.getBoundingClientRect(),i=t.width=Math.max(300,l.width||300),n=t.height=40,o=t.getContext("2d");o.clearRect(0,0,i,n);let d=Math.ceil(a.length/i);o.fillStyle="#3b82f6";let c=n/2;for(let e=0;e<i;e++){let t=e*d,r=0;for(let e=0;e<d&&t+e<a.length;e++)r+=Math.abs(a[t+e]);
4let s=r/d,l=Math.max(2,s*n*2);o.fillRect(e,c-l/2,1,l)}s.close()}catch(e){if(t){let e=t.getContext("2d");e.fillStyle="#d1d5db",e.fillRect(0,t.height/2-1,t.width,2)}}}(0,l.useEffect)(()=>{if(!er)return void eh("none");let e=setTimeout(()=>eh("spinner"),200),t=setTimeout(()=>eh("skeleton"),500);return()=>{clearTimeout(e),clearTimeout(t)}},[er]),(0,l.useEffect)(()=>{let e=e0.current;if(!e)return;let t=()=>{e.scrollTop<50&&eg&&!ew.current&&tf()};return e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)},[eg,er,eb]),(0,l.useEffect)(()=>{if(!B)return void G(!1);let e=!0;return(async()=>{let t=eY.current;(0,T.FZ)(t,eG.current).then(t=>{if(e&&t){if(t?.presences&&Array.isArray(t.presences)){let e={};t.presences.forEach(t=>{let r=String(t.user_id);r!==B&&(e[r]="online"===t.status?"online":"offline")}),J(e)}t?.admin_user_id&&tJ(t.admin_user_id),t?.admin_last_seen&&tY(t.admin_last_seen),t?.content&&tQ(t.content)}}).catch(()=>{});try{let e=await (0,T.Vv)(t,eG.current,5),r=Array.isArray(e?.messages)?e.messages:[];ex(e.has_more||!1),r.length>0&&ey(r[0].message_id||r[0].id);let a=r[r.length-1],l=a&&"system_resolved"===a.message_type;tp(e.is_blocked),tJ(e.assigned_admin_user_id);let n=e.last_session_rated??null;eR(n);let o=e.assigned_admin_user_id;a?.message_type==="system_resolved"&&!1===n&&o&&e$(!0);let{hasIssueSelected:d,hasTripSelected:c,consideredMessages:u}=tc(r),m=to(r);if(l){let e={...ed,room:eY.current};m.push(e)}L(m),G(!1),s&&!l&&L(function(e){let t=Array.isArray(e)?[...e]:[];return t.some(e=>e.id===em.id)||eY.current,t}(r)),i&&!l&&L(function(e){let t=Array.isArray(e)?[...e]:[];return t.some(e=>e.id===ed.id)||eY.current,t}(r)),setTimeout(()=>{eX.current?.scrollIntoView({behavior:"auto",block:"end"})},100),d?(eC(!1),eS(!1),eM(!1)):c?(eC(!1),td(!0),eM(!1)):(eC(!0),eS(!1))}catch(e){L(e=>to(e)),eC(!0),eS(!1),G(!1)}let r=(0,ee.z)();eZ.current=r;let a=()=>{r.emit("join_rooms",{rooms:[t],username:U.current},e=>{}),th()};r.on("connect",()=>{a()}),r.connected&&a(),r.on("user_joined",e=>{e.admin_id&&localStorage.setItem("admin_id",e.admin_id.toString()),eK(!0)}),r.on("presence:update",e=>{let t=String(e.user_id);t!==B&&(J(r=>({...r,[t]:e.status})),tZ&&Number(t)===tZ&&"online"===e.status&&tY(new Date().toISOString()))}),r.on("new_message",e=>{L(t=>{if(e.client_uuid===eQ.current){let r=t.map((e,t)=>({message:e,index:t})).filter(t=>{let{message:r}=t;return r.client_uuid===e.client_uuid&&3===r.status&&(r.content===e.content||!!r.images?.length)});if(r.length>0){let s=[...t];if(r.reverse().forEach(e=>{let{index:t}=e;s.splice(t,1)}),s.push(e),"system"===e.message_type){let e={...ed,room:eY.current};s.some(e=>e.id===ed.id)||s.push(e)}return s}}if(e?.id&&t.some(t=>t.id===e.id))return t;if(e.client_uuid!==eQ.current){let r=[...t,e];if("system"===e.sender_id||"system"===e.message_type){let e={...ed,room:eY.current};r.some(e=>e.id===ed.id)||r.push(e)}return r}return[...t,e]}),e?.message_type==="issue_selected"||e?.type==="issue_selected"?(eC(!1),eS(!1)):(e?.message_type==="trip_selected"||e?.type==="trip_selected")&&(eC(!1),setTimeout(()=>{td(!0)},100)),e&&e.id&&e.client_uuid!==eQ.current&&(r.emit("message_received",{message_id:e.id,room:e.room}),r.emit("message_read",{message_id:e.id,client_uuid:e.client_uuid,room:e.room,reader_id:B}))}),r.on("message_updated",e=>{L(t=>{let r=t.findIndex(t=>t.id&&e.id&&t.id===e.id);if(-1!==r){let s=[...t];return s[r]={...s[r],...e},s}let s=t.findIndex(t=>t.id&&e.message_id&&t.id===e.message_id);if(-1!==s){let r=[...t];return r[s]={...r[s],...e},r}if(e.client_uuid){let r=t.findIndex(t=>t.client_uuid&&t.client_uuid===e.client_uuid);if(-1!==r){let s=[...t];return s[r]={...s[r],...e,id:e.message_id??e.id},s}}return[...t,e]})}),r.on("open_ticket",e=>{e.room===eY.current&&tQ(tu(e))}),r.on("unassigned_ticket",e=>{e.room===eY.current&&tQ(tu(e))}),r.on("connect_error",e=>{}),r.on("disconnect",e=>{eK(!1)})})(),()=>{eZ.current&&(eZ.current.off("connect"),eZ.current.off("new_message"),eZ.current.off("user_joined"),eZ.current.off("presence:update"),eZ.current.off("open_ticket"),eZ.current.off("unassigned_ticket"),eZ.current.off("message_updated"),eZ.current.off("connect_error"),eZ.current.off("disconnect"),(0,ee.j)(),eZ.current=null),e=!1}},[B]),(0,l.useEffect)(()=>{(async()=>
4{if(c?.trim()&&c!==te.current)if(te.current=c,eZ.current?.connected&&O){let e={id:`temp-${eQ.current}-${Date.now()}`,client_uuid:eQ.current,sender_id:"me",sender_name:O,message_type:"text",room:eY.current,content:c,status:3,created_at:new Date().toISOString()};L(t=>[...t,e]),await tk(c),e_((0,S.Cd)(""))}else tn(c)})()},[c,e_,O]),(0,l.useEffect)(()=>{(async()=>{ti&&eZ.current?.connected&&O&&(await tk(ti),tn(""),e_((0,S.Cd)("")))})()},[eJ,O,ti,e_]),(0,l.useEffect)(()=>{L(e=>t_(e))},[]),(0,l.useEffect)(()=>{er||Y||setTimeout(()=>{eX.current?.scrollIntoView({behavior:"auto",block:"end"})},50)},[N,er,Y]);let tx=async()=>{if(tR){if(tz.current||(tz.current=new Audio(URL.createObjectURL(tR)),tz.current.onended=()=>tq(!1)),tH)tz.current.pause(),tq(!1);else try{await tz.current.play(),tq(!0)}catch(e){}tP.current&&tR&&tg(tR,tP.current)}},tb=e=>{let t=Math.floor(e/60).toString().padStart(2,"0"),r=Math.floor(e%60).toString().padStart(2,"0");return`${t}:${r}`};(0,l.useEffect)(()=>()=>{tU.current&&(clearInterval(tU.current),tU.current=null),ez.current&&(cancelAnimationFrame(ez.current),ez.current=null),tV&&URL.revokeObjectURL(tV),eB&&eB.close(),tM&&"inactive"!==tM.state&&(tM.stream?.getTracks().forEach(e=>e.stop()),tM.stop())},[]),(0,l.useEffect)(()=>()=>{tU.current&&(clearInterval(tU.current),tU.current=null),ez.current&&(cancelAnimationFrame(ez.current),ez.current=null),tV&&URL.revokeObjectURL(tV),eB&&"closed"!==eB.state&&eB.close(),tM&&"inactive"!==tM.state&&(tM.stream?.getTracks().forEach(e=>e.stop()),tM.stop()),eP.current&&(eP.current.destroy(),eP.current=null)},[]);let ty=(0,l.useRef)(null);async function tv(e,t){if(t)try{let r,s=t.getBoundingClientRect(),a=Math.max(1,Math.floor(s.width)||300),l=Math.max(1,Math.floor(s.height)||40),i=window.devicePixelRatio||1;t.width=Math.floor(a*i),t.height=Math.floor(l*i),t.style.width=`${a}px`,t.style.height=`${l}px`;let n=t.getContext("2d");if(!n)return;n.setTransform(1,0,0,1,0,0),n.scale(i,i),n.clearRect(0,0,a,l),n.fillStyle="#3b82f6",n.lineWidth=1;let o=await e.arrayBuffer(),d=window.AudioContext||window.webkitAudioContext;if(!d)throw Error("Web Audio API not supported");if(ty.current){try{await ty.current.close()}catch{}ty.current=null}let c=new d;ty.current=c;let u=await c.decodeAudioData(o),m=u.numberOfChannels,p=u.length;if(1===m)r=u.getChannelData(0);else{r=new Float32Array(p);for(let e=0;e<m;e++){let t=u.getChannelData(e);for(let e=0;e<p;e++)r[e]+=t[e]}let e=1/m;for(let t=0;t<p;t++)r[t]*=e}let f=Math.max(1,Math.floor(r.length/a));for(let e=0;e<a;e++){let t=e*f,s=1,a=-1,i=t,o=Math.min(t+f,r.length);for(;i<o;i++){let e=r[i];e<s&&(s=e),e>a&&(a=e)}let d=(1+a)/2*l,c=(1+s)/2*l,u=Math.max(1,c-d);n.fillRect(e,Math.round(d),1,Math.round(u))}try{await c.close()}catch{}ty.current=null}catch(e){}}let tw=e=>{tA(e),tW(URL.createObjectURL(e)),setTimeout(()=>{tP.current&&tv(e,tP.current)},200)};function t_(e){let t=Array.isArray(e)?e:[];return t.some(e=>e.id===ed.id)||t.some(e=>e.sender_id&&"system"!==e.sender_id)||0!==t.length?t:[{...ed,room:eY.current},...t]}let tj=async(e,t)=>{try{let r=await (0,T.gu)(e),s=r?.data?.message;s&&L(r=>{let a=r.findIndex(r=>
4r.id===t||e.client_uuid&&r.client_uuid===e.client_uuid&&3===r.status);if(-1===a)return r;let l=r[a];l?.message_type==="audio"&&l?.audio_url?.startsWith("blob:")&&URL.revokeObjectURL(l.audio_url);let i=[...r];return i[a]={...s},i})}catch(e){L(e=>e.map(e=>e.id===t?{...e,status:-1}:e)),console.error("[sendViaApi] failed",e?.message,"code:",e?.code,"status:",e?.response?.status,"data:",e?.response?.data)}};async function tk(e){eZ.current;let t=!1,r=(e??R??"").trim();if(r||0!==e2.length){if(e2.length>0){let e=`temp-${eQ.current}-${Date.now()}`;e2.map(e=>e.previewUrl);let s=e2.map(e=>e.file.name),a=e2.map(e=>e.file.type);tD(!0);try{let l=e2.map(e=>e.file),i=await tN(l),n=i.map(e=>e.public_url??e.publicUrl).filter(Boolean);if(0===n.length)throw Error("No uploaded URLs");let o={room:eY.current,sender_name:O||"Anonymous",sender_id:B,client_uuid:eQ.current,content:R.trim()||"",images:n,file_names:i.map(e=>e.original_name??e.filename??e.file??null),file_types:e2.map(e=>e.file.type),is_file:n.length>0,lat:eq.current?.lat??void 0,lng:eq.current?.lng??void 0,address:eq.current?.address??void 0,region:eq.current?.region??void 0};tj(o,e);let d=new Set(["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","text/plain"]),c=a.some(e=>d.has((e||"").toLowerCase())),u=a.some(e=>!d.has((e||"").toLowerCase())),m=R.trim();m||(m=c&&!u?s[a.findIndex(e=>d.has((e||"").toLowerCase()))]||"Document":u&&!c?"Photo sent":"Attachments sent");let p={id:e,client_uuid:eQ.current,sender_id:"me",sender_name:O,room:eY.current,content:m,status:3,created_at:new Date().toISOString(),images:n,metadata:{file_names:s,file_types:a}};L(e=>[...e,p]),t=!!r}catch(t){L(t=>t.map(t=>t.id===e?{...t,status:0}:t))}finally{tD(!1)}e6([]),t&&M("")}if(r&&!t){let e=eQ.current,t=`temp-${e}-${Date.now()}`,s={id:t,client_uuid:e,sender_id:"me",message_type:"text",sender_name:O,room:eY.current,content:r,status:3,created_at:new Date().toISOString()};L(e=>[...e,s]),M(""),tj({room:s.room,sender_id:B,sender_name:s.sender_name,content:s.content,client_uuid:e,lat:eq.current?.lat??void 0,lng:eq.current?.lng??void 0,address:eq.current?.address??void 0,region:eq.current?.region??void 0},t);return}}}async function tN(e){try{let t=await (0,T.jb)(e,`${B}/`),r=t?.data?.files??t?.files;if(!t||1!==t.success||!Array.isArray(r))throw Error("upload_message_attachments unexpected response");return r.map(e=>({public_url:e.public_url??e.publicUrl,filename:e.filename??e.file,original_name:e.original_name??e.originalName}))}catch(e){throw e}}let[tC,tT]=(0,l.useState)(null),[tS,tD]=(0,l.useState)(!1),[t$,tL]=(0,l.useState)(!1),[tR,tA]=(0,l.useState)(null),[tM,tF]=(0,l.useState)(null),tE=(0,l.useRef)(null),[tB,tI]=(0,l.useState)(0),tU=(0,l.useRef)(null),tO=(0,l.useRef)(0),tz=(0,l.useRef)(null),tP=(0,l.useRef)(null),[tV,tW]=(0,l.useState)(null),[tH,tq]=(0,l.useState)(!1),[tZ,tJ]=(0,l.useState)(null),[tK,tY]=(0,l.useState)(null),[tG,tQ]=(0,l.useState)(null),tX={booking_id:"",driver_name:"Unknown driver",driver_image:"/assets/icons/default_profile_image.svg",car_type:"Unknown",car_type_icon:"/assets/support/vehicles/light/hatchback.webp",trip_type:"Unknown",trip_route:"Unknown",trip_type_icon:"/assets/support/default-trip-type.svg",trip_route_icon:"/assets/support/default-trip-route.svg",trip_status:"Unknown",date:"",total_price:"₹0",duration:"",driver_rating:0,driver_reviews:0,is_night:0,is_overtime:0};function t0(e){let t=e.booking_details?.booking_code||e.booking_details?.book_code||e.booking_details?.booking_id||"",r=e.booking_details?.static_map??"",s=""===r?"/assets/support/static.png":`${X.sT}book-static-map-${t}/${r}`;return{booking_id:t,driver_name:e.driver_details?.name??"Unknown driver",static_map:r,driver_image:e.driver_details?.profile_pic?e.driver_details.profile_pic.startsWith("http")?e.driver_details.profile_pic:X.sT+e.driver_details.profile_pic:"/assets/icons/default_profile_image.svg",car_type:e.trip_details?.car_type_str??"Unknown",car_type_icon:"/assets/support/vehicles/light/"+(e.trip_details?.car_type_str??"hatchback").toString().toLowerCase()+".webp",trip_type:e.trip_details?.trip_type_str??"Unknown",trip_route:e.trip_details?.trip_type_route_str??"Unknown",trip_type_icon:"/assets/support/"+(e.trip_details?.trip_type_str??"unknown").toString().toLowerCase()+".svg",trip_route_icon:"/assets/support/"+(e.trip_details?.trip_type_route_str??"unknown").toString().toLowerCase()+".svg",trip_status:e.trip_details?.trip_status_str??"Unknown",date:e.booking_details?.book_date_time??"",total_price:e.trip_price?.price!=null?"₹"+e.trip_price.price:"₹0",duration:e.trip_schedule?.dur_display_str??"",driver_rating:Number(e.driver_details?.rating??0),driver_reviews:Number(e.driver_details?.rating_count??0),is_night:Number(e.trip_details?.is_night??0),is_overtime:Number(e.trip_time?.is_overtime??0),map_src:s}}async function t1(e){let t=e.booking_id.toString(),r=ts.current[t];if(r)return r;try{let r=ta.current[t];r||(r=(0,T.Yp)(t),ta.current[t]=r,r.finally(()=>{delete ta.current[t]}));let s=await r;if(!s||!s.booking_details)return tX;let a=t0(s);return ts.current[t]=a,e.id&&e.room&&e.booking_id&&(0,T.TQ)(e.id,e.room,e.booking_id),a}catch(e){return tX}}let t2=e=>{let{content:t,is_mine:r,sender_name:s}=e;return(0,a.jsx)("div",{className:"max-w-sm",children:(0,a.jsxs)("div",{className:"relative bg-white dark:bg-blue-800 rounded-2xl shadow-md border border-slate-100 dar
4k:border-blue-700 overflow-hidden w-[320px]",children:[(0,a.jsxs)("div",{className:"bg-[#16758a] dark:bg-[#09171D] text-white px-4 py-2 rounded-t-2xl flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex-1 text-right",children:[(0,a.jsx)("div",{className:"text-[15px] font-semibold opacity-90",children:r?"You":s??""}),(0,a.jsx)("div",{className:"text-sm leading-relaxed mt-1",children:t})]}),(0,a.jsx)("div",{className:"ml-3 w-8 h-8 rounded-full bg-white/10 flex items-center justify-center flex-shrink-0",children:(0,a.jsxs)("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"#fff",strokeOpacity:"0.2"}),(0,a.jsx)("circle",{cx:"12",cy:"9",r:"1.6",fill:"#fff"}),(0,a.jsx)("rect",{x:"9",y:"13",width:"6",height:"2",rx:"1",fill:"#fff"})]})})]}),(0,a.jsxs)("div",{className:"px-4 py-3 flex items-center gap-2 text-[12px] text-slate-500 dark:text-slate-300 bg-slate-50/60 dark:bg-blue-700/40",children:[(0,a.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0 text-slate-400 dark:text-slate-300",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4M12 16h.01"})]}),(0,a.jsx)("span",{children:"Trip details unavailable for this message."})]})]})})},t6=e=>{let{issue:t,is_mine:r,is_issue:s}=e;return(0,a.jsxs)("div",{className:"max-w-sm mx-auto",children:[(0,a.jsxs)("div",{className:"relative bg-white dark:bg-blue-800 rounded-2xl shadow-md border border-slate-100 dark:border-blue-700 overflow-hidden w-[402px]",children:[(0,a.jsxs)("div",{className:"bg-[#16758a] dark:bg-[#09171D] text-white px-4 py-2 rounded-t-2xl flex items-center justify-between",children:[(0,a.jsxs)("div",{className:`flex-1 ${s?"text-left":"text-right"}`,children:[!s&&(0,a.jsx)("div",{className:"text-[15px] font-semibold opacity-90",children:r?"You":""}),(0,a.jsx)("div",{className:`text-sm leading-relaxed mt-1 ${s?"text-left text-md":""}`,children:t??""}),(0,a.jsxs)("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-white/70",children:[(0,a.jsxs)("svg",{className:"w-3 h-3 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeOpacity:"0.25",strokeWidth:"3"}),(0,a.jsx)("path",{d:"M22 12a10 10 0 0 1-10 10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]}),(0,a.jsx)("span",{children:"Loading trip details…"})]})]}),(0,a.jsx)("div",{className:"ml-3 w-8 h-8 rounded-full bg-white/10 flex items-center justify-center flex-shrink-0",children:(0,a.jsxs)("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"#fff",strokeOpacity:"0.2"}),(0,a.jsx)("circle",{cx:"12",cy:"9",r:"1.6",fill:"#fff"}),(0,a.jsx)("rect",{x:"9",y:"13",width:"6",height:"2",rx:"1",fill:"#fff"})]})})]}),(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsx)("div",{className:"rounded-xl h-36 w-full bg-gradient-to-r from-slate-100 via-slate-200 to-slate-100 dark:from-blue-800 dark:via-blue-700 dark:to-blue-800 animate-pulse"}),(0,a.jsxs)("div",{className:"mt-4 grid grid-cols-3 gap-3 items-start",children:[(0,a.jsxs)("div",{className:"col-span-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"h-5 w-12 bg-slate-200 dark:bg-blue-700 rounded animate-pulse"}),(0,a.jsx)("div",{className:"h-5 w-20 bg-slate-300 dark:bg-blue-600 rounded animate-pulse [animation-delay:80ms]"})]}),(0,a.jsx)("div",{className:"mt-2 h-3 w-44 bg-slate-200 dark:bg-blue-700 rounded animate-pulse [animation-delay:120ms]"}),(0,a.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[(0,a.jsx)("div",{className:"h-6 w-24 bg-slate-200 dark:bg-blue-700 rounded-full animate-pulse [animation-delay:200ms]"}),(0,a.jsx)("div",{className:"w-8 h-8 rounded-full bg-slate-200 dark:bg-blue-700 shadow-sm animate-pulse [animation-delay:260ms]"}),(0,a.jsx)("div",{className:"w-8 h-8 rounded-full bg-slate-200 dark:bg-blue-700 shadow-sm animate-pulse [animation-delay:320ms]"})]}),(0,a.jsxs)("div",{className:"mt-3 flex items-center gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-14 h-14 roun
4ded-xl bg-white dark:bg-blue-700 shadow-sm flex items-center justify-center animate-pulse [animation-delay:360ms]",children:(0,a.jsx)("div",{className:"w-7 h-7 rounded-md bg-slate-300 dark:bg-blue-600"})}),(0,a.jsx)("div",{className:"h-3 w-10 bg-slate-200 dark:bg-blue-700 rounded animate-pulse [animation-delay:380ms]"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"w-12 h-12 rounded-xl bg-white dark:bg-blue-700 shadow-sm flex items-center justify-center animate-pulse [animation-delay:420ms]",children:(0,a.jsx)("div",{className:"w-6 h-6 rounded-md bg-slate-300 dark:bg-blue-600"})}),(0,a.jsx)("div",{className:"h-3 w-8 bg-slate-200 dark:bg-blue-700 rounded animate-pulse [animation-delay:440ms]"})]})]})]}),(0,a.jsx)("div",{className:"col-span-1 flex flex-col items-center",children:(0,a.jsx)("div",{className:"w-16 h-16 rounded-xl bg-white dark:bg-blue-700 shadow-sm flex items-center justify-center animate-pulse [animation-delay:300ms]",children:(0,a.jsx)("div",{className:"w-9 h-9 rounded-md bg-slate-300 dark:bg-blue-600"})})})]}),(0,a.jsxs)("div",{className:"mt-4 border-t border-slate-200 dark:border-blue-700 pt-3 flex items-center gap-3",children:[(0,a.jsx)("div",{className:"w-12 h-12 rounded-full bg-slate-200 dark:bg-blue-700 animate-pulse [animation-delay:500ms]"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("div",{className:"h-4 w-28 bg-slate-200 dark:bg-blue-700 rounded animate-pulse [animation-delay:560ms]"}),(0,a.jsxs)("div",{className:"mt-2 flex items-center gap-1",children:[[0,1,2,3,4].map(e=>(0,a.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",className:"text-slate-200 dark:text-blue-700",children:(0,a.jsx)("path",{d:"M12 .587l3.668 7.568 8.332 1.151-6.064 5.787 1.48 8.257L12 18.896l-7.416 4.454 1.48-8.257L0 9.306l8.332-1.151z",fill:"currentColor"})},e)),(0,a.jsx)("div",{className:"ml-1 h-3 w-20 bg-slate-200 dark:bg-blue-700 rounded animate-pulse [animation-delay:620ms]"})]})]})]})]})]}),(0,a.jsx)("div",{className:"text-[11px] mt-1 flex gap-1 items-center justify-end",children:(0,a.jsx)("div",{className:"h-3 w-10 bg-slate-200 dark:bg-blue-700 rounded animate-pulse [animation-delay:680ms]"})})]})},t3=e=>{let{m:t,issue:r}=e,s=null!=t.booking_id?t.booking_id.toString():"",i=(()=>{if(!t.trip_snapshot)return null;try{return t0(JSON.parse(t.trip_snapshot))}catch{return null}})(),n=(s?ts.current[s]:null)??i,[o,d]=(0,l.useState)(n??tX),[c,u]=(0,l.useState)(!n),[m,p]=(0,l.useState)(null),f="me"===t.sender_id||null!=B&&String(t.sender_id)===B,h=N.findIndex(e=>e.id===t.id),g=f&&0!==t.status&&rn>=0&&h>=0&&h<=rn?2:t.status;return(0,l.useEffect)(()=>{if(s&&(ts.current[s]||i))return;let e=!0;return(async()=>{try{u(!0),p(null);let r=await t1(t);if(!e)return;d(r??tX)}catch(t){if(!e)return;p("Failed to load trip details"),d(tX)}finally{if(!e)return;u(!1)}})(),()=>{e=!1}},[s]),(0,a.jsxs)(a.Fragment,{children:[c&&(()=>{let e="issue_selected"===t.message_type||"driver_issue_selected"===t.message_type;return(0,a.jsx)(t6,{issue:r,is_mine:f,is_issue:e})})(),!c&&(0,a.jsx)(Q,{mapSrc:o.map_src,avatarSrc:o.driver_image,total:o.total_price,date:o.date,tripId:o.booking_id,status:o.trip_status,car_type:o.car_type,car_type_icon:o.car_type_icon,trip_type:o.trip_type,trip_type_icon:o.trip_type_icon,trip_route:o.trip_route,trip_route_icon:o.trip_route_icon,duration:o.duration,driverName:o.driver_name,is_night:o.is_night??0,is_overtime:o.is_overtime??0,driverRating:o.driver_rating??0,driverReviews:o.driver_reviews??"",content:r,is_mine:f,message_status:Number(g),message_type:t.message_type,sender_name:t.sender_name})]})},t4=e=>{let t=e.content??"",r=!ri(t)&&t.length>rs,s=!!F[e.id],l=r&&!s?t.slice(0,rs):t,i="trip_selected"===e.message_type?((e,t)=>{let r=t&&"object"==typeof t?t:null;if(r&&(r.booking_code||r.booking_id)){let e=e=>null==e||"null"===e?void 0:String(e);return{booking_code:e(r.booking_code),date:e(r.date),status:e(r.status),booking_id:r.booking_id??void 0}}if(!e)return null;try{let t=e.match(/#([^,\s]+)/),r=e.match(/date=([^,]+)/),s=e.match(/status=([^,]+)/),a=e=>e&&"null"!==e&&"undefined"!==e?e:void 0;return{booking_code:a(t?.[1]),date:a(r?.[1]),status:a(s?.[1])}}catch(e){return null}})(t,e.metadata):null,n="selected_past_trip"===e.message_type?t:null;if(n&&e.booking_id)return(0,a.jsx)(t3,{m:e,issue:n});if(n)return(0,a.jsx)(t2,{content:t,is_mine:rl(e),sender_name:e.sender_name});if(i&&i.booking_code)return(0,a.jsxs)("div",{"aria-label":`Open trip ${i.booking_id}`,className:"   w-full flex items-center justify-between   py-3 px-2   bg-white dark:bg-navy-700   text-left rounded   hover:bg-gray-50   dark:hover:bg-navy-600   focus:outline-none   ",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("div",{className:"text-sm flex items-center gap-2",children:[(0,a.jsx)("img",{src:"/assets/support/calendar.svg",className:"block dark:hidden",alt:"calendar"}),(0,a.jsx)("img",{src:"/assets/support/calendar_dark.svg",className:"hidden dark:block",alt:"calendar"}),(0,a.jsxs)("span",{className:"mr-3 text-[#6b7280] dark:text-white",children:["Date: ",i.date?new Date(i.date).toLocaleDateString("en-GB"):""," "]})]}),(0,a.jsxs)("div",{className:"text-xs text-[#6b7280] dark:text-white mt-1",children:["Booking ID: #",i.booking_code]})]}),(0,a.jsx)("div",{children:(0,a.jsx)("span",{className:`text-[12px] inline-block px-3 py-1 rounded-full border ${"Completed"===i.status?"text-[#1FA863] border-[#1FA863] bg-white dark:bg-[#183B49]":"Cancelled"===i.status?"text-[#ff5a5f] border-[#ffdede] bg-white":"text-[#667085] border-[#e6edf2] bg-white"}`,children:i.status})})]});let o="issue_selected"===e.message_type||"driver_issue_selected"===e.message_type?t:null;return o?(0,a.jsx)("div",{className:"w-full flex items-center justify-between py-3 px-2 bg-white dark:bg-navy-700 text-left hover:bg-gray-50  dark:hover:bg-navy-600 focus:outline-none rounded",children:(0,a.jsx)("div",{className:"flex flex-col",children:(0,a.jsx)("div",{className:"text-sm flex items-center gap-2",children:(0,a.jsx)("span",{className:"text-[14px] text-black dark:text-white",children:o})})})}):(0,a.jsxs)(a.Fragment,{children:[l,r&&(0,a.jsx)("button",{onClick:()=>ra(e.id),className:`bg-transparent border-none font-semibold cursor-pointer p-0 text-[13px] ${rl(e)?"text-[rgba(255,255,255,0.9)]":"text-[#0b69ff]"}`,children:s?" ... show less":"... read more"})]})},t5=()=>{for(let e=N.length-1;e>=0;e--){let t=N[e];if("trip_selected"===t.message_type&&t.booking_id)return t.booking_id}return null},t9=e=>{eZ.current;let t=eF||t5(),r={room:eY.current,sender_name:O||"Anonymous",sender_id:B,client_uuid:eQ.current,content:e,booking_id:t,message_type:"issue_selected",type:"issue_selected",lat:eq.current?.lat??void 0,lng:eq.current?.lng??void 0,address:eq.current?.address??void 0,region:eq.current?.region??void 0},s=`temp-${r.client_uuid}-${Date.now()}`;L(e=>[...e,{id:s,client_uuid:r.client_uuid,sender_id:"me",sender_name:r.sender_name,room:r.room,content:r.content,message_type:"issue_selected",booking_id:r.booking_id,status:3,created_at:new Date().toISOString()}]),tj(r,s),eC(!1),eS(!1)},t8=e=>new Date(e.replace(" ","T")+"+05:30"),t7=i&&(()=>{let e=null;if(v)e=t8(v);else if(w&&_){let[t,r,s]=w.split("/");e=t8(`${s}-${r}-${t} ${_}`)}return!(!e||isNaN(e.getTime()))&&Date.now()>e.getTime()})(),re=(()=>
4{if(!t7)return"";let e=null;if(v)e=t8(v);else if(w&&_){let[t,r,s]=w.split("/");e=t8(`${s}-${r}-${t} ${_}`)}if(!e)return"Trip was completed";let t=e.toLocaleDateString("en-IN",{day:"numeric",month:"long",timeZone:"Asia/Kolkata"}),r=e.toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit",timeZone:"Asia/Kolkata"});return`Trip was completed on ${t} at ${r}`})(),rt=(()=>{if(0===N.length)return!1;for(let e=N.length-1;e>=0&&"system_resolved"!==(N[e]?.message_type??N[e]?.type);e--){let t=N[e]?.sender_id;if(t&&"system"!==t&&"bot"!==t)return!0}return!1})(),rr=e=>{eZ.current;let t=eF||t5(),r={room:eY.current,sender_name:O||"Anonymous",sender_id:B,client_uuid:eQ.current,booking_id:t,content:e,type:"issue_selected",lat:eq.current?.lat??void 0,lng:eq.current?.lng??void 0,address:eq.current?.address??void 0,region:eq.current?.region??void 0},s=`temp-${r.client_uuid}-${Date.now()}`;L(e=>[...e,{id:s,client_uuid:r.client_uuid,sender_id:"me",sender_name:r.sender_name,room:r.room,content:r.content,message_type:"issue_selected",booking_id:r.booking_id,status:3,created_at:new Date().toISOString()}]),tj(r,s),eM(!1),eC(!1),eS(!1)},rs=500,ra=e=>E(t=>({...t,[e]:!t[e]})),rl=e=>"me"===e.sender_id||null!=B&&String(e.sender_id)===B,ri=e=>{if(!e)return!1;try{if(e.startsWith("data:image/"))return!0;return/\.(jpeg|jpg|png|gif|webp|avif|svg)$/i.test(e)}catch{return!1}},rn=(0,l.useMemo)(()=>{let e=-1,t=-1;for(let r=N.length-1;r>=0;r--){let s=N[r];if(rl(s)?-1===e&&2===s.status&&(e=r):-1===t&&(t=r),-1!==e&&-1!==t)break}return Math.max(e,t)},[N,B]),ro=e=>e4(e),rd=()=>e4(null);(0,l.useEffect)(()=>{if(e3){let e=document.body.style.overflow;document.body.style.overflow="hidden";let t=e=>{"Escape"===e.key&&rd()};return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t),document.body.style.overflow=e}}},[e3]);let rc=(0,l.useRef)(""),[ru,rm]=(0,l.useState)(null);(0,l.useEffect)(()=>{(async()=>{try{if(!eH||!O||eH?.lat===0||eH?.lng===0)return;let e=`${eH.lat}-${eH.lng}`;if(e===rc.current)return;let t=eH.lat,s=eH.lng,a=localStorage.getItem("persist:root"),l=a?JSON.parse(a):null,i=l?.auth?JSON.parse(l.auth):null,n=i?.user?.id??null;rc.current=e;let{STATIC_MAP_API_KEY:o}=await r.e(9595).then(r.bind(r,49595)),d=eH.label||"Location",{day:c,dark:u,dayUrl:m,darkUrl:p}=await H({lat:eH.lat,lng:eH.lng,locationLabel:d,apiKey:o}),f=new File([c],`map_light_${eH.lat}_${eH.lng}.png`,{type:"image/png"}),h=new File([u],`map_dark_${eH.lat}_${eH.lng}.png`,{type:"image/png"});m&&URL.revokeObjectURL(m),p&&URL.revokeObjectURL(p);let g=await (0,T.jb)([f,h],`${n??"anonymous"}/`,"location"),x=g?.data?.files??g?.files;if(!g||1!==g.success||!x)throw Error("Location upload failed");let b=x.map(e=>e.public_url).filter(Boolean),y={room:eY.current,sender_name:O,sender_id:n,client_uuid:eQ.current,type:"location",content:`📍 ${d}`,address:d,lat:t,lng:s,location_url:b[0]??null,location_url_dark:b[1]??null,file_names:x.map(e=>e.filename),file_types:["image/png","image/png"],is_file:!0},v=`temp-loc-${y.client_uuid}-${Date.now()}`;L(e=>[...e,{id:v,client_uuid:y.client_uuid,sender_id:"me",sender_name:O,room:y.room,content:y.content,message_type:"location",lat:t,lng:s,address:d,location_url:b[0]??null,location_url_dark:b[1]??null,status:3,created_at:new Date().toISOString()}]),tj(y,v),e_((0,S.Ol)(!1)),e_((0,S.Og)({lat:0,lng:0,label:""}))}catch(e){alert(`Failed to send location. ${e?.message??e}`),e_((0,S.Ol)(!1)),e_((0,S.Og)({lat:0,lng:0,label:""}))}})()},[eH?.lat,eH?.lng,eH?.label,O]),(0,l.useEffect)(()=>{(async()=>{ru&&(ru.sender_name=O,(0,T.gu)(ru),rm(null))})()},[eJ,O,ru]);let rp=async e=>{let{default:t}=await r.e(2564).then(r.bind(r,2564));return new Promise(r=>{let s=document.createElement("div"),a=t.create({container:s,normalize:!1,interact:!1,height:1}),l=setTimeout(()=>r([]),5e3);a.loadBlob(e),a.on("ready",()=>{clearTimeout(l),r(a.exportPeaks({channels:1,maxLength:100})[0]??[]);try{a.destroy()}catch{}})})},rf=async()=>{try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});if(tL(!0),tI(0),await new Promise(e=>setTimeout(e,100)),eP.current){try{eP.current.destroy()}catch{}eP.current=null}if(!document.getElementById("live-waveform"))throw Error("Waveform container not found");let{default:t}=await r.e(2564).then(r.bind(r,2564)),{default:s}=await r.e(6274).then(r.bind(r,16274)),a=t.create({container:"#live-waveform",waveColor:"#0099ff",progressColor:"#0055a
4a",barWidth:3,barGap:2,barRadius:2,height:40}),l=a.registerPlugin(s.create({scrollingWaveform:!0,renderRecordedAudio:!1}));eP.current=a,l.startRecording({deviceId:e.getAudioTracks()[0].getSettings().deviceId});let i=new MediaRecorder(e,{mimeType:"audio/webm"}),n=[];i.ondataavailable=e=>{e.data.size>0&&n.push(e.data)},i.onstop=async()=>{let t=new Blob(n,{type:"audio/webm"});tw(t),e.getTracks().forEach(e=>e.stop()),l&&l.stopRecording()},i.start(),tF(i),tE.current=i,tO.current=Date.now(),tU.current=setInterval(()=>{let e=Math.floor((Date.now()-tO.current)/1e3);tI(e),e>=180&&rh()},1e3)}catch(e){tL(!1),k("Unable to access microphone. Please check permissions.","error")}},rh=()=>{let e=tE.current;if(e&&"recording"===e.state){if(e.stop(),tL(!1),tE.current=null,eP.current){try{eP.current.destroy()}catch{}eP.current=null}tU.current&&(clearInterval(tU.current),tU.current=null)}},rg=async()=>{try{tq(!1);let e=await navigator.mediaDevices.getUserMedia({audio:!0});if(tL(!0),await new Promise(e=>setTimeout(e,100)),eP.current){try{eP.current.destroy()}catch{}eP.current=null}if(!document.getElementById("live-waveform"))throw Error("Waveform container not found");let{default:t}=await r.e(2564).then(r.bind(r,2564)),{default:s}=await r.e(6274).then(r.bind(r,16274)),a=t.create({container:"#live-waveform",waveColor:"#0099ff",progressColor:"#0055aa",barWidth:3,barGap:2,barRadius:2,height:40}),l=a.registerPlugin(s.create({scrollingWaveform:!0,renderRecordedAudio:!1}));eP.current=a,l.startRecording({deviceId:e.getAudioTracks()[0].getSettings().deviceId});let i=new MediaRecorder(e,{mimeType:"audio/webm"}),n=[];tR&&n.push(tR),i.ondataavailable=e=>{e.data.size>0&&n.push(e.data)},i.onstop=()=>{let t=new Blob(n,{type:"audio/webm"});tw(t),e.getTracks().forEach(e=>e.stop()),l&&l.stopRecording()},i.start(),tF(i),tE.current=i,tO.current=Date.now()-1e3*tB,tU.current=setInterval(()=>{let e=Math.floor((Date.now()-tO.current)/1e3);tI(e),e>=180&&rh()},1e3)}catch(e){tL(!1),k("Unable to access microphone. Please check permissions.","error")}},rx=async e=>{let t=((e,t)=>{if(e.size>0xa00000)return{ok:!1,reason:`Voice note too large (max ${el(0xa00000)})`};if("number"==typeof t&&t>180)return{ok:!1,reason:"Voice note too long (max 180 seconds)"};let r=(e.type||"").toLowerCase();return r&&!ea.includes(r)?{ok:!1,reason:`Audio type not allowed (${r||"unknown"})`}:{ok:!0}})(e,tB);if(!t.ok)throw k(t.reason,"error"),Error(t.reason);let r=new File([e],`audio_${Date.now()}.webm`,{type:"audio/webm"});try{return await (0,T.jb)([r],`${B}/`,"audio")}catch(e){throw e}},rb=async()=>{if(t$&&tM&&"recording"===tM.state)return new Promise(e=>{let t=[];tR&&t.push(tR),tM.ondataavailable=e=>{e.data.size>0&&t.push(e.data)},tM.onstop=async r=>{let s=new Blob(t,{type:"audio/webm"}),a=await rp(s);await ry(s,tB,a),e()},tM.stop(),tL(!1),tU.current&&(clearInterval(tU.current),tU.current=null)});tR&&O&&await ry(tR,tB)},ry=async(e,t,r)=>{if(!e||!O)return;let s=eQ.current,a=`temp-audio-${s}-${Date.now()}`,l=eY.current,i=URL.createObjectURL(e);L(e=>[...e,{id:a,client_uuid:s,sender_id:"me",message_type:"audio",sender_name:O,room:l,content:`🎵 Audio message (${t}s)`,audio_url:i,audio_duration:t,audio_waveform:r?JSON.stringify(r):void 0,status:3,created_at:new Date().toISOString()}]);
4try{let i=await rx(e),n=i?.data?.files?.[0]?.public_url??i?.files?.[0]?.public_url;if(!n)throw Error("No audio URL returned");let o={room:l,sender_name:O,sender_id:B,client_uuid:s,content:`🎵 Audio message (${t}s)`,type:"audio",audio_url:n,audio_duration:t,audio_waveform:JSON.stringify(r),file_type:"audio/webm",lat:eq.current?.lat??void 0,lng:eq.current?.lng??void 0,address:eq.current?.address??void 0,region:eq.current?.region??void 0};tj(o,a)}catch(e){URL.revokeObjectURL(i),L(e=>e.map(e=>e.id===a?{...e,status:-1}:e))}if(tA(null),tI(0),tL(!1),tq(!1),tz.current&&(tz.current.pause(),tz.current=null),tV&&(URL.revokeObjectURL(tV),tW(null)),tP.current){let e=tP.current.getContext("2d");e&&e.clearRect(0,0,tP.current.width,tP.current.height)}tU.current&&(clearInterval(tU.current),tU.current=null),ez.current&&(cancelAnimationFrame(ez.current),ez.current=null),eB&&(eB.close(),eI(null),eO(null))},rv=async(e,t,r)=>{let s=N.filter(e=>"system_resolved"===e.message_type).length,a=`${eY.current}_${s+1}`,l=tZ||localStorage.getItem("admin_id"),i=await (0,T.ai)(e,eY.current,a,eG.current,l,t,r);try{1===i.success?(k(i.user_message||i.message,"success"),e$(!1),eR(!0)):k(i.message||"Failed to submit rating. Please try again.","error")}catch(e){k("Something went wrong. Please try again.","error")}};return(0,a.jsxs)("div",{ref:eX,className:" flex-1 flex flex-col shadow-[0_10px_30px_rgba(0,0,0,0.15)] rounded-xl overflow-hidden bg-[#102731]",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-navy-400 bg-white dark:bg-[#102731]",children:[(0,a.jsxs)("div",{className:"flex items-center bg-white dark:bg-[#102731]",children:[(s||i||y)&&(0,a.jsx)("button",{onClick:()=>{if(y)return void y();s&&e_((0,S.V6)(!1)),i&&e_((0,S.kJ)(!1))},className:"mr-4 text-gray-600 dark:text-[#eef2f3] hover:text-gray-800 dark:hover:text-[#9aa4a3] focus:outline-none",children:(0,a.jsx)(d.A,{size:24})}),(0,a.jsx)("div",{className:"w-11 h-11 rounded-full bg-[#dfeff6] flex items-center justify-center font-bold text-[#024]",children:(0,a.jsx)("img",{src:"/d4m_favicon.png",alt:"Bot Avatar",className:"w-full h-full object-cover"})}),(0,a.jsxs)("div",{className:"ml-3",children:[(0,a.jsx)("div",{className:"font-bold text-black dark:text-[#eef2f3]",children:i?j:"Customer Support"}),!i&&(0,a.jsx)("div",{className:"text-xs text-black dark:text-[#9aa4a3]",children:tG||"Drivers4me"})]})]}),rt&&!i&&(0,a.jsxs)("button",{onClick:()=>{eZ.current;let e={room:eY.current,sender_name:O||"Anonymous",sender_id:B,client_uuid:eQ.current,content:"Issue resolved. The conversation has been closed.",type:"system_resolved",lat:eq.current?.lat??void 0,lng:eq.current?.lng??void 0,address:eq.current?.address??void 0,region:eq.current?.region??void 0},t=`temp-${e.client_uuid}-${Date.now()}`;L(r=>[...r,{id:t,client_uuid:e.client_uuid,sender_id:"me",sender_name:e.sender_name,room:e.room,content:e.content,message_type:"system_resolved",status:3,created_at:new Date().toISOString()}]),tj(e,t),tZ&&(eR(!1),e$(!0))},className:"   flex items-center gap-3   px-4 py-2   rounded-full   bg-[#EAECF0] dark:bg-[#183B49]   text-black dark:text-white   shadow-sm   hover:shadow-md   hover:scale-[1.02]   active:scale-[0.98]   transition-all duration-200   ",children:[(0,a.jsx)(q,{className:"w-4 h-4 block dark:hidden"}),(0,a.jsx)(Z,{className:"w-4 h-4 hidden dark:block"}),(0,a.jsx)("p",{className:"text-sm font-medium",children:"End chat"})]})]}),(0,a.jsx)("div",{ref:e0,className:"flex-1 overflow-y-auto p-6 bg-white dark:bg-[#102731] scrollbar-hide",id:"chat-messages-container",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center gap-3 pt-4 pb-6",children:[(0,a.jsx)("img",{alt:"Bot Avatar",className:"w-10 h-10 object-cover",src:"/d4m_favicon.png"}),(0,a.jsxs)("p",{className:"text-center text-[13px] text-[#667085] dark:text-[#7a9aaa] leading-6 whitespace-nowrap",children:["Your support conversations are secured and kept confidential.",(0,a.jsx)("br",{}),"Only authorized Drivers4Me staff and you can read them."]})]}),Y?(0,a.jsx)("div",{className:"flex justify-center py-8",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 text-gray-500",children:[(0,a.jsx)("div",{className:"w-4 h-4 border-2 border-gray-300 border-t-blue-500 rounded-full animate-spin"}),(0,a.jsx)("span",{className:"text-sm",children:"Loading chat history..."})]})}):(0,a.jsxs)(a.Fragment,{children:["spinner"===ef&&(0,a.jsx)("div",{className:"flex justify-center py-3",children:(0,a.jsx)("div",{className:"w-3 h-3 border-2 border-gray-300 dark:border-gray-600 border-t-[#2F7592] rounded-full animate-spin"})}),"skeleton"===ef&&(0,a.jsxs)("div",{className:"flex flex-col gap-3 pb-2",children:[(0,a.jsxs)("div",{className:"flex justify-start pr-10",children:[(0,a.jsx)("div",{className:"w-8 h-8 rounded-full bg-[#D0D5DD] dark:bg-[#1f3d4a] animate-pulse flex-shrink-0 mr-2 mt-1"}),(0,a.jsxs)("div",{className:"rounded-[14px] px-3 pt-2.5 pb-3 bg-[#EAECF0] dark:bg-[#09171D] shadow-[0_4px_10px_rgba(15,23,42,0.06)]",children:[(0,a.jsx)("div",{className:"h-2 w-10 rounded-full bg-[#C1C7D0] dark:bg-[#2a4d5c] animate-pulse mb-2.5"}),(0,a.jsx)("div",{className:"h-2 w-40 rounded-full bg-[#D0D5DD] dark:bg-[#1a3641] animate-pulse [animation-delay:100ms] mb-1.5"}),(0,a.jsx)("div",{className:"h-2 w-28 rounded-full bg-[#D0D5DD] dark:bg-[#1a3641] animate-pulse [animation-delay:180ms]"})]})]}),(0,a.jsx)("div",{className:"flex justify-end pl-10",children:(0,a.jsxs)("div",{className:"rounded-[14px] px-3 pt-2.5 pb-3 bg-[#2F7592] shadow-[0_4px_10px_rgba(15,23,42,0.06)]",children:[(0,a.jsx)("div",{className:"h-2 w-11 rounded-full bg-[#1d4f62] animate-pulse [animation-delay:60ms] mb-2.5"}),(0,a.jsx)("div",{className:"h-2 w-44 rounded-full bg-[#1e5b72] animate-pulse [animation-delay:160m
4s] mb-1.5"}),(0,a.jsx)("div",{className:"h-2 w-32 rounded-full bg-[#1e5b72] animate-pulse [animation-delay:240ms]"})]})}),(0,a.jsxs)("div",{className:"flex justify-start pr-10",children:[(0,a.jsx)("div",{className:"w-8 h-8 rounded-full bg-[#D0D5DD] dark:bg-[#1f3d4a] animate-pulse [animation-delay:100ms] flex-shrink-0 mr-2 mt-1"}),(0,a.jsxs)("div",{className:"rounded-[14px] px-3 pt-2.5 pb-3 bg-[#EAECF0] dark:bg-[#09171D] shadow-[0_4px_10px_rgba(15,23,42,0.06)]",children:[(0,a.jsx)("div",{className:"h-2 w-10 rounded-full bg-[#C1C7D0] dark:bg-[#2a4d5c] animate-pulse [animation-delay:180ms] mb-2.5"}),(0,a.jsx)("div",{className:"h-2 w-36 rounded-full bg-[#D0D5DD] dark:bg-[#1a3641] animate-pulse [animation-delay:260ms]"})]})]})]}),(()=>{let{hasTripSelected:e,hasIssueSelected:r}=tc(N),n=null;return N.map((o,d)=>{let c=rl(o),p="system"===o.sender_id||"system_resolved"===o.message_type||"ticket_assigned"===o.message_type||"ticket_transferred"===o.message_type||"ticket_started"===o.message_type,f="bot"===o.sender_id,h=f&&o.id===ed.id,g=f&&o.id===ec,x="selected_past_trip"===o.message_type,b=i&&f&&N.slice(d+1).some(e=>"system"!==e.sender_id&&"system_resolved"!==e.message_type&&"ticket_assigned"!==e.message_type&&"ticket_transferred"!==e.message_type&&"ticket_started"!==e.message_type),y=t7||b,v=(e,t)=>(0,a.jsxs)("div",{className:"flex items-start",children:[(0,a.jsx)("div",{className:"w-8 h-8 rounded-full overflow-hidden flex-shrink-0 mr-2 mt-1",children:(0,a.jsx)("img",{src:"/assets/icons/d4m_bot.svg",alt:"Bot Avatar",className:"w-full h-full object-cover"})}),(0,a.jsx)("div",{className:"max-w-[70%]",children:(0,a.jsxs)("div",{className:"rounded-[14px] px-[14px] py-3 shadow-[0_4px_10px_rgba(15,23,42,0.06)] break-words bg-[#e6f7ff] text-[#0b2e2b] dark:text-white dark:bg-[#09171D]",children:[(0,a.jsx)("div",{className:"text-[13px] font-bold mb-1.5",children:t}),(0,a.jsxs)("div",{className:"mt-3 bg-white rounded-md border border-[#e6edf2] dark:bg-[#183B49] overflow-hidden",children:[e.map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>!y&&rr(e),disabled:y,className:`w-full text-left py-2 px-3 text-sm border-b last:border-b-0 border-[#f0f0f0] dark:bg-[#183B49] ${y?"opacity-50 cursor-not-allowed":"hover:bg-gray-50 dark:hover:bg-[#1E4A5C]"}`,children:e},e)),(0,a.jsx)("div",{className:"text-center py-2",children:(0,a.jsx)("button",{className:`text-sm font-semibold bg-transparent border-none ${y?"text-gray-400 cursor-not-allowed opacity-50":"text-[#0b69ff]"}`,onClick:()=>!y&&rr("Other trip issue"),disabled:y,children:"Other trip issue"})})]})]})})]},o.id);if(f&&s&&eA)return v(["I want to edit trip details","Change drop off location","Report driver conduct","Trip started late","Vehicle damaged"],"Please select the issue with booking");if(f&&i&&eA)return v(["Are you on your way?","I have arrived at the pickup spot","Please call me","My car is in different location than pickup spot","Can you please arrive early?"],"Driver Assistant");if(f&&eV&&eA&&!t)return v(["Difficulty booking trip","Report issue with app","Trip cancelled unexcpected","Driver allocation taking too long"],"Please select the issue you are facing");if(f&&!t||h&&Y)return null;let w=(e=>{if(!e)return null;let t=String(e).trim();if(!t)return null;let r=Date.parse(t.includes("T")?t:t.replace(" ","T"));return Number.isNaN(r)?null:r})(o.created_at),_=null;if(w){let e=new Date(w).toDateString();e!==n&&(_=(0,a.jsx)("div",{className:"flex items-center justify-center my-3",children:(0,a.jsx)("span",{className:"px-3 py-1 text-xs text-[#6b7280] bg-[#F2F4F7] dark:bg-[#183B49] rounded-full",children:(e=>{let t=new Date(e),r=new Date,s=new Date(r);return(s.setDate(s.getDate()-1),t.toDateString()===r.toDateString())?"Today":t.toDateString()===s.toDateString()?"Yesterday":t.toLocaleDateString("en-IN",{day:"numeric",month:"long"})})(w)})}),n=e)}let j=o.content??"",k=!ri(j)&&j.length>
4rs,C=!!F[o.id],T=k&&!C?j.slice(0,rs):j;if(p)return(0,a.jsxs)(l.Fragment,{children:[_,(0,a.jsxs)("div",{className:"flex flex-col p-3 items-center gap-2 bg-[#F2F4F7] dark:bg-[#183B49] rounded-xl",children:[(0,a.jsx)("div",{className:"w-10 h-10 rounded-full border-2 border-green-400 overflow-hidden flex-shrink-0",children:(0,a.jsx)("img",{src:o.sender_profile_pic||"/default_profile_image.svg",alt:o.sender_name?`${o.sender_name} Avatar`:"D4M Support",className:"w-full h-full object-cover",onError:e=>{let t=e.currentTarget;-1===t.src.indexOf("/default_profile_image.svg")&&(t.src="/default_profile_image.svg")}})}),(0,a.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,a.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full bg-green-100",children:(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-4 h-4 text-green-600",viewBox:"0 0 20 20",fill:"currentColor",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.707a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 10-1.414 1.414L9 13.414l4.707-4.707z",clipRule:"evenodd"})})}),(0,a.jsx)("div",{className:"flex flex-col",children:(0,a.jsx)("div",{className:"text-xs text-black dark:text-[#D0D5DD] italic",children:T})})]})]})]},o.id);let D=0===o.status?0:rl(o)&&rn>=0&&d<=rn?2:o.status,$=null;return c&&(3===D?$=(0,a.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:"fill-[#667085] dark:fill-[#E6F0F6]",children:(0,a.jsx)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"})}):1===D?$=(0,a.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:"fill-[#667085] dark:fill-[#DCEAF2]",children:[(0,a.jsx)("path",{d:"M1.5 13.5l4.5 4.5 12-12-1.5-1.5-10.5 10.5-3-3z"}),(0,a.jsx)("path",{d:"M6 13.5l4.5 4.5 12-12-1.5-1.5-10.5 10.5-3-3z"})]}):2===D?$=(0,a.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:"fill-[#34B7F1] dark:fill-[#34B7F1]",children:[(0,a.jsx)("path",{d:"M1.5 13.5l4.5 4.5 12-12-1.5-1.5-10.5 10.5-3-3z"}),(0,a.jsx)("path",{d:"M6 13.5l4.5 4.5 12-12-1.5-1.5-10.5 10.5-3-3z"})]}):0===D&&($=(0,a.jsx)("span",{className:"text-xs text-red-400 dark:text-red-300",children:"Failed"}))),(0,a.jsxs)(l.Fragment,{children:[_,(0,a.jsxs)("div",{"data-id":o.id,ref:e=>{e?tl.current.set(o.id,e):tl.current.delete(o.id)},className:`flex ${c?"justify-end pl-10":"justify-start pr-10"} mb-3`,children:[!c&&!p&&(0,a.jsxs)("div",{className:"relative w-8 h-8 flex-shrink-0 mr-2 mt-1",children:[(0,a.jsx)("div",{className:"w-8 h-8 rounded-full overflow-hidden",children:(0,a.jsx)("img",{src:f?"/assets/icons/d4m_bot.svg":o.sender_profile_pic||"/handsome-happy-bearded-man.jpg",alt:`${o.sender_name} Avatar`,className:"w-full h-full object-cover",onError:e=>{let t=e.currentTarget;-1===t.src.indexOf("/handsome-happy-bearded-man.jpg")&&(t.src="/handsome-happy-bearded-man.jpg")}})}),!f&&(0,a.jsx)("div",{className:`absolute -bottom-0.5 -right-0.5
5                w-2.5 h-2.5 rounded-full
6                border-2 border-white dark:border-gray-800
7                ${"online"===W[String(o.sender_id)]?"bg-green-500":"bg-white dark:bg-gray-400"}`})]}),x&&(0,a.jsxs)("div",{children:[" ",t4(o)]}),(0,a.jsxs)("div",{className:"max-w-[70%]",children:[!x&&(0,a.jsxs)("div",{className:`rounded-[14px] px-[10px] ${"audio"===o.message_type?"pt-2":"py-2"} shadow-[0_4px_10px_rgba(15,23,42,0.06)] break-words text-[14px] leading-[1.35] ${c?"bg-[#2F7592] text-white":"bg-[#EAECF0] dark:bg-[#09171D] text-[#000000] dark:text-[#FFFFFF]"}`,children:[(0,a.jsx)("div",{className:"text-[10px] font-bold mb-1.5",children:c?"You":String(o.sender_name)}),h&&!Y?(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-[14px]",children:e?"A trip has been selected.":eV&&t?(0,a.jsxs)(a.Fragment,{children:["Hi ",O?.split(" ")[0]??"there",", how can we help you today?"]}):(0,a.jsxs)(a.Fragment,{children:["Hi ",O?.split(" ")[0]??"there",", Please select the trip for which you seek help."]})}),!eV&&eN&&(0,a.jsxs)("div",{className:"mt-3 bg-white dark:bg-[#183B49] rounded-md border border-[#e6edf2] overflow-hidden",children:[ej.length>0?(0,a.jsx)("div",{className:"flex flex-col divide-y",children:ej.map((e,t)=>(0,a.jsxs)("button",{type:"button",onClick:()=>(e=>{e_((0,S.Jx)(Number(e.booking_id)));let t={room:eY.current,sender_id:B,booking_id:e.booking_id,sender_name:O||"Anonymous",client_uuid:eQ.current,content:e.booking_code?`🚗 Booking Details shared #${e.booking_code}`:"\uD83D\uDE97 Booking Details Shared",metadata_booking_code:e.booking_code??void 0,metadata_date:e.date??void 0,metadata_status:e.status??void 0,metadata_booking_id:e.booking_id??void 0,type:"trip_selected",lat:eq.current?.lat??void 0,lng:eq.current?.lng??void 0,address:eq.current?.address??void 0,region:eq.current?.region??void 0},r=`temp-${t.client_uuid}-${Date.now()}`;L(s=>[...s,{id:r,client_uuid:t.client_uuid,sender_id:"me",sender_name:t.sender_name,room:t.room,content:t.content,message_type:"trip_selected",booking_id:e.booking_id,metadata:t.metadata,status:3,created_at:new Date().toISOString()}]),tj(t,r),eC(!1)})(e),"aria-label":`Open trip ${e.booking_id}`,className:"w-full flex items-center justify-between py-3 px-2 text-left hover:bg-gray-50 dark:bg-[#183B49] dark:hover:bg-[#1E4A5C] focu
7s:outline-none rounded",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("div",{className:"text-sm flex items-center gap-2",children:[(0,a.jsx)("img",{src:"/assets/support/calendar.svg",className:"block dark:hidden",alt:"calendar"}),(0,a.jsx)("img",{src:"/assets/support/calendar_dark.svg",className:"hidden dark:block",alt:"calendar"}),(0,a.jsxs)("span",{children:["Date: ",(e=>{if(!e)return"-";let t=new Date(e);return isNaN(t.getTime())?e:t.toLocaleString("en-IN",{timeZone:"Asia/Kolkata"})})(e.date)]})]}),(0,a.jsxs)("div",{className:"text-xs text-[#6b7280] mt-1 dark:text-white",children:["Trip ID: #",e.booking_code]})]}),(0,a.jsx)("div",{children:(0,a.jsx)("span",{className:`text-[12px] inline-block px-3 py-1 rounded-full border ${"Completed"===e.status?"text-[#1FA863] border-[#1FA863] bg-white dark:bg-[#183B49]":"Cancelled"===e.status?"text-[#ff5a5f] border-[#ffdede] bg-white dark:bg-[#183B49]":"text-[#667085] border-[#e6edf2] bg-white dark:bg-[#183B49] dark:text-white"}`,children:e.status})})]},e.booking_id??t))}):(0,a.jsx)("div",{className:"text-sm text-[#6b7280] p-3",children:"No recent trips"}),(0,a.jsx)("div",{className:"text-center py-2",children:(0,a.jsx)("button",{className:"text-sm font-semibold text-[#0b69ff] dark:text-white bg-transparent border-none",onClick:()=>eC(!1),children:"Other trip issue"})})]})]}):(0,a.jsx)("div",{className:"",children:f?(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-[14px]",children:o.content??`Hi ${O??"there"} please select the issue you are facing with this trip.`}),eT&&(0,a.jsxs)("div",{className:"mt-3 bg-white dark:bg-[#183B49] rounded-md border border-[#e6edf2] dark:border-[#1E4A5C] overflow-hidden",children:[["Billing Issue","Vehicle damaged or Item missing","Report driver conduct","Trip canceled unexpectedly","Difficulty booking trip"].map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>!y&&t9(e),disabled:y,className:`w-full text-left py-2 px-3 text-sm border-b last:border-b-0 border-[#f0f0f0] dark:border-[#1E4A5C] text-gray-800 dark:text-white ${y?"opacity-50 cursor-not-allowed":"hover:bg-gray-50 dark:hover:bg-[#1E4A5C]"}`,children:e},e)),(0,a.jsx)("div",{className:"text-center py-2",children:(0,a.jsx)("button",{className:`text-sm font-semibold bg-transparent border-none ${y?"text-gray-400 cursor-not-allowed opacity-50":"text-[#0b69ff] dark:text-white"}`,onClick:()=>!y&&t9("Other trip issue"),disabled:y,children:"Other trip issue"})})]})]}):g?(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-[14px]",children:r?"An issue has been selected.":o.content}),eT&&(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"mt-3 bg-white dark:bg-[#183B49] rounded-md border border-[#e6edf2] dark:border-[#1E4A5C] overflow-hidden",children:[["Billing Issue","Vehicle damaged or Item missing","Report driver conduct","Trip canceled unexpectedly","Difficulty booking trip"].map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>!y&&t9(e),disabled:y,className:`w-full text-left py-2 px-3 text-sm border-b last:border-b-0 border-[#f0f0f0] dark:border-[#1E4A5C] text-gray-800 dark:text-white ${y?"opacity-50 cursor-not-allowed":"hover:bg-gray-50 dark:hover:bg-[#1E4A5C]"}`,children:e},e)),(0,a.jsx)("div",{className:"text-center py-2",children:(0,a.jsx)("button",{className:`text-sm font-semibold bg-transparent border-none ${y?"text-gray-400 cursor-not-allowed opacity-50":"text-[#0b69ff] dark:text-white"}`,onClick:()=>!y&&t9("Other trip issue"),disabled:y,children:"Other trip issue"})})]})})]}):"location"===o.message_type?(0,a.jsxs)("div",{className:"space-y-2 max-w-[360px]",children:[o.location_url&&(0,a.jsxs)("div",{onClick:()=>{let e=o.location?.lat||0,t=o.location?.lng||0,r=o.content,s=r&&"Location"!==r?encodeURIComponent(r):encodeURIComponent(`${e},${t}`);window.open(`https://www.google.com/maps/search/?api=1&query=${s}`,"_blank","noopener,noreferrer")},className:"relative w-full aspect-[16/9] overflow-hidden rounded cursor-pointer",children:[(0,a.jsx)("img",{src:o.location_url??void 0,alt:"Location",className:"absolute inset-0 w-full h-full object-cover block dark:hidden"}),(0,a.jsx)("img",{src:o.location_url_dark??void 0,alt:"Location",className:"absolute inset-0 w-full h-full object-cover hidden dark:block"})]}),j&&(0,a.jsxs)("div",{className:"mt-2 break-words whitespace-normal text-[14px]",children:[T,k&&(0,a.jsx)("button",{onClick:()=>ra(o.id),className:`bg-transparent border-none font-semibold cursor-pointer p-0 text-[14px] ${c?"text-[rgba(255,255,255,0.9)]":"text-[#0b69ff]"}`,children:C?" ... show less":"... read more"})]})]}):"audio"===o.message_type?(0,a.jsx)(eo,{message:o,isMine:rl(o)}):o.images&&o.images.length>0?(()=>
7{let e=o.metadata?.file_types??[],t=o.metadata?.file_names??[],r=o.images.filter((t,r)=>!ei(e[r]??"")),s=o.images.map((r,s)=>{let a=e[s]??"",l="application/pdf"===a?"PDF Document":a.includes("word")?"Word Document":"text/plain"===a?"Text File":"Document";return{url:r,mime:a,name:t[s]&&!t[s].match(/^[0-9a-f-]{36}/)?t[s]:l}}).filter(e=>ei(e.mime));return(0,a.jsxs)("div",{className:"space-y-2 max-w-[280px]",children:[s.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-2 w-[220px]",children:s.map((e,t)=>(0,a.jsxs)("button",{onClick:()=>e9(e),className:`flex items-center gap-3 px-3 py-2 rounded-lg text-left w-full min-w-0 border transition-colors ${c?"bg-white/10 border-white/20 hover:bg-white/20 text-white":"bg-gray-100 dark:bg-navy-600 border-gray-200 dark:border-navy-500 hover:bg-gray-200 dark:hover:bg-navy-500 text-gray-800 dark:text-white"}`,children:["application/pdf"===e.mime||e.mime.includes("word")||"text/plain"===e.mime?(0,a.jsx)(u,{className:"w-7 h-7 flex-shrink-0"}):(0,a.jsx)(m,{className:"w-7 h-7 flex-shrink-0"}),(0,a.jsxs)("div",{className:"flex flex-col min-w-0 overflow-hidden",children:[(0,a.jsx)("span",{className:"text-xs font-medium truncate",children:e.name}),(0,a.jsxs)("span",{className:`text-xs ${c?"text-white/60":"text-gray-500 dark:text-gray-400"}`,children:["application/pdf"===e.mime?"PDF":e.mime.includes("word")?"Word":"Document"," \xb7 Tap to view"]})]})]},t))}),r.length>0&&(0,a.jsxs)("div",{className:"max-w-[280px]",children:[1===r.length&&(0,a.jsx)("img",{onClick:()=>ro(r[0]),src:r[0],alt:"attachment-0",className:"w-full aspect-square object-cover rounded cursor-zoom-in"}),2===r.length&&(0,a.jsx)("div",{className:"grid grid-cols-2 gap-1",children:r.map((e,t)=>(0,a.jsx)("img",{onClick:()=>ro(e),src:e,alt:`attachment-${t}`,className:"w-full aspect-square object-cover rounded cursor-zoom-in"},t))}),3===r.length&&(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-1",children:[r.slice(0,2).map((e,t)=>(0,a.jsx)("img",{onClick:()=>ro(e),src:e,alt:`attachment-${t}`,className:"w-full aspect-square object-cover rounded cursor-zoom-in"},t)),r[2]&&(0,a.jsx)("img",{onClick:()=>ro(r[2]),src:r[2],alt:"attachment-2",className:"col-span-2 w-full aspect-[2/1] object-cover rounded cursor-zoom-in"})]}),4===r.length&&(0,a.jsx)("div",{className:"grid grid-cols-2 gap-1",children:r.map((e,t)=>(0,a.jsx)("img",{onClick:()=>ro(e),src:e,alt:`attachment-${t}`,className:"w-full aspect-square object-cover rounded cursor-zoom-in"},t))}),5===r.length&&(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("div",{className:"grid grid-cols-2 gap-1",children:r.slice(0,2).map((e,t)=>(0,a.jsx)("img",{onClick:()=>ro(e),src:e,alt:`attachment-${t}`,className:"w-full aspect-square object-cover rounded cursor-zoom-in"},t))}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-1",children:r.slice(2,5).map((e,t)=>(0,a.jsx)("img",{onClick:()=>ro(e),src:e,alt:`attachment-${t+2}`,className:"w-full aspect-square object-cover rounded cursor-zoom-in"},t+2))})]}),r.length>=6&&(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("div",{className:"grid grid-cols-2 gap-1",children:r.slice(0,2).map((e,t)=>(0,a.jsx)("img",{onClick:()=>ro(e),src:e,alt:`attachment-${t}`,className:"w-full aspect-square object-cover rounded cursor-zoom-in"},t))}),(0,a.jsx)("div",{className:"grid grid-cols-3 gap-1",children:r.slice(2).map((e,t)=>(0,a.jsx)("img",{onClick:()=>ro(e),src:e,alt:`attachment-${t+2}`,className:"w-full aspect-square object-cover rounded cursor-zoom-in"},t+2))})]})]}),j&&!j.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/)&&!["photo sent","document sent","document shared","pdf document","word document","text file","document","attachments sent","voice message sent","location shared","image shared","image shared!"].includes(j.toLowerCase().trim())&&(0,a.jsxs)("div",{className:"mt-2 break-words whitespace-pre-wrap w-full",children:[T,k&&(0,a.jsx)("button",{onClick:()=>ra(o.id),className:`bg-transparent border-none font-semibold cursor-pointer p-0 text-[14px] ${c?"text-[rgba(255,255,255,0.9)]":"text-[#0b69ff]"}`,children:C?" ... show less":"... read more"})]})]})})():ri(j)?(0,a.jsx)("img",{onClick:()=>ro(j),src:j,alt:o.file_name??"attachment",className:"max-w-full rounded cursor-zoom-in"}):o.file_name?(0,a.jsxs)("div",{children:[(0,a.jsx)("a",{href:j,target:"_blank",rel:"noreferrer",className:`underline ${c?"text-white/90":"text-[#0b69ff]"}`,children:o.file_name}),(0,a.jsx)("div",{className:"text-[14px] mt-1",children:T})]}):t4(o)})]}),(0,a.jsxs)("div",{className:`text-[11px] text-[#6b7280] dark:text-white mt-1 flex gap-1 items-center ${c?"justify-end":"justify-start"}`,children:[!x&&(0,a.jsx)("span",{children:new Date(o.created_at).toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit",timeZone:"Asia/Kolkata"})}),c&&(0,a.jsx)("span",{children:$})]})]})]})]},o.id)})})()]}),(0,a.jsx)("div",{ref:eX})]})}),e2.length>0&&(0,a.jsx)("div",{className:"p-3 border-t bg-white dark:bg-navy-700 dark:border-navy-600 flex gap-3 items-center overflow-x-auto",children:e2.map(e=>(0,a.jsxs)("div",{className:"relative w-20 h-20 rounded-md overflow-hidden bg-[#f3f4f6] dark:bg-navy-600 flex-shrink-0",children:[ei(e.file.type)?(0,a.jsxs)("div",{className:"w-full h-full flex flex-col items-center justify-center gap-1 px-1",children:[(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-8 h-8 text-gray-500 dark:text-gray-300 flex-shrink-0",viewBox:"0 0 24 24",fill:"
7currentColor",children:(0,a.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6zm-1 1.5L18.5 9H13V3.5zM6 20V4h5v7h7v9H6z"})}),(0,a.jsx)("span",{className:"text-[10px] text-gray-600 dark:text-gray-300 text-center leading-tight break-all line-clamp-2",children:e.file.name})]}):(0,a.jsx)("img",{onClick:()=>ro(e.previewUrl),src:e.previewUrl,alt:e.file.name,className:"w-full h-full object-cover cursor-zoom-in"}),(0,a.jsx)("button",{onClick:()=>{var t;return t=e.id,void e6(e=>{let r=e.find(e=>e.id===t);if(r)try{URL.revokeObjectURL(r.previewUrl)}catch(e){}return e.filter(e=>e.id!==t)})},className:"absolute top-1 right-1 bg-black/50 text-white rounded-full w-6 h-6 flex items-center justify-center",children:"\xd7"})]},e.id))}),t7?(0,a.jsxs)("div",{className:"flex flex-col p-3 items-center gap-2 bg-[#F2F4F7] dark:bg-[#183B49] rounded-xl mx-3 mb-3",children:[(0,a.jsx)("div",{className:"w-10 h-10 rounded-full border-2 border-green-400 overflow-hidden flex-shrink-0 flex items-center justify-center bg-green-50",children:(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-6 h-6 text-green-500",viewBox:"0 0 20 20",fill:"currentColor",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.707a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 10-1.414 1.414L9 13.414l4.707-4.707z",clipRule:"evenodd"})})}),(0,a.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,a.jsx)("div",{className:"flex items-center justify-center w-6 h-6 rounded-full bg-green-100",children:(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-4 h-4 text-green-600",viewBox:"0 0 20 20",fill:"currentColor",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.707a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 10-1.414 1.414L9 13.414l4.707-4.707z",clipRule:"evenodd"})})}),(0,a.jsx)("div",{className:"text-xs text-black dark:text-[#D0D5DD] italic",children:re})]})]}):(0,a.jsxs)(a.Fragment,{children:[!t$&&!tR&&!eE&&!tm&&!i&&(0,a.jsx)("div",{className:"flex flex-wrap gap-2 p-3 bg-white dark:bg-navy-700 border-t border-gray-200 dark:border-navy-400",children:["I have an issue with last trip.","I forgot my password","Lost an item in car","Contact Customer service","Redeem coupon code","Report a driver"].map((e,t)=>(0,a.jsx)("button",{onClick:()=>{M(e),tr.current?.focus()},className:"px-3 py-1.5 text-xs bg-gray-100 dark:bg-navy-600 text-gray-700 dark:text-gray-300 rounded-full hover:bg-gray-200 dark:hover:bg-navy-500 transition-colors",children:e},t))}),(0,a.jsxs)("div",{className:"p-3.5 flex gap-3 justify-between items-center border-t border-[#eef2f3] bg-white dark:bg-[#102731] position-sticky bottom-0",children:[(0,a.jsx)("div",{className:"p-3.5 w-full bg-white dark:bg-[#102731] sticky bottom-0",children:tm?(0,a.jsxs)("div",{className:"w-full rounded-full border border-red-300 bg-red-50 h-12 flex items-center justify-center px-3",children:[(0,a.jsx)("span",{className:"text-red-600 font-medium text-sm",children:"You have been blocked from using D4M Chat Support"}),(0,a.jsx)(p,{size:13,className:"text-red-600 flex-shrink-0 ml-1.5 -translate-y-px"})]}):(0,a.jsx)("form",{children:(0,a.jsxs)("div",{className:"w-full rounded-full border border-[#e6edf2] bg-gray-100 dark:bg-[#183B49] h-12 flex items-center px-3 relative",children:[(0,a.jsx)("div",{children:t$||!t$&&tR?(0,a.jsx)("button",{type:"button",onClick:e=>{e.preventDefault(),tA(null),tI(0),tq(!1),eP.current&&(eP.current.destroy(),eP.current=null),tz.current&&(tz.current.pause(),tz.current.src="",tz.current=null),tV&&(URL.revokeObjectURL(tV),tW(null))},className:"ml-1 flex items-center justify-center rounded-full bg-red-100 hover:bg-red-200 transition w-10 h-10","aria-label":"Delete recording",children:(0,a.jsx)("img",{src:"/material-symbols_delete-outline-rounded.svg",width:20,height:20,alt:"Delete"})}):(0,a.jsx)("button",{type:"button",onClick:e=>{e.preventDefault()},className:"w-10 h-10 flex items-center justify-center rounded-full bg-teal-100 hover:bg-teal-200 transition","aria-label":"Start recording",children:(0,a.jsx)("img",{src:"/tabler_message-filled.svg",width:20,height:20,alt:"Record / Send"})})}),!t$&&tR&&(0,a.jsxs)("div",{className:"flex w-full items-center gap-3 mt-2 pl-2",children:[(0,a.jsx)("button",{onClick:e=>{e.preventDefault(),tx()},className:"w-8 h-8 rounded-full flex items-center justify-center border","aria-label":tH?"Pause":"Play",children:(0,a.jsx)("img",{src:tH?"/mage_pause
7-fill.svg":"/play.svg",alt:tH?"Pause":"Play",className:"w-5 h-5 brightness-0"})}),(0,a.jsx)("div",{className:"text-sm text-slate-700 dark:text-white",children:tb(tB)}),(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)("canvas",{ref:tP,style:{width:"100%",height:40,borderRadius:8},className:"bg-gray-50 dark:bg-navy-600 text-gray-400"})}),!tH&&(0,a.jsx)("button",{onClick:e=>{e.preventDefault(),rg()},className:"w-8 h-8 rounded-full flex items-center justify-center border","aria-label":"Resume Recording",children:(0,a.jsx)("img",{src:"./material-symbols_mic-rounded.svg",alt:"Resume",className:"w-5 h-5 brightness-0"})})]}),t$&&(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-3",children:[(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)("div",{id:"live-waveform",style:{width:"100%",height:40,borderRadius:8},className:"bg-gray-50 dark:bg-navy-600"})}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"text-sm text-slate-700 dark:text-white",children:tb(tB)}),(0,a.jsx)("button",{onClick:rh,className:"w-10 h-10 rounded-full flex items-center justify-center border","aria-label":"Stop recording",children:(0,a.jsx)("img",{src:"/mage_pause-fill.svg",alt:"Stop recording",className:"w-5 h-5"})})]})]}),!t$&&!tR&&!eE&&(0,a.jsx)("input",{ref:tr,value:R,onChange:e=>M(e.target.value.slice(0,2e3)),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),tk())},placeholder:"Send a message",maxLength:2e3,className:"w-full h-10 pl-14 pr-40 bg-transparent dark:text-white outline-none text-[14px]","aria-label":"Message"}),eE&&(0,a.jsxs)("div",{className:"flex-1 flex items-center justify-center gap-3 px-3 py-2 ",children:[(0,a.jsxs)("div",{className:"relative w-3 h-3",children:[(0,a.jsx)("span",{className:"absolute inset-0 rounded-full bg-red-500 animate-ping opacity-75"}),(0,a.jsx)("span",{className:"relative block w-3 h-3 rounded-full bg-red-600"})]}),(0,a.jsx)("span",{className:"text-sm font-medium text-red-600 animate-pulse",children:"Sharing live location"})]}),!t$&&!tR&&!eE&&(0,a.jsxs)("div",{className:"absolute right-2 top-1/2 transform -translate-y-1/2 flex items-center gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:e=>{e.preventDefault(),s?(e_((0,S.bD)(!0)),e_((0,S.V6)(!1))):i?(e_((0,S.ew)(!0)),e_((0,S.kJ)(!1))):e_((0,S.bD)(!0))},className:"pr-6 rounded-full flex items-center justify-center shadow-[0_6px_18px_rgba(14,165,164,0.08)] bg-transparent cursor-pointer","aria-label":"Attach location",children:(0,a.jsx)("img",{src:"/mingcute_location-line.svg",alt:"Location",width:22,height:22})}),!i&&(0,a.jsx)("button",{type:"button",onClick:e=>{e.preventDefault(),e1.current?.click()},className:"w-9 h-9 mr-4 rounded-full flex items-center justify-center shadow-[0_6px_18px_rgba(14,165,164,0.08)] bg-transparent cursor-pointer","aria-label":"Attach file",children:(0,a.jsx)("img",{src:"/heroicons-outline_paper-clip.svg",alt:"Attachment",width:18,height:18})})]})]})})}),(0,a.jsx)("input",{type:"file",accept:"image/*,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",ref:e1,style:{display:"none"},onChange:e=>{let t=Array.from(e.target.files??[]);if(e.currentTarget.value="",!t.length)return;let r=[],s=[];for(let e of t){let t=en(e);t.ok?r.push(e):s.push(`${e.name}: ${t.reason}`)}e6(e=>{let t=Math.max(0,5-e.length),a=r.slice(0,t);return r.length>t&&s.push("Only 5 attachments allowed per message"),[...e,...a.map(e=>({id:C(),file:e,previewUrl:URL.createObjectURL(e)}))]}),s.forEach(e=>k(e,"error"))},multiple:!0}),!tm&&(0,a.jsx)("button",{disabled:eE||tS,onClick:e=>(e.preventDefault(),tR||t$)?rb():R.trim()||e2.length>0?tk():rf(),className:"border-none p-[10px_14px] rounded-full cursor-pointer shadow-[0_6px_18px_rgba(14,165,164,0.18)] flex items-center justify-center bg-transparent dark:bg-[#183B49] text-[#667085] dark:text-white disabled:opacity-50 disabled:cursor-default","aria-label":"Send or record",children:tS?(0,a.jsx)(f,{size:20,className:"animate-spin"}):tR||t$||R.trim()||e2.length>0?(0,a.jsx)(h,{size:20}):(0,a.jsx)(g,{size:20})})]})]}),(0,a.jsx)(K,{isOpen:eD,onSubmit:rv}),e3&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70",onClick:rd,children:(0,a.jsxs)("div",{className:"max-w-[95vw] max-h-[95vh] p-4",onClick:e=>e.stopPropagation(),children:[(0,a.jsx)("button",{onClick:rd,className:"absolute top-6 right-6 z-60 bg-black/60 text-white rounded-full w-9 h-9 flex items-center justify-center",children:"\xd7"}),(0,a.jsx)("img",{src:e3,alt:"preview",className:"max-w-full max-h-[80vh] rounded shadow-lg"})]})}),e5&&(0,a.jsxs)("div",{className:"fixed inset-0 z-50 flex flex-col bg-black/90",onClick:()=>{e9(null),e7(0)},children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 bg-gray-900 text-white flex-shrink-0",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)("span",{className:"text-sm font-medium truncate max-w-[60vw]",children:e5.name}),"application/pdf"===e5.mime&&e8>0&&(0,a.jsxs)("span",{className:"text-xs text-gray-400 flex-shrink-0",children:[e8," page",1!==e8?"s":""]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-shrink-0",children:[(0,a.jsx)("a",{href:e5.url,target:"_blank",rel:"noreferrer",title:"Download",className:"bg-white/20 hover:bg-white/30 text-white rounded-full w-8 h-8 flex items-center justify-center transition-colors",onClick:e=>e.stopPropagation(),children:(0,a.jsx)(x,{className:"w-4 h-4"})}),(0,a.jsx)("button",{onClick:()=>{e9(null),e7(0)},className:"bg-white/20 hover:bg-white/30 text-white rounded-full w-8 h-8 flex items-center justify-center text-lg leading-none",children:"\xd7"})]})]}),(0,a.jsx)("div",{className:"flex-1 overflow-hidden",onClick:e=>e.stopPropagation(),children:"application/pdf"===e5.mime?(0,a.jsx)("div",{className:"h-full overflow-y-auto flex flex-col items-center py-4 gap-3",children:(0,a.jsx)(n,{url:e5.url,onPageCountChange:e7})}):"text/plain"===e5.mime?(0,a.jsx)(ep,{url:e5.url}):(0,a.jsx)("iframe",{src:`https://docs.google.com/viewer?url=${encodeURIComponent(e5.url)}&embedded=true`,title:e5.name,className:"w-full h-full border-0"})})]}),tC&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70",children:(0,a.jsxs)("div",{className:"w-[90vw] h-[80vh] max-w-4xl bg-white dark:bg-navy-700 rounded-lg overflow-hidden relative",children:[(0,a.jsx)("button",{onClick:()=>tT(null),className:"absolute top-4 right-4 z-10 bg-black/60 text-white rounded-full w-8 h-8 flex items-center justify-center hover:bg-black/80 transition-colors",children:"\xd7"}),(0,a.jsx)(A,{lat:tC.lat,lng:tC.lng,onClose:()=>tT(null),showSelectButton:!1})]})})]})}}}]);

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.