PageSourceSearch

https://caterninja.com/_next/static/chunks/pages/Admin/manpower/city-report-05534a478faef312.js

js caterninja.com collected 2026-09-28 13:41:35 UTC 14,807 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5750],{96540:function(e,n,r){"use strict";var t=r(64836);n.Z=void 0;var i=t(r(64938)),a=r(85893);n.Z=(0,i.default)((0,a.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add")},46907:function(e,n,r){"use strict";var t=r(64836);n.Z=void 0;var i=t(r(64938)),a=r(85893);n.Z=(0,i.default)((0,a.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"}),"DeleteOutline")},72456:function(e,n,r){"use strict";var t=r(88169),i=r(85893);n.Z=(0,t.Z)((0,i.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh")},69368:function(e,n,r){"use strict";r.d(n,{Z:function(){return P}});var t=r(63366),i=r(87462),a=r(67294),l=r(63961),s=r(94780),c=r(2101),o=r(21964),d=r(88169),u=r(85893),h=(0,d.Z)((0,u.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),v=(0,d.Z)((0,u.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),x=(0,d.Z)((0,u.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox"),m=r(98216),Z=r(28628),j=r(90948),p=r(14136),f=r(1588),g=r(34867);function b(e){return(0,g.ZP)("MuiCheckbox",e)}var C=(0,f.Z)("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]);const y=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],S=(0,j.ZP)(o.Z,{shouldForwardProp:e=>(0,p.Z)(e)||"classes"===e,name:"MuiCheckbox",slot:"Root",overridesResolver:(e,n)=>{const{ownerState:r}=e;return[n.root,r.indeterminate&&n.indeterminate,n[`size${(0,m.Z)(r.size)}`],"default"!==r.color&&n[`color${(0,m.Z)(r.color)}`]]}})((({theme:e,ownerState:n})=>(0,i.Z)({color:(e.vars||e).palette.text.secondary},!n.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${"default"===n.color?e.vars.palette.action.activeChannel:e.vars.palette[n.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,c.Fq)("default"===n.color?e.palette.action.active:e.palette[n.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"default"!==n.color&&{[`&.${C.checked}, &.${C.indeterminate}`]:{color:(e.vars||e).palette[n.color].main},[`&.${C.disabled}`]:{color:(e.vars||e).palette.action.disabled}}))),z=(0,u.jsx)(v,{}),w=(0,u.jsx)(h,{}),k=(0,u.jsx)(x,{});var P=a.forwardRef((function(e,n){var r,c;const o=(0,Z.i)({props:e,name:"MuiCheckbox"}),{checkedIcon:d=z,color:h="primary",icon:v=w,indeterminate:x=!1,indeterminateIcon:j=k,inputProps:p,size:f="medium",className:g}=o,C=(0,t.Z)(o,y),P=x?j:v,M=x?j:d,I=(0,i.Z)({},o,{color:h,indeterminate:x,size:f}),L=(e=>{const{classes:n,indeterminate:r,color:t,size:a}=e,l={root:["root",r&&"indeterminate",`color${(0,m.Z)(t)}`,`size${(0,m.Z)(a)}`]},c=(0,s.Z)(l,b,n);return(0,i.Z)({},n,c)})(I);return(0,u.jsx)(S,(0,i.Z)({type:"checkbox",inputProps:(0,i.Z)({"data-indeterminate":x},p),icon:a.cloneElement(P,{fontSize:null!=(r=P.props.fontSize)?r:f}),checkedIcon:a.cloneElement(M,{fontSize:null!=(c=M.props.fontSize)?c:f}),ownerState:I,ref:n,className:(0,l.Z)(L.root,g)},C,{classes:L}))}))},82865:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/Admin/manpower/city-report",function(){return r(17199)}])},94002:function(e,n,r){"use strict";r.d(n,{W3:function(){return t},nd:function(){return i}});var t=[{name:"Bangalore",cities:["Bangalore"]},{name:"Chennai",cities:["Chennai"]},{name:"Hyderabad",cities:["Hyderabad"]},{name:"NCR",cities:["Delhi","Gurgaon","Ghaziabad","Noida"]},{name:"MMR",cities:["Mumbai","Navi-Mumbai","Thane"]},{name:"Pune",cities:["Pune"]},{name:"Chandigarh",cities:["Chandigarh"]}],i=function(e){var n=t.find((function(n){return n.name===e}));return n?n.cities:[]}},17199:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return $}});var t=r(47568),i=r(97582),a=r(85893),l=r(67294),s=r(5616),c=r(15861),o=r(86886),d=r(94054),u=r(47312),h=r(18360),v=r(18972),x=r(50135),m=r(591),Z=r(47120),j=r(72882),p=r(90629),f=r(7906),g=r(53184),b=r(53816),C=r(53252),y=r(295),S=r(69417),z=r(50480),w=r(45843),k=r(87918),P=r(50657),M=r(37645),I=r(6514),L=r(31425),N=r(21407),_=(0,r(88169).Z)((0,a.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39"}),"Public"),O=r(72456),D=r(62343),W=r(49439),A=r(40876),E=r(69598),H=r(72040
1),B=r(94002),R=r(38188),V=function(){return(new Date).toISOString().split("T")[0]},$=function(){var e,n,r,$=(0,l.useState)((null===(e=B.W3[0])||void 0===e?void 0:e.name)||""),F=$[0],T=$[1],G=(0,l.useState)(V()),U=G[0],X=G[1],Y=(0,l.useState)([]),q=Y[0],J=Y[1],K=(0,l.useState)(!1),Q=K[0],ee=K[1],ne=(0,l.useState)("lunch"),re=ne[0],te=ne[1],ie=(0,l.useState)(""),ae=ie[0],le=ie[1],se=(0,l.useState)((null===(n=B.W3[0])||void 0===n?void 0:n.name)||""),ce=se[0],oe=se[1],de=(0,l.useState)((0,B.nd)(null===(r=B.W3[0])||void 0===r?void 0:r.name)[0]||""),ue=de[0],he=de[1],ve=(0,l.useState)(V()),xe=ve[0],me=ve[1],Ze=(0,l.useState)("all"),je=Ze[0],pe=Ze[1],fe=(0,l.useState)(!1),ge=fe[0],be=fe[1],Ce=(0,l.useState)([]),ye=Ce[0],Se=Ce[1],ze=(0,l.useState)(!1),we=ze[0],ke=ze[1],Pe=(0,l.useState)(null),Me=Pe[0],Ie=Pe[1],Le=(0,E.VY)(),Ne=Le.alert,_e=Le.showAlert,Oe=Le.handleCloseAlert,De=(0,B.nd)(ce),We=function(){var e=(0,t.Z)((function(){var e,n,r;return(0,i.__generator)(this,(function(t){switch(t.label){case 0:if(!F||!U)return[2];ee(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,(0,H.kj)({cityBunch:F,eventDate:U})];case 2:return(null===(n=t.sent())||void 0===n||null===(e=n.data)||void 0===e?void 0:e.flag)?J(n.data.data.results||[]):_e((null===n||void 0===n||null===(r=n.data)||void 0===r?void 0:r.message)||"Failed to load manpower summary","error"),[3,5];case 3:return t.sent(),_e("Failed to load manpower summary","error"),[3,5];case 4:return ee(!1),[7];case 5:return[2]}}
1))}));return function(){return e.apply(this,arguments)}}(),Ae=function(){var e=(0,t.Z)((function(){var e,n,r;return(0,i.__generator)(this,(function(t){switch(t.label){case 0:if(!ue||!xe)return[2];ke(!0),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,(0,H.pY)({city:ue,eventDate:xe})];case 2:return(null===(n=t.sent())||void 0===n||null===(e=n.data)||void 0===e?void 0:e.flag)?Se(n.data.data.results||[]):_e((null===n||void 0===n||null===(r=n.data)||void 0===r?void 0:r.message)||"Failed to load order report","error"),[3,5];case 3:return t.sent(),_e("Failed to load order report","error"),[3,5];case 4:return ke(!1),[7];case 5:return[2]}}))}));return function(){return e.apply(this,arguments)}}();(0,l.useEffect)((function(){We()}),[F,U]),(0,l.useEffect)((function(){Ae()}),[ue,xe]);var Ee=ye.filter((function(e){return"all"===je||e.slot.toLowerCase()===je})).filter((function(e){var n;return!ge||(null===(n=e.liveServiceNames)||void 0===n?void 0:n.length)>0}));return(0,a.jsx)(N.Z,{theme:W.Z,children:(0,a.jsx)(D.Z,{children:(0,a.jsxs)(s.Z,{sx:{p:{xs:2,md:4},bgcolor:"background.default",minHeight:"100vh"},children:[(0,a.jsx)(A.mr,{title:"City Manpower Report",subtitle:"Live services' Lunch/Dinner slot capacity for a city bunch and date, plus order-level manpower allocation per city.",icon:_}),(0,a.jsxs)(c.Z,{variant:"h6",sx:{mb:1},children:["City-wise Manpower Summary \u2014 ",F," (",U,")"]}),(0,a.jsxs)(c.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:["Every live service's slot capacity plus owned/outsourced captain availability, scoped to the ",F," bunch's own orders on this date only."]}),(0,a.jsxs)(o.ZP,{container:!0,spacing:2,sx:{mb:2},alignItems:"center",children:[(0,a.jsx)(o.ZP,{item:!0,xs:12,md:3,children:(0,a.jsxs)(d.Z,{fullWidth:!0,size:"small",children:[(0,a.jsx)(u.Z,{children:"City Bunch"}),(0,a.jsx)(h.Z,{value:F,label:"City Bunch",onChange:function(e){return T(e.target.value)},children:B.W3.map((function(e){return(0,a.jsxs)(v.Z,{value:e.name,children:[e.name," (",e.cities.join(", "),")"]},e.name)}))})]})}),(0,a.jsx)(o.ZP,{item:!0,xs:12,md:3,children:(0,a.jsx)(x.Z,{fullWidth:!0,size:"small",label:"Event Date",type:"date",value:U,onChange:function(e){return X(e.target.value)},InputLabelProps:{shrink:!0}})}),(0,a.jsx)(o.ZP,{item:!0,xs:12,md:3,children:(0,a.jsxs)(m.Z,{exclusive:!0,size:"small",color:"primary",value:re,onChange:function(e,n){return n&&te(n)},children:[(0,a.jsx)(Z.Z,{value:"lunch",children:"Lunch"}),(0,a.jsx)(Z.Z,{value:"dinner",children:"Dinner"})]})}),(0,a.jsx)(o.ZP,{item:!0,xs:12,md:3,children:(0,a.jsx)(x.Z,{fullWidth:!0,size:"small",label:"Search live service",value:ae,onChange:function(e){return le(e.target.value)},placeholder:"e.g. Pizza"})})]}),(0,a.jsx)(j.Z,{component:p.Z,sx:{mb:5},children:(0,a.jsxs)(f.Z,{size:"small",children:[(0,a.jsx)(g.Z,{children:(0,a.jsxs)(b.Z,{children:[(0,a.jsx)(C.Z,{children:"Live Service"}),(0,a.jsx)(C.Z,{children:"Slot"}),(0,a.jsx)(C.Z,{children:"Capacity \u2192 Occupied \u2192 Available"}),(0,a.jsx)(C.Z,{children:"Owned Captains"}),(0,a.jsx)(C.Z,{children:"Outsourced Captains"})]})}),(0,a.jsx)(y.Z,{children:q.length>0?q.filter((function(e){return e.liveServiceName.toLowerCase().includes(ae.trim().toLowerCase())})).map((function(e){var n=e[re];return(0,a.jsxs)(b.Z,{hover:!0,children:[(0,a.jsx)(C.Z,{children:e.liveServiceName}),(0,a.jsx)(C.Z,{children:"lunch"===re?"Lunch":"Dinner"}),(0,a.jsx)(C.Z,{children:n.configured?"".concat(n.total," \u2192 ").concat(n.occupied," \u2192 ").concat(n.available):"Unrestricted"}),(0,a.jsx)(C.Z,{children:"".concat(n.ownedCaptains," total / ").concat(n.ownedBusy," busy / ").concat(n.ownedAvailable," free")}),(0,a.jsx)(C.Z,{children:"".concat(n.outsourcedCaptains," total / ").concat(n.outsourcedUsed," used / ").concat(n.outsourcedAvailable," free")})]},e.liveServiceId)})):(0,a.jsx)(b.Z,{children:(0,a.jsx)(C.Z,{colSpan:5,align:"center",sx:{py:4},children:(0,a.jsx)(c.Z,{children:Q?"Loading...":"No live services configured"})})})})]})}),(0,a.jsx)(c.Z,{variant:"h6",sx:{mb:1},children:"Order-Level Manpower Report"}),(0,a.jsx)(c.Z,{variant:"body2",color:"text.secondary",sx:{mb:2},children:"Independent city bunch/date filters \u2014 orders sorted chronologically by event time."}),(0,a.jsxs)(o.ZP,{container:!0,spacing:2,sx:{mb:1},alignItems:"center",children:[(0,a.jsx)(o.ZP,{item:!0,xs:12,md:3,children:(0,a.jsxs)(d.Z,{fullWidth:!0,size:"small",children:[(0,a.jsx)(u.Z,{children:"City Bunch"}),(0,a.jsx)(h.Z,{value:ce,label:"City Bunch",onChange:function(e){return function(e){oe(e);var n=(0,B.nd)(e);n.includes(ue)||he(n[0]||"")}(e.target.value)},children:B.W3.map((function(e){return(0,a.jsx)(v.Z,{value:e.name,children:e.name},e.name)}))})]})}),(0,a.jsx)(o.ZP,{item:!0,xs:12,md:3,children:(0,a.jsxs)(d.Z,{fullWidth:!0,size:"small",children:[(0,a.jsx)(u.Z,{children:"City"}),(0,a.jsx)(h.Z,{value:ue,label:"City",onChange:function(e){return he(e.target.value)},children:De.map((function(e){return(0,a.jsx)(v.Z,{value:e,children:e},e)}))})]})}),(0,a.jsx)(o.ZP,{item:!0,xs:12,md:3,children:(0,a.jsx)(x.Z,{fullWidth:!0,size:"small",label:"Event Date",type:"date",value:xe,onChange:function(e){return me(e.target.value)},InputLabelProps:{shrink:!0}})}),(0,a.jsx)(o.ZP,{item:!0,xs:12,md:3,children:(0,a.jsx)(S.Z,{variant:"outlined",startIcon:(0,a.jsx)(O.Z,{}),onClick:function(){We(),Ae()},disabled:Q||we,children:Q||we?"Refreshing...":"Refresh"})})]}),(0,a.jsxs)(o.ZP,{container:!0,spacing:2,sx:{mb:2},alignItems:"center",children:[(0,a.jsx)(o.ZP,{item:!0,xs:12,md:4,children:(0,a.jsxs)(m.Z,{exclusive:!0,size:"small",color:"primary",value:je,onChange:function(e,n){return n&&pe(n)},children:[(0,a.jsx)(Z.Z,{value:"all",children:"All"}),(0,a.jsx)(Z.Z,{value:"lunch",children:"Lunch"}),(0,a.jsx)(Z.Z,{value:"dinner",children:"Dinner"})]})}),(0,a.jsx)(o.ZP,{item:!0,xs:12,md:4,children:(0,a.jsx)(z.Z,{control:(0,a.jsx)(w.Z,{size:"small",checked:ge,onChange:function(e){return be(e.target.checked)}}),label:"Only orders with live services"})})]}),(0,a.jsx)(j.Z,{component:p.Z,children:(0,a.jsxs)(f.Z,{size:"small",children:[(0,a.jsx)(g.Z,{children:(0,a.jsxs)(b.Z,{children:[(0,a.jsx)(C.Z,{children:"Order ID"}),(0,a.jsx)(C.Z,{children:"Product"}),(0,a.jsx)(C.Z,{children:"Live Services"}),(0,a.jsx)(C.Z,{children:"Event Time"}),(0,a.jsx)(C.Z,{align:"right",children:"Owned (In-house)"}),(0,a.jsx)(C.Z,{align:"right",children:"Outsourced"}),(0,a.jsx)(C.Z,{children:"Assigned Captains"}),(0,a.jsx)(C.Z,{children:"Slot"}),(0,a.jsx)(C.Z,{children:"Manage"})]})}),(0,a.jsx)(y.Z,{children:Ee.length>0?Ee.map((function(e){var n,r;return(0,a.jsxs)(b.Z,{hover:!0,children:[(0,a.jsx)(C.Z,{children:e.orderId}),(0,a.jsx)(C.Z,{children:e.product||"-"}),(0,a.jsx)(C.Z,{children:(null===(n=e.liveServiceNames)||void 0===n?void 0:n.length)>0?e.liveServiceNames.join(", "):"-"}),(0,a.jsx)(C.Z,{children:e.eventTime||"-"}),(0,a.jsx)(C.Z,{align:"right",children:e.ownedCount}),(0,a.jsx)(C.Z,{align:"right",children:e.outsourcedCount}),(0,a.jsx)(C.Z,{children:(null===(r=e.captainAssignments)||void 0===r?void 0:r.length)>0?(0,a.jsx)(s.Z,{sx:{display:"flex",flexDirection:"column",gap:.25},children:e.captainAssignments.map((function(e,n){return(0,a.jsxs)(c.Z,{variant:"body2",children:[e.name," (",e.type,e.liveServiceName?" \u2014 ".concat(e.liveServiceName):"",")"]},n)}))}):"-"}),(0,a.jsx)(C.Z,{children:(0,a.jsx)(k.Z,{label:e.slot,size:"small",color:"Lunch"===e.slot?"warning":"Dinner"===e.slot?"info":"default"})}),(0,a.jsx)(C.Z,{children:(0,a.jsx)(S.Z,{size:"small",variant:"outlined",onClick:function(){return Ie(e.orderId)},children:"Manage Captains"})})]},e.orderId)})):(0,a.jsx)(b.Z,{children:(0,a.jsx)(C.Z,{colSpan:9,align:"center",sx:{py:4},children:(0,a.jsx)(c.Z,{children:we?"Loading...":"No orders found for ".concat(ue," on ").concat(xe)})})})})]})}),(0,a.jsxs)(P.Z,{open:!!Me,onClose:function(){Ie(null),Ae()},maxWidth:"md",fullWidth:!0,children:[(0,a.jsxs)(M.Z,{children:["Manage Captains \u2014 ",Me]}),(0,a.jsx)(I.Z,{children:Me&&(0,a.jsx)(R.Z,{orderId:Me,showAssignedCaptains:!0,canAssign:!0})}),(0,a.jsx)(L.Z,{children:(0,a.jsx)(S.Z,{onClick:function(){Ie(null),Ae()},children:"Close"})})]}),(0,a.jsx)(A.L9,{alert:Ne,onClose:Oe})]})})})}}},function(e){e.O(0,[8166,1664,5675,2858,4948,2724,6788,5908,6252,13,6886,135,2453,7918,1130,1840,7403,5191,7607,8086,8188,876,9598,9774,2888,179],(function(){return n=82865,e(e.s=n);var n}));var n=e.O();_N_E=n}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.