Sindbad~EG File Manager
"use strict";(self.webpackChunk_minimal_material_kit_react=self.webpackChunk_minimal_material_kit_react||[]).push([[52,285],{52:function(e,t,r){r.r(t),r.d(t,{default:function(){return $}});var n=r(4165),a=r(5861),o=r(9439),i=r(5987),l=r(1413),s=r(2791),d=(r(6907),r(5166),r(7047)),c=r(3609),u=r(3967),v=r(1614),h=r(4554),m=r(890),x=r(3767),p=r(4518),f=r(1715),y=r(3786),g=r(1889),Z=r(184);r(163);var k=r(7870);var w=r(7621),b=["title","total","price","color","sx"];function j(e){var t=e.title,r=e.total,n=e.price,a=e.color,o=void 0===a?"primary":a,s=e.sx,d=(0,i.Z)(e,b),c=void 0!==r&&null!==r?(0,k.v1)(r):null,u=void 0!==n&&null!==n?(0,k.v1)(n):null;return(0,Z.jsxs)(w.Z,(0,l.Z)((0,l.Z)({sx:(0,l.Z)({py:5,boxShadow:0,textAlign:"center",color:function(e){return e.palette[o].darker},bgcolor:function(e){return e.palette[o].lighter}},s)},d),{},{children:[null!==u&&(0,Z.jsxs)(m.Z,{variant:"h3",children:["$",u]}),null!==c&&(0,Z.jsx)(m.Z,{variant:"h3",children:c}),(0,Z.jsx)(m.Z,{variant:"subtitle2",sx:{opacity:.72},children:t})]}))}var D=r(7892),S=r.n(D),C=r(7689),_=r(9113),R=r(1243),P=r(9434),I=r(6818),W=r.n(I),F=r(6934),T=r(3634),H=r(1652),L=r(1090),M=r(4639),N=r(5835),B=r(8400),O=(r(3285),r(3507),["day","selectedDay","hoveredDay"]);S().extend(W());var U=(0,F.ZP)(M.H,{shouldForwardProp:function(e){return"isSelected"!==e&&"isHovered"!==e}})((function(e){var t=e.theme,r=e.isSelected,n=e.isHovered,a=e.day;return(0,l.Z)((0,l.Z)((0,l.Z)((0,l.Z)({borderRadius:0},r&&{backgroundColor:t.palette.primary.main,color:t.palette.primary.contrastText,"&:hover, &:focus":{backgroundColor:t.palette.primary.main}}),n&&{backgroundColor:t.palette.primary[t.palette.mode],"&:hover, &:focus":{backgroundColor:t.palette.primary[t.palette.mode]}}),0===a.day()&&{borderTopLeftRadius:"50%",borderBottomLeftRadius:"50%"}),6===a.day()&&{borderTopRightRadius:"50%",borderBottomRightRadius:"50%"})})),E=function(e,t){return null!=t&&e.isSame(t,"week")};function A(e){var t=e.day,r=e.selectedDay,n=e.hoveredDay,a=(0,i.Z)(e,O);return(0,Z.jsx)(U,(0,l.Z)((0,l.Z)({},a),{},{day:t,sx:{px:2.5},disableMargin:!0,selected:!1,isSelected:E(t,r),isHovered:E(t,n)}))}var z=[{value:"currentweek",label:"Current week"},{value:"lastweek",label:"Last week"},{value:"last4weeks",label:"Last 4 weeks"},{value:"last12weeks",label:"Last 12 weeks"}];function $(){(0,u.Z)();var e=(0,s.useState)(null),t=(0,o.Z)(e,2),r=t[0],i=(t[1],(0,s.useState)(null)),l=(0,o.Z)(i,2),k=l[0],w=l[1],b=(0,s.useState)({}),D=(0,o.Z)(b,2),S=D[0],I=D[1],W=(0,s.useState)(!0),F=(0,o.Z)(W,2),M=F[0],O=F[1],U=(0,s.useState)(null),E=(0,o.Z)(U,2),$=E[0],q=E[1],G=(0,s.useState)("Current week"),J=(0,o.Z)(G,2),K=J[0],Q=J[1],V=(0,s.useState)("currentweek"),X=(0,o.Z)(V,2),Y=X[0],ee=X[1],te=(0,C.s0)(),re=(0,P.I0)(),ne=(0,P.v9)((function(e){return e.auth})).userInfo,ae=((0,P.v9)((function(e){return e.users})).auctioneerStats,function(){var e=(0,a.Z)((0,n.Z)().mark((function e(){var t,r;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,R.Z.post("".concat(_.v,"/auctioneer/auctioneer-stats"),{auctioneer_id:null===ne||void 0===ne?void 0:ne.user_id,timeRange:Y});case 2:200==(null===(t=e.sent)||void 0===t?void 0:t.status)&&(I(null===t||void 0===t||null===(r=t.data)||void 0===r?void 0:r.data),O(!1));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}());return(0,s.useEffect)((function(){ae()}),[Y]),(0,s.useEffect)((function(){if(k){var e=k.toDate(),t=(0,N.ZM)(e),r=(t.day,t.week),n=t.year,a=new Date(n,0,7*r),o=a.getDay();a.setDate(a.getDate()-(0===o?6:o-1));var i=new Date(a);i.setDate(i.getDate()+6);var l=a.toLocaleDateString("en-US",{month:"short",day:"numeric"}),s=i.toLocaleDateString("en-US",{month:"short",day:"numeric"});t.week&&(re((0,B.v6)({auctioneerId:null===ne||void 0===ne?void 0:ne.user_id,weekId:null===t||void 0===t?void 0:t.week})),te("/dashboard/app/users",{state:{week:t.week,startDate:l,endDate:s}}))}}),[k,ne]),(0,Z.jsx)(Z.Fragment,{children:(0,Z.jsxs)(v.Z,{maxWidth:"xl",children:[(0,Z.jsxs)(h.Z,{display:"flex",flexDirection:"column",alignItems:"center",mb:5,sx:{"@media (min-width:600px)":{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}},children:[(0,Z.jsxs)(m.Z,{variant:"h4",sx:{mb:5},children:["Hi, Welcome back ",(null===ne||void 0===ne?void 0:ne.first_name)||""," ",(null===ne||void 0===ne?void 0:ne.last_name)||""]}),(0,Z.jsxs)(x.Z,{direction:"row",alignItems:"center",justifyContent:"end",mb:5,children:[(0,Z.jsx)(p.Z,{color:"inherit",disableRipple:!0,onClick:function(e){q(e.currentTarget)},endIcon:(0,Z.jsx)(c.Z,{icon:$?"eva:chevron-up-fill":"eva:chevron-down-fill"}),children:(0,Z.jsx)(m.Z,{component:"span",variant:"subtitle2",sx:{borderBottom:"1px solid black"},children:K})}),(0,Z.jsx)(f.Z,{keepMounted:!0,anchorEl:$,open:Boolean($),onClose:function(){q(null)},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:z.map((function(e){return(0,Z.jsx)(y.Z,{selected:"currentweek"===e.value,onClick:function(){return function(e,t){console.log(e,t),ee(e),Q(t),q(null)}(e.value,e.label)},sx:{typography:"body2"},children:e.label},e.value+"_"+(null===e||void 0===e?void 0:e.condition))}))})]})]}),(0,Z.jsxs)(g.ZP,{container:!0,spacing:3,children:[M?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(g.ZP,{item:!0,xs:12,sm:6,md:4,children:(0,Z.jsx)(d.Z,{variant:"rectangular",width:"100%",height:150,sx:{bgcolor:"#D1E9FC"}})}),(0,Z.jsx)(g.ZP,{item:!0,xs:12,sm:6,md:4,children:(0,Z.jsx)(d.Z,{variant:"rectangular",width:"100%",height:150,sx:{bgcolor:"#D0F2FF"}})}),(0,Z.jsx)(g.ZP,{item:!0,xs:12,sm:6,md:4,children:(0,Z.jsx)(d.Z,{variant:"rectangular",width:"100%",height:150,sx:{bgcolor:"#FFF7CD"}})})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(g.ZP,{item:!0,xs:12,sm:6,md:4,children:(0,Z.jsx)(j,{title:"Total Sale",price:null===S||void 0===S?void 0:S.total_sales})}),(0,Z.jsx)(g.ZP,{item:!0,xs:12,sm:6,md:4,children:(0,Z.jsx)(j,{title:"Net Proceed",price:null===S||void 0===S?void 0:S.net_proceeds,color:"info"})}),(0,Z.jsx)(g.ZP,{item:!0,xs:12,sm:6,md:4,children:(0,Z.jsx)(j,{title:"Units Sold",total:null===S||void 0===S?void 0:S.sold_units,color:"warning"})})]}),(0,Z.jsxs)(g.ZP,{item:!0,xs:12,md:12,lg:12,children:[(0,Z.jsx)(x.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",mb:5,children:(0,Z.jsx)(m.Z,{variant:"h4",children:"Opportunity"})}),(0,Z.jsx)("div",{style:{width:"100%"},children:(0,Z.jsx)(H._,{dateAdapter:T.y,style:{width:"100%"},children:(0,Z.jsx)(L.W,{value:k,onChange:function(e){w(e)},localetext:{calendarWeekNumberHeaderText:"Week",calendarWeekNumberText:function(e){return"Week ".concat(e)}},showDaysOutsideCurrentMonth:!0,displayWeekNumber:!0,slots:{day:A},slotProps:{day:function(e){return{selectedDay:k,hoveredDay:r}}}})})})]})]})]})})}},3285:function(e,t,r){r.r(t),r.d(t,{default:function(){return _}});var n=r(9439),a=r(5987),o=r(1413),i=r(2791),l=r(7892),s=r.n(l),d=r(6818),c=r.n(d),u=r(6934),v=r(3634),h=r(1652),m=r(1090),x=r(4639),p=r(5835),f=r(1614),y=r(3767),g=r(890),Z=r(7689),k=r(9434),w=r(8400),b=(r(2426),r(184)),j=["day","selectedDay","hoveredDay"];s().extend(c());var D=(0,u.ZP)(x.H,{shouldForwardProp:function(e){return"isSelected"!==e&&"isHovered"!==e}})((function(e){var t=e.theme,r=e.isSelected,n=e.isHovered,a=e.day;return(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({borderRadius:0},r&&{backgroundColor:t.palette.primary.main,color:t.palette.primary.contrastText,"&:hover, &:focus":{backgroundColor:t.palette.primary.main}}),n&&{backgroundColor:t.palette.primary[t.palette.mode],"&:hover, &:focus":{backgroundColor:t.palette.primary[t.palette.mode]}}),0===a.day()&&{borderTopLeftRadius:"50%",borderBottomLeftRadius:"50%"}),6===a.day()&&{borderTopRightRadius:"50%",borderBottomRightRadius:"50%"})})),S=((0,u.ZP)(f.Z)({height:"100vh",width:"100vw",padding:0,margin:0,display:"flex",flexDirection:"column"}),function(e,t){return null!=t&&e.isSame(t,"week")});function C(e){var t=e.day,r=e.selectedDay,n=e.hoveredDay,i=(0,a.Z)(e,j);return(0,b.jsx)(D,(0,o.Z)((0,o.Z)({},i),{},{day:t,sx:{px:2.5},disableMargin:!0,selected:!1,isSelected:S(t,r),isHovered:S(t,n)}))}function _(){var e=(0,i.useState)(null),t=(0,n.Z)(e,2),r=t[0],a=t[1],o=(0,i.useState)(s()()),l=(0,n.Z)(o,2),d=l[0],c=l[1],u=(0,Z.s0)(),x=(0,k.I0)(),f=(0,k.v9)((function(e){return e.auth})).userInfo;console.log("userInfo",f);var j=d.toDate(),D=(0,p.ZM)(j),S=(D.day,D.week),_=D.year;console.log("week",S);var R=new Date(_,0,1+7*S),P=R.getDay();R.setDate(R.getDate()-(0===P?6:P-1));var I=new Date(R);I.setDate(I.getDate()+6);var W=R.toLocaleDateString("en-US",{month:"short",day:"numeric"}),F=I.toLocaleDateString("en-US",{month:"short",day:"numeric"});return console.log("Result week:",D.week),D.week&&(x((0,w.v6)({auctioneerId:null===f||void 0===f?void 0:f.user_id,weekId:null===D||void 0===D?void 0:D.week})),u("/dashboard/users",{state:{week:D.week,startDate:W,endDate:F}})),(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(y.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",mb:5,children:(0,b.jsx)(g.Z,{variant:"h4",sx:{mb:5},children:"Opportunity"})}),(0,b.jsx)(h._,{dateAdapter:v.y,children:(0,b.jsx)(m.W,{value:d,onChange:function(e){c(e)},localetext:{calendarWeekNumberHeaderText:"Week",calendarWeekNumberText:function(e){return"Week ".concat(e)}},showDaysOutsideCurrentMonth:!0,slots:{day:C},slotProps:{day:function(e){return{selectedDay:d,hoveredDay:r,onClick:function(){console.log("Week days",e),a(e.weekNumber)}}}}})})]})}},7870:function(e,t,r){r.d(t,{v1:function(){return o}});var n=r(6098),a=r.n(n);function o(e){return i(e||0===e?a()(e).format("0.00a"):"",".00")}function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".00";return e.includes(t)?e.replace(t,""):e}}}]);
//# sourceMappingURL=52.e9a5e443.chunk.js.map
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists