Sindbad~EG File Manager
"use strict";(self.webpackChunk_minimal_material_kit_react=self.webpackChunk_minimal_material_kit_react||[]).push([[820],{6657:(e,t,i)=>{i(579);i(5869);i(5043)},7550:(e,t,i)=>{i(5043);var l=i(4535),o=i(310),n=i(6446);(0,l.Ay)(n.A)((e=>{let{theme:t,ownerState:i}=e;const l="light"===t.palette.mode,n="filled"===i.variant,r="outlined"===i.variant,a="soft"===i.variant,c={..."default"===i.color&&{...r&&{backgroundColor:"transparent",color:t.palette.text.primary,border:"1px solid ".concat((0,o.X4)(t.palette.grey[500],.32))},...a&&{color:l?t.palette.text.primary:t.palette.common.white,backgroundColor:(0,o.X4)(t.palette.grey[500],.16)}}},s={..."default"!==i.color&&{...n&&{color:t.palette[i.color].contrastText,backgroundColor:t.palette[i.color].main},...r&&{backgroundColor:"transparent",color:t.palette[i.color].main,border:"1px solid ".concat(t.palette[i.color].main)},...a&&{color:t.palette[i.color][l?"dark":"light"],backgroundColor:(0,o.X4)(t.palette[i.color].main,.16)}}};return{height:24,minWidth:22,lineHeight:0,borderRadius:6,cursor:"default",alignItems:"center",whiteSpace:"nowrap",display:"inline-flex",justifyContent:"center",textTransform:"capitalize",padding:t.spacing(0,1),color:t.palette.grey[800],fontSize:t.typography.pxToRem(12),fontFamily:t.typography.fontFamily,backgroundColor:t.palette.grey[300],fontWeight:t.typography.fontWeightBold,...s,...c}}));i(579)},3820:(e,t,i)=>{i.r(t),i.d(t,{default:()=>z});var l=i(5043),o=i(9252),n=i(8911),r=i(5865),a=i(8977),c=i(688),s=i(2143),d=i(5869),u=i(9456),h=(i(9907),i(3536),i(579));var p=i(3216),v=i(1551),g=i(4535),x=(i(3338),i(7550),i(6657),i(3568)),m=i(7858),b=i(1036);(0,g.Ay)("img")({top:0,width:"100%",height:"80%",objectFit:"contain",position:"absolute"}),(0,g.Ay)("img")({top:"100%",right:0,transform:"translate(0%, -100%)",width:"100%",height:"50%",objectFit:"contain",position:"absolute"}),(0,v.A)({root:{minWidth:400,height:150}});var y=i(8903),A=i(9650),j=i(1806),f=i(3460),w=i(8076),k=i(2420),C=i(7625),S=i(6446),I=i(7894),_=i(9588),F=i(7154);const R={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:360,bgcolor:"background.paper",border:"2px solid #1976D2",borderRadius:2,boxShadow:24,p:4},B=(0,g.Ay)("img")({height:50,objectFit:"contain"});function D(e){let{inventoryData:t,...i}=e;const o=(0,p.Zp)(),c=(0,u.wA)(),[s,d]=(0,l.useState)([]),[v,g]=(0,l.useState)(!1),[D,E]=(0,l.useState)(null),L=()=>g(!1),{userInfo:z}=(0,u.d4)((e=>e.auth));(0,l.useEffect)((()=>{d([{id:"image",label:"Image"},{id:"title",label:"Title"},{id:"vin",label:"VIN"},{id:"mileage",label:"Mileage"},{id:"action",label:"Action"}])}),[]);return!(null!==t&&void 0!==t&&t.length)>0?(0,h.jsx)("h1",{style:{marginTop:"100px"},children:"No results were found!"}):(0,h.jsxs)(y.Ay,{container:!0,mt:5,...i,sx:{width:"100% !important"},children:[(0,h.jsx)(A.A,{sx:{maxHeight:440},children:(0,h.jsxs)(j.A,{stickyHeader:!0,children:[(0,h.jsx)(I.K,{headLabel:s}),(0,h.jsx)(f.A,{children:(0,h.jsx)(l.Fragment,{children:null===t||void 0===t?void 0:t.map(((e,t)=>(0,h.jsx)(h.Fragment,{children:(0,h.jsxs)(w.A,{children:[(0,h.jsx)(k.A,{children:(0,h.jsx)("img",{src:"".concat(_.Jz,"/").concat(null===e||void 0===e?void 0:e.imageUrl),height:80,width:80,alt:"",style:{objectFit:"contain"}})}),(0,h.jsx)(k.A,{children:(0,h.jsx)(r.A,{sx:{fontWeight:"bold",cursor:"pointer"},style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical",overflow:"hidden",minWidth:"200px"},onClick:()=>o("/dashboard/inventory/vehicle",{state:{product:e}}),children:"".concat((null===e||void 0===e?void 0:e.year)||""," ").concat((null===e||void 0===e?void 0:e.make)||""," ").concat((null===e||void 0===e?void 0:e.model)||""," ").concat((null===e||void 0===e?void 0:e.trim)||"")})}),(0,h.jsx)(k.A,{style:{width:220},children:(null===e||void 0===e?void 0:e.vin)||""}),(0,h.jsx)(k.A,{style:{width:200},children:"".concat((null===e||void 0===e?void 0:e.mileage)||"")}),(0,h.jsx)(k.A,{children:(0,h.jsx)(B,{style:{cursor:"pointer"},alt:null===e||void 0===e?void 0:e.make,src:x,onClick:()=>{g(!0),E(null===e||void 0===e?void 0:e.vehicle_id)}})})]},t)})))})})]})}),(0,h.jsx)(C.A,{open:v,onClose:L,"aria-labelledby":"modal-modal-title","aria-describedby":"modal-modal-description",children:(0,h.jsxs)(S.A,{sx:R,children:[(0,h.jsx)(r.A,{id:"modal-modal-title",variant:"h6",component:"h2",sx:{mb:1,textAlign:"center"},children:"Are you sure you want to delete"}),(0,h.jsx)(r.A,{id:"modal-modal-description",variant:"h6",component:"h2",align:"center",children:"this vehicle?"}),(0,h.jsxs)(n.A,{spacing:2,direction:"row",justifyContent:"center",alignItems:"flex-end",sx:{mt:2},children:[(0,h.jsx)(a.A,{variant:"contained",style:{width:"150px",backgroundColor:"#4CAF50",borderRadius:"30px",color:"white",marginRight:"8px",fontWeight:"bold"},onClick:()=>{(async()=>{try{200===(await F.A.delete("".concat(_.VY,"/vehicle/delete-inventory-vehicle/").concat(D))).status?(b.oR.error("Vehicle deleted successfully"),g(!1),c((0,m.M)({timeRange:"currentweek",orderDirection:"ASC",sortBy:"",userId:null===z||void 0===z?void 0:z.user_id}))):b.oR.error("Failed to delete vehicle")}catch(e){b.oR.error("Error deleting vehicle!")}})()},children:"Yes"}),(0,h.jsx)(a.A,{variant:"contained",style:{width:"150px",backgroundColor:"#E53935",borderRadius:"30px",color:"white",fontWeight:"bold"},onClick:L,children:"No"})]})]})})]})}const E=[{value:"currentweek",label:"Current week"},{value:"lastweek",label:"Last week"},{value:"last4weeks",label:"Last 4 weeks"},{value:"last12weeks",label:"Last 12 weeks"}],L=[{value:"year",label:"Year: Newest First",condition:"DESC"},{value:"year",label:"Year: Oldest First",condition:"ASC"},{value:"mileage",label:"Mileage: Highest First",condition:"DESC"},{value:"mileage",label:"Mileage: Lowest First",condition:"ASC"}];function z(){const e=(0,p.Zp)(),t=(0,u.wA)(),{state:i}=(0,p.zy)(),[v,g]=(0,l.useState)(!1),[x,b]=(0,l.useState)([]),[y,A]=(0,l.useState)(null),[j,f]=(0,l.useState)(null),[w,k]=(0,l.useState)("Current week"),[C,S]=(0,l.useState)(""),[I,_]=(0,l.useState)("currentweek"),[F,R]=(0,l.useState)("ASC"),{InventoryData:B}=(0,u.d4)((e=>e.inventory)),{userInfo:z}=(0,u.d4)((e=>e.auth));(0,l.useEffect)((()=>{t((0,m.M)({timeRange:I,orderDirection:F,sortBy:C,userId:null===z||void 0===z?void 0:z.user_id}))}),[]);return(0,h.jsx)(h.Fragment,{children:(0,h.jsxs)(o.A,{children:[(0,h.jsxs)(n.A,{direction:"row",alignItems:"center",justifyContent:"space-between",my:5,children:[(0,h.jsx)(r.A,{variant:"h4",sx:{my:5},children:"INVENTORY"}),(0,h.jsx)(a.A,{variant:"contained",startIcon:(0,h.jsx)(d.A,{icon:"eva:plus-fill"}),onClick:()=>e("/dashboard/inventory/newVehicle"),children:"Add"})]}),(0,h.jsxs)(n.A,{direction:"row",alignItems:"center",justifyContent:"space-between",my:5,children:[(0,h.jsxs)(n.A,{children:[(0,h.jsxs)(a.A,{color:"inherit",disableRipple:!0,onClick:e=>{f(e.currentTarget)},endIcon:(0,h.jsx)(d.A,{icon:j?"eva:chevron-up-fill":"eva:chevron-down-fill"}),children:["Sort By:\xa0",(0,h.jsx)(r.A,{component:"span",variant:"subtitle2",sx:{color:"text.secondary",borderBottom:"1px solid black"},children:C})]}),(0,h.jsx)(c.A,{keepMounted:!0,anchorEl:j,open:Boolean(j),onClose:()=>{f(null)},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:L.map(((e,i)=>(0,h.jsx)(s.A,{selected:0===i,onClick:()=>((e,i,l)=>{t((0,m.M)({timeRange:I,orderDirection:i,sortBy:e,userId:null===z||void 0===z?void 0:z.user_id})),S(l),f(null)})(e.value,e.condition,e.label),sx:{typography:"body2"},children:e.label},e.value+"_"+e.condition)))})]}),(0,h.jsxs)(n.A,{children:[(0,h.jsx)(a.A,{color:"inherit",disableRipple:!0,onClick:e=>{g(e.currentTarget)},endIcon:(0,h.jsx)(d.A,{icon:v?"eva:chevron-up-fill":"eva:chevron-down-fill"}),children:(0,h.jsx)(r.A,{component:"span",variant:"subtitle2",sx:{borderBottom:"1px solid black"},children:w})}),(0,h.jsx)(c.A,{keepMounted:!0,anchorEl:v,open:Boolean(v),onClose:()=>{g(!1)},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:E.map((e=>(0,h.jsx)(s.A,{selected:"currentweek"===e.value,onClick:()=>((e,i)=>{_(e),S(""),t((0,m.M)({timeRange:e,orderDirection:F,sortBy:"",userId:null===z||void 0===z?void 0:z.user_id})),k(i),g(null)})(e.value,e.label),sx:{typography:"body2"},children:e.label},e.value+"_"+e.label)))})]})]}),(0,h.jsx)(D,{inventoryData:B})]})})}},7894:(e,t,i)=>{i.d(t,{K:()=>d,H:()=>k});var l=i(4882),o=i(8076),n=i(2420),r=i(8093),a=i(6446),c=i(579);const s={border:0,margin:-1,padding:0,width:"1px",height:"1px",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",clip:"rect(0 0 0 0)"};function d(e){let{order:t,orderBy:i,rowCount:d,headLabel:u,numSelected:h,onRequestSort:p,onSelectAllClick:v}=e;return(0,c.jsx)(l.A,{children:(0,c.jsx)(o.A,{children:u.map(((e,l)=>{return(0,c.jsx)(n.A,{align:e.alignRight?"right":"left",sortDirection:i===e.id&&t,children:(0,c.jsxs)(r.A,{hideSortIcon:!0,active:i===e.id,direction:i===e.id?t:"asc",onClick:(o=e.id,e=>{p(e,o)}),children:[e.label,i===e.id?(0,c.jsx)(a.A,{sx:{...s},children:"desc"===t?"sorted descending":"sorted ascending"}):null]})},l);var o}))})})}var u=i(4535),h=i(5263),p=i(5865),v=i(5869),g=i(5043),x=i(8977),m=i(688),b=i(2143),y=i(9456),A=i(9907);const j=[{value:"auctioneer",label:"Auctioneer"},{value:"auction",label:"Auction"},{value:"condition_light",label:"Condition Light"},{value:"sale_status",label:"Sale Status"}];function f(e){let{weekId:t,userId:i,setLoader:l}=e;const[o,n]=(0,g.useState)(null),[r,a]=(0,g.useState)("auctioneer"),s=(0,y.wA)(),{filterType:d}=(0,y.d4)((e=>e.users)),u=(e,o)=>{l(!0),"auctioneer"===e?s((0,A.Np)({userId:i,weekId:t})).finally((()=>l(!1))):"auction"===e?s((0,A.x1)({user_id:i,week_id:t})).finally((()=>l(!1))):"condition_light"===e?s((0,A.S4)({user_id:i,week_id:t})).finally((()=>l(!1))):"sale_status"===e&&s((0,A.yh)({user_id:i,week_id:t})).finally((()=>l(!1))),a(o||e),n(null)};(0,g.useEffect)((()=>{u(d||"auctioneer")}),[]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(x.A,{color:"inherit",disableRipple:!0,onClick:e=>{n(e.currentTarget)},endIcon:(0,c.jsx)(v.A,{icon:o?"eva:chevron-up-fill":"eva:chevron-down-fill"}),children:["Filter by \xa0",(0,c.jsx)(p.A,{component:"span",variant:"subtitle2",sx:{color:"text.secondary"},children:r})]}),(0,c.jsx)(m.A,{keepMounted:!0,anchorEl:o,open:Boolean(o),onClose:()=>{n(null)},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:j.map((e=>(0,c.jsx)(b.A,{selected:e.value===r,onClick:()=>u(e.value,e.label),sx:{typography:"body2"},children:e.label},e.value+"_"+e.label)))})]})}const w=(0,u.Ay)(h.A)((e=>{let{theme:t}=e;return{height:96,display:"flex",justifyContent:"flex-end",padding:t.spacing(0,1,0,3)}}));function k(e){let{numSelected:t,filterName:i,onFilterName:l,weekId:o,userId:n,setLoader:r}=e;return(0,c.jsx)(w,{sx:{...t>0&&{color:"primary.main",bgcolor:"primary.lighter"}},children:t>0?(0,c.jsxs)(p.A,{component:"div",variant:"subtitle1",children:[t," selected"]}):(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(f,{weekId:o,userId:n,setLoader:r})})})}},3568:(e,t,i)=>{e.exports=i.p+"static/media/trash.5795bffc2e3ba17cfc33.png"}}]);
//# sourceMappingURL=820.8c889797.chunk.js.map
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists