anarock-widgets 1.0.319 → 1.0.320
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -369,6 +369,6 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
369
369
|
*
|
|
370
370
|
* This source code is licensed under the ISC license.
|
|
371
371
|
* See the LICENSE file in the root directory of this source tree.
|
|
372
|
-
*/const hde=[["path",{d:"M19 5a2 2 0 0 0-2 2v11",key:"s41o68"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}],["path",{d:"M7 13h10",key:"1rwob1"}],["path",{d:"M7 9h10",key:"12czzb"}],["path",{d:"M9 5a2 2 0 0 0-2 2v11",key:"x0q4gh"}]],mde=Ri("waves-ladder",hde),Ct=({title:e,icon:t,period:n,isDateSelector:r=!1,children:i,footer:o,className:a="",titleWeight:s,titleColor:l,iconClassName:c,titleClassName:u,childrenClassName:d,rightContent:f,onCalendarClick:p,onPrevClick:h,onNextClick:m})=>{const v=s==="semi-bold"?600:500;return g.jsxs("div",{className:`relative bg-white p-[24px] !border-[0.5px] !border-[#EBEBEB] !rounded-[12px] !shadow-[0_0_12px_0_#EAF2FF] ${a}`,children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{className:"flex items-center gap-[8px]",children:[t&&g.jsx("div",{className:c,children:t}),g.jsx("div",{style:{fontWeight:v,color:l||"#121212"},className:u||"text-[20px] leading-[24px]",children:e})]}),g.jsxs("div",{className:"flex items-center gap-[12px]",children:[f&&f,n&&!r&&g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:n}),r&&g.jsxs("div",{className:"flex items-center gap-[12px] px-[16px] py-[8px] rounded-[8px] bg-white text-sm text-[#64748B]",children:[g.jsx(tde,{size:16,className:"text-[#64748B] cursor-pointer",onClick:p}),g.jsx($R,{size:16,className:"cursor-pointer",onClick:h}),g.jsx("span",{className:"text-[12px] leading-[16px] text-[#64748B]",children:n}),g.jsx(BR,{size:16,className:"cursor-pointer",onClick:m})]})]})]}),g.jsx("div",{className:`flex-1 min-h-0 mt-4 ${d}`,children:i}),o&&g.jsx("div",{className:"mt-4 pt-4 border-t border-gray-100 text-[12px] text-[#64748B]",children:o})]})},gde={completed:18,not_completed:6,missed:4};function vde({data:e={}}){const t=e&&Object.keys(e).length>0?e:gde,n=[{name:"Completed",value:Number(t?.completed??0),color:"#12B981"},{name:"Delayed",value:Number(t?.not_completed??0),color:"#EF4444"},{name:"Missed",value:Number(t?.missed??0),color:"#F69E0A"}],r=Number(t?.completed??0)+Number(t?.not_completed??0)+Number(t?.missed??0),i=Number(t?.completed??0);return g.jsx(Ct,{title:"Guard Patrols",className:"h-[362px]",titleWeight:"semi-bold",children:g.jsxs("div",{className:"flex flex-col items-center justify-center",children:[g.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Ni,{children:[g.jsx(Jr,{data:n??[],innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:n?.map?.((o,a)=>g.jsx(pn,{fill:o?.color??"#ccc"},`cell-${a}`))}),g.jsx(kt,{content:g.jsx(FR,{})})]})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[i??0,"/",r??0]}),g.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),g.jsx("div",{className:"flex flex-col w-full text-[14px]",children:n?.length?n?.map?.((o,a)=>g.jsxs("div",{className:`flex items-center justify-between py-[10px] ${a!==(n?.length??0)-1?"border-b border-[#F1F5F9]":""}`,children:[g.jsxs("div",{className:"flex items-center gap-[10px]",children:[g.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:o?.color??"#ccc"}}),g.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:o?.name??"-"})]}),g.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:o?.value??0})]},o?.name??a)):g.jsx("div",{className:"text-center text-gray-400 text-sm py-[24px]",children:"No patrol data"})})]})})}Wn.register(Co,ko,a1,o1,Yr,ei);const yde=["10 AM","12 PM","2 PM","4 PM","6 PM","8 PM","10 PM"],zd={guest:[9,5,12,7,3,6,4],cab:[15,12,10,14,7,12,8],delivery:[22,18,16,20,22,14,17],service:[13,12,8,9,5,10,7]},bde=[{key:"Guest",datasetIndex:0,color:"#EF4444"},{key:"Cab",datasetIndex:1,color:"#7C3AED"},{key:"Delivery",datasetIndex:2,color:"#10B981"},{key:"Service",datasetIndex:3,color:"#F59E0B"}],xde=({color:e,size:t=12})=>g.jsx("svg",{width:t,height:t,viewBox:"0 0 12 12",style:{display:"block",flexShrink:0},children:g.jsx("rect",{x:"1",y:"1",width:"10",height:"10",rx:"0",fill:e,transform:"rotate(45 6 6)"})}),wde=({chartRef:e})=>{const[t,n]=k.useState({}),r=i=>{const o=e.current;if(!o)return;const a=o.getDatasetMeta(i),s=!!a.hidden;a.hidden=!s,o.update(),n(l=>({...l,[i]:!s}))};return g.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"76px",marginTop:"10px",paddingBottom:"8px",flexWrap:"wrap"},children:bde.map(({key:i,datasetIndex:o,color:a})=>{const s=!!t[o];return g.jsxs("div",{onClick:()=>r(o),style:{display:"flex",alignItems:"center",gap:"6px",cursor:"pointer",userSelect:"none",opacity:s?.45:1,transition:"opacity 0.2s ease"},children:[g.jsx(xde,{color:a,size:12}),g.jsx("span",{style:{fontSize:"13px",color:"#64748B",fontWeight:400,lineHeight:1,textDecoration:s?"line-through":"none",transition:"text-decoration 0.15s ease"},children:i})]},i)})})},_de=({data:e})=>{const t=k.useRef(null),r={labels:Array.isArray(e?.labels)&&e.labels.length>0?e.labels:yde,datasets:[{label:"Guest",data:Array.isArray(e?.guest)&&e.guest.length>0?e.guest:zd.guest,borderColor:"#EF4444",backgroundColor:"rgba(239,68,68,0.15)",pointBackgroundColor:"#EF4444",pointStyle:"rectRot",fill:!1},{label:"Cab",data:Array.isArray(e?.cab)&&e.cab.length>0?e.cab:zd.cab,borderColor:"#7C3AED",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#7C3AED",pointStyle:"rectRot",fill:!1},{label:"Delivery",data:Array.isArray(e?.delivery)&&e.delivery.length>0?e.delivery:zd.delivery,borderColor:"#10B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#10B981",pointStyle:"rectRot",fill:!1},{label:"Service",data:Array.isArray(e?.service)&&e.service.length>0?e.service:zd.service,borderColor:"#F59E0B",backgroundColor:"rgba(245,158,11,0.15)",pointBackgroundColor:"#F59E0B",pointStyle:"rectRot",fill:!1}]},i={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:o=>o[0].label,label:o=>`${o.dataset.label} ${o.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return g.jsxs(Ie,{title:"Hourly Traffic Flow",className:"w-full h-[362px]",children:[g.jsx("div",{style:{height:"calc(100% - 44px)",width:"100%"},children:g.jsx(l1,{ref:t,data:r,options:i})}),g.jsx(wde,{chartRef:t})]})},Sde={open:4,in_progress:7,closed:12},Ede=[{incident_code:"INC-401",severity_level:"L1",severity:"Danger"},{incident_code:"INC-402",severity_level:"L2",severity:"High"},{incident_code:"INC-403",severity_level:"L3",severity:"Low"}];function Ode({incidentReports:e={},incidentReportsDetails:t=[]}){const n=e&&Object.keys(e).length>0?e:Sde,r=Array.isArray(t)?t:Ede,i=Number(n?.open??0),o=Number(n?.in_progress??0),a=Number(n?.closed??0);return g.jsx(Ct,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:g.jsxs("div",{children:[g.jsxs("div",{className:"flex w-full text-center gap-[24px]",children:[g.jsxs("div",{className:"flex-1 py-[12px] bg-[#FBF4F4] h-[76px] rounded",children:[g.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#AB0000]",children:i??0}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),g.jsxs("div",{className:"flex-1 py-[12px] bg-[#FFFBF2] h-[76px] rounded",children:[g.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#E7A015]",children:o??0}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#E7A015]",children:"In-progress"})]}),g.jsxs("div",{className:"flex-1 py-[12px] bg-[#F7FEFA] h-[76px] rounded",children:[g.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:a??0}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),g.jsx("div",{className:"mt-4 space-y-2",children:r?.length?r?.map?.((s,l)=>{const c=s?.severity==="Danger"?"text-[#AB0000]":s?.severity==="High"?"text-[#E7A015]":"text-[#1FA05B]";return g.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#FAFBFD] rounded-md",children:[g.jsx("div",{className:"flex items-center gap-[8px]",children:g.jsx("div",{className:"text-gray-700 font-medium",children:s?.incident_code??"-"})}),g.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${c}`,children:g.jsxs("div",{children:[s?.severity_level??"-"," - ",s?.severity??"-"]})})]},l)}):g.jsx("div",{className:"text-center text-gray-400 text-sm py-[24px]",children:"No incidents found"})})]})})}const Cde=[{total_staff:42,absent_staff:6}],kde=[{staff_role_name:"Security Guard",total_staff:18,present_staff:16},{staff_role_name:"Supervisor",total_staff:8,present_staff:7},{staff_role_name:"Technician",total_staff:10,present_staff:9},{staff_role_name:"Technician",total_staff:10,present_staff:9}];function Pde({staffPresentAbsent:e,staffPresentByRole:t}){const n=Array.isArray(e)&&e.length>0?e:Cde,r=Array.isArray(t)&&t.length>0?t:kde,i=n?.[0]?.total_staff??0,o=n?.[0]?.absent_staff??0,a=(i??0)-(o??0);return g.jsx(Ct,{title:"Staff Attendance",className:"h-[362px] overflow-hidden ",titleWeight:"semi-bold",children:g.jsxs("div",{children:[g.jsxs("div",{className:"flex gap-[16px] text-center mt-[24px]",children:[g.jsxs("div",{className:"flex-1 py-[12px] bg-[#F7FEFA] rounded h-[76px]",children:[g.jsx("div",{className:"text-[24px] font-medium text-[#1FA05B]",children:a??0}),g.jsx("div",{className:"text-[12px] text-[#1FA05B]",children:"Present"})]}),g.jsxs("div",{className:"flex-1 py-[12px] bg-[#FBF4F4] rounded h-[76px]",children:[g.jsx("div",{className:"text-[24px] font-medium text-[#AB0000]",children:o??0}),g.jsx("div",{className:"text-[12px] text-[#AB0000]",children:"Absent"})]})]}),g.jsx("div",{className:"mt-[24px] pb-[16px] space-y-[8px] overflow-y-auto max-h-[200px] hide-scrollbar",children:r?.length?r?.map?.((s,l)=>{const c=Number(s?.total_staff??0),u=Number(s?.present_staff??0);return g.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#F8FAFC] rounded-md",children:[g.jsx("div",{className:"text-[#121212] text-[14px] leading-[18px] font-medium",children:s?.staff_role_name??"-"}),g.jsxs("div",{className:"text-[14px] leading-[20px] text-[#64748B]",children:[u??0,"/",c??0]})]},l)}):g.jsx(g.Fragment,{})})]})})}function Dde(e){return Ze({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M116,132V96a12,12,0,0,1,24,0v36a12,12,0,0,1-24,0Zm12,56a16,16,0,1,0-16-16A16,16,0,0,0,128,188ZM228,56v56c0,54.29-26.32,87.22-48.4,105.29-23.71,19.39-47.44,26-48.44,26.29a12.1,12.1,0,0,1-6.32,0c-1-.28-24.73-6.9-48.44-26.29C54.32,199.22,28,166.29,28,112V56A20,20,0,0,1,48,36H208A20,20,0,0,1,228,56Zm-24,4H52v52c0,35.71,13.09,64.69,38.91,86.15A126.14,126.14,0,0,0,128,219.38a126.28,126.28,0,0,0,37.09-21.23C190.91,176.69,204,147.71,204,112Z"},child:[]}]})(e)}function Ade({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=lu,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return g.jsxs(Ie,{title:e,icon:g.jsx("div",{className:"h-6 w-6 grid place-items-center",children:g.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[g.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),g.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[g.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),g.jsx("div",{className:"text-slate-500",children:r})]})]})}const Tde=[{title:"Total Visitors",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:wb,iconColor:"text-[#329DFF]"},{title:"Active Incidents",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:toe,iconColor:"text-[#F69E0A]"},{title:"Missed Patrols",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Dde,iconColor:"text-[#AB0000]"},{title:"Parking Usage",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:x3,iconColor:"text-[#36AB6C]"}];function Mde({data:e}){const t=Array.isArray(e)&&e.length>0?e:Tde;return g.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>g.jsx(Ade,{...n},r))})}const Nde=[{title:"Maintenance",total:12,pending:3},{title:"Security",total:8,pending:1},{title:"Housekeeping",total:6,pending:2},{title:"Utilities",total:10,pending:4}],jde=(e="")=>e.replace(/</g,"<").replace(/>/g,">").replace(/<[^>]*>/g,"").trim();function Rde({data:e}){const t=Array.isArray(e?.complaints_by_category)&&e.complaints_by_category.length>0?e.complaints_by_category.map(n=>({title:jde(n.category_name)||"—",total:n.total||0,pending:n.pending||0})):Nde;return g.jsx(Ie,{title:"Complaints",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:g.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>g.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-[8px] p-[12px] h-[62px]",children:[g.jsxs("div",{className:"flex flex-col",children:[g.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),g.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),g.jsxs("div",{className:"flex flex-col items-end",children:[g.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},r))})})}const Ide=e=>{const t={0:"𝟎",1:"𝟏",2:"𝟐",3:"𝟑",4:"𝟒",5:"𝟓",6:"𝟔",7:"𝟕",8:"𝟖",9:"𝟗"};return String(e).split("").map(n=>t[n]||n).join("")},Fde=[{level:"Level 1",open_count:3,in_progress_count:4,closed_count:5,total:12},{level:"Level 2",open_count:1,in_progress_count:1,closed_count:1,total:3},{level:"Level 3",open_count:5,in_progress_count:2,closed_count:3,total:10}],Lde=({active:e,payload:t,label:n})=>{if(!e||!t)return null;const r=[{key:"open_count",label:"Open",color:"#EF4444"},{key:"in_progress_count",label:"In Progress",color:"#F59D0D"},{key:"closed_count",label:"Closed",color:"#12B981"}];return g.jsxs("div",{style:{backgroundColor:"#0B0B0B",padding:"14px 40px 14px 18px",borderRadius:"10px",color:"#ffffff"},children:[g.jsx("div",{style:{color:"#ffffff",fontSize:"12px",fontWeight:"900",marginBottom:"10px"},children:n}),r.map((i,o)=>{const a=t[0]?.payload[i.key]||0,s=Ide(a);return g.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:o<r.length-1?"8px":"0",fontSize:"12px"},children:[g.jsx("div",{style:{width:"8px",height:"8px",backgroundColor:i.color,transform:"rotate(45deg)",marginRight:"8px"}}),g.jsx("span",{style:{color:"D1D3D4",minWidth:"100px"},children:i.label}),g.jsx("span",{style:{marginLeft:"auto",fontWeight:"700"},children:s})]},i.key)})]})},$de=()=>{const e=[{label:"Open",color:"#EF4444"},{label:"In Progress",color:"#F59D0D"},{label:"Closed",color:"#12B981"}];return g.jsx("div",{style:{display:"flex",justifyContent:"space-between",gap:"15px"},children:e.map(t=>g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[g.jsx("div",{style:{width:"6px",height:"6px",backgroundColor:t.color,transform:"rotate(45deg)"}}),g.jsx("span",{style:{fontSize:"14px"},children:t.label})]},t.label))})},Bde=({data:e})=>{const t=k.useMemo(()=>(Array.isArray(e?.complaints_by_level)&&e.complaints_by_level.some(l=>Number(l.total)>0)?e.complaints_by_level:Fde).map(l=>({level:l.level||"—",open_count:Number(l.open_count)||0,in_progress_count:Number(l.in_progress_count)||0,closed_count:Number(l.closed_count)||0,total:Number(l.total)||0})),[e]),n=k.useMemo(()=>Math.max(...t.map(a=>a.total),5),[t]),r=Math.ceil(n*1.2),i=6,o=Math.max(Math.ceil(n/i),1);return g.jsxs(Ie,{title:"Complaints by Level",className:"w-full h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:[g.jsx(_t,{width:"100%",height:"85%",children:g.jsxs(Eo,{data:t,margin:{top:5,right:-25,left:-30,bottom:5},children:[g.jsx(or,{strokeDasharray:"0",vertical:!1}),g.jsx(Bn,{dataKey:"level"}),g.jsx(An,{domain:[0,r],ticks:Array.from({length:i+1},(a,s)=>s*o)}),g.jsx(kt,{content:g.jsx(Lde,{}),cursor:!1}),g.jsx(Kt,{dataKey:"open_count",stackId:"a",fill:"#EF4444",barSize:44,radius:[0,0,0,0]}),g.jsx(Kt,{dataKey:"in_progress_count",stackId:"a",fill:"#F59D0D",barSize:44,radius:[0,0,0,0]}),g.jsx(Kt,{dataKey:"closed_count",stackId:"a",fill:"#12B981",barSize:44,radius:[0,0,0,0]})]})}),g.jsx($de,{})]})},Wde=[{title:"Maintenance",total:18,pending:4},{title:"Security",total:11,pending:2},{title:"Housekeeping",total:9,pending:3},{title:"Utilities",total:14,pending:5}];function zde({data:e}){const t=Array.isArray(e?.request_box_by_type)&&e.request_box_by_type.length>0?e.request_box_by_type.map(n=>({title:n.category_name||"—",total:Number(n.total)||0,pending:Number(n.pending)||0})):Wde;return g.jsx(Ie,{title:"Request Box",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:g.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>g.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-[8px] p-[12px] h-[62px]",children:[g.jsxs("div",{className:"flex flex-col",children:[g.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),g.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),g.jsxs("div",{className:"flex flex-col items-end",children:[g.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},`${n.title}-${r}`))})})}function Vde(e){return Ze({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinejoin:"round",strokeWidth:"32",d:"M416 221.25V416a48 48 0 0 1-48 48H144a48 48 0 0 1-48-48V96a48 48 0 0 1 48-48h98.75a32 32 0 0 1 22.62 9.37l141.26 141.26a32 32 0 0 1 9.37 22.62z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M256 56v120a32 32 0 0 0 32 32h120m-232 80h160m-160 80h160"},child:[]}]})(e)}const Hde=["open_complaints","pending_requests","avg_response_time","resolution_rate"],Yde={open_complaints:{title:"Open Complaints",Icon:qP,iconColor:"#AB0000",deltaLabel:"Compared to last month"},pending_requests:{title:"Pending Requests",Icon:Vde,iconColor:"#E7A015",deltaLabel:"Compared to last month"},avg_response_time:{title:"Avg Response Time",Icon:D3,iconColor:"#1FA05B",deltaLabel:"Compared to last month"},resolution_rate:{title:"Resolution Rate",Icon:O3,iconColor:"#329DFF",deltaLabel:"Compared to last month"}},Ude=({children:e,size:t=28,lineHeight:n=32,weight:r=500,color:i="#121212"})=>g.jsx("div",{style:{fontWeight:r,fontSize:`${t}px`,lineHeight:`${n}px`,color:i},children:e}),Kde={primary:{size:28,lineHeight:32,weight:500}},qde={open_complaints:{current:24,trend_percent:"-8%",direction:"bad"},pending_requests:{current:17,trend_percent:"-5%",direction:"bad"},avg_response_time:{current:"2.4 h",trend_percent:"+6%",direction:"good"},resolution_rate:{current:"89%",trend_percent:"+4%",direction:"good"}};function Gde({id:e,data:t}){return e&&t&&!t[e]&&t.current!==void 0?g.jsx(fk,{id:e,data:t}):g.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[16px]",children:Hde.map(n=>g.jsx(fk,{id:n},n))})}function fk({id:e,data:t}){const n=Yde[e];if(!n)return null;const r=(d,f)=>f==null?"—":d==="avg_response_time"?typeof f=="number"?`${f} h`:f:d==="resolution_rate"&&typeof f=="number"?`${f}%`:f,{title:i,Icon:o=lu,iconColor:a,deltaLabel:s}=n,l=t&&Object.keys(t).length>0?t:qde[e],c=r(e,l?.current),u=l?.trend_percent??"—";return l?.direction==="good"||l?.direction,g.jsx("div",{className:"h-[132px]",children:g.jsxs(Ie,{title:i,titleColor:a,icon:g.jsx("div",{className:"h-[20px] w-[20px] flex items-center justify-center",children:g.jsx(o,{className:"h-[20px] w-[20px]",style:{color:a}})}),childrenClassName:"!space-y-[12px]",iconClassName:"!gap-[12px]",children:[g.jsx(Ude,{...Kde.primary,children:c}),g.jsxs("div",{className:"flex items-center gap-[8px] text-[12px] leading-[16px]",children:[g.jsx(eh,{value:u}),g.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:s})]})]})})}const Xde=[{title:"Holi Celebration",date:"25 Jun 2025",rsvp:"78/100",utilisation:71,status:"Upcoming"},{title:"Maintenance Meeting",date:"25 Jun 2025",rsvp:"45/60",utilisation:75,status:"Completed"}];function Qde({title:e,date:t,rsvp:n,utilisation:r,status:i}){return g.jsxs("div",{className:" bg-[#F8FAFC] h-[106px] px-[12px] mt-3",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx("div",{className:"text-[16px] leading-[20px] font-semibold text-[#121212]",children:e}),g.jsx("div",{className:`!text-[12px] font-medium leading-[16px] px-[8px] py-[4px] ${i==="Completed"?"text-[#36AB6C] bg-[#E6F7EE]":i==="Upcoming"?"text-[#329DFF] bg-[#E6F2FF]":"text-slate-500 bg-slate-100"}`,children:i})]}),g.jsx("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:t}),g.jsxs("div",{className:"flex justify-between items-center mt-2",children:[g.jsxs("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:[n," RSVP"]}),g.jsxs("div",{className:"text-[#3C82F6] text-[14px] leading-[18px] font-medium",children:[r,"% utilisation"]})]}),g.jsx("div",{className:"w-full bg-[#F8FAFC] h-[6px] rounded mt-2 mb-3",children:g.jsx("div",{className:"h-[6px] rounded bg-[#3C82F6]",style:{width:`${r}%`}})})]})}function Zde({data:e}){const t=Array.isArray(e)?e:Xde;return g.jsx(Ie,{title:"Events Utilisation",className:"w-full h-[360px] overflow-y-auto hide-scrollbar",children:g.jsx("div",{className:"m-auto",children:t?.length>0?t.map((n,r)=>g.jsx(Qde,{...n},`${n.title}-${r}`)):g.jsx("div",{className:"h-full flex items-center justify-center",children:g.jsx(ar,{})})})})}const Jde=[{label:"Active",value:138,subLabel:"3 expiring soon",bgColor:"bg-[#F0FFF7]",textColor:"text-[#1FA05B]"},{label:"Scheduled",value:13,subLabel:"4 this week",bgColor:"bg-[#FFFBF2]",textColor:"text-[#E7A015]"},{label:"Recurring",value:3,subLabel:"All active",bgColor:"bg-[#EDF6FF]",textColor:"text-[#329DFF]"},{label:"Expired",value:7,subLabel:"4 recent",bgColor:"bg-[#F6F6F6]",textColor:"text-[#64748B]"}];function efe({label:e,value:t,subLabel:n,bgColor:r,textColor:i}){return g.jsxs("div",{className:`rounded-[8px] p-[16px] ${r} h-[124px]`,children:[g.jsx("div",{className:`text-[16px] font-medium ${i} leading-[20px]`,children:e}),g.jsx("div",{className:"mt-4 text-[28px] leading-[32px] font-semibold text-[#121212]",children:t}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-2",children:n})]})}function tfe({data:e}){const t=Array.isArray(e)&&e.length>0?e:Jde;return g.jsx(Ie,{title:"Notice Board Status",className:"w-full h-[360px]",children:g.jsx("div",{className:"grid grid-cols-2 gap-[16px]",children:t.map((n,r)=>g.jsx(efe,{...n},`${n.label}-${r}`))})})}function nfe(e){return Ze({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M20 22H4C3.44772 22 3 21.5523 3 21V3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22ZM19 20V4H5V20H19ZM8 9H16V11H8V9ZM8 13H16V15H8V13Z"},child:[]}]})(e)}function rfe({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=lu,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50",iconUrl:l}){return g.jsx(Ie,{title:e,icon:g.jsx("div",{className:"grid place-items-center ",children:l?g.jsx("img",{src:l,alt:"icon",className:"h-8 w-8 object-contain"}):g.jsx(o,{className:`h-8 w-8 ${a}`})}),className:"h-[132px]",children:g.jsxs("div",{children:[g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),g.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[g.jsx(eh,{value:n}),g.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}function ife({data:e}){const t=[{title:e?.title||"Total Bookings",value:e?.value??0,delta:e?.delta??"0%",deltaLabel:e?.deltaLabel||"Compared to last month",positive:e?.positive??!1,Icon:e?.Icon,iconUrl:e?.iconUrl,iconColor:e?.iconColor||"text-emerald-600",iconBg:e?.iconBg||"bg-emerald-50"}];return g.jsx("div",{className:"h-full",children:t.map((n,r)=>g.jsx(rfe,{...n},r))})}function ofe(e){return Ze({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"},child:[]}]})(e)}function afe({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=lu,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return g.jsx(Ie,{title:e,icon:g.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:g.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:g.jsxs("div",{children:[g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),g.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[g.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),g.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}const sfe=[{title:"Notice",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:nfe,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"},{title:"Post",value:83,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:w3,iconColor:"text-[#329DFF]",iconBg:"bg-emerald-50"},{title:"Poll",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Jie,iconColor:"text-[#FA7E28]",iconBg:"bg-orange-100"},{title:"Poll",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:ofe,iconColor:"text-[#DBB467]",iconBg:"bg-yellow-100"}];function lfe({data:e}){const t=Array.isArray(e)&&e.length>0?e:sfe;return g.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>g.jsx(afe,{...n},r))})}const pk=({value:e=0,total:t=1,colorClass:n="",label:r=""})=>{const i=Number(e)||0,o=Number(t)||1,a=Math.max(0,Math.min(100,i/o*100)),s=n==="bg-[#3C81F6]"?"text-[#8B5CF6]":n==="bg-[#8B5CF6]"?"text-[#12B981]":"text-slate-600";return g.jsxs("div",{className:"flex flex-col items-start",children:[g.jsx("div",{className:"w-2/3 min-w-[80px] h-5 rounded-full overflow-hidden",children:g.jsx("div",{className:`h-[11px] rounded-full ${n||""}`,style:{width:n==="bg-[#12B981]"?`${a+45}%`:`${a}%`}})}),g.jsx("div",{className:`${s} !text-[12px] font-bold mt-1`,children:i??0}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-1",children:r??""})]})},cfe=({data:e,occupiedUnits:t=1,EmployeesCount:n=8910,AdminsCount:r=910})=>{const i=e?.total_occupants!==void 0&&e?.total_occupants!==null?Number(e?.total_occupants)||0:Number(t)||0,o=e?.total_members!==void 0&&e?.total_members!==null?Number(e?.total_members)||0:Number(n)||0,a=e?.total_admins!==void 0&&e?.total_admins!==null?Number(e?.total_admins)||0:Number(r)||0,s=(o||0)+(a||0);return g.jsx("div",{children:g.jsxs("div",{className:"bg-white !border-[0.5px] !border-[#EBEBEB] rounded-[12px] shadow-[0_0_12px_0_#EAF2FF] p-[16px] h-[128px]",children:[g.jsxs("div",{className:"flex items-center gap-[12px] h-[20px]",style:{marginBottom:"24px"},children:[g.jsx(wb,{className:"!text-[20px] text-[#329DFF]"}),g.jsx("div",{className:"font-medium text-[#121212] text-[16px] leading-[20px]",children:"Occupancy Overview"})]}),g.jsxs("div",{className:"flex items-start justify-between",children:[g.jsxs("div",{className:"flex flex-col gap-[4px]",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] font-normal",children:"Total Occupants"}),g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:i??0})]}),g.jsxs("div",{className:"flex items-end gap-[4px]",children:[g.jsx(pk,{value:o??0,total:s||1,colorClass:"bg-[#3C81F6]",label:(o??0)<=1?"Employee":"Employees"}),g.jsx(pk,{value:a??0,total:s||1,colorClass:"bg-[#8B5CF6]",label:(a??0)<=1?"Admin":"Admins"})]})]})]})})};Wn.register(Co,ko,Tl,Yr);const ufe=()=>{const t={labels:["HP","Adobe","Anarock","Swiggy","Infosys","Zepto"],datasets:[{data:[2e3,1700,1500,1200,900,800],backgroundColor:["#3C81F6","#3C81F6","#3C81F6","#3C81F6","#3C81F6","#3C81F6"],barThickness:34}]},n={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff",displayColors:!1,callbacks:{label:r=>`Employees: ${r.parsed.y}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B",font:{size:12}}},y:{beginAtZero:!0,min:0,max:2e3,ticks:{stepSize:500,color:"#64748B",callback:r=>r},grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1}}}};return g.jsxs(Ie,{className:"w-full h-[238px]",title:"Employee Footfall (Static Data)",period:"Today",icon:g.jsx(Jue,{className:"!text-[24px] text-[#8B5CF6]"}),children:[g.jsxs("div",{className:"mb-[10px] mt-[8px] flex flex-col gap-[4px]!",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Employees Inside"}),g.jsx("div",{className:"text-[20px] leading-[24px] font-medium text-[#3C81F6]",children:"7,500"})]}),g.jsx("div",{className:"h-[110px]",children:g.jsx(Ml,{data:t,options:n})})]})},dfe="₹",hk=["bg-blue-500","bg-red-500","bg-purple-700"],ga={title:"Food & Beverages (Static Data)",period:"Today",summary:{totalOrders:247,revenueGenerated:"82K",growthPercentage:8,growthTotalPercentage:0},outlets:[{name:"HP",orders:120,revenue:"45K",percentage:70,color:"bg-[#3C81F6]"},{name:"Adobe",orders:85,revenue:"23K",percentage:50,color:"bg-[#3C81F6]"},{name:"Anarock",orders:42,revenue:"14K",percentage:25,color:"bg-[#3C81F6]"}]};function Op(e,t=null){if(typeof e=="number")return e;if(typeof e=="string"){const n=Number(e.replace("%","").trim());return Number.isNaN(n)?t:n}return t}function mk(e){if(e==null||e==="")return"0";if(typeof e=="number")return e_(e);const t=Number(e);return Number.isNaN(t)?String(e):e_(t)}function ffe(e){const t=e?.food_beverage_summary?{title:e?.title,period:e?.period,summary:{totalOrders:e?.food_beverage_summary?.total_orders,revenueGenerated:e?.food_beverage_summary?.revenue_generated,growthPercentage:e?.food_beverage_summary?.growth_percentage??e?.food_beverage_summary?.revenue_growth,growthTotalPercentage:e?.food_beverage_summary?.order_growth,currencyType:e?.food_beverage_summary?.currency_type},outlets:e?.chart_data}:e||{},n=t?.summary||{},i=(Array.isArray(t?.outlets)?t.outlets:[]).map((f,p)=>({name:f?.name||f?.outlet_name||f?.tenant_name||f?.company_name||"Unknown",orders:f?.orders??f?.total_orders??f?.count??0,revenue:f?.revenue??f?.revenue_generated??f?.total_revenue??0,percentage:f?.percentage,color:f?.color||hk[p%hk.length]})),o=n?.totalOrders??n?.orders??ga.summary.totalOrders,a=n?.revenueGenerated??n?.revenue??ga.summary.revenueGenerated,s=Op(n?.growthPercentage??n?.revenueGrowth,ga.summary.growthPercentage),l=Op(n?.growthTotalPercentage??n?.orderGrowth,ga.summary.growthTotalPercentage),c=n?.currencyType||n?.currency||dfe,u=i.reduce((f,p)=>f+(Number(p?.orders)||0),0),d=i.map(f=>({...f,percentage:f?.percentage!==null&&f?.percentage!==void 0?Number(f.percentage)||0:u>0?Math.round((Number(f?.orders)||0)/u*100):0}));return{title:t?.title||ga.title,period:t?.period||ga.period,summary:{totalOrders:o,revenueGenerated:a,growthPercentage:s,growthTotalPercentage:l,currencyType:c},outlets:d.length>0?d:ga.outlets}}function pfe({data:e,title:t,period:n,icon:r}){const i=ffe(e),o=t||i.title,a=n||i.period,s=r||g.jsx(pde,{className:"!text-[24px] text-[#FA7E28]"}),l=i.summary.totalOrders??0,c=mk(i.summary.revenueGenerated),u=Op(i.summary.growthPercentage,0),d=Op(i.summary.growthTotalPercentage,0),f=u>=0,p=d>=0;return g.jsx(Ie,{className:"h-[324px]",title:o,period:a,icon:s,children:g.jsxs("div",{className:"flex flex-col h-full",children:[g.jsxs("div",{className:"flex gap-[24px]",children:[g.jsxs("div",{className:"w-[65%] flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Orders"}),g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:l}),g.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${p?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[p?g.jsx(qa,{}):g.jsx(Ka,{}),d,"%",g.jsx("span",{children:"from last month"})]})]}),g.jsxs("div",{className:"w-[30%] flex flex-col gap-[8px] ",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] whitespace-nowrap",children:"Revenue Generated"}),g.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF] whitespace-nowrap",children:[i.summary.currencyType," ",c]}),g.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${f?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[f?g.jsx(qa,{}):g.jsx(Ka,{}),u,"%",g.jsx("span",{children:"from last month"})]})]})]}),g.jsx("div",{className:"mt-[16px]",children:i.outlets.map((h,m)=>g.jsxs("div",{className:m===i.outlets.length-1?"":"mb-[16px]",children:[g.jsxs("div",{className:"flex justify-between text-sm mb-[8px]",children:[g.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:h.name}),g.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[g.jsxs("div",{className:"text-[#64748B] inline-block",children:[h.orders," orders"]}),g.jsxs("div",{className:"mx-2 text-[#121212] inline-block",children:[i.summary.currencyType," ",mk(h.revenue)]})]})]}),g.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:g.jsx("div",{className:`h-[11px] rounded-full ${h.color}`,style:{width:`${h.percentage}%`}})})]},`${h.name}-${m}`))})]})})}function hfe({data:e}){const t=e?.amenity_summary?{amenitySummary:{totalBookings:e?.amenity_summary?.total_bookings??0,todayPaidRevenue:e?.amenity_summary?.today_paid_revenue??"0.00",growthPercentage:e?.amenity_summary?.growth_percentage??null,bookingGrowth:e?.amenity_summary?.booking_growth??null,currencyType:e?.amenity_summary?.currency_type??"₹"},chartData:Array.isArray(e?.chart_data)?e.chart_data.map(h=>({facility_name:h?.facility_name,total_bookings:h?.total_bookings??0,paid_revenue:h?.paid_revenue??"0",isPaid:h?.is_paid===!0})):[]}:e||{},n=t?.amenitySummary||{},i=(Array.isArray(t?.chartData)?t.chartData:[]).map(h=>({...h,isPaid:h?.isPaid===!0})),o=i.length>0&&i.every(h=>h?.isPaid===!1),a=n?.totalBookings||0,s=n?.bookingGrowth;let l=0;if(typeof s=="number")l=s;else if(typeof s=="string"){const h=s.replace("%","").trim(),m=Number(h);l=isNaN(m)?0:m}const c=i.reduce((h,m)=>{const v=m?.total_bookings||0;return h+v},0),u=i.map(h=>{const m=h?.total_bookings||0,v=h?.isPaid?`${n?.currencyType||"₹"} ${h?.paid_revenue||"0.00"}`:"",b=c>0?Math.round(m/c*100):0;return{name:h?.facility_name||"Unknown",bookings:m,revenue:v,percentage:b,color:"bg-[#3C81F6]",isPaid:h?.isPaid}}),d=n?.growthPercentage;let f=null;if(typeof d=="number")f=d;else if(typeof d=="string"){const h=d.replace("%","").trim(),m=Number(h);f=isNaN(m)?null:m}const p=f!==null?f>=0:!0;return g.jsx(Ie,{className:"h-[324px]",title:"Amenities",period:"Today",icon:g.jsx(mde,{className:"!text-[24px] text-[#8B5CF6]"}),children:g.jsxs("div",{className:"flex flex-col h-full",children:[g.jsxs("div",{className:"flex gap-[24px]",children:[g.jsxs("div",{className:"w-[65%] flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Bookings"}),g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:a}),g.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${l>=0?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[l>=0?g.jsx(qa,{}):g.jsx(Ka,{}),l,"%",g.jsx("span",{children:"from last month"})]})]}),!o&&g.jsxs("div",{className:"w-[25%] flex flex-col gap-[8px] ",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] whitespace-nowrap",children:"Revenue Generated"}),g.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF] whitespace-nowrap",children:[n?.currencyType||"₹"," ",n?.todayPaidRevenue??"0.00"]}),f!==null&&g.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${p?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[p?g.jsx(qa,{}):g.jsx(Ka,{}),f,"%",g.jsx("span",{children:"from last month"})]})]})]}),g.jsx("div",{className:"mt-[16px]",children:u.length>0?u.map((h,m)=>g.jsxs("div",{className:m===u.length-1?"":"mb-[16px]",children:[g.jsxs("div",{className:"flex justify-between text-sm mb-[8px]",children:[g.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:h?.name}),g.jsxs("div",{className:"font-medium text-[12px] leading-[16px]",children:[g.jsxs("div",{className:"text-[#64748B] inline",children:[h?.bookings," ",h?.bookings<=1?"booking":"bookings"]}),h?.isPaid&&g.jsx("div",{className:"mx-2 text-[#121212] inline",children:h?.revenue})]})]}),g.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:g.jsx("div",{className:`h-[11px] rounded-full ${h?.color}`,style:{width:`${h?.percentage}%`}})})]},m)):g.jsx("div",{className:"flex items-center justify-center h-[120px]",children:g.jsx("div",{className:"text-[12px] text-[#94A3B8]",children:"No amenity usage data available"})})})]})})}Wn.register(Co,ko,Tl,Yr,ei);function mfe({data:e=[]}){const t=[{level:"L1",open:55,in_progress:22,on_hold:15,closed:6},{level:"L2",open:45,in_progress:25,on_hold:18,closed:5},{level:"L3",open:58,in_progress:23,on_hold:14,closed:6}],n=e.length>0?e:t,r=[],i=[],o=[],a=[],s=[];for(let u=0;u<n.length;u++)r.push(n[u].level),i.push(Number(n[u].open)),o.push(Number(n[u].in_progress)),a.push(Number(n[u].on_hold)),s.push(Number(n[u].cancelled));const l={labels:r,datasets:[{label:"Open",data:i,backgroundColor:"#3B82F6",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"In Progress",data:o,backgroundColor:"#F59E0B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"On-Hold",data:a,backgroundColor:"#64748B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"Cancelled",data:s,backgroundColor:"#FB2C36",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"}]},c={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,pointStyle:"rectRot",padding:20,color:"#64748B"}},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff"}},scales:{x:{stacked:!0,grid:{display:!1},ticks:{color:"#64748B"}},y:{stacked:!0,beginAtZero:!0,grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1},ticks:{color:"#64748B",stepSize:1,precision:0,callback:u=>Math.round(u)}}}};return g.jsx(Ie,{className:"h-[267px]",title:"Ticket Escalation Levels",period:"Today",icon:g.jsx(C3,{className:"!text-[24px] text-[#3C81F6]"}),children:g.jsx("div",{className:"h-full",children:g.jsx(Ml,{data:l,options:c})})})}const gfe=({active:e,payload:t})=>{if(!e||!t||!t.length)return null;const n=t[0],r=n.payload.color;return g.jsx("div",{style:{backgroundColor:"#000000",color:"#ffffff",padding:"8px 10px",borderRadius:"8px",fontSize:"12px"},children:g.jsxs("div",{className:"flex items-center gap-[8px] font-medium",children:[g.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:r}}),g.jsx("div",{children:n.name}),g.jsx("div",{className:"ml-2",children:n.value})]})})};function vfe({data:e=null}){const n=e||{open:12,on_hold:5,cancelled:3,completed:156,in_progress:8,total_complaints:184},r=a=>{const s=Number(a);return isNaN(s)?0:s},i=[{name:"Completed",value:r(n.completed),color:"#10B981"},{name:"Open",value:r(n.open),color:"#3B82F6"},{name:"In Progress",value:r(n.in_progress),color:"#F59E0B"},{name:"On Hold",value:r(n.on_hold),color:"#6B7280"},{name:"Cancelled",value:r(n.cancelled),color:"#EF4444"}],o=r(n.total_complaints);return g.jsx(Ie,{className:"h-[267px]",title:"Ticket Status",period:"Today",icon:g.jsx(Mv,{className:"!text-[24px] text-[#EF4444]"}),children:g.jsxs("div",{className:"flex h-full items-center gap-[16px]",children:[g.jsxs("div",{className:"w-[202px] h-[170px] relative",children:[g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Ni,{children:[g.jsx(Jr,{data:i,innerRadius:55,outerRadius:85,dataKey:"value",stroke:"#FFFFFF",strokeWidth:2,children:i.map((a,s)=>g.jsx(pn,{fill:a.color},s))}),g.jsx(kt,{content:g.jsx(gfe,{}),wrapperStyle:{zIndex:1e3}})]})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsxs("div",{className:"flex items-baseline text-[18px] leading-[22px] font-medium text-[#121212]",children:[g.jsx("div",{children:r(n.completed)}),g.jsxs("div",{className:"text-[18.18px] leading-[22.22px] text-[#121212]",children:["/",o]})]}),g.jsx("div",{className:"text-[10.1px] leading-[14.14px] text-[#64748B]",children:"Completed"})]})]}),g.jsx("div",{className:"flex-1 space-y-2",children:i.map(a=>g.jsxs("div",{className:"flex items-center justify-between text-[12px] leading-[17px] mt-[12px]",children:[g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("div",{className:"h-[7px] w-[16px]",style:{backgroundColor:a.color}}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]}),g.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px] font-medium",children:a.value})]},a.name))})]})})}const gk={visitorSummary:{totalVisitorsToday:150,peakTime:"2:00 - 4:00PM",peakCount:50,activeWalkins:18,preApprovedCheckins:3},popupData:{walkins:{currently_inside:18,total_visited_today:58},preApproved:{completed_visits:3,total_expected_today:5}},chart_data:[{hour:10,walkins:22,preApproved:30},{hour:12,walkins:15,preApproved:28},{hour:14,walkins:30,preApproved:38},{hour:16,walkins:45,preApproved:50},{hour:18,walkins:25,preApproved:40}]};function yfe(e){const t=e>=12?"PM":"AM";let n=e%12;return n===0&&(n=12),`${n} ${t}`}function bfe(e){if(typeof e=="number"&&e>=0&&e<=23)return e;if(typeof e=="string"){const t=e.trim().toUpperCase(),n=t.match(/^(\d{1,2})(?::\d{2})?\s*(AM|PM)$/);if(n){let i=Number(n[1])%12;return n[2]==="PM"&&(i+=12),i}const r=Number(t);if(!Number.isNaN(r)&&r>=0&&r<=23)return r}return null}function xfe(e=[]){return Array.from({length:24},(t,n)=>{const r=e.find(i=>bfe(i?.hour)===n)||{};return{hour:n,time:yfe(n),walkins:Number(r?.walkins??0),approved:Number(r?.pre_approved??r?.preApproved??r?.approved??0)}})}function vk({title:e,color:t,rows:n=[],children:r}){const i=g.jsxs("div",{className:"bg-white rounded-[12px] min-w-[260px] p-[16px] border-[0.5px] border-[#EBEBEB] shadow-[0px_0px_12px_0px_#EAF2FF]",children:[g.jsx("div",{className:"flex items-center gap-[8px] font-medium text-[#121212]",children:g.jsx("div",{children:e??""})}),g.jsx("div",{className:"mt-[16px] pt-[16px] border-t border-dashed border-[#EBEBEB] space-y-[16px]",children:n?.map(({label:o,value:a,valueColor:s})=>g.jsxs("div",{className:"flex justify-between text-[14px] leading-[18px]",children:[g.jsx("div",{className:"text-[#64748B]",children:o??""}),g.jsx("div",{className:"font-semibold",style:{color:s||"#121212"},children:a??0})]},o))})]});return g.jsx(Yj,{placement:"right-start",interactive:!0,delay:[100,0],offset:[6,0],appendTo:()=>document.body,maxWidth:"none",render:o=>g.jsx("div",{tabIndex:"-1",...o,children:i}),children:r})}function wfe({active:e,payload:t}){return!e||!t?.length?null:g.jsx("div",{className:"rounded-[8px] bg-[#121212] px-[12px] py-[8px] text-[12px] text-white shadow-lg",children:t.map(n=>g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:n.stroke}}),g.jsx("span",{className:"min-w-[82px] text-[#D1D3D4]",children:n.name}),g.jsx("span",{className:"font-semibold",children:n.value})]},n.dataKey))})}function _fe({data:e}){const t=e&&Object.keys(e).length?e:gk,n=t?.visitor_summary?{totalVisitorsToday:t?.visitor_summary?.total_visitors_today??0,peakTime:t?.visitor_summary?.peak_time??"-"}:t?.visitorSummary??{},r=t?.walkins_popup_data?{walkins:{currently_inside:Number(t?.walkins_popup_data?.walkins_inside??0),total_visited_today:Number(t?.walkins_popup_data?.total_walkins??0)},preApproved:{completed_visits:Number(t?.pre_approved_popup_data?.pre_approved_check_ins??0),total_expected_today:Number(t?.pre_approved_popup_data?.total_pre_approved_check_ins??0)}}:t?.popupData??{},i=k.useMemo(()=>{const l=t?.chart_data??[];return xfe(l.length?l:gk.chart_data)},[t]),{yAxisTicks:o,yAxisMax:a}=k.useMemo(()=>{const l=Math.max(...i.map(u=>Math.max(u.walkins,u.approved))),c=l>0?l:5;return{yAxisTicks:[0,Math.ceil(c/2),c],yAxisMax:c}},[i]),s=new Date().toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit",hour12:!0});return g.jsx(Ie,{className:"h-[377px]",title:"Visitor Updates",period:`Today at ${s}`,icon:g.jsx(bb,{className:"!text-[24px] text-[#8B5CF6]"}),children:g.jsxs("div",{className:"flex flex-col gap-[24px]",children:[g.jsxs("div",{className:"grid grid-cols-2 gap-y-4 gap-x-6",children:[g.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Total Visitors"}),g.jsx("div",{className:"text-[20px] font-medium text-[#08B6D4]",children:n?.totalVisitorsToday??0})]}),g.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Peak Time"}),g.jsx("div",{className:"text-[20px] font-medium text-[#8B5CF6]",children:n?.peakTime??"-"})]}),g.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Active Walk-ins"}),g.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[g.jsx("div",{className:"text-[28px] text-[#1FA05B] leading-[32px]",children:r?.walkins?.currently_inside??0}),g.jsx(vk,{title:"Active Walk-ins",color:"text-[#1FA05B]",rows:[{label:"Currently Inside",value:r?.walkins?.currently_inside??0,valueColor:"#1FA05B"},{label:"Total Visited Today",value:r?.walkins?.total_visited_today??0}],children:g.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.walkins?.total_visited_today??0]})})]})]}),g.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Pre-approved Check-ins"}),g.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[g.jsx("div",{className:"text-[28px] text-[#E7A015] leading-[32px]",children:r?.preApproved?.completed_visits??0}),g.jsx(vk,{title:"Pre-approved Check-ins",color:"text-[#E7A015]",rows:[{label:"Completed Visits",value:r?.preApproved?.completed_visits??0,valueColor:"#E7A015"},{label:"Total Expected Check-ins Today",value:r?.preApproved?.total_expected_today??0}],children:g.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.preApproved?.total_expected_today??0]})})]})]})]}),g.jsx("div",{className:"w-full h-[149px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(_x,{data:i??[],margin:{top:5,right:0,left:0,bottom:-10},children:[g.jsx(or,{stroke:"#E5E7EB",strokeDasharray:"4 4",vertical:!1}),g.jsx(Bn,{dataKey:"time",tickFormatter:(l,c)=>c%4===0?l:"",axisLine:!1,tickLine:!1,tick:{fill:"#121212",fontSize:10,fontWeight:400}}),g.jsx(An,{width:24,axisLine:!1,tickLine:!1,allowDecimals:!1,ticks:o,domain:[0,a],tick:{fill:"#64748B",fontSize:10,fontWeight:400}}),g.jsx(kt,{content:g.jsx(wfe,{})}),g.jsx(Vo,{type:"monotone",dataKey:"walkins",stroke:"#22C55E",strokeWidth:2,dot:!1,name:"Walk-ins",isAnimationActive:!1}),g.jsx(Vo,{type:"monotone",dataKey:"approved",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved",isAnimationActive:!1})]})})})]})})}const Sfe=({color:e})=>g.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:e,marginRight:"6px"}}),Efe=({active:e,payload:t})=>!e||!t||!t.length?null:g.jsx("div",{className:"bg-black text-white !text-[12px] px-[12px] py-[8px] rounded-[8px] shadow-lg",children:t.map((n,r)=>g.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[g.jsx(Sfe,{color:n.color}),n.name,": ",g.jsx("div",{className:"font-semibold",children:n.value})]},r))});function Ofe({data:e=null}){const n=e||{card_entry:60,mobile_entry:35,card_exit:15,mobile_exit:10,total:20.3},r=a=>{const s=Number(a);return isNaN(s)?0:s},i=[{name:"Card Entry",value:r(n.card_entry),color:"#329DFF"},{name:"Mobile Entry",value:r(n.mobile_entry),color:"#8B5CF6"},{name:"Card Exit",value:r(n.card_exit),color:"#B1D2F0"},{name:"Mobile Exit",value:r(n.mobile_exit),color:"#DACBFB"}],o=r(n.total);return g.jsx(Ct,{className:"h-[362px]",title:"Access Overview",titleWeight:"semi-bold",children:g.jsxs("div",{className:"flex flex-col items-center mt-[16px]",children:[g.jsxs("div",{className:"relative w-[200px] h-[200px]",children:[g.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:g.jsx("div",{className:"w-[130px] h-[130px] rounded-full shadow-[0px_12px_35px_rgba(0,0,0,0.12)]"})}),g.jsx("div",{className:"h-[184px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Ni,{children:[g.jsx(Jr,{data:i,dataKey:"value",innerRadius:65,outerRadius:90,startAngle:110,endAngle:-250,paddingAngle:2,stroke:"transparent",children:i.map((a,s)=>g.jsx(pn,{fill:a.color},s))}),g.jsx(kt,{content:g.jsx(Efe,{}),wrapperStyle:{zIndex:9999}})]})})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsxs("div",{className:"text-[20px] leading-[24px] font-semibold text-[#121212]",children:[o,"L"]}),g.jsx("div",{className:"text-[10px] leading-[15px] text-[#64748B]",children:"Total Access"})]})]}),g.jsx("div",{className:"mt-[32px] grid grid-cols-2 gap-x-[20px] gap-y-[12px] text-[12px] text-[#94A3B8]",children:i.map(a=>g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("div",{className:"w-[16px] h-[7px] ",style:{backgroundColor:a.color}}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]},a.name))})]})})}function WR({title:e="Access",data:t=[],height:n="h-[362px]"}){const r=i=>i==null?"0":Number(i).toLocaleString();return g.jsx(Ct,{className:n,title:e,titleWeight:"semi-bold",children:g.jsxs("div",{className:"rounded-[12px] overflow-hidden mt-[16px]",children:[g.jsxs("div",{className:"grid grid-cols-2 bg-[#F8FAFC] py-[8px] px-[12px] text-[12px] leading-[16px] font-medium text-[#64748B]",children:[g.jsx("div",{children:"Point"}),g.jsx("div",{className:"text-right",children:"Access"})]}),t.map((i,o)=>g.jsxs("div",{className:"grid grid-cols-2 p-[12px] text-[14px] border-t border-[#E2E8F0]",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:i.label}),g.jsx("div",{className:"text-[12px] leading-[16px] text-right font-medium",style:{color:i.color||"#000"},children:r(i.value)})]},o))]})})}function Cfe({data:e=[]}){const t=[{name:"Google",value:82e3},{name:"Uber",value:67e3},{name:"ANAROCK",value:6e4},{name:"Flipkart",value:48e3},{name:"HP",value:41e3},{name:"Myntra",value:3e4},{name:"Cloudscape",value:2e4},{name:"Infosys",value:9e3}],n=e.length?e:t,r=o=>o>=1e3?`${o/1e3}K`:o,i=Math.max(...n.map(o=>o.value));return g.jsx(Ct,{title:"Access Points Usage",titleWeight:"semi-bold",className:"h-[362px]",children:g.jsx("div",{className:"mt-[24px] h-[270px] w-full",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Eo,{data:n,barSize:60,margin:{top:0,right:0,left:-20,bottom:0},children:[g.jsx(or,{strokeDasharray:"8 8",vertical:!1}),g.jsx(fx,{y:0,stroke:"#EBEBEB",strokeDasharray:"0"}),g.jsx(Bn,{dataKey:"name",tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),g.jsx(An,{tickFormatter:r,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),g.jsx(kt,{cursor:!1}),g.jsx(Kt,{dataKey:"value",barSize:60,children:n.map((o,a)=>g.jsx(pn,{fill:o.value===i?"#3C81F6":"#79ABFF"},`cell-${a}`))})]})})})})}const kfe=({x:e,y:t,payload:n})=>{const r=n.value.split(" ");return g.jsx("g",{transform:`translate(${e},${t})`,children:g.jsx("text",{x:-85,y:0,textAnchor:"start",fill:"#121212",fontSize:14,children:r.map((i,o)=>g.jsx("tspan",{x:-85,dy:o===0?0:16,children:i},o))})})};function Pfe({data:e=[]}){const t=e&&e.length>0,n=e.map(r=>({name:r.category_name,value:r.total_complaints,color:"#08B6D4"}));return g.jsx(Ct,{title:"Tickets per Category",className:"h-[362px]",titleWeight:"semi-bold",childrenClassName:"h-full mt-[24px]!",children:t?g.jsx("div",{className:"w-full h-[262px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Eo,{data:n,layout:"vertical",margin:{top:0,right:8,left:-20,bottom:0},children:[g.jsx(or,{strokeDasharray:"3 3",horizontal:!1,stroke:"#E5E7EB"}),g.jsx(Bn,{type:"number",tick:{fill:"#94A3B8",fontSize:12},axisLine:!0,tickLine:!1,tickMargin:10,allowDecimals:!1}),g.jsx(An,{type:"category",dataKey:"name",axisLine:!1,tickLine:!1,width:132,tick:g.jsx(kfe,{})}),g.jsx(kt,{content:g.jsx(ss,{}),cursor:{fill:"transparent"},position:{x:300,y:0}}),g.jsx(Kt,{dataKey:"value",barSize:36,fill:"#08B6D4"})]})})}):g.jsx(ar,{title:"No Tickets Found",description:"Catch up all the data. Change the date range to see the data."})})}function Dfe({icon:e,iconColor:t="#329DFF",title:n,value:r,percentage:i,percentageText:o}){const a=parseFloat(i),s=a>=0,l=s?"#16A34A":"#DC2626";return g.jsxs("div",{className:"relative bg-white !border-[0.5px] !border-[#EBEBEB] !rounded-[12px] !shadow-[0_0_12px_0_#EAF2FF] p-[16px]",children:[g.jsxs("div",{className:"flex items-center gap-[8px]",children:[e&&g.jsx("div",{className:"h-[20px] w-[20px]",style:{color:t,display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsx(e,{className:"h-[20px] w-[20px]"})}),g.jsx("div",{className:"text-[16px] leading-[20px] font-medium text-[#64748B]",children:n})]}),g.jsx("div",{className:"mt-[16px] text-[28px] leading-[32px] font-medium text-[#121212]",children:r}),(i||o)&&g.jsxs("div",{className:"mt-[12px] flex items-center gap-[8px]",children:[i&&g.jsxs("div",{className:"flex items-center gap-[4px] text-[12px] leading-[16px] font-medium",style:{color:l},children:[s?g.jsx(qa,{}):g.jsx(Ka,{}),Math.abs(a),"%"]}),o&&g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:o})]})]})}const Afe=({data:e=[],onDateChange:t})=>{const[n,r]=k.useState(new Date),[i,o]=k.useState(!1),s=(v=>{const b=new Date(v);return b.setDate(b.getDate()-6),b})(n),l=v=>{try{return v.toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}catch{return""}},c=v=>{const b=new Date(v),S=new Date(b);S.setDate(S.getDate()-6),t&&t(S.toISOString(),b.toISOString())},u=()=>{const v=new Date(n);v.setDate(v.getDate()-7),r(v),c(v)},d=()=>{const v=new Date(n);v.setDate(v.getDate()+7),r(v),c(v)},f=()=>{o(v=>!v)},p=v=>{const b=v||new Date;r(b),c(b),o(!1)},h=Array.isArray(e)?e:[],m=!h.length||h.every(v=>v.no_of_visitors===0);return g.jsxs(Ct,{title:"Weekly Visitor Pattern",period:`${l(s)} - ${l(n)}`,isDateSelector:!0,titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",onPrevClick:u,onNextClick:d,onCalendarClick:f,children:[i&&g.jsx("div",{className:"anarock-datepicker absolute top-[70px] right-[24px] z-50",children:g.jsx(VP,{selected:n,onChange:p,inline:!0,maxDate:new Date,showYearDropdown:!0,scrollableYearDropdown:!0,yearDropdownItemNumber:40})}),m?g.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:g.jsx(ar,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):g.jsx("div",{className:"w-full h-[280px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(VN,{data:h,margin:{top:10,right:-10,left:-10,bottom:0},children:[g.jsx("defs",{children:g.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[g.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),g.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),g.jsx(or,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),g.jsx(Bn,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:v=>new Date(v).toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}),g.jsx(An,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),g.jsx(kt,{cursor:!1,content:({active:v,payload:b,label:S,coordinate:w})=>{if(!v||!b?.length)return null;const x=new Date(S).toLocaleDateString("en-GB",{day:"2-digit",month:"short"}),O=b[0]?.payload===h[h.length-1]?w.x-70:w.x;return g.jsx("div",{style:{position:"absolute",transform:`translate(${O}px, ${w.y-40}px)`,pointerEvents:"none",zIndex:99999},children:g.jsx(ls,{active:v,payload:b,label:x})})}}),g.jsx(vx,{type:"monotone",dataKey:"no_of_visitors",stroke:"#6366F1",strokeWidth:2,fill:"url(#colorVisitors)",dot:{r:5,stroke:"#6366F1",strokeWidth:2,fill:"#fff"},activeDot:v=>{const{cx:b,cy:S,stroke:w}=v;return g.jsxs("g",{children:[g.jsx("circle",{cx:b,cy:S,r:6,fill:"#fff",stroke:"#6466F1",strokeWidth:2}),g.jsx("circle",{cx:b,cy:S,r:2.5,fill:"#6466F1"})]})}})]})})})]})},Tfe=[{building_name:"Google",no_of_visitors:1e3},{building_name:"Uber",no_of_visitors:3500},{building_name:"ANAROCK",no_of_visitors:2e3},{building_name:"Flipkart",no_of_visitors:8e3},{building_name:"HP",no_of_visitors:1650}],Mfe=({data:e})=>{const t=Array.isArray(e)&&e?.length===0,n=e==null?Tfe:Array.isArray(e)?e:[];return g.jsx(Ct,{title:"Organisation Wise Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",children:g.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:t?g.jsx(ar,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."}):g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Eo,{data:n||[],margin:{top:10,right:10,left:10,bottom:-10},barCategoryGap:35,children:[g.jsx(or,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),g.jsx(Bn,{dataKey:"building_name",tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1}),g.jsx(An,{width:40,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1}),g.jsx(kt,{cursor:!1,content:g.jsx(ls,{})}),g.jsx(Kt,{dataKey:"no_of_visitors",name:"Visitors",maxBarSize:55,fill:"#3C81F6"})]})})})})};function Nfe({data:e}){return g.jsx("div",{className:"h-full",children:e.map((t,n)=>{const r=parseFloat(t.delta),i=r>=0;return g.jsx(Ie,{iconClassName:"!gap-[8px]",title:g.jsx("div",{className:"text-[#64748B]",children:t.title}),icon:g.jsx(t.Icon,{className:"h-[20px] w-[20px]",style:{color:t.iconColor||"#000000"}}),className:`${t?.widget==="amenities"?"h-[139px]":"h-[124px]"}`,children:g.jsxs("div",{className:`flex flex-col gap-[8px] ${t?.widget==="amenities"?"mt-[3.5px]":"mt-0"}`,children:[g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t.value}),g.jsxs("div",{className:`flex items-center pt-[8px] text-[12px] leading-[16px] ${t.delta?"gap-[8px]":""}`,children:[t.delta&&g.jsxs("div",{className:`flex items-center gap-[4px] px-[6px] py-[2px] rounded-[4px] font-medium
|
|
372
|
+
*/const hde=[["path",{d:"M19 5a2 2 0 0 0-2 2v11",key:"s41o68"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}],["path",{d:"M7 13h10",key:"1rwob1"}],["path",{d:"M7 9h10",key:"12czzb"}],["path",{d:"M9 5a2 2 0 0 0-2 2v11",key:"x0q4gh"}]],mde=Ri("waves-ladder",hde),Ct=({title:e,icon:t,period:n,isDateSelector:r=!1,children:i,footer:o,className:a="",titleWeight:s,titleColor:l,iconClassName:c,titleClassName:u,childrenClassName:d,rightContent:f,onCalendarClick:p,onPrevClick:h,onNextClick:m})=>{const v=s==="semi-bold"?600:500;return g.jsxs("div",{className:`relative bg-white p-[24px] !border-[0.5px] !border-[#EBEBEB] !rounded-[12px] !shadow-[0_0_12px_0_#EAF2FF] ${a}`,children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{className:"flex items-center gap-[8px]",children:[t&&g.jsx("div",{className:c,children:t}),g.jsx("div",{style:{fontWeight:v,color:l||"#121212"},className:u||"text-[20px] leading-[24px]",children:e})]}),g.jsxs("div",{className:"flex items-center gap-[12px]",children:[f&&f,n&&!r&&g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:n}),r&&g.jsxs("div",{className:"flex items-center gap-[12px] px-[16px] py-[8px] rounded-[8px] bg-white text-sm text-[#64748B]",children:[g.jsx(tde,{size:16,className:"text-[#64748B] cursor-pointer",onClick:p}),g.jsx($R,{size:16,className:"cursor-pointer",onClick:h}),g.jsx("span",{className:"text-[12px] leading-[16px] text-[#64748B]",children:n}),g.jsx(BR,{size:16,className:"cursor-pointer",onClick:m})]})]})]}),g.jsx("div",{className:`flex-1 min-h-0 mt-4 ${d}`,children:i}),o&&g.jsx("div",{className:"mt-4 pt-4 border-t border-gray-100 text-[12px] text-[#64748B]",children:o})]})},gde={completed:18,not_completed:6,missed:4};function vde({data:e={}}){const t=e&&Object.keys(e).length>0?e:gde,n=[{name:"Completed",value:Number(t?.completed??0),color:"#12B981"},{name:"Delayed",value:Number(t?.not_completed??0),color:"#EF4444"},{name:"Missed",value:Number(t?.missed??0),color:"#F69E0A"}],r=Number(t?.completed??0)+Number(t?.not_completed??0)+Number(t?.missed??0),i=Number(t?.completed??0);return g.jsx(Ct,{title:"Guard Patrols",className:"h-[362px]",titleWeight:"semi-bold",children:g.jsxs("div",{className:"flex flex-col items-center justify-center",children:[g.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Ni,{children:[g.jsx(Jr,{data:n??[],innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:n?.map?.((o,a)=>g.jsx(pn,{fill:o?.color??"#ccc"},`cell-${a}`))}),g.jsx(kt,{content:g.jsx(FR,{})})]})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[i??0,"/",r??0]}),g.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),g.jsx("div",{className:"flex flex-col w-full text-[14px]",children:n?.length?n?.map?.((o,a)=>g.jsxs("div",{className:`flex items-center justify-between py-[10px] ${a!==(n?.length??0)-1?"border-b border-[#F1F5F9]":""}`,children:[g.jsxs("div",{className:"flex items-center gap-[10px]",children:[g.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:o?.color??"#ccc"}}),g.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:o?.name??"-"})]}),g.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:o?.value??0})]},o?.name??a)):g.jsx("div",{className:"text-center text-gray-400 text-sm py-[24px]",children:"No patrol data"})})]})})}Wn.register(Co,ko,a1,o1,Yr,ei);const yde=["10 AM","12 PM","2 PM","4 PM","6 PM","8 PM","10 PM"],zd={guest:[9,5,12,7,3,6,4],cab:[15,12,10,14,7,12,8],delivery:[22,18,16,20,22,14,17],service:[13,12,8,9,5,10,7]},bde=[{key:"Guest",datasetIndex:0,color:"#EF4444"},{key:"Cab",datasetIndex:1,color:"#7C3AED"},{key:"Delivery",datasetIndex:2,color:"#10B981"},{key:"Service",datasetIndex:3,color:"#F59E0B"}],xde=({color:e,size:t=12})=>g.jsx("svg",{width:t,height:t,viewBox:"0 0 12 12",style:{display:"block",flexShrink:0},children:g.jsx("rect",{x:"1",y:"1",width:"10",height:"10",rx:"0",fill:e,transform:"rotate(45 6 6)"})}),wde=({chartRef:e})=>{const[t,n]=k.useState({}),r=i=>{const o=e.current;if(!o)return;const a=o.getDatasetMeta(i),s=!!a.hidden;a.hidden=!s,o.update(),n(l=>({...l,[i]:!s}))};return g.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"76px",marginTop:"10px",paddingBottom:"8px",flexWrap:"wrap"},children:bde.map(({key:i,datasetIndex:o,color:a})=>{const s=!!t[o];return g.jsxs("div",{onClick:()=>r(o),style:{display:"flex",alignItems:"center",gap:"6px",cursor:"pointer",userSelect:"none",opacity:s?.45:1,transition:"opacity 0.2s ease"},children:[g.jsx(xde,{color:a,size:12}),g.jsx("span",{style:{fontSize:"13px",color:"#64748B",fontWeight:400,lineHeight:1,textDecoration:s?"line-through":"none",transition:"text-decoration 0.15s ease"},children:i})]},i)})})},_de=({data:e})=>{const t=k.useRef(null),r={labels:Array.isArray(e?.labels)&&e.labels.length>0?e.labels:yde,datasets:[{label:"Guest",data:Array.isArray(e?.guest)&&e.guest.length>0?e.guest:zd.guest,borderColor:"#EF4444",backgroundColor:"rgba(239,68,68,0.15)",pointBackgroundColor:"#EF4444",pointStyle:"rectRot",fill:!1},{label:"Cab",data:Array.isArray(e?.cab)&&e.cab.length>0?e.cab:zd.cab,borderColor:"#7C3AED",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#7C3AED",pointStyle:"rectRot",fill:!1},{label:"Delivery",data:Array.isArray(e?.delivery)&&e.delivery.length>0?e.delivery:zd.delivery,borderColor:"#10B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#10B981",pointStyle:"rectRot",fill:!1},{label:"Service",data:Array.isArray(e?.service)&&e.service.length>0?e.service:zd.service,borderColor:"#F59E0B",backgroundColor:"rgba(245,158,11,0.15)",pointBackgroundColor:"#F59E0B",pointStyle:"rectRot",fill:!1}]},i={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:o=>o[0].label,label:o=>`${o.dataset.label} ${o.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return g.jsxs(Ie,{title:"Hourly Traffic Flow",className:"w-full h-[362px]",children:[g.jsx("div",{style:{height:"calc(100% - 44px)",width:"100%"},children:g.jsx(l1,{ref:t,data:r,options:i})}),g.jsx(wde,{chartRef:t})]})},Sde={open:4,in_progress:7,closed:12},Ede=[{incident_code:"INC-401",severity_level:"L1",severity:"Danger"},{incident_code:"INC-402",severity_level:"L2",severity:"High"},{incident_code:"INC-403",severity_level:"L3",severity:"Low"}];function Ode({incidentReports:e={},incidentReportsDetails:t=[]}){const n=e&&Object.keys(e).length>0?e:Sde,r=Array.isArray(t)?t:Ede,i=Number(n?.open??0),o=Number(n?.in_progress??0),a=Number(n?.closed??0);return g.jsx(Ct,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:g.jsxs("div",{children:[g.jsxs("div",{className:"flex w-full text-center gap-[24px]",children:[g.jsxs("div",{className:"flex-1 py-[12px] bg-[#FBF4F4] h-[76px] rounded",children:[g.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#AB0000]",children:i??0}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),g.jsxs("div",{className:"flex-1 py-[12px] bg-[#FFFBF2] h-[76px] rounded",children:[g.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#E7A015]",children:o??0}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#E7A015]",children:"In-progress"})]}),g.jsxs("div",{className:"flex-1 py-[12px] bg-[#F7FEFA] h-[76px] rounded",children:[g.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:a??0}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),g.jsx("div",{className:"mt-4 space-y-2",children:r?.length?r?.map?.((s,l)=>{const c=s?.severity==="Danger"?"text-[#AB0000]":s?.severity==="High"?"text-[#E7A015]":"text-[#1FA05B]";return g.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#FAFBFD] rounded-md",children:[g.jsx("div",{className:"flex items-center gap-[8px]",children:g.jsx("div",{className:"text-gray-700 font-medium",children:s?.incident_code??"-"})}),g.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${c}`,children:g.jsxs("div",{children:[s?.severity_level??"-"," - ",s?.severity??"-"]})})]},l)}):g.jsx("div",{className:"text-center text-gray-400 text-sm py-[24px]",children:"No incidents found"})})]})})}const Cde=[{total_staff:42,absent_staff:6}],kde=[{staff_role_name:"Security Guard",total_staff:18,present_staff:16},{staff_role_name:"Supervisor",total_staff:8,present_staff:7},{staff_role_name:"Technician",total_staff:10,present_staff:9},{staff_role_name:"Technician",total_staff:10,present_staff:9}];function Pde({staffPresentAbsent:e,staffPresentByRole:t}){const n=Array.isArray(e)&&e.length>0?e:Cde,r=Array.isArray(t)&&t.length>0?t:kde,i=n?.[0]?.total_staff??0,o=n?.[0]?.absent_staff??0,a=(i??0)-(o??0);return g.jsx(Ct,{title:"Staff Attendance",className:"h-[362px] overflow-hidden ",titleWeight:"semi-bold",children:g.jsxs("div",{children:[g.jsxs("div",{className:"flex gap-[16px] text-center mt-[24px]",children:[g.jsxs("div",{className:"flex-1 py-[12px] bg-[#F7FEFA] rounded h-[76px]",children:[g.jsx("div",{className:"text-[24px] font-medium text-[#1FA05B]",children:a??0}),g.jsx("div",{className:"text-[12px] text-[#1FA05B]",children:"Present"})]}),g.jsxs("div",{className:"flex-1 py-[12px] bg-[#FBF4F4] rounded h-[76px]",children:[g.jsx("div",{className:"text-[24px] font-medium text-[#AB0000]",children:o??0}),g.jsx("div",{className:"text-[12px] text-[#AB0000]",children:"Absent"})]})]}),g.jsx("div",{className:"mt-[24px] pb-[16px] space-y-[8px] overflow-y-auto max-h-[200px] hide-scrollbar",children:r?.length?r?.map?.((s,l)=>{const c=Number(s?.total_staff??0),u=Number(s?.present_staff??0);return g.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#F8FAFC] rounded-md",children:[g.jsx("div",{className:"text-[#121212] text-[14px] leading-[18px] font-medium",children:s?.staff_role_name??"-"}),g.jsxs("div",{className:"text-[14px] leading-[20px] text-[#64748B]",children:[u??0,"/",c??0]})]},l)}):g.jsx(g.Fragment,{})})]})})}function Dde(e){return Ze({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M116,132V96a12,12,0,0,1,24,0v36a12,12,0,0,1-24,0Zm12,56a16,16,0,1,0-16-16A16,16,0,0,0,128,188ZM228,56v56c0,54.29-26.32,87.22-48.4,105.29-23.71,19.39-47.44,26-48.44,26.29a12.1,12.1,0,0,1-6.32,0c-1-.28-24.73-6.9-48.44-26.29C54.32,199.22,28,166.29,28,112V56A20,20,0,0,1,48,36H208A20,20,0,0,1,228,56Zm-24,4H52v52c0,35.71,13.09,64.69,38.91,86.15A126.14,126.14,0,0,0,128,219.38a126.28,126.28,0,0,0,37.09-21.23C190.91,176.69,204,147.71,204,112Z"},child:[]}]})(e)}function Ade({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=lu,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return g.jsxs(Ie,{title:e,icon:g.jsx("div",{className:"h-6 w-6 grid place-items-center",children:g.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[g.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),g.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[g.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),g.jsx("div",{className:"text-slate-500",children:r})]})]})}const Tde=[{title:"Total Visitors",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:wb,iconColor:"text-[#329DFF]"},{title:"Active Incidents",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:toe,iconColor:"text-[#F69E0A]"},{title:"Missed Patrols",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Dde,iconColor:"text-[#AB0000]"},{title:"Parking Usage",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:x3,iconColor:"text-[#36AB6C]"}];function Mde({data:e}){const t=Array.isArray(e)&&e.length>0?e:Tde;return g.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>g.jsx(Ade,{...n},r))})}const Nde=[{title:"Maintenance",total:12,pending:3},{title:"Security",total:8,pending:1},{title:"Housekeeping",total:6,pending:2},{title:"Utilities",total:10,pending:4}],jde=(e="")=>e.replace(/</g,"<").replace(/>/g,">").replace(/<[^>]*>/g,"").trim();function Rde({data:e}){const t=Array.isArray(e?.complaints_by_category)&&e.complaints_by_category.length>0?e.complaints_by_category.map(n=>({title:jde(n.category_name)||"—",total:n.total||0,pending:n.pending||0})):Nde;return g.jsx(Ie,{title:"Complaints",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:g.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>g.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-[8px] p-[12px] h-[62px]",children:[g.jsxs("div",{className:"flex flex-col",children:[g.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),g.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),g.jsxs("div",{className:"flex flex-col items-end",children:[g.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},r))})})}const Ide=e=>{const t={0:"𝟎",1:"𝟏",2:"𝟐",3:"𝟑",4:"𝟒",5:"𝟓",6:"𝟔",7:"𝟕",8:"𝟖",9:"𝟗"};return String(e).split("").map(n=>t[n]||n).join("")},Fde=[{level:"Level 1",open_count:3,in_progress_count:4,closed_count:5,total:12},{level:"Level 2",open_count:1,in_progress_count:1,closed_count:1,total:3},{level:"Level 3",open_count:5,in_progress_count:2,closed_count:3,total:10}],Lde=({active:e,payload:t,label:n})=>{if(!e||!t)return null;const r=[{key:"open_count",label:"Open",color:"#EF4444"},{key:"in_progress_count",label:"In Progress",color:"#F59D0D"},{key:"closed_count",label:"Closed",color:"#12B981"}];return g.jsxs("div",{style:{backgroundColor:"#0B0B0B",padding:"14px 40px 14px 18px",borderRadius:"10px",color:"#ffffff"},children:[g.jsx("div",{style:{color:"#ffffff",fontSize:"12px",fontWeight:"900",marginBottom:"10px"},children:n}),r.map((i,o)=>{const a=t[0]?.payload[i.key]||0,s=Ide(a);return g.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:o<r.length-1?"8px":"0",fontSize:"12px"},children:[g.jsx("div",{style:{width:"8px",height:"8px",backgroundColor:i.color,transform:"rotate(45deg)",marginRight:"8px"}}),g.jsx("span",{style:{color:"D1D3D4",minWidth:"100px"},children:i.label}),g.jsx("span",{style:{marginLeft:"auto",fontWeight:"700"},children:s})]},i.key)})]})},$de=()=>{const e=[{label:"Open",color:"#EF4444"},{label:"In Progress",color:"#F59D0D"},{label:"Closed",color:"#12B981"}];return g.jsx("div",{style:{display:"flex",justifyContent:"space-between",gap:"15px"},children:e.map(t=>g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[g.jsx("div",{style:{width:"6px",height:"6px",backgroundColor:t.color,transform:"rotate(45deg)"}}),g.jsx("span",{style:{fontSize:"14px"},children:t.label})]},t.label))})},Bde=({data:e})=>{const t=k.useMemo(()=>(Array.isArray(e?.complaints_by_level)&&e.complaints_by_level.some(l=>Number(l.total)>0)?e.complaints_by_level:Fde).map(l=>({level:l.level||"—",open_count:Number(l.open_count)||0,in_progress_count:Number(l.in_progress_count)||0,closed_count:Number(l.closed_count)||0,total:Number(l.total)||0})),[e]),n=k.useMemo(()=>Math.max(...t.map(a=>a.total),5),[t]),r=Math.ceil(n*1.2),i=6,o=Math.max(Math.ceil(n/i),1);return g.jsxs(Ie,{title:"Complaints by Level",className:"w-full h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:[g.jsx(_t,{width:"100%",height:"85%",children:g.jsxs(Eo,{data:t,margin:{top:5,right:-25,left:-30,bottom:5},children:[g.jsx(or,{strokeDasharray:"0",vertical:!1}),g.jsx(Bn,{dataKey:"level"}),g.jsx(An,{domain:[0,r],ticks:Array.from({length:i+1},(a,s)=>s*o)}),g.jsx(kt,{content:g.jsx(Lde,{}),cursor:!1}),g.jsx(Kt,{dataKey:"open_count",stackId:"a",fill:"#EF4444",barSize:44,radius:[0,0,0,0]}),g.jsx(Kt,{dataKey:"in_progress_count",stackId:"a",fill:"#F59D0D",barSize:44,radius:[0,0,0,0]}),g.jsx(Kt,{dataKey:"closed_count",stackId:"a",fill:"#12B981",barSize:44,radius:[0,0,0,0]})]})}),g.jsx($de,{})]})},Wde=[{title:"Maintenance",total:18,pending:4},{title:"Security",total:11,pending:2},{title:"Housekeeping",total:9,pending:3},{title:"Utilities",total:14,pending:5}];function zde({data:e}){const t=Array.isArray(e?.request_box_by_type)&&e.request_box_by_type.length>0?e.request_box_by_type.map(n=>({title:n.category_name||"—",total:Number(n.total)||0,pending:Number(n.pending)||0})):Wde;return g.jsx(Ie,{title:"Request Box",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:g.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>g.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-[8px] p-[12px] h-[62px]",children:[g.jsxs("div",{className:"flex flex-col",children:[g.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),g.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),g.jsxs("div",{className:"flex flex-col items-end",children:[g.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},`${n.title}-${r}`))})})}function Vde(e){return Ze({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinejoin:"round",strokeWidth:"32",d:"M416 221.25V416a48 48 0 0 1-48 48H144a48 48 0 0 1-48-48V96a48 48 0 0 1 48-48h98.75a32 32 0 0 1 22.62 9.37l141.26 141.26a32 32 0 0 1 9.37 22.62z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M256 56v120a32 32 0 0 0 32 32h120m-232 80h160m-160 80h160"},child:[]}]})(e)}const Hde=["open_complaints","pending_requests","avg_response_time","resolution_rate"],Yde={open_complaints:{title:"Open Complaints",Icon:qP,iconColor:"#AB0000",deltaLabel:"Compared to last month"},pending_requests:{title:"Pending Requests",Icon:Vde,iconColor:"#E7A015",deltaLabel:"Compared to last month"},avg_response_time:{title:"Avg Response Time",Icon:D3,iconColor:"#1FA05B",deltaLabel:"Compared to last month"},resolution_rate:{title:"Resolution Rate",Icon:O3,iconColor:"#329DFF",deltaLabel:"Compared to last month"}},Ude=({children:e,size:t=28,lineHeight:n=32,weight:r=500,color:i="#121212"})=>g.jsx("div",{style:{fontWeight:r,fontSize:`${t}px`,lineHeight:`${n}px`,color:i},children:e}),Kde={primary:{size:28,lineHeight:32,weight:500}},qde={open_complaints:{current:24,trend_percent:"-8%",direction:"bad"},pending_requests:{current:17,trend_percent:"-5%",direction:"bad"},avg_response_time:{current:"2.4 h",trend_percent:"+6%",direction:"good"},resolution_rate:{current:"89%",trend_percent:"+4%",direction:"good"}};function Gde({id:e,data:t}){return e&&t&&!t[e]&&t.current!==void 0?g.jsx(fk,{id:e,data:t}):g.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[16px]",children:Hde.map(n=>g.jsx(fk,{id:n},n))})}function fk({id:e,data:t}){const n=Yde[e];if(!n)return null;const r=(d,f)=>f==null?"—":d==="avg_response_time"?typeof f=="number"?`${f} h`:f:d==="resolution_rate"&&typeof f=="number"?`${f}%`:f,{title:i,Icon:o=lu,iconColor:a,deltaLabel:s}=n,l=t&&Object.keys(t).length>0?t:qde[e],c=r(e,l?.current),u=l?.trend_percent??"—";return l?.direction==="good"||l?.direction,g.jsx("div",{className:"h-[132px]",children:g.jsxs(Ie,{title:i,titleColor:a,icon:g.jsx("div",{className:"h-[20px] w-[20px] flex items-center justify-center",children:g.jsx(o,{className:"h-[20px] w-[20px]",style:{color:a}})}),childrenClassName:"!space-y-[12px]",iconClassName:"!gap-[12px]",children:[g.jsx(Ude,{...Kde.primary,children:c}),g.jsxs("div",{className:"flex items-center gap-[8px] text-[12px] leading-[16px]",children:[g.jsx(eh,{value:u}),g.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:s})]})]})})}const Xde=[{title:"Holi Celebration",date:"25 Jun 2025",rsvp:"78/100",utilisation:71,status:"Upcoming"},{title:"Maintenance Meeting",date:"25 Jun 2025",rsvp:"45/60",utilisation:75,status:"Completed"}];function Qde({title:e,date:t,rsvp:n,utilisation:r,status:i}){return g.jsxs("div",{className:" bg-[#F8FAFC] h-[106px] px-[12px] mt-3",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx("div",{className:"text-[16px] leading-[20px] font-semibold text-[#121212]",children:e}),g.jsx("div",{className:`!text-[12px] font-medium leading-[16px] px-[8px] py-[4px] ${i==="Completed"?"text-[#36AB6C] bg-[#E6F7EE]":i==="Upcoming"?"text-[#329DFF] bg-[#E6F2FF]":"text-slate-500 bg-slate-100"}`,children:i})]}),g.jsx("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:t}),g.jsxs("div",{className:"flex justify-between items-center mt-2",children:[g.jsxs("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:[n," RSVP"]}),g.jsxs("div",{className:"text-[#3C82F6] text-[14px] leading-[18px] font-medium",children:[r,"% utilisation"]})]}),g.jsx("div",{className:"w-full bg-[#F8FAFC] h-[6px] rounded mt-2 mb-3",children:g.jsx("div",{className:"h-[6px] rounded bg-[#3C82F6]",style:{width:`${r}%`}})})]})}function Zde({data:e}){const t=Array.isArray(e)?e:Xde;return g.jsx(Ie,{title:"Events Utilisation",className:"w-full h-[360px] overflow-y-auto hide-scrollbar",children:g.jsx("div",{className:"m-auto",children:t?.length>0?t.map((n,r)=>g.jsx(Qde,{...n},`${n.title}-${r}`)):g.jsx("div",{className:"h-full flex items-center justify-center",children:g.jsx(ar,{})})})})}const Jde=[{label:"Active",value:138,subLabel:"3 expiring soon",bgColor:"bg-[#F0FFF7]",textColor:"text-[#1FA05B]"},{label:"Scheduled",value:13,subLabel:"4 this week",bgColor:"bg-[#FFFBF2]",textColor:"text-[#E7A015]"},{label:"Recurring",value:3,subLabel:"All active",bgColor:"bg-[#EDF6FF]",textColor:"text-[#329DFF]"},{label:"Expired",value:7,subLabel:"4 recent",bgColor:"bg-[#F6F6F6]",textColor:"text-[#64748B]"}];function efe({label:e,value:t,subLabel:n,bgColor:r,textColor:i}){return g.jsxs("div",{className:`rounded-[8px] p-[16px] ${r} h-[124px]`,children:[g.jsx("div",{className:`text-[16px] font-medium ${i} leading-[20px]`,children:e}),g.jsx("div",{className:"mt-4 text-[28px] leading-[32px] font-semibold text-[#121212]",children:t}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-2",children:n})]})}function tfe({data:e}){const t=Array.isArray(e)&&e.length>0?e:Jde;return g.jsx(Ie,{title:"Notice Board Status",className:"w-full h-[360px]",children:g.jsx("div",{className:"grid grid-cols-2 gap-[16px]",children:t.map((n,r)=>g.jsx(efe,{...n},`${n.label}-${r}`))})})}function nfe(e){return Ze({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M20 22H4C3.44772 22 3 21.5523 3 21V3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22ZM19 20V4H5V20H19ZM8 9H16V11H8V9ZM8 13H16V15H8V13Z"},child:[]}]})(e)}function rfe({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=lu,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50",iconUrl:l}){return g.jsx(Ie,{title:e,icon:g.jsx("div",{className:"grid place-items-center ",children:l?g.jsx("img",{src:l,alt:"icon",className:"h-8 w-8 object-contain"}):g.jsx(o,{className:`h-8 w-8 ${a}`})}),className:"h-[132px]",children:g.jsxs("div",{children:[g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),g.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[g.jsx(eh,{value:n}),g.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}function ife({data:e}){const t=[{title:e?.title||"Total Bookings",value:e?.value??0,delta:e?.delta??"0%",deltaLabel:e?.deltaLabel||"Compared to last month",positive:e?.positive??!1,Icon:e?.Icon,iconUrl:e?.iconUrl,iconColor:e?.iconColor||"text-emerald-600",iconBg:e?.iconBg||"bg-emerald-50"}];return g.jsx("div",{className:"h-full",children:t.map((n,r)=>g.jsx(rfe,{...n},r))})}function ofe(e){return Ze({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"},child:[]}]})(e)}function afe({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=lu,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return g.jsx(Ie,{title:e,icon:g.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:g.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:g.jsxs("div",{children:[g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),g.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[g.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),g.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}const sfe=[{title:"Notice",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:nfe,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"},{title:"Post",value:83,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:w3,iconColor:"text-[#329DFF]",iconBg:"bg-emerald-50"},{title:"Poll",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Jie,iconColor:"text-[#FA7E28]",iconBg:"bg-orange-100"},{title:"Poll",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:ofe,iconColor:"text-[#DBB467]",iconBg:"bg-yellow-100"}];function lfe({data:e}){const t=Array.isArray(e)&&e.length>0?e:sfe;return g.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>g.jsx(afe,{...n},r))})}const pk=({value:e=0,total:t=1,colorClass:n="",label:r=""})=>{const i=Number(e)||0,o=Number(t)||1,a=Math.max(0,Math.min(100,i/o*100)),s=n==="bg-[#3C81F6]"?"text-[#8B5CF6]":n==="bg-[#8B5CF6]"?"text-[#12B981]":"text-slate-600";return g.jsxs("div",{className:"flex flex-col items-start",children:[g.jsx("div",{className:"w-2/3 min-w-[80px] h-5 rounded-full overflow-hidden",children:g.jsx("div",{className:`h-[11px] rounded-full ${n||""}`,style:{width:n==="bg-[#12B981]"?`${a+45}%`:`${a}%`}})}),g.jsx("div",{className:`${s} !text-[12px] font-bold mt-1`,children:i??0}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-1",children:r??""})]})},cfe=({data:e,occupiedUnits:t=1,EmployeesCount:n=8910,AdminsCount:r=910})=>{const i=e?.total_occupants!==void 0&&e?.total_occupants!==null?Number(e?.total_occupants)||0:Number(t)||0,o=e?.total_members!==void 0&&e?.total_members!==null?Number(e?.total_members)||0:Number(n)||0,a=e?.total_admins!==void 0&&e?.total_admins!==null?Number(e?.total_admins)||0:Number(r)||0,s=(o||0)+(a||0);return g.jsx("div",{children:g.jsxs("div",{className:"bg-white !border-[0.5px] !border-[#EBEBEB] rounded-[12px] shadow-[0_0_12px_0_#EAF2FF] p-[16px] h-[128px]",children:[g.jsxs("div",{className:"flex items-center gap-[12px] h-[20px]",style:{marginBottom:"24px"},children:[g.jsx(wb,{className:"!text-[20px] text-[#329DFF]"}),g.jsx("div",{className:"font-medium text-[#121212] text-[16px] leading-[20px]",children:"Occupancy Overview"})]}),g.jsxs("div",{className:"flex items-start justify-between",children:[g.jsxs("div",{className:"flex flex-col gap-[4px]",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] font-normal",children:"Total Occupants"}),g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:i??0})]}),g.jsxs("div",{className:"flex items-end gap-[4px]",children:[g.jsx(pk,{value:o??0,total:s||1,colorClass:"bg-[#3C81F6]",label:(o??0)<=1?"Employee":"Employees"}),g.jsx(pk,{value:a??0,total:s||1,colorClass:"bg-[#8B5CF6]",label:(a??0)<=1?"Admin":"Admins"})]})]})]})})};Wn.register(Co,ko,Tl,Yr);const ufe=()=>{const t={labels:["HP","Adobe","Anarock","Swiggy","Infosys","Zepto"],datasets:[{data:[2e3,1700,1500,1200,900,800],backgroundColor:["#3C81F6","#3C81F6","#3C81F6","#3C81F6","#3C81F6","#3C81F6"],barThickness:34}]},n={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff",displayColors:!1,callbacks:{label:r=>`Employees: ${r.parsed.y}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B",font:{size:12}}},y:{beginAtZero:!0,min:0,max:2e3,ticks:{stepSize:500,color:"#64748B",callback:r=>r},grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1}}}};return g.jsxs(Ie,{className:"w-full h-[238px]",title:"Employee Footfall (Static Data)",period:"Today",icon:g.jsx(Jue,{className:"!text-[24px] text-[#8B5CF6]"}),children:[g.jsxs("div",{className:"mb-[10px] mt-[8px] flex flex-col gap-[4px]!",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Employees Inside"}),g.jsx("div",{className:"text-[20px] leading-[24px] font-medium text-[#3C81F6]",children:"7,500"})]}),g.jsx("div",{className:"h-[110px]",children:g.jsx(Ml,{data:t,options:n})})]})},dfe="₹",hk=["bg-blue-500","bg-red-500","bg-purple-700"],ga={title:"Food & Beverages (Static Data)",period:"Today",summary:{totalOrders:247,revenueGenerated:"82K",growthPercentage:8,growthTotalPercentage:0},outlets:[{name:"HP",orders:120,revenue:"45K",percentage:70,color:"bg-[#3C81F6]"},{name:"Adobe",orders:85,revenue:"23K",percentage:50,color:"bg-[#3C81F6]"},{name:"Anarock",orders:42,revenue:"14K",percentage:25,color:"bg-[#3C81F6]"}]};function Op(e,t=null){if(typeof e=="number")return e;if(typeof e=="string"){const n=Number(e.replace("%","").trim());return Number.isNaN(n)?t:n}return t}function mk(e){if(e==null||e==="")return"0";if(typeof e=="number")return e_(e);const t=Number(e);return Number.isNaN(t)?String(e):e_(t)}function ffe(e){const t=e?.food_beverage_summary?{title:e?.title,period:e?.period,summary:{totalOrders:e?.food_beverage_summary?.total_orders,revenueGenerated:e?.food_beverage_summary?.revenue_generated,growthPercentage:e?.food_beverage_summary?.growth_percentage??e?.food_beverage_summary?.revenue_growth,growthTotalPercentage:e?.food_beverage_summary?.order_growth,currencyType:e?.food_beverage_summary?.currency_type},outlets:e?.chart_data}:e||{},n=t?.summary||{},i=(Array.isArray(t?.outlets)?t.outlets:[]).map((f,p)=>({name:f?.name||f?.outlet_name||f?.tenant_name||f?.company_name||"Unknown",orders:f?.orders??f?.total_orders??f?.count??0,revenue:f?.revenue??f?.revenue_generated??f?.total_revenue??0,percentage:f?.percentage,color:f?.color||hk[p%hk.length]})),o=n?.totalOrders??n?.orders??ga.summary.totalOrders,a=n?.revenueGenerated??n?.revenue??ga.summary.revenueGenerated,s=Op(n?.growthPercentage??n?.revenueGrowth,ga.summary.growthPercentage),l=Op(n?.growthTotalPercentage??n?.orderGrowth,ga.summary.growthTotalPercentage),c=n?.currencyType||n?.currency||dfe,u=i.reduce((f,p)=>f+(Number(p?.orders)||0),0),d=i.map(f=>({...f,percentage:f?.percentage!==null&&f?.percentage!==void 0?Number(f.percentage)||0:u>0?Math.round((Number(f?.orders)||0)/u*100):0}));return{title:t?.title||ga.title,period:t?.period||ga.period,summary:{totalOrders:o,revenueGenerated:a,growthPercentage:s,growthTotalPercentage:l,currencyType:c},outlets:d.length>0?d:ga.outlets}}function pfe({data:e,title:t,period:n,icon:r}){const i=ffe(e),o=t||i.title,a=n||i.period,s=r||g.jsx(pde,{className:"!text-[24px] text-[#FA7E28]"}),l=i.summary.totalOrders??0,c=mk(i.summary.revenueGenerated),u=Op(i.summary.growthPercentage,0),d=Op(i.summary.growthTotalPercentage,0),f=u>=0,p=d>=0;return g.jsx(Ie,{className:"h-[324px]",title:o,period:a,icon:s,children:g.jsxs("div",{className:"flex flex-col h-full",children:[g.jsxs("div",{className:"flex gap-[24px]",children:[g.jsxs("div",{className:"w-[65%] flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Orders"}),g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:l}),g.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${p?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[p?g.jsx(qa,{}):g.jsx(Ka,{}),d,"%",g.jsx("span",{children:"from last month"})]})]}),g.jsxs("div",{className:"w-[30%] flex flex-col gap-[8px] ",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] whitespace-nowrap",children:"Revenue Generated"}),g.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF] whitespace-nowrap",children:[i.summary.currencyType," ",c]}),g.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${f?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[f?g.jsx(qa,{}):g.jsx(Ka,{}),u,"%",g.jsx("span",{children:"from last month"})]})]})]}),g.jsx("div",{className:"mt-[16px]",children:i.outlets.map((h,m)=>g.jsxs("div",{className:m===i.outlets.length-1?"":"mb-[16px]",children:[g.jsxs("div",{className:"flex justify-between text-sm mb-[8px]",children:[g.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:h.name}),g.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[g.jsxs("div",{className:"text-[#64748B] inline-block",children:[h.orders," orders"]}),g.jsxs("div",{className:"mx-2 text-[#121212] inline-block",children:[i.summary.currencyType," ",mk(h.revenue)]})]})]}),g.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:g.jsx("div",{className:`h-[11px] rounded-full ${h.color}`,style:{width:`${h.percentage}%`}})})]},`${h.name}-${m}`))})]})})}function hfe({data:e}){const t=e?.amenity_summary?{amenitySummary:{totalBookings:e?.amenity_summary?.total_bookings??0,todayPaidRevenue:e?.amenity_summary?.today_paid_revenue??"0.00",growthPercentage:e?.amenity_summary?.growth_percentage??null,bookingGrowth:e?.amenity_summary?.booking_growth??null,currencyType:e?.amenity_summary?.currency_type??"₹"},chartData:Array.isArray(e?.chart_data)?e.chart_data.map(h=>({facility_name:h?.facility_name,total_bookings:h?.total_bookings??0,paid_revenue:h?.paid_revenue??"0",isPaid:h?.is_paid===!0})):[]}:e||{},n=t?.amenitySummary||{},i=(Array.isArray(t?.chartData)?t.chartData:[]).map(h=>({...h,isPaid:h?.isPaid===!0})),o=i.length>0&&i.every(h=>h?.isPaid===!1),a=n?.totalBookings||0,s=n?.bookingGrowth;let l=0;if(typeof s=="number")l=s;else if(typeof s=="string"){const h=s.replace("%","").trim(),m=Number(h);l=isNaN(m)?0:m}const c=i.reduce((h,m)=>{const v=m?.total_bookings||0;return h+v},0),u=i.map(h=>{const m=h?.total_bookings||0,v=h?.isPaid?`${n?.currencyType||"₹"} ${h?.paid_revenue||"0.00"}`:"",b=c>0?Math.round(m/c*100):0;return{name:h?.facility_name||"Unknown",bookings:m,revenue:v,percentage:b,color:"bg-[#3C81F6]",isPaid:h?.isPaid}}),d=n?.growthPercentage;let f=null;if(typeof d=="number")f=d;else if(typeof d=="string"){const h=d.replace("%","").trim(),m=Number(h);f=isNaN(m)?null:m}const p=f!==null?f>=0:!0;return g.jsx(Ie,{className:"h-[324px]",title:"Amenities",period:"Today",icon:g.jsx(mde,{className:"!text-[24px] text-[#8B5CF6]"}),children:g.jsxs("div",{className:"flex flex-col h-full",children:[g.jsxs("div",{className:"flex gap-[24px]",children:[g.jsxs("div",{className:"w-[65%] flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Bookings"}),g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:a}),g.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${l>=0?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[l>=0?g.jsx(qa,{}):g.jsx(Ka,{}),l,"%",g.jsx("span",{children:"from last month"})]})]}),!o&&g.jsxs("div",{className:"w-[25%] flex flex-col gap-[8px] ",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] whitespace-nowrap",children:"Revenue Generated"}),g.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF] whitespace-nowrap",children:[n?.currencyType||"₹"," ",n?.todayPaidRevenue??"0.00"]}),f!==null&&g.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${p?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[p?g.jsx(qa,{}):g.jsx(Ka,{}),f,"%",g.jsx("span",{children:"from last month"})]})]})]}),g.jsx("div",{className:"mt-[16px]",children:u.length>0?u.map((h,m)=>g.jsxs("div",{className:m===u.length-1?"":"mb-[16px]",children:[g.jsxs("div",{className:"flex justify-between text-sm mb-[8px]",children:[g.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:h?.name}),g.jsxs("div",{className:"font-medium text-[12px] leading-[16px]",children:[g.jsxs("div",{className:"text-[#64748B] inline",children:[h?.bookings," ",h?.bookings<=1?"booking":"bookings"]}),h?.isPaid&&g.jsx("div",{className:"mx-2 text-[#121212] inline",children:h?.revenue})]})]}),g.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:g.jsx("div",{className:`h-[11px] rounded-full ${h?.color}`,style:{width:`${h?.percentage}%`}})})]},m)):g.jsx("div",{className:"flex items-center justify-center h-[120px]",children:g.jsx("div",{className:"text-[12px] text-[#94A3B8]",children:"No amenity usage data available"})})})]})})}Wn.register(Co,ko,Tl,Yr,ei);function mfe({data:e=[]}){const t=[{level:"L1",open:55,in_progress:22,on_hold:15,closed:6},{level:"L2",open:45,in_progress:25,on_hold:18,closed:5},{level:"L3",open:58,in_progress:23,on_hold:14,closed:6}],n=e.length>0?e:t,r=[],i=[],o=[],a=[],s=[];for(let u=0;u<n.length;u++)r.push(n[u].level),i.push(Number(n[u].open)),o.push(Number(n[u].in_progress)),a.push(Number(n[u].on_hold)),s.push(Number(n[u].cancelled));const l={labels:r,datasets:[{label:"Open",data:i,backgroundColor:"#3B82F6",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"In Progress",data:o,backgroundColor:"#F59E0B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"On-Hold",data:a,backgroundColor:"#64748B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"Cancelled",data:s,backgroundColor:"#FB2C36",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"}]},c={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,pointStyle:"rectRot",padding:20,color:"#64748B"}},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff"}},scales:{x:{stacked:!0,grid:{display:!1},ticks:{color:"#64748B"}},y:{stacked:!0,beginAtZero:!0,grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1},ticks:{color:"#64748B",stepSize:1,precision:0,callback:u=>Math.round(u)}}}};return g.jsx(Ie,{className:"h-[267px]",title:"Ticket Escalation Levels",period:"Today",icon:g.jsx(C3,{className:"!text-[24px] text-[#3C81F6]"}),children:g.jsx("div",{className:"h-full",children:g.jsx(Ml,{data:l,options:c})})})}const gfe=({active:e,payload:t})=>{if(!e||!t||!t.length)return null;const n=t[0],r=n.payload.color;return g.jsx("div",{style:{backgroundColor:"#000000",color:"#ffffff",padding:"8px 10px",borderRadius:"8px",fontSize:"12px"},children:g.jsxs("div",{className:"flex items-center gap-[8px] font-medium",children:[g.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:r}}),g.jsx("div",{children:n.name}),g.jsx("div",{className:"ml-2",children:n.value})]})})};function vfe({data:e=null}){const n=e||{open:12,on_hold:5,cancelled:3,completed:156,in_progress:8,total_complaints:184},r=a=>{const s=Number(a);return isNaN(s)?0:s},i=[{name:"Completed",value:r(n.completed),color:"#10B981"},{name:"Open",value:r(n.open),color:"#3B82F6"},{name:"In Progress",value:r(n.in_progress),color:"#F59E0B"},{name:"On Hold",value:r(n.on_hold),color:"#6B7280"},{name:"Cancelled",value:r(n.cancelled),color:"#EF4444"}],o=r(n.total_complaints);return g.jsx(Ie,{className:"h-[267px]",title:"Ticket Status",period:"Today",icon:g.jsx(Mv,{className:"!text-[24px] text-[#EF4444]"}),children:g.jsxs("div",{className:"flex h-full items-center gap-[16px]",children:[g.jsxs("div",{className:"w-[202px] h-[170px] relative",children:[g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Ni,{children:[g.jsx(Jr,{data:i,innerRadius:55,outerRadius:85,dataKey:"value",stroke:"#FFFFFF",strokeWidth:2,children:i.map((a,s)=>g.jsx(pn,{fill:a.color},s))}),g.jsx(kt,{content:g.jsx(gfe,{}),wrapperStyle:{zIndex:1e3}})]})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsxs("div",{className:"flex items-baseline text-[18px] leading-[22px] font-medium text-[#121212]",children:[g.jsx("div",{children:r(n.completed)}),g.jsxs("div",{className:"text-[18.18px] leading-[22.22px] text-[#121212]",children:["/",o]})]}),g.jsx("div",{className:"text-[10.1px] leading-[14.14px] text-[#64748B]",children:"Completed"})]})]}),g.jsx("div",{className:"flex-1 space-y-2",children:i.map(a=>g.jsxs("div",{className:"flex items-center justify-between text-[12px] leading-[17px] mt-[12px]",children:[g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("div",{className:"h-[7px] w-[16px]",style:{backgroundColor:a.color}}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]}),g.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px] font-medium",children:a.value})]},a.name))})]})})}const gk={visitorSummary:{totalVisitorsToday:150,peakTime:"2:00 - 4:00PM",peakCount:50,activeWalkins:18,preApprovedCheckins:3},popupData:{walkins:{currently_inside:18,total_visited_today:58},preApproved:{completed_visits:3,total_expected_today:5}},chart_data:[{hour:10,walkins:22,preApproved:30},{hour:12,walkins:15,preApproved:28},{hour:14,walkins:30,preApproved:38},{hour:16,walkins:45,preApproved:50},{hour:18,walkins:25,preApproved:40}]};function yfe(e){const t=e>=12?"PM":"AM";let n=e%12;return n===0&&(n=12),`${n} ${t}`}function bfe(e){if(typeof e=="number"&&e>=0&&e<=23)return e;if(typeof e=="string"){const t=e.trim().toUpperCase(),n=t.match(/^(\d{1,2})(?::\d{2})?\s*(AM|PM)$/);if(n){let i=Number(n[1])%12;return n[2]==="PM"&&(i+=12),i}const r=Number(t);if(!Number.isNaN(r)&&r>=0&&r<=23)return r}return null}function xfe(e=[]){return Array.from({length:24},(t,n)=>{const r=e.find(i=>bfe(i?.hour)===n)||{};return{hour:n,time:yfe(n),walkins:Number(r?.walkins??0),approved:Number(r?.pre_approved??r?.preApproved??r?.approved??0)}})}function vk({title:e,color:t,rows:n=[],children:r}){const i=g.jsxs("div",{className:"bg-white rounded-[12px] min-w-[260px] p-[16px] border-[0.5px] border-[#EBEBEB] shadow-[0px_0px_12px_0px_#EAF2FF]",children:[g.jsx("div",{className:"flex items-center gap-[8px] font-medium text-[#121212]",children:g.jsx("div",{children:e??""})}),g.jsx("div",{className:"mt-[16px] pt-[16px] border-t border-dashed border-[#EBEBEB] space-y-[16px]",children:n?.map(({label:o,value:a,valueColor:s})=>g.jsxs("div",{className:"flex justify-between text-[14px] leading-[18px]",children:[g.jsx("div",{className:"text-[#64748B]",children:o??""}),g.jsx("div",{className:"font-semibold",style:{color:s||"#121212"},children:a??0})]},o))})]});return g.jsx(Yj,{placement:"right-start",interactive:!0,delay:[100,0],offset:[6,0],appendTo:()=>document.body,maxWidth:"none",render:o=>g.jsx("div",{tabIndex:"-1",...o,children:i}),children:r})}function wfe({active:e,payload:t}){return!e||!t?.length?null:g.jsx("div",{className:"rounded-[8px] bg-[#121212] px-[12px] py-[8px] text-[12px] text-white shadow-lg",children:t.map(n=>g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:n.stroke}}),g.jsx("span",{className:"min-w-[82px] text-[#D1D3D4]",children:n.name}),g.jsx("span",{className:"font-semibold",children:n.value})]},n.dataKey))})}function _fe({data:e}){const t=e&&Object.keys(e).length?e:gk,n=t?.visitor_summary?{totalVisitorsToday:t?.visitor_summary?.total_visitors_today??0,peakTime:t?.visitor_summary?.peak_time??"-"}:t?.visitorSummary??{},r=t?.walkins_popup_data?{walkins:{currently_inside:Number(t?.walkins_popup_data?.walkins_inside??0),total_visited_today:Number(t?.walkins_popup_data?.total_walkins??0)},preApproved:{completed_visits:Number(t?.pre_approved_popup_data?.pre_approved_check_ins??0),total_expected_today:Number(t?.pre_approved_popup_data?.total_pre_approved_check_ins??0)}}:t?.popupData??{},i=k.useMemo(()=>{const l=t?.chart_data??[];return xfe(l.length?l:gk.chart_data)},[t]),{yAxisTicks:o,yAxisMax:a}=k.useMemo(()=>{const l=Math.max(...i.map(u=>Math.max(u.walkins,u.approved))),c=l>0?l:5;return{yAxisTicks:[0,Math.ceil(c/2),c],yAxisMax:c}},[i]),s=new Date().toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit",hour12:!0});return g.jsx(Ie,{className:"h-[377px]",title:"Visitor Updates",period:`Today at ${s}`,icon:g.jsx(bb,{className:"!text-[24px] text-[#8B5CF6]"}),children:g.jsxs("div",{className:"flex flex-col gap-[24px]",children:[g.jsxs("div",{className:"grid grid-cols-2 gap-y-4 gap-x-6",children:[g.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Total Visitors"}),g.jsx("div",{className:"text-[20px] font-medium text-[#08B6D4]",children:n?.totalVisitorsToday??0})]}),g.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Peak Time"}),g.jsx("div",{className:"text-[20px] font-medium text-[#8B5CF6]",children:n?.peakTime??"-"})]}),g.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Active Walk-ins"}),g.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[g.jsx("div",{className:"text-[28px] text-[#1FA05B] leading-[32px]",children:r?.walkins?.currently_inside??0}),g.jsx(vk,{title:"Active Walk-ins",color:"text-[#1FA05B]",rows:[{label:"Currently Inside",value:r?.walkins?.currently_inside??0,valueColor:"#1FA05B"},{label:"Total Visited Today",value:r?.walkins?.total_visited_today??0}],children:g.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.walkins?.total_visited_today??0]})})]})]}),g.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Pre-approved Check-ins"}),g.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[g.jsx("div",{className:"text-[28px] text-[#E7A015] leading-[32px]",children:r?.preApproved?.completed_visits??0}),g.jsx(vk,{title:"Pre-approved Check-ins",color:"text-[#E7A015]",rows:[{label:"Completed Visits",value:r?.preApproved?.completed_visits??0,valueColor:"#E7A015"},{label:"Total Expected Check-ins Today",value:r?.preApproved?.total_expected_today??0}],children:g.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.preApproved?.total_expected_today??0]})})]})]})]}),g.jsx("div",{className:"w-full h-[149px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(_x,{data:i??[],margin:{top:5,right:0,left:0,bottom:-10},children:[g.jsx(or,{stroke:"#E5E7EB",strokeDasharray:"4 4",vertical:!1}),g.jsx(Bn,{dataKey:"time",tickFormatter:(l,c)=>c%4===0?l:"",axisLine:!1,tickLine:!1,tick:{fill:"#121212",fontSize:10,fontWeight:400}}),g.jsx(An,{width:24,axisLine:!1,tickLine:!1,allowDecimals:!1,ticks:o,domain:[0,a],tick:{fill:"#64748B",fontSize:10,fontWeight:400}}),g.jsx(kt,{content:g.jsx(wfe,{})}),g.jsx(Vo,{type:"monotone",dataKey:"walkins",stroke:"#22C55E",strokeWidth:2,dot:!1,name:"Walk-ins",isAnimationActive:!1}),g.jsx(Vo,{type:"monotone",dataKey:"approved",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved",isAnimationActive:!1})]})})})]})})}const Sfe=({color:e})=>g.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:e,marginRight:"6px"}}),Efe=({active:e,payload:t})=>!e||!t||!t.length?null:g.jsx("div",{className:"bg-black text-white !text-[12px] px-[12px] py-[8px] rounded-[8px] shadow-lg",children:t.map((n,r)=>g.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[g.jsx(Sfe,{color:n.color}),n.name,": ",g.jsx("div",{className:"font-semibold",children:n.value})]},r))});function Ofe({data:e=null}){const n=e||{card_entry:60,mobile_entry:35,card_exit:15,mobile_exit:10,total:20.3},r=a=>{const s=Number(a);return isNaN(s)?0:s},i=[{name:"Card Entry",value:r(n.card_entry),color:"#329DFF"},{name:"Mobile Entry",value:r(n.mobile_entry),color:"#8B5CF6"},{name:"Card Exit",value:r(n.card_exit),color:"#B1D2F0"},{name:"Mobile Exit",value:r(n.mobile_exit),color:"#DACBFB"}],o=r(n.total);return g.jsx(Ct,{className:"h-[362px]",title:"Access Overview",titleWeight:"semi-bold",children:g.jsxs("div",{className:"flex flex-col items-center mt-[16px]",children:[g.jsxs("div",{className:"relative w-[200px] h-[200px]",children:[g.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:g.jsx("div",{className:"w-[130px] h-[130px] rounded-full shadow-[0px_12px_35px_rgba(0,0,0,0.12)]"})}),g.jsx("div",{className:"h-[184px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Ni,{children:[g.jsx(Jr,{data:i,dataKey:"value",innerRadius:65,outerRadius:90,startAngle:110,endAngle:-250,paddingAngle:2,stroke:"transparent",children:i.map((a,s)=>g.jsx(pn,{fill:a.color},s))}),g.jsx(kt,{content:g.jsx(Efe,{}),wrapperStyle:{zIndex:9999}})]})})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsxs("div",{className:"text-[20px] leading-[24px] font-semibold text-[#121212]",children:[o,"L"]}),g.jsx("div",{className:"text-[10px] leading-[15px] text-[#64748B]",children:"Total Access"})]})]}),g.jsx("div",{className:"mt-[32px] grid grid-cols-2 gap-x-[20px] gap-y-[12px] text-[12px] text-[#94A3B8]",children:i.map(a=>g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("div",{className:"w-[16px] h-[7px] ",style:{backgroundColor:a.color}}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]},a.name))})]})})}function WR({title:e="Access",data:t=[],height:n="h-[362px]"}){const r=i=>i==null?"0":Number(i).toLocaleString();return g.jsx(Ct,{className:n,title:e,titleWeight:"semi-bold",children:g.jsxs("div",{className:"rounded-[12px] overflow-hidden mt-[16px]",children:[g.jsxs("div",{className:"grid grid-cols-2 bg-[#F8FAFC] py-[8px] px-[12px] text-[12px] leading-[16px] font-medium text-[#64748B]",children:[g.jsx("div",{children:"Point"}),g.jsx("div",{className:"text-right",children:"Access"})]}),t.map((i,o)=>g.jsxs("div",{className:"grid grid-cols-2 p-[12px] text-[14px] border-t border-[#E2E8F0]",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:i.label}),g.jsx("div",{className:"text-[12px] leading-[16px] text-right font-medium",style:{color:i.color||"#000"},children:r(i.value)})]},o))]})})}function Cfe({data:e=[]}){const t=[{name:"Google",value:82e3},{name:"Uber",value:67e3},{name:"ANAROCK",value:6e4},{name:"Flipkart",value:48e3},{name:"HP",value:41e3},{name:"Myntra",value:3e4},{name:"Cloudscape",value:2e4},{name:"Infosys",value:9e3}],n=e.length?e:t,r=o=>o>=1e3?`${o/1e3}K`:o,i=Math.max(...n.map(o=>o.value));return g.jsx(Ct,{title:"Access Points Usage",titleWeight:"semi-bold",className:"h-[362px]",children:g.jsx("div",{className:"mt-[24px] h-[270px] w-full",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Eo,{data:n,barSize:60,margin:{top:0,right:0,left:-20,bottom:0},children:[g.jsx(or,{strokeDasharray:"8 8",vertical:!1}),g.jsx(fx,{y:0,stroke:"#EBEBEB",strokeDasharray:"0"}),g.jsx(Bn,{dataKey:"name",tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),g.jsx(An,{tickFormatter:r,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),g.jsx(kt,{cursor:!1}),g.jsx(Kt,{dataKey:"value",barSize:60,children:n.map((o,a)=>g.jsx(pn,{fill:o.value===i?"#3C81F6":"#79ABFF"},`cell-${a}`))})]})})})})}const kfe=({x:e,y:t,payload:n})=>{const r=n.value.split(" ");return g.jsx("g",{transform:`translate(${e},${t})`,children:g.jsx("text",{x:-85,y:0,textAnchor:"start",fill:"#121212",fontSize:14,children:r.map((i,o)=>g.jsx("tspan",{x:-85,dy:o===0?0:16,children:i},o))})})};function Pfe({data:e=[]}){const t=e&&e.length>0,n=e.map(r=>({name:r.category_name,value:r.total_complaints,color:"#08B6D4"}));return g.jsx(Ct,{title:"Tickets per Category",className:"h-[362px]",titleWeight:"semi-bold",childrenClassName:"h-full mt-[24px]!",children:t?g.jsx("div",{className:"w-full h-[262px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Eo,{data:n,layout:"vertical",margin:{top:0,right:8,left:-20,bottom:0},children:[g.jsx(or,{strokeDasharray:"3 3",horizontal:!1,stroke:"#E5E7EB"}),g.jsx(Bn,{type:"number",tick:{fill:"#94A3B8",fontSize:12},axisLine:!0,tickLine:!1,tickMargin:10,allowDecimals:!1}),g.jsx(An,{type:"category",dataKey:"name",axisLine:!1,tickLine:!1,width:132,tick:g.jsx(kfe,{})}),g.jsx(kt,{content:g.jsx(ss,{}),cursor:{fill:"transparent"},position:{x:300,y:0}}),g.jsx(Kt,{dataKey:"value",barSize:36,fill:"#08B6D4"})]})})}):g.jsx(ar,{title:"No Tickets Found",description:"Catch up all the data. Change the date range to see the data."})})}function Dfe({icon:e,iconColor:t="#329DFF",title:n,value:r,percentage:i,percentageText:o}){const a=parseFloat(i),s=a>=0,l=s?"#16A34A":"#DC2626";return g.jsxs("div",{className:"relative bg-white !border-[0.5px] !border-[#EBEBEB] !rounded-[12px] !shadow-[0_0_12px_0_#EAF2FF] p-[16px]",children:[g.jsxs("div",{className:"flex items-center gap-[8px]",children:[e&&g.jsx("div",{className:"h-[20px] w-[20px]",style:{color:t,display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsx(e,{className:"h-[20px] w-[20px]"})}),g.jsx("div",{className:"text-[16px] leading-[20px] font-medium text-[#64748B]",children:n})]}),g.jsx("div",{className:"mt-[16px] text-[28px] leading-[32px] font-medium text-[#121212]",children:r}),(i||o)&&g.jsxs("div",{className:"mt-[12px] flex items-center gap-[8px]",children:[i&&g.jsxs("div",{className:"flex items-center gap-[4px] text-[12px] leading-[16px] font-medium",style:{color:l},children:[s?g.jsx(qa,{}):g.jsx(Ka,{}),Math.abs(a),"%"]}),o&&g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:o})]})]})}const Afe=({data:e=[],onDateChange:t})=>{const[n,r]=k.useState(new Date),[i,o]=k.useState(!1),s=(v=>{const b=new Date(v);return b.setDate(b.getDate()-6),b})(n),l=v=>{try{return v.toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}catch{return""}},c=v=>{const b=new Date(v),S=new Date(b);S.setDate(S.getDate()-6),t&&t(S.toISOString(),b.toISOString())},u=()=>{const v=new Date(n);v.setDate(v.getDate()-7),r(v),c(v)},d=()=>{const v=new Date(n);v.setDate(v.getDate()+7),r(v),c(v)},f=()=>{o(v=>!v)},p=v=>{const b=v||new Date;r(b),c(b),o(!1)},h=Array.isArray(e)?e:[],m=!h.length||h.every(v=>v.no_of_visitors===0);return g.jsxs(Ct,{title:"Weekly Visitor Pattern",period:`${l(s)} - ${l(n)}`,isDateSelector:!0,titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",onPrevClick:u,onNextClick:d,onCalendarClick:f,children:[i&&g.jsx("div",{className:"anarock-datepicker absolute top-[70px] right-[24px] z-50",children:g.jsx(VP,{selected:n,onChange:p,inline:!0,maxDate:new Date,showYearDropdown:!0,scrollableYearDropdown:!0,yearDropdownItemNumber:40})}),m?g.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:g.jsx(ar,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):g.jsx("div",{className:"w-full h-[280px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(VN,{data:h,margin:{top:10,right:-10,left:-10,bottom:0},children:[g.jsx("defs",{children:g.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[g.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),g.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),g.jsx(or,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),g.jsx(Bn,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:v=>new Date(v).toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}),g.jsx(An,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),g.jsx(kt,{cursor:!1,content:({active:v,payload:b,label:S,coordinate:w})=>{if(!v||!b?.length)return null;const x=new Date(S).toLocaleDateString("en-GB",{day:"2-digit",month:"short"}),O=b[0]?.payload===h[h.length-1]?w.x-70:w.x;return g.jsx("div",{style:{position:"absolute",transform:`translate(${O}px, ${w.y-40}px)`,pointerEvents:"none",zIndex:99999},children:g.jsx(ls,{active:v,payload:b,label:x})})}}),g.jsx(vx,{type:"monotone",dataKey:"no_of_visitors",stroke:"#6366F1",strokeWidth:2,fill:"url(#colorVisitors)",dot:{r:5,stroke:"#6366F1",strokeWidth:2,fill:"#fff"},activeDot:v=>{const{cx:b,cy:S,stroke:w}=v;return g.jsxs("g",{children:[g.jsx("circle",{cx:b,cy:S,r:6,fill:"#fff",stroke:"#6466F1",strokeWidth:2}),g.jsx("circle",{cx:b,cy:S,r:2.5,fill:"#6466F1"})]})}})]})})})]})},Tfe=[{building_name:"Google",no_of_visitors:1e3},{building_name:"Uber",no_of_visitors:3500},{building_name:"ANAROCK",no_of_visitors:2e3},{building_name:"Flipkart",no_of_visitors:8e3},{building_name:"HP",no_of_visitors:1650}],Mfe=({data:e})=>{const t=Array.isArray(e)&&e?.length===0,n=e==null?Tfe:Array.isArray(e)?e:[];return g.jsx(Ct,{title:"Organisation Wise Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",children:g.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:t?g.jsx(ar,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."}):g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Eo,{data:n||[],margin:{top:10,right:10,left:10,bottom:-10},barCategoryGap:35,children:[g.jsx(or,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),g.jsx(Bn,{dataKey:"building_name",tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1}),g.jsx(An,{width:40,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1}),g.jsx(kt,{cursor:!1,content:g.jsx(ls,{})}),g.jsx(Kt,{dataKey:"no_of_visitors",name:"Visitors",maxBarSize:55,fill:"#3C81F6"})]})})})})};function Nfe({data:e}){return g.jsx("div",{className:"h-full",children:e.map((t,n)=>{const r=parseFloat(t.delta),i=r>=0;return g.jsx(Ie,{iconClassName:"!gap-[8px]",title:g.jsx("div",{className:"text-[#64748B]",children:t.title}),icon:g.jsx(t.Icon,{className:"h-[20px] w-[20px]",style:{color:t.iconColor||"#000000"}}),className:`${t?.widget==="amenities"?"h-[139px]":"h-[124px]"}`,children:g.jsxs("div",{className:`flex flex-col gap-[8px] ${t?.widget==="amenities"?"mt-[3.5px]":"mt-0"}`,children:[g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t.value}),g.jsxs("div",{className:`flex items-center text-[12px] leading-[16px] ${t.delta?"gap-[8px]":""}`,children:[t.delta&&g.jsxs("div",{className:`flex items-center gap-[4px] px-[6px] py-[2px] rounded-[4px] font-medium
|
|
373
373
|
${i?"text-[#1FA05B] bg-[#F7FEFA]":"text-[#E11D48] bg-[#FBF4F4]"}
|
|
374
374
|
`,children:[i?g.jsx(qa,{}):g.jsx(Ka,{}),Math.abs(r),"%"]}),g.jsx("div",{style:{color:"#64748B"},children:t.deltaLabel})]})]})},n)})})}const jfe=[{facility_name:"Table Tennis",total_booking:5},{facility_name:"Gym",total_booking:12},{facility_name:"Meeting Room A",total_booking:3},{facility_name:"Conference Hall",total_booking:8}],Rfe=({x:e,y:t,payload:n})=>g.jsx("foreignObject",{x:(e||0)-80,y:(t||0)-18,width:80,height:40,children:g.jsx("div",{className:"text-[12px] leading-[16px] text-[#121212]",style:{width:"80px",whiteSpace:"normal",wordBreak:"break-word",textAlign:"left"},children:n?.value||""})});function Ife({data:e}){const t=Array?.isArray(e)&&e?.length===0,r=(e==null?jfe:Array?.isArray(e)?e:[]).map(i=>({...i,name:i.facility_name,color:"#8B5CF6"}));return g.jsx(Ie,{title:"Bookings",icon:g.jsx(dde,{size:18,className:"text-[#DBB467]"}),className:"h-[288px]",children:g.jsx("div",{className:"w-full h-full flex items-center justify-center",children:t?g.jsx(ar,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Eo,{data:r||[],layout:"vertical",margin:{top:0,right:10,left:-12,bottom:0},children:[g.jsx(Bn,{type:"number",allowDecimals:!1,tick:{fill:"#64748B",fontSize:12},axisLine:!0,tickLine:!1}),g.jsx(An,{type:"category",dataKey:"facility_name",axisLine:!1,tickLine:!1,width:100,tick:g.jsx(Rfe,{})}),g.jsx(kt,{content:g.jsx(ss,{}),cursor:{fill:"transparent"},position:{x:300,y:0}}),g.jsx(Kt,{dataKey:"total_booking",barSize:40,fill:"#8B5CF6"})]})})})})}const Ffe=[{building_name:"Google",no_of_booking:1},{building_name:"Uber",no_of_booking:2},{building_name:"ANAROCK",no_of_booking:4},{building_name:"Flipkart",no_of_booking:2},{building_name:"HP",no_of_booking:1}];function Lfe({data:e}){const t=Array.isArray(e)&&e?.length===0,n=e==null?Ffe:Array.isArray(e)?e:[];return g.jsx(Ct,{title:"Booking Trend by Organisation",titleWeight:"semi-bold",className:"h-[362px]",children:g.jsx("div",{className:"w-full h-[265px] mt-[28px] flex items-center justify-center",children:t?g.jsx(ar,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Eo,{data:n||[],margin:{top:0,right:0,left:-30,bottom:0},children:[g.jsx(or,{strokeDasharray:"3 3",vertical:!1,stroke:"#E5E7EB"}),g.jsx(Bn,{dataKey:"building_name",axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12}}),g.jsx(An,{allowDecimals:!1,axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12},tickFormatter:r=>`${r??0}`}),g.jsx(kt,{cursor:!1,content:g.jsx(ls,{})}),g.jsx(Kt,{dataKey:"no_of_booking",barSize:54,fill:"#12B981"})]})})})})}const $fe=[{facility_name:"Table Tennis",paid_revenue:"24000.00"},{facility_name:"Games Room",paid_revenue:"14000.00"},{facility_name:"Badminton",paid_revenue:"10000.00"},{facility_name:"GYM",paid_revenue:"4000.00"}],Vd=["#3C81F6","#60A5FA","#95BFFA","#BEDAFE","#DAE6FC"];function Bfe({data:e,currencyType:t}){const n=Array?.isArray(e)&&e?.length===0,r=e??$fe,i=Array?.isArray(r)&&r?.length>0?r?.map(l=>({name:l?.facility_name||"Unknown",value:Number(l?.paid_revenue)||0})):[],a=(i?.length>0?i?.every(l=>l?.value===0):!1)?i?.map((l,c)=>({...l,value:c===0?1:0})):i,s=l=>`${t||"Rs"} ${l?.toLocaleString?.("en-IN")||0}`;return g.jsx(Ct,{title:"Amenity Wise Revenue",titleWeight:"semi-bold",className:"h-[362px]",children:g.jsx("div",{className:"grid grid-cols-12 gap-[24px] items-center h-full mt-[16px]",children:n?g.jsx("div",{className:"col-span-12 flex items-center justify-center h-[240px]",children:g.jsx(ar,{title:"No Amenity Found",description:"Catch up all the data. Change the date range to see the data."})}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"col-span-6 h-[240px] w-full max-w-[240px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Ni,{children:[g.jsx(Jr,{data:a||[],dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:95,stroke:"#fff",strokeWidth:1,children:a?.map?.((l,c)=>g.jsx(pn,{fill:Vd?.[c%Vd?.length]},`cell-${c}`))}),g.jsx(kt,{cursor:!1,content:l=>g.jsx(ls,{...l,formatter:c=>s(c)})})]})})}),g.jsx("div",{className:"col-span-6",children:g.jsxs("div",{className:"rounded-[12px] !overflow-hidden border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[g.jsxs("div",{className:"grid grid-cols-2 px-[12px] py-[8px] bg-[#EBEBEB] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[g.jsx("div",{children:"Amenity"}),g.jsx("div",{className:"text-right",children:"Revenue"})]}),g.jsx("div",{className:"divide-y divide-[#F1F5F9] max-h-[238px] overflow-y-auto hide-scrollbar",children:i?.map?.((l,c)=>g.jsxs("div",{className:"grid grid-cols-2 px-[16px] py-[16px] text-[14px] text-[#121212]",children:[g.jsxs("div",{className:"flex items-center gap-[12px]",children:[g.jsx("span",{className:"w-[16px] h-[7px]",style:{backgroundColor:Vd?.[c%Vd?.length]}}),g.jsx("span",{className:"text-[#64748B] text-[12px] leading-[16px]",children:l?.name||"Unknown"})]}),g.jsx("div",{className:"text-right text-[12px] leading-[16px] text-[#64748B]",children:s(l?.value||0)})]},l?.name||c))})]})})]})})})}const Hd=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],Wfe=[{asset_group_name:"Lifts",asset_count:3},{asset_group_name:"Fire Systems",asset_count:16},{asset_group_name:"Generators",asset_count:16},{asset_group_name:"HVAC",asset_count:24},{asset_group_name:"Others",asset_count:97}],zfe=({rows:e,totalAssets:t})=>{const n=k.useMemo(()=>e?e.length===0?[]:e.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,fill:Hd[o%Hd.length]})):Wfe.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,fill:Hd[o%Hd.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?g.jsx(Ct,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:g.jsx("div",{className:"flex items-center justify-center h-full",children:g.jsx(ar,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):g.jsx(Ct,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:g.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[g.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Ni,{children:[g.jsx(Jr,{data:n,dataKey:"value",cx:"50%",cy:"50%",innerRadius:60,outerRadius:90,paddingAngle:2,stroke:"#FFFFFF",strokeWidth:2,startAngle:90,endAngle:-270,isAnimationActive:!1,children:n.map((i,o)=>g.jsx(pn,{fill:i.fill},o))}),g.jsx(kt,{cursor:!1,content:g.jsx(ls,{})})]})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),g.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),g.jsx("div",{className:"flex-1 max-w-[280px]",children:g.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[g.jsxs("div",{className:"flex items-center justify-between px-[16px] py-[12px] bg-[#F8FAFC]",children:[g.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),g.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Count"})]}),n.map((i,o)=>g.jsxs("div",{className:"max-h-[205px] overflow-y-auto hide-scrollbar flex items-center justify-between px-[16px] py-[12px] border-t border-[#F1F5F9]",children:[g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.fill}}),g.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),g.jsx("div",{className:"text-[13px] text-[#64748B]",children:i.value})]},o))]})})]})})},Vfe=({data:e})=>{const[t,n]=k.useState({}),r=[{name:"Lifts",Cancelled:55,Closed:45,Open:50,OnHold:20,InProgress:10},{name:"Fire Systems",Cancelled:15,Closed:45,Open:15,OnHold:8,InProgress:5},{name:"Generators",Cancelled:12,Closed:45,Open:75,OnHold:18,InProgress:7},{name:"HVAC",Cancelled:45,Closed:80,Open:30,OnHold:22,InProgress:12},{name:"Others",Cancelled:18,Closed:18,Open:45,OnHold:9,InProgress:4}],i=k.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:r,[e]),o=a=>{const{dataKey:s}=a;n(l=>({...l,[s]:!l[s]}))};return Array.isArray(e)&&e.length===0?g.jsx(Ct,{title:"Maintenance Status",titleWeight:"semi-bold",className:"h-full",children:g.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:g.jsx(ar,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):g.jsx(Ct,{title:"Maintenance Status",titleWeight:"semi-bold",className:"h-full",children:g.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:Array.isArray(e)&&e.length===0?g.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):g.jsx("div",{className:"relative w-full h-[297px] mt-[20px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Eo,{data:i,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[g.jsx(or,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),g.jsx(Bn,{dataKey:"name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),g.jsx(An,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),g.jsx(kt,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},content:({active:a,payload:s,label:l})=>!a||!s||!s.length?null:g.jsxs("div",{style:{backgroundColor:"#000",borderRadius:"10px",padding:"10px 14px",fontSize:"12px",color:"#fff"},children:[g.jsx("div",{style:{marginBottom:"6px",fontWeight:600},children:l}),s.map((c,u)=>{const d=c.color||c.fill||"#fff";return g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[g.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:d,display:"inline-block"}}),g.jsx("span",{style:{color:"#D1D3D4"},children:c.name}),g.jsx("span",{style:{color:"#fff",fontWeight:600},children:c.value})]},u)})]})}),g.jsx(wu,{verticalAlign:"bottom",align:"center",onClick:o,content:({payload:a})=>g.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:a.map((s,l)=>g.jsxs("div",{onClick:()=>o({dataKey:s.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[g.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:t[s.dataKey]?"#CBD5E1":s.color}}),g.jsx("span",{style:{fontSize:"12px",color:t[s.dataKey]?"#CBD5E1":"#64748B"},children:s.value})]},l))})}),g.jsx(Kt,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:t.Open}),g.jsx(Kt,{dataKey:"Closed",stackId:"a",fill:"#10B981",hide:t.Closed}),g.jsx(Kt,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:t.Cancelled}),g.jsx(Kt,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:t.OnHold,name:"On-Hold"}),g.jsx(Kt,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:t.InProgress,name:"In Progress"})]})})})})})};function Hfe({data:e}){const t=[{name:"Completed",value:Number(e?.completed||1110),color:"#12B981"},{name:"Not - Completed",value:Number(e?.not_completed||20),color:"#F69E0A"},{name:"Missed",value:Number(e?.missed||30),color:"#EF4444"}],n=Number(e?.completed||0)+Number(e?.not_completed||0)+Number(e?.missed||0),r=Number(e?.completed||0);return g.jsx(Ct,{title:"Patrol Status",className:"h-[362px]",titleWeight:"semi-bold",children:g.jsxs("div",{className:"flex flex-col items-center justify-center",children:[g.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Ni,{children:[g.jsx(Jr,{data:t,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:t.map((i,o)=>g.jsx(pn,{fill:i.color},`cell-${o}`))}),g.jsx(kt,{cursor:!1,content:g.jsx(ls,{})})]})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[r,"/",n]}),g.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),g.jsx("div",{className:"flex flex-col w-full text-[14px]",children:t.map((i,o)=>g.jsxs("div",{className:`flex items-center justify-between py-[10px] ${o!==t.length-1?"border-b border-[#F1F5F9]":""}`,children:[g.jsxs("div",{className:"flex items-center gap-[10px]",children:[g.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:i.color}}),g.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.name})]}),g.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.value})]},i.name))})]})})}function Yfe({incidentReports:e,incidentReportsDetails:t}){const n=Number(e?.open||0),r=Number(e?.in_progress||0),i=Number(e?.closed||0);return g.jsx(Ct,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:g.jsxs("div",{children:[g.jsxs("div",{className:"flex w-full text-center gap-[16px] mt-[24px]",children:[g.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FBF4F4] h-[76px] rounded",children:[g.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#AB0000]",children:n}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),g.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FFFBF2] h-[76px] rounded",children:[g.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#F2A815]",children:r}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#F2A815]",children:"In-progress"})]}),g.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#F7FEFA] h-[76px] rounded",children:[g.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:i}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),g.jsx("div",{className:"mt-4 space-y-2",children:t?.length>0?t.map((o,a)=>{const s=o?.severity==="Danger"?"text-[#AB0000]":o?.severity==="High"?"text-[#E7A015]":"text-[#1FA05B]";return g.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#FAFBFD] rounded-md",children:[g.jsx("div",{className:"flex items-center gap-[8px]",children:g.jsx("div",{className:"text-gray-700 font-medium",children:o?.incident_code})}),g.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${s}`,children:g.jsxs("div",{children:[o?.severity_level," - ",o?.severity]})})]},a)}):g.jsx(g.Fragment,{})})]})})}function Ufe({columns:e=[{key:"a",label:"Organisation"},{key:"b",label:"Item"},{key:"c",label:"Closed"},{key:"d",label:"Open"},{key:"e",label:"AOV"},{key:"f",label:"% Revenue"}],data:t=[{a:"Google",b:"Coffee",c:"34,908",d:"₹ 57,21,288",e:"₹ 450",f:"43.6%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"}],rowsPerPage:n=10,setRowsPerPage:r=()=>{},currentPage:i=1,setCurrentPage:o=()=>{},totalRows:a=0,totalPages:s=1,pageOptions:l=[10,20,30,40,50]}){const c=Array.isArray(t)?t:[],u=Array.isArray(e)?e:[],d=n>0?Math.ceil(c.length/n):1,f=s||d,p=c,h=a===0&&c.length===0,m=`repeat(${u.length}, 1fr)`;return g.jsxs("div",{className:"w-full bg-white rounded-[12px] h-[390px] !border-[0.5px] !border-[#EBEBEB] !shadow-[0_0_12px_0_#EAF2FF] overflow-hidden flex flex-col",children:[g.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[g.jsx("div",{className:"grid bg-[#354A5E] text-white text-[16px] leading-[20px] font-medium shrink-0",style:{gridTemplateColumns:m},children:u.map((v,b)=>g.jsx("div",{className:"px-[24px] py-[16px] text-[16px] leading-[20px] whitespace-nowrap text-left",children:v.label},b))}),g.jsx("div",{className:"flex-1 overflow-y-auto hide-scrollbar",children:h?g.jsx(ar,{title:"No Data Found",description:"Catch up all the data. Change the date range to see the data."}):p.map((v,b)=>g.jsx("div",{className:"grid",style:{gridTemplateColumns:m},children:u.map((S,w)=>{const x=v[S.key],_=S.label==="Closed",O=S.label==="Open",P=typeof x=="string"&&x.includes("%"),D=x==="100%"?"bg-[#F0FEF2] text-[#36AB6C]":"bg-[#FFF0F0] text-[#AB0000]";return g.jsx("div",{className:`px-[24px] py-[16px] flex items-center justify-start ${w===0?"bg-white":"bg-gray-50"} text-[#121212]`,children:_?g.jsx("div",{className:"text-[14px] font-medium",style:{color:"#36AB6C"},children:x??"-"}):O?g.jsx("div",{className:"text-[14px] font-medium",style:{color:"#AB0000"},children:x??"-"}):P?g.jsx("div",{className:`inline-block px-[12px] py-[4px] rounded-full text-[14px] font-medium ${D}`,children:x}):g.jsx("div",{children:x??"-"})},w)})},b))})]}),g.jsxs("div",{className:"flex justify-end items-center px-[24px] py-[16px] text-sm bg-white border-t border-[#F0F0F0] gap-[32px] shrink-0",children:[g.jsxs("div",{className:"flex items-center gap-[8px] text-gray-600 text-[14px]",children:[g.jsx("div",{children:"Rows per page:"}),g.jsx("select",{value:n,onChange:v=>{r(Number(v.target.value)),o(1)},className:"border rounded px-[8px] py-[4px]",children:l.map((v,b)=>g.jsx("option",{value:v,children:v},b))}),g.jsxs("div",{className:"ml-4 text-[14px]",children:[c?.length===0?"0–0":`1–${c?.length}`," of"," ",a||c?.length]})]}),g.jsxs("div",{className:"flex items-center space-x-2 text-gray-600 text-[14px]",children:[g.jsx("button",{onClick:()=>o(1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:g.jsx(sde,{size:18})}),g.jsx("button",{onClick:()=>o(v=>v-1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:g.jsx($R,{size:18})}),g.jsx("button",{onClick:()=>o(v=>v+1),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:g.jsx(BR,{size:18})}),g.jsx("button",{onClick:()=>o(f),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:g.jsx(cde,{size:18})})]})]})]})}const zR=({options:e=[],value:t,onChange:n})=>{const[r,i]=k.useState(!1),o=k.useRef(null);return k.useEffect(()=>{const a=s=>{o.current&&!o.current.contains(s.target)&&i(!1)};return document.addEventListener("mousedown",a),()=>{document.removeEventListener("mousedown",a)}},[]),g.jsxs("div",{ref:o,className:"relative h-[32px]",children:[g.jsxs("div",{className:"flex items-center justify-between gap-[10px] px-[12px] py-[8px] border border-[#E2E8F0] rounded-[4px] cursor-pointer min-w-[140px]",onClick:()=>i(!r),children:[g.jsx("div",{className:"text-[12px] leading-[16px] min-w-[109px] text-[#64748B]",children:t}),g.jsx(rde,{size:16,className:"text-[#64748B]"})]}),r&&g.jsx("div",{className:"absolute top-[110%] left-0 w-full bg-white border border-[#E2E8F0] rounded-[8px] shadow-md z-10",children:e.map((a,s)=>g.jsx("div",{className:"px-[12px] py-[8px] text-[14px] text-[#334155] hover:bg-[#F1F5F9] cursor-pointer",onClick:()=>{n(a),i(!1)},children:a},s))})]})},Kfe=({data:e})=>{const[t,n]=k.useState({}),[r,i]=k.useState("Kosmo One"),o=["Kosmo One","Kosmo Two","Kosmo Three"],a=[{name:"L1",Cancelled:55,Open:50,OnHold:20,InProgress:10},{name:"L2",Cancelled:15,Open:15,OnHold:8,InProgress:5},{name:"L3",Cancelled:12,Open:75,OnHold:18,InProgress:7}],s=k.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:a,[e]),l=c=>{const{dataKey:u}=c;n(d=>({...d,[u]:!d[u]}))};return Array.isArray(e)&&e.length===0?g.jsx(Ct,{title:"Escalation Level By Building",titleWeight:"semi-bold",className:"h-full",children:g.jsx("div",{className:"w-full h-[362px] flex items-center justify-center",children:g.jsx(ar,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):g.jsx(Ct,{title:"Escalation Level By Building",titleWeight:"semi-bold",className:"h-[362px]",childrenClassName:"mt-[21px]",rightContent:g.jsx(zR,{options:o,value:r,onChange:c=>i(c)}),children:g.jsx("div",{className:"w-full flex items-center justify-center",children:Array.isArray(e)&&e.length===0?g.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):g.jsx("div",{className:"relative w-full h-[261px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(Eo,{data:s,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[g.jsx(or,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),g.jsx(Bn,{dataKey:"name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),g.jsx(An,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),g.jsx(kt,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},content:({active:c,payload:u,label:d})=>!c||!u||!u.length?null:g.jsxs("div",{style:{backgroundColor:"#000",borderRadius:"10px",padding:"10px 14px",fontSize:"12px",color:"#fff"},children:[g.jsx("div",{style:{marginBottom:"6px",fontWeight:600},children:d}),u.map((f,p)=>{const h=f.color||f.fill||"#fff";return g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[g.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:h,display:"inline-block"}}),g.jsx("span",{style:{color:"#D1D3D4"},children:f.name}),g.jsx("span",{style:{color:"#fff",fontWeight:600},children:f.value})]},p)})]})}),g.jsx(wu,{verticalAlign:"bottom",align:"center",onClick:l,content:({payload:c})=>g.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:c.map((u,d)=>g.jsxs("div",{onClick:()=>l({dataKey:u.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[g.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:t[u.dataKey]?"#CBD5E1":u.color}}),g.jsx("span",{style:{fontSize:"12px",color:t[u.dataKey]?"#CBD5E1":"#64748B"},children:u.value})]},d))})}),g.jsx(Kt,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:t.Open}),g.jsx(Kt,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:t.Cancelled}),g.jsx(Kt,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:t.OnHold,name:"On-Hold"}),g.jsx(Kt,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:t.InProgress,name:"In Progress"})]})})})})})},qfe=({data:e=[]})=>{const[t,n]=k.useState("Kosmo One"),r=["Kosmo One","Kosmo Two","Kosmo Three"],i=Array.isArray(e)?e:[],o=!i.length||i.every(a=>a.no_of_visitors===0);return g.jsx(Ct,{title:"Top 5 Tenants by Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-[20px]",rightContent:g.jsx(zR,{options:r,value:t,onChange:a=>n(a)}),children:o?g.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:g.jsx(ar,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):g.jsx("div",{className:"w-full h-[280px]",children:g.jsx(_t,{width:"100%",height:"100%",children:g.jsxs(VN,{data:i,margin:{top:10,right:-10,left:-10,bottom:0},children:[g.jsx("defs",{children:g.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[g.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),g.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),g.jsx(or,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),g.jsx(Bn,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:a=>new Date(a).toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}),g.jsx(An,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),g.jsx(kt,{cursor:!1,content:({active:a,payload:s,label:l,coordinate:c})=>{if(!a||!s?.length)return null;const u=new Date(l).toLocaleDateString("en-GB",{day:"2-digit",month:"short"});return g.jsx(ls,{active:a,payload:s,label:u})}}),g.jsx(vx,{type:"monotone",dataKey:"no_of_visitors",stroke:"#6366F1",strokeWidth:2,fill:"url(#colorVisitors)",dot:{r:5,stroke:"#6366F1",strokeWidth:2,fill:"#fff"},activeDot:a=>{const{cx:s,cy:l,stroke:c}=a;return g.jsxs("g",{children:[g.jsx("circle",{cx:s,cy:l,r:6,fill:"#fff",stroke:"#6466F1",strokeWidth:2}),g.jsx("circle",{cx:s,cy:l,r:2.5,fill:"#6466F1"})]})}})]})})})})},Gfe=({data:e})=>{const t=[{name:"Kosmo One",total:29,pending:1,cancelled:2},{name:"OWC",total:23,pending:9,cancelled:3},{name:"Exora",total:40,pending:12,cancelled:1},{name:"OIC - T3",total:27,pending:19,cancelled:8}],n=e&&e.length?e:t;return g.jsx(Ct,{title:"Building Wise Approvals",titleWeight:"semi-bold",className:"h-full",childrenClassName:"mt-[34px]",children:g.jsxs("div",{className:"w-full border border-[#EBEBEB] rounded-[10px] overflow-hidden",children:[g.jsxs("div",{className:"grid grid-cols-4 bg-[#FAFAFA] px-[12px] py-[8px] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[g.jsx("div",{children:"Tenant"}),g.jsx("div",{className:"flex justify-end",children:"Total"}),g.jsx("div",{className:"flex justify-end",children:"Pending"}),g.jsx("div",{className:"flex justify-end",children:"Cancelled"})]}),g.jsx("div",{className:"max-h-[280px] overflow-y-auto hide-scrollbar",children:n.map((r,i)=>g.jsxs("div",{className:"grid grid-cols-4 p-[12px] text-[12px] leading-[16px] border-t border-[#EBEBEB]",children:[g.jsx("div",{className:"text-[#475569]",children:r.name}),g.jsx("div",{className:"flex justify-end text-[#36AB6C] font-[400]",children:r.total}),g.jsx("div",{className:"flex justify-end text-[#F2A815] font-[400]",children:r.pending}),g.jsx("div",{className:"flex justify-end text-[#AB0000] font-[400]",children:r.cancelled})]},i))})]})})},Yd=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],Xfe=[{asset_group_name:"Lifts",asset_count:3,investment:"₹ 45L"},{asset_group_name:"Fire Systems",asset_count:16,investment:"₹ 28L"},{asset_group_name:"Generators",asset_count:16,investment:"₹ 95L"},{asset_group_name:"HVAC",asset_count:24,investment:"₹ 1.2Cr"},{asset_group_name:"Others",asset_count:97,investment:"₹ 52L"}],Qfe=({rows:e,totalAssets:t})=>{const n=k.useMemo(()=>e?e.length===0?[]:e.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",color:Yd[o%Yd.length]})):Xfe.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",color:Yd[o%Yd.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?g.jsx(Ct,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:g.jsx("div",{className:"flex items-center justify-center h-full",children:g.jsx(ar,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):g.jsx(Ct,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:g.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[g.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[g.jsx(_t,{width:"100%",height:"100%",children:g.jsx(Ni,{children:g.jsx(Jr,{data:n,dataKey:"value",cx:"50%",cy:"50%",innerRadius:60,outerRadius:90,paddingAngle:2,stroke:"#FFFFFF",strokeWidth:2,startAngle:90,endAngle:-270,children:n.map((i,o)=>g.jsx(pn,{fill:i.color},o))})})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[g.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),g.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),g.jsx("div",{className:"flex-1 max-w-[280px]",children:g.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[g.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] bg-[#F8FAFC]",children:[g.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),g.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-center",children:"Count"}),g.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-right",children:"Investment"})]}),g.jsx("div",{className:"max-h-[205px] overflow-y-auto hide-scrollbar",children:n.map((i,o)=>g.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] border-t border-[#F1F5F9]",children:[g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.color}}),g.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),g.jsx("div",{className:"text-[13px] text-[#64748B] text-center",children:i.value}),g.jsx("div",{className:"text-[13px] text-[#64748B] text-right",children:i.investment})]},o))})]})})]})})};exports.AccessPointsUsage=Cfe;exports.Accounting=kue;exports.Amenities=hfe;exports.AmenitiesStatsCard=Nfe;exports.AmenityWiseRevenue=Bfe;exports.AssetValueBreakdown=$ue;exports.AssetsByType=zfe;exports.BlockWiseOccupancy=xue;exports.BookingTrendChart=Lfe;exports.Bookings=Ife;exports.Budgets=Tue;exports.BuildingWiseApprovals=Gfe;exports.Card=Ie;exports.CardAccess=WR;exports.CashBankBalance=Nue;exports.CommercialAccessOverview=Ofe;exports.CommercialGuardPatrols=Hfe;exports.CommercialIncidentReports=Yfe;exports.CommercialOccupancy=cfe;exports.CommercialReportTable=Ufe;exports.Community=noe;exports.Complaints=Rde;exports.ComplaintsByLevel=Bde;exports.DuesAgeing=Rue;exports.EmployeeFootfall=ufe;exports.Engagement=roe;exports.EngagementStatsGrid=lfe;exports.EscalationLevel=Kfe;exports.EventsUtilisation=Zde;exports.ExpenseCategories=Fue;exports.Facilities=ioe;exports.FinanceSummary=ooe;exports.FoodBeverages=pfe;exports.GateAndSecurityStatsGrid=Mde;exports.GateUpdates=Uoe;exports.GuardPatrols=vde;exports.Header=d3;exports.Helpdesk=Koe;exports.HelpdeskStatsGrid=Gde;exports.HourlyTrafficFlow=_de;exports.IncidentReports=Ode;exports.IncomeExpenditure=IR;exports.MainHeader=E3;exports.MaintenanceStatus=Vfe;exports.MetricCard=Dfe;exports.MobileAccess=WR;exports.MoveInOutTrends=_ue;exports.NoticeBoardStatus=tfe;exports.OccupancyOverview=vue;exports.OrganisationWiseVisitors=Mfe;exports.PortfolioAssetsByType=Qfe;exports.RequestBox=zde;exports.ResidentOverview=bue;exports.RevenuebyCategory=Wue;exports.SingleStats=ife;exports.StaffAttendance=Pde;exports.StatsGrid=Uue;exports.TenantsByVisitors=qfe;exports.TicketEscalation=mfe;exports.TicketStatus=vfe;exports.Tickets=RR;exports.TicketsperCategory=Pfe;exports.UnitStatus=RR;exports.VisitorUpdates=_fe;exports.WeeklyVisitorPattern=Afe;
|
package/dist/index.es.js
CHANGED
|
@@ -54015,7 +54015,7 @@ function Spe({ data: e }) {
|
|
|
54015
54015
|
/* @__PURE__ */ g.jsxs(
|
|
54016
54016
|
"div",
|
|
54017
54017
|
{
|
|
54018
|
-
className: `flex items-center
|
|
54018
|
+
className: `flex items-center text-[12px] leading-[16px] ${t.delta ? "gap-[8px]" : ""}`,
|
|
54019
54019
|
children: [
|
|
54020
54020
|
t.delta && /* @__PURE__ */ g.jsxs(
|
|
54021
54021
|
"div",
|
package/dist/index.umd.js
CHANGED
|
@@ -369,6 +369,6 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
369
369
|
*
|
|
370
370
|
* This source code is licensed under the ISC license.
|
|
371
371
|
* See the LICENSE file in the root directory of this source tree.
|
|
372
|
-
*/const Yue=Ii("waves-ladder",[["path",{d:"M19 5a2 2 0 0 0-2 2v11",key:"s41o68"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}],["path",{d:"M7 13h10",key:"1rwob1"}],["path",{d:"M7 9h10",key:"12czzb"}],["path",{d:"M9 5a2 2 0 0 0-2 2v11",key:"x0q4gh"}]]),kt=({title:e,icon:t,period:n,isDateSelector:r=!1,children:i,footer:o,className:a="",titleWeight:s,titleColor:l,iconClassName:c,titleClassName:u,childrenClassName:d,rightContent:f,onCalendarClick:p,onPrevClick:h,onNextClick:m})=>{const v=s==="semi-bold"?600:500;return g.jsxs("div",{className:`relative bg-white p-[24px] !border-[0.5px] !border-[#EBEBEB] !rounded-[12px] !shadow-[0_0_12px_0_#EAF2FF] ${a}`,children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{className:"flex items-center gap-[8px]",children:[t&&g.jsx("div",{className:c,children:t}),g.jsx("div",{style:{fontWeight:v,color:l||"#121212"},className:u||"text-[20px] leading-[24px]",children:e})]}),g.jsxs("div",{className:"flex items-center gap-[12px]",children:[f&&f,n&&!r&&g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:n}),r&&g.jsxs("div",{className:"flex items-center gap-[12px] px-[16px] py-[8px] rounded-[8px] bg-white text-sm text-[#64748B]",children:[g.jsx($ue,{size:16,className:"text-[#64748B] cursor-pointer",onClick:p}),g.jsx(MI,{size:16,className:"cursor-pointer",onClick:h}),g.jsx("span",{className:"text-[12px] leading-[16px] text-[#64748B]",children:n}),g.jsx(NI,{size:16,className:"cursor-pointer",onClick:m})]})]})]}),g.jsx("div",{className:`flex-1 min-h-0 mt-4 ${d}`,children:i}),o&&g.jsx("div",{className:"mt-4 pt-4 border-t border-gray-100 text-[12px] text-[#64748B]",children:o})]})},Uue={completed:18,not_completed:6,missed:4};function Kue({data:e={}}){const t=e&&Object.keys(e).length>0?e:Uue,n=[{name:"Completed",value:Number(t?.completed??0),color:"#12B981"},{name:"Delayed",value:Number(t?.not_completed??0),color:"#EF4444"},{name:"Missed",value:Number(t?.missed??0),color:"#F69E0A"}],r=Number(t?.completed??0)+Number(t?.not_completed??0)+Number(t?.missed??0),i=Number(t?.completed??0);return g.jsx(kt,{title:"Guard Patrols",className:"h-[362px]",titleWeight:"semi-bold",children:g.jsxs("div",{className:"flex flex-col items-center justify-center",children:[g.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[g.jsx(xt,{width:"100%",height:"100%",children:g.jsxs(Oi,{children:[g.jsx(Zr,{data:n??[],innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:n?.map?.((o,a)=>g.jsx(gn,{fill:o?.color??"#ccc"},`cell-${a}`))}),g.jsx(Ct,{content:g.jsx(DI,{})})]})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[i??0,"/",r??0]}),g.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),g.jsx("div",{className:"flex flex-col w-full text-[14px]",children:n?.length?n?.map?.((o,a)=>g.jsxs("div",{className:`flex items-center justify-between py-[10px] ${a!==(n?.length??0)-1?"border-b border-[#F1F5F9]":""}`,children:[g.jsxs("div",{className:"flex items-center gap-[10px]",children:[g.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:o?.color??"#ccc"}}),g.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:o?.name??"-"})]}),g.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:o?.value??0})]},o?.name??a)):g.jsx("div",{className:"text-center text-gray-400 text-sm py-[24px]",children:"No patrol data"})})]})})}Bn.register(Co,ko,i1,r1,Vr,ti);const que=["10 AM","12 PM","2 PM","4 PM","6 PM","8 PM","10 PM"],Kh={guest:[9,5,12,7,3,6,4],cab:[15,12,10,14,7,12,8],delivery:[22,18,16,20,22,14,17],service:[13,12,8,9,5,10,7]},Gue=[{key:"Guest",datasetIndex:0,color:"#EF4444"},{key:"Cab",datasetIndex:1,color:"#7C3AED"},{key:"Delivery",datasetIndex:2,color:"#10B981"},{key:"Service",datasetIndex:3,color:"#F59E0B"}],Xue=({color:e,size:t=12})=>g.jsx("svg",{width:t,height:t,viewBox:"0 0 12 12",style:{display:"block",flexShrink:0},children:g.jsx("rect",{x:"1",y:"1",width:"10",height:"10",rx:"0",fill:e,transform:"rotate(45 6 6)"})}),Que=({chartRef:e})=>{const[t,n]=k.useState({}),r=i=>{const o=e.current;if(!o)return;const a=o.getDatasetMeta(i),s=!!a.hidden;a.hidden=!s,o.update(),n(l=>({...l,[i]:!s}))};return g.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"76px",marginTop:"10px",paddingBottom:"8px",flexWrap:"wrap"},children:Gue.map(({key:i,datasetIndex:o,color:a})=>{const s=!!t[o];return g.jsxs("div",{onClick:()=>r(o),style:{display:"flex",alignItems:"center",gap:"6px",cursor:"pointer",userSelect:"none",opacity:s?.45:1,transition:"opacity 0.2s ease"},children:[g.jsx(Xue,{color:a,size:12}),g.jsx("span",{style:{fontSize:"13px",color:"#64748B",fontWeight:400,lineHeight:1,textDecoration:s?"line-through":"none",transition:"text-decoration 0.15s ease"},children:i})]},i)})})},Zue=({data:e})=>{const t=k.useRef(null),r={labels:Array.isArray(e?.labels)&&e.labels.length>0?e.labels:que,datasets:[{label:"Guest",data:Array.isArray(e?.guest)&&e.guest.length>0?e.guest:Kh.guest,borderColor:"#EF4444",backgroundColor:"rgba(239,68,68,0.15)",pointBackgroundColor:"#EF4444",pointStyle:"rectRot",fill:!1},{label:"Cab",data:Array.isArray(e?.cab)&&e.cab.length>0?e.cab:Kh.cab,borderColor:"#7C3AED",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#7C3AED",pointStyle:"rectRot",fill:!1},{label:"Delivery",data:Array.isArray(e?.delivery)&&e.delivery.length>0?e.delivery:Kh.delivery,borderColor:"#10B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#10B981",pointStyle:"rectRot",fill:!1},{label:"Service",data:Array.isArray(e?.service)&&e.service.length>0?e.service:Kh.service,borderColor:"#F59E0B",backgroundColor:"rgba(245,158,11,0.15)",pointBackgroundColor:"#F59E0B",pointStyle:"rectRot",fill:!1}]},i={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:o=>o[0].label,label:o=>`${o.dataset.label} ${o.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return g.jsxs(je,{title:"Hourly Traffic Flow",className:"w-full h-[362px]",children:[g.jsx("div",{style:{height:"calc(100% - 44px)",width:"100%"},children:g.jsx(l1,{ref:t,data:r,options:i})}),g.jsx(Que,{chartRef:t})]})},Jue={open:4,in_progress:7,closed:12},ede=[{incident_code:"INC-401",severity_level:"L1",severity:"Danger"},{incident_code:"INC-402",severity_level:"L2",severity:"High"},{incident_code:"INC-403",severity_level:"L3",severity:"Low"}];function tde({incidentReports:e={},incidentReportsDetails:t=[]}){const n=e&&Object.keys(e).length>0?e:Jue,r=Array.isArray(t)?t:ede,i=Number(n?.open??0),o=Number(n?.in_progress??0),a=Number(n?.closed??0);return g.jsx(kt,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:g.jsxs("div",{children:[g.jsxs("div",{className:"flex w-full text-center gap-[24px]",children:[g.jsxs("div",{className:"flex-1 py-[12px] bg-[#FBF4F4] h-[76px] rounded",children:[g.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#AB0000]",children:i??0}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),g.jsxs("div",{className:"flex-1 py-[12px] bg-[#FFFBF2] h-[76px] rounded",children:[g.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#E7A015]",children:o??0}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#E7A015]",children:"In-progress"})]}),g.jsxs("div",{className:"flex-1 py-[12px] bg-[#F7FEFA] h-[76px] rounded",children:[g.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:a??0}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),g.jsx("div",{className:"mt-4 space-y-2",children:r?.length?r?.map?.((s,l)=>{const c=s?.severity==="Danger"?"text-[#AB0000]":s?.severity==="High"?"text-[#E7A015]":"text-[#1FA05B]";return g.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#FAFBFD] rounded-md",children:[g.jsx("div",{className:"flex items-center gap-[8px]",children:g.jsx("div",{className:"text-gray-700 font-medium",children:s?.incident_code??"-"})}),g.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${c}`,children:g.jsxs("div",{children:[s?.severity_level??"-"," - ",s?.severity??"-"]})})]},l)}):g.jsx("div",{className:"text-center text-gray-400 text-sm py-[24px]",children:"No incidents found"})})]})})}const nde=[{total_staff:42,absent_staff:6}],rde=[{staff_role_name:"Security Guard",total_staff:18,present_staff:16},{staff_role_name:"Supervisor",total_staff:8,present_staff:7},{staff_role_name:"Technician",total_staff:10,present_staff:9},{staff_role_name:"Technician",total_staff:10,present_staff:9}];function ide({staffPresentAbsent:e,staffPresentByRole:t}){const n=Array.isArray(e)&&e.length>0?e:nde,r=Array.isArray(t)&&t.length>0?t:rde,i=n?.[0]?.total_staff??0,o=n?.[0]?.absent_staff??0,a=(i??0)-(o??0);return g.jsx(kt,{title:"Staff Attendance",className:"h-[362px] overflow-hidden ",titleWeight:"semi-bold",children:g.jsxs("div",{children:[g.jsxs("div",{className:"flex gap-[16px] text-center mt-[24px]",children:[g.jsxs("div",{className:"flex-1 py-[12px] bg-[#F7FEFA] rounded h-[76px]",children:[g.jsx("div",{className:"text-[24px] font-medium text-[#1FA05B]",children:a??0}),g.jsx("div",{className:"text-[12px] text-[#1FA05B]",children:"Present"})]}),g.jsxs("div",{className:"flex-1 py-[12px] bg-[#FBF4F4] rounded h-[76px]",children:[g.jsx("div",{className:"text-[24px] font-medium text-[#AB0000]",children:o??0}),g.jsx("div",{className:"text-[12px] text-[#AB0000]",children:"Absent"})]})]}),g.jsx("div",{className:"mt-[24px] pb-[16px] space-y-[8px] overflow-y-auto max-h-[200px] hide-scrollbar",children:r?.length?r?.map?.((s,l)=>{const c=Number(s?.total_staff??0),u=Number(s?.present_staff??0);return g.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#F8FAFC] rounded-md",children:[g.jsx("div",{className:"text-[#121212] text-[14px] leading-[18px] font-medium",children:s?.staff_role_name??"-"}),g.jsxs("div",{className:"text-[14px] leading-[20px] text-[#64748B]",children:[u??0,"/",c??0]})]},l)}):g.jsx(g.Fragment,{})})]})})}function ode(e){return Xe({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M116,132V96a12,12,0,0,1,24,0v36a12,12,0,0,1-24,0Zm12,56a16,16,0,1,0-16-16A16,16,0,0,0,128,188ZM228,56v56c0,54.29-26.32,87.22-48.4,105.29-23.71,19.39-47.44,26-48.44,26.29a12.1,12.1,0,0,1-6.32,0c-1-.28-24.73-6.9-48.44-26.29C54.32,199.22,28,166.29,28,112V56A20,20,0,0,1,48,36H208A20,20,0,0,1,228,56Zm-24,4H52v52c0,35.71,13.09,64.69,38.91,86.15A126.14,126.14,0,0,0,128,219.38a126.28,126.28,0,0,0,37.09-21.23C190.91,176.69,204,147.71,204,112Z"},child:[]}]})(e)}function ade({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=Gl,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return g.jsxs(je,{title:e,icon:g.jsx("div",{className:"h-6 w-6 grid place-items-center",children:g.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[g.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),g.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[g.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),g.jsx("div",{className:"text-slate-500",children:r})]})]})}const sde=[{title:"Total Visitors",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:pg,iconColor:"text-[#329DFF]"},{title:"Active Incidents",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Wie,iconColor:"text-[#F69E0A]"},{title:"Missed Patrols",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:ode,iconColor:"text-[#AB0000]"},{title:"Parking Usage",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:s3,iconColor:"text-[#36AB6C]"}];function lde({data:e}){const t=Array.isArray(e)&&e.length>0?e:sde;return g.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>g.jsx(ade,{...n},r))})}const cde=[{title:"Maintenance",total:12,pending:3},{title:"Security",total:8,pending:1},{title:"Housekeeping",total:6,pending:2},{title:"Utilities",total:10,pending:4}],ude=(e="")=>e.replace(/</g,"<").replace(/>/g,">").replace(/<[^>]*>/g,"").trim();function dde({data:e}){const t=Array.isArray(e?.complaints_by_category)&&e.complaints_by_category.length>0?e.complaints_by_category.map(n=>({title:ude(n.category_name)||"—",total:n.total||0,pending:n.pending||0})):cde;return g.jsx(je,{title:"Complaints",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:g.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>g.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-[8px] p-[12px] h-[62px]",children:[g.jsxs("div",{className:"flex flex-col",children:[g.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),g.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),g.jsxs("div",{className:"flex flex-col items-end",children:[g.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},r))})})}const fde=e=>{const t={0:"𝟎",1:"𝟏",2:"𝟐",3:"𝟑",4:"𝟒",5:"𝟓",6:"𝟔",7:"𝟕",8:"𝟖",9:"𝟗"};return String(e).split("").map(n=>t[n]||n).join("")},pde=[{level:"Level 1",open_count:3,in_progress_count:4,closed_count:5,total:12},{level:"Level 2",open_count:1,in_progress_count:1,closed_count:1,total:3},{level:"Level 3",open_count:5,in_progress_count:2,closed_count:3,total:10}],hde=({active:e,payload:t,label:n})=>{if(!e||!t)return null;const r=[{key:"open_count",label:"Open",color:"#EF4444"},{key:"in_progress_count",label:"In Progress",color:"#F59D0D"},{key:"closed_count",label:"Closed",color:"#12B981"}];return g.jsxs("div",{style:{backgroundColor:"#0B0B0B",padding:"14px 40px 14px 18px",borderRadius:"10px",color:"#ffffff"},children:[g.jsx("div",{style:{color:"#ffffff",fontSize:"12px",fontWeight:"900",marginBottom:"10px"},children:n}),r.map((i,o)=>{const a=t[0]?.payload[i.key]||0,s=fde(a);return g.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:o<r.length-1?"8px":"0",fontSize:"12px"},children:[g.jsx("div",{style:{width:"8px",height:"8px",backgroundColor:i.color,transform:"rotate(45deg)",marginRight:"8px"}}),g.jsx("span",{style:{color:"D1D3D4",minWidth:"100px"},children:i.label}),g.jsx("span",{style:{marginLeft:"auto",fontWeight:"700"},children:s})]},i.key)})]})},mde=()=>{const e=[{label:"Open",color:"#EF4444"},{label:"In Progress",color:"#F59D0D"},{label:"Closed",color:"#12B981"}];return g.jsx("div",{style:{display:"flex",justifyContent:"space-between",gap:"15px"},children:e.map(t=>g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[g.jsx("div",{style:{width:"6px",height:"6px",backgroundColor:t.color,transform:"rotate(45deg)"}}),g.jsx("span",{style:{fontSize:"14px"},children:t.label})]},t.label))})},gde=({data:e})=>{const t=k.useMemo(()=>(Array.isArray(e?.complaints_by_level)&&e.complaints_by_level.some(l=>Number(l.total)>0)?e.complaints_by_level:pde).map(l=>({level:l.level||"—",open_count:Number(l.open_count)||0,in_progress_count:Number(l.in_progress_count)||0,closed_count:Number(l.closed_count)||0,total:Number(l.total)||0})),[e]),n=k.useMemo(()=>Math.max(...t.map(a=>a.total),5),[t]),r=Math.ceil(n*1.2),i=6,o=Math.max(Math.ceil(n/i),1);return g.jsxs(je,{title:"Complaints by Level",className:"w-full h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:[g.jsx(xt,{width:"100%",height:"85%",children:g.jsxs(go,{data:t,margin:{top:5,right:-25,left:-30,bottom:5},children:[g.jsx(Qn,{strokeDasharray:"0",vertical:!1}),g.jsx($n,{dataKey:"level"}),g.jsx(Pn,{domain:[0,r],ticks:Array.from({length:i+1},(a,s)=>s*o)}),g.jsx(Ct,{content:g.jsx(hde,{}),cursor:!1}),g.jsx(Xt,{dataKey:"open_count",stackId:"a",fill:"#EF4444",barSize:44,radius:[0,0,0,0]}),g.jsx(Xt,{dataKey:"in_progress_count",stackId:"a",fill:"#F59D0D",barSize:44,radius:[0,0,0,0]}),g.jsx(Xt,{dataKey:"closed_count",stackId:"a",fill:"#12B981",barSize:44,radius:[0,0,0,0]})]})}),g.jsx(mde,{})]})},vde=[{title:"Maintenance",total:18,pending:4},{title:"Security",total:11,pending:2},{title:"Housekeeping",total:9,pending:3},{title:"Utilities",total:14,pending:5}];function yde({data:e}){const t=Array.isArray(e?.request_box_by_type)&&e.request_box_by_type.length>0?e.request_box_by_type.map(n=>({title:n.category_name||"—",total:Number(n.total)||0,pending:Number(n.pending)||0})):vde;return g.jsx(je,{title:"Request Box",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:g.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>g.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-[8px] p-[12px] h-[62px]",children:[g.jsxs("div",{className:"flex flex-col",children:[g.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),g.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),g.jsxs("div",{className:"flex flex-col items-end",children:[g.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},`${n.title}-${r}`))})})}function bde(e){return Xe({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinejoin:"round",strokeWidth:"32",d:"M416 221.25V416a48 48 0 0 1-48 48H144a48 48 0 0 1-48-48V96a48 48 0 0 1 48-48h98.75a32 32 0 0 1 22.62 9.37l141.26 141.26a32 32 0 0 1 9.37 22.62z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M256 56v120a32 32 0 0 0 32 32h120m-232 80h160m-160 80h160"},child:[]}]})(e)}const xde=["open_complaints","pending_requests","avg_response_time","resolution_rate"],wde={open_complaints:{title:"Open Complaints",Icon:PS,iconColor:"#AB0000",deltaLabel:"Compared to last month"},pending_requests:{title:"Pending Requests",Icon:bde,iconColor:"#E7A015",deltaLabel:"Compared to last month"},avg_response_time:{title:"Avg Response Time",Icon:g3,iconColor:"#1FA05B",deltaLabel:"Compared to last month"},resolution_rate:{title:"Resolution Rate",Icon:f3,iconColor:"#329DFF",deltaLabel:"Compared to last month"}},_de=({children:e,size:t=28,lineHeight:n=32,weight:r=500,color:i="#121212"})=>g.jsx("div",{style:{fontWeight:r,fontSize:`${t}px`,lineHeight:`${n}px`,color:i},children:e}),Sde={primary:{size:28,lineHeight:32,weight:500}},Ede={open_complaints:{current:24,trend_percent:"-8%",direction:"bad"},pending_requests:{current:17,trend_percent:"-5%",direction:"bad"},avg_response_time:{current:"2.4 h",trend_percent:"+6%",direction:"good"},resolution_rate:{current:"89%",trend_percent:"+4%",direction:"good"}};function Ode({id:e,data:t}){return e&&t&&!t[e]&&t.current!==void 0?g.jsx(jI,{id:e,data:t}):g.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[16px]",children:xde.map(n=>g.jsx(jI,{id:n},n))})}function jI({id:e,data:t}){const n=wde[e];if(!n)return null;const r=(d,f)=>f==null?"—":d==="avg_response_time"?typeof f=="number"?`${f} h`:f:d==="resolution_rate"&&typeof f=="number"?`${f}%`:f,{title:i,Icon:o=Gl,iconColor:a,deltaLabel:s}=n,l=t&&Object.keys(t).length>0?t:Ede[e],c=r(e,l?.current),u=l?.trend_percent??"—";return l?.direction==="good"||l?.direction,g.jsx("div",{className:"h-[132px]",children:g.jsxs(je,{title:i,titleColor:a,icon:g.jsx("div",{className:"h-[20px] w-[20px] flex items-center justify-center",children:g.jsx(o,{className:"h-[20px] w-[20px]",style:{color:a}})}),childrenClassName:"!space-y-[12px]",iconClassName:"!gap-[12px]",children:[g.jsx(_de,{...Sde.primary,children:c}),g.jsxs("div",{className:"flex items-center gap-[8px] text-[12px] leading-[16px]",children:[g.jsx(of,{value:u}),g.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:s})]})]})})}const Cde=[{title:"Holi Celebration",date:"25 Jun 2025",rsvp:"78/100",utilisation:71,status:"Upcoming"},{title:"Maintenance Meeting",date:"25 Jun 2025",rsvp:"45/60",utilisation:75,status:"Completed"}];function kde({title:e,date:t,rsvp:n,utilisation:r,status:i}){return g.jsxs("div",{className:" bg-[#F8FAFC] h-[106px] px-[12px] mt-3",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx("div",{className:"text-[16px] leading-[20px] font-semibold text-[#121212]",children:e}),g.jsx("div",{className:`!text-[12px] font-medium leading-[16px] px-[8px] py-[4px] ${i==="Completed"?"text-[#36AB6C] bg-[#E6F7EE]":i==="Upcoming"?"text-[#329DFF] bg-[#E6F2FF]":"text-slate-500 bg-slate-100"}`,children:i})]}),g.jsx("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:t}),g.jsxs("div",{className:"flex justify-between items-center mt-2",children:[g.jsxs("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:[n," RSVP"]}),g.jsxs("div",{className:"text-[#3C82F6] text-[14px] leading-[18px] font-medium",children:[r,"% utilisation"]})]}),g.jsx("div",{className:"w-full bg-[#F8FAFC] h-[6px] rounded mt-2 mb-3",children:g.jsx("div",{className:"h-[6px] rounded bg-[#3C82F6]",style:{width:`${r}%`}})})]})}function Pde({data:e}){const t=Array.isArray(e)?e:Cde;return g.jsx(je,{title:"Events Utilisation",className:"w-full h-[360px] overflow-y-auto hide-scrollbar",children:g.jsx("div",{className:"m-auto",children:t?.length>0?t.map((n,r)=>g.jsx(kde,{...n},`${n.title}-${r}`)):g.jsx("div",{className:"h-full flex items-center justify-center",children:g.jsx(ir,{})})})})}const Dde=[{label:"Active",value:138,subLabel:"3 expiring soon",bgColor:"bg-[#F0FFF7]",textColor:"text-[#1FA05B]"},{label:"Scheduled",value:13,subLabel:"4 this week",bgColor:"bg-[#FFFBF2]",textColor:"text-[#E7A015]"},{label:"Recurring",value:3,subLabel:"All active",bgColor:"bg-[#EDF6FF]",textColor:"text-[#329DFF]"},{label:"Expired",value:7,subLabel:"4 recent",bgColor:"bg-[#F6F6F6]",textColor:"text-[#64748B]"}];function Ade({label:e,value:t,subLabel:n,bgColor:r,textColor:i}){return g.jsxs("div",{className:`rounded-[8px] p-[16px] ${r} h-[124px]`,children:[g.jsx("div",{className:`text-[16px] font-medium ${i} leading-[20px]`,children:e}),g.jsx("div",{className:"mt-4 text-[28px] leading-[32px] font-semibold text-[#121212]",children:t}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-2",children:n})]})}function Tde({data:e}){const t=Array.isArray(e)&&e.length>0?e:Dde;return g.jsx(je,{title:"Notice Board Status",className:"w-full h-[360px]",children:g.jsx("div",{className:"grid grid-cols-2 gap-[16px]",children:t.map((n,r)=>g.jsx(Ade,{...n},`${n.label}-${r}`))})})}function Mde(e){return Xe({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M20 22H4C3.44772 22 3 21.5523 3 21V3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22ZM19 20V4H5V20H19ZM8 9H16V11H8V9ZM8 13H16V15H8V13Z"},child:[]}]})(e)}function Nde({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=Gl,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50",iconUrl:l}){return g.jsx(je,{title:e,icon:g.jsx("div",{className:"grid place-items-center ",children:l?g.jsx("img",{src:l,alt:"icon",className:"h-8 w-8 object-contain"}):g.jsx(o,{className:`h-8 w-8 ${a}`})}),className:"h-[132px]",children:g.jsxs("div",{children:[g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),g.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[g.jsx(of,{value:n}),g.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}function jde({data:e}){const t=[{title:e?.title||"Total Bookings",value:e?.value??0,delta:e?.delta??"0%",deltaLabel:e?.deltaLabel||"Compared to last month",positive:e?.positive??!1,Icon:e?.Icon,iconUrl:e?.iconUrl,iconColor:e?.iconColor||"text-emerald-600",iconBg:e?.iconBg||"bg-emerald-50"}];return g.jsx("div",{className:"h-full",children:t.map((n,r)=>g.jsx(Nde,{...n},r))})}function Ide(e){return Xe({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"},child:[]}]})(e)}function Rde({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=Gl,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return g.jsx(je,{title:e,icon:g.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:g.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:g.jsxs("div",{children:[g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),g.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[g.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),g.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}const Fde=[{title:"Notice",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Mde,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"},{title:"Post",value:83,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:l3,iconColor:"text-[#329DFF]",iconBg:"bg-emerald-50"},{title:"Poll",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:$ie,iconColor:"text-[#FA7E28]",iconBg:"bg-orange-100"},{title:"Poll",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:Ide,iconColor:"text-[#DBB467]",iconBg:"bg-yellow-100"}];function Lde({data:e}){const t=Array.isArray(e)&&e.length>0?e:Fde;return g.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>g.jsx(Rde,{...n},r))})}const II=({value:e=0,total:t=1,colorClass:n="",label:r=""})=>{const i=Number(e)||0,o=Number(t)||1,a=Math.max(0,Math.min(100,i/o*100)),s=n==="bg-[#3C81F6]"?"text-[#8B5CF6]":n==="bg-[#8B5CF6]"?"text-[#12B981]":"text-slate-600";return g.jsxs("div",{className:"flex flex-col items-start",children:[g.jsx("div",{className:"w-2/3 min-w-[80px] h-5 rounded-full overflow-hidden",children:g.jsx("div",{className:`h-[11px] rounded-full ${n||""}`,style:{width:n==="bg-[#12B981]"?`${a+45}%`:`${a}%`}})}),g.jsx("div",{className:`${s} !text-[12px] font-bold mt-1`,children:i??0}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-1",children:r??""})]})},$de=({data:e,occupiedUnits:t=1,EmployeesCount:n=8910,AdminsCount:r=910})=>{const i=e?.total_occupants!==void 0&&e?.total_occupants!==null?Number(e?.total_occupants)||0:Number(t)||0,o=e?.total_members!==void 0&&e?.total_members!==null?Number(e?.total_members)||0:Number(n)||0,a=e?.total_admins!==void 0&&e?.total_admins!==null?Number(e?.total_admins)||0:Number(r)||0,s=(o||0)+(a||0);return g.jsx("div",{children:g.jsxs("div",{className:"bg-white !border-[0.5px] !border-[#EBEBEB] rounded-[12px] shadow-[0_0_12px_0_#EAF2FF] p-[16px] h-[128px]",children:[g.jsxs("div",{className:"flex items-center gap-[12px] h-[20px]",style:{marginBottom:"24px"},children:[g.jsx(pg,{className:"!text-[20px] text-[#329DFF]"}),g.jsx("div",{className:"font-medium text-[#121212] text-[16px] leading-[20px]",children:"Occupancy Overview"})]}),g.jsxs("div",{className:"flex items-start justify-between",children:[g.jsxs("div",{className:"flex flex-col gap-[4px]",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] font-normal",children:"Total Occupants"}),g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:i??0})]}),g.jsxs("div",{className:"flex items-end gap-[4px]",children:[g.jsx(II,{value:o??0,total:s||1,colorClass:"bg-[#3C81F6]",label:(o??0)<=1?"Employee":"Employees"}),g.jsx(II,{value:a??0,total:s||1,colorClass:"bg-[#8B5CF6]",label:(a??0)<=1?"Admin":"Admins"})]})]})]})})};Bn.register(Co,ko,Al,Vr);const Bde=()=>{const t={labels:["HP","Adobe","Anarock","Swiggy","Infosys","Zepto"],datasets:[{data:[2e3,1700,1500,1200,900,800],backgroundColor:["#3C81F6","#3C81F6","#3C81F6","#3C81F6","#3C81F6","#3C81F6"],barThickness:34}]},n={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff",displayColors:!1,callbacks:{label:r=>`Employees: ${r.parsed.y}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B",font:{size:12}}},y:{beginAtZero:!0,min:0,max:2e3,ticks:{stepSize:500,color:"#64748B",callback:r=>r},grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1}}}};return g.jsxs(je,{className:"w-full h-[238px]",title:"Employee Footfall (Static Data)",period:"Today",icon:g.jsx(Lue,{className:"!text-[24px] text-[#8B5CF6]"}),children:[g.jsxs("div",{className:"mb-[10px] mt-[8px] flex flex-col gap-[4px]!",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Employees Inside"}),g.jsx("div",{className:"text-[20px] leading-[24px] font-medium text-[#3C81F6]",children:"7,500"})]}),g.jsx("div",{className:"h-[110px]",children:g.jsx(Tl,{data:t,options:n})})]})},Wde="₹",RI=["bg-blue-500","bg-red-500","bg-purple-700"],fs={title:"Food & Beverages (Static Data)",period:"Today",summary:{totalOrders:247,revenueGenerated:"82K",growthPercentage:8,growthTotalPercentage:0},outlets:[{name:"HP",orders:120,revenue:"45K",percentage:70,color:"bg-[#3C81F6]"},{name:"Adobe",orders:85,revenue:"23K",percentage:50,color:"bg-[#3C81F6]"},{name:"Anarock",orders:42,revenue:"14K",percentage:25,color:"bg-[#3C81F6]"}]};function qh(e,t=null){if(typeof e=="number")return e;if(typeof e=="string"){const n=Number(e.replace("%","").trim());return Number.isNaN(n)?t:n}return t}function FI(e){if(e==null||e==="")return"0";if(typeof e=="number")return MS(e);const t=Number(e);return Number.isNaN(t)?String(e):MS(t)}function zde(e){const t=e?.food_beverage_summary?{title:e?.title,period:e?.period,summary:{totalOrders:e?.food_beverage_summary?.total_orders,revenueGenerated:e?.food_beverage_summary?.revenue_generated,growthPercentage:e?.food_beverage_summary?.growth_percentage??e?.food_beverage_summary?.revenue_growth,growthTotalPercentage:e?.food_beverage_summary?.order_growth,currencyType:e?.food_beverage_summary?.currency_type},outlets:e?.chart_data}:e||{},n=t?.summary||{},i=(Array.isArray(t?.outlets)?t.outlets:[]).map((f,p)=>({name:f?.name||f?.outlet_name||f?.tenant_name||f?.company_name||"Unknown",orders:f?.orders??f?.total_orders??f?.count??0,revenue:f?.revenue??f?.revenue_generated??f?.total_revenue??0,percentage:f?.percentage,color:f?.color||RI[p%RI.length]})),o=n?.totalOrders??n?.orders??fs.summary.totalOrders,a=n?.revenueGenerated??n?.revenue??fs.summary.revenueGenerated,s=qh(n?.growthPercentage??n?.revenueGrowth,fs.summary.growthPercentage),l=qh(n?.growthTotalPercentage??n?.orderGrowth,fs.summary.growthTotalPercentage),c=n?.currencyType||n?.currency||Wde,u=i.reduce((f,p)=>f+(Number(p?.orders)||0),0),d=i.map(f=>({...f,percentage:f?.percentage!==null&&f?.percentage!==void 0?Number(f.percentage)||0:u>0?Math.round((Number(f?.orders)||0)/u*100):0}));return{title:t?.title||fs.title,period:t?.period||fs.period,summary:{totalOrders:o,revenueGenerated:a,growthPercentage:s,growthTotalPercentage:l,currencyType:c},outlets:d.length>0?d:fs.outlets}}function Vde({data:e,title:t,period:n,icon:r}){const i=zde(e),o=t||i.title,a=n||i.period,s=r||g.jsx(Hue,{className:"!text-[24px] text-[#FA7E28]"}),l=i.summary.totalOrders??0,c=FI(i.summary.revenueGenerated),u=qh(i.summary.growthPercentage,0),d=qh(i.summary.growthTotalPercentage,0),f=u>=0,p=d>=0;return g.jsx(je,{className:"h-[324px]",title:o,period:a,icon:s,children:g.jsxs("div",{className:"flex flex-col h-full",children:[g.jsxs("div",{className:"flex gap-[24px]",children:[g.jsxs("div",{className:"w-[65%] flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Orders"}),g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:l}),g.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${p?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[p?g.jsx(Sa,{}):g.jsx(_a,{}),d,"%",g.jsx("span",{children:"from last month"})]})]}),g.jsxs("div",{className:"w-[30%] flex flex-col gap-[8px] ",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] whitespace-nowrap",children:"Revenue Generated"}),g.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF] whitespace-nowrap",children:[i.summary.currencyType," ",c]}),g.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${f?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[f?g.jsx(Sa,{}):g.jsx(_a,{}),u,"%",g.jsx("span",{children:"from last month"})]})]})]}),g.jsx("div",{className:"mt-[16px]",children:i.outlets.map((h,m)=>g.jsxs("div",{className:m===i.outlets.length-1?"":"mb-[16px]",children:[g.jsxs("div",{className:"flex justify-between text-sm mb-[8px]",children:[g.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:h.name}),g.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[g.jsxs("div",{className:"text-[#64748B] inline-block",children:[h.orders," orders"]}),g.jsxs("div",{className:"mx-2 text-[#121212] inline-block",children:[i.summary.currencyType," ",FI(h.revenue)]})]})]}),g.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:g.jsx("div",{className:`h-[11px] rounded-full ${h.color}`,style:{width:`${h.percentage}%`}})})]},`${h.name}-${m}`))})]})})}function Hde({data:e}){const t=e?.amenity_summary?{amenitySummary:{totalBookings:e?.amenity_summary?.total_bookings??0,todayPaidRevenue:e?.amenity_summary?.today_paid_revenue??"0.00",growthPercentage:e?.amenity_summary?.growth_percentage??null,bookingGrowth:e?.amenity_summary?.booking_growth??null,currencyType:e?.amenity_summary?.currency_type??"₹"},chartData:Array.isArray(e?.chart_data)?e.chart_data.map(h=>({facility_name:h?.facility_name,total_bookings:h?.total_bookings??0,paid_revenue:h?.paid_revenue??"0",isPaid:h?.is_paid===!0})):[]}:e||{},n=t?.amenitySummary||{},i=(Array.isArray(t?.chartData)?t.chartData:[]).map(h=>({...h,isPaid:h?.isPaid===!0})),o=i.length>0&&i.every(h=>h?.isPaid===!1),a=n?.totalBookings||0,s=n?.bookingGrowth;let l=0;if(typeof s=="number")l=s;else if(typeof s=="string"){const h=s.replace("%","").trim(),m=Number(h);l=isNaN(m)?0:m}const c=i.reduce((h,m)=>{const v=m?.total_bookings||0;return h+v},0),u=i.map(h=>{const m=h?.total_bookings||0,v=h?.isPaid?`${n?.currencyType||"₹"} ${h?.paid_revenue||"0.00"}`:"",b=c>0?Math.round(m/c*100):0;return{name:h?.facility_name||"Unknown",bookings:m,revenue:v,percentage:b,color:"bg-[#3C81F6]",isPaid:h?.isPaid}}),d=n?.growthPercentage;let f=null;if(typeof d=="number")f=d;else if(typeof d=="string"){const h=d.replace("%","").trim(),m=Number(h);f=isNaN(m)?null:m}const p=f!==null?f>=0:!0;return g.jsx(je,{className:"h-[324px]",title:"Amenities",period:"Today",icon:g.jsx(Yue,{className:"!text-[24px] text-[#8B5CF6]"}),children:g.jsxs("div",{className:"flex flex-col h-full",children:[g.jsxs("div",{className:"flex gap-[24px]",children:[g.jsxs("div",{className:"w-[65%] flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Bookings"}),g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:a}),g.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${l>=0?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[l>=0?g.jsx(Sa,{}):g.jsx(_a,{}),l,"%",g.jsx("span",{children:"from last month"})]})]}),!o&&g.jsxs("div",{className:"w-[25%] flex flex-col gap-[8px] ",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] whitespace-nowrap",children:"Revenue Generated"}),g.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF] whitespace-nowrap",children:[n?.currencyType||"₹"," ",n?.todayPaidRevenue??"0.00"]}),f!==null&&g.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${p?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[p?g.jsx(Sa,{}):g.jsx(_a,{}),f,"%",g.jsx("span",{children:"from last month"})]})]})]}),g.jsx("div",{className:"mt-[16px]",children:u.length>0?u.map((h,m)=>g.jsxs("div",{className:m===u.length-1?"":"mb-[16px]",children:[g.jsxs("div",{className:"flex justify-between text-sm mb-[8px]",children:[g.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:h?.name}),g.jsxs("div",{className:"font-medium text-[12px] leading-[16px]",children:[g.jsxs("div",{className:"text-[#64748B] inline",children:[h?.bookings," ",h?.bookings<=1?"booking":"bookings"]}),h?.isPaid&&g.jsx("div",{className:"mx-2 text-[#121212] inline",children:h?.revenue})]})]}),g.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:g.jsx("div",{className:`h-[11px] rounded-full ${h?.color}`,style:{width:`${h?.percentage}%`}})})]},m)):g.jsx("div",{className:"flex items-center justify-center h-[120px]",children:g.jsx("div",{className:"text-[12px] text-[#94A3B8]",children:"No amenity usage data available"})})})]})})}Bn.register(Co,ko,Al,Vr,ti);function Yde({data:e=[]}){const t=[{level:"L1",open:55,in_progress:22,on_hold:15,closed:6},{level:"L2",open:45,in_progress:25,on_hold:18,closed:5},{level:"L3",open:58,in_progress:23,on_hold:14,closed:6}],n=e.length>0?e:t,r=[],i=[],o=[],a=[],s=[];for(let u=0;u<n.length;u++)r.push(n[u].level),i.push(Number(n[u].open)),o.push(Number(n[u].in_progress)),a.push(Number(n[u].on_hold)),s.push(Number(n[u].cancelled));const l={labels:r,datasets:[{label:"Open",data:i,backgroundColor:"#3B82F6",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"In Progress",data:o,backgroundColor:"#F59E0B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"On-Hold",data:a,backgroundColor:"#64748B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"Cancelled",data:s,backgroundColor:"#FB2C36",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"}]},c={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,pointStyle:"rectRot",padding:20,color:"#64748B"}},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff"}},scales:{x:{stacked:!0,grid:{display:!1},ticks:{color:"#64748B"}},y:{stacked:!0,beginAtZero:!0,grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1},ticks:{color:"#64748B",stepSize:1,precision:0,callback:u=>Math.round(u)}}}};return g.jsx(je,{className:"h-[267px]",title:"Ticket Escalation Levels",period:"Today",icon:g.jsx(p3,{className:"!text-[24px] text-[#3C81F6]"}),children:g.jsx("div",{className:"h-full",children:g.jsx(Tl,{data:l,options:c})})})}const Ude=({active:e,payload:t})=>{if(!e||!t||!t.length)return null;const n=t[0],r=n.payload.color;return g.jsx("div",{style:{backgroundColor:"#000000",color:"#ffffff",padding:"8px 10px",borderRadius:"8px",fontSize:"12px"},children:g.jsxs("div",{className:"flex items-center gap-[8px] font-medium",children:[g.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:r}}),g.jsx("div",{children:n.name}),g.jsx("div",{className:"ml-2",children:n.value})]})})};function Kde({data:e=null}){const n=e||{open:12,on_hold:5,cancelled:3,completed:156,in_progress:8,total_complaints:184},r=a=>{const s=Number(a);return isNaN(s)?0:s},i=[{name:"Completed",value:r(n.completed),color:"#10B981"},{name:"Open",value:r(n.open),color:"#3B82F6"},{name:"In Progress",value:r(n.in_progress),color:"#F59E0B"},{name:"On Hold",value:r(n.on_hold),color:"#6B7280"},{name:"Cancelled",value:r(n.cancelled),color:"#EF4444"}],o=r(n.total_complaints);return g.jsx(je,{className:"h-[267px]",title:"Ticket Status",period:"Today",icon:g.jsx(dg,{className:"!text-[24px] text-[#EF4444]"}),children:g.jsxs("div",{className:"flex h-full items-center gap-[16px]",children:[g.jsxs("div",{className:"w-[202px] h-[170px] relative",children:[g.jsx(xt,{width:"100%",height:"100%",children:g.jsxs(Oi,{children:[g.jsx(Zr,{data:i,innerRadius:55,outerRadius:85,dataKey:"value",stroke:"#FFFFFF",strokeWidth:2,children:i.map((a,s)=>g.jsx(gn,{fill:a.color},s))}),g.jsx(Ct,{content:g.jsx(Ude,{}),wrapperStyle:{zIndex:1e3}})]})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsxs("div",{className:"flex items-baseline text-[18px] leading-[22px] font-medium text-[#121212]",children:[g.jsx("div",{children:r(n.completed)}),g.jsxs("div",{className:"text-[18.18px] leading-[22.22px] text-[#121212]",children:["/",o]})]}),g.jsx("div",{className:"text-[10.1px] leading-[14.14px] text-[#64748B]",children:"Completed"})]})]}),g.jsx("div",{className:"flex-1 space-y-2",children:i.map(a=>g.jsxs("div",{className:"flex items-center justify-between text-[12px] leading-[17px] mt-[12px]",children:[g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("div",{className:"h-[7px] w-[16px]",style:{backgroundColor:a.color}}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]}),g.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px] font-medium",children:a.value})]},a.name))})]})})}const LI={visitorSummary:{totalVisitorsToday:150,peakTime:"2:00 - 4:00PM",peakCount:50,activeWalkins:18,preApprovedCheckins:3},popupData:{walkins:{currently_inside:18,total_visited_today:58},preApproved:{completed_visits:3,total_expected_today:5}},chart_data:[{hour:10,walkins:22,preApproved:30},{hour:12,walkins:15,preApproved:28},{hour:14,walkins:30,preApproved:38},{hour:16,walkins:45,preApproved:50},{hour:18,walkins:25,preApproved:40}]};function qde(e){const t=e>=12?"PM":"AM";let n=e%12;return n===0&&(n=12),`${n} ${t}`}function Gde(e){if(typeof e=="number"&&e>=0&&e<=23)return e;if(typeof e=="string"){const t=e.trim().toUpperCase(),n=t.match(/^(\d{1,2})(?::\d{2})?\s*(AM|PM)$/);if(n){let i=Number(n[1])%12;return n[2]==="PM"&&(i+=12),i}const r=Number(t);if(!Number.isNaN(r)&&r>=0&&r<=23)return r}return null}function Xde(e=[]){return Array.from({length:24},(t,n)=>{const r=e.find(i=>Gde(i?.hour)===n)||{};return{hour:n,time:qde(n),walkins:Number(r?.walkins??0),approved:Number(r?.pre_approved??r?.preApproved??r?.approved??0)}})}function $I({title:e,color:t,rows:n=[],children:r}){const i=g.jsxs("div",{className:"bg-white rounded-[12px] min-w-[260px] p-[16px] border-[0.5px] border-[#EBEBEB] shadow-[0px_0px_12px_0px_#EAF2FF]",children:[g.jsx("div",{className:"flex items-center gap-[8px] font-medium text-[#121212]",children:g.jsx("div",{children:e??""})}),g.jsx("div",{className:"mt-[16px] pt-[16px] border-t border-dashed border-[#EBEBEB] space-y-[16px]",children:n?.map(({label:o,value:a,valueColor:s})=>g.jsxs("div",{className:"flex justify-between text-[14px] leading-[18px]",children:[g.jsx("div",{className:"text-[#64748B]",children:o??""}),g.jsx("div",{className:"font-semibold",style:{color:s||"#121212"},children:a??0})]},o))})]});return g.jsx(bN,{placement:"right-start",interactive:!0,delay:[100,0],offset:[6,0],appendTo:()=>document.body,maxWidth:"none",render:o=>g.jsx("div",{tabIndex:"-1",...o,children:i}),children:r})}function Qde({active:e,payload:t}){return!e||!t?.length?null:g.jsx("div",{className:"rounded-[8px] bg-[#121212] px-[12px] py-[8px] text-[12px] text-white shadow-lg",children:t.map(n=>g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:n.stroke}}),g.jsx("span",{className:"min-w-[82px] text-[#D1D3D4]",children:n.name}),g.jsx("span",{className:"font-semibold",children:n.value})]},n.dataKey))})}function Zde({data:e}){const t=e&&Object.keys(e).length?e:LI,n=t?.visitor_summary?{totalVisitorsToday:t?.visitor_summary?.total_visitors_today??0,peakTime:t?.visitor_summary?.peak_time??"-"}:t?.visitorSummary??{},r=t?.walkins_popup_data?{walkins:{currently_inside:Number(t?.walkins_popup_data?.walkins_inside??0),total_visited_today:Number(t?.walkins_popup_data?.total_walkins??0)},preApproved:{completed_visits:Number(t?.pre_approved_popup_data?.pre_approved_check_ins??0),total_expected_today:Number(t?.pre_approved_popup_data?.total_pre_approved_check_ins??0)}}:t?.popupData??{},i=k.useMemo(()=>{const l=t?.chart_data??[];return Xde(l.length?l:LI.chart_data)},[t]),{yAxisTicks:o,yAxisMax:a}=k.useMemo(()=>{const l=Math.max(...i.map(u=>Math.max(u.walkins,u.approved))),c=l>0?l:5;return{yAxisTicks:[0,Math.ceil(c/2),c],yAxisMax:c}},[i]),s=new Date().toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit",hour12:!0});return g.jsx(je,{className:"h-[377px]",title:"Visitor Updates",period:`Today at ${s}`,icon:g.jsx(ug,{className:"!text-[24px] text-[#8B5CF6]"}),children:g.jsxs("div",{className:"flex flex-col gap-[24px]",children:[g.jsxs("div",{className:"grid grid-cols-2 gap-y-4 gap-x-6",children:[g.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Total Visitors"}),g.jsx("div",{className:"text-[20px] font-medium text-[#08B6D4]",children:n?.totalVisitorsToday??0})]}),g.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Peak Time"}),g.jsx("div",{className:"text-[20px] font-medium text-[#8B5CF6]",children:n?.peakTime??"-"})]}),g.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Active Walk-ins"}),g.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[g.jsx("div",{className:"text-[28px] text-[#1FA05B] leading-[32px]",children:r?.walkins?.currently_inside??0}),g.jsx($I,{title:"Active Walk-ins",color:"text-[#1FA05B]",rows:[{label:"Currently Inside",value:r?.walkins?.currently_inside??0,valueColor:"#1FA05B"},{label:"Total Visited Today",value:r?.walkins?.total_visited_today??0}],children:g.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.walkins?.total_visited_today??0]})})]})]}),g.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Pre-approved Check-ins"}),g.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[g.jsx("div",{className:"text-[28px] text-[#E7A015] leading-[32px]",children:r?.preApproved?.completed_visits??0}),g.jsx($I,{title:"Pre-approved Check-ins",color:"text-[#E7A015]",rows:[{label:"Completed Visits",value:r?.preApproved?.completed_visits??0,valueColor:"#E7A015"},{label:"Total Expected Check-ins Today",value:r?.preApproved?.total_expected_today??0}],children:g.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.preApproved?.total_expected_today??0]})})]})]})]}),g.jsx("div",{className:"w-full h-[149px]",children:g.jsx(xt,{width:"100%",height:"100%",children:g.jsxs($0,{data:i??[],margin:{top:5,right:0,left:0,bottom:-10},children:[g.jsx(Qn,{stroke:"#E5E7EB",strokeDasharray:"4 4",vertical:!1}),g.jsx($n,{dataKey:"time",tickFormatter:(l,c)=>c%4===0?l:"",axisLine:!1,tickLine:!1,tick:{fill:"#121212",fontSize:10,fontWeight:400}}),g.jsx(Pn,{width:24,axisLine:!1,tickLine:!1,allowDecimals:!1,ticks:o,domain:[0,a],tick:{fill:"#64748B",fontSize:10,fontWeight:400}}),g.jsx(Ct,{content:g.jsx(Qde,{})}),g.jsx(Zo,{type:"monotone",dataKey:"walkins",stroke:"#22C55E",strokeWidth:2,dot:!1,name:"Walk-ins",isAnimationActive:!1}),g.jsx(Zo,{type:"monotone",dataKey:"approved",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved",isAnimationActive:!1})]})})})]})})}const Jde=({color:e})=>g.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:e,marginRight:"6px"}}),efe=({active:e,payload:t})=>!e||!t||!t.length?null:g.jsx("div",{className:"bg-black text-white !text-[12px] px-[12px] py-[8px] rounded-[8px] shadow-lg",children:t.map((n,r)=>g.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[g.jsx(Jde,{color:n.color}),n.name,": ",g.jsx("div",{className:"font-semibold",children:n.value})]},r))});function tfe({data:e=null}){const n=e||{card_entry:60,mobile_entry:35,card_exit:15,mobile_exit:10,total:20.3},r=a=>{const s=Number(a);return isNaN(s)?0:s},i=[{name:"Card Entry",value:r(n.card_entry),color:"#329DFF"},{name:"Mobile Entry",value:r(n.mobile_entry),color:"#8B5CF6"},{name:"Card Exit",value:r(n.card_exit),color:"#B1D2F0"},{name:"Mobile Exit",value:r(n.mobile_exit),color:"#DACBFB"}],o=r(n.total);return g.jsx(kt,{className:"h-[362px]",title:"Access Overview",titleWeight:"semi-bold",children:g.jsxs("div",{className:"flex flex-col items-center mt-[16px]",children:[g.jsxs("div",{className:"relative w-[200px] h-[200px]",children:[g.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:g.jsx("div",{className:"w-[130px] h-[130px] rounded-full shadow-[0px_12px_35px_rgba(0,0,0,0.12)]"})}),g.jsx("div",{className:"h-[184px]",children:g.jsx(xt,{width:"100%",height:"100%",children:g.jsxs(Oi,{children:[g.jsx(Zr,{data:i,dataKey:"value",innerRadius:65,outerRadius:90,startAngle:110,endAngle:-250,paddingAngle:2,stroke:"transparent",children:i.map((a,s)=>g.jsx(gn,{fill:a.color},s))}),g.jsx(Ct,{content:g.jsx(efe,{}),wrapperStyle:{zIndex:9999}})]})})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsxs("div",{className:"text-[20px] leading-[24px] font-semibold text-[#121212]",children:[o,"L"]}),g.jsx("div",{className:"text-[10px] leading-[15px] text-[#64748B]",children:"Total Access"})]})]}),g.jsx("div",{className:"mt-[32px] grid grid-cols-2 gap-x-[20px] gap-y-[12px] text-[12px] text-[#94A3B8]",children:i.map(a=>g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("div",{className:"w-[16px] h-[7px] ",style:{backgroundColor:a.color}}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]},a.name))})]})})}function BI({title:e="Access",data:t=[],height:n="h-[362px]"}){const r=i=>i==null?"0":Number(i).toLocaleString();return g.jsx(kt,{className:n,title:e,titleWeight:"semi-bold",children:g.jsxs("div",{className:"rounded-[12px] overflow-hidden mt-[16px]",children:[g.jsxs("div",{className:"grid grid-cols-2 bg-[#F8FAFC] py-[8px] px-[12px] text-[12px] leading-[16px] font-medium text-[#64748B]",children:[g.jsx("div",{children:"Point"}),g.jsx("div",{className:"text-right",children:"Access"})]}),t.map((i,o)=>g.jsxs("div",{className:"grid grid-cols-2 p-[12px] text-[14px] border-t border-[#E2E8F0]",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:i.label}),g.jsx("div",{className:"text-[12px] leading-[16px] text-right font-medium",style:{color:i.color||"#000"},children:r(i.value)})]},o))]})})}function nfe({data:e=[]}){const t=[{name:"Google",value:82e3},{name:"Uber",value:67e3},{name:"ANAROCK",value:6e4},{name:"Flipkart",value:48e3},{name:"HP",value:41e3},{name:"Myntra",value:3e4},{name:"Cloudscape",value:2e4},{name:"Infosys",value:9e3}],n=e.length?e:t,r=o=>o>=1e3?`${o/1e3}K`:o,i=Math.max(...n.map(o=>o.value));return g.jsx(kt,{title:"Access Points Usage",titleWeight:"semi-bold",className:"h-[362px]",children:g.jsx("div",{className:"mt-[24px] h-[270px] w-full",children:g.jsx(xt,{width:"100%",height:"100%",children:g.jsxs(go,{data:n,barSize:60,margin:{top:0,right:0,left:-20,bottom:0},children:[g.jsx(Qn,{strokeDasharray:"8 8",vertical:!1}),g.jsx(_0,{y:0,stroke:"#EBEBEB",strokeDasharray:"0"}),g.jsx($n,{dataKey:"name",tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),g.jsx(Pn,{tickFormatter:r,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),g.jsx(Ct,{cursor:!1}),g.jsx(Xt,{dataKey:"value",barSize:60,children:n.map((o,a)=>g.jsx(gn,{fill:o.value===i?"#3C81F6":"#79ABFF"},`cell-${a}`))})]})})})})}const rfe=({x:e,y:t,payload:n})=>{const r=n.value.split(" ");return g.jsx("g",{transform:`translate(${e},${t})`,children:g.jsx("text",{x:-85,y:0,textAnchor:"start",fill:"#121212",fontSize:14,children:r.map((i,o)=>g.jsx("tspan",{x:-85,dy:o===0?0:16,children:i},o))})})};function ife({data:e=[]}){const t=e&&e.length>0,n=e.map(r=>({name:r.category_name,value:r.total_complaints,color:"#08B6D4"}));return g.jsx(kt,{title:"Tickets per Category",className:"h-[362px]",titleWeight:"semi-bold",childrenClassName:"h-full mt-[24px]!",children:t?g.jsx("div",{className:"w-full h-[262px]",children:g.jsx(xt,{width:"100%",height:"100%",children:g.jsxs(go,{data:n,layout:"vertical",margin:{top:0,right:8,left:-20,bottom:0},children:[g.jsx(Qn,{strokeDasharray:"3 3",horizontal:!1,stroke:"#E5E7EB"}),g.jsx($n,{type:"number",tick:{fill:"#94A3B8",fontSize:12},axisLine:!0,tickLine:!1,tickMargin:10,allowDecimals:!1}),g.jsx(Pn,{type:"category",dataKey:"name",axisLine:!1,tickLine:!1,width:132,tick:g.jsx(rfe,{})}),g.jsx(Ct,{content:g.jsx(Ea,{}),cursor:{fill:"transparent"},position:{x:300,y:0}}),g.jsx(Xt,{dataKey:"value",barSize:36,fill:"#08B6D4"})]})})}):g.jsx(ir,{title:"No Tickets Found",description:"Catch up all the data. Change the date range to see the data."})})}function ofe({icon:e,iconColor:t="#329DFF",title:n,value:r,percentage:i,percentageText:o}){const a=parseFloat(i),s=a>=0,l=s?"#16A34A":"#DC2626";return g.jsxs("div",{className:"relative bg-white !border-[0.5px] !border-[#EBEBEB] !rounded-[12px] !shadow-[0_0_12px_0_#EAF2FF] p-[16px]",children:[g.jsxs("div",{className:"flex items-center gap-[8px]",children:[e&&g.jsx("div",{className:"h-[20px] w-[20px]",style:{color:t,display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsx(e,{className:"h-[20px] w-[20px]"})}),g.jsx("div",{className:"text-[16px] leading-[20px] font-medium text-[#64748B]",children:n})]}),g.jsx("div",{className:"mt-[16px] text-[28px] leading-[32px] font-medium text-[#121212]",children:r}),(i||o)&&g.jsxs("div",{className:"mt-[12px] flex items-center gap-[8px]",children:[i&&g.jsxs("div",{className:"flex items-center gap-[4px] text-[12px] leading-[16px] font-medium",style:{color:l},children:[s?g.jsx(Sa,{}):g.jsx(_a,{}),Math.abs(a),"%"]}),o&&g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:o})]})]})}const afe=({data:e=[],onDateChange:t})=>{const[n,r]=k.useState(new Date),[i,o]=k.useState(!1),s=(v=>{const b=new Date(v);return b.setDate(b.getDate()-6),b})(n),l=v=>{try{return v.toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}catch{return""}},c=v=>{const b=new Date(v),S=new Date(b);S.setDate(S.getDate()-6),t&&t(S.toISOString(),b.toISOString())},u=()=>{const v=new Date(n);v.setDate(v.getDate()-7),r(v),c(v)},d=()=>{const v=new Date(n);v.setDate(v.getDate()+7),r(v),c(v)},f=()=>{o(v=>!v)},p=v=>{const b=v||new Date;r(b),c(b),o(!1)},h=Array.isArray(e)?e:[],m=!h.length||h.every(v=>v.no_of_visitors===0);return g.jsxs(kt,{title:"Weekly Visitor Pattern",period:`${l(s)} - ${l(n)}`,isDateSelector:!0,titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",onPrevClick:u,onNextClick:d,onCalendarClick:f,children:[i&&g.jsx("div",{className:"anarock-datepicker absolute top-[70px] right-[24px] z-50",children:g.jsx(wS,{selected:n,onChange:p,inline:!0,maxDate:new Date,showYearDropdown:!0,scrollableYearDropdown:!0,yearDropdownItemNumber:40})}),m?g.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:g.jsx(ir,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):g.jsx("div",{className:"w-full h-[280px]",children:g.jsx(xt,{width:"100%",height:"100%",children:g.jsxs(MT,{data:h,margin:{top:10,right:-10,left:-10,bottom:0},children:[g.jsx("defs",{children:g.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[g.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),g.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),g.jsx(Qn,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),g.jsx($n,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:v=>new Date(v).toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}),g.jsx(Pn,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),g.jsx(Ct,{cursor:!1,content:({active:v,payload:b,label:S,coordinate:w})=>{if(!v||!b?.length)return null;const x=new Date(S).toLocaleDateString("en-GB",{day:"2-digit",month:"short"}),O=b[0]?.payload===h[h.length-1]?w.x-70:w.x;return g.jsx("div",{style:{position:"absolute",transform:`translate(${O}px, ${w.y-40}px)`,pointerEvents:"none",zIndex:99999},children:g.jsx(Oa,{active:v,payload:b,label:x})})}}),g.jsx(P0,{type:"monotone",dataKey:"no_of_visitors",stroke:"#6366F1",strokeWidth:2,fill:"url(#colorVisitors)",dot:{r:5,stroke:"#6366F1",strokeWidth:2,fill:"#fff"},activeDot:v=>{const{cx:b,cy:S,stroke:w}=v;return g.jsxs("g",{children:[g.jsx("circle",{cx:b,cy:S,r:6,fill:"#fff",stroke:"#6466F1",strokeWidth:2}),g.jsx("circle",{cx:b,cy:S,r:2.5,fill:"#6466F1"})]})}})]})})})]})},sfe=[{building_name:"Google",no_of_visitors:1e3},{building_name:"Uber",no_of_visitors:3500},{building_name:"ANAROCK",no_of_visitors:2e3},{building_name:"Flipkart",no_of_visitors:8e3},{building_name:"HP",no_of_visitors:1650}],lfe=({data:e})=>{const t=Array.isArray(e)&&e?.length===0,n=e==null?sfe:Array.isArray(e)?e:[];return g.jsx(kt,{title:"Organisation Wise Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",children:g.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:t?g.jsx(ir,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."}):g.jsx(xt,{width:"100%",height:"100%",children:g.jsxs(go,{data:n||[],margin:{top:10,right:10,left:10,bottom:-10},barCategoryGap:35,children:[g.jsx(Qn,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),g.jsx($n,{dataKey:"building_name",tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1}),g.jsx(Pn,{width:40,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1}),g.jsx(Ct,{cursor:!1,content:g.jsx(Oa,{})}),g.jsx(Xt,{dataKey:"no_of_visitors",name:"Visitors",maxBarSize:55,fill:"#3C81F6"})]})})})})};function cfe({data:e}){return g.jsx("div",{className:"h-full",children:e.map((t,n)=>{const r=parseFloat(t.delta),i=r>=0;return g.jsx(je,{iconClassName:"!gap-[8px]",title:g.jsx("div",{className:"text-[#64748B]",children:t.title}),icon:g.jsx(t.Icon,{className:"h-[20px] w-[20px]",style:{color:t.iconColor||"#000000"}}),className:`${t?.widget==="amenities"?"h-[139px]":"h-[124px]"}`,children:g.jsxs("div",{className:`flex flex-col gap-[8px] ${t?.widget==="amenities"?"mt-[3.5px]":"mt-0"}`,children:[g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t.value}),g.jsxs("div",{className:`flex items-center pt-[8px] text-[12px] leading-[16px] ${t.delta?"gap-[8px]":""}`,children:[t.delta&&g.jsxs("div",{className:`flex items-center gap-[4px] px-[6px] py-[2px] rounded-[4px] font-medium
|
|
372
|
+
*/const Yue=Ii("waves-ladder",[["path",{d:"M19 5a2 2 0 0 0-2 2v11",key:"s41o68"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}],["path",{d:"M7 13h10",key:"1rwob1"}],["path",{d:"M7 9h10",key:"12czzb"}],["path",{d:"M9 5a2 2 0 0 0-2 2v11",key:"x0q4gh"}]]),kt=({title:e,icon:t,period:n,isDateSelector:r=!1,children:i,footer:o,className:a="",titleWeight:s,titleColor:l,iconClassName:c,titleClassName:u,childrenClassName:d,rightContent:f,onCalendarClick:p,onPrevClick:h,onNextClick:m})=>{const v=s==="semi-bold"?600:500;return g.jsxs("div",{className:`relative bg-white p-[24px] !border-[0.5px] !border-[#EBEBEB] !rounded-[12px] !shadow-[0_0_12px_0_#EAF2FF] ${a}`,children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{className:"flex items-center gap-[8px]",children:[t&&g.jsx("div",{className:c,children:t}),g.jsx("div",{style:{fontWeight:v,color:l||"#121212"},className:u||"text-[20px] leading-[24px]",children:e})]}),g.jsxs("div",{className:"flex items-center gap-[12px]",children:[f&&f,n&&!r&&g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:n}),r&&g.jsxs("div",{className:"flex items-center gap-[12px] px-[16px] py-[8px] rounded-[8px] bg-white text-sm text-[#64748B]",children:[g.jsx($ue,{size:16,className:"text-[#64748B] cursor-pointer",onClick:p}),g.jsx(MI,{size:16,className:"cursor-pointer",onClick:h}),g.jsx("span",{className:"text-[12px] leading-[16px] text-[#64748B]",children:n}),g.jsx(NI,{size:16,className:"cursor-pointer",onClick:m})]})]})]}),g.jsx("div",{className:`flex-1 min-h-0 mt-4 ${d}`,children:i}),o&&g.jsx("div",{className:"mt-4 pt-4 border-t border-gray-100 text-[12px] text-[#64748B]",children:o})]})},Uue={completed:18,not_completed:6,missed:4};function Kue({data:e={}}){const t=e&&Object.keys(e).length>0?e:Uue,n=[{name:"Completed",value:Number(t?.completed??0),color:"#12B981"},{name:"Delayed",value:Number(t?.not_completed??0),color:"#EF4444"},{name:"Missed",value:Number(t?.missed??0),color:"#F69E0A"}],r=Number(t?.completed??0)+Number(t?.not_completed??0)+Number(t?.missed??0),i=Number(t?.completed??0);return g.jsx(kt,{title:"Guard Patrols",className:"h-[362px]",titleWeight:"semi-bold",children:g.jsxs("div",{className:"flex flex-col items-center justify-center",children:[g.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[g.jsx(xt,{width:"100%",height:"100%",children:g.jsxs(Oi,{children:[g.jsx(Zr,{data:n??[],innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:n?.map?.((o,a)=>g.jsx(gn,{fill:o?.color??"#ccc"},`cell-${a}`))}),g.jsx(Ct,{content:g.jsx(DI,{})})]})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[i??0,"/",r??0]}),g.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),g.jsx("div",{className:"flex flex-col w-full text-[14px]",children:n?.length?n?.map?.((o,a)=>g.jsxs("div",{className:`flex items-center justify-between py-[10px] ${a!==(n?.length??0)-1?"border-b border-[#F1F5F9]":""}`,children:[g.jsxs("div",{className:"flex items-center gap-[10px]",children:[g.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:o?.color??"#ccc"}}),g.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:o?.name??"-"})]}),g.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:o?.value??0})]},o?.name??a)):g.jsx("div",{className:"text-center text-gray-400 text-sm py-[24px]",children:"No patrol data"})})]})})}Bn.register(Co,ko,i1,r1,Vr,ti);const que=["10 AM","12 PM","2 PM","4 PM","6 PM","8 PM","10 PM"],Kh={guest:[9,5,12,7,3,6,4],cab:[15,12,10,14,7,12,8],delivery:[22,18,16,20,22,14,17],service:[13,12,8,9,5,10,7]},Gue=[{key:"Guest",datasetIndex:0,color:"#EF4444"},{key:"Cab",datasetIndex:1,color:"#7C3AED"},{key:"Delivery",datasetIndex:2,color:"#10B981"},{key:"Service",datasetIndex:3,color:"#F59E0B"}],Xue=({color:e,size:t=12})=>g.jsx("svg",{width:t,height:t,viewBox:"0 0 12 12",style:{display:"block",flexShrink:0},children:g.jsx("rect",{x:"1",y:"1",width:"10",height:"10",rx:"0",fill:e,transform:"rotate(45 6 6)"})}),Que=({chartRef:e})=>{const[t,n]=k.useState({}),r=i=>{const o=e.current;if(!o)return;const a=o.getDatasetMeta(i),s=!!a.hidden;a.hidden=!s,o.update(),n(l=>({...l,[i]:!s}))};return g.jsx("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"76px",marginTop:"10px",paddingBottom:"8px",flexWrap:"wrap"},children:Gue.map(({key:i,datasetIndex:o,color:a})=>{const s=!!t[o];return g.jsxs("div",{onClick:()=>r(o),style:{display:"flex",alignItems:"center",gap:"6px",cursor:"pointer",userSelect:"none",opacity:s?.45:1,transition:"opacity 0.2s ease"},children:[g.jsx(Xue,{color:a,size:12}),g.jsx("span",{style:{fontSize:"13px",color:"#64748B",fontWeight:400,lineHeight:1,textDecoration:s?"line-through":"none",transition:"text-decoration 0.15s ease"},children:i})]},i)})})},Zue=({data:e})=>{const t=k.useRef(null),r={labels:Array.isArray(e?.labels)&&e.labels.length>0?e.labels:que,datasets:[{label:"Guest",data:Array.isArray(e?.guest)&&e.guest.length>0?e.guest:Kh.guest,borderColor:"#EF4444",backgroundColor:"rgba(239,68,68,0.15)",pointBackgroundColor:"#EF4444",pointStyle:"rectRot",fill:!1},{label:"Cab",data:Array.isArray(e?.cab)&&e.cab.length>0?e.cab:Kh.cab,borderColor:"#7C3AED",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#7C3AED",pointStyle:"rectRot",fill:!1},{label:"Delivery",data:Array.isArray(e?.delivery)&&e.delivery.length>0?e.delivery:Kh.delivery,borderColor:"#10B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#10B981",pointStyle:"rectRot",fill:!1},{label:"Service",data:Array.isArray(e?.service)&&e.service.length>0?e.service:Kh.service,borderColor:"#F59E0B",backgroundColor:"rgba(245,158,11,0.15)",pointBackgroundColor:"#F59E0B",pointStyle:"rectRot",fill:!1}]},i={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:o=>o[0].label,label:o=>`${o.dataset.label} ${o.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return g.jsxs(je,{title:"Hourly Traffic Flow",className:"w-full h-[362px]",children:[g.jsx("div",{style:{height:"calc(100% - 44px)",width:"100%"},children:g.jsx(l1,{ref:t,data:r,options:i})}),g.jsx(Que,{chartRef:t})]})},Jue={open:4,in_progress:7,closed:12},ede=[{incident_code:"INC-401",severity_level:"L1",severity:"Danger"},{incident_code:"INC-402",severity_level:"L2",severity:"High"},{incident_code:"INC-403",severity_level:"L3",severity:"Low"}];function tde({incidentReports:e={},incidentReportsDetails:t=[]}){const n=e&&Object.keys(e).length>0?e:Jue,r=Array.isArray(t)?t:ede,i=Number(n?.open??0),o=Number(n?.in_progress??0),a=Number(n?.closed??0);return g.jsx(kt,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:g.jsxs("div",{children:[g.jsxs("div",{className:"flex w-full text-center gap-[24px]",children:[g.jsxs("div",{className:"flex-1 py-[12px] bg-[#FBF4F4] h-[76px] rounded",children:[g.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#AB0000]",children:i??0}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),g.jsxs("div",{className:"flex-1 py-[12px] bg-[#FFFBF2] h-[76px] rounded",children:[g.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#E7A015]",children:o??0}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#E7A015]",children:"In-progress"})]}),g.jsxs("div",{className:"flex-1 py-[12px] bg-[#F7FEFA] h-[76px] rounded",children:[g.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:a??0}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),g.jsx("div",{className:"mt-4 space-y-2",children:r?.length?r?.map?.((s,l)=>{const c=s?.severity==="Danger"?"text-[#AB0000]":s?.severity==="High"?"text-[#E7A015]":"text-[#1FA05B]";return g.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#FAFBFD] rounded-md",children:[g.jsx("div",{className:"flex items-center gap-[8px]",children:g.jsx("div",{className:"text-gray-700 font-medium",children:s?.incident_code??"-"})}),g.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${c}`,children:g.jsxs("div",{children:[s?.severity_level??"-"," - ",s?.severity??"-"]})})]},l)}):g.jsx("div",{className:"text-center text-gray-400 text-sm py-[24px]",children:"No incidents found"})})]})})}const nde=[{total_staff:42,absent_staff:6}],rde=[{staff_role_name:"Security Guard",total_staff:18,present_staff:16},{staff_role_name:"Supervisor",total_staff:8,present_staff:7},{staff_role_name:"Technician",total_staff:10,present_staff:9},{staff_role_name:"Technician",total_staff:10,present_staff:9}];function ide({staffPresentAbsent:e,staffPresentByRole:t}){const n=Array.isArray(e)&&e.length>0?e:nde,r=Array.isArray(t)&&t.length>0?t:rde,i=n?.[0]?.total_staff??0,o=n?.[0]?.absent_staff??0,a=(i??0)-(o??0);return g.jsx(kt,{title:"Staff Attendance",className:"h-[362px] overflow-hidden ",titleWeight:"semi-bold",children:g.jsxs("div",{children:[g.jsxs("div",{className:"flex gap-[16px] text-center mt-[24px]",children:[g.jsxs("div",{className:"flex-1 py-[12px] bg-[#F7FEFA] rounded h-[76px]",children:[g.jsx("div",{className:"text-[24px] font-medium text-[#1FA05B]",children:a??0}),g.jsx("div",{className:"text-[12px] text-[#1FA05B]",children:"Present"})]}),g.jsxs("div",{className:"flex-1 py-[12px] bg-[#FBF4F4] rounded h-[76px]",children:[g.jsx("div",{className:"text-[24px] font-medium text-[#AB0000]",children:o??0}),g.jsx("div",{className:"text-[12px] text-[#AB0000]",children:"Absent"})]})]}),g.jsx("div",{className:"mt-[24px] pb-[16px] space-y-[8px] overflow-y-auto max-h-[200px] hide-scrollbar",children:r?.length?r?.map?.((s,l)=>{const c=Number(s?.total_staff??0),u=Number(s?.present_staff??0);return g.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#F8FAFC] rounded-md",children:[g.jsx("div",{className:"text-[#121212] text-[14px] leading-[18px] font-medium",children:s?.staff_role_name??"-"}),g.jsxs("div",{className:"text-[14px] leading-[20px] text-[#64748B]",children:[u??0,"/",c??0]})]},l)}):g.jsx(g.Fragment,{})})]})})}function ode(e){return Xe({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M116,132V96a12,12,0,0,1,24,0v36a12,12,0,0,1-24,0Zm12,56a16,16,0,1,0-16-16A16,16,0,0,0,128,188ZM228,56v56c0,54.29-26.32,87.22-48.4,105.29-23.71,19.39-47.44,26-48.44,26.29a12.1,12.1,0,0,1-6.32,0c-1-.28-24.73-6.9-48.44-26.29C54.32,199.22,28,166.29,28,112V56A20,20,0,0,1,48,36H208A20,20,0,0,1,228,56Zm-24,4H52v52c0,35.71,13.09,64.69,38.91,86.15A126.14,126.14,0,0,0,128,219.38a126.28,126.28,0,0,0,37.09-21.23C190.91,176.69,204,147.71,204,112Z"},child:[]}]})(e)}function ade({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=Gl,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return g.jsxs(je,{title:e,icon:g.jsx("div",{className:"h-6 w-6 grid place-items-center",children:g.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[g.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),g.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[g.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),g.jsx("div",{className:"text-slate-500",children:r})]})]})}const sde=[{title:"Total Visitors",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:pg,iconColor:"text-[#329DFF]"},{title:"Active Incidents",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Wie,iconColor:"text-[#F69E0A]"},{title:"Missed Patrols",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:ode,iconColor:"text-[#AB0000]"},{title:"Parking Usage",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:s3,iconColor:"text-[#36AB6C]"}];function lde({data:e}){const t=Array.isArray(e)&&e.length>0?e:sde;return g.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>g.jsx(ade,{...n},r))})}const cde=[{title:"Maintenance",total:12,pending:3},{title:"Security",total:8,pending:1},{title:"Housekeeping",total:6,pending:2},{title:"Utilities",total:10,pending:4}],ude=(e="")=>e.replace(/</g,"<").replace(/>/g,">").replace(/<[^>]*>/g,"").trim();function dde({data:e}){const t=Array.isArray(e?.complaints_by_category)&&e.complaints_by_category.length>0?e.complaints_by_category.map(n=>({title:ude(n.category_name)||"—",total:n.total||0,pending:n.pending||0})):cde;return g.jsx(je,{title:"Complaints",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:g.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>g.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-[8px] p-[12px] h-[62px]",children:[g.jsxs("div",{className:"flex flex-col",children:[g.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),g.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),g.jsxs("div",{className:"flex flex-col items-end",children:[g.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},r))})})}const fde=e=>{const t={0:"𝟎",1:"𝟏",2:"𝟐",3:"𝟑",4:"𝟒",5:"𝟓",6:"𝟔",7:"𝟕",8:"𝟖",9:"𝟗"};return String(e).split("").map(n=>t[n]||n).join("")},pde=[{level:"Level 1",open_count:3,in_progress_count:4,closed_count:5,total:12},{level:"Level 2",open_count:1,in_progress_count:1,closed_count:1,total:3},{level:"Level 3",open_count:5,in_progress_count:2,closed_count:3,total:10}],hde=({active:e,payload:t,label:n})=>{if(!e||!t)return null;const r=[{key:"open_count",label:"Open",color:"#EF4444"},{key:"in_progress_count",label:"In Progress",color:"#F59D0D"},{key:"closed_count",label:"Closed",color:"#12B981"}];return g.jsxs("div",{style:{backgroundColor:"#0B0B0B",padding:"14px 40px 14px 18px",borderRadius:"10px",color:"#ffffff"},children:[g.jsx("div",{style:{color:"#ffffff",fontSize:"12px",fontWeight:"900",marginBottom:"10px"},children:n}),r.map((i,o)=>{const a=t[0]?.payload[i.key]||0,s=fde(a);return g.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:o<r.length-1?"8px":"0",fontSize:"12px"},children:[g.jsx("div",{style:{width:"8px",height:"8px",backgroundColor:i.color,transform:"rotate(45deg)",marginRight:"8px"}}),g.jsx("span",{style:{color:"D1D3D4",minWidth:"100px"},children:i.label}),g.jsx("span",{style:{marginLeft:"auto",fontWeight:"700"},children:s})]},i.key)})]})},mde=()=>{const e=[{label:"Open",color:"#EF4444"},{label:"In Progress",color:"#F59D0D"},{label:"Closed",color:"#12B981"}];return g.jsx("div",{style:{display:"flex",justifyContent:"space-between",gap:"15px"},children:e.map(t=>g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[g.jsx("div",{style:{width:"6px",height:"6px",backgroundColor:t.color,transform:"rotate(45deg)"}}),g.jsx("span",{style:{fontSize:"14px"},children:t.label})]},t.label))})},gde=({data:e})=>{const t=k.useMemo(()=>(Array.isArray(e?.complaints_by_level)&&e.complaints_by_level.some(l=>Number(l.total)>0)?e.complaints_by_level:pde).map(l=>({level:l.level||"—",open_count:Number(l.open_count)||0,in_progress_count:Number(l.in_progress_count)||0,closed_count:Number(l.closed_count)||0,total:Number(l.total)||0})),[e]),n=k.useMemo(()=>Math.max(...t.map(a=>a.total),5),[t]),r=Math.ceil(n*1.2),i=6,o=Math.max(Math.ceil(n/i),1);return g.jsxs(je,{title:"Complaints by Level",className:"w-full h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:[g.jsx(xt,{width:"100%",height:"85%",children:g.jsxs(go,{data:t,margin:{top:5,right:-25,left:-30,bottom:5},children:[g.jsx(Qn,{strokeDasharray:"0",vertical:!1}),g.jsx($n,{dataKey:"level"}),g.jsx(Pn,{domain:[0,r],ticks:Array.from({length:i+1},(a,s)=>s*o)}),g.jsx(Ct,{content:g.jsx(hde,{}),cursor:!1}),g.jsx(Xt,{dataKey:"open_count",stackId:"a",fill:"#EF4444",barSize:44,radius:[0,0,0,0]}),g.jsx(Xt,{dataKey:"in_progress_count",stackId:"a",fill:"#F59D0D",barSize:44,radius:[0,0,0,0]}),g.jsx(Xt,{dataKey:"closed_count",stackId:"a",fill:"#12B981",barSize:44,radius:[0,0,0,0]})]})}),g.jsx(mde,{})]})},vde=[{title:"Maintenance",total:18,pending:4},{title:"Security",total:11,pending:2},{title:"Housekeeping",total:9,pending:3},{title:"Utilities",total:14,pending:5}];function yde({data:e}){const t=Array.isArray(e?.request_box_by_type)&&e.request_box_by_type.length>0?e.request_box_by_type.map(n=>({title:n.category_name||"—",total:Number(n.total)||0,pending:Number(n.pending)||0})):vde;return g.jsx(je,{title:"Request Box",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:g.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>g.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-[8px] p-[12px] h-[62px]",children:[g.jsxs("div",{className:"flex flex-col",children:[g.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),g.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),g.jsxs("div",{className:"flex flex-col items-end",children:[g.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},`${n.title}-${r}`))})})}function bde(e){return Xe({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinejoin:"round",strokeWidth:"32",d:"M416 221.25V416a48 48 0 0 1-48 48H144a48 48 0 0 1-48-48V96a48 48 0 0 1 48-48h98.75a32 32 0 0 1 22.62 9.37l141.26 141.26a32 32 0 0 1 9.37 22.62z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M256 56v120a32 32 0 0 0 32 32h120m-232 80h160m-160 80h160"},child:[]}]})(e)}const xde=["open_complaints","pending_requests","avg_response_time","resolution_rate"],wde={open_complaints:{title:"Open Complaints",Icon:PS,iconColor:"#AB0000",deltaLabel:"Compared to last month"},pending_requests:{title:"Pending Requests",Icon:bde,iconColor:"#E7A015",deltaLabel:"Compared to last month"},avg_response_time:{title:"Avg Response Time",Icon:g3,iconColor:"#1FA05B",deltaLabel:"Compared to last month"},resolution_rate:{title:"Resolution Rate",Icon:f3,iconColor:"#329DFF",deltaLabel:"Compared to last month"}},_de=({children:e,size:t=28,lineHeight:n=32,weight:r=500,color:i="#121212"})=>g.jsx("div",{style:{fontWeight:r,fontSize:`${t}px`,lineHeight:`${n}px`,color:i},children:e}),Sde={primary:{size:28,lineHeight:32,weight:500}},Ede={open_complaints:{current:24,trend_percent:"-8%",direction:"bad"},pending_requests:{current:17,trend_percent:"-5%",direction:"bad"},avg_response_time:{current:"2.4 h",trend_percent:"+6%",direction:"good"},resolution_rate:{current:"89%",trend_percent:"+4%",direction:"good"}};function Ode({id:e,data:t}){return e&&t&&!t[e]&&t.current!==void 0?g.jsx(jI,{id:e,data:t}):g.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[16px]",children:xde.map(n=>g.jsx(jI,{id:n},n))})}function jI({id:e,data:t}){const n=wde[e];if(!n)return null;const r=(d,f)=>f==null?"—":d==="avg_response_time"?typeof f=="number"?`${f} h`:f:d==="resolution_rate"&&typeof f=="number"?`${f}%`:f,{title:i,Icon:o=Gl,iconColor:a,deltaLabel:s}=n,l=t&&Object.keys(t).length>0?t:Ede[e],c=r(e,l?.current),u=l?.trend_percent??"—";return l?.direction==="good"||l?.direction,g.jsx("div",{className:"h-[132px]",children:g.jsxs(je,{title:i,titleColor:a,icon:g.jsx("div",{className:"h-[20px] w-[20px] flex items-center justify-center",children:g.jsx(o,{className:"h-[20px] w-[20px]",style:{color:a}})}),childrenClassName:"!space-y-[12px]",iconClassName:"!gap-[12px]",children:[g.jsx(_de,{...Sde.primary,children:c}),g.jsxs("div",{className:"flex items-center gap-[8px] text-[12px] leading-[16px]",children:[g.jsx(of,{value:u}),g.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:s})]})]})})}const Cde=[{title:"Holi Celebration",date:"25 Jun 2025",rsvp:"78/100",utilisation:71,status:"Upcoming"},{title:"Maintenance Meeting",date:"25 Jun 2025",rsvp:"45/60",utilisation:75,status:"Completed"}];function kde({title:e,date:t,rsvp:n,utilisation:r,status:i}){return g.jsxs("div",{className:" bg-[#F8FAFC] h-[106px] px-[12px] mt-3",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx("div",{className:"text-[16px] leading-[20px] font-semibold text-[#121212]",children:e}),g.jsx("div",{className:`!text-[12px] font-medium leading-[16px] px-[8px] py-[4px] ${i==="Completed"?"text-[#36AB6C] bg-[#E6F7EE]":i==="Upcoming"?"text-[#329DFF] bg-[#E6F2FF]":"text-slate-500 bg-slate-100"}`,children:i})]}),g.jsx("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:t}),g.jsxs("div",{className:"flex justify-between items-center mt-2",children:[g.jsxs("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:[n," RSVP"]}),g.jsxs("div",{className:"text-[#3C82F6] text-[14px] leading-[18px] font-medium",children:[r,"% utilisation"]})]}),g.jsx("div",{className:"w-full bg-[#F8FAFC] h-[6px] rounded mt-2 mb-3",children:g.jsx("div",{className:"h-[6px] rounded bg-[#3C82F6]",style:{width:`${r}%`}})})]})}function Pde({data:e}){const t=Array.isArray(e)?e:Cde;return g.jsx(je,{title:"Events Utilisation",className:"w-full h-[360px] overflow-y-auto hide-scrollbar",children:g.jsx("div",{className:"m-auto",children:t?.length>0?t.map((n,r)=>g.jsx(kde,{...n},`${n.title}-${r}`)):g.jsx("div",{className:"h-full flex items-center justify-center",children:g.jsx(ir,{})})})})}const Dde=[{label:"Active",value:138,subLabel:"3 expiring soon",bgColor:"bg-[#F0FFF7]",textColor:"text-[#1FA05B]"},{label:"Scheduled",value:13,subLabel:"4 this week",bgColor:"bg-[#FFFBF2]",textColor:"text-[#E7A015]"},{label:"Recurring",value:3,subLabel:"All active",bgColor:"bg-[#EDF6FF]",textColor:"text-[#329DFF]"},{label:"Expired",value:7,subLabel:"4 recent",bgColor:"bg-[#F6F6F6]",textColor:"text-[#64748B]"}];function Ade({label:e,value:t,subLabel:n,bgColor:r,textColor:i}){return g.jsxs("div",{className:`rounded-[8px] p-[16px] ${r} h-[124px]`,children:[g.jsx("div",{className:`text-[16px] font-medium ${i} leading-[20px]`,children:e}),g.jsx("div",{className:"mt-4 text-[28px] leading-[32px] font-semibold text-[#121212]",children:t}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-2",children:n})]})}function Tde({data:e}){const t=Array.isArray(e)&&e.length>0?e:Dde;return g.jsx(je,{title:"Notice Board Status",className:"w-full h-[360px]",children:g.jsx("div",{className:"grid grid-cols-2 gap-[16px]",children:t.map((n,r)=>g.jsx(Ade,{...n},`${n.label}-${r}`))})})}function Mde(e){return Xe({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M20 22H4C3.44772 22 3 21.5523 3 21V3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22ZM19 20V4H5V20H19ZM8 9H16V11H8V9ZM8 13H16V15H8V13Z"},child:[]}]})(e)}function Nde({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=Gl,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50",iconUrl:l}){return g.jsx(je,{title:e,icon:g.jsx("div",{className:"grid place-items-center ",children:l?g.jsx("img",{src:l,alt:"icon",className:"h-8 w-8 object-contain"}):g.jsx(o,{className:`h-8 w-8 ${a}`})}),className:"h-[132px]",children:g.jsxs("div",{children:[g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),g.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[g.jsx(of,{value:n}),g.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}function jde({data:e}){const t=[{title:e?.title||"Total Bookings",value:e?.value??0,delta:e?.delta??"0%",deltaLabel:e?.deltaLabel||"Compared to last month",positive:e?.positive??!1,Icon:e?.Icon,iconUrl:e?.iconUrl,iconColor:e?.iconColor||"text-emerald-600",iconBg:e?.iconBg||"bg-emerald-50"}];return g.jsx("div",{className:"h-full",children:t.map((n,r)=>g.jsx(Nde,{...n},r))})}function Ide(e){return Xe({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"},child:[]}]})(e)}function Rde({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=Gl,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return g.jsx(je,{title:e,icon:g.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:g.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:g.jsxs("div",{children:[g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),g.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[g.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),g.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}const Fde=[{title:"Notice",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Mde,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"},{title:"Post",value:83,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:l3,iconColor:"text-[#329DFF]",iconBg:"bg-emerald-50"},{title:"Poll",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:$ie,iconColor:"text-[#FA7E28]",iconBg:"bg-orange-100"},{title:"Poll",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:Ide,iconColor:"text-[#DBB467]",iconBg:"bg-yellow-100"}];function Lde({data:e}){const t=Array.isArray(e)&&e.length>0?e:Fde;return g.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>g.jsx(Rde,{...n},r))})}const II=({value:e=0,total:t=1,colorClass:n="",label:r=""})=>{const i=Number(e)||0,o=Number(t)||1,a=Math.max(0,Math.min(100,i/o*100)),s=n==="bg-[#3C81F6]"?"text-[#8B5CF6]":n==="bg-[#8B5CF6]"?"text-[#12B981]":"text-slate-600";return g.jsxs("div",{className:"flex flex-col items-start",children:[g.jsx("div",{className:"w-2/3 min-w-[80px] h-5 rounded-full overflow-hidden",children:g.jsx("div",{className:`h-[11px] rounded-full ${n||""}`,style:{width:n==="bg-[#12B981]"?`${a+45}%`:`${a}%`}})}),g.jsx("div",{className:`${s} !text-[12px] font-bold mt-1`,children:i??0}),g.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-1",children:r??""})]})},$de=({data:e,occupiedUnits:t=1,EmployeesCount:n=8910,AdminsCount:r=910})=>{const i=e?.total_occupants!==void 0&&e?.total_occupants!==null?Number(e?.total_occupants)||0:Number(t)||0,o=e?.total_members!==void 0&&e?.total_members!==null?Number(e?.total_members)||0:Number(n)||0,a=e?.total_admins!==void 0&&e?.total_admins!==null?Number(e?.total_admins)||0:Number(r)||0,s=(o||0)+(a||0);return g.jsx("div",{children:g.jsxs("div",{className:"bg-white !border-[0.5px] !border-[#EBEBEB] rounded-[12px] shadow-[0_0_12px_0_#EAF2FF] p-[16px] h-[128px]",children:[g.jsxs("div",{className:"flex items-center gap-[12px] h-[20px]",style:{marginBottom:"24px"},children:[g.jsx(pg,{className:"!text-[20px] text-[#329DFF]"}),g.jsx("div",{className:"font-medium text-[#121212] text-[16px] leading-[20px]",children:"Occupancy Overview"})]}),g.jsxs("div",{className:"flex items-start justify-between",children:[g.jsxs("div",{className:"flex flex-col gap-[4px]",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] font-normal",children:"Total Occupants"}),g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:i??0})]}),g.jsxs("div",{className:"flex items-end gap-[4px]",children:[g.jsx(II,{value:o??0,total:s||1,colorClass:"bg-[#3C81F6]",label:(o??0)<=1?"Employee":"Employees"}),g.jsx(II,{value:a??0,total:s||1,colorClass:"bg-[#8B5CF6]",label:(a??0)<=1?"Admin":"Admins"})]})]})]})})};Bn.register(Co,ko,Al,Vr);const Bde=()=>{const t={labels:["HP","Adobe","Anarock","Swiggy","Infosys","Zepto"],datasets:[{data:[2e3,1700,1500,1200,900,800],backgroundColor:["#3C81F6","#3C81F6","#3C81F6","#3C81F6","#3C81F6","#3C81F6"],barThickness:34}]},n={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff",displayColors:!1,callbacks:{label:r=>`Employees: ${r.parsed.y}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B",font:{size:12}}},y:{beginAtZero:!0,min:0,max:2e3,ticks:{stepSize:500,color:"#64748B",callback:r=>r},grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1}}}};return g.jsxs(je,{className:"w-full h-[238px]",title:"Employee Footfall (Static Data)",period:"Today",icon:g.jsx(Lue,{className:"!text-[24px] text-[#8B5CF6]"}),children:[g.jsxs("div",{className:"mb-[10px] mt-[8px] flex flex-col gap-[4px]!",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Employees Inside"}),g.jsx("div",{className:"text-[20px] leading-[24px] font-medium text-[#3C81F6]",children:"7,500"})]}),g.jsx("div",{className:"h-[110px]",children:g.jsx(Tl,{data:t,options:n})})]})},Wde="₹",RI=["bg-blue-500","bg-red-500","bg-purple-700"],fs={title:"Food & Beverages (Static Data)",period:"Today",summary:{totalOrders:247,revenueGenerated:"82K",growthPercentage:8,growthTotalPercentage:0},outlets:[{name:"HP",orders:120,revenue:"45K",percentage:70,color:"bg-[#3C81F6]"},{name:"Adobe",orders:85,revenue:"23K",percentage:50,color:"bg-[#3C81F6]"},{name:"Anarock",orders:42,revenue:"14K",percentage:25,color:"bg-[#3C81F6]"}]};function qh(e,t=null){if(typeof e=="number")return e;if(typeof e=="string"){const n=Number(e.replace("%","").trim());return Number.isNaN(n)?t:n}return t}function FI(e){if(e==null||e==="")return"0";if(typeof e=="number")return MS(e);const t=Number(e);return Number.isNaN(t)?String(e):MS(t)}function zde(e){const t=e?.food_beverage_summary?{title:e?.title,period:e?.period,summary:{totalOrders:e?.food_beverage_summary?.total_orders,revenueGenerated:e?.food_beverage_summary?.revenue_generated,growthPercentage:e?.food_beverage_summary?.growth_percentage??e?.food_beverage_summary?.revenue_growth,growthTotalPercentage:e?.food_beverage_summary?.order_growth,currencyType:e?.food_beverage_summary?.currency_type},outlets:e?.chart_data}:e||{},n=t?.summary||{},i=(Array.isArray(t?.outlets)?t.outlets:[]).map((f,p)=>({name:f?.name||f?.outlet_name||f?.tenant_name||f?.company_name||"Unknown",orders:f?.orders??f?.total_orders??f?.count??0,revenue:f?.revenue??f?.revenue_generated??f?.total_revenue??0,percentage:f?.percentage,color:f?.color||RI[p%RI.length]})),o=n?.totalOrders??n?.orders??fs.summary.totalOrders,a=n?.revenueGenerated??n?.revenue??fs.summary.revenueGenerated,s=qh(n?.growthPercentage??n?.revenueGrowth,fs.summary.growthPercentage),l=qh(n?.growthTotalPercentage??n?.orderGrowth,fs.summary.growthTotalPercentage),c=n?.currencyType||n?.currency||Wde,u=i.reduce((f,p)=>f+(Number(p?.orders)||0),0),d=i.map(f=>({...f,percentage:f?.percentage!==null&&f?.percentage!==void 0?Number(f.percentage)||0:u>0?Math.round((Number(f?.orders)||0)/u*100):0}));return{title:t?.title||fs.title,period:t?.period||fs.period,summary:{totalOrders:o,revenueGenerated:a,growthPercentage:s,growthTotalPercentage:l,currencyType:c},outlets:d.length>0?d:fs.outlets}}function Vde({data:e,title:t,period:n,icon:r}){const i=zde(e),o=t||i.title,a=n||i.period,s=r||g.jsx(Hue,{className:"!text-[24px] text-[#FA7E28]"}),l=i.summary.totalOrders??0,c=FI(i.summary.revenueGenerated),u=qh(i.summary.growthPercentage,0),d=qh(i.summary.growthTotalPercentage,0),f=u>=0,p=d>=0;return g.jsx(je,{className:"h-[324px]",title:o,period:a,icon:s,children:g.jsxs("div",{className:"flex flex-col h-full",children:[g.jsxs("div",{className:"flex gap-[24px]",children:[g.jsxs("div",{className:"w-[65%] flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Orders"}),g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:l}),g.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${p?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[p?g.jsx(Sa,{}):g.jsx(_a,{}),d,"%",g.jsx("span",{children:"from last month"})]})]}),g.jsxs("div",{className:"w-[30%] flex flex-col gap-[8px] ",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] whitespace-nowrap",children:"Revenue Generated"}),g.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF] whitespace-nowrap",children:[i.summary.currencyType," ",c]}),g.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${f?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[f?g.jsx(Sa,{}):g.jsx(_a,{}),u,"%",g.jsx("span",{children:"from last month"})]})]})]}),g.jsx("div",{className:"mt-[16px]",children:i.outlets.map((h,m)=>g.jsxs("div",{className:m===i.outlets.length-1?"":"mb-[16px]",children:[g.jsxs("div",{className:"flex justify-between text-sm mb-[8px]",children:[g.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:h.name}),g.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[g.jsxs("div",{className:"text-[#64748B] inline-block",children:[h.orders," orders"]}),g.jsxs("div",{className:"mx-2 text-[#121212] inline-block",children:[i.summary.currencyType," ",FI(h.revenue)]})]})]}),g.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:g.jsx("div",{className:`h-[11px] rounded-full ${h.color}`,style:{width:`${h.percentage}%`}})})]},`${h.name}-${m}`))})]})})}function Hde({data:e}){const t=e?.amenity_summary?{amenitySummary:{totalBookings:e?.amenity_summary?.total_bookings??0,todayPaidRevenue:e?.amenity_summary?.today_paid_revenue??"0.00",growthPercentage:e?.amenity_summary?.growth_percentage??null,bookingGrowth:e?.amenity_summary?.booking_growth??null,currencyType:e?.amenity_summary?.currency_type??"₹"},chartData:Array.isArray(e?.chart_data)?e.chart_data.map(h=>({facility_name:h?.facility_name,total_bookings:h?.total_bookings??0,paid_revenue:h?.paid_revenue??"0",isPaid:h?.is_paid===!0})):[]}:e||{},n=t?.amenitySummary||{},i=(Array.isArray(t?.chartData)?t.chartData:[]).map(h=>({...h,isPaid:h?.isPaid===!0})),o=i.length>0&&i.every(h=>h?.isPaid===!1),a=n?.totalBookings||0,s=n?.bookingGrowth;let l=0;if(typeof s=="number")l=s;else if(typeof s=="string"){const h=s.replace("%","").trim(),m=Number(h);l=isNaN(m)?0:m}const c=i.reduce((h,m)=>{const v=m?.total_bookings||0;return h+v},0),u=i.map(h=>{const m=h?.total_bookings||0,v=h?.isPaid?`${n?.currencyType||"₹"} ${h?.paid_revenue||"0.00"}`:"",b=c>0?Math.round(m/c*100):0;return{name:h?.facility_name||"Unknown",bookings:m,revenue:v,percentage:b,color:"bg-[#3C81F6]",isPaid:h?.isPaid}}),d=n?.growthPercentage;let f=null;if(typeof d=="number")f=d;else if(typeof d=="string"){const h=d.replace("%","").trim(),m=Number(h);f=isNaN(m)?null:m}const p=f!==null?f>=0:!0;return g.jsx(je,{className:"h-[324px]",title:"Amenities",period:"Today",icon:g.jsx(Yue,{className:"!text-[24px] text-[#8B5CF6]"}),children:g.jsxs("div",{className:"flex flex-col h-full",children:[g.jsxs("div",{className:"flex gap-[24px]",children:[g.jsxs("div",{className:"w-[65%] flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Bookings"}),g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:a}),g.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${l>=0?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[l>=0?g.jsx(Sa,{}):g.jsx(_a,{}),l,"%",g.jsx("span",{children:"from last month"})]})]}),!o&&g.jsxs("div",{className:"w-[25%] flex flex-col gap-[8px] ",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] whitespace-nowrap",children:"Revenue Generated"}),g.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF] whitespace-nowrap",children:[n?.currencyType||"₹"," ",n?.todayPaidRevenue??"0.00"]}),f!==null&&g.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] ${p?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[p?g.jsx(Sa,{}):g.jsx(_a,{}),f,"%",g.jsx("span",{children:"from last month"})]})]})]}),g.jsx("div",{className:"mt-[16px]",children:u.length>0?u.map((h,m)=>g.jsxs("div",{className:m===u.length-1?"":"mb-[16px]",children:[g.jsxs("div",{className:"flex justify-between text-sm mb-[8px]",children:[g.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:h?.name}),g.jsxs("div",{className:"font-medium text-[12px] leading-[16px]",children:[g.jsxs("div",{className:"text-[#64748B] inline",children:[h?.bookings," ",h?.bookings<=1?"booking":"bookings"]}),h?.isPaid&&g.jsx("div",{className:"mx-2 text-[#121212] inline",children:h?.revenue})]})]}),g.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:g.jsx("div",{className:`h-[11px] rounded-full ${h?.color}`,style:{width:`${h?.percentage}%`}})})]},m)):g.jsx("div",{className:"flex items-center justify-center h-[120px]",children:g.jsx("div",{className:"text-[12px] text-[#94A3B8]",children:"No amenity usage data available"})})})]})})}Bn.register(Co,ko,Al,Vr,ti);function Yde({data:e=[]}){const t=[{level:"L1",open:55,in_progress:22,on_hold:15,closed:6},{level:"L2",open:45,in_progress:25,on_hold:18,closed:5},{level:"L3",open:58,in_progress:23,on_hold:14,closed:6}],n=e.length>0?e:t,r=[],i=[],o=[],a=[],s=[];for(let u=0;u<n.length;u++)r.push(n[u].level),i.push(Number(n[u].open)),o.push(Number(n[u].in_progress)),a.push(Number(n[u].on_hold)),s.push(Number(n[u].cancelled));const l={labels:r,datasets:[{label:"Open",data:i,backgroundColor:"#3B82F6",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"In Progress",data:o,backgroundColor:"#F59E0B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"On-Hold",data:a,backgroundColor:"#64748B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"Cancelled",data:s,backgroundColor:"#FB2C36",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"}]},c={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,pointStyle:"rectRot",padding:20,color:"#64748B"}},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff"}},scales:{x:{stacked:!0,grid:{display:!1},ticks:{color:"#64748B"}},y:{stacked:!0,beginAtZero:!0,grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1},ticks:{color:"#64748B",stepSize:1,precision:0,callback:u=>Math.round(u)}}}};return g.jsx(je,{className:"h-[267px]",title:"Ticket Escalation Levels",period:"Today",icon:g.jsx(p3,{className:"!text-[24px] text-[#3C81F6]"}),children:g.jsx("div",{className:"h-full",children:g.jsx(Tl,{data:l,options:c})})})}const Ude=({active:e,payload:t})=>{if(!e||!t||!t.length)return null;const n=t[0],r=n.payload.color;return g.jsx("div",{style:{backgroundColor:"#000000",color:"#ffffff",padding:"8px 10px",borderRadius:"8px",fontSize:"12px"},children:g.jsxs("div",{className:"flex items-center gap-[8px] font-medium",children:[g.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:r}}),g.jsx("div",{children:n.name}),g.jsx("div",{className:"ml-2",children:n.value})]})})};function Kde({data:e=null}){const n=e||{open:12,on_hold:5,cancelled:3,completed:156,in_progress:8,total_complaints:184},r=a=>{const s=Number(a);return isNaN(s)?0:s},i=[{name:"Completed",value:r(n.completed),color:"#10B981"},{name:"Open",value:r(n.open),color:"#3B82F6"},{name:"In Progress",value:r(n.in_progress),color:"#F59E0B"},{name:"On Hold",value:r(n.on_hold),color:"#6B7280"},{name:"Cancelled",value:r(n.cancelled),color:"#EF4444"}],o=r(n.total_complaints);return g.jsx(je,{className:"h-[267px]",title:"Ticket Status",period:"Today",icon:g.jsx(dg,{className:"!text-[24px] text-[#EF4444]"}),children:g.jsxs("div",{className:"flex h-full items-center gap-[16px]",children:[g.jsxs("div",{className:"w-[202px] h-[170px] relative",children:[g.jsx(xt,{width:"100%",height:"100%",children:g.jsxs(Oi,{children:[g.jsx(Zr,{data:i,innerRadius:55,outerRadius:85,dataKey:"value",stroke:"#FFFFFF",strokeWidth:2,children:i.map((a,s)=>g.jsx(gn,{fill:a.color},s))}),g.jsx(Ct,{content:g.jsx(Ude,{}),wrapperStyle:{zIndex:1e3}})]})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsxs("div",{className:"flex items-baseline text-[18px] leading-[22px] font-medium text-[#121212]",children:[g.jsx("div",{children:r(n.completed)}),g.jsxs("div",{className:"text-[18.18px] leading-[22.22px] text-[#121212]",children:["/",o]})]}),g.jsx("div",{className:"text-[10.1px] leading-[14.14px] text-[#64748B]",children:"Completed"})]})]}),g.jsx("div",{className:"flex-1 space-y-2",children:i.map(a=>g.jsxs("div",{className:"flex items-center justify-between text-[12px] leading-[17px] mt-[12px]",children:[g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("div",{className:"h-[7px] w-[16px]",style:{backgroundColor:a.color}}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]}),g.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px] font-medium",children:a.value})]},a.name))})]})})}const LI={visitorSummary:{totalVisitorsToday:150,peakTime:"2:00 - 4:00PM",peakCount:50,activeWalkins:18,preApprovedCheckins:3},popupData:{walkins:{currently_inside:18,total_visited_today:58},preApproved:{completed_visits:3,total_expected_today:5}},chart_data:[{hour:10,walkins:22,preApproved:30},{hour:12,walkins:15,preApproved:28},{hour:14,walkins:30,preApproved:38},{hour:16,walkins:45,preApproved:50},{hour:18,walkins:25,preApproved:40}]};function qde(e){const t=e>=12?"PM":"AM";let n=e%12;return n===0&&(n=12),`${n} ${t}`}function Gde(e){if(typeof e=="number"&&e>=0&&e<=23)return e;if(typeof e=="string"){const t=e.trim().toUpperCase(),n=t.match(/^(\d{1,2})(?::\d{2})?\s*(AM|PM)$/);if(n){let i=Number(n[1])%12;return n[2]==="PM"&&(i+=12),i}const r=Number(t);if(!Number.isNaN(r)&&r>=0&&r<=23)return r}return null}function Xde(e=[]){return Array.from({length:24},(t,n)=>{const r=e.find(i=>Gde(i?.hour)===n)||{};return{hour:n,time:qde(n),walkins:Number(r?.walkins??0),approved:Number(r?.pre_approved??r?.preApproved??r?.approved??0)}})}function $I({title:e,color:t,rows:n=[],children:r}){const i=g.jsxs("div",{className:"bg-white rounded-[12px] min-w-[260px] p-[16px] border-[0.5px] border-[#EBEBEB] shadow-[0px_0px_12px_0px_#EAF2FF]",children:[g.jsx("div",{className:"flex items-center gap-[8px] font-medium text-[#121212]",children:g.jsx("div",{children:e??""})}),g.jsx("div",{className:"mt-[16px] pt-[16px] border-t border-dashed border-[#EBEBEB] space-y-[16px]",children:n?.map(({label:o,value:a,valueColor:s})=>g.jsxs("div",{className:"flex justify-between text-[14px] leading-[18px]",children:[g.jsx("div",{className:"text-[#64748B]",children:o??""}),g.jsx("div",{className:"font-semibold",style:{color:s||"#121212"},children:a??0})]},o))})]});return g.jsx(bN,{placement:"right-start",interactive:!0,delay:[100,0],offset:[6,0],appendTo:()=>document.body,maxWidth:"none",render:o=>g.jsx("div",{tabIndex:"-1",...o,children:i}),children:r})}function Qde({active:e,payload:t}){return!e||!t?.length?null:g.jsx("div",{className:"rounded-[8px] bg-[#121212] px-[12px] py-[8px] text-[12px] text-white shadow-lg",children:t.map(n=>g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:n.stroke}}),g.jsx("span",{className:"min-w-[82px] text-[#D1D3D4]",children:n.name}),g.jsx("span",{className:"font-semibold",children:n.value})]},n.dataKey))})}function Zde({data:e}){const t=e&&Object.keys(e).length?e:LI,n=t?.visitor_summary?{totalVisitorsToday:t?.visitor_summary?.total_visitors_today??0,peakTime:t?.visitor_summary?.peak_time??"-"}:t?.visitorSummary??{},r=t?.walkins_popup_data?{walkins:{currently_inside:Number(t?.walkins_popup_data?.walkins_inside??0),total_visited_today:Number(t?.walkins_popup_data?.total_walkins??0)},preApproved:{completed_visits:Number(t?.pre_approved_popup_data?.pre_approved_check_ins??0),total_expected_today:Number(t?.pre_approved_popup_data?.total_pre_approved_check_ins??0)}}:t?.popupData??{},i=k.useMemo(()=>{const l=t?.chart_data??[];return Xde(l.length?l:LI.chart_data)},[t]),{yAxisTicks:o,yAxisMax:a}=k.useMemo(()=>{const l=Math.max(...i.map(u=>Math.max(u.walkins,u.approved))),c=l>0?l:5;return{yAxisTicks:[0,Math.ceil(c/2),c],yAxisMax:c}},[i]),s=new Date().toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit",hour12:!0});return g.jsx(je,{className:"h-[377px]",title:"Visitor Updates",period:`Today at ${s}`,icon:g.jsx(ug,{className:"!text-[24px] text-[#8B5CF6]"}),children:g.jsxs("div",{className:"flex flex-col gap-[24px]",children:[g.jsxs("div",{className:"grid grid-cols-2 gap-y-4 gap-x-6",children:[g.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Total Visitors"}),g.jsx("div",{className:"text-[20px] font-medium text-[#08B6D4]",children:n?.totalVisitorsToday??0})]}),g.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Peak Time"}),g.jsx("div",{className:"text-[20px] font-medium text-[#8B5CF6]",children:n?.peakTime??"-"})]}),g.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Active Walk-ins"}),g.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[g.jsx("div",{className:"text-[28px] text-[#1FA05B] leading-[32px]",children:r?.walkins?.currently_inside??0}),g.jsx($I,{title:"Active Walk-ins",color:"text-[#1FA05B]",rows:[{label:"Currently Inside",value:r?.walkins?.currently_inside??0,valueColor:"#1FA05B"},{label:"Total Visited Today",value:r?.walkins?.total_visited_today??0}],children:g.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.walkins?.total_visited_today??0]})})]})]}),g.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[g.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Pre-approved Check-ins"}),g.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[g.jsx("div",{className:"text-[28px] text-[#E7A015] leading-[32px]",children:r?.preApproved?.completed_visits??0}),g.jsx($I,{title:"Pre-approved Check-ins",color:"text-[#E7A015]",rows:[{label:"Completed Visits",value:r?.preApproved?.completed_visits??0,valueColor:"#E7A015"},{label:"Total Expected Check-ins Today",value:r?.preApproved?.total_expected_today??0}],children:g.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.preApproved?.total_expected_today??0]})})]})]})]}),g.jsx("div",{className:"w-full h-[149px]",children:g.jsx(xt,{width:"100%",height:"100%",children:g.jsxs($0,{data:i??[],margin:{top:5,right:0,left:0,bottom:-10},children:[g.jsx(Qn,{stroke:"#E5E7EB",strokeDasharray:"4 4",vertical:!1}),g.jsx($n,{dataKey:"time",tickFormatter:(l,c)=>c%4===0?l:"",axisLine:!1,tickLine:!1,tick:{fill:"#121212",fontSize:10,fontWeight:400}}),g.jsx(Pn,{width:24,axisLine:!1,tickLine:!1,allowDecimals:!1,ticks:o,domain:[0,a],tick:{fill:"#64748B",fontSize:10,fontWeight:400}}),g.jsx(Ct,{content:g.jsx(Qde,{})}),g.jsx(Zo,{type:"monotone",dataKey:"walkins",stroke:"#22C55E",strokeWidth:2,dot:!1,name:"Walk-ins",isAnimationActive:!1}),g.jsx(Zo,{type:"monotone",dataKey:"approved",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved",isAnimationActive:!1})]})})})]})})}const Jde=({color:e})=>g.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:e,marginRight:"6px"}}),efe=({active:e,payload:t})=>!e||!t||!t.length?null:g.jsx("div",{className:"bg-black text-white !text-[12px] px-[12px] py-[8px] rounded-[8px] shadow-lg",children:t.map((n,r)=>g.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[g.jsx(Jde,{color:n.color}),n.name,": ",g.jsx("div",{className:"font-semibold",children:n.value})]},r))});function tfe({data:e=null}){const n=e||{card_entry:60,mobile_entry:35,card_exit:15,mobile_exit:10,total:20.3},r=a=>{const s=Number(a);return isNaN(s)?0:s},i=[{name:"Card Entry",value:r(n.card_entry),color:"#329DFF"},{name:"Mobile Entry",value:r(n.mobile_entry),color:"#8B5CF6"},{name:"Card Exit",value:r(n.card_exit),color:"#B1D2F0"},{name:"Mobile Exit",value:r(n.mobile_exit),color:"#DACBFB"}],o=r(n.total);return g.jsx(kt,{className:"h-[362px]",title:"Access Overview",titleWeight:"semi-bold",children:g.jsxs("div",{className:"flex flex-col items-center mt-[16px]",children:[g.jsxs("div",{className:"relative w-[200px] h-[200px]",children:[g.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:g.jsx("div",{className:"w-[130px] h-[130px] rounded-full shadow-[0px_12px_35px_rgba(0,0,0,0.12)]"})}),g.jsx("div",{className:"h-[184px]",children:g.jsx(xt,{width:"100%",height:"100%",children:g.jsxs(Oi,{children:[g.jsx(Zr,{data:i,dataKey:"value",innerRadius:65,outerRadius:90,startAngle:110,endAngle:-250,paddingAngle:2,stroke:"transparent",children:i.map((a,s)=>g.jsx(gn,{fill:a.color},s))}),g.jsx(Ct,{content:g.jsx(efe,{}),wrapperStyle:{zIndex:9999}})]})})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsxs("div",{className:"text-[20px] leading-[24px] font-semibold text-[#121212]",children:[o,"L"]}),g.jsx("div",{className:"text-[10px] leading-[15px] text-[#64748B]",children:"Total Access"})]})]}),g.jsx("div",{className:"mt-[32px] grid grid-cols-2 gap-x-[20px] gap-y-[12px] text-[12px] text-[#94A3B8]",children:i.map(a=>g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("div",{className:"w-[16px] h-[7px] ",style:{backgroundColor:a.color}}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]},a.name))})]})})}function BI({title:e="Access",data:t=[],height:n="h-[362px]"}){const r=i=>i==null?"0":Number(i).toLocaleString();return g.jsx(kt,{className:n,title:e,titleWeight:"semi-bold",children:g.jsxs("div",{className:"rounded-[12px] overflow-hidden mt-[16px]",children:[g.jsxs("div",{className:"grid grid-cols-2 bg-[#F8FAFC] py-[8px] px-[12px] text-[12px] leading-[16px] font-medium text-[#64748B]",children:[g.jsx("div",{children:"Point"}),g.jsx("div",{className:"text-right",children:"Access"})]}),t.map((i,o)=>g.jsxs("div",{className:"grid grid-cols-2 p-[12px] text-[14px] border-t border-[#E2E8F0]",children:[g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:i.label}),g.jsx("div",{className:"text-[12px] leading-[16px] text-right font-medium",style:{color:i.color||"#000"},children:r(i.value)})]},o))]})})}function nfe({data:e=[]}){const t=[{name:"Google",value:82e3},{name:"Uber",value:67e3},{name:"ANAROCK",value:6e4},{name:"Flipkart",value:48e3},{name:"HP",value:41e3},{name:"Myntra",value:3e4},{name:"Cloudscape",value:2e4},{name:"Infosys",value:9e3}],n=e.length?e:t,r=o=>o>=1e3?`${o/1e3}K`:o,i=Math.max(...n.map(o=>o.value));return g.jsx(kt,{title:"Access Points Usage",titleWeight:"semi-bold",className:"h-[362px]",children:g.jsx("div",{className:"mt-[24px] h-[270px] w-full",children:g.jsx(xt,{width:"100%",height:"100%",children:g.jsxs(go,{data:n,barSize:60,margin:{top:0,right:0,left:-20,bottom:0},children:[g.jsx(Qn,{strokeDasharray:"8 8",vertical:!1}),g.jsx(_0,{y:0,stroke:"#EBEBEB",strokeDasharray:"0"}),g.jsx($n,{dataKey:"name",tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),g.jsx(Pn,{tickFormatter:r,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),g.jsx(Ct,{cursor:!1}),g.jsx(Xt,{dataKey:"value",barSize:60,children:n.map((o,a)=>g.jsx(gn,{fill:o.value===i?"#3C81F6":"#79ABFF"},`cell-${a}`))})]})})})})}const rfe=({x:e,y:t,payload:n})=>{const r=n.value.split(" ");return g.jsx("g",{transform:`translate(${e},${t})`,children:g.jsx("text",{x:-85,y:0,textAnchor:"start",fill:"#121212",fontSize:14,children:r.map((i,o)=>g.jsx("tspan",{x:-85,dy:o===0?0:16,children:i},o))})})};function ife({data:e=[]}){const t=e&&e.length>0,n=e.map(r=>({name:r.category_name,value:r.total_complaints,color:"#08B6D4"}));return g.jsx(kt,{title:"Tickets per Category",className:"h-[362px]",titleWeight:"semi-bold",childrenClassName:"h-full mt-[24px]!",children:t?g.jsx("div",{className:"w-full h-[262px]",children:g.jsx(xt,{width:"100%",height:"100%",children:g.jsxs(go,{data:n,layout:"vertical",margin:{top:0,right:8,left:-20,bottom:0},children:[g.jsx(Qn,{strokeDasharray:"3 3",horizontal:!1,stroke:"#E5E7EB"}),g.jsx($n,{type:"number",tick:{fill:"#94A3B8",fontSize:12},axisLine:!0,tickLine:!1,tickMargin:10,allowDecimals:!1}),g.jsx(Pn,{type:"category",dataKey:"name",axisLine:!1,tickLine:!1,width:132,tick:g.jsx(rfe,{})}),g.jsx(Ct,{content:g.jsx(Ea,{}),cursor:{fill:"transparent"},position:{x:300,y:0}}),g.jsx(Xt,{dataKey:"value",barSize:36,fill:"#08B6D4"})]})})}):g.jsx(ir,{title:"No Tickets Found",description:"Catch up all the data. Change the date range to see the data."})})}function ofe({icon:e,iconColor:t="#329DFF",title:n,value:r,percentage:i,percentageText:o}){const a=parseFloat(i),s=a>=0,l=s?"#16A34A":"#DC2626";return g.jsxs("div",{className:"relative bg-white !border-[0.5px] !border-[#EBEBEB] !rounded-[12px] !shadow-[0_0_12px_0_#EAF2FF] p-[16px]",children:[g.jsxs("div",{className:"flex items-center gap-[8px]",children:[e&&g.jsx("div",{className:"h-[20px] w-[20px]",style:{color:t,display:"flex",alignItems:"center",justifyContent:"center"},children:g.jsx(e,{className:"h-[20px] w-[20px]"})}),g.jsx("div",{className:"text-[16px] leading-[20px] font-medium text-[#64748B]",children:n})]}),g.jsx("div",{className:"mt-[16px] text-[28px] leading-[32px] font-medium text-[#121212]",children:r}),(i||o)&&g.jsxs("div",{className:"mt-[12px] flex items-center gap-[8px]",children:[i&&g.jsxs("div",{className:"flex items-center gap-[4px] text-[12px] leading-[16px] font-medium",style:{color:l},children:[s?g.jsx(Sa,{}):g.jsx(_a,{}),Math.abs(a),"%"]}),o&&g.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:o})]})]})}const afe=({data:e=[],onDateChange:t})=>{const[n,r]=k.useState(new Date),[i,o]=k.useState(!1),s=(v=>{const b=new Date(v);return b.setDate(b.getDate()-6),b})(n),l=v=>{try{return v.toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}catch{return""}},c=v=>{const b=new Date(v),S=new Date(b);S.setDate(S.getDate()-6),t&&t(S.toISOString(),b.toISOString())},u=()=>{const v=new Date(n);v.setDate(v.getDate()-7),r(v),c(v)},d=()=>{const v=new Date(n);v.setDate(v.getDate()+7),r(v),c(v)},f=()=>{o(v=>!v)},p=v=>{const b=v||new Date;r(b),c(b),o(!1)},h=Array.isArray(e)?e:[],m=!h.length||h.every(v=>v.no_of_visitors===0);return g.jsxs(kt,{title:"Weekly Visitor Pattern",period:`${l(s)} - ${l(n)}`,isDateSelector:!0,titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",onPrevClick:u,onNextClick:d,onCalendarClick:f,children:[i&&g.jsx("div",{className:"anarock-datepicker absolute top-[70px] right-[24px] z-50",children:g.jsx(wS,{selected:n,onChange:p,inline:!0,maxDate:new Date,showYearDropdown:!0,scrollableYearDropdown:!0,yearDropdownItemNumber:40})}),m?g.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:g.jsx(ir,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):g.jsx("div",{className:"w-full h-[280px]",children:g.jsx(xt,{width:"100%",height:"100%",children:g.jsxs(MT,{data:h,margin:{top:10,right:-10,left:-10,bottom:0},children:[g.jsx("defs",{children:g.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[g.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),g.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),g.jsx(Qn,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),g.jsx($n,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:v=>new Date(v).toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}),g.jsx(Pn,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),g.jsx(Ct,{cursor:!1,content:({active:v,payload:b,label:S,coordinate:w})=>{if(!v||!b?.length)return null;const x=new Date(S).toLocaleDateString("en-GB",{day:"2-digit",month:"short"}),O=b[0]?.payload===h[h.length-1]?w.x-70:w.x;return g.jsx("div",{style:{position:"absolute",transform:`translate(${O}px, ${w.y-40}px)`,pointerEvents:"none",zIndex:99999},children:g.jsx(Oa,{active:v,payload:b,label:x})})}}),g.jsx(P0,{type:"monotone",dataKey:"no_of_visitors",stroke:"#6366F1",strokeWidth:2,fill:"url(#colorVisitors)",dot:{r:5,stroke:"#6366F1",strokeWidth:2,fill:"#fff"},activeDot:v=>{const{cx:b,cy:S,stroke:w}=v;return g.jsxs("g",{children:[g.jsx("circle",{cx:b,cy:S,r:6,fill:"#fff",stroke:"#6466F1",strokeWidth:2}),g.jsx("circle",{cx:b,cy:S,r:2.5,fill:"#6466F1"})]})}})]})})})]})},sfe=[{building_name:"Google",no_of_visitors:1e3},{building_name:"Uber",no_of_visitors:3500},{building_name:"ANAROCK",no_of_visitors:2e3},{building_name:"Flipkart",no_of_visitors:8e3},{building_name:"HP",no_of_visitors:1650}],lfe=({data:e})=>{const t=Array.isArray(e)&&e?.length===0,n=e==null?sfe:Array.isArray(e)?e:[];return g.jsx(kt,{title:"Organisation Wise Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",children:g.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:t?g.jsx(ir,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."}):g.jsx(xt,{width:"100%",height:"100%",children:g.jsxs(go,{data:n||[],margin:{top:10,right:10,left:10,bottom:-10},barCategoryGap:35,children:[g.jsx(Qn,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),g.jsx($n,{dataKey:"building_name",tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1}),g.jsx(Pn,{width:40,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1}),g.jsx(Ct,{cursor:!1,content:g.jsx(Oa,{})}),g.jsx(Xt,{dataKey:"no_of_visitors",name:"Visitors",maxBarSize:55,fill:"#3C81F6"})]})})})})};function cfe({data:e}){return g.jsx("div",{className:"h-full",children:e.map((t,n)=>{const r=parseFloat(t.delta),i=r>=0;return g.jsx(je,{iconClassName:"!gap-[8px]",title:g.jsx("div",{className:"text-[#64748B]",children:t.title}),icon:g.jsx(t.Icon,{className:"h-[20px] w-[20px]",style:{color:t.iconColor||"#000000"}}),className:`${t?.widget==="amenities"?"h-[139px]":"h-[124px]"}`,children:g.jsxs("div",{className:`flex flex-col gap-[8px] ${t?.widget==="amenities"?"mt-[3.5px]":"mt-0"}`,children:[g.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t.value}),g.jsxs("div",{className:`flex items-center text-[12px] leading-[16px] ${t.delta?"gap-[8px]":""}`,children:[t.delta&&g.jsxs("div",{className:`flex items-center gap-[4px] px-[6px] py-[2px] rounded-[4px] font-medium
|
|
373
373
|
${i?"text-[#1FA05B] bg-[#F7FEFA]":"text-[#E11D48] bg-[#FBF4F4]"}
|
|
374
374
|
`,children:[i?g.jsx(Sa,{}):g.jsx(_a,{}),Math.abs(r),"%"]}),g.jsx("div",{style:{color:"#64748B"},children:t.deltaLabel})]})]})},n)})})}const ufe=[{facility_name:"Table Tennis",total_booking:5},{facility_name:"Gym",total_booking:12},{facility_name:"Meeting Room A",total_booking:3},{facility_name:"Conference Hall",total_booking:8}],dfe=({x:e,y:t,payload:n})=>g.jsx("foreignObject",{x:(e||0)-80,y:(t||0)-18,width:80,height:40,children:g.jsx("div",{className:"text-[12px] leading-[16px] text-[#121212]",style:{width:"80px",whiteSpace:"normal",wordBreak:"break-word",textAlign:"left"},children:n?.value||""})});function ffe({data:e}){const t=Array?.isArray(e)&&e?.length===0,r=(e==null?ufe:Array?.isArray(e)?e:[]).map(i=>({...i,name:i.facility_name,color:"#8B5CF6"}));return g.jsx(je,{title:"Bookings",icon:g.jsx(Vue,{size:18,className:"text-[#DBB467]"}),className:"h-[288px]",children:g.jsx("div",{className:"w-full h-full flex items-center justify-center",children:t?g.jsx(ir,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):g.jsx(xt,{width:"100%",height:"100%",children:g.jsxs(go,{data:r||[],layout:"vertical",margin:{top:0,right:10,left:-12,bottom:0},children:[g.jsx($n,{type:"number",allowDecimals:!1,tick:{fill:"#64748B",fontSize:12},axisLine:!0,tickLine:!1}),g.jsx(Pn,{type:"category",dataKey:"facility_name",axisLine:!1,tickLine:!1,width:100,tick:g.jsx(dfe,{})}),g.jsx(Ct,{content:g.jsx(Ea,{}),cursor:{fill:"transparent"},position:{x:300,y:0}}),g.jsx(Xt,{dataKey:"total_booking",barSize:40,fill:"#8B5CF6"})]})})})})}const pfe=[{building_name:"Google",no_of_booking:1},{building_name:"Uber",no_of_booking:2},{building_name:"ANAROCK",no_of_booking:4},{building_name:"Flipkart",no_of_booking:2},{building_name:"HP",no_of_booking:1}];function hfe({data:e}){const t=Array.isArray(e)&&e?.length===0,n=e==null?pfe:Array.isArray(e)?e:[];return g.jsx(kt,{title:"Booking Trend by Organisation",titleWeight:"semi-bold",className:"h-[362px]",children:g.jsx("div",{className:"w-full h-[265px] mt-[28px] flex items-center justify-center",children:t?g.jsx(ir,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):g.jsx(xt,{width:"100%",height:"100%",children:g.jsxs(go,{data:n||[],margin:{top:0,right:0,left:-30,bottom:0},children:[g.jsx(Qn,{strokeDasharray:"3 3",vertical:!1,stroke:"#E5E7EB"}),g.jsx($n,{dataKey:"building_name",axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12}}),g.jsx(Pn,{allowDecimals:!1,axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12},tickFormatter:r=>`${r??0}`}),g.jsx(Ct,{cursor:!1,content:g.jsx(Oa,{})}),g.jsx(Xt,{dataKey:"no_of_booking",barSize:54,fill:"#12B981"})]})})})})}const mfe=[{facility_name:"Table Tennis",paid_revenue:"24000.00"},{facility_name:"Games Room",paid_revenue:"14000.00"},{facility_name:"Badminton",paid_revenue:"10000.00"},{facility_name:"GYM",paid_revenue:"4000.00"}],Gh=["#3C81F6","#60A5FA","#95BFFA","#BEDAFE","#DAE6FC"];function gfe({data:e,currencyType:t}){const n=Array?.isArray(e)&&e?.length===0,r=e??mfe,i=Array?.isArray(r)&&r?.length>0?r?.map(l=>({name:l?.facility_name||"Unknown",value:Number(l?.paid_revenue)||0})):[],a=(i?.length>0?i?.every(l=>l?.value===0):!1)?i?.map((l,c)=>({...l,value:c===0?1:0})):i,s=l=>`${t||"Rs"} ${l?.toLocaleString?.("en-IN")||0}`;return g.jsx(kt,{title:"Amenity Wise Revenue",titleWeight:"semi-bold",className:"h-[362px]",children:g.jsx("div",{className:"grid grid-cols-12 gap-[24px] items-center h-full mt-[16px]",children:n?g.jsx("div",{className:"col-span-12 flex items-center justify-center h-[240px]",children:g.jsx(ir,{title:"No Amenity Found",description:"Catch up all the data. Change the date range to see the data."})}):g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"col-span-6 h-[240px] w-full max-w-[240px]",children:g.jsx(xt,{width:"100%",height:"100%",children:g.jsxs(Oi,{children:[g.jsx(Zr,{data:a||[],dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:95,stroke:"#fff",strokeWidth:1,children:a?.map?.((l,c)=>g.jsx(gn,{fill:Gh?.[c%Gh?.length]},`cell-${c}`))}),g.jsx(Ct,{cursor:!1,content:l=>g.jsx(Oa,{...l,formatter:c=>s(c)})})]})})}),g.jsx("div",{className:"col-span-6",children:g.jsxs("div",{className:"rounded-[12px] !overflow-hidden border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[g.jsxs("div",{className:"grid grid-cols-2 px-[12px] py-[8px] bg-[#EBEBEB] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[g.jsx("div",{children:"Amenity"}),g.jsx("div",{className:"text-right",children:"Revenue"})]}),g.jsx("div",{className:"divide-y divide-[#F1F5F9] max-h-[238px] overflow-y-auto hide-scrollbar",children:i?.map?.((l,c)=>g.jsxs("div",{className:"grid grid-cols-2 px-[16px] py-[16px] text-[14px] text-[#121212]",children:[g.jsxs("div",{className:"flex items-center gap-[12px]",children:[g.jsx("span",{className:"w-[16px] h-[7px]",style:{backgroundColor:Gh?.[c%Gh?.length]}}),g.jsx("span",{className:"text-[#64748B] text-[12px] leading-[16px]",children:l?.name||"Unknown"})]}),g.jsx("div",{className:"text-right text-[12px] leading-[16px] text-[#64748B]",children:s(l?.value||0)})]},l?.name||c))})]})})]})})})}const Xh=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],vfe=[{asset_group_name:"Lifts",asset_count:3},{asset_group_name:"Fire Systems",asset_count:16},{asset_group_name:"Generators",asset_count:16},{asset_group_name:"HVAC",asset_count:24},{asset_group_name:"Others",asset_count:97}],yfe=({rows:e,totalAssets:t})=>{const n=k.useMemo(()=>e?e.length===0?[]:e.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,fill:Xh[o%Xh.length]})):vfe.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,fill:Xh[o%Xh.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?g.jsx(kt,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:g.jsx("div",{className:"flex items-center justify-center h-full",children:g.jsx(ir,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):g.jsx(kt,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:g.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[g.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[g.jsx(xt,{width:"100%",height:"100%",children:g.jsxs(Oi,{children:[g.jsx(Zr,{data:n,dataKey:"value",cx:"50%",cy:"50%",innerRadius:60,outerRadius:90,paddingAngle:2,stroke:"#FFFFFF",strokeWidth:2,startAngle:90,endAngle:-270,isAnimationActive:!1,children:n.map((i,o)=>g.jsx(gn,{fill:i.fill},o))}),g.jsx(Ct,{cursor:!1,content:g.jsx(Oa,{})})]})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),g.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),g.jsx("div",{className:"flex-1 max-w-[280px]",children:g.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[g.jsxs("div",{className:"flex items-center justify-between px-[16px] py-[12px] bg-[#F8FAFC]",children:[g.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),g.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Count"})]}),n.map((i,o)=>g.jsxs("div",{className:"max-h-[205px] overflow-y-auto hide-scrollbar flex items-center justify-between px-[16px] py-[12px] border-t border-[#F1F5F9]",children:[g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.fill}}),g.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),g.jsx("div",{className:"text-[13px] text-[#64748B]",children:i.value})]},o))]})})]})})},bfe=({data:e})=>{const[t,n]=k.useState({}),r=[{name:"Lifts",Cancelled:55,Closed:45,Open:50,OnHold:20,InProgress:10},{name:"Fire Systems",Cancelled:15,Closed:45,Open:15,OnHold:8,InProgress:5},{name:"Generators",Cancelled:12,Closed:45,Open:75,OnHold:18,InProgress:7},{name:"HVAC",Cancelled:45,Closed:80,Open:30,OnHold:22,InProgress:12},{name:"Others",Cancelled:18,Closed:18,Open:45,OnHold:9,InProgress:4}],i=k.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:r,[e]),o=a=>{const{dataKey:s}=a;n(l=>({...l,[s]:!l[s]}))};return Array.isArray(e)&&e.length===0?g.jsx(kt,{title:"Maintenance Status",titleWeight:"semi-bold",className:"h-full",children:g.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:g.jsx(ir,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):g.jsx(kt,{title:"Maintenance Status",titleWeight:"semi-bold",className:"h-full",children:g.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:Array.isArray(e)&&e.length===0?g.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):g.jsx("div",{className:"relative w-full h-[297px] mt-[20px]",children:g.jsx(xt,{width:"100%",height:"100%",children:g.jsxs(go,{data:i,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[g.jsx(Qn,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),g.jsx($n,{dataKey:"name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),g.jsx(Pn,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),g.jsx(Ct,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},content:({active:a,payload:s,label:l})=>!a||!s||!s.length?null:g.jsxs("div",{style:{backgroundColor:"#000",borderRadius:"10px",padding:"10px 14px",fontSize:"12px",color:"#fff"},children:[g.jsx("div",{style:{marginBottom:"6px",fontWeight:600},children:l}),s.map((c,u)=>{const d=c.color||c.fill||"#fff";return g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[g.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:d,display:"inline-block"}}),g.jsx("span",{style:{color:"#D1D3D4"},children:c.name}),g.jsx("span",{style:{color:"#fff",fontWeight:600},children:c.value})]},u)})]})}),g.jsx(wc,{verticalAlign:"bottom",align:"center",onClick:o,content:({payload:a})=>g.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:a.map((s,l)=>g.jsxs("div",{onClick:()=>o({dataKey:s.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[g.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:t[s.dataKey]?"#CBD5E1":s.color}}),g.jsx("span",{style:{fontSize:"12px",color:t[s.dataKey]?"#CBD5E1":"#64748B"},children:s.value})]},l))})}),g.jsx(Xt,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:t.Open}),g.jsx(Xt,{dataKey:"Closed",stackId:"a",fill:"#10B981",hide:t.Closed}),g.jsx(Xt,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:t.Cancelled}),g.jsx(Xt,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:t.OnHold,name:"On-Hold"}),g.jsx(Xt,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:t.InProgress,name:"In Progress"})]})})})})})};function xfe({data:e}){const t=[{name:"Completed",value:Number(e?.completed||1110),color:"#12B981"},{name:"Not - Completed",value:Number(e?.not_completed||20),color:"#F69E0A"},{name:"Missed",value:Number(e?.missed||30),color:"#EF4444"}],n=Number(e?.completed||0)+Number(e?.not_completed||0)+Number(e?.missed||0),r=Number(e?.completed||0);return g.jsx(kt,{title:"Patrol Status",className:"h-[362px]",titleWeight:"semi-bold",children:g.jsxs("div",{className:"flex flex-col items-center justify-center",children:[g.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[g.jsx(xt,{width:"100%",height:"100%",children:g.jsxs(Oi,{children:[g.jsx(Zr,{data:t,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:t.map((i,o)=>g.jsx(gn,{fill:i.color},`cell-${o}`))}),g.jsx(Ct,{cursor:!1,content:g.jsx(Oa,{})})]})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[g.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[r,"/",n]}),g.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),g.jsx("div",{className:"flex flex-col w-full text-[14px]",children:t.map((i,o)=>g.jsxs("div",{className:`flex items-center justify-between py-[10px] ${o!==t.length-1?"border-b border-[#F1F5F9]":""}`,children:[g.jsxs("div",{className:"flex items-center gap-[10px]",children:[g.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:i.color}}),g.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.name})]}),g.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.value})]},i.name))})]})})}function wfe({incidentReports:e,incidentReportsDetails:t}){const n=Number(e?.open||0),r=Number(e?.in_progress||0),i=Number(e?.closed||0);return g.jsx(kt,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:g.jsxs("div",{children:[g.jsxs("div",{className:"flex w-full text-center gap-[16px] mt-[24px]",children:[g.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FBF4F4] h-[76px] rounded",children:[g.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#AB0000]",children:n}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),g.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FFFBF2] h-[76px] rounded",children:[g.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#F2A815]",children:r}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#F2A815]",children:"In-progress"})]}),g.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#F7FEFA] h-[76px] rounded",children:[g.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:i}),g.jsx("div",{className:"text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),g.jsx("div",{className:"mt-4 space-y-2",children:t?.length>0?t.map((o,a)=>{const s=o?.severity==="Danger"?"text-[#AB0000]":o?.severity==="High"?"text-[#E7A015]":"text-[#1FA05B]";return g.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#FAFBFD] rounded-md",children:[g.jsx("div",{className:"flex items-center gap-[8px]",children:g.jsx("div",{className:"text-gray-700 font-medium",children:o?.incident_code})}),g.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${s}`,children:g.jsxs("div",{children:[o?.severity_level," - ",o?.severity]})})]},a)}):g.jsx(g.Fragment,{})})]})})}function _fe({columns:e=[{key:"a",label:"Organisation"},{key:"b",label:"Item"},{key:"c",label:"Closed"},{key:"d",label:"Open"},{key:"e",label:"AOV"},{key:"f",label:"% Revenue"}],data:t=[{a:"Google",b:"Coffee",c:"34,908",d:"₹ 57,21,288",e:"₹ 450",f:"43.6%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"}],rowsPerPage:n=10,setRowsPerPage:r=()=>{},currentPage:i=1,setCurrentPage:o=()=>{},totalRows:a=0,totalPages:s=1,pageOptions:l=[10,20,30,40,50]}){const c=Array.isArray(t)?t:[],u=Array.isArray(e)?e:[],d=n>0?Math.ceil(c.length/n):1,f=s||d,p=c,h=a===0&&c.length===0,m=`repeat(${u.length}, 1fr)`;return g.jsxs("div",{className:"w-full bg-white rounded-[12px] h-[390px] !border-[0.5px] !border-[#EBEBEB] !shadow-[0_0_12px_0_#EAF2FF] overflow-hidden flex flex-col",children:[g.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[g.jsx("div",{className:"grid bg-[#354A5E] text-white text-[16px] leading-[20px] font-medium shrink-0",style:{gridTemplateColumns:m},children:u.map((v,b)=>g.jsx("div",{className:"px-[24px] py-[16px] text-[16px] leading-[20px] whitespace-nowrap text-left",children:v.label},b))}),g.jsx("div",{className:"flex-1 overflow-y-auto hide-scrollbar",children:h?g.jsx(ir,{title:"No Data Found",description:"Catch up all the data. Change the date range to see the data."}):p.map((v,b)=>g.jsx("div",{className:"grid",style:{gridTemplateColumns:m},children:u.map((S,w)=>{const x=v[S.key],_=S.label==="Closed",O=S.label==="Open",P=typeof x=="string"&&x.includes("%"),D=x==="100%"?"bg-[#F0FEF2] text-[#36AB6C]":"bg-[#FFF0F0] text-[#AB0000]";return g.jsx("div",{className:`px-[24px] py-[16px] flex items-center justify-start ${w===0?"bg-white":"bg-gray-50"} text-[#121212]`,children:_?g.jsx("div",{className:"text-[14px] font-medium",style:{color:"#36AB6C"},children:x??"-"}):O?g.jsx("div",{className:"text-[14px] font-medium",style:{color:"#AB0000"},children:x??"-"}):P?g.jsx("div",{className:`inline-block px-[12px] py-[4px] rounded-full text-[14px] font-medium ${D}`,children:x}):g.jsx("div",{children:x??"-"})},w)})},b))})]}),g.jsxs("div",{className:"flex justify-end items-center px-[24px] py-[16px] text-sm bg-white border-t border-[#F0F0F0] gap-[32px] shrink-0",children:[g.jsxs("div",{className:"flex items-center gap-[8px] text-gray-600 text-[14px]",children:[g.jsx("div",{children:"Rows per page:"}),g.jsx("select",{value:n,onChange:v=>{r(Number(v.target.value)),o(1)},className:"border rounded px-[8px] py-[4px]",children:l.map((v,b)=>g.jsx("option",{value:v,children:v},b))}),g.jsxs("div",{className:"ml-4 text-[14px]",children:[c?.length===0?"0–0":`1–${c?.length}`," of"," ",a||c?.length]})]}),g.jsxs("div",{className:"flex items-center space-x-2 text-gray-600 text-[14px]",children:[g.jsx("button",{onClick:()=>o(1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:g.jsx(Wue,{size:18})}),g.jsx("button",{onClick:()=>o(v=>v-1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:g.jsx(MI,{size:18})}),g.jsx("button",{onClick:()=>o(v=>v+1),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:g.jsx(NI,{size:18})}),g.jsx("button",{onClick:()=>o(f),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:g.jsx(zue,{size:18})})]})]})]})}const WI=({options:e=[],value:t,onChange:n})=>{const[r,i]=k.useState(!1),o=k.useRef(null);return k.useEffect(()=>{const a=s=>{o.current&&!o.current.contains(s.target)&&i(!1)};return document.addEventListener("mousedown",a),()=>{document.removeEventListener("mousedown",a)}},[]),g.jsxs("div",{ref:o,className:"relative h-[32px]",children:[g.jsxs("div",{className:"flex items-center justify-between gap-[10px] px-[12px] py-[8px] border border-[#E2E8F0] rounded-[4px] cursor-pointer min-w-[140px]",onClick:()=>i(!r),children:[g.jsx("div",{className:"text-[12px] leading-[16px] min-w-[109px] text-[#64748B]",children:t}),g.jsx(Bue,{size:16,className:"text-[#64748B]"})]}),r&&g.jsx("div",{className:"absolute top-[110%] left-0 w-full bg-white border border-[#E2E8F0] rounded-[8px] shadow-md z-10",children:e.map((a,s)=>g.jsx("div",{className:"px-[12px] py-[8px] text-[14px] text-[#334155] hover:bg-[#F1F5F9] cursor-pointer",onClick:()=>{n(a),i(!1)},children:a},s))})]})},Sfe=({data:e})=>{const[t,n]=k.useState({}),[r,i]=k.useState("Kosmo One"),o=["Kosmo One","Kosmo Two","Kosmo Three"],a=[{name:"L1",Cancelled:55,Open:50,OnHold:20,InProgress:10},{name:"L2",Cancelled:15,Open:15,OnHold:8,InProgress:5},{name:"L3",Cancelled:12,Open:75,OnHold:18,InProgress:7}],s=k.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:a,[e]),l=c=>{const{dataKey:u}=c;n(d=>({...d,[u]:!d[u]}))};return Array.isArray(e)&&e.length===0?g.jsx(kt,{title:"Escalation Level By Building",titleWeight:"semi-bold",className:"h-full",children:g.jsx("div",{className:"w-full h-[362px] flex items-center justify-center",children:g.jsx(ir,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):g.jsx(kt,{title:"Escalation Level By Building",titleWeight:"semi-bold",className:"h-[362px]",childrenClassName:"mt-[21px]",rightContent:g.jsx(WI,{options:o,value:r,onChange:c=>i(c)}),children:g.jsx("div",{className:"w-full flex items-center justify-center",children:Array.isArray(e)&&e.length===0?g.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):g.jsx("div",{className:"relative w-full h-[261px]",children:g.jsx(xt,{width:"100%",height:"100%",children:g.jsxs(go,{data:s,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[g.jsx(Qn,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),g.jsx($n,{dataKey:"name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),g.jsx(Pn,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),g.jsx(Ct,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},content:({active:c,payload:u,label:d})=>!c||!u||!u.length?null:g.jsxs("div",{style:{backgroundColor:"#000",borderRadius:"10px",padding:"10px 14px",fontSize:"12px",color:"#fff"},children:[g.jsx("div",{style:{marginBottom:"6px",fontWeight:600},children:d}),u.map((f,p)=>{const h=f.color||f.fill||"#fff";return g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[g.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:h,display:"inline-block"}}),g.jsx("span",{style:{color:"#D1D3D4"},children:f.name}),g.jsx("span",{style:{color:"#fff",fontWeight:600},children:f.value})]},p)})]})}),g.jsx(wc,{verticalAlign:"bottom",align:"center",onClick:l,content:({payload:c})=>g.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:c.map((u,d)=>g.jsxs("div",{onClick:()=>l({dataKey:u.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[g.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:t[u.dataKey]?"#CBD5E1":u.color}}),g.jsx("span",{style:{fontSize:"12px",color:t[u.dataKey]?"#CBD5E1":"#64748B"},children:u.value})]},d))})}),g.jsx(Xt,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:t.Open}),g.jsx(Xt,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:t.Cancelled}),g.jsx(Xt,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:t.OnHold,name:"On-Hold"}),g.jsx(Xt,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:t.InProgress,name:"In Progress"})]})})})})})},Efe=({data:e=[]})=>{const[t,n]=k.useState("Kosmo One"),r=["Kosmo One","Kosmo Two","Kosmo Three"],i=Array.isArray(e)?e:[],o=!i.length||i.every(a=>a.no_of_visitors===0);return g.jsx(kt,{title:"Top 5 Tenants by Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-[20px]",rightContent:g.jsx(WI,{options:r,value:t,onChange:a=>n(a)}),children:o?g.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:g.jsx(ir,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):g.jsx("div",{className:"w-full h-[280px]",children:g.jsx(xt,{width:"100%",height:"100%",children:g.jsxs(MT,{data:i,margin:{top:10,right:-10,left:-10,bottom:0},children:[g.jsx("defs",{children:g.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[g.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),g.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),g.jsx(Qn,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),g.jsx($n,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:a=>new Date(a).toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}),g.jsx(Pn,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),g.jsx(Ct,{cursor:!1,content:({active:a,payload:s,label:l,coordinate:c})=>{if(!a||!s?.length)return null;const u=new Date(l).toLocaleDateString("en-GB",{day:"2-digit",month:"short"});return g.jsx(Oa,{active:a,payload:s,label:u})}}),g.jsx(P0,{type:"monotone",dataKey:"no_of_visitors",stroke:"#6366F1",strokeWidth:2,fill:"url(#colorVisitors)",dot:{r:5,stroke:"#6366F1",strokeWidth:2,fill:"#fff"},activeDot:a=>{const{cx:s,cy:l,stroke:c}=a;return g.jsxs("g",{children:[g.jsx("circle",{cx:s,cy:l,r:6,fill:"#fff",stroke:"#6466F1",strokeWidth:2}),g.jsx("circle",{cx:s,cy:l,r:2.5,fill:"#6466F1"})]})}})]})})})})},Ofe=({data:e})=>{const t=[{name:"Kosmo One",total:29,pending:1,cancelled:2},{name:"OWC",total:23,pending:9,cancelled:3},{name:"Exora",total:40,pending:12,cancelled:1},{name:"OIC - T3",total:27,pending:19,cancelled:8}],n=e&&e.length?e:t;return g.jsx(kt,{title:"Building Wise Approvals",titleWeight:"semi-bold",className:"h-full",childrenClassName:"mt-[34px]",children:g.jsxs("div",{className:"w-full border border-[#EBEBEB] rounded-[10px] overflow-hidden",children:[g.jsxs("div",{className:"grid grid-cols-4 bg-[#FAFAFA] px-[12px] py-[8px] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[g.jsx("div",{children:"Tenant"}),g.jsx("div",{className:"flex justify-end",children:"Total"}),g.jsx("div",{className:"flex justify-end",children:"Pending"}),g.jsx("div",{className:"flex justify-end",children:"Cancelled"})]}),g.jsx("div",{className:"max-h-[280px] overflow-y-auto hide-scrollbar",children:n.map((r,i)=>g.jsxs("div",{className:"grid grid-cols-4 p-[12px] text-[12px] leading-[16px] border-t border-[#EBEBEB]",children:[g.jsx("div",{className:"text-[#475569]",children:r.name}),g.jsx("div",{className:"flex justify-end text-[#36AB6C] font-[400]",children:r.total}),g.jsx("div",{className:"flex justify-end text-[#F2A815] font-[400]",children:r.pending}),g.jsx("div",{className:"flex justify-end text-[#AB0000] font-[400]",children:r.cancelled})]},i))})]})})},Qh=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],Cfe=[{asset_group_name:"Lifts",asset_count:3,investment:"₹ 45L"},{asset_group_name:"Fire Systems",asset_count:16,investment:"₹ 28L"},{asset_group_name:"Generators",asset_count:16,investment:"₹ 95L"},{asset_group_name:"HVAC",asset_count:24,investment:"₹ 1.2Cr"},{asset_group_name:"Others",asset_count:97,investment:"₹ 52L"}],kfe=({rows:e,totalAssets:t})=>{const n=k.useMemo(()=>e?e.length===0?[]:e.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",color:Qh[o%Qh.length]})):Cfe.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",color:Qh[o%Qh.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?g.jsx(kt,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:g.jsx("div",{className:"flex items-center justify-center h-full",children:g.jsx(ir,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):g.jsx(kt,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:g.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[g.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[g.jsx(xt,{width:"100%",height:"100%",children:g.jsx(Oi,{children:g.jsx(Zr,{data:n,dataKey:"value",cx:"50%",cy:"50%",innerRadius:60,outerRadius:90,paddingAngle:2,stroke:"#FFFFFF",strokeWidth:2,startAngle:90,endAngle:-270,children:n.map((i,o)=>g.jsx(gn,{fill:i.color},o))})})}),g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[g.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),g.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),g.jsx("div",{className:"flex-1 max-w-[280px]",children:g.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[g.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] bg-[#F8FAFC]",children:[g.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),g.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-center",children:"Count"}),g.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-right",children:"Investment"})]}),g.jsx("div",{className:"max-h-[205px] overflow-y-auto hide-scrollbar",children:n.map((i,o)=>g.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] border-t border-[#F1F5F9]",children:[g.jsxs("div",{className:"flex items-center gap-[8px]",children:[g.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.color}}),g.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),g.jsx("div",{className:"text-[13px] text-[#64748B] text-center",children:i.value}),g.jsx("div",{className:"text-[13px] text-[#64748B] text-right",children:i.investment})]},o))})]})})]})})};se.AccessPointsUsage=nfe,se.Accounting=pue,se.Amenities=Hde,se.AmenitiesStatsCard=cfe,se.AmenityWiseRevenue=gfe,se.AssetValueBreakdown=Oue,se.AssetsByType=yfe,se.BlockWiseOccupancy=aue,se.BookingTrendChart=hfe,se.Bookings=ffe,se.Budgets=vue,se.BuildingWiseApprovals=Ofe,se.Card=je,se.CardAccess=BI,se.CashBankBalance=bue,se.CommercialAccessOverview=tfe,se.CommercialGuardPatrols=xfe,se.CommercialIncidentReports=wfe,se.CommercialOccupancy=$de,se.CommercialReportTable=_fe,se.Community=zie,se.Complaints=dde,se.ComplaintsByLevel=gde,se.DuesAgeing=wue,se.EmployeeFootfall=Bde,se.Engagement=Vie,se.EngagementStatsGrid=Lde,se.EscalationLevel=Sfe,se.EventsUtilisation=Pde,se.ExpenseCategories=Sue,se.Facilities=Hie,se.FinanceSummary=Yie,se.FoodBeverages=Vde,se.GateAndSecurityStatsGrid=lde,se.GateUpdates=Moe,se.GuardPatrols=Kue,se.Header=Z6,se.Helpdesk=Noe,se.HelpdeskStatsGrid=Ode,se.HourlyTrafficFlow=Zue,se.IncidentReports=tde,se.IncomeExpenditure=kI,se.MainHeader=d3,se.MaintenanceStatus=bfe,se.MetricCard=ofe,se.MobileAccess=BI,se.MoveInOutTrends=lue,se.NoticeBoardStatus=Tde,se.OccupancyOverview=rue,se.OrganisationWiseVisitors=lfe,se.PortfolioAssetsByType=kfe,se.RequestBox=yde,se.ResidentOverview=oue,se.RevenuebyCategory=kue,se.SingleStats=jde,se.StaffAttendance=ide,se.StatsGrid=Mue,se.TenantsByVisitors=Efe,se.TicketEscalation=Yde,se.TicketStatus=Kde,se.Tickets=EI,se.TicketsperCategory=ife,se.UnitStatus=EI,se.VisitorUpdates=Zde,se.WeeklyVisitorPattern=afe,Object.defineProperty(se,Symbol.toStringTag,{value:"Module"})}));
|