Files
Express_console_build/build/static/js/8445.411a98f2.chunk.js

1 line
54 KiB
JavaScript

"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[8445],{855:(e,t,a)=>{a.d(t,{A:()=>o});var s=a(68106),n=a(82522),l=a(65908);function o(e){var t,a;let o,i,{children:r,type:c="scale",direction:d="right",offset:u=10,scale:p={hover:1.05,tap:.95}}=e;switch(d){case"up":case"left":o=u,i=0;break;default:o=0,i=u}const[m,h]=(0,s.Y)(o,i),[x,g]=(0,s.Y)(o,i);switch(c){case"rotate":return(0,l.jsx)(n.P.div,{animate:{rotate:360},transition:{repeat:1/0,repeatType:"loop",duration:2,repeatDelay:0},children:r});case"slide":return"up"===d||"down"===d?(0,l.jsx)(n.P.div,{animate:{y:void 0!==x?x:""},onHoverEnd:()=>g(),onHoverStart:()=>g(),children:r}):(0,l.jsx)(n.P.div,{animate:{x:void 0!==m?m:""},onHoverEnd:()=>h(),onHoverStart:()=>h(),children:r});default:return"number"===typeof p&&(p={hover:p,tap:p}),(0,l.jsx)(n.P.div,{whileHover:{scale:null===(t=p)||void 0===t?void 0:t.hover},whileTap:{scale:null===(a=p)||void 0===a?void 0:a.tap},children:r})}}},5303:(e,t,a)=>{a.d(t,{Ay:()=>x,ft:()=>h});var s=a(22555),n=a(85672),l=a(17488),o=a(86270),i=a(12010),r=a(56691),c=a(65908);const d="https://nominatim.openstreetmap.org/search",u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[],a=(e,a)=>{e&&t.push({long_name:e,short_name:e,types:a})};return a(e.house_number,["street_number"]),a(e.road||e.pedestrian,["route"]),a(e.suburb||e.neighbourhood||e.quarter,["sublocality_level_1","sublocality"]),a(e.city_district||e.county,["administrative_area_level_3"]),a(e.city||e.town||e.village,["locality"]),a(e.state,["administrative_area_level_1"]),a(e.country,["country"]),a(e.postcode,["postal_code"]),t},p=e=>{var t;return{formatted_address:e.display_name,name:(null===(t=e.display_name)||void 0===t?void 0:t.split(",")[0])||"",geometry:{location:{lat:()=>parseFloat(e.lat),lng:()=>parseFloat(e.lon)}},address_components:u(e.address)}},m=(e,t)=>{const a=new URLSearchParams({q:e,format:"json",addressdetails:"1",limit:"5"});if(null!==t&&void 0!==t&&t.lat&&null!==t&&void 0!==t&&t.lng){const e=.5;a.set("viewbox","".concat(t.lng-e,",").concat(t.lat+e,",").concat(t.lng+e,",").concat(t.lat-e))}return a};async function h(e){let{bias:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return null;try{const a=m(e,t);a.set("limit","1");const s=await fetch("".concat(d,"?").concat(a.toString()),{headers:{Accept:"application/json"}});if(!s.ok)return null;const n=await s.json();return null!==n&&void 0!==n&&n.length?p(n[0]):null}catch(a){return console.error("geocodeAddress error:",a),null}}const x=e=>{let{id:t,label:a,placeholder:u="Search address",value:h,onChange:x,onPlaceSelected:g,bias:A,sx:v,textFieldSx:f,fullWidth:j=!0,disabled:b,inputRef:y,TextFieldProps:S={}}=e;const[_,k]=(0,n.useState)(h||""),[P,N]=(0,n.useState)([]),[C,I]=(0,n.useState)(!1);(0,n.useEffect)((()=>{void 0!==h&&h!==_&&k(h||"")}),[h]);const w=(0,n.useMemo)((()=>(0,r.A)(((e,t,a)=>{if(!e)return void a([]);const s=m(e,t);fetch("".concat(d,"?").concat(s.toString()),{headers:{Accept:"application/json"}}).then((e=>e.ok?e.json():[])).then((e=>a(e||[]))).catch((()=>a([])))}),500)),[]);return(0,n.useEffect)((()=>{let e=!0;return _?(I(!0),w(_,A,(t=>{e&&(I(!1),N(t))})),()=>{e=!1}):(N([]),void I(!1))}),[_,null===A||void 0===A?void 0:A.lat,null===A||void 0===A?void 0:A.lng,w]),(0,c.jsx)(l.A,{id:t,freeSolo:!0,fullWidth:j,disabled:b,sx:v,options:P,filterOptions:e=>e,getOptionLabel:e=>"string"===typeof e?e:e.display_name||"",isOptionEqualToValue:(e,t)=>e.place_id===(null===t||void 0===t?void 0:t.place_id),inputValue:_,onInputChange:(e,t)=>{k(t),null===x||void 0===x||x(t)},onChange:(e,t)=>{t&&"string"!==typeof t&&(k(t.display_name||""),null===g||void 0===g||g(p(t)))},renderInput:e=>{var t,n,l,r;return(0,c.jsx)(o.A,(0,s.A)((0,s.A)((0,s.A)({},e),S),{},{inputRef:y,label:a,placeholder:u,sx:f,autoComplete:"off",InputProps:(0,s.A)((0,s.A)((0,s.A)({},e.InputProps),S.InputProps),{},{startAdornment:null!==(t=null===(n=S.InputProps)||void 0===n?void 0:n.startAdornment)&&void 0!==t?t:e.InputProps.startAdornment,endAdornment:(0,c.jsxs)(c.Fragment,{children:[C?(0,c.jsx)(i.A,{color:"inherit",size:16}):null,null!==(l=null===(r=S.InputProps)||void 0===r?void 0:r.endAdornment)&&void 0!==l?l:e.InputProps.endAdornment]})})}))}})}},20466:(e,t,a)=>{a.d(t,{k:()=>n});var s=a(13659);const n=(e,t,a)=>(0,s.M8)(e,{variant:t,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:a||2e3})},42041:()=>{},79520:(e,t,a)=>{a.d(t,{D:()=>n,F:()=>s});const s=async(e,t)=>{const a=null===e||void 0===e?void 0:e.latitude,s=null===e||void 0===e?void 0:e.longitude,n=null===t||void 0===t?void 0:t.latitude,l=null===t||void 0===t?void 0:t.longitude;if(null==a||null==s||null==n||null==l)throw new Error("Invalid coordinates");const o={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_API_URL:"https://mock-data-api-nextjs.vercel.app/",REACT_APP_AUTH0_CLIENT_ID:"",REACT_APP_AUTH0_DOMAIN:"",REACT_APP_AWS_APP_CLIENT_ID:"",REACT_APP_AWS_POOL_ID:"",REACT_APP_FIREBASE_API_KEY:"",REACT_APP_FIREBASE_APP_ID:"",REACT_APP_FIREBASE_AUTH_DOMAIN:"",REACT_APP_FIREBASE_MEASUREMENT_ID:"",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"",REACT_APP_FIREBASE_PROJECT_ID:"",REACT_APP_FIREBASE_STORAGE_BUCKET:"",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_STAFF_TOKEN:"",REACT_APP_URL:"https://jupiter.nearle.app/live/api/v1",REACT_APP_URL2:"https://jupiter.nearle.app/live/api/v2",REACT_APP_URL3:"https://jupiter.nearle.app/live/api/v3",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_OSRM_URL||"https://router.project-osrm.org";try{const e="".concat(o,"/route/v1/driving/").concat(s,",").concat(a,";").concat(l,",").concat(n,"?overview=false"),t=await fetch(e);if(t.ok){const e=await t.json();if(e.routes&&e.routes.length>0){const t=e.routes[0].distance/1e3;return Math.round(t)}}}catch(p){console.warn("OSRM API failed, falling back to Haversine math:",p)}const i=e=>e*Math.PI/180,r=i(n-a),c=i(l-s),d=Math.sin(r/2)*Math.sin(r/2)+Math.cos(i(a))*Math.cos(i(n))*Math.sin(c/2)*Math.sin(c/2),u=6371*(2*Math.atan2(Math.sqrt(d),Math.sqrt(1-d)));return Math.round(1.3*u)},n=(e,t,a,s)=>e<s?t:(e-s)*a+t},80987:(e,t,a)=>{a.r(t),a.d(t,{default:()=>he});var s=a(22555),n=a(85672),l=a(76264),o=a(48738),i=a(84007),r=a(2866),c=a(17488),d=a(86270),u=a(1939),p=a(80911),m=a(43318),h=a(11969),x=a(83900),g=a(28579),A=a(71392),v=a(94524),f=a(12010),j=a(19619),b=a(29398),y=a(29776),S=a(58571),_=a(5670),k=a(17450),P=a(43281),N=a(79520),C=a(38464),I=a(81600),w=a(20605),R=a(15172),D=a(51808),E=a(96515),z=a(90215),M=a(66157),L=a(69039),T=a(5303),Y=a(52351),F=(a(4114),a(59008),a(91939)),W=a(65293),H=a(12557),O=a(58689),U=a(46077),B=a.n(U),V=a(13659),q=a(26777),K=a(96048),X=a(3273),Z=a(13763),G=a(71188),Q=a(88664),$=a(37856),J=a(20466),ee=a(38965),te=a(43e3),ae=a(69191),se=a(87),ne=a(91001),le=a(73413),oe=a.n(le),ie=(a(98443),a(42041),a(855)),re=a(65908),ce=a(22686);B().extend(ce);const de="undefined"!==typeof window?new(oe().Icon)({iconUrl:"https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-blue.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-icon.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]}):null,ue="undefined"!==typeof window?new(oe().Icon)({iconUrl:"https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-red.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-icon.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]}):null,pe=e=>{let{startPoint:t,endPoint:a}=e;const s=(0,ee.ko)();return(0,n.useEffect)((()=>{const e=[],n=parseFloat(null===t||void 0===t?void 0:t.latitude),l=parseFloat(null===t||void 0===t?void 0:t.longitude),o=parseFloat(null===a||void 0===a?void 0:a.latitude),i=parseFloat(null===a||void 0===a?void 0:a.longitude);isNaN(n)||isNaN(l)||0===n||0===l||e.push([n,l]),isNaN(o)||isNaN(i)||0===o||0===i||e.push([o,i]),1===e.length?s.setView(e[0],14):2===e.length&&s.fitBounds(e,{padding:[50,50]})}),[null===t||void 0===t?void 0:t.latitude,null===t||void 0===t?void 0:t.longitude,null===a||void 0===a?void 0:a.latitude,null===a||void 0===a?void 0:a.longitude,s]),null},me=e=>{let{startPoint:t,endPoint:a,appLocaLat:s,appLocaLng:l}=e;const o=[parseFloat(s)||11.0168,parseFloat(l)||76.9558],i=(null===t||void 0===t?void 0:t.latitude)&&(null===t||void 0===t?void 0:t.longitude)&&0!==parseFloat(t.latitude),r=(null===a||void 0===a?void 0:a.latitude)&&(null===a||void 0===a?void 0:a.longitude)&&0!==parseFloat(a.latitude),c=i?[parseFloat(t.latitude),parseFloat(t.longitude)]:null,d=r?[parseFloat(a.latitude),parseFloat(a.longitude)]:null,[u,p]=n.useState([]);return n.useEffect((()=>{if(!i||!r)return void p([]);(async()=>{const e="https://router.project-osrm.org/route/v1/driving/".concat(t.longitude,",").concat(t.latitude,";").concat(a.longitude,",").concat(a.latitude,"?overview=full&geometries=geojson");try{var s;const t=await fetch(e),a=await t.json();if(null!==(s=a.routes)&&void 0!==s&&s.length){const e=a.routes[0].geometry.coordinates.map((e=>{let[t,a]=e;return[a,t]}));p(e)}else p([c,d])}catch(n){console.error("OSRM Error:",n),p([c,d])}})()}),[t.latitude,t.longitude,a.latitude,a.longitude,i,r]),(0,re.jsx)("div",{style:{position:"relative",width:"100%",height:"100%"},children:(0,re.jsxs)(te.W,{center:o,zoom:12,style:{width:"100%",height:"100%"},zoomControl:!0,children:[(0,re.jsx)(ae.e,{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:"\xa9 OpenStreetMap contributors"}),i&&(0,re.jsx)(se.p,{position:c,icon:de}),r&&(0,re.jsx)(se.p,{position:d,icon:ue}),u.length>0?(0,re.jsx)(ne.R,{positions:u,color:"#662582",weight:4}):i&&r&&(0,re.jsx)(ne.R,{positions:[c,d],color:"#662582",weight:4}),(0,re.jsx)(pe,{startPoint:t,endPoint:a})]})})},he=()=>{const e=(0,E.Zp)(),t=(0,L.A)(),a=(0,l.A)(t.breakpoints.down("md")),U=(0,n.useRef)(null),ee=(0,n.useRef)(null),[te,ae]=n.useState(""),[se,ne]=n.useState(""),[le,oe]=(0,n.useState)(localStorage.getItem("locationid")),[ce,de]=(0,n.useState)(!1),ue=(0,n.useRef)(null),pe=(0,n.useRef)(null),he=(0,n.useRef)(null),[xe,ge]=(0,n.useState)(0),[Ae,ve]=(0,n.useState)(!1),[fe,je]=(0,n.useState)([]),[be,ye]=(0,n.useState)(B()().format("MM-DD-YYYY")),[Se,_e]=(0,n.useState)(),[ke,Pe]=(0,n.useState)(),[Ne,Ce]=(0,n.useState)([]),[Ie,we]=(0,n.useState)(""),[Re,De]=(0,n.useState)(!1),[Ee,ze]=(0,n.useState)(!1),[Me,Le]=(0,n.useState)(!1),[Te,Ye]=(0,n.useState)(""),[Fe,We]=(0,n.useState)(),[He,Oe]=(0,n.useState)({}),[Ue,Be]=(0,n.useState)(""),[Ve,qe]=(0,n.useState)([]),[Ke,Xe]=(0,n.useState)({latitude:0,longitude:0}),[Ze,Ge]=(0,n.useState)({latitude:0,longitude:0}),[Qe,$e]=(0,n.useState)(!1),[Je,et]=(0,n.useState)(0),[tt,at]=(0,n.useState)(0),[st,nt]=(0,n.useState)(0),[lt,ot]=(0,n.useState)(0),[it,rt]=(0,n.useState)(0),[ct,dt]=(0,n.useState)([]),[ut,pt]=(0,n.useState)("Select "),[mt,ht]=(0,n.useState)(0),[xt,gt]=(0,n.useState)(""),[At,vt]=(0,n.useState)(0),[ft,jt]=(0,n.useState)(0),[bt,yt]=(0,n.useState)(null),[St,_t]=(0,n.useState)(!1),[kt,Pt]=(0,n.useState)(""),[Nt,Ct]=(0,n.useState)([]),[It,wt]=(0,n.useState)(null),[Rt,Dt]=(0,n.useState)(null),[Et,zt]=(0,n.useState)(null),[Mt,Lt]=(0,n.useState)(0),[Tt,Yt]=(0,n.useState)(0),[Ft,Wt]=(0,n.useState)(0),[Ht,Ot]=(0,n.useState)([]),[Ut,Bt]=(0,n.useState)(),[Vt,qt]=(0,n.useState)(),[Kt,Xt]=(0,n.useState)(),[Zt,Gt]=(0,n.useState)("Select Location"),Qt=localStorage.getItem("userid"),[$t,Jt]=(0,n.useState)(0),[ea,ta]=(0,n.useState)(0),[aa,sa]=(0,n.useState)(0),[na,la]=(0,n.useState)(0),[oa,ia]=(0,n.useState)(),[ra,ca]=(0,n.useState)(),[da,ua]=(0,n.useState)(!1),[pa,ma]=(0,n.useState)(!1),[ha,xa]=(0,n.useState)(0),[ga,Aa]=(0,n.useState)(0),[va,fa]=(0,n.useState)(1),[ja,ba]=(0,n.useState)(null),[ya,Sa]=(0,n.useState)(null),[_a,ka]=(0,n.useState)(null),[Pa,Na]=(0,n.useState)(null),[Ca,Ia]=(0,n.useState)(1),wa=!!(null!==Rt&&void 0!==Rt&&Rt.firstname&&null!==Rt&&void 0!==Rt&&Rt.contactno&&10===String(Rt.contactno).length&&null!==Rt&&void 0!==Rt&&Rt.doorno&&null!==Rt&&void 0!==Rt&&Rt.suburb&&null!==Rt&&void 0!==Rt&&Rt.postcode);(0,n.useEffect)((()=>{console.log("pickupSlotsList",_a),console.log("pickupSlot",Pa)}),[_a,Pa]);(0,n.useEffect)((()=>{(async()=>{try{const e=await M.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(Qt));console.log("fetchAppLocations",e.data.details),Gt(e.data.details)}catch(e){console.log("locationRes",e)}})()}),[]);(0,n.useEffect)((()=>{xe&&(async()=>{ze(!0),await M.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenants/?applocationid=").concat(xe,"&status=active")).then((e=>{if(console.log(e),e.data.status){let t=[];e.data.details.map((e=>{t.push((0,s.A)((0,s.A)({},e),{},{label:"".concat(e.tenantname)}))})),qe(t)}ze(!1)})).catch((e=>{console.log(e),ze(!1)}))})()}),[xe]);(0,n.useEffect)((()=>{console.log("startPoint",Ke),console.log("endPoint",Ze),0!=Ke.latitude&&0!=Ke.longitude&&0!=Ze.latitude&&0!=Ze.longitude&&Ra(Ke,Ze)}),[Ke,Ze]);const Ra=async(e,t)=>{try{const a=await(0,N.F)(e,t);console.log("calculated distance in km:",a),et(a);const s=(0,N.D)(a,tt,st,lt);console.log("total charge:",s),rt(s),$e(!0),a>Kt&&($e(!0),ve(!0));const n=40,l=Math.round(a/n*60);console.log("Distance: ".concat(a,", Duration: ").concat(l))}catch(a){console.error("Error calculating distance:",a)}};(0,n.useEffect)((()=>{At&&za()}),[(null===kt||void 0===kt?void 0:kt.length)>3,""==kt,At]),(0,n.useEffect)((()=>{if(Ne[0]){let e=[];Ne.map((t=>{B()().diff(B()("".concat(B()(be).format("MM-DD-YYYY")," ").concat(B()(t).format("HH:mm:ss"))),"m")<=0&&e.push(t)}))}}),[Ne]);(0,n.useEffect)((()=>{At&&(async()=>{ze(!0),console.log("tenantid",At),await M.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantinfo/?tenantid=").concat(At)).then((e=>{console.log("fetchtenantinfo",e),e.data.status&&(Oe(e.data.details),Da(),pt(e.data.details.subcategoryname),ht(e.data.details.subcategoryid)),ze(!1)})).catch((e=>{console.log(e),ze(!1)}))})()}),[At]);(0,n.useEffect)((()=>{(async()=>{await M.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/utils/getsubcategories/?moduleid=6")).then((e=>{console.log("subcateRes",e.data.details),e.data.status&&dt(e.data.details)})).catch((e=>{console.log(e)}))})()}),[]);(0,n.useEffect)((()=>{xe&&(async()=>{ze(!0),await M.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/utils/getapplocations/?applocationid=").concat(xe)).then((e=>{console.log("fetchTiming",e);const{opentime:t,closetime:a,latitude:s,longitude:n,radius:l}=e.data.details[0];if(e.data.status){Bt(s),qt(n),Xt(l),console.log("radius",l),_e("".concat(B()().format("MM-DD-YYYY")," ").concat(t)),Pe("".concat(B()().format("MM-DD-YYYY")," ").concat(a)),console.log("starttime","".concat(B()().format("MM-DD-YYYY")," ").concat(t)),console.log("endtime","".concat(B()().format("MM-DD-YYYY")," ").concat(a," "));let e=[];for(let s="".concat(B()().format("MM-DD-YYYY")," ").concat(t),n=0;B()("".concat(B()().format("MM-DD-YYYY")," ").concat(a," ")).diff(s,"m")>=0;n++,s=B()(s).add(30,"m"))e.push(s);console.log("setTimeslotarr",e),Ce(e)}ze(!1)})).catch((e=>{console.log(e),ze(!1)}))})()}),[xe]);const Da=async()=>{ze(!0),await M.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/utils/getapplocationconfig/?applocationid=").concat(xe)).then((e=>{const t=e.data.details.applocationadmins.map((e=>e.userfcmtokem));e.data.status&&We(t),ze(!1)})).catch((e=>{console.log(e),ze(!1)}))};(0,n.useEffect)((()=>{Se&&ke&&Da()}),[Se,ke]);const Ea=(e,t,a)=>{(0,V.M8)(e,{variant:t,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:a||1500}),console.log(Te)},za=async()=>{De(!0);try{let e=""==kt?"".concat("https://jupiter.nearle.app/live/api/v1","/customers/gettenantcustomers/?tenantid=").concat(At,"&pageno=1&pagesize=30"):"".concat("https://jupiter.nearle.app/live/api/v1","/customers/search/?tenantid=").concat(At,"&keyword=").concat(kt);await M.A.get(e).then((e=>{e.data.status&&(console.log("clientdetails",e.data.details),je(e.data.details),Ct(e.data.details)),De(!1)})).catch((e=>{console.log(e),De(!1),Ea("server error","warning")}))}catch(e){console.log(e),De(!1)}},Ma=async()=>{ze(!0),await M.A.post("".concat("https://jupiter.nearle.app/live/api/v1","/utils/sendnotifications"),{priority:"high",registration_ids:Fe,data:{accessid:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk"},notification:{title:"Nearle Merchant",body:"An Order has been placed successfully,kindly process the same",sound:"ring"}}).then((e=>{console.log(e),"Success"==e.data.message&&(0,V.M8)("Notification sent Successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:1e3}),ze(!1)})).catch((e=>{console.log(e),(0,V.M8)(e.message,{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:1e3}),ze(!1)}))};return(0,re.jsxs)(re.Fragment,{children:[Ee&&(0,re.jsx)(Y.A,{}),Re&&(0,re.jsx)(Y.A,{}),(0,re.jsxs)(o.A,{className:"orders-workspace-bg",sx:{p:0,m:0,minHeight:"auto",display:"flex",flexDirection:"column"},children:[(0,re.jsxs)(i.A,{className:"orders-card page-header-row",sx:{mb:{xs:1.5,sm:2},display:"flex",flexDirection:{xs:"column",lg:"row"},alignItems:{xs:"stretch",lg:"center"},justifyContent:"space-between",gap:{xs:1.25,lg:2},px:{xs:1.75,sm:2},py:{xs:.75,sm:.9},flexShrink:0},children:[(0,re.jsx)(o.A,{className:"header-title-block",sx:{display:"flex",flexDirection:"column",gap:0,minWidth:0,flex:{lg:"1 1 auto"}},children:(0,re.jsx)(o.A,{sx:{display:"flex",alignItems:"center",gap:1},children:(0,re.jsx)(r.A,{sx:{fontWeight:700,color:"#1e293b",lineHeight:1.15,fontSize:{xs:"17px",sm:"19px"}},children:"Create New Order"})})}),(0,re.jsxs)(o.A,{className:"header-configurators",sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},alignItems:{xs:"stretch",sm:"center"},justifyContent:{xs:"stretch",lg:"flex-end"},gap:1,p:0,width:{xs:"100%",lg:"auto"},flexShrink:0},children:[(0,re.jsx)(o.A,{sx:{width:{xs:"100%",sm:180,md:200,xl:220}},children:(0,re.jsx)(c.A,{fullWidth:!0,autoFocus:!0,size:"small",ref:U,options:Zt||[],getOptionLabel:e=>"".concat(e.locationname),className:"header-compact-input",onChange:(e,t,a)=>{"clear"===a?(ge(0),vt(0),ba(null),qe([]),jt(0),Sa(null),Ot([]),Dt(null),zt(null)):(ge(t.applocationid),Dt(null),zt(null),vt(0),ba(null),jt(0),Sa(null),Ot([]))},renderInput:e=>(0,re.jsx)(d.A,(0,s.A)((0,s.A)({},e),{},{size:"small",placeholder:"Choose Location",label:"Location",InputLabelProps:{shrink:!0},className:"header-compact-tf",InputProps:(0,s.A)((0,s.A)({},e.InputProps),{},{startAdornment:(0,re.jsxs)(re.Fragment,{children:[(0,re.jsx)(R.sIY,{style:{color:"#94a3b8",fontSize:12,marginRight:6,flexShrink:0}}),e.InputProps.startAdornment]})})}))})}),(0,re.jsx)(o.A,{sx:{width:{xs:"100%",sm:180,md:200,xl:220}},children:(0,re.jsx)(c.A,{fullWidth:!0,size:"small",className:"header-compact-input",options:Ve||[],value:ja,onOpen:e=>{xe||(e.preventDefault(),(0,J.k)("Please select a your location first!","warning",3e3),setTimeout((()=>{var e;null===(e=U.current)||void 0===e||e.focus()}),0))},onChange:(e,t,a)=>{"clear"==a?(vt(0),ba(null),jt(0),Sa(null),Ot([]),Dt(null),zt(null)):(vt((null===t||void 0===t?void 0:t.tenantid)||0),ba(t),jt(0),Sa(null),(async e=>{try{const t=await M.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantpricing/?tenantid=").concat(e));console.log("pricingResponse",t.data.details),at(t.data.details.baseprice),nt(t.data.details.priceperkm),ot(t.data.details.minkm)}catch(t){console.log("fetchTenantPricing error",t)}})(t.tenantid),(async e=>{try{const t=await M.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantlocations/?tenantid=").concat(e));console.log("gettenantlocations",t.data.details),1==t.data.details.length?(Ot(t.data.details),wt(t.data.details[0]),jt(t.data.details[0].locationid),Sa(t.data.details[0].locationid),ka(t.data.details[0].slots)):Ot(t.data.details)}catch(t){console.log("gettenantlocations",t)}})(t.tenantid),zt(null))},renderInput:e=>(0,re.jsx)(d.A,(0,s.A)((0,s.A)({},e),{},{size:"small",placeholder:"Choose Client",label:"Client",inputRef:ee,InputLabelProps:{shrink:!0},className:"header-compact-tf",InputProps:(0,s.A)((0,s.A)({},e.InputProps),{},{startAdornment:(0,re.jsxs)(re.Fragment,{children:[(0,re.jsx)(R.x$1,{style:{color:"#94a3b8",fontSize:11,marginRight:6,flexShrink:0}}),e.InputProps.startAdornment]})})}))})}),(0,re.jsx)(o.A,{sx:{width:{xs:"100%",sm:200,md:220,xl:240}},children:1==Ht.length?(0,re.jsx)(d.A,{variant:"outlined",fullWidth:!0,size:"small",label:"Business Location",value:Ht[0].locationname,InputLabelProps:{shrink:!0},className:"header-compact-tf",InputProps:{style:{color:t.palette.primary.main},startAdornment:(0,re.jsx)(Q.A,{style:{color:"#94a3b8",fontSize:14,marginRight:6,flexShrink:0}})}}):(0,re.jsx)(c.A,{fullWidth:!0,size:"small",className:"header-compact-input",value:ya,options:Ht||[],getOptionLabel:e=>"".concat(e.locationname," (").concat(e.suburb,")")||0,onOpen:e=>{xe||At?At||(e.preventDefault(),(0,J.k)("Please select a your Tenant first!","warning",3e3),setTimeout((()=>{var e;null===(e=ee.current)||void 0===e||e.focus()}),0)):(e.preventDefault(),(0,J.k)("Please select Location and Tenant first!","warning",3e3),setTimeout((()=>{var e;null===(e=U.current)||void 0===e||e.focus()}),0))},onChange:(e,t,a)=>{"clear"===a?(jt(0),Sa(null),Dt(null)):(jt(t.locationid||0),Sa(t),wt(t),ka(null===t||void 0===t?void 0:t.slots))},renderInput:e=>(0,re.jsx)(d.A,(0,s.A)((0,s.A)({},e),{},{size:"small",placeholder:"Select Business Locations",label:"Business Location",color:"primary",InputLabelProps:{shrink:!0},className:"header-compact-tf",InputProps:(0,s.A)((0,s.A)({},e.InputProps),{},{startAdornment:(0,re.jsxs)(re.Fragment,{children:[(0,re.jsx)(Q.A,{style:{color:"#94a3b8",fontSize:14,marginRight:6,flexShrink:0}}),e.InputProps.startAdornment]})})}))})})]})]}),(0,re.jsxs)(u.Ay,{container:!0,spacing:{xs:2.5,sm:3,lg:4},children:[(0,re.jsxs)(u.Ay,{item:!0,xs:12,lg:7.5,sx:{display:"flex",flexDirection:"column",gap:{xs:1.5,sm:1.75,lg:2}},children:[(0,re.jsxs)(i.A,{className:"orders-card",sx:{p:{xs:1.25,sm:1.5,lg:1.5}},children:[(0,re.jsxs)(o.A,{className:"route-stepper",children:[(0,re.jsxs)(o.A,{className:"route-step ".concat(1===Ca?"is-active":""," ").concat(wa?"is-done":""," step-pickup"),onClick:()=>Ia(1),role:"button",tabIndex:0,children:[(0,re.jsx)(o.A,{className:"route-step-index",children:wa&&1!==Ca?(0,re.jsx)(I.CMH,{}):"1"}),(0,re.jsxs)(o.A,{className:"route-step-text",children:[(0,re.jsx)(r.A,{className:"route-step-title",children:"Pickup"}),(0,re.jsx)(r.A,{className:"route-step-sub",children:"Where to collect"})]})]}),(0,re.jsxs)(o.A,{className:"route-step-connector ".concat(wa?"is-done":""),children:[(0,re.jsx)(o.A,{className:"route-step-line"}),(0,re.jsx)(o.A,{className:"route-step-line-arrow",children:(0,re.jsx)(I.Z0P,{})})]}),(0,re.jsxs)(o.A,{className:"route-step ".concat(2===Ca?"is-active":""," step-drop ").concat(wa?"":"is-locked"),onClick:()=>{wa?Ia(2):Ea("Please complete Pickup details first","warning",2e3)},role:"button",tabIndex:0,children:[(0,re.jsx)(o.A,{className:"route-step-index",children:"2"}),(0,re.jsxs)(o.A,{className:"route-step-text",children:[(0,re.jsx)(r.A,{className:"route-step-title",children:"Drop"}),(0,re.jsx)(r.A,{className:"route-step-sub",children:"Where to deliver"})]})]})]}),(0,re.jsxs)(o.A,{className:"route-flow",children:[(0,re.jsxs)(o.A,{className:"location-panel pickup-panel",sx:{display:1===Ca?"block":"none"},children:[(0,re.jsxs)(o.A,{className:"lp-header",children:[(0,re.jsxs)(o.A,{className:"lp-header-title",children:[(0,re.jsx)(o.A,{className:"lp-badge",children:(0,re.jsx)(R.sIY,{})}),(0,re.jsxs)(o.A,{children:[(0,re.jsx)(r.A,{className:"lp-title",children:"Pickup"}),(0,re.jsx)(r.A,{className:"lp-subtitle",children:"Where to collect the parcel"})]})]}),(0,re.jsx)(o.A,{className:"lp-header-actions",children:(0,re.jsx)(p.A,{className:"lp-action-btn",size:"small",disabled:!ft,startIcon:(0,re.jsx)(q.A,{style:{fontSize:13}}),onClick:()=>{xe||At||ft?xe||At?xe?(_t(!0),Lt(1),Dt(null),ae(""),Pt("")):(0,J.k)("Please select Location!","warning",3e3):(0,J.k)("Please select Location and Tenant!","warning",3e3):(0,J.k)("Please select Location, Tenant and Business!","warning",3e3)},children:"From Saved"})})]}),(0,re.jsx)(r.A,{className:"field-group-caption",children:"Contact"}),(0,re.jsxs)(u.Ay,{container:!0,spacing:1.5,sx:{mt:.5},children:[(0,re.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,re.jsx)(d.A,{inputRef:ue,fullWidth:!0,size:"small",InputProps:{startAdornment:(0,re.jsx)(m.A,{position:"start",children:(0,re.jsx)(R.x$1,{style:{color:"#64748b"}})}),style:{borderRadius:"10px"}},variant:"outlined",label:"Contact Name",value:(null===Rt||void 0===Rt?void 0:Rt.firstname)||"",onChange:e=>{Dt((0,s.A)((0,s.A)({},Rt),{},{firstname:e.target.value}))}})}),(0,re.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,re.jsx)(d.A,{error:da,inputRef:pe,fullWidth:!0,size:"small",type:"number",InputProps:{inputProps:{maxLength:10},startAdornment:(0,re.jsx)(m.A,{position:"start",children:(0,re.jsx)(I.dRU,{style:{color:da?"#ef4444":"#64748b"}})}),style:{borderRadius:"10px"}},variant:"outlined",label:"Contact Number",value:(null===Rt||void 0===Rt?void 0:Rt.contactno)||"",onChange:e=>{e.target.value.length<=10&&Dt((0,s.A)((0,s.A)({},Rt),{},{contactno:e.target.value})),oa==e.target.value?sa(0):sa(1),e.target.value.length<10?ua(!0):ua(!1)}})})]}),(0,re.jsx)(r.A,{className:"field-group-caption",sx:{mt:2},children:"Address Lookup"}),0==Tt?(0,re.jsx)(T.Ay,{id:"addressAuto1",fullWidth:!0,placeholder:"Search for an address...",value:te||"",onChange:ae,onPlaceSelected:e=>{ae("".concat(e.name,", ").concat(e.formatted_address)),Xe({latitude:e.geometry.location.lat(),longitude:e.geometry.location.lng()}),Dt((0,s.A)((0,s.A)({},Rt),{},{address:"".concat(e.name," ").concat(e.formatted_address)}));const t={address:"".concat(e.name," ").concat(e.formatted_address),street_number:"",route:"",locality:"",sublocality_level_1:"",administrative_area_level_3:"",administrative_area_level_1:"",country:"",postal_code:""};e.address_components.forEach((e=>{e.types.forEach((a=>{switch(a){case"street_number":t.street_number=e.long_name;break;case"route":t.route=e.long_name;break;case"locality":t.locality=e.long_name;break;case"sublocality_level_1":t.sublocality_level_1=e.long_name;break;case"administrative_area_level_3":t.administrative_area_level_3=e.long_name;break;case"administrative_area_level_1":t.administrative_area_level_1=e.long_name;break;case"country":t.country=e.long_name;break;case"postal_code":t.postal_code=e.long_name}}))})),Dt((0,s.A)((0,s.A)({},Rt),{},{address:t.address,doorno:"".concat(t.street_number," ").concat(t.route),suburb:t.sublocality_level_1,city:t.locality,postcode:t.postal_code,latitude:e.geometry.location.lat(),longitude:e.geometry.location.lng()}))},bias:{lat:Ut,lng:Vt},TextFieldProps:{size:"small",variant:"outlined",helperText:"Start typing to auto-fill the address details below",FormHelperTextProps:{className:"address-search-helper pickup-helper"},InputProps:{startAdornment:(0,re.jsx)(m.A,{position:"start",children:(0,re.jsx)(q.A,{style:{fontSize:15,color:"#662582"}})}),endAdornment:(0,re.jsx)(h.A,{onClick:()=>{ae(""),Dt((0,s.A)((0,s.A)({},Rt),{},{doorno:"",suburb:"",city:"",postcode:"",landmark:""})),$e(!1),Xe({latitude:0,longitude:0})},size:"small",children:(0,re.jsx)(P.A,{fontSize:"small"})}),style:{borderRadius:"10px",background:"#fff"}}}}):(0,re.jsx)(d.A,{variant:"outlined",fullWidth:!0,size:"small",helperText:"Saved address selected \xb7 clear to search again",FormHelperTextProps:{className:"address-search-helper pickup-helper"},InputProps:{startAdornment:(0,re.jsx)(m.A,{position:"start",children:(0,re.jsx)(R.sIY,{style:{fontSize:14,color:"#662582"}})}),endAdornment:(0,re.jsx)(h.A,{onClick:()=>{Yt(0),Dt((0,s.A)((0,s.A)({},Rt),{},{doorno:"",suburb:"",city:"",postcode:"",landmark:""})),$e(!1),Xe({latitude:0,longitude:0})},size:"small",children:(0,re.jsx)(D.A,{fontSize:"small"})}),style:{borderRadius:"10px",background:"#fff"}},value:(null===Rt||void 0===Rt?void 0:Rt.address)||"",onChange:e=>{Dt((0,s.A)((0,s.A)({},Rt),{},{address:e.target.value})),""==e.target.value&&(Yt(0),$e(!1),Xe({latitude:0,longitude:0}))}}),(0,re.jsx)(r.A,{className:"field-group-caption",sx:{mt:2},children:"Address Details"}),(0,re.jsxs)(u.Ay,{container:!0,spacing:1.5,sx:{mt:.5},children:[(0,re.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,re.jsx)(d.A,{fullWidth:!0,size:"small",InputProps:{startAdornment:(0,re.jsx)(m.A,{position:"start",children:(0,re.jsx)(w.V92,{style:{color:"#64748b",fontSize:"20px"}})}),style:{borderRadius:"10px"}},variant:"outlined",label:"Door No / Street",value:(null===Rt||void 0===Rt?void 0:Rt.doorno)||"",onChange:e=>{Dt((0,s.A)((0,s.A)({},Rt),{},{doorno:e.target.value}))}})}),(0,re.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,re.jsx)(d.A,{fullWidth:!0,size:"small",InputProps:{startAdornment:(0,re.jsx)(m.A,{position:"start",children:(0,re.jsx)(R.sIY,{style:{color:"#64748b"}})}),style:{borderRadius:"10px"}},variant:"outlined",label:"Location",value:(null===Rt||void 0===Rt?void 0:Rt.suburb)||"",onChange:e=>{Dt((0,s.A)((0,s.A)({},Rt),{},{suburb:e.target.value}))}})}),(0,re.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,re.jsx)(d.A,{fullWidth:!0,size:"small",InputProps:{startAdornment:(0,re.jsx)(m.A,{position:"start",children:(0,re.jsx)(z.BND,{style:{color:"#64748b",fontSize:"20px"}})}),style:{borderRadius:"10px"}},variant:"outlined",label:"Postcode",value:(null===Rt||void 0===Rt?void 0:Rt.postcode)||"",onChange:e=>{Dt((0,s.A)((0,s.A)({},Rt),{},{postcode:e.target.value}))}})}),(0,re.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,re.jsx)(d.A,{fullWidth:!0,size:"small",InputProps:{startAdornment:(0,re.jsx)(m.A,{position:"start",children:(0,re.jsx)(R.Ndh,{style:{color:"#64748b"}})}),style:{borderRadius:"10px"}},variant:"outlined",label:"Landmark",value:(null===Rt||void 0===Rt?void 0:Rt.landmark)||"",onChange:e=>{Dt((0,s.A)((0,s.A)({},Rt),{},{landmark:e.target.value}))}})})]}),1==aa&&(0,re.jsx)(o.A,{sx:{display:"flex",justifyContent:"flex-end",mt:1},children:(0,re.jsx)(o.A,{className:"save-later-pill",children:(0,re.jsx)(x.A,{control:(0,re.jsx)(g.A,{size:"small",checked:1===$t,onChange:e=>{Jt(e.target.checked?1:0)}}),label:"Save contact for later"})})}),(0,re.jsxs)(o.A,{className:"step-nav",children:[(0,re.jsx)(r.A,{className:"step-nav-hint",children:wa?"Pickup looks good. Proceed to Drop details.":"Fill the required Pickup fields to continue."}),(0,re.jsx)(p.A,{className:"step-nav-btn step-nav-next",disabled:!wa,endIcon:(0,re.jsx)(I.Z0P,{style:{fontSize:12}}),onClick:()=>Ia(2),children:"Continue to Drop"})]})]}),(0,re.jsxs)(o.A,{className:"location-panel drop-panel",sx:{display:2===Ca?"block":"none"},children:[(0,re.jsxs)(o.A,{className:"lp-header",children:[(0,re.jsxs)(o.A,{className:"lp-header-title",children:[(0,re.jsx)(o.A,{className:"lp-badge",children:(0,re.jsx)(R.sIY,{})}),(0,re.jsxs)(o.A,{children:[(0,re.jsx)(r.A,{className:"lp-title",children:"Drop"}),(0,re.jsx)(r.A,{className:"lp-subtitle",children:"Where to deliver the parcel"})]})]}),(0,re.jsx)(o.A,{className:"lp-header-actions",children:(0,re.jsx)(p.A,{className:"lp-action-btn",size:"small",disabled:!ft,startIcon:(0,re.jsx)(q.A,{style:{fontSize:13}}),onClick:()=>{xe||At||ft?xe||At?xe?(_t(!0),Lt(2),ne("")):(0,J.k)("Please select Location!","warning",3e3):(0,J.k)("Please select Location and Tenant!","warning",3e3):(0,J.k)("Please select Location, Tenant and Business!","warning",3e3)},children:"From Saved"})})]}),(0,re.jsx)(r.A,{className:"field-group-caption",children:"Contact"}),(0,re.jsxs)(u.Ay,{container:!0,spacing:1.5,sx:{mt:.5},children:[(0,re.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,re.jsx)(d.A,{inputRef:he,fullWidth:!0,size:"small",variant:"outlined",label:"Contact Name",InputProps:{startAdornment:(0,re.jsx)(m.A,{position:"start",children:(0,re.jsx)(R.x$1,{style:{color:"#64748b"}})}),style:{borderRadius:"10px"}},value:(null===Et||void 0===Et?void 0:Et.firstname)||"",onChange:e=>{zt((0,s.A)((0,s.A)({},Et),{},{firstname:e.target.value}))}})}),(0,re.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,re.jsx)(d.A,{error:pa,fullWidth:!0,size:"small",type:"number",variant:"outlined",label:"Contact Number",InputProps:{startAdornment:(0,re.jsx)(m.A,{position:"start",children:(0,re.jsx)(I.dRU,{style:{color:pa?"#ef4444":"#64748b"}})}),style:{borderRadius:"10px"}},value:(null===Et||void 0===Et?void 0:Et.contactno)||"",onChange:e=>{e.target.value.length<=10&&zt((0,s.A)((0,s.A)({},Et),{},{contactno:e.target.value})),ra==e.target.value?la(0):la(1),e.target.value.length<10?ma(!0):ma(!1)}})})]}),(0,re.jsx)(r.A,{className:"field-group-caption",sx:{mt:2},children:"Address Lookup"}),0==Ft?(0,re.jsx)(T.Ay,{id:"addressAuto2",placeholder:"Search for an address...",fullWidth:!0,value:se||"",onChange:ne,onPlaceSelected:e=>{ne("".concat(e.name,", ").concat(e.formatted_address)),Ge({latitude:e.geometry.location.lat(),longitude:e.geometry.location.lng()}),zt((0,s.A)((0,s.A)({},Et),{},{address:"".concat(e.name," ").concat(e.formatted_address)}));const t={address:"".concat(e.name," ").concat(e.formatted_address),street_number:"",route:"",locality:"",sublocality_level_1:"",administrative_area_level_3:"",administrative_area_level_1:"",country:"",postal_code:""};e.address_components.forEach((e=>{e.types.forEach((a=>{switch(a){case"street_number":t.street_number=e.long_name;break;case"route":t.route=e.long_name;break;case"locality":t.locality=e.long_name;break;case"sublocality_level_1":t.sublocality_level_1=e.long_name;break;case"administrative_area_level_3":t.administrative_area_level_3=e.long_name;break;case"administrative_area_level_1":t.administrative_area_level_1=e.long_name;break;case"country":t.country=e.long_name;break;case"postal_code":t.postal_code=e.long_name}}))})),zt((0,s.A)((0,s.A)({},Et),{},{address:t.address,doorno:"".concat(t.street_number," ").concat(t.route),suburb:t.sublocality_level_1,city:t.locality,postcode:t.postal_code,latitude:e.geometry.location.lat(),longitude:e.geometry.location.lng()}))},bias:{lat:Ut,lng:Vt},TextFieldProps:{size:"small",variant:"outlined",helperText:"Start typing to auto-fill the address details below",FormHelperTextProps:{className:"address-search-helper drop-helper"},InputProps:{startAdornment:(0,re.jsx)(m.A,{position:"start",children:(0,re.jsx)(q.A,{style:{fontSize:15,color:"#65387a"}})}),endAdornment:(0,re.jsx)(h.A,{onClick:()=>{ne(""),zt((0,s.A)((0,s.A)({},Et),{},{doorno:"",suburb:"",city:"",postcode:"",landmark:""})),$e(!1),Ge({latitude:0,longitude:0})},size:"small",children:(0,re.jsx)(P.A,{fontSize:"small"})}),style:{borderRadius:"10px",background:"#fff"}}}}):(0,re.jsx)(d.A,{variant:"outlined",fullWidth:!0,size:"small",helperText:"Saved address selected \xb7 clear to search again",FormHelperTextProps:{className:"address-search-helper drop-helper"},InputProps:{startAdornment:(0,re.jsx)(m.A,{position:"start",children:(0,re.jsx)(R.sIY,{style:{fontSize:14,color:"#65387a"}})}),endAdornment:(0,re.jsx)(h.A,{onClick:()=>{Wt(0),zt((0,s.A)((0,s.A)({},Et),{},{doorno:"",suburb:"",city:"",postcode:"",landmark:""})),$e(!1),Ge({latitude:0,longitude:0})},size:"small",children:(0,re.jsx)(D.A,{fontSize:"small"})}),style:{borderRadius:"10px",background:"#fff"}},value:(null===Et||void 0===Et?void 0:Et.address)||"",onChange:e=>{zt((0,s.A)((0,s.A)({},Et),{},{address:e.target.value})),""==e.target.value&&(Wt(0),$e(!1),Ge({latitude:0,longitude:0}))}}),(0,re.jsx)(r.A,{className:"field-group-caption",sx:{mt:2},children:"Address Details"}),(0,re.jsxs)(u.Ay,{container:!0,spacing:1.5,sx:{mt:.5},children:[(0,re.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,re.jsx)(d.A,{fullWidth:!0,size:"small",variant:"outlined",label:"Door No / Street",InputProps:{startAdornment:(0,re.jsx)(m.A,{position:"start",children:(0,re.jsx)(w.V92,{style:{color:"#64748b",fontSize:"20px"}})}),style:{borderRadius:"10px"}},value:(null===Et||void 0===Et?void 0:Et.doorno)||"",onChange:e=>{zt((0,s.A)((0,s.A)({},Et),{},{doorno:e.target.value}))}})}),(0,re.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,re.jsx)(d.A,{fullWidth:!0,size:"small",variant:"outlined",label:"Location",InputProps:{startAdornment:(0,re.jsx)(m.A,{position:"start",children:(0,re.jsx)(R.sIY,{style:{color:"#64748b"}})}),style:{borderRadius:"10px"}},value:(null===Et||void 0===Et?void 0:Et.suburb)||"",onChange:e=>{zt((0,s.A)((0,s.A)({},Et),{},{suburb:e.target.value}))}})}),(0,re.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,re.jsx)(d.A,{fullWidth:!0,size:"small",variant:"outlined",label:"Postcode",InputProps:{startAdornment:(0,re.jsx)(m.A,{position:"start",children:(0,re.jsx)(z.BND,{style:{color:"#64748b",fontSize:"20px"}})}),style:{borderRadius:"10px"}},value:(null===Et||void 0===Et?void 0:Et.postcode)||"",onChange:e=>{zt((0,s.A)((0,s.A)({},Et),{},{postcode:e.target.value}))}})}),(0,re.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,re.jsx)(d.A,{fullWidth:!0,size:"small",variant:"outlined",label:"Landmark",InputProps:{startAdornment:(0,re.jsx)(m.A,{position:"start",children:(0,re.jsx)(R.Ndh,{style:{color:"#64748b"}})}),style:{borderRadius:"10px"}},value:(null===Et||void 0===Et?void 0:Et.landmark)||"",onChange:e=>{zt((0,s.A)((0,s.A)({},Et),{},{landmark:e.target.value}))}})})]}),1==na&&(0,re.jsx)(o.A,{sx:{display:"flex",justifyContent:"flex-end",mt:1},children:(0,re.jsx)(o.A,{className:"save-later-pill",children:(0,re.jsx)(x.A,{control:(0,re.jsx)(g.A,{size:"small",checked:1===ea,onChange:e=>{ta(e.target.checked?1:0)}}),label:"Save contact for later"})})}),(0,re.jsxs)(o.A,{className:"step-nav",children:[(0,re.jsx)(p.A,{className:"step-nav-btn step-nav-back",startIcon:(0,re.jsx)(I.QVr,{style:{fontSize:12}}),onClick:()=>Ia(1),children:"Back to Pickup"}),(0,re.jsx)(r.A,{className:"step-nav-hint",children:"Review the route below once Drop is filled."})]})]})]})]}),(0,re.jsxs)(i.A,{className:"orders-card",sx:{p:{xs:1.5,sm:1.75,lg:2}},children:[(0,re.jsx)(o.A,{className:"section-title-bar",sx:{mb:1.25},children:(0,re.jsx)(r.A,{sx:{fontWeight:700,color:"#1e293b",fontSize:"15px",letterSpacing:"-0.01em"},children:"Cargo & Dispatch Logistics"})}),(0,re.jsxs)(u.Ay,{container:!0,spacing:1.5,alignItems:"stretch",children:[(0,re.jsx)(u.Ay,{item:!0,xs:12,sx:{pt:"0 !important"},children:(0,re.jsxs)(o.A,{sx:{display:"flex",alignItems:"center",gap:1,mb:.25},children:[(0,re.jsx)(r.A,{sx:{fontWeight:700,fontSize:"10.5px",color:"#64748b",letterSpacing:"0.7px",textTransform:"uppercase"},children:"Cargo Details"}),(0,re.jsx)(o.A,{sx:{flex:1,height:"1px",background:"linear-gradient(90deg, #eef2f6 0%, transparent 100%)"}})]})}),(0,re.jsx)(u.Ay,{item:!0,xs:12,sm:4,children:(0,re.jsx)(A.A,{children:(0,re.jsx)(c.A,{id:"combo-box-demo",size:"small",options:ct,getOptionLabel:e=>(null===e||void 0===e?void 0:e.subcategoryname)||"",fullWidth:!0,sx:{"& .MuiOutlinedInput-root":{borderRadius:"12px",height:"38px",paddingTop:"0px !important",paddingBottom:"0px !important"}},renderInput:e=>(0,re.jsx)(d.A,(0,s.A)((0,s.A)({},e),{},{label:"Category",size:"small",InputLabelProps:{shrink:!0},sx:{"& .MuiOutlinedInput-root":{borderRadius:"12px",height:"38px"}},InputProps:(0,s.A)((0,s.A)({},e.InputProps),{},{startAdornment:(0,re.jsxs)(re.Fragment,{children:[(0,re.jsx)(I.TXh,{style:{color:"#94a3b8",fontSize:13,marginRight:6,marginLeft:2,flexShrink:0}}),e.InputProps.startAdornment]})})})),onChange:(e,t,a)=>{t?(console.log(t),pt(t.subcategoryname||""),ht(t.subcategoryid||0)):a&&(pt(null),ht(null))}})})}),(0,re.jsx)(u.Ay,{item:!0,xs:12,sm:4,children:(0,re.jsx)(A.A,{children:(0,re.jsx)(d.A,{type:"number",size:"small",value:ga,fullWidth:!0,label:"Cash Collect",InputLabelProps:{shrink:!0},onChange:e=>{Aa(e.target.value)},inputProps:{min:0},sx:{"& .MuiOutlinedInput-root":{borderRadius:"12px",height:"38px"}},InputProps:{startAdornment:(0,re.jsx)(m.A,{position:"start",children:(0,re.jsx)(o.A,{sx:{color:"#94a3b8",fontWeight:700,fontSize:14,lineHeight:1},children:"\u20b9"})})}})})}),(0,re.jsx)(u.Ay,{item:!0,xs:12,sm:4,children:(0,re.jsx)(A.A,{children:(0,re.jsx)(d.A,{type:"number",size:"small",value:va,fullWidth:!0,label:"Quantity",InputLabelProps:{shrink:!0},onChange:e=>{fa(e.target.value)},inputProps:{min:1},sx:{"& .MuiOutlinedInput-root":{borderRadius:"12px",height:"38px"}},InputProps:{startAdornment:(0,re.jsx)(m.A,{position:"start",children:(0,re.jsx)(I.H5e,{style:{color:"#94a3b8",fontSize:14}})})}})})}),(0,re.jsx)(u.Ay,{item:!0,xs:12,sx:{mt:.5,pb:0},children:(0,re.jsxs)(o.A,{sx:{display:"flex",alignItems:"center",gap:1,mb:.5},children:[(0,re.jsxs)(r.A,{sx:{display:"flex",alignItems:"center",gap:.75,fontWeight:700,fontSize:"10.5px",color:"#64748b",letterSpacing:"0.7px",textTransform:"uppercase"},children:[(0,re.jsx)(K.A,{style:{fontSize:"11px",color:"#65387a"}}),"Schedule Details"]}),(0,re.jsx)(o.A,{sx:{flex:1,height:"1px",background:"linear-gradient(90deg, #eef2f6 0%, transparent 100%)"}})]})}),(0,re.jsx)(u.Ay,{item:!0,xs:12,sx:{pt:"0px !important"},children:(0,re.jsxs)(u.Ay,{container:!0,spacing:1.5,sx:{mt:.5},children:[(0,re.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,re.jsx)(W.$,{dateAdapter:H.R,children:(0,re.jsx)(F.l,{label:"Pickup Date",format:"DD-MM-YYYY",onChange:e=>{let t=B()().diff(B()("".concat(B()(e).format("YYYY-MM-DD"))),"d");if(Be(""),t<=0){ye(e);let t=[];Ne.map((a=>{B()().diff(B()("".concat(B()(e).format("MM-DD-YYYY")," ").concat(B()(a).format("HH:mm:ss"))),"m")<=0&&t.push(a)}))}else Ye("choose Upcoming Date"),Ea("choose Upcoming Date","warning"),ye(NaN)},value:B()(be),sx:{width:"100%","& .MuiOutlinedInput-root":{borderRadius:"12px",height:"38px"}},slotProps:{textField:{size:"small",fullWidth:!0,InputLabelProps:{shrink:!0},InputProps:{startAdornment:(0,re.jsx)(m.A,{position:"start",children:(0,re.jsx)(K.A,{style:{color:"#94a3b8",fontSize:"13px"}})})},sx:{"& .MuiOutlinedInput-root":{borderRadius:"12px",height:"38px",paddingLeft:"10px"}}}},disablePast:!0})})}),(0,re.jsx)(u.Ay,{item:!0,xs:12,sm:6,children:(0,re.jsx)(c.A,{size:"small",fullWidth:!0,options:_a||[],sx:{width:"100%","& .MuiOutlinedInput-root":{borderRadius:"12px",height:"38px",paddingTop:"0px !important",paddingBottom:"0px !important"}},onChange:(e,t,a)=>{if("clear"!==a&&t){const e=B()(t.time,"HH:mm").format("hh:mm A");Be(e);const a=B()("".concat(be," ").concat(e),"MM-DD-YYYY hh:mm A").format("YYYY-MM-DD hh:mm A");Na(a)}else Be(null),Na(null)},getOptionLabel:e=>e?"".concat(e.name," (").concat(B()(e.time,"HH:mm").format("hh:mm A"),")"):"",renderInput:e=>(0,re.jsx)(d.A,(0,s.A)((0,s.A)({},e),{},{label:"Pickup Time Slot",placeholder:"Select Pickup Slot",fullWidth:!0,InputLabelProps:{shrink:!0},sx:{"& .MuiOutlinedInput-root":{borderRadius:"12px",height:"38px"}},InputProps:(0,s.A)((0,s.A)({},e.InputProps),{},{startAdornment:(0,re.jsxs)(re.Fragment,{children:[(0,re.jsx)(X.A,{style:{color:"#94a3b8",fontSize:"13px",marginRight:"6px",marginLeft:"2px",flexShrink:0}}),e.InputProps.startAdornment]})})}))})})]})})]})]})]}),(0,re.jsx)(u.Ay,{item:!0,xs:12,lg:4.5,sx:{position:{lg:"sticky"},top:{lg:"24px"},height:"fit-content"},children:(0,re.jsxs)(A.A,{spacing:2,children:[(0,re.jsxs)(i.A,{className:"orders-card",sx:{p:1.5,display:"flex",flexDirection:"column"},children:[(0,re.jsxs)(r.A,{sx:{fontWeight:700,mb:1.25,display:"flex",alignItems:"center",gap:.75,color:"#1e293b",fontSize:"14px",letterSpacing:"-0.01em"},children:[(0,re.jsx)(Q.A,{sx:{color:"#662582",fontSize:16}}),"Live Route Preview"]}),(0,re.jsx)("div",{className:"map-preview-wrapper",children:(0,re.jsx)(me,{startPoint:Ke,endPoint:Ze,appLocaLat:Ut,appLocaLng:Vt})})]}),(0,re.jsxs)(i.A,{className:"orders-card delivery-prefs-card",sx:{p:1.5},children:[(0,re.jsxs)(o.A,{className:"delivery-prefs-header",children:[(0,re.jsx)(r.A,{className:"delivery-prefs-title",children:"Delivery Preferences"}),(0,re.jsx)(r.A,{className:"delivery-prefs-sub",children:"Customer notifications & dispatch instructions"})]}),(0,re.jsxs)(o.A,{className:"delivery-prefs-row",children:[(0,re.jsxs)(o.A,{className:"delivery-prefs-field",children:[(0,re.jsxs)("label",{className:"delivery-prefs-label",htmlFor:"dispatch-notes-input",children:[(0,re.jsx)(Z.A,{style:{fontSize:11,color:"#65387a"}}),"Special Dispatch Notes"]}),(0,re.jsx)(d.A,{id:"dispatch-notes-input",size:"small",fullWidth:!0,placeholder:"Gate codes, call instructions, special cargo care\u2026",value:Ie,onChange:e=>we(e.target.value),sx:{"& .MuiOutlinedInput-root":{borderRadius:"10px",padding:"0 10px",alignItems:"center",fontSize:"12px",background:"#ffffff",height:"32px"},"& .MuiOutlinedInput-input":{padding:"0 !important",fontSize:"12px !important",lineHeight:"32px"}}})]}),(0,re.jsxs)(o.A,{className:"sms-toggle-tile ".concat(1===ha?"is-active":""),onClick:()=>xa(1===ha?0:1),role:"button",tabIndex:0,children:[(0,re.jsxs)(o.A,{className:"sms-toggle-left",children:[(0,re.jsx)(o.A,{className:"sms-toggle-icon",children:(0,re.jsx)(G.A,{style:{fontSize:13}})}),(0,re.jsxs)(o.A,{sx:{minWidth:0},children:[(0,re.jsx)(r.A,{className:"sms-toggle-title",children:"SMS Updates"}),(0,re.jsx)(r.A,{className:"sms-toggle-sub",children:"Auto-notify customer on dispatch & delivery"})]})]}),(0,re.jsx)(v.A,{size:"small",checked:1===ha,onChange:e=>{e.stopPropagation(),xa(e.target.checked?1:0)}})]})]})]}),(0,re.jsxs)(i.A,{className:"orders-card pricing-summary-card",children:[(0,re.jsxs)(o.A,{className:"pricing-header",children:[(0,re.jsx)(r.A,{className:"pricing-title",children:"Pricing & Dispatch"}),(0,re.jsx)(r.A,{className:"pricing-subtitle",children:"Live cost estimate"})]}),(0,re.jsxs)("div",{className:"price-metric-item",children:[(0,re.jsxs)("div",{className:"price-metric-label",children:[(0,re.jsx)("span",{className:"price-metric-icon icon-distance",children:(0,re.jsx)(I.$Fg,{})}),(0,re.jsx)("span",{children:"Delivery Distance"})]}),(0,re.jsx)("div",{className:"price-metric-value ".concat(Qe?"highlight":""),children:Qe?"".concat(Je," km"):"\u2014"})]}),(0,re.jsxs)("div",{className:"price-metric-item",children:[(0,re.jsxs)("div",{className:"price-metric-label",children:[(0,re.jsx)("span",{className:"price-metric-icon icon-base",children:(0,re.jsx)(I.MxO,{})}),(0,re.jsxs)("span",{children:["Base Fare",(0,re.jsxs)("span",{className:"price-metric-sub",children:[" \xb7 ",lt," km"]})]})]}),(0,re.jsx)("div",{className:"price-metric-value",children:tt?"\u20b9".concat(tt.toFixed(2)):"\u20b90.00"})]}),(0,re.jsxs)("div",{className:"price-metric-item",children:[(0,re.jsxs)("div",{className:"price-metric-label",children:[(0,re.jsx)("span",{className:"price-metric-icon icon-rate",children:(0,re.jsx)(I.YYR,{})}),(0,re.jsx)("span",{children:"Rate per km"})]}),(0,re.jsxs)("div",{className:"price-metric-value",children:[st?"\u20b9".concat(st.toFixed(2)):"\u20b90.00",(0,re.jsx)("span",{className:"price-metric-unit",children:"/km"})]})]}),Qe&&(0,re.jsxs)("div",{className:"total-charge-badge",children:[(0,re.jsxs)("div",{className:"total-charge-left",children:[(0,re.jsx)(I.wTh,{className:"total-charge-icon"}),(0,re.jsx)("div",{className:"total-charge-label",children:"Total Delivery Charge"})]}),(0,re.jsxs)("div",{className:"total-charge-val",children:["\u20b9",it.toFixed(2)]})]}),(0,re.jsx)(o.A,{sx:{mt:1.5},children:(0,re.jsx)(ie.A,{children:(0,re.jsx)(p.A,{fullWidth:!0,className:"gradient-btn-create",disabled:!Qe||!Ue||!Pa,startIcon:!Me&&(0,re.jsx)(I.Cer,{style:{fontSize:11}}),onClick:()=>{ze(!0),Le(!0),(async()=>{let t={};if(t={orders:{applocationid:He.applolcationid,cancellled:"",categoryid:+He.categoryid,configid:9,customerid:0==$t&&+Rt.customerid||0,deliveryaddress:Et.address||"",deliverycharge:+it.toFixed(2)||0,deliverycity:Et.city||"",deliverycontactno:Et.contactno||"",deliverycustomer:Et.firstname||"",deliveryid:0==ea&&+Et.customerid||0,deliverylandmark:Et.landmark||"",deliverylat:Et.latitude.toString(),deliverylocation:Et.suburb||"",deliverylocationid:Et.deliverylocationid||0,deliverylong:Et.longitude.toString(),deliverytime:"".concat(B()(be).format("YYYY-MM-DD")," ").concat(B()(Ue.$d).format("HH:mm:ss")),deliverytype:"B",delivered:"",itemcount:1,kms:Je.toString()||0,locationid:+ft,moduleid:+He.moduleid,orderamount:+it.toFixed(2)||0,ordercharges:0,orderdate:B()().format("YYYY-MM-DD HH:mm:ss"),ordernotes:Ie,orderstatus:"created",ordervalue:+it.toFixed(2)||0,partnerid:He.partnerid,partneruserid:+Qt,paymentstatus:1,paymenttype:42,pickupaddress:Rt.address||"",pickupcity:Rt.city||"",pickupcontactno:Rt.contactno||"",pickupcustomer:Rt.firstname||"",pickuplandmark:Rt.landmark||"",pickuplat:Rt.latitude.toString()||"",pickuplocation:Rt.suburb||"",pickuplocationid:Rt.deliverylocationid||0,pickuplong:Rt.longitude.toString()||"",smsdelivery:ha,subcategoryid:+mt,tenantid:He.tenantid,collectionamt:+ga,quantity:+va,weight:xt,pickupSlot:Pa},pickup:{address:Rt.address||"",applocationid:He.applolcationid,city:Rt.city||"",configid:1,contactno:Rt.contactno||"",customertoken:"",customerid:0==$t&&Rt.customerid||0,devicetype:"",deviceid:"",dialcode:"+91",doorno:Rt.doorno||"",email:Rt.email||"",firstname:Rt.firstname||"",landmark:Rt.landmark||"",latitude:Rt.latitude.toString()||"",longitude:Rt.longitude.toString()||"",postcode:Rt.postcode||"",primaryaddress:1,locationid:Rt.deliverylocationid||0,profileimage:"",state:Rt.state||"",suburb:Rt.suburb||"",tenantid:He.tenantid},drop:{address:Et.address||"",applocationid:He.applolcationid,city:Et.city||"",configid:1,contactno:Et.contactno||"",customertoken:"",customerid:0==ea&&Et.customerid||0,devicetype:"",deviceid:"",locationid:Et.deliverylocationid||0,dialcode:"+91",doorno:Et.doorno||"",email:Et.email||"",firstname:Et.firstname||"",landmark:Et.landmark||"",latitude:Et.latitude.toString(),longitude:Et.longitude.toString(),postcode:Et.postcode||"",primaryaddress:1,profileimage:"",state:Et.state||"",suburb:Et.suburb||"",tenantid:He.tenantid}},console.log("createsubmitobj2",t),Rt.firstname)if(Rt.contactno)if(10!=Rt.contactno.length)Ea("Check Pickup Contact Number ","error",2e3);else if(Rt.suburb)if(Rt.city)if(Rt.postcode)if(Rt.landmark)if(Et.firstname)if(Et.contactno)if(10!==Et.contactno.length)Ea("Check Drop Contact Number ","error",2e3);else if(Et.suburb)if(Et.city)if(Et.postcode)if(Et.landmark)if(Ue)if(ht)try{const a=await M.A.post("".concat("https://jupiter.nearle.app/live/api/v2","/orders/createorder"),t);a.data.status?(console.log("createRes",a),(0,V.M8)("Order Created Successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:1e3}),Fe&&Ma(),e("/nearle/orders")):Ea("Error in creating orders","warning"),ze(!1)}catch(a){Ea(a.message,"warning"),console.log("createResErr",a)}else Ea("Choose SubCategory ","warning",2e3);else Ea("Choose deliverytime ","warning",2e3);else Ea("Enter Drop Landmark ","warning",2e3);else Ea("Enter Drop postcode ","warning",2e3);else Ea("Enter Drop City ","warning",2e3);else Ea("Enter Drop Suburb ","warning",2e3);else Ea("Enter Drop Contact Number","warning",2e3);else Ea("Enter Drop Contact Name ","warning",2e3);else Ea("Enter Pickup Landmark ","warning",2e3);else Ea("Enter Pickup Postcode ","warning",2e3);else Ea("Enter Pickup City ","warning",2e3);else Ea("Enter Pickup Location ","warning",2e3);else Ea("Enter Pickup Contact Number ","warning",2e3);else Ea("Enter Pickup Contact Name ","warning",2e3)})(),setTimeout((()=>{ze(!1),Le(!1)}),2e3)},children:Me?(0,re.jsx)(f.A,{color:"inherit",size:16,thickness:5}):"Dispatch Delivery Order"})})})]})]})})]})]}),(0,re.jsxs)(O.A,{open:St,onClose:()=>{_t(!1),Pt("")},fullWidth:!0,fullScreen:a,sx:{"& .MuiDialog-paper":{borderRadius:{xs:0,sm:"16px"},overflow:"hidden"}},children:[(0,re.jsx)(j.A,{sx:{background:"linear-gradient(135deg, #662582 0%, #9255AB 100%)",color:"white",py:2.5},children:(0,re.jsxs)(A.A,{spacing:1.5,children:[(0,re.jsx)(r.A,{variant:"h4",sx:{fontWeight:600,color:"white"},children:"Select Saved Address (".concat(1===Mt?"Pickup":"Drop",")")}),(0,re.jsx)(b.A,{sx:{width:"100%"},children:(0,re.jsx)(y.A,{autoFocus:!0,fullWidth:!0,id:"input-search-header",placeholder:"Search by name, contact, or address...",value:kt,onChange:e=>Pt(e.target.value),sx:{bgcolor:"white",borderRadius:"10px","& .MuiOutlinedInput-input":{p:"10px 14px"}},startAdornment:(0,re.jsx)(m.A,{position:"start",children:(0,re.jsx)(q.A,{style:{fontSize:"small",color:"#64748b"}})}),endAdornment:(0,re.jsx)(h.A,{sx:{visibility:kt?"visible":"hidden",p:.5},onClick:()=>{Pt("")},children:(0,re.jsx)(D.A,{style:{fontSize:"18px"}})}),autoComplete:"off"})})]})}),(0,re.jsx)(S.A,{}),(0,re.jsx)(_.A,{sx:{p:3,maxHeight:"600px",overflowY:"auto",bgcolor:"#fafbfc"},children:0==(null===Nt||void 0===Nt?void 0:Nt.length)?(0,re.jsx)(A.A,{spacing:2,direction:"row",alignItems:"center",justifyContent:"center",sx:{minHeight:300},children:(0,re.jsx)(C.A,{description:"No saved addresses found for this client"})}):(0,re.jsx)(o.A,{children:Nt&&Nt.map(((e,t)=>(0,re.jsx)(p.A,{className:"address-card-btn",onClick:()=>{_t(!1),Pt(""),1===Mt?(console.log("PickupClient",e),Yt(1),Xe({latitude:e.latitude,longitude:e.longitude}),Dt(e),ia(e.contactno)):(console.log("DropClient",e),Wt(1),Ge({latitude:e.latitude,longitude:e.longitude}),zt(e),ca(e.contactno))},disabled:(null===Rt||void 0===Rt?void 0:Rt.customerid)===e.customerid,children:(0,re.jsxs)("div",{style:{width:"100%",display:"flex",flexDirection:"column"},children:[(0,re.jsx)(r.A,{variant:"subtitle1",sx:{textAlign:"left",fontWeight:600,color:"#1e293b"},children:"".concat(e.firstname," (").concat(e.contactno,")")}),(0,re.jsx)(r.A,{variant:"body2",sx:{textAlign:"left",color:"#64748b",mt:.5,lineHeight:1.4},children:e.address})]})},t)))})}),(0,re.jsx)(S.A,{}),(0,re.jsx)(k.A,{sx:{p:2.5,bgcolor:"#fafbfc"},children:(0,re.jsx)(p.A,{color:"error",variant:"outlined",sx:{borderRadius:"8px",textTransform:"none",px:3,"&:hover":{bgcolor:"#ef4444",color:"white",borderColor:"#ef4444"}},onClick:()=>{_t(!1),Pt("")},children:"Cancel"})})]}),(0,re.jsxs)(O.A,{open:Ae,onClose:()=>{ve(!1)},fullWidth:!0,sx:{"& .MuiDialog-paper":{borderRadius:{xs:3,sm:"16px"},p:1.5,m:{xs:1.5,sm:4},width:{xs:"calc(100% - 24px)",sm:"auto"},maxWidth:"400px"}},children:[(0,re.jsxs)(j.A,{sx:{textAlign:"center",pb:1},children:[(0,re.jsx)($.A,{sx:{fontSize:70,color:t.palette.error.main,mb:1}}),(0,re.jsx)(r.A,{variant:"h3",sx:{color:t.palette.error.main,fontWeight:700},children:"Dispatch Blocked"})]}),(0,re.jsx)(_.A,{sx:{textAlign:"center",pb:2},children:(0,re.jsx)(r.A,{variant:"body1",sx:{color:"#64748b",lineHeight:1.5},children:"Our delivery partners cannot service this coordinate combination. The route distance exceeds the active operating radius for this app location."})}),(0,re.jsx)(k.A,{sx:{bgcolor:t.palette.error.main,borderRadius:"12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"16px",fontWeight:600,color:"white",cursor:"pointer",py:1.5,mx:2.5,mb:2,transition:"background-color 0.2s ease","&:hover":{bgcolor:t.palette.error.dark}},onClick:()=>{ve(!1)},children:"Acknowledge & Close"})]})]})}}}]);