"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[4776],{84776:function(e,n,t){t.r(n);var i=t(1413),r=t(93433),s=t(74165),o=t(15861),a=t(29439),c=t(47313),l=t(58467),d=t(56573),_=t(42897),A=t(41627),E=t(24904),x=t(76035),P=t(58873),h=t(26446),u=t(10165),C=t(94469),R=t(42832),T=t(48119),f=t(61113),p=t(96467),S=t(99881),Z=t(33249),g=t(90891),I=t(16783),j=t(69099),m=t(33604),v=t(9019),D=t(85281),b=t(51629),O=t(66835),y=t(23477),L=t(24076),H=t(67478),F=t(57861),U=t(66212),M=t(44758),Y=t(61689),N=t(47131),B=t(4117),w=t(84488),k=t(1550),K=t(65033),z=t(19536),W=t(43909),G=t(25718),V=t(97316),q=t(11577),X=t(10658),Q=t.n(X),J=t(19860),$=t(50661),ee=t(11829),ne=t(25057),te=t(90842),ie=t(22539),re=t(57829),se=t(70501),oe=t(46417),ae=t(91635);Q().extend(ae);var ce=16,le="0 8px 24px rgba(15, 23, 42, 0.08)",de="#0f172a",_e="#64748b",Ae="#94a3b8",Ee="#e2e8f0",xe="#f8fafc",Pe=function(e,n){return"".concat(e).concat(n)},he=function(e){return Pe(e,"08")},ue=function(e){return Pe(e,"26")},Ce=function(e){return Pe(e,"55")},Re="#662582",Te="#9255AB",fe={pending:{label:"Pending",color:"#f59e0b",icon:ie.Ley},assigned:{label:"Assigned",color:"#0ea5e9",icon:ie.Z5O},confirmed:{label:"Confirmed",color:"#10b981",icon:ie.ZSR},modified:{label:"Modified",color:"#06b6d4",icon:ie.Y8K},processing:{label:"Processing",color:Re,icon:ie.dKE},active:{label:"Active",color:"#8b5cf6",icon:ie.ili},closed:{label:"Closed",color:"#06b6d4",icon:ie.ZSR},completed:{label:"Completed",color:"#10b981",icon:ie.ZSR},cancelled:{label:"Cancelled",color:"#ef4444",icon:ie.B4e}},pe=function(e){var n=e.status,t=e.size,i=void 0===t?"md":t;if(!n)return null;var r=fe[String(n).toLowerCase()]||{label:n,color:Ae,icon:ie.Y8K},s=r.icon,o="lg"===i?1.25:1,a="lg"===i?.5:.375,c="lg"===i?12:11;return(0,oe.jsxs)(re.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:o,py:a,borderRadius:999,bgcolor:he(r.color),border:"1px solid ".concat(Ce(r.color)),color:r.color,fontSize:c,fontWeight:800,whiteSpace:"nowrap"},children:[(0,oe.jsx)(s,{size:12})," ",r.label]})};n.default=function(){var e=(0,c.useState)([]),n=(0,a.Z)(e,2),t=n[0],X=n[1],ae=(0,c.useState)(!0),Ae=(0,a.Z)(ae,2),Pe=Ae[0],fe=Ae[1],Se=(0,l.TH)(),Ze=(0,c.useState)(""),ge=(0,a.Z)(Ze,2),Ie=ge[0],je=ge[1],me=(0,c.useState)(""),ve=(0,a.Z)(me,2),De=ve[0],be=ve[1],Oe=(0,c.useState)(""),ye=(0,a.Z)(Oe,2),Le=ye[0],He=ye[1],Fe=(0,c.useState)(""),Ue=(0,a.Z)(Fe,2),Me=Ue[0],Ye=Ue[1],Ne=(0,c.useState)(!1),Be=(0,a.Z)(Ne,2),we=Be[0],ke=Be[1],Ke=(0,c.useState)(""),ze=(0,a.Z)(Ke,2),We=ze[0],Ge=ze[1],Ve=(0,c.useState)(""),qe=(0,a.Z)(Ve,2),Xe=qe[0],Qe=qe[1],Je=(0,c.useState)(!1),$e=(0,a.Z)(Je,2),en=$e[0],nn=$e[1],tn=(0,c.useState)(""),rn=(0,a.Z)(tn,2),sn=rn[0],on=rn[1],an=(0,c.useState)(""),cn=(0,a.Z)(an,2),ln=cn[0],dn=(cn[1],(0,c.useState)("")),_n=(0,a.Z)(dn,2),An=_n[0],En=_n[1],xn=(0,c.useState)(""),Pn=(0,a.Z)(xn,2),hn=Pn[0],un=Pn[1],Cn=(0,c.useState)(""),Rn=(0,a.Z)(Cn,2),Tn=Rn[0],fn=Rn[1],pn=(0,c.useState)(""),Sn=(0,a.Z)(pn,2),Zn=Sn[0],gn=Sn[1],In=(0,c.useState)([]),jn=(0,a.Z)(In,2),mn=jn[0],vn=jn[1],Dn=(0,c.useState)(""),bn=(0,a.Z)(Dn,2),On=bn[0],yn=bn[1],Ln=(0,c.useState)(""),Hn=(0,a.Z)(Ln,2),Fn=Hn[0],Un=Hn[1],Mn=(0,c.useState)([]),Yn=(0,a.Z)(Mn,2),Nn=Yn[0],Bn=Yn[1],wn=(0,c.useState)([]),kn=(0,a.Z)(wn,2),Kn=kn[0],zn=kn[1],Wn=(0,c.useState)(""),Gn=(0,a.Z)(Wn,2),Vn=Gn[0],qn=Gn[1],Xn=(0,c.useState)(""),Qn=(0,a.Z)(Xn,2),Jn=Qn[0],$n=Qn[1],et=(0,c.useState)(""),nt=(0,a.Z)(et,2),tt=nt[0],it=(nt[1],(0,c.useState)("")),rt=(0,a.Z)(it,2),st=rt[0],ot=(rt[1],(0,c.useState)("")),at=(0,a.Z)(ot,2),ct=at[0],lt=at[1],dt=(0,c.useState)(""),_t=(0,a.Z)(dt,2),At=_t[0],Et=(_t[1],(0,c.useState)("")),xt=(0,a.Z)(Et,2),Pt=xt[0],ht=(xt[1],(0,c.useState)([])),ut=(0,a.Z)(ht,2),Ct=ut[0],Rt=ut[1],Tt=(0,c.useState)({shifts:0,assigned:0,remaining:0,shiftid:0,price:0}),ft=(0,a.Z)(Tt,2),pt=ft[0],St=ft[1],Zt=(0,c.useState)(0),gt=(0,a.Z)(Zt,2),It=(gt[0],gt[1]),jt=(0,l.TH)().state,mt=(0,c.useState)(""),vt=(0,a.Z)(mt,2),Dt=vt[0],bt=vt[1],Ot=(0,l.s0)(),yt=(0,c.useState)(["",""]),Lt=(0,a.Z)(yt,2),Ht=Lt[0],Ft=Lt[1],Ut=(0,c.useState)(""),Mt=(0,a.Z)(Ut,2),Yt=Mt[0],Nt=Mt[1],Bt=(0,c.useState)(!1),wt=(0,a.Z)(Bt,2),kt=wt[0],Kt=wt[1];(0,c.useEffect)((function(){console.log("categoryarr"),console.log(t,De,Zn,tt,st)}),[Ct]),(0,c.useEffect)((function(){jt&&(qn(jt.orderheaderid),$n(jt.tenantid)),console.log(jt),console.log(Date.now())}),[]),(0,c.useEffect)((function(){jt&&(qn(jt.orderheaderid),$n(jt.tenantid)),console.log(jt),console.log(Date.now())}),[jt.orderheaderid,jt.tenantid]);var zt=(0,J.Z)(),Wt=function(){var e=(0,o.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return fe(!0),e.next=3,d.Z.get("".concat({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_GOOGLE_MAPS_API_KEY:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL2,"/orders/getordersbystatus?tenantid=").concat(Jn)).then((function(e){console.log(e);var n=e.data.Details.find((function(e){return e.orderheaderid==Vn}));console.log("result"),console.log(n),vn(n.orderaddons),gn(n.venuetype),yn(n.remarks),Nt(n.startdate),Ge(n.tenantname),be(""),Qe(n.tenantaddress),Ye(n.eventname),He(Q()(n.orderdate).format("MM/DD/YYYY")||""),je(n.orderid),on(n.orderstatus),En(n.taxamount),un(n.orderamount),fn(n.ordervalue),Un(Q()(n.cancelled).format("MM/DD/YYYY")||""),lt(n.pending),fe(!1)})).catch((function(e){console.log(e),fe(!1)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Gt=function(){var e=(0,o.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return fe(!0),e.next=3,d.Z.get("".concat({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_GOOGLE_MAPS_API_KEY:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL2,"/orders/getorderdetails?orderheaderid=").concat(Vn)).then((function(e){console.log("res"),console.log(e),X(e.data.Details||[]),console.log("categoryarr"),Rt(e.data.Details),console.log(e.data.Details),fe(!1)})).catch((function(e){console.log(e),fe(!1)}));case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Vt=function(){var e=(0,o.Z)((0,s.Z)().mark((function e(n){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return fe(!0),e.prev=1,e.next=4,d.Z.get("".concat({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_GOOGLE_MAPS_API_KEY:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL2,"/orders/getassignedinfo?orderdetailid=").concat(n)).then((function(e){console.log(e),e.data.status&&Bn(e.data.Details),fe(!1)})).catch((function(e){console.log(e),fe(!1)}));case 4:e.next=10;break;case 6:e.prev=6,e.t0=e.catch(1),console.log(e.t0),fe(!1);case 10:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(n){return e.apply(this,arguments)}}(),qt=function(){var e=(0,o.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.Z.put("".concat({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_GOOGLE_MAPS_API_KEY:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL2,"/orders/cancel"),{orderheaderid:parseInt(Vn),orderstatus:"cancelled",cancelled:Q()().format("YYYY-MM-DD HH:mm:ss"),unserviceable:kt?0:1}).then((function(e){console.log(e),e.data.status&&Vn&&Jn&&(Wt(),Gt())})).catch((function(e){console.log(e)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Xt=function(){var e=(0,o.Z)((0,s.Z)().mark((function e(n){var t;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={orderheaderid:Vn,orderprocessid:n.orderprocessid,orderdetailid:n.orderdetailid,orderstatus:"pending",pending:Q()().format("YYYY-MM-DD HH:mm:ss"),status:1},console.log(t),e.next=4,d.Z.put("".concat({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_GOOGLE_MAPS_API_KEY:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL2,"/orders/updateprocessstatus"),t).then((function(e){console.log(e),"Successful"===e.data.message&&((0,te.yv)("Role unassigned successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),pt.assigned>pt.shifts&&Qt(n),Wt(),Gt(),ke(!1),ti(),Jt(),setTimeout((function(){ti()}),2e3))})).catch((function(e){console.log(e)}));case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),Qt=function(e){console.log(e);var n=[e.userfcmtoken],t={notifications:[{notificationid:0,notificationdate:Q()().format("YYYY-MM-DD HH:mm:ss"),Title:"Staff Un-Asigned",message:"".concat(e.firstname," has been Un-assigned to the order ").concat(Ie),configid:2,tenantid:Jn,orderheaderid:Vn,orderprocessid:e.orderprocessid,shiftid:e.shiftid,userid:e.userid,orderid:Ie,success:0,orderstatus:"assigned",processing:Q()().format("YYYY-MM-DD HH:mm:ss"),notifytype:2,notifyreason:"Staff Un-Assigned"}],fcmmodel:{priority:"high",registration_ids:n,data:{Title:"Staff Un-Asigned",message:"A Staff has been Un-assigned to the order ".concat(Ie),tenantid:Jn,orderheaderid:Vn,orderid:Ie,configid:2},notification:{body:"An order has been Un-assigned ".concat(Ie),title:"Legendary",sound:"ring",content_available:!0,click_action:"FLUTTER_NOTIFICATION_CLICK"}}};console.log("grpnotifyobj unassign"),console.log(t),ni(t)};(0,c.useEffect)((function(){console.log(Vn),Vn&&Jn?(Wt(),Gt(),ti(),console.log(Se.state||"")):fe(!1),console.log(Vn,Jn)}),[Vn,Jn,Dt]);var Jt=function(){nn(!1),zn([]),Ft(["",""])};(0,c.useEffect)((function(){console.log(pt)}));var $t=function(){var e=(0,o.Z)((0,s.Z)().mark((function e(){var n,t;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],t=[],Kn.map((function(e){n.push({orderprocessid:0,processdate:Q()().format("YYYY-MM-DD HH:mm:ss"),tenantid:Jn,orderheaderid:Vn,orderdetailid:e.orderdetailid,productid:e.productid,userid:e.userid,orderstatus:"pending",pending:"".concat(Q()(ct).format("YYYY-MM-DD")," ").concat(Q()(ct).format("HH:mm:ss")),starttime:"".concat(Q()(tt).format("YYYY-MM-DD")," ").concat(Q()(tt).format("HH:mm:ss")),endtime:"".concat(Q()(st).format("YYYY-MM-DD")," ").concat(Q()(st).format("HH:mm:ss")),appuserid:parseInt(localStorage.getItem("appuserid")),shiftid:e.shiftid,userrate:e.userrate,productrate:e.productrate}),Kn.map((function(e){t.push({notificationid:0,notificationdate:Q()().format("YYYY-MM-DD HH:mm:ss"),Title:"Staff Asigned",message:"A Staff has been assigned to the order ".concat(Ie),configid:2,tenantid:Jn,orderheaderid:Vn,orderprocessid:0,shiftid:e.shiftid,userid:e.userid,orderid:Ie,sound:"ring",click_action:"FLUTTER_NOTIFICATION_CLICK",firstname:e.firstname})}))})),console.log("arr"),console.log(n),e.next=7,d.Z.post("".concat({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_GOOGLE_MAPS_API_KEY:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL2,"/orders/createorderprocess"),n).then((function(e){console.log(e),"Successfully created"===e.data.message&&((0,te.yv)("Roles assigned successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),console.log(Pt,"","",Vn,t[0].shiftid),nn(!1),Gt(),ti())})).catch((function(e){console.log(e)}));case 7:console.log(n);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ei=function(){var e=(0,o.Z)((0,s.Z)().mark((function e(n){var t,i;return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.userfcmtoken,i={notificationid:0,notificationdate:Q()().format("YYYY-MM-DD HH:mm:ss"),Title:"Staff Asigned",message:"A Staff has been assigned to the order ".concat(Ie),configid:2,tenantid:Jn,orderheaderid:Vn,orderprocessid:n.orderprocessid,shiftid:n.shiftid,userid:n.userid,orderid:Ie,sound:"ring",click_action:"FLUTTER_NOTIFICATION_CLICK"},console.log(i,t),e.next=5,d.Z.post("".concat({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_GOOGLE_MAPS_API_KEY:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL2,"/utils/notification/send"),{priority:"high",registration_ids:[t],data:i,notification:{body:"A Staff has been assigned to ".concat(Ie),title:"Legendary",sound:"ring",content_available:!0}},{headers:{Authorization:"Bearer ".concat({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_GOOGLE_MAPS_API_KEY:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_STAFF_TOKEN)}}).then((function(e){console.log(e),(0,te.yv)("Notification sent successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3})})).catch((function(e){console.log(e)}));case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),ni=function(){var e=(0,o.Z)((0,s.Z)().mark((function e(n){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log(n),e.next=3,d.Z.post("".concat({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_GOOGLE_MAPS_API_KEY:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL2,"/utils/notification/sendall"),n,{headers:{Authorization:"Bearer ".concat({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_GOOGLE_MAPS_API_KEY:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_STAFF_TOKEN)}}).then((function(e){console.log(e),e.data.status&&((0,te.yv)("Notification sent successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),Wt())})).catch((function(e){console.log(e)}));case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),ti=function(){var e=(0,o.Z)((0,s.Z)().mark((function e(){return(0,s.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.Z.get("".concat({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_GOOGLE_MAPS_API_KEY:"AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8",REACT_APP_RIDER_ACCESS_ID:"AAAAILMpCEU:APA91bEavuOllBI6sFgYtxXAgNmAVwNA-MnCMHLGlR4_t7UqpLajAkdn3T0CZr_zaLBknLyim9ytFLMZgbeXmKqTad_PKCbqlYjHpaizVrLXtecxqyEy4UktIacK2UvHVUATHL-7VQQk",REACT_APP_VERSION:"v2.1.0"}.REACT_APP_URL2,"/orders/getorderstatuscount?orderheaderid=").concat(Vn)).then((function(e){e.data.status?(console.log(e),bt(e.data.pendingcount),Wt()):(bt(e.data.pendingcount),Wt())})).catch((function(e){console.log(e)}));case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();function ii(e){var n=e.open,t=e.handleClose,i=(0,c.useState)(""),r=(0,a.Z)(i,2),s=r[0],o=r[1];return(0,oe.jsxs)(C.Z,{open:n,onClose:function(){return t(!1)},maxWidth:"xs",PaperProps:{sx:{borderRadius:3}},children:[(0,oe.jsx)(re.Z,{sx:{p:2.5,background:"linear-gradient(135deg, ".concat(he("#ef4444")," 0%, ").concat(he("#f59e0b")," 100%)"),borderBottom:"1px solid ".concat(Ee)},children:(0,oe.jsxs)(R.Z,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,oe.jsx)(T.Z,{sx:{bgcolor:"#ef4444",color:"#fff",width:40,height:40},children:(0,oe.jsx)(h.Z,{})}),(0,oe.jsxs)(R.Z,{children:[(0,oe.jsx)(f.Z,{variant:"h5",sx:{fontWeight:800,color:de},children:"Cancel Order"}),(0,oe.jsx)(f.Z,{variant:"caption",sx:{color:_e,fontWeight:600},children:"Confirm to permanently cancel this order"})]})]})}),(0,oe.jsx)(p.Z,{sx:{pt:3},children:(0,oe.jsxs)(R.Z,{alignItems:"center",spacing:2.5,children:[(0,oe.jsxs)(re.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1.25,py:.5,borderRadius:999,bgcolor:he("#f59e0b"),border:"1px solid ".concat(Ce("#f59e0b")),color:"#f59e0b",fontSize:12,fontWeight:800},children:[(0,oe.jsx)(ie.VHP,{size:12})," ",Ie.slice(4)]}),kt&&(0,oe.jsxs)(S.Z,{color:"warning",variant:"border",icon:(0,oe.jsx)($.Z,{}),children:[(0,oe.jsx)(Z.Z,{children:"Order is within 24Hrs time frame. The order will be invoiced with standard pricing as agreed."}),(0,oe.jsx)(g.Z,{href:"https://thelegendarystaff.com/",target:"_blank",children:"Terms & Condition link"})]}),(0,oe.jsx)(f.Z,{variant:"body1",align:"center",sx:{color:_e,fontWeight:600},children:"Please type in the order number to confirm."}),(0,oe.jsx)(I.Z,{type:"text",fullWidth:!0,onChange:function(e){return o(e.target.value)},error:s!==Ie.slice(4),value:s,placeholder:Ie.slice(4)}),(0,oe.jsxs)(R.Z,{direction:"row",spacing:1.5,sx:{width:1},children:[(0,oe.jsx)(j.Z,{fullWidth:!0,onClick:function(){return t(!1)},variant:"outlined",sx:{borderRadius:999,py:1,borderColor:Ee,color:_e,fontWeight:700,"&:hover":{borderColor:_e,bgcolor:xe}},children:"No"}),(0,oe.jsx)(j.Z,{fullWidth:!0,variant:"contained",autoFocus:!0,onClick:function(){s===Ie.slice(4)&&(qt(),t(!0))},sx:{borderRadius:999,py:1,bgcolor:"#ef4444",fontWeight:700,boxShadow:"0 6px 18px ".concat(ue("#ef4444")),"&:hover":{bgcolor:"#dc2626"}},children:"Yes, Cancel"})]})]})})]})}return(0,oe.jsxs)(oe.Fragment,{children:[Pe&&(0,oe.jsx)(q.Z,{}),(0,oe.jsx)(ii,{open:we,handleClose:function(){ke(!1)}}),(0,oe.jsxs)(C.Z,{maxWidth:!1,fullWidth:!0,open:en,onClose:Jt,scroll:"paper",TransitionComponent:W.S,children:[(0,oe.jsxs)(m.Z,{sx:{background:"linear-gradient(135deg, ".concat(he(Re)," 0%, ").concat(he(Te)," 100%)"),borderBottom:"1px solid ".concat(Ee),p:{xs:2,sm:2.5}},children:[(0,oe.jsxs)(R.Z,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},spacing:1.5,children:[(0,oe.jsxs)(R.Z,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,oe.jsx)(T.Z,{sx:{bgcolor:Re,color:"#fff",width:40,height:40,boxShadow:"0 6px 18px ".concat(ue(Re))},children:(0,oe.jsx)(ie.Z5O,{size:20})}),(0,oe.jsxs)(R.Z,{children:[(0,oe.jsx)(f.Z,{variant:"h4",sx:{fontWeight:800,color:de,lineHeight:1.1},children:"Assign Roles"}),(0,oe.jsxs)(f.Z,{variant:"caption",sx:{color:_e,fontWeight:600},children:[We," \xb7 ",ln]})]})]}),(0,oe.jsxs)(re.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1.25,py:.5,borderRadius:999,bgcolor:he("#f59e0b"),border:"1px solid ".concat(Ce("#f59e0b")),color:"#f59e0b",fontSize:12,fontWeight:800},children:[(0,oe.jsx)(ie.VHP,{size:12})," ",Ie]})]}),(0,oe.jsxs)(v.ZP,{container:!0,sx:{pt:2},spacing:1.5,children:[(0,oe.jsx)(v.ZP,{item:!0,sm:6,xs:12,children:(0,oe.jsxs)(re.Z,{onClick:function(){return It((function(e){return 0===e?1:0}))},sx:{display:"inline-flex",alignItems:"center",gap:.75,px:1.25,py:.625,borderRadius:999,cursor:"pointer",bgcolor:Re,color:"#fff",fontWeight:800,fontSize:12,boxShadow:"0 6px 18px ".concat(ue(Re))},children:[(0,oe.jsx)(T.Z,{sx:{width:22,height:22,bgcolor:"rgba(255,255,255,0.22)",color:"#fff"},children:(0,oe.jsx)(ie.Z5O,{size:12})}),ln||"Role"]})}),(0,oe.jsx)(v.ZP,{item:!0,sm:6,xs:12,children:(0,oe.jsx)(R.Z,{direction:"row",justifyContent:{xs:"flex-start",sm:"flex-end"},spacing:1,flexWrap:"wrap",useFlexGap:!0,children:[{label:"Required",value:pt.shifts,color:Re},{label:"Assigned",value:pt.assigned,color:"#10b981"},{label:"Remaining",value:pt.remaining,color:"#ef4444"}].map((function(e){var n;return(0,oe.jsxs)(re.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.625,px:1,py:.5,borderRadius:999,bgcolor:he(e.color),border:"1px solid ".concat(Ce(e.color)),color:e.color,fontSize:11.5,fontWeight:800},children:[e.label,(0,oe.jsx)(re.Z,{sx:{minWidth:22,height:18,px:.5,display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:999,fontSize:11,fontWeight:800,bgcolor:"#fff",color:e.color,border:"1px solid ".concat(Ce(e.color))},children:null!==(n=e.value)&&void 0!==n?n:0})]},e.label)}))})})]})]}),(0,oe.jsx)(p.Z,{dividers:!0,children:0===Nn.length?(0,oe.jsx)(oe.Fragment,{children:Pe?(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsx)(R.Z,{alignItems:"center",children:(0,oe.jsx)(D.Z,{})})}):(0,oe.jsx)(f.Z,{children:"No Staffs Available"})}):(0,oe.jsx)(b.Z,{children:(0,oe.jsxs)(O.Z,{children:[(0,oe.jsx)(y.Z,{children:(0,oe.jsxs)(L.Z,{children:[(0,oe.jsx)(H.Z,{children:"#"}),(0,oe.jsx)(H.Z,{children:"Staff"}),(0,oe.jsx)(H.Z,{children:"Category"}),(0,oe.jsx)(H.Z,{children:"Price"}),(0,oe.jsx)(H.Z,{children:"Experience"}),(0,oe.jsx)(H.Z,{children:"Level"}),(0,oe.jsx)(H.Z,{children:"City"}),(0,oe.jsx)(H.Z,{children:"Action"}),(0,oe.jsx)(H.Z,{})]})}),(0,oe.jsx)(F.Z,{children:Nn.map((function(e,n){return(0,oe.jsx)(c.Fragment,{children:(0,oe.jsxs)(L.Z,{sx:{backgroundColor:Kn.find((function(n){return n.userid==e.userid}))?"#f5f5f5":"",":hover":{backgroundColor:Kn.find((function(n){return n.userid==e.userid}))?"#f5f5f5 !important":""}},children:[(0,oe.jsx)(H.Z,{component:"th",scope:"row",padding:"none",children:n+1}),(0,oe.jsx)(H.Z,{align:"left",sx:{paddingLeft:"0px !important"},children:(0,oe.jsxs)(R.Z,{direction:"row",alignItems:"center",spacing:1,justifyContent:"flex-start",children:[(0,oe.jsx)(T.Z,{alt:"",size:"sm",src:"",sx:{width:"25px",height:"25px"}}),(0,oe.jsxs)(R.Z,{direction:"column",children:[(0,oe.jsx)(f.Z,{variant:"caption",children:e.firstname}),(0,oe.jsx)(f.Z,{variant:"caption",color:"textSecondary",children:e.contactno})]})]})}),(0,oe.jsx)(H.Z,{align:"left",children:(0,oe.jsxs)(R.Z,{direction:"column",alignItems:"flex-start",children:[(0,oe.jsx)(f.Z,{variant:"caption",color:"textSecondary",children:e.cateoryname}),(0,oe.jsx)(U.Z,{label:e.subcategoryname,color:"info",size:"small",variant:"light"})]})}),(0,oe.jsx)(H.Z,{children:e.rolecost}),(0,oe.jsxs)(H.Z,{align:"left",children:[e.experience," Years"]}),(0,oe.jsx)(H.Z,{align:"left",children:(0,oe.jsx)(U.Z,{label:e.levelofexperience,size:"small",color:"primary",variant:"light"})}),(0,oe.jsx)(H.Z,{align:"left",children:e.city}),(0,oe.jsx)(H.Z,{align:"left",children:e.orderdetailid!==At?(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsx)(M.Z,{disabled:0!==e.orderdetailid,checked:!!Kn.find((function(n){return n.userid==e.userid})),onClick:function(n){if(console.log(pt),pt.remaining>=0){if(n.target.checked&&0!=pt.remaining){var t=Kn;t.push({userid:e.userid,orderdetailid:At,productid:Pt,shiftid:pt.shiftid,userrate:pt.price,productrate:e.rolecost,firstname:e.firstname}),zn((0,r.Z)(t));var s=pt;s.assigned++,s.remaining=s.shifts-s.assigned,St((0,i.Z)({},s))}else if(pt.assigned!=pt.shifts||0===pt.remaining&&!n.target.checked){var o=Kn,a=o.findIndex((function(n){return n.userid===e.userid}));o.splice(a,1),zn((0,r.Z)(o));var c=pt;c.assigned--,c.remaining=c.shifts-c.assigned,St((0,i.Z)({},c))}console.log(Kn)}}})}):(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(U.Z,{label:"Assigned",color:"success",size:"small",sx:{mr:1}}),(0,oe.jsx)(Y.Z,{title:"Unassign",children:(0,oe.jsx)(N.Z,{color:"error",onClick:function(){console.log(e),Xt(e)},children:(0,oe.jsx)(ee.Z,{})})}),(0,oe.jsx)(Y.Z,{title:"Send Notification",children:(0,oe.jsx)(N.Z,{color:"info",onClick:function(){console.log(e),ei(e)},children:(0,oe.jsx)(u.Z,{})})})]})}),(0,oe.jsx)(H.Z,{children:e.orderid&&(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsx)(U.Z,{label:e.orderid,color:"warning",size:"small",variant:"light"})})})]})},n)}))})]})})}),(0,oe.jsx)(B.Z,{children:(0,oe.jsxs)(R.Z,{sx:{mt:2},direction:"row",justifyContent:"flex-end",spacing:5,children:[Nn.length>0&&(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(j.Z,{sx:{width:"130px"},variant:"contained",onClick:$t,children:"OK"}),(0,oe.jsx)(j.Z,{sx:{width:"130px"},color:"warning",variant:"contained",onClick:function(){zn([]);var e=pt;e.remaining=e.shifts,e.assigned=0,St(e)},children:"clear"})]}),(0,oe.jsx)(j.Z,{sx:{width:"130px"},color:"error",variant:"contained",onClick:function(){Jt()},children:"Close"})]})})]}),(0,oe.jsxs)(v.ZP,{container:!0,rowSpacing:2,columnSpacing:2.75,children:[(0,oe.jsx)(se.Z,{elevation:0,sx:{position:"sticky",top:"60px",zIndex:5,mb:2,p:{xs:1.5,sm:2,md:2.5},borderRadius:ce/8,border:"1px solid",borderColor:Ee,background:"linear-gradient(135deg, ".concat(he(Re)," 0%, ").concat(he(Te)," 100%)"),boxShadow:le},children:(0,oe.jsxs)(R.Z,{direction:{xs:"column",md:"row"},alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",spacing:{xs:1.5,md:2},children:[(0,oe.jsxs)(R.Z,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,oe.jsx)(N.Z,{onClick:function(){return history.back()},sx:{bgcolor:"#fff",border:"1px solid ".concat(Ee),borderRadius:999,color:de,"&:hover":{bgcolor:he(Re),borderColor:Ce(Re),color:Re}},children:(0,oe.jsx)(ie.KYK,{size:18})}),(0,oe.jsx)(T.Z,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:Re,color:"#fff",boxShadow:"0 6px 18px ".concat(ue(Re))},children:(0,oe.jsx)(ie.VHP,{size:22})}),(0,oe.jsxs)(R.Z,{children:[(0,oe.jsx)(f.Z,{variant:"h3",sx:{fontWeight:800,color:de,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Order Details"}),(0,oe.jsxs)(R.Z,{direction:"row",alignItems:"center",spacing:.75,flexWrap:"wrap",useFlexGap:!0,sx:{mt:.75},children:[(0,oe.jsxs)(re.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:he("#f59e0b"),border:"1px solid ".concat(Ce("#f59e0b")),color:"#f59e0b",fontSize:11,fontWeight:800},children:[(0,oe.jsx)(ie.VHP,{size:11}),""===Ie?(0,oe.jsx)(w.Z,{sx:{width:80},animation:"wave"}):Ie]}),(0,oe.jsxs)(re.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1,py:.375,borderRadius:999,bgcolor:he(Re),border:"1px solid ".concat(Ce(Re)),color:Re,fontSize:11,fontWeight:800},children:[(0,oe.jsx)(ie.dKE,{size:11}),""===Le?(0,oe.jsx)(w.Z,{sx:{width:80},animation:"wave"}):Le]}),(0,oe.jsx)(pe,{status:sn})]})]})]}),(0,oe.jsxs)(R.Z,{direction:"row",spacing:1.5,alignItems:"center",flexWrap:"wrap",useFlexGap:!0,children:[("pending"===sn||"assigned"===sn||"confirmed"===sn||"modified"===sn)&&(0,oe.jsx)(Y.Z,{title:"Edit",children:(0,oe.jsx)(j.Z,{variant:"outlined",sx:{borderRadius:999,borderColor:Ce(Re),color:Re,fontWeight:700,px:2,"&:hover":{borderColor:Re,bgcolor:he(Re),boxShadow:"0 0 0 3px ".concat(ue(Re))}},startIcon:(0,oe.jsx)(ie.zmo,{size:16}),onClick:function(e){e.stopPropagation(),Q()(Q()().format("MM-DD-YYYY")).isBefore(Q()(Q()(Yt).format("MM-DD-YYYY")))?Ot("/editorder",{state:{orderheaderid:Vn,tenantid:Jn}}):(0,te.yv)("Order cannot be edited.\n Order date is not valid at this time",{variant:"error",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:4e3,style:{whiteSpace:"pre-line"}})},children:"Edit Order"})}),"cancelled"!==sn&&""!==sn&&"completed"!==sn&&"closed"!==sn&&(0,oe.jsx)(j.Z,{variant:"outlined",sx:{borderRadius:999,borderColor:Ce("#ef4444"),color:"#ef4444",fontWeight:700,px:2,"&:hover":{borderColor:"#ef4444",bgcolor:he("#ef4444"),boxShadow:"0 0 0 3px ".concat(ue("#ef4444"))}},onClick:function(){Q()(Yt).diff(Q()(),"m")/60>24?(Kt(!1),ke(!0)):(Kt(!0),ke(!0))},startIcon:(0,oe.jsx)(G.Z,{}),children:"Cancel Order"}),"cancelled"===sn&&(0,oe.jsxs)(re.Z,{sx:{display:"inline-flex",alignItems:"center",gap:.5,px:1.25,py:.5,borderRadius:999,bgcolor:he("#ef4444"),border:"1px solid ".concat(Ce("#ef4444")),color:"#ef4444",fontSize:12,fontWeight:800},children:[(0,oe.jsx)(ie.B4e,{size:12})," Cancelled on ",Fn]})]})]})}),(0,oe.jsx)(v.ZP,{item:!0,xs:12,sx:{mt:-2},children:(0,oe.jsx)(V.Z,{content:!1,width:"100%",children:(0,oe.jsxs)(v.ZP,{container:!0,spacing:2.5,sx:{p:2.5},children:[(0,oe.jsx)(v.ZP,{item:!0,xs:12,sm:6,children:(0,oe.jsx)(V.Z,{sx:{height:"100%"},children:(0,oe.jsxs)(R.Z,{spacing:1,children:[(0,oe.jsx)(f.Z,{variant:"h5",children:"Client"}),(0,oe.jsx)(f.Z,{color:"secondary",children:""===We?(0,oe.jsx)(w.Z,{sx:{width:"40%"},animation:"wave"}):We}),(0,oe.jsx)(k.Z,{sx:{width:"100%"},children:(0,oe.jsx)(f.Z,{color:"secondary",children:""===Xe?(0,oe.jsx)(w.Z,{sx:{width:"90%"},animation:"wave"}):Xe})})]})})}),(0,oe.jsx)(v.ZP,{item:!0,xs:12,sm:6,children:(0,oe.jsx)(V.Z,{sx:{height:"100%"},children:(0,oe.jsxs)(R.Z,{spacing:1,children:[(0,oe.jsx)(f.Z,{variant:"h5",children:"Event"}),(0,oe.jsx)(k.Z,{sx:{width:"100%"},children:(0,oe.jsx)(f.Z,{color:"secondary",children:""===Me?(0,oe.jsx)(w.Z,{sx:{width:"40%"},animation:"wave"}):Me})})]})})}),Ct.map((function(e,n){return(0,oe.jsx)(c.Fragment,{children:(0,oe.jsx)(v.ZP,{item:!0,xs:12,children:(0,oe.jsxs)(V.Z,{sx:{opacity:0==e.shiftstatus?"":"0.7"},children:[(0,oe.jsxs)(R.Z,{direction:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{md:"center",xs:"flex-start"},spacing:2,sx:{p:2},children:[(0,oe.jsxs)(R.Z,{direction:{xs:"column",md:"row"},spacing:2,alignItems:{md:"center",xs:"flex-start"},children:[(0,oe.jsxs)(f.Z,{variant:"h5",children:["Shift ",n+1]}),(0,oe.jsxs)(f.Z,{color:"secondary",children:[(0,oe.jsx)(_.Z,{})," ","",e.locationaddress]}),1===e.shiftstatus&&(0,oe.jsx)(U.Z,{label:"Cancelled",color:"secondary"})]}),(0,oe.jsx)(R.Z,{direction:"row",spacing:1,children:e.ordercontacts.map((function(e){return(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsx)(Y.Z,{title:e.contactname,children:(0,oe.jsx)(T.Z,{sx:{bgcolor:"#2196f3",width:30,height:30},alt:"A",children:e.contactname.charAt(0).toUpperCase()})})})}))})]}),(0,oe.jsx)(b.Z,{children:(0,oe.jsxs)(O.Z,{children:[(0,oe.jsx)(y.Z,{children:(0,oe.jsxs)(L.Z,{children:[(0,oe.jsx)(H.Z,{children:"#"}),(0,oe.jsx)(H.Z,{children:"Role"}),(0,oe.jsx)(H.Z,{children:"Start Date"}),(0,oe.jsx)(H.Z,{children:"End Date"}),(0,oe.jsx)(H.Z,{children:"Unpaid break"}),(0,oe.jsx)(H.Z,{children:"Count"}),(0,oe.jsx)(H.Z,{children:"Assigned"}),(0,oe.jsx)(H.Z,{children:"Attire"}),(0,oe.jsx)(H.Z,{children:"Price"}),(0,oe.jsx)(H.Z,{children:"Amount"}),(0,oe.jsx)(H.Z,{children:"Action"})]})}),(0,oe.jsxs)(F.Z,{children:[0===e.orderdetails.length&&(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsxs)(L.Z,{children:[(0,oe.jsx)(H.Z,{children:(0,oe.jsx)(w.Z,{animation:"wave"})}),(0,oe.jsx)(H.Z,{children:(0,oe.jsx)(w.Z,{animation:"wave"})}),(0,oe.jsxs)(H.Z,{children:[(0,oe.jsx)(w.Z,{animation:"wave"}),(0,oe.jsx)(w.Z,{animation:"wave"})]}),(0,oe.jsxs)(H.Z,{children:[(0,oe.jsx)(w.Z,{animation:"wave"}),(0,oe.jsx)(w.Z,{animation:"wave"})]}),(0,oe.jsx)(H.Z,{children:(0,oe.jsx)(w.Z,{animation:"wave"})}),(0,oe.jsx)(H.Z,{children:(0,oe.jsx)(w.Z,{animation:"wave"})}),(0,oe.jsx)(H.Z,{children:(0,oe.jsx)(w.Z,{animation:"wave"})}),(0,oe.jsx)(H.Z,{children:(0,oe.jsx)(w.Z,{animation:"wave"})}),(0,oe.jsx)(H.Z,{children:(0,oe.jsx)(w.Z,{animation:"wave"})}),(0,oe.jsx)(H.Z,{children:(0,oe.jsx)(w.Z,{animation:"wave"})}),(0,oe.jsx)(H.Z,{children:(0,oe.jsx)(w.Z,{animation:"wave"})})]})}),e.orderdetails.map((function(e,t){return(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsxs)(L.Z,{sx:{"&:last-child td, &:last-child th":{border:0},opacity:0==e.status?"":"0.7"},children:[(0,oe.jsx)(H.Z,{children:t+1}),(0,oe.jsx)(H.Z,{children:e.productname}),(0,oe.jsx)(H.Z,{children:(0,oe.jsxs)(R.Z,{direction:"column",children:[(0,oe.jsx)(f.Z,{variant:"body1",children:Q()(e.starttime).format("MM/DD/YYYY")}),(0,oe.jsx)(f.Z,{variant:"body2",children:Q()(e.starttime).format("hh:mm A")})]})}),(0,oe.jsxs)(H.Z,{children:[" ",(0,oe.jsxs)(R.Z,{direction:"column",children:[(0,oe.jsx)(f.Z,{variant:"body1",children:Q()(e.endtime).format("MM/DD/YYYY")}),(0,oe.jsx)(f.Z,{variant:"body2",children:Q()(e.endtime).format("hh:mm A")})]})]}),(0,oe.jsx)(H.Z,{children:e.unpaidbreak||0}),(0,oe.jsx)(H.Z,{align:"center",children:(0,oe.jsx)(U.Z,{label:e.orderqty,color:"success",variant:"light",size:"small"})}),(0,oe.jsx)(H.Z,{align:"center",children:(0,oe.jsx)(U.Z,{label:e.supplyqty,color:0===e.supplyqty?"error":"warning",variant:"light",size:"small"})}),(0,oe.jsx)(H.Z,{width:"100px"}),(0,oe.jsxs)(H.Z,{children:["$",e.price]}),(0,oe.jsxs)(H.Z,{children:["$",e.landingamount]}),(0,oe.jsx)(H.Z,{children:(0,oe.jsxs)(R.Z,{direction:"row",children:[(0,oe.jsx)(Y.Z,{title:"Expand",children:(0,oe.jsx)(N.Z,{"aria-label":"expand row",style:{color:zt.palette.primary.main},onClick:function(){Bn([]),Ft(Ht[0]===n&&Ht[1]===t?["",""]:[n,t]),Vt(e.orderdetailid)},children:Ht[0]===n&&Ht[1]===t?(0,oe.jsx)(x.Z,{}):(0,oe.jsx)(P.Z,{})})}),"cancelled"===sn&&(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsx)(N.Z,{sx:{minWidth:"10px !important"},disabled:!0,children:(0,oe.jsx)(A.Z,{})})}),1===e.status&&(0,oe.jsx)(Y.Z,{title:"Cancelled",children:(0,oe.jsx)(N.Z,{sx:{minWidth:"10px !important"},children:(0,oe.jsx)(G.Z,{color:"error"})})}),e.supplyqty>e.orderqty&&(0,oe.jsx)(Y.Z,{title:"Assigned count is greater than ordered count",children:(0,oe.jsx)(N.Z,{color:"warning",children:(0,oe.jsx)(ne.Z,{})})})]})})]},t+1),(0,oe.jsx)(L.Z,{sx:{p:2},children:(0,oe.jsx)(H.Z,{style:{paddingBottom:0,paddingTop:0,paddingLeft:0,paddingRight:0},colSpan:11,sx:{width:"100%"},children:(0,oe.jsx)(K.Z,{in:Ht[0]===n&&Ht[1]===t,timeout:"auto",unmountOnExit:!0,children:(0,oe.jsx)(V.Z,{sx:{width:"100%"},children:0===Nn.length?(0,oe.jsx)(oe.Fragment,{children:Pe?(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsx)(R.Z,{alignItems:"center",children:(0,oe.jsx)(D.Z,{})})}):(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsx)(R.Z,{sx:{p:1},children:(0,oe.jsx)(f.Z,{children:"No Staffs has been Assigned"})})})}):(0,oe.jsx)(b.Z,{children:(0,oe.jsxs)(O.Z,{children:[(0,oe.jsx)(y.Z,{children:(0,oe.jsxs)(L.Z,{children:[(0,oe.jsx)(H.Z,{children:"#"}),(0,oe.jsx)(H.Z,{children:"Staff"}),(0,oe.jsx)(H.Z,{children:"Start Time"}),(0,oe.jsx)(H.Z,{children:"End Time"}),(0,oe.jsx)(H.Z,{children:"Pay Rate"}),(0,oe.jsx)(H.Z,{align:"center",children:"Clockin"}),(0,oe.jsx)(H.Z,{align:"center",children:"Clockout"}),(0,oe.jsx)(H.Z,{children:"Hours Worked"}),(0,oe.jsx)(H.Z,{children:"Status"})]})}),(0,oe.jsx)(F.Z,{children:Nn.map((function(e,n){return(0,oe.jsx)(c.Fragment,{children:(0,oe.jsxs)(L.Z,{sx:{},children:[(0,oe.jsx)(H.Z,{component:"th",scope:"row",padding:"none",children:n+1}),(0,oe.jsx)(H.Z,{align:"left",children:(0,oe.jsxs)(R.Z,{direction:"column",children:[(0,oe.jsx)(f.Z,{variant:"caption",children:e.staffname}),(0,oe.jsx)(v.ZP,{children:(0,oe.jsx)(U.Z,{label:e.productname,color:"info",variant:"light",size:"small"})})]})}),(0,oe.jsx)(H.Z,{children:(0,oe.jsxs)(R.Z,{direction:"column",children:[(0,oe.jsx)(f.Z,{variant:"body2",children:Q()(e.Starttime).format("MM/DD/YYYY")}),(0,oe.jsx)(f.Z,{variant:"caption",children:Q()(e.Starttime).format("hh:mm A")})]})}),(0,oe.jsx)(H.Z,{children:(0,oe.jsxs)(R.Z,{direction:"column",children:[(0,oe.jsx)(f.Z,{variant:"body2",children:Q()(e.Endtime).format("MM/DD/YYYY")}),(0,oe.jsx)(f.Z,{variant:"caption",children:Q()(e.Endtime).format("hh:mm A")})]})}),(0,oe.jsx)(H.Z,{children:e.rolecost}),(0,oe.jsx)(H.Z,{children:(0,oe.jsxs)(R.Z,{spacing:.5,alignItems:"center",children:[(0,oe.jsx)(U.Z,{label:e.clockin?Q()(e.clockin).format("MM/DD/YYYY"):"",color:"primary",variant:"light",size:"small"}),(0,oe.jsx)(U.Z,{label:e.clockin?Q()(e.clockin).format("hh:mm A"):"",color:"info",variant:"light",size:"small"})]})}),(0,oe.jsx)(H.Z,{children:(0,oe.jsxs)(R.Z,{spacing:.5,alignItems:"center",children:[(0,oe.jsx)(U.Z,{label:e.clockout?Q()(e.clockout).format("MM/DD/YYYY"):"",color:"primary",variant:"light",size:"small"}),(0,oe.jsx)(U.Z,{label:e.clockout?Q()(e.clockout).format("hh:mm A"):"",color:"info",variant:"light",size:"small"})]})}),(0,oe.jsx)(H.Z,{children:e.hoursworked}),(0,oe.jsx)(H.Z,{align:"left",children:(0,oe.jsxs)(R.Z,{direction:"row",children:["pending"===e.orderstatus&&(0,oe.jsx)(U.Z,{label:"Pending",color:"error",size:"small"}),"cancelled"===e.orderstatus&&(0,oe.jsx)(U.Z,{label:"Cancelled",color:"secondary",size:"small"}),"completed"===e.orderstatus&&(0,oe.jsx)(U.Z,{label:"Completed",color:"primary",size:"small"}),"processing"===e.orderstatus&&(0,oe.jsx)(U.Z,{label:"Processing",color:"primary",size:"small"}),"assigned"===e.orderstatus&&(0,oe.jsx)(U.Z,{label:"Assigned",color:"warning",size:"small"}),"confirmed"===e.orderstatus&&(0,oe.jsx)(U.Z,{label:"Confirmed",color:"success",size:"small"}),"active"===e.orderstatus&&(0,oe.jsx)(U.Z,{label:"Active",color:"info",size:"small"}),"closed"===e.orderstatus&&(0,oe.jsx)(U.Z,{label:"Closed",color:"info",size:"small"})]})})]})},n)}))})]})})})})})})]})}))]})]})})]})})},e.locationaddress)})),(0,oe.jsx)(v.ZP,{item:!0,xs:12,children:(0,oe.jsx)(z.Z,{sx:{borderWidth:1}})}),(0,oe.jsx)(v.ZP,{item:!0,xs:12,sm:6,children:(0,oe.jsx)(V.Z,{title:"Order Addons",sx:{height:"100%"},children:(0,oe.jsx)(v.ZP,{container:!0,spacing:2,children:(mn||[]).map((function(e){return(0,oe.jsx)(c.Fragment,{children:(0,oe.jsx)(v.ZP,{item:!0,children:(0,oe.jsx)(U.Z,{icon:(0,oe.jsx)(E.Z,{}),variant:"outlined",color:"error",label:e.addon})})},e.addon)}))})})}),(0,oe.jsx)(v.ZP,{item:!0,xs:12,sm:6,children:(0,oe.jsx)(V.Z,{title:"Total",sx:{height:"100%"},children:(0,oe.jsxs)(R.Z,{spacing:2,children:[(0,oe.jsxs)(R.Z,{direction:"row",justifyContent:"space-between",children:[(0,oe.jsx)(f.Z,{color:zt.palette.grey[500],children:"Sub Total:"}),(0,oe.jsxs)(f.Z,{children:["$",""===hn?(0,oe.jsx)(w.Z,{sx:{width:"30px"}}):hn]})]}),(0,oe.jsxs)(R.Z,{direction:"row",justifyContent:"space-between",children:[(0,oe.jsx)(f.Z,{color:zt.palette.grey[500],children:"Tax:"}),(0,oe.jsx)(f.Z,{children:""===An?(0,oe.jsx)(w.Z,{sx:{width:"30px"}}):An})]}),(0,oe.jsxs)(R.Z,{direction:"row",justifyContent:"space-between",children:[(0,oe.jsx)(f.Z,{variant:"subtitle1",children:"Grand Total:"}),(0,oe.jsx)(f.Z,{variant:"subtitle1",children:""===Tn?(0,oe.jsx)(w.Z,{sx:{width:"30px"}}):"$".concat(Tn)})]})]})})}),(0,oe.jsx)(v.ZP,{item:!0,xs:12,children:(0,oe.jsxs)(R.Z,{direction:"column",sx:{mt:2},children:[(0,oe.jsx)(f.Z,{color:"secondary",children:"Other Instructions:"}),(0,oe.jsx)(f.Z,{sx:{ml:3},children:On})]})})]})})})]})]})}}}]);