anarock-widgets 1.0.392 → 1.0.393
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
|
@@ -479,4 +479,4 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
479
479
|
${i?"bg-[#F7FEFA] text-[#1FA05B]":"bg-[#FBF4F4] text-[#EF4444]"} p-[4px] rounded-[4px] font-medium
|
|
480
480
|
`,children:n}),h.jsx("div",{className:"!text-[#64748B]",children:r})]})]})}const fhe=[{title:"Total Visitors",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Gb,iconColor:"text-[#329DFF]"},{title:"Active Incidents",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:sse,iconColor:"text-[#F69E0A]"},{title:"Missed Patrols",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:uhe,iconColor:"text-[#AB0000]"},{title:"Parking Usage",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:H8,iconColor:"text-[#36AB6C]"}];function phe({data:e}){const t=Array.isArray(e)&&e.length>0?e:fhe;return h.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>h.jsx(dhe,{...n},r))})}const hhe=[{title:"Maintenance",total:12,pending:3},{title:"Security",total:8,pending:1},{title:"Housekeeping",total:6,pending:2},{title:"Utilities",total:10,pending:4}],mhe=(e="")=>e.replace(/</g,"<").replace(/>/g,">").replace(/<[^>]*>/g,"").trim();function ghe({data:e}){const t=Array.isArray(e?.complaints_by_category)&&e.complaints_by_category.length>0?e.complaints_by_category.map(n=>({title:mhe(n.category_name)||"—",total:n.total||0,pending:n.pending||0})):hhe;return h.jsx(Ie,{title:"Complaints",titleClassName:"!text-[20px] !leading-[24px] font-semibold!",className:"w-full h-[362px] p-[24px]!",children:h.jsx("div",{className:"flex flex-col gap-[12px] max-h-full overflow-y-auto hide-scrollbar",children:t.map((n,r)=>h.jsxs("div",{className:"flex items-center justify-between bg-[#F8FAFC] rounded-[4px] p-[12px]",children:[h.jsxs("div",{className:"flex flex-col gap-[4px]",children:[h.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),h.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),h.jsxs("div",{className:"flex flex-col items-end gap-[4px]",children:[h.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#AB0000]",children:String(n.pending).padStart(2,"0")}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},r))})})}const vhe=[{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}],yhe=()=>{const e=[{label:"Open",color:"#EF4444"},{label:"In Progress",color:"#F59D0D"},{label:"Closed",color:"#12B981"}];return h.jsx("div",{style:{display:"flex",justifyContent:"space-between",gap:"15px"},children:e.map(t=>h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[h.jsx("div",{style:{width:"6px",height:"6px",backgroundColor:t.color,transform:"rotate(45deg)"}}),h.jsx("span",{style:{fontSize:"14px"},children:t.label})]},t.label))})},bhe=({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:vhe).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 h.jsxs(Ie,{title:"Complaints by Level",className:"w-full h-[362px] p-[24px]! gap-[18px]!",titleClassName:"!text-[20px] !leading-[24px] font-semibold!",children:[h.jsx(Pt,{width:"100%",height:"85%",children:h.jsxs(Mo,{data:t,margin:{top:5,right:-25,left:-30,bottom:5},children:[h.jsx(fr,{strokeDasharray:"0",vertical:!1}),h.jsx(Gn,{dataKey:"level"}),h.jsx($n,{domain:[0,r],ticks:Array.from({length:i+1},(a,s)=>s*o)}),h.jsx(kt,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},allowEscapeViewBox:{x:!0,y:!0},content:a=>!a.active||!a.payload||!a.payload.length?null:h.jsx(Qt,{...a,data:t,children:h.jsxs("div",{className:"bg-[#121212] rounded-[10px] px-[14px] py-[10px] text-[12px] text-white",children:[h.jsx("div",{className:"mb-[6px] font-semibold",children:a.label}),a.payload.map((s,l)=>{const c=s.color||s.fill||"#fff";return h.jsxs("div",{className:"flex items-center gap-[6px]",children:[h.jsx("span",{className:"w-2 h-2 rounded-full inline-block",style:{backgroundColor:c}}),h.jsx("span",{className:"text-[#D1D3D4]",children:s.name}),h.jsx("span",{className:"text-white font-semibold",children:s.value})]},l)})]})})}),h.jsx(qt,{dataKey:"open_count",name:"Open",stackId:"a",fill:"#EF4444",barSize:44,radius:[0,0,0,0]}),h.jsx(qt,{dataKey:"in_progress_count",name:"In Progress",stackId:"a",fill:"#F59D0D",barSize:44,radius:[0,0,0,0]}),h.jsx(qt,{dataKey:"closed_count",name:"Closed",stackId:"a",fill:"#12B981",barSize:44,radius:[0,0,0,0]})]})}),h.jsx(yhe,{})]})},xhe=[{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 whe({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})):xhe;return h.jsx(Ie,{title:"Request Box",titleClassName:"!text-[20px] !leading-[24px] font-semibold!",className:"w-full h-[362px] p-[24px]!",children:h.jsx("div",{className:"flex flex-col gap-[12px] max-h-full overflow-y-auto hide-scrollbar",children:t.map((n,r)=>h.jsxs("div",{className:"flex items-center justify-between bg-[#F8FAFC] rounded-[4px] p-[12px]",children:[h.jsxs("div",{className:"flex flex-col gap-[4px]",children:[h.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),h.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),h.jsxs("div",{className:"flex flex-col items-end gap-[4px]",children:[h.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#AB0000]",children:String(n.pending).padStart(2,"0")}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},`${n.title}-${r}`))})})}function _he(e){return yt({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 Ehe=["open_complaints","pending_requests","avg_response_time","resolution_rate"],She={open_complaints:{title:"Open Complaints",Icon:LD,iconColor:"#AB0000",deltaLabel:"Compared to last month"},pending_requests:{title:"Pending Requests",Icon:_he,iconColor:"#E7A015",deltaLabel:"Compared to last month"},avg_response_time:{title:"Avg Response Time",Icon:Q8,iconColor:"#1FA05B",deltaLabel:"Compared to last month"},resolution_rate:{title:"Resolution Rate",Icon:G8,iconColor:"#329DFF",deltaLabel:"Compared to last month"}},Ohe=({children:e,size:t=28,lineHeight:n=32,weight:r=500,color:i="#121212"})=>h.jsx("div",{style:{fontWeight:r,fontSize:`${t}px`,lineHeight:`${n}px`,color:i},children:e}),Che={primary:{size:28,lineHeight:32,weight:500}},khe={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 Phe({id:e,data:t}){return e&&t&&!t[e]&&t.current!==void 0?h.jsx(nP,{id:e,data:t}):h.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[16px]",children:Ehe.map(n=>h.jsx(nP,{id:n},n))})}function nP({id:e,data:t}){const n=She[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=lh,iconColor:a,deltaLabel:s}=n,l=t&&Object.keys(t).length>0?t:khe[e],c=r(e,l?.current),u=l?.trend_percent??"—";return l?.direction==="good"||l?.direction,h.jsx("div",{className:"h-[132px]",children:h.jsxs(Ie,{title:i,titleColor:a,icon:h.jsx("div",{className:"h-[20px] w-[20px] flex items-center justify-center",children:h.jsx(o,{className:"h-[20px] w-[20px]",style:{color:a}})}),childrenClassName:"!space-y-[12px]",iconClassName:"!gap-[12px]",children:[h.jsx(Ohe,{...Che.primary,children:c}),h.jsxs("div",{className:"flex items-center gap-[8px] text-[12px] leading-[16px]",children:[h.jsx(Pu,{value:u}),h.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:s})]})]})})}const Dhe=[{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"},{title:"Maintenance Meeting",date:"25 Jun 2025",rsvp:"45/60",utilisation:75,status:"Completed"},{title:"Maintenance Meeting",date:"25 Jun 2025",rsvp:"45/60",utilisation:75,status:"Completed"}];function Ahe({title:e,date:t,rsvp:n,utilisation:r,status:i}){return h.jsxs("div",{className:"bg-[#F8FAFC] p-[12px] rounded-[4px]",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("div",{className:"text-[16px] leading-[20px] font-semibold text-[#121212]",children:e}),h.jsx("div",{className:`!text-[12px] leading-[16px] font-medium p-[4px] rounded-[4px] ${i==="Completed"?"text-[#36AB6C] bg-[#E6F7EE]":i==="Upcoming"?"text-[#329DFF] bg-[#E6F2FF]":"text-slate-500 bg-slate-100"}`,children:i})]}),h.jsx("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:t}),h.jsxs("div",{className:"mt-[8px] flex justify-between items-center",children:[h.jsxs("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:[n," RSVP"]}),h.jsxs("div",{className:"text-[#3C82F6] text-[14px] leading-[18px] font-medium",children:[r,"% utilisation"]})]}),h.jsx("div",{className:"mt-[8px] w-full bg-[#F8FAFC] h-[6px] rounded",children:h.jsx("div",{className:"h-[6px] rounded bg-[#3C82F6]",style:{width:`${r}%`}})})]})}function The({data:e}){const t=Array.isArray(e)?e:Dhe;return h.jsx(Ie,{title:"Events Utilisation",className:"w-full h-[360px] p-[24px]!",childrenClassName:"overflow-y-auto hide-scrollbar",titleClassName:"!text-[20px] !leading-[24px] font-semibold!",children:h.jsx("div",{className:"m-auto space-y-[12px]",children:t?.length>0?t.map((n,r)=>h.jsx(Ahe,{...n},`${n.title}-${r}`)):h.jsx("div",{className:"h-full flex items-center justify-center",children:h.jsx(ln,{})})})})}const Nhe=[{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 jhe({label:e,value:t,subLabel:n,bgColor:r,textColor:i}){return h.jsxs("div",{className:`border-[0.5px] border-[#EBEBEB] rounded-[12px] p-[16px] ${r} h-[124px]`,children:[h.jsx("div",{className:`text-[16px] leading-[20px]! tracking-[-2%] font-medium ${i}`,children:e}),h.jsx("div",{className:"mt-[16px] text-[28px] leading-[32px] font-semibold text-[#121212]",children:t}),h.jsx("div",{className:"mt-[8px] !text-[12px] leading-[16px] text-[#64748B]",children:n})]})}function Mhe({data:e}){const t=Array.isArray(e)&&e.length>0?e:Nhe;return h.jsx(Ie,{title:"Notice Board Status",className:"w-full h-[360px] !p-[24px]",titleClassName:"!text-[20px] !leading-[24px] font-semibold!",children:h.jsx("div",{className:"grid grid-cols-2 gap-[24px]",children:t.map((n,r)=>h.jsx(jhe,{...n},`${n.label}-${r}`))})})}function Rhe({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=lh,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50",iconUrl:l}){return h.jsx(Ie,{title:e,icon:h.jsx("div",{className:"grid place-items-center ",children:l?h.jsx("img",{src:l,alt:"icon",className:"h-8 w-8 object-contain"}):h.jsx(o,{className:`h-8 w-8 ${a}`})}),className:"h-[132px]",children:h.jsxs("div",{children:[h.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),h.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[h.jsx(Pu,{value:n}),h.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}function Ihe({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 h.jsx("div",{className:"h-full",children:t.map((n,r)=>h.jsx(Rhe,{...n},r))})}function Fhe({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,icon:o,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return h.jsxs(Ie,{title:e,icon:h.jsx("div",{className:"size-[20px] grid place-items-center",children:h.jsx("img",{src:o,alt:e})}),className:"h-[132px]",titleClassName:"text-[#64748B]! leading-[20px]",childrenClassName:"space-y-[8px]!",children:[h.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),h.jsxs("div",{className:"flex items-center gap-[8px] text-[12px] leading-[16px]",children:[h.jsx(Pu,{value:n}),h.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:r})]})]})}const Lhe=[{title:"Notice",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,icon:"https://res.cloudinary.com/dzqlw1ixr/image/upload/v1773902569/notice_djcorh.svg"},{title:"Post",value:83,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,icon:"https://res.cloudinary.com/dzqlw1ixr/image/upload/v1773902568/post_rivboo.svg"},{title:"Poll",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,icon:"https://res.cloudinary.com/dzqlw1ixr/image/upload/v1773902569/poll_b43jo0.svg"},{title:"Survey",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,icon:"https://res.cloudinary.com/dzqlw1ixr/image/upload/v1773902568/survey_yevzwi.svg"}];function $he({data:e}){const t=Array.isArray(e)&&e.length>0?e:Lhe;return h.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>h.jsx(Fhe,{...n},r))})}const rP=({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 h.jsxs("div",{className:"flex flex-col items-start",children:[h.jsx("div",{className:"w-2/3 min-w-[80px] h-5 rounded-full overflow-hidden",children:h.jsx("div",{className:`h-[11px] rounded-full ${n||""}`,style:{width:n==="bg-[#12B981]"?`${a+45}%`:`${a}%`}})}),h.jsx("div",{className:`${s} !text-[12px] font-bold mt-1`,children:i??0}),h.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-1",children:r??""})]})},HI=({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 h.jsx("div",{children:h.jsxs("div",{className:"bg-white !border-[0.5px] !border-[#EBEBEB] rounded-[12px] shadow-[0_0_12px_0_#EAF2FF] p-[16px] h-[128px]",children:[h.jsxs("div",{className:"flex items-center gap-[12px] h-[20px]",style:{marginBottom:"24px"},children:[h.jsx(Gb,{className:"!text-[20px] text-[#329DFF]"}),h.jsx("div",{className:"font-medium text-[#121212] text-[16px] leading-[20px]",children:"Occupancy Overview"})]}),h.jsxs("div",{className:"flex items-start justify-between",children:[h.jsxs("div",{className:"flex flex-col gap-[4px]",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] font-normal",children:"Total Occupants"}),h.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:i??0})]}),h.jsxs("div",{className:"flex items-end gap-[4px]",children:[h.jsx(rP,{value:o??0,total:s||1,colorClass:"bg-[#3C81F6]",label:(o??0)<=1?"Employee":"Employees"}),h.jsx(rP,{value:a??0,total:s||1,colorClass:"bg-[#8B5CF6]",label:(a??0)<=1?"Admin":"Admins"})]})]})]})})};Wn.register(Io,Fo,Bl,Dr);const YI=({data:e})=>{const t=e!=null,n=e?.employee_data,r=["HP","Adobe","Anarock","Swiggy","Infosys","Zepto"],i=[2e3,1700,1500,1200,900,800],o=[],a=[];if(t){if(n&&n.length>0)for(let d=0;d<n.length;d++)o.push(n[d].name),a.push(n[d].employees)}else for(let d=0;d<r.length;d++)o.push(r[d]),a.push(i[d]);let s=!1;if(t)if(!n||n.length===0)s=!0;else{s=!0;for(let d=0;d<n.length;d++)if(n[d].employees!==0){s=!1;break}}let l=0;for(let d=0;d<a.length;d++)a[d]>l&&(l=a[d]);const c={labels:o,datasets:[{data:a,backgroundColor:[],barThickness:34}]};for(let d=0;d<a.length;d++)c.datasets[0].backgroundColor.push("#3C81F6");const u={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff",displayColors:!1,callbacks:{label:d=>`Employees: ${d.parsed.y}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B",font:{size:12}}},y:{beginAtZero:!0,min:0,max:l>0?l+5:2e3,ticks:{stepSize:l>0?Math.ceil((l+5)/5):500,color:"#64748B",callback:d=>d},grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1}}}};return t&&s?h.jsx(Ie,{className:"w-full h-[238px]",title:"Employee Footfall",period:"Today",icon:h.jsx(tP,{className:"!text-[24px] text-[#8B5CF6]"}),children:h.jsx("div",{className:"h-full flex items-center justify-center",children:h.jsx(ln,{title:"No Employee footfall Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsxs(Ie,{className:"w-full h-[238px]",title:"Employee Footfall",period:"Today",icon:h.jsx(tP,{className:"!text-[24px] text-[#8B5CF6]"}),children:[h.jsxs("div",{className:"mb-[10px] mt-[8px] flex flex-col gap-[4px]!",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Employees Inside"}),h.jsx("div",{className:"text-[20px] leading-[24px] font-medium text-[#3C81F6]",children:t?e.total_employees:7500})]}),h.jsx("div",{className:"h-[110px]",children:h.jsx(Wl,{data:c,options:u})})]})},Bhe="Rs",iP=["bg-blue-500","bg-red-500","bg-purple-700"],Ca={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 zp(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 oP(e){if(e==null||e==="")return"0";if(typeof e=="number")return Z_(e);const t=Number(e);return Number.isNaN(t)?String(e):Z_(t)}function Whe(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||iP[p%iP.length]})),o=n?.totalOrders??n?.orders??Ca.summary.totalOrders,a=n?.revenueGenerated??n?.revenue??Ca.summary.revenueGenerated,s=zp(n?.growthPercentage??n?.revenueGrowth,Ca.summary.growthPercentage),l=zp(n?.growthTotalPercentage??n?.orderGrowth,Ca.summary.growthTotalPercentage),c=n?.currencyType||n?.currency||Bhe,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||Ca.title,period:t?.period||Ca.period,summary:{totalOrders:o,revenueGenerated:a,growthPercentage:s,growthTotalPercentage:l,currencyType:c},outlets:d.length>0?d:Ca.outlets}}function UI({data:e,title:t,period:n,icon:r}){const i=Whe(e),o=t||i.title,a=n||i.period,s=r||h.jsx(Upe,{className:"!text-[24px] text-[#FA7E28]"}),l=i.summary.totalOrders??0,c=oP(i.summary.revenueGenerated),u=zp(i.summary.growthPercentage,0),d=zp(i.summary.growthTotalPercentage,0),f=u>=0,p=d>=0;return h.jsx(Ie,{className:"h-[324px]",title:o,period:a,icon:s,children:h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"flex gap-[24px]",children:[h.jsxs("div",{className:"w-full flex flex-col gap-[8px]!",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Orders"}),h.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:l}),h.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?h.jsx(oa,{}):h.jsx(ia,{}),d,"%",h.jsx("span",{children:"from last month"})]})]}),h.jsx("div",{className:"w-full flex justify-end",children:h.jsxs("div",{className:"flex flex-col gap-[8px]",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] whitespace-nowrap",children:"Revenue Generated"}),h.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF] whitespace-nowrap",children:[i.summary.currencyType," ",c]}),h.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] whitespace-nowrap ${f?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[f?h.jsx(oa,{}):h.jsx(ia,{}),u,"%",h.jsx("span",{children:"from last month"})]})]})})]}),h.jsx("div",{className:"mt-[16px]",children:i.outlets.map((m,g)=>h.jsxs("div",{className:g===i.outlets.length-1?"":"mb-[16px]",children:[h.jsxs("div",{className:"flex justify-between text-sm mb-[8px]",children:[h.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:m.name}),h.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[h.jsxs("div",{className:"text-[#64748B] inline-block",children:[m.orders," orders"]}),h.jsxs("div",{className:"mx-2 text-[#121212] inline-block",children:[i.summary.currencyType," ",oP(m.revenue)]})]})]}),h.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:h.jsx("div",{className:`h-[11px] rounded-full ${m.color}`,style:{width:`${m.percentage}%`}})})]},`${m.name}-${g}`))})]})})}function KI({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??"Rs"},chartData:Array.isArray(e?.chart_data)?e.chart_data.map(m=>({facility_name:m?.facility_name,total_bookings:m?.total_bookings??0,paid_revenue:m?.paid_revenue??"0",isPaid:m?.is_paid===!0})):[]}:e||{},n=t?.amenitySummary||{},i=(Array.isArray(t?.chartData)?t.chartData:[]).map(m=>({...m,isPaid:m?.isPaid===!0})),o=i.length>0&&i.every(m=>m?.isPaid===!1),a=n?.totalBookings||0,s=n?.bookingGrowth;let l=0;if(typeof s=="number")l=s;else if(typeof s=="string"){const m=s.replace("%","").trim(),g=Number(m);l=isNaN(g)?0:g}const c=i.reduce((m,g)=>{const v=g?.total_bookings||0;return m+v},0),u=i.map(m=>{const g=m?.total_bookings||0,v=m?.isPaid?`${n?.currencyType||"Rs"} ${m?.paid_revenue||"0.00"}`:"",x=c>0?Math.round(g/c*100):0;return{name:m?.facility_name||"Unknown",bookings:g,revenue:v,percentage:x,color:"bg-[#3C81F6]",isPaid:m?.isPaid}}),d=n?.growthPercentage;let f=null;if(typeof d=="number")f=d;else if(typeof d=="string"){const m=d.replace("%","").trim(),g=Number(m);f=isNaN(g)?null:g}const p=f!==null?f>=0:!0;return h.jsx(Ie,{className:"h-[324px]",title:"Amenities",period:"Today",icon:h.jsx(qpe,{className:"!text-[24px] text-[#8B5CF6]"}),children:h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"flex gap-[24px]",children:[h.jsxs("div",{className:"w-full flex flex-col gap-[8px]!",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Bookings"}),h.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:a}),h.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?h.jsx(oa,{}):h.jsx(ia,{}),l,"%",h.jsx("span",{children:"from last month"})]})]}),!o&&h.jsx("div",{className:"w-full flex justify-end",children:h.jsxs("div",{className:"flex flex-col gap-[8px]",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] whitespace-nowrap",children:"Revenue Generated"}),h.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF] whitespace-nowrap",children:[n?.currencyType||"Rs"," ",n?.todayPaidRevenue??"0.00"]}),f!==null&&h.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] whitespace-nowrap ${p?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[p?h.jsx(oa,{}):h.jsx(ia,{}),f,"%",h.jsx("span",{children:"from last month"})]})]})})]}),h.jsx("div",{className:"mt-[16px]",children:u.length>0?u.map((m,g)=>h.jsxs("div",{className:g===u.length-1?"":"mb-[16px]",children:[h.jsxs("div",{className:"flex justify-between text-sm mb-[8px]",children:[h.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:m?.name}),h.jsxs("div",{className:"font-medium text-[12px] leading-[16px]",children:[h.jsxs("div",{className:"text-[#64748B] inline",children:[m?.bookings," ",m?.bookings<=1?"booking":"bookings"]}),m?.isPaid&&h.jsx("div",{className:"mx-2 text-[#121212] inline",children:m?.revenue})]})]}),h.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:h.jsx("div",{className:`h-[11px] rounded-full ${m?.color}`,style:{width:`${m?.percentage}%`}})})]},g)):h.jsx("div",{className:"flex items-center justify-center h-[120px]",children:h.jsx("div",{className:"text-[12px] text-[#94A3B8]",children:"No amenity usage data available"})})})]})})}Wn.register(Io,Fo,Bl,Dr,Zr);function qI({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:!1,pointStyle:"rect",padding:12,boxWidth:20,boxHeight:8,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 h.jsx(Ie,{className:"h-[267px]",title:"Ticket Escalation Levels",period:"Today",icon:h.jsx(X8,{className:"!text-[24px] text-[#3C81F6]"}),children:h.jsx("div",{className:"h-full",children:h.jsx(Wl,{data:l,options:c})})})}const zhe=({active:e,payload:t})=>{if(!e||!t||!t.length)return null;const n=t[0],r=n.payload.color;return h.jsx("div",{style:{backgroundColor:"#000000",color:"#ffffff",padding:"8px 10px",borderRadius:"8px",fontSize:"12px"},children:h.jsxs("div",{className:"flex items-center gap-[8px] font-medium",children:[h.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:r}}),h.jsx("div",{children:n.name}),h.jsx("div",{className:"ml-2",children:n.value})]})})};function GI({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 h.jsx(Ie,{className:"h-[267px]",title:"Ticket Status",period:"Today",icon:h.jsx(Wf,{className:"!text-[24px] text-[#EF4444]"}),children:h.jsxs("div",{className:"flex h-full items-center gap-[16px]",children:[h.jsxs("div",{className:"w-[202px] h-[170px] relative",children:[h.jsx(Pt,{width:"100%",height:"100%",children:h.jsxs(Hi,{children:[h.jsx(ui,{data:i,innerRadius:55,outerRadius:85,dataKey:"value",stroke:"#FFFFFF",strokeWidth:2,children:i.map((a,s)=>h.jsx(Ln,{fill:a.color},s))}),h.jsx(kt,{content:a=>h.jsx(Qt,{...a,data:i,children:h.jsx(zhe,{...a})})})]})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsxs("div",{className:"flex items-baseline text-[18px] leading-[22px] font-medium text-[#121212]",children:[h.jsx("div",{children:r(n.completed)}),h.jsxs("div",{className:"text-[18.18px] leading-[22.22px] text-[#121212]",children:["/",o]})]}),h.jsx("div",{className:"text-[10.1px] leading-[14.14px] text-[#64748B]",children:"Completed"})]})]}),h.jsx("div",{className:"flex-1 space-y-2",children:i.map(a=>h.jsxs("div",{className:"flex items-center justify-between text-[12px] leading-[17px] mt-[12px]",children:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"h-[7px] w-[16px]",style:{backgroundColor:a.color}}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]}),h.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px] font-medium",children:a.value})]},a.name))})]})})}const aP={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 Vhe(e){const t=e>=12?"PM":"AM";let n=e%12;return n===0&&(n=12),`${n} ${t}`}function Hhe(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 Yhe(e=[]){return Array.from({length:24},(t,n)=>{const r=e.find(i=>Hhe(i?.hour)===n)||{};return{hour:n,time:Vhe(n),walkins:Number(r?.walkins??0),approved:Number(r?.pre_approved??r?.preApproved??r?.approved??0)}})}function sP({title:e,color:t,rows:n=[],children:r}){const i=h.jsxs("div",{className:"bg-white rounded-[12px] min-w-[260px] p-[16px] border-[0.5px] border-[#EBEBEB] shadow-[0px_0px_12px_0px_#EAF2FF]",children:[h.jsx("div",{className:"flex items-center gap-[8px] font-medium text-[#121212]",children:h.jsx("div",{children:e??""})}),h.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})=>h.jsxs("div",{className:"flex justify-between text-[14px] leading-[18px]",children:[h.jsx("div",{className:"text-[#64748B]",children:o??""}),h.jsx("div",{className:"font-semibold",style:{color:s||"#121212"},children:a??0})]},o))})]});return h.jsx(KR,{placement:"right-start",interactive:!0,delay:[100,0],offset:[6,0],appendTo:()=>document.body,maxWidth:"none",render:o=>h.jsx("div",{tabIndex:"-1",...o,children:i}),children:r})}function Uhe({active:e,payload:t}){return!e||!t?.length?null:h.jsx("div",{className:"rounded-[8px] bg-[#121212] px-[12px] py-[8px] text-[12px] text-white shadow-lg",children:t.map(n=>h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:n.stroke}}),h.jsx("span",{className:"min-w-[82px] text-[#D1D3D4]",children:n.name}),h.jsx("span",{className:"font-semibold",children:n.value})]},n.dataKey))})}function XI({data:e}){const t=e&&Object.keys(e).length?e:aP,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 Yhe(l.length?l:aP.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 h.jsx(Ie,{className:"h-[377px]",title:"Visitor Updates",period:`Today at ${s}`,icon:h.jsx(Kb,{className:"!text-[24px] text-[#8B5CF6]"}),children:h.jsxs("div",{className:"flex flex-col gap-[24px]",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-y-4 gap-x-6",children:[h.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[h.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Total Visitors"}),h.jsx("div",{className:"text-[20px] font-medium text-[#08B6D4]",children:n?.totalVisitorsToday??0})]}),h.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[h.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Peak Time"}),h.jsx("div",{className:"text-[20px] font-medium text-[#8B5CF6]",children:n?.peakTime??"-"})]}),h.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[h.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Active Walk-ins"}),h.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[h.jsx("div",{className:"text-[28px] text-[#1FA05B] leading-[32px]",children:r?.walkins?.currently_inside??0}),h.jsx(sP,{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:h.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.walkins?.total_visited_today??0]})})]})]}),h.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[h.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Pre-approved Check-ins"}),h.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[h.jsx("div",{className:"text-[28px] text-[#E7A015] leading-[32px]",children:r?.preApproved?.completed_visits??0}),h.jsx(sP,{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:h.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.preApproved?.total_expected_today??0]})})]})]})]}),h.jsx("div",{className:"w-full h-[149px]",children:h.jsx(Pt,{width:"100%",height:"100%",children:h.jsxs(a1,{data:i??[],margin:{top:5,right:0,left:0,bottom:-10},children:[h.jsx(fr,{stroke:"#E5E7EB",strokeDasharray:"4 4",vertical:!1}),h.jsx(Gn,{dataKey:"time",tickFormatter:(l,c)=>c%4===0?l:"",axisLine:!1,tickLine:!1,tick:{fill:"#121212",fontSize:10,fontWeight:400}}),h.jsx($n,{width:24,axisLine:!1,tickLine:!1,allowDecimals:!1,ticks:o,domain:[0,a],tick:{fill:"#64748B",fontSize:10,fontWeight:400}}),h.jsx(kt,{content:l=>h.jsx(Qt,{...l,data:i,children:h.jsx(Uhe,{...l})})}),h.jsx(Zo,{type:"monotone",dataKey:"walkins",stroke:"#22C55E",strokeWidth:2,dot:!1,name:"Walk-ins",isAnimationActive:!1}),h.jsx(Zo,{type:"monotone",dataKey:"approved",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved",isAnimationActive:!1})]})})})]})})}function Khe(){return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"px-[20px] grid grid-cols-1 lg:grid-cols-[minmax(0,1fr)_minmax(0,2fr)] gap-[24px] mt-6 auto-rows-fr",children:[h.jsx(HI,{}),h.jsx(YI,{})]}),h.jsxs("div",{className:"px-[20px] grid grid-cols-1 lg:grid-cols-3 gap-[24px] mt-6 auto-rows-fr",children:[h.jsx("div",{className:"mt-[-115px]",children:h.jsx(XI,{})}),h.jsx(GI,{}),h.jsx(qI,{})]}),h.jsxs("div",{className:"px-[20px] grid grid-cols-1 lg:grid-cols-3 gap-[24px] mt-6 auto-rows-fr",children:[h.jsx(IR,{}),h.jsx(KI,{}),h.jsx(UI,{})]})]})}function QI({data:e=null}){const t={total_entries:79.6,entries:59350,exit:40950},n=e&&Object.keys(e).length>0?e:t,r=c=>{const u=Number(c);return isNaN(u)?0:u},i=r(n.entries),o=r(n.exit),a=e&&Object.keys(e).length>0&&Number(e.entries)===0&&Number(e.exit)===0,s=[{name:"Entries",value:i,color:"#8B5CF6"},{name:"Exit",value:o,color:"#329DFF"}],l=r(n.total_entries);return h.jsx(St,{className:"h-[362px]",title:"Access Overview",titleWeight:"semi-bold",children:a?h.jsx("div",{className:"h-[300px] flex items-center justify-center",children:h.jsx(ln,{title:"No access Point Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsxs("div",{className:"flex flex-col items-center mt-[16px]",children:[h.jsxs("div",{className:"relative w-[212px] h-[212px]",children:[h.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:h.jsx("div",{className:"w-[130px] h-[130px] rounded-full shadow-[0px_12px_35px_rgba(0,0,0,0.12)]"})}),h.jsx("div",{className:"h-[212px]",children:h.jsx(Pt,{width:"100%",height:"100%",children:h.jsxs(Hi,{children:[h.jsx(ui,{data:s,dataKey:"value",innerRadius:65,outerRadius:100,startAngle:360,endAngle:-180,paddingAngle:1,stroke:"transparent",children:s.map((c,u)=>h.jsx(Ln,{fill:c.color},u))}),h.jsx(kt,{content:c=>h.jsx(Qt,{...c,data:s,children:h.jsx(Gr,{...c})})})]})})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsx("div",{className:"text-[22px] leading-[27px] font-medium text-[#121212]",children:l}),h.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B]",children:"Total Access"})]})]}),h.jsxs("div",{className:"mt-[28px] flex justify-between w-full px-[20px]",children:[h.jsxs("div",{className:"flex flex-col items-center",children:[h.jsxs("div",{className:"flex items-center gap-[6px]",children:[h.jsx("div",{className:"w-[14px] h-[6px] bg-[#8B5CF6]"}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Entries"})]}),h.jsx("div",{className:"text-[18px] font-medium text-[#8B5CF6] mt-[4px]",children:i.toLocaleString()})]}),h.jsxs("div",{className:"flex flex-col items-center",children:[h.jsxs("div",{className:"flex items-center gap-[6px]",children:[h.jsx("div",{className:"w-[14px] h-[6px] bg-[#329DFF]"}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Exit"})]}),h.jsx("div",{className:"text-[18px] font-medium text-[#329DFF] mt-[4px]",children:o.toLocaleString()})]})]})]})})}function ZI({title:e="Access",data:t=[],height:n="h-[362px]"}){const r=i=>i==null?"0":Number(i).toLocaleString();return h.jsx(St,{className:n,title:e,titleWeight:"semi-bold",children:h.jsxs("div",{className:"rounded-[12px] overflow-hidden mt-[16px]",children:[h.jsxs("div",{className:"grid grid-cols-2 bg-[#F8FAFC] py-[8px] px-[12px] text-[12px] leading-[16px] font-medium text-[#64748B]",children:[h.jsx("div",{children:"Point"}),h.jsx("div",{className:"text-right",children:"Access"})]}),t.map((i,o)=>h.jsxs("div",{className:"grid grid-cols-2 p-[12px] text-[14px] border-t border-[#E2E8F0]",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:i.label}),h.jsx("div",{className:"text-[12px] leading-[16px] text-right font-medium",style:{color:i.color||"#000"},children:r(i.value)})]},o))]})})}function JI({data:e=[]}){const[t,n]=k.useState([]),r=e&&e.length?e:[],i=!e||e.length===0,o=e&&e.length>0&&e.every(c=>Number(c.entries)===0&&Number(c.exit)===0),a=i||o,s=c=>c>=1e3?`${c/1e3}K`:c,l=c=>{n(u=>u.includes(c)?u.filter(d=>d!==c):[...u,c])};return h.jsx(St,{title:"Access Points Usage",titleWeight:"semi-bold",className:"h-[362px]",children:a?h.jsx("div",{className:"h-[270px] flex items-center justify-center",children:h.jsx(ln,{title:"No access Point Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsx("div",{className:"mt-[24px] h-[270px] w-full",children:h.jsx(Pt,{width:"100%",height:"100%",children:h.jsxs(Mo,{data:r,barSize:54,margin:{top:0,right:0,left:-20,bottom:0},children:[h.jsx(fr,{strokeDasharray:"8 8",vertical:!1}),h.jsx(Xx,{y:0,stroke:"#EBEBEB"}),h.jsx(Gn,{dataKey:"block_name",tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),h.jsx($n,{tickFormatter:s,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),h.jsx(kt,{cursor:!1,content:c=>h.jsx(Qt,{...c,data:r,children:(()=>{if(!c.active||!c.label)return null;const u=r.find(d=>d.block_name===c.label);return h.jsxs("div",{className:"bg-[#111] text-white px-[14px] py-[8px] rounded-[6px] flex flex-col gap-[6px] text-[13px]",children:[h.jsx("div",{className:"font-semibold",children:c.label}),!t.includes("entries")&&h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-2 h-2 rounded-full bg-[#329DFF]"}),h.jsx("div",{className:"text-[#aaa]",children:"Entries"}),h.jsx("div",{className:"font-bold",children:u?.entries??0})]}),!t.includes("exit")&&h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-2 h-2 rounded-full bg-[#76BDFF]"}),h.jsx("div",{className:"text-[#aaa]",children:"Exit"}),h.jsx("div",{className:"font-bold",children:u?.exit??0})]})]})})()})}),h.jsx(Sl,{verticalAlign:"bottom",height:36,content:()=>{const c=[{key:"entries",label:"Entries",color:"#329DFF"},{key:"exit",label:"Exit",color:"#76BDFF"}];return h.jsx("div",{style:{display:"flex",gap:"20px",justifyContent:"center",marginTop:"20px"},children:c.map((u,d)=>{const f=t.includes(u.key);return h.jsxs("div",{onClick:()=>l(u.key),style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer",opacity:f?.4:1},children:[h.jsx("div",{style:{width:"20px",height:"8px",backgroundColor:u.color}}),h.jsx("div",{style:{fontSize:"12px",color:"#64748B"},children:u.label})]},d)})})}}),h.jsx(qt,{dataKey:"entries",stackId:"a",fill:"#329DFF",hide:t.includes("entries")}),h.jsx(qt,{dataKey:"exit",stackId:"a",fill:"#76BDFF",hide:t.includes("exit")})]})})})})}function qhe(e){return yt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"},child:[]},{tag:"line",attr:{x1:"16",y1:"2",x2:"16",y2:"6"},child:[]},{tag:"line",attr:{x1:"8",y1:"2",x2:"8",y2:"6"},child:[]},{tag:"line",attr:{x1:"3",y1:"10",x2:"21",y2:"10"},child:[]}]})(e)}function Ghe(e){return yt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"6 9 12 15 18 9"},child:[]}]})(e)}function Xhe(e){return yt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},child:[]},{tag:"polyline",attr:{points:"7 10 12 15 17 10"},child:[]},{tag:"line",attr:{x1:"12",y1:"15",x2:"12",y2:"3"},child:[]}]})(e)}function xs({text:e="Smart Access",Icon:t,iconColor:n="#329DFF"}){return h.jsxs("div",{className:"px-[20px] pt-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[t?h.jsx("div",{className:"flex items-center justify-center",children:h.jsx(t,{size:20,style:{color:n}})}):null,h.jsx("div",{className:"text-[24px] leading-[32px] font-semibold text-[#121212]",children:e})]}),h.jsxs("div",{className:"flex items-center gap-[12px]",children:[h.jsxs("div",{className:"flex items-center gap-[8px] bg-white px-[16px] py-[8px].5 rounded-[8px] border border-[#EBEBEB] text-sm font-medium text-[#64748B] hover:bg-gray-100 transition-colors cursor-pointer",children:[h.jsx("div",{className:"flex items-center",children:h.jsx(qhe,{size:16})}),h.jsx("div",{children:"Today"}),h.jsx("div",{className:"flex items-center",children:h.jsx(Ghe,{size:16})})]}),h.jsxs("div",{className:"flex items-center gap-[8px] px-[12px] py-[8px] rounded-[8px] border border-[#EBEBEB] bg-white text-[#7C3AED] text-[14px] font-medium hover:bg-[#E9D5FF] transition cursor-pointer",children:[h.jsx("div",{children:"Export Report"}),h.jsx("div",{className:"flex items-center",children:h.jsx(Xhe,{size:16})})]})]})]}),h.jsx("div",{className:"mt-4 border-t border-dashed border-[#E2E8F0]"})]})}function Qhe(){return h.jsxs(h.Fragment,{children:[h.jsx(xs,{text:"Smart Access",Icon:Fpe}),h.jsxs("div",{className:"px-[20px] grid grid-cols-1 lg:grid-cols-3 gap-[24px] mt-6 auto-rows-fr",children:[h.jsx(QI,{}),h.jsx(JI,{})]}),h.jsx("div",{className:"mt-7 px-[20px]"})]})}Wn.register(pm,Dr,Zr);const Zhe={id:"bottomGlow",afterDatasetsDraw(e,t,n){if(!n?.enabled)return;const r=e.getDatasetMeta(0);if(!r?.data?.[0])return;const{ctx:i}=e,{x:o,y:a,innerRadius:s}=r.data[0],l=Math.max(s-2,0),c=a+l*.9,u=i.createRadialGradient(o,c,0,o,c,l*1.08);u.addColorStop(0,n.color??"rgba(186, 230, 253, 0.72)"),u.addColorStop(.3,"rgba(186, 230, 253, 0.4)"),u.addColorStop(.58,"rgba(186, 230, 253, 0.16)"),u.addColorStop(1,"rgba(186, 230, 253, 0)"),i.save(),i.beginPath(),i.arc(o,a,l,0,Math.PI*2),i.clip(),i.fillStyle=u,i.beginPath(),i.ellipse(o,c,l*1.08,l*.52,0,0,Math.PI*2),i.fill(),i.restore()}},Jhe={id:"centerText",afterDraw(e,t,n){const{ctx:r}=e,i=e.getDatasetMeta(0);if(!i?.data?.[0])return;const{x:o,y:a}=i.data[0],{top:s="",bottom:l="",topSize:c=24,bottomSize:u=9,topColor:d="#121212",bottomColor:f="#121212"}=n||{};r.save(),r.textAlign="center",r.textBaseline="middle",r.fillStyle=d,r.font=`600 ${c}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(s,o,a-6),r.fillStyle=f,r.font=`500 ${u}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(l,o,a+22),r.restore()}},e4=({title:e="Tickets",icon:t,firstLabel:n="First",firstValue:r=0,firstColor:i="#12B981",secondLabel:o="Second",secondValue:a=0,secondColor:s="#AB0000",growthPercentage:l="+0%",growthText:c="Compared to last month",totalLabel:u="Total",centerTopColor:d="#0F172A",centerBottomColor:f="#64748B",centerTopSize:p,centerBottomSize:m,showBottomGlow:g=!1,bottomGlowColor:v="rgba(186, 230, 253, 0.75)",widgetType:x="",resolvedWidgetType:_="",data:w})=>{const y=w?.title??e;w?.icon;const E=w?.firstLabel??n,S=Number(w?.firstValue??r??0),P=w?.firstColor??i,D=w?.secondLabel??o,T=Number(w?.secondValue??a??0),R=w?.secondColor??s,A=w?.growthPercentage??l??"+0%",C=w?.growthText??c,j=w?.totalLabel??u,N=w?.widgetType??x??_,M=w?.centerTopSize??p??(N==="commercial"?34:20),L=w?.centerBottomSize??m??(N==="commercial"?14:10),B=w?.showBottomGlow??g,V=w?.bottomGlowColor??v,z=S+T,W={labels:[E,D],datasets:[{data:[S,T],backgroundColor:[P,R],borderWidth:2,hoverOffset:4}]},Q={responsive:!0,maintainAspectRatio:!1,cutout:"68%",plugins:{legend:{display:!1},tooltip:{enabled:!1,external:li()},centerText:{top:`${z}`,bottom:j,topSize:M,bottomSize:L,topColor:d,bottomColor:f},bottomGlow:{enabled:B,color:V}}},G=[{label:E,value:S,color:P},{label:D,value:T,color:R}],ie=A.toString().includes("+"),Z=A.toString().includes("-"),re=ie?"#1FA05B":"#AB0000";return h.jsx(St,{title:y,className:"h-[362px] leading-[24px]",titleWeight:"semi-bold",children:h.jsxs("div",{className:"grid grid-cols-12 gap-[16px] items-center",children:[h.jsxs("div",{className:"col-span-5 space-y-[12px]",children:[G.map((oe,le)=>h.jsxs("div",{children:[h.jsx("div",{className:"text-[12px] text-[#64748B] mb-[8px]",children:oe.label}),h.jsx("div",{className:"text-[28px] leading-[32px]",style:{color:oe.color},children:oe.value})]},le)),h.jsxs("div",{className:`text-[12px] flex gap-[4px] ${N==="commercial"?"mt-[20px]":""} items-center`,style:{color:re},children:[ie&&h.jsx(oa,{}),Z&&h.jsx(ia,{}),h.jsx("div",{children:A.replace("+","").replace("-","")}),h.jsx("div",{className:"text-[#64748B] text-[12px] leading-[14px] ml-[4px] whitespace-nowrap",children:C})]})]}),h.jsx("div",{className:"col-span-7",children:h.jsx("div",{className:`${N==="commercial"?"h-[260px] max-w-[263px]":"h-[158px] w-[158px]"} ml-auto mr-2`,children:h.jsx(mm,{data:W,options:Q,plugins:[Zhe,Jhe]})})})]})})},eme=({x:e,y:t,payload:n})=>{const r=n.value.split(" ");return h.jsx("g",{transform:`translate(${e},${t})`,children:h.jsx("text",{x:-85,y:0,textAnchor:"start",fill:"#121212",fontSize:14,children:r.map((i,o)=>h.jsx("tspan",{x:-85,dy:o===0?0:16,children:i},o))})})};function t4({data:e=[]}){const t=e&&e.length>0,n=e.map(r=>({name:r.category_name,value:r.total_complaints,color:"#08B6D4"}));return h.jsx(St,{title:"Tickets per Category",className:"h-[362px]",titleWeight:"semi-bold",childrenClassName:"h-full mt-[24px]!",children:t?h.jsx("div",{className:"w-full h-[262px]",children:h.jsx(Pt,{width:"100%",height:"100%",children:h.jsxs(Mo,{data:n,layout:"vertical",margin:{top:0,right:8,left:-20,bottom:0},children:[h.jsx(fr,{strokeDasharray:"3 3",horizontal:!1,stroke:"#E5E7EB"}),h.jsx(Gn,{type:"number",tick:{fill:"#94A3B8",fontSize:12},axisLine:!0,tickLine:!1,tickMargin:10,allowDecimals:!1}),h.jsx($n,{type:"category",dataKey:"name",axisLine:!1,tickLine:!1,width:132,tick:h.jsx(eme,{})}),h.jsx(kt,{cursor:{fill:"transparent"},position:{x:300,y:0},allowEscapeViewBox:{x:!0,y:!0},content:r=>r.active?h.jsx(Qt,{...r,data:n,children:h.jsx(Gr,{...r})}):null}),h.jsx(qt,{dataKey:"value",barSize:36,fill:"#08B6D4"})]})})}):h.jsx(ln,{title:"No Tickets Found",description:"Catch up all the data. Change the date range to see the data."})})}function vb({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 h.jsxs("div",{className:"relative bg-white !border-[0.5px] !border-[#EBEBEB] !rounded-[12px] !shadow-[0_0_12px_0_#EAF2FF] p-[16px] h-[132px]",children:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[e&&h.jsx("div",{className:"h-[20px] w-[20px]",style:{color:t,display:"flex",alignItems:"center",justifyContent:"center"},children:h.jsx(e,{className:"h-[20px] w-[20px]"})}),h.jsx("div",{className:"text-[16px] leading-[20px] tracking-[-2%] font-medium text-[#64748B]",children:n})]}),h.jsx("div",{className:"mt-[16px] text-[28px] leading-[32px] font-medium text-[#121212]",children:r}),(i||o)&&h.jsxs("div",{className:"mt-[12px] flex items-center gap-[8px]",children:[i&&h.jsxs("div",{className:"flex items-center gap-[4px] text-[12px] leading-[16px] font-medium",style:{color:l},children:[s?h.jsx(oa,{}):h.jsx(ia,{}),Math.abs(a),"%"]}),o&&h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:o})]})]})}function tme(){const e=[{category_name:"Plumbing",total_complaints:12},{category_name:"Electrical Issues",total_complaints:8},{category_name:"Cleaning Services",total_complaints:15}];return h.jsxs(h.Fragment,{children:[h.jsx(xs,{text:"Helpdesk",Icon:bpe,iconColor:"#12B981"}),h.jsxs("div",{className:"flex gap-[24px] mt-[24px] px-[16px]",children:[h.jsx("div",{className:"w-[380px] h-full space-y-[16px]",children:h.jsx(e4,{title:"Tickets",icon:h.jsx(Wf,{className:"h-6 w-6 text-[#EF4444]"}),firstLabel:"Resolved",firstValue:779,firstColor:"#12B981",secondLabel:"Open",secondValue:83,secondColor:"#AB0000",growthPercentage:"+9.1%",growthColor:"#1FA05B",growthText:"Compared to last month",widgetType:"commercial",totalLabel:"Total",centerTopSize:34,centerBottomSize:14,showBottomGlow:!0})}),h.jsx("div",{className:"flex-1",children:h.jsx(t4,{data:e})})]})]})}const n4=({data:e=[],onDateChange:t})=>{const[n,r]=k.useState(new Date),[i,o]=k.useState(!1),s=(v=>{const x=new Date(v);return x.setDate(x.getDate()-6),x})(n),l=v=>{try{return v.toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}catch{return""}},c=v=>{const x=new Date(v),_=new Date(x);_.setDate(_.getDate()-6),t&&t(_.toISOString(),x.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 x=v||new Date;r(x),c(x),o(!1)},m=Array.isArray(e)?e:[],g=!m.length||m.every(v=>v.no_of_visitors===0);return h.jsxs(St,{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&&h.jsx("div",{className:"anarock-datepicker absolute top-[70px] right-[24px] z-50",children:h.jsx(jD,{selected:n,onChange:p,inline:!0,maxDate:new Date,showYearDropdown:!0,scrollableYearDropdown:!0,yearDropdownItemNumber:40})}),g?h.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:h.jsx(ln,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsx("div",{className:"w-full h-[280px]",children:h.jsx(Pt,{width:"100%",height:"100%",children:h.jsxs(tR,{data:m,margin:{top:10,right:-10,left:-10,bottom:0},children:[h.jsx("defs",{children:h.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[h.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),h.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),h.jsx(fr,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),h.jsx(Gn,{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"})}),h.jsx($n,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),h.jsx(kt,{cursor:!1,content:v=>{const{active:x,payload:_,label:w}=v;if(!x||!_?.length)return null;const y=new Date(w).toLocaleDateString("en-GB",{day:"2-digit",month:"short"});return h.jsx(Qt,{...v,data:m,children:h.jsx(Gr,{active:x,payload:_,label:y})})}}),h.jsx(t1,{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:x,cy:_,stroke:w}=v;return h.jsxs("g",{children:[h.jsx("circle",{cx:x,cy:_,r:6,fill:"#fff",stroke:"#6466F1",strokeWidth:2}),h.jsx("circle",{cx:x,cy:_,r:2.5,fill:"#6466F1"})]})}})]})})})]})},nme=[{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}],r4=({data:e,title:t,bar:n})=>{const r=Array.isArray(e)&&e?.length===0,i=e==null?nme:Array.isArray(e)?e:[];return h.jsx(St,{title:t||"Organisation Wise Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",children:h.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:r?h.jsx(ln,{title:t||"Organisation Wise Visitors",description:"Catch up all the data. Change the date range to see the data."}):h.jsx(Pt,{width:"100%",height:"100%",children:h.jsxs(Mo,{data:i||[],margin:{top:10,right:10,left:10,bottom:-10},barCategoryGap:35,children:[h.jsx(fr,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),h.jsx(Gn,{dataKey:"building_name",tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1}),h.jsx($n,{width:40,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1}),h.jsx(kt,{cursor:!1,content:o=>o.active?h.jsx(Qt,{...o,data:i,children:h.jsx(Gr,{...o})}):null}),h.jsx(qt,{dataKey:"no_of_visitors",name:"Visitors",maxBarSize:55,fill:n||"#3C81F6"})]})})})})};function rme(){const e=[{day:"2026-03-05",no_of_visitors:0},{day:"2026-03-06",no_of_visitors:0},{day:"2026-03-07",no_of_visitors:0},{day:"2026-03-08",no_of_visitors:14},{day:"2026-03-09",no_of_visitors:0},{day:"2026-03-10",no_of_visitors:0},{day:"2026-03-11",no_of_visitors:0}];return h.jsxs(h.Fragment,{children:[h.jsx(xs,{text:"Visitors",Icon:vpe,iconColor:"#884EA7"}),h.jsxs("div",{className:"grid grid-cols-2 gap-[24px] mt-[24px]",children:[h.jsx(vb,{icon:Hpe,iconColor:"#329DFF",title:"Visitors Expected",value:"1,247",percentage:"+11.0%",percentageText:"Compared to last month"}),h.jsx(vb,{icon:rpe,iconColor:"#1FA05B",title:"Visitors Inside",value:"800",percentageText:"Across organisations"})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-[24px] mt-[24px]",children:[h.jsx(n4,{data:e}),h.jsx(r4,{})]}),h.jsx("div",{})]})}function co({data:e}){return h.jsx("div",{className:"h-full",children:e.map((t,n)=>{const r=parseFloat(t.delta),i=r>=0;return h.jsx(Ie,{iconClassName:"!gap-[8px]",title:h.jsx("div",{className:"text-[#64748B]",children:t.title}),icon:h.jsx(t.Icon,{className:"h-[20px] w-[20px]",style:{color:t.iconColor||"#000000"}}),className:`${t?.widget==="amenities"?"h-[139px]":"h-[124px]"}`,children:h.jsxs("div",{className:`flex flex-col gap-[8px] ${t?.widget==="amenities"?"mt-[3.5px]":"mt-0"}`,children:[h.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t.value}),h.jsxs("div",{className:`flex items-center text-[12px] leading-[16px] ${t.delta?"gap-[8px]":""}`,children:[t.delta&&h.jsxs("div",{className:`flex items-center gap-[4px] px-[6px] py-[2px] rounded-[4px] font-medium
|
|
481
481
|
${i?"text-[#1FA05B] bg-[#F7FEFA]":"text-[#E11D48] bg-[#FBF4F4]"}
|
|
482
|
-
`,children:[i?h.jsx(oa,{}):h.jsx(ia,{}),Math.abs(r),"%"]}),h.jsx("div",{className:t.deltaColor?`text-[${t.deltaColor}] font-[600]`:"text-[#64748B]",children:t.deltaLabel})]})]})},n)})})}const ime=[{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}],ome=({x:e,y:t,payload:n})=>h.jsx("foreignObject",{x:(e||0)-80,y:(t||0)-18,width:80,height:40,children:h.jsx("div",{className:"text-[12px] leading-[16px] text-[#121212]",style:{width:"80px",whiteSpace:"normal",wordBreak:"break-word",textAlign:"left"},children:n?.value||""})});function i4({data:e,bar:t}){const n=Array?.isArray(e)&&e?.length===0,i=(e==null?ime:Array?.isArray(e)?e:[]).map(o=>({...o,name:o.facility_name,color:"#8B5CF6"}));return h.jsx(Ie,{title:"Bookings",icon:h.jsx(kpe,{size:18,className:"text-[#DBB467]"}),className:"h-[288px]",children:h.jsx("div",{className:"w-full h-full flex items-center justify-center",children:n?h.jsx(ln,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):h.jsx(Pt,{width:"100%",height:"100%",children:h.jsxs(Mo,{data:i||[],layout:"vertical",margin:{top:0,right:10,left:-12,bottom:0},children:[h.jsx(Gn,{type:"number",allowDecimals:!1,tick:{fill:"#64748B",fontSize:12},axisLine:!0,tickLine:!1}),h.jsx($n,{type:"category",dataKey:"facility_name",axisLine:!1,tickLine:!1,width:100,tick:h.jsx(ome,{})}),h.jsx(kt,{cursor:{fill:"transparent"},position:{x:300,y:0},allowEscapeViewBox:{x:!0,y:!0},content:o=>o.active?h.jsx(Qt,{...o,data:i,children:h.jsx(Gr,{...o})}):null}),h.jsx(qt,{dataKey:"total_booking",barSize:40,fill:t||"#8B5CF6"})]})})})})}const ame=[{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 o4({data:e}){const t=Array.isArray(e)&&e?.length===0,n=e==null?ame:Array.isArray(e)?e:[];return h.jsx(St,{title:"Booking Trend by Organisation",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full h-[265px] mt-[28px] flex items-center justify-center",children:t?h.jsx(ln,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):h.jsx(Pt,{width:"100%",height:"100%",children:h.jsxs(Mo,{data:n||[],margin:{top:0,right:0,left:-30,bottom:0},children:[h.jsx(fr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E5E7EB"}),h.jsx(Gn,{dataKey:"building_name",axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12}}),h.jsx($n,{allowDecimals:!1,axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12},tickFormatter:r=>`${r??0}`}),h.jsx(kt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:r=>r.active?h.jsx(Qt,{...r,data:n,children:h.jsx(Gr,{...r})}):null}),h.jsx(qt,{dataKey:"no_of_booking",barSize:54,fill:"#12B981"})]})})})})}const sme=[{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"}],of=["#3C81F6","#60A5FA","#95BFFA","#BEDAFE","#DAE6FC"];function a4({data:e,currencyType:t}){const n=Array?.isArray(e)&&e?.length===0,r=e??sme,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 h.jsx(St,{title:"Amenity Wise Revenue",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"grid grid-cols-12 gap-[24px] items-center h-full mt-[16px]",children:n?h.jsx("div",{className:"col-span-12 flex items-center justify-center h-[240px]",children:h.jsx(ln,{title:"No Amenity Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"col-span-6 h-[240px] w-full max-w-[240px]",children:h.jsx(Pt,{width:"100%",height:"100%",children:h.jsxs(Hi,{children:[h.jsx(ui,{data:a||[],dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:95,stroke:"#fff",strokeWidth:1,children:a?.map?.((l,c)=>h.jsx(Ln,{fill:of?.[c%of?.length]},`cell-${c}`))}),h.jsx(kt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:l=>l.active?h.jsx(Qt,{...l,data:a,children:h.jsx(Gr,{...l,formatter:c=>s(c)})}):null})]})})}),h.jsx("div",{className:"col-span-6",children:h.jsxs("div",{className:"rounded-[12px] !overflow-hidden border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[h.jsxs("div",{className:"grid grid-cols-2 px-[12px] py-[8px] bg-[#EBEBEB] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[h.jsx("div",{children:"Amenity"}),h.jsx("div",{className:"text-right",children:"Revenue"})]}),h.jsx("div",{className:"divide-y divide-[#F1F5F9] max-h-[238px] overflow-y-auto hide-scrollbar",children:i?.map?.((l,c)=>h.jsxs("div",{className:"grid grid-cols-2 px-[16px] py-[16px] text-[14px] text-[#121212]",children:[h.jsxs("div",{className:"flex items-center gap-[12px]",children:[h.jsx("span",{className:"w-[16px] h-[7px]",style:{backgroundColor:of?.[c%of?.length]}}),h.jsx("span",{className:"text-[#64748B] text-[12px] leading-[16px]",children:l?.name||"Unknown"})]}),h.jsx("div",{className:"text-right text-[12px] leading-[16px] text-[#64748B]",children:s(l?.value||0)})]},l?.name||c))})]})})]})})})}function lme(){return h.jsxs(h.Fragment,{children:[h.jsx(xs,{text:"Amenities",Icon:Epe,iconColor:"#F59D0D"}),h.jsxs("div",{className:"p-[16px] grid grid-cols-2 mt-[24px] gap-[24px]",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-[24px]",children:[h.jsx(co,{data:[{title:"Total Bookings",value:145,delta:"+11.0%",deltaLabel:"Compared to last month",Icon:Wpe,iconColor:"#1FA05B",iconBg:"bg-emerald-50"}]}),h.jsx(co,{data:[{title:"Utilisation Rate",value:"73%",delta:"+11.0%",deltaLabel:"Compared to last month",Icon:jpe,iconColor:"#329DFF"}]}),h.jsx(co,{data:[{title:"Most Popular",value:"Table Tennis",delta:"+11.0%",deltaLabel:"Compared to last month",Icon:zI,iconColor:"#FA7E28"}]}),h.jsx(co,{data:[{title:"Pending Approvals",value:23,delta:"-8.0%",deltaLabel:"Compared to last month",Icon:$I,iconColor:"#AB0000"}]})]}),h.jsx(i4,{})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-[24px] px-[16px]",children:[h.jsx(o4,{}),h.jsx(a4,{})]})]})}const af=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],cme=[{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}],s4=({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:af[o%af.length]})):cme.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,fill:af[o%af.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?h.jsx(St,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"flex items-center justify-center h-[calc(100%-50px)]",children:h.jsx(ln,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(St,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[h.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[h.jsx(Pt,{width:"100%",height:"100%",children:h.jsxs(Hi,{children:[h.jsx(ui,{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)=>h.jsx(Ln,{fill:i.fill},o))}),h.jsx(kt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?h.jsx(Qt,{...i,data:n,children:h.jsx(Gr,{...i})}):null})]})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),h.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),h.jsx("div",{className:"flex-1 max-w-[280px]",children:h.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[h.jsxs("div",{className:"flex items-center justify-between px-[16px] py-[12px] bg-[#F8FAFC]",children:[h.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),h.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Count"})]}),n.map((i,o)=>h.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:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.fill}}),h.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),h.jsx("div",{className:"text-[13px] text-[#64748B]",children:i.value})]},o))]})})]})})},l4=({data:e,title:t})=>{const[n,r]=k.useState({}),i=[{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}],o=k.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:i,[e]),a=s=>{const{dataKey:l}=s;r(c=>({...c,[l]:!c[l]}))};return Array.isArray(e)&&e.length===0?h.jsx(St,{title:t||"Maintenance Status",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:h.jsx(ln,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(St,{title:t||"Maintenance Status",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:Array.isArray(e)&&e.length===0?h.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):h.jsx("div",{className:`relative w-full ${t?"h-[261px]":"h-[297px]"} mt-[20px]`,children:h.jsx(Pt,{width:"100%",height:"100%",children:h.jsxs(Mo,{data:o,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[h.jsx(fr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),h.jsx(Gn,{dataKey:"name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),h.jsx($n,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),h.jsx(kt,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},allowEscapeViewBox:{x:!0,y:!0},content:s=>!s.active||!s.payload||!s.payload.length?null:h.jsx(Qt,{...s,data:o,children:h.jsxs("div",{className:"bg-[#121212] rounded-[10px] px-[14px] py-[10px] text-[12px] text-white",children:[h.jsx("div",{className:"mb-[6px] font-semibold",children:s.label}),s.payload.map((l,c)=>{const u=l.color||l.fill||"#fff";return h.jsxs("div",{className:"flex items-center gap-[6px]",children:[h.jsx("span",{className:"w-2 h-2 rounded-full inline-block",style:{backgroundColor:u}}),h.jsx("span",{className:"text-[#D1D3D4]",children:l.name}),h.jsx("span",{className:"text-white font-semibold",children:l.value})]},c)})]})})}),h.jsx(Sl,{verticalAlign:"bottom",align:"center",onClick:a,content:({payload:s})=>h.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:s.map((l,c)=>h.jsxs("div",{onClick:()=>a({dataKey:l.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[h.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:n[l.dataKey]?"#CBD5E1":l.color}}),h.jsx("span",{style:{fontSize:"12px",color:n[l.dataKey]?"#CBD5E1":"#64748B"},children:l.value})]},c))})}),h.jsx(qt,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:n.Open}),h.jsx(qt,{dataKey:"Closed",stackId:"a",fill:"#10B981",hide:n.Closed}),h.jsx(qt,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:n.Cancelled}),h.jsx(qt,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:n.OnHold,name:"On-Hold"}),h.jsx(qt,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:n.InProgress,name:"In Progress"})]})})})})})};function ume(){return h.jsxs(h.Fragment,{children:[h.jsx(xs,{text:"Asset Management",Icon:Rpe,iconColor:"#A74E8A"}),h.jsxs("div",{className:"grid grid-cols-2 mt-4 gap-[24px]",children:[h.jsx(s4,{}),h.jsx(l4,{})]})]})}function c4({data:e}){const t=[{name:"Completed",value:Number(e?.completed||0),color:"#12B981"},{name:"Not - Completed",value:Number(e?.not_completed||0),color:"#F69E0A"},{name:"Missed",value:Number(e?.missed||0),color:"#EF4444"}],n=Number(e?.completed||0)+Number(e?.not_completed||0)+Number(e?.missed||0),r=Number(e?.completed||0);return h.jsx(St,{title:"Patrol Status",className:"h-[362px]",titleWeight:"semi-bold",children:h.jsxs("div",{className:"flex flex-col items-center justify-center",children:[h.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[h.jsx(Pt,{width:"100%",height:"100%",children:h.jsxs(Hi,{children:[h.jsx(ui,{data:t,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:t.map((i,o)=>h.jsx(Ln,{fill:i.color},`cell-${o}`))}),h.jsx(kt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?h.jsx(Qt,{...i,data:t,children:h.jsx(Gr,{...i})}):null})]})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[r,"/",n]}),h.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),h.jsx("div",{className:"flex flex-col w-full text-[14px]",children:t.map((i,o)=>h.jsxs("div",{className:`flex items-center justify-between py-[10px] ${o!==t.length-1?"border-b border-[#F1F5F9]":""}`,children:[h.jsxs("div",{className:"flex items-center gap-[10px]",children:[h.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:i.color}}),h.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.name})]}),h.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.value})]},i.name))})]})})}function u4({incidentReports:e,incidentReportsDetails:t}){const n=Number(e?.open||0),r=Number(e?.in_progress||0),i=Number(e?.closed||0);return h.jsx(St,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:h.jsxs("div",{children:[h.jsxs("div",{className:"flex w-full text-center gap-[16px] mt-[24px]",children:[h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FBF4F4] h-[76px] rounded",children:[h.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#AB0000]",children:n}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FFFBF2] h-[76px] rounded",children:[h.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#F2A815]",children:r}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#F2A815]",children:"In-progress"})]}),h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#F7FEFA] h-[76px] rounded",children:[h.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:i}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),h.jsx("div",{className:"mt-4 space-y-2",children:t?.length>0?t.map((o,a)=>{const s=o?.escalation_level==="Danger"?"text-[#AB0000]":o?.escalation_level==="High"?"text-[#E7A015]":"text-[#1FA05B]";return h.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#FAFBFD] rounded-md",children:[h.jsx("div",{className:"flex items-center gap-[8px]",children:h.jsx("div",{className:"text-gray-700 font-medium",children:o?.incident_reporting_id})}),h.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${s}`,children:h.jsxs("div",{children:[o?.escalation_value," - ",o?.escalation_level]})})]},a)}):h.jsx(h.Fragment,{})})]})})}function dme(){return h.jsxs(h.Fragment,{children:[h.jsx(xs,{text:"Guard Petrol",Icon:$pe,iconColor:"#AB0000"}),h.jsxs("div",{className:"px-[16px] grid grid-cols-3 gap-[24px] mt-4",children:[h.jsx(c4,{}),h.jsx(u4,{}),h.jsx(VI,{})]})]})}function fme(){return h.jsxs(h.Fragment,{children:[h.jsx(xs,{text:"Engagement",Icon:Dpe,iconColor:"#3C81F6"}),h.jsxs("div",{className:"grid grid-cols-4 gap-[24px] mt-4",children:[h.jsx(co,{data:[{title:"Notice",value:20,deltaLabel:"Currently active",Icon:mpe,iconColor:"#1FA05B"}]}),h.jsx(co,{data:[{title:"Discussion Forum",value:9,deltaLabel:"Active threads",Icon:wpe,iconColor:"#329DFF"}]}),h.jsx(co,{data:[{title:"Polls",value:3,deltaLabel:"Currently active",Icon:Ope,iconColor:"#FA7E28"}]}),h.jsx(co,{data:[{title:"Surveys",value:8,deltaLabel:"Currently active",Icon:Tpe,iconColor:"#DBB467"}]})]})]})}function d4({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%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"},{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,m=a===0&&c.length===0,g=`repeat(${u.length}, 1fr)`;return h.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:[h.jsx("div",{className:"flex-1 overflow-auto hide-scrollbar",children:h.jsxs("div",{className:"h-full min-w-max",children:[h.jsx("div",{className:"grid bg-[#354A5E] text-white text-[16px] leading-[20px] font-medium sticky top-0 z-30",style:{gridTemplateColumns:g},children:u.map((v,x)=>h.jsx("div",{className:`px-[24px] py-[16px] whitespace-nowrap text-left ${x===0?"sticky left-0 z-40 bg-[#354A5E] text-[16px] leading-[20px] shadow-[2px_0_5px_rgba(0,0,0,0.1)] border-r border-[#2C3E50]":""}`,children:v.label},x))}),m?h.jsx("div",{className:"h-[calc(100%-50px)] flex items-center justify-center",children:h.jsx(ln,{title:"No Data Found",description:"Catch up all the data. Change the date range to see the data."})}):p.map((v,x)=>h.jsx("div",{className:"grid",style:{gridTemplateColumns:g},children:u.map((_,w)=>{const y=v[_.key],E=_.label==="Closed",S=_.label==="Open",P=typeof y=="string"&&y.includes("%"),D=y==="100%"?"bg-[#F0FEF2] text-[#36AB6C]":"bg-[#FFF0F0] text-[#AB0000]";return h.jsx("div",{className:`px-[24px] py-[16px] flex items-center ${w===0?"bg-white sticky left-0 z-20 shadow-[2px_0_5px_rgba(0,0,0,0.05)] border-r border-gray-200":"bg-gray-50"} text-[#121212]`,children:E?h.jsx("div",{className:"text-[14px] font-medium",style:{color:"#36AB6C"},children:y??"-"}):S?h.jsx("div",{className:"text-[14px] font-medium",style:{color:"#AB0000"},children:y??"-"}):P?h.jsx("div",{className:`inline-block px-[12px] py-[4px] rounded-full text-[14px] font-medium ${D}`,children:y}):h.jsx("div",{children:y??"-"})},w)})},x))]})}),h.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:[h.jsxs("div",{className:"flex items-center gap-[8px] text-gray-600 text-[14px]",children:[h.jsx("div",{children:"Rows per page:"}),h.jsx("select",{value:n,onChange:v=>{r(Number(v.target.value)),o(1)},className:"border rounded px-[8px] py-[4px]",children:l.map((v,x)=>h.jsx("option",{value:v,children:v},x))}),h.jsxs("div",{className:"ml-4 text-[14px]",children:[c?.length===0?"0–0":`1–${c?.length}`," of"," ",a||c?.length]})]}),h.jsxs("div",{className:"flex items-center space-x-2 text-gray-600 text-[14px]",children:[h.jsx("button",{onClick:()=>o(1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(BI,{size:18})}),h.jsx("button",{onClick:()=>o(v=>v-1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx($1,{size:18})}),h.jsx("button",{onClick:()=>o(v=>v+1),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(B1,{size:18})}),h.jsx("button",{onClick:()=>o(f),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(WI,{size:18})})]})]})]})}const f4=({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)}},[]),h.jsxs("div",{ref:o,className:"relative h-[32px]",children:[h.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:[h.jsx("div",{className:"text-[12px] leading-[16px] min-w-[109px] text-[#64748B]",children:t}),h.jsx(cpe,{size:16,className:"text-[#64748B]"})]}),r&&h.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)=>h.jsx("div",{className:"px-[12px] py-[8px] text-[14px] text-[#334155] hover:bg-[#F1F5F9] cursor-pointer",onClick:()=>{n(a),i(!1)},children:a},s))})]})},pme=({data:e,communities:t,title:n})=>{const[r,i]=k.useState({}),[o,a]=k.useState(""),s=t?.map(d=>d?.community_name)||[];k.useEffect(()=>{s?.length>0&&!o&&a(s[0])},[s,o]);const l=[{community_name:"L1",Cancelled:55,Open:50,OnHold:20,InProgress:10},{community_name:"L2",Cancelled:15,Open:15,OnHold:8,InProgress:5},{community_name:"L3",Cancelled:12,Open:75,OnHold:18,InProgress:7}],c=k.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:l,[e]),u=d=>{const{dataKey:f}=d||{};i(p=>({...p,[f]:!p?.[f]}))};return Array.isArray(e)&&e.length===0?h.jsx(St,{title:n||"Escalation Level By Building",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full flex items-center justify-center",children:h.jsx(ln,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(St,{title:n||"Escalation Level By Building",titleWeight:"semi-bold",className:"h-[362px]",childrenClassName:"mt-[21px]",rightContent:h.jsx(f4,{options:s,value:o,onChange:d=>a(d)}),children:h.jsx("div",{className:"w-full flex items-center justify-center",children:Array.isArray(e)&&e.length===0?h.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):h.jsx("div",{className:"relative w-full h-[261px]",children:h.jsx(Pt,{width:"100%",height:"100%",children:h.jsxs(Mo,{data:c,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[h.jsx(fr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),h.jsx(Gn,{dataKey:"community_name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),h.jsx($n,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),h.jsx(kt,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},allowEscapeViewBox:{x:!0,y:!0},content:d=>!d?.active||!d?.payload?.length?null:h.jsx(Qt,{...d,data:c,children:h.jsxs("div",{className:"bg-black rounded-[10px] px-[14px] py-[10px] text-[12px] text-white",children:[h.jsx("div",{className:"mb-[6px] font-semibold",children:d?.label}),d?.payload?.map((f,p)=>{const m=f?.color||f?.fill||"#fff";return h.jsxs("div",{className:"flex items-center gap-[6px]",children:[h.jsx("span",{className:"w-[8px] h-[8px] rounded-full inline-block",style:{backgroundColor:m}}),h.jsx("span",{className:"text-[#D1D3D4]",children:f?.name}),h.jsx("span",{className:"text-white font-semibold",children:f?.value})]},p)})]})})}),h.jsx(Sl,{verticalAlign:"bottom",align:"center",onClick:u,content:({payload:d})=>h.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:d?.map((f,p)=>h.jsxs("div",{onClick:()=>u({dataKey:f?.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[h.jsx("div",{className:`w-[16px] h-[8px] ${r?.[f?.dataKey]?"bg-slate-300":""}`,style:{backgroundColor:r?.[f?.dataKey]?"#CBD5E1":f?.color}}),h.jsx("span",{className:`text-[12px] ${r?.[f?.dataKey]?"text-[#CBD5E1]":"text-[#64748B]"}`,children:f?.value})]},p))})}),h.jsx(qt,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:r?.Open}),h.jsx(qt,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:r?.Cancelled}),h.jsx(qt,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:r?.OnHold,name:"On-Hold"}),h.jsx(qt,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:r?.InProgress,name:"In Progress"})]})})})})})},hme=({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 h.jsx(St,{title:"Top 5 Tenants by Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-[20px]",rightContent:h.jsx(f4,{options:r,value:t,onChange:a=>n(a)}),children:o?h.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:h.jsx(ln,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsx("div",{className:"w-full h-[280px]",children:h.jsx(Pt,{width:"100%",height:"100%",children:h.jsxs(tR,{data:i,margin:{top:10,right:-10,left:-10,bottom:0},children:[h.jsx("defs",{children:h.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[h.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),h.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),h.jsx(fr,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),h.jsx(Gn,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:a=>a}),h.jsx($n,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),h.jsx(kt,{cursor:!1,content:a=>h.jsx(Qt,{...a,data:i,children:(()=>{if(!a.active||!a.label)return null;const s=i.find(l=>l.day===a.label);return h.jsxs("div",{className:"bg-[#111] text-white px-[14px] py-[8px] rounded-[6px] flex flex-col gap-[6px] text-[13px]",children:[h.jsx("div",{className:"font-semibold",children:a.label}),h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-2 h-2 rounded-full bg-[#6366F1]"}),h.jsx("div",{className:"text-[#aaa]",children:"Visitors"}),h.jsx("div",{className:"font-bold",children:s?.no_of_visitors??0})]})]})})()})}),h.jsx(t1,{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}=a;return h.jsxs("g",{children:[h.jsx("circle",{cx:s,cy:l,r:6,fill:"#fff",stroke:"#6466F1",strokeWidth:2}),h.jsx("circle",{cx:s,cy:l,r:2.5,fill:"#6466F1"})]})}})]})})})})},mme=({data:e})=>{const t=[{name:"Kosmo One",total:29,pending_approval:1,cancelled:2},{name:"OWC",total:23,pending_approval:9,cancelled:3},{name:"Exora",total:40,pending_approval:12,cancelled:1},{name:"OIC - T3",total:27,pending_approval:19,cancelled:8}],n=e==null?t:Array.isArray(e)?e:[],r=Array.isArray(n)&&n.length===0;return h.jsx(St,{title:"Building Wise Approvals",titleWeight:"semi-bold",className:"h-[362px]",childrenClassName:"mt-[34px]",children:r?h.jsx("div",{className:"h-[250px] flex items-center justify-center",children:h.jsx(ln,{title:"No Data Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsxs("div",{className:"w-full border border-[#EBEBEB] rounded-[10px] overflow-hidden",children:[h.jsxs("div",{className:"grid grid-cols-4 bg-[#FAFAFA] px-[12px] py-[8px] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[h.jsx("div",{children:"Tenant"}),h.jsx("div",{className:"flex justify-end",children:"Total"}),h.jsx("div",{className:"flex justify-end",children:"Pending"}),h.jsx("div",{className:"flex justify-end",children:"Cancelled"})]}),h.jsx("div",{className:"max-h-[280px] overflow-y-auto hide-scrollbar",children:n.map((i,o)=>h.jsxs("div",{className:"grid grid-cols-4 p-[12px] text-[12px] leading-[16px] border-t border-[#EBEBEB]",children:[h.jsx("div",{className:"text-[#475569]",children:i.name}),h.jsx("div",{className:"flex justify-end text-[#36AB6C]",children:i.total}),h.jsx("div",{className:"flex justify-end text-[#F2A815]",children:i.pending_approval}),h.jsx("div",{className:"flex justify-end text-[#AB0000]",children:i.cancelled})]},o))})]})})},sf=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],gme=[{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"}],vme=({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,investment:i.investment||"-",fill:sf[o%sf.length]})):gme.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",fill:sf[o%sf.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?h.jsx(St,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx(ln,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(St,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[h.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[h.jsx(Pt,{width:"100%",height:"100%",children:h.jsxs(Hi,{children:[h.jsx(ui,{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)=>h.jsx(Ln,{fill:i.fill},o))}),h.jsx(kt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?h.jsx(Qt,{...i,data:n,children:h.jsx(Gr,{...i})}):null})]})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),h.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),h.jsx("div",{className:"flex-1 max-w-[280px]",children:h.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0]",children:[h.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] bg-[#F8FAFC]",children:[h.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),h.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-center",children:"Count"}),h.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-right",children:"Investment"})]}),h.jsx("div",{className:"max-h-[205px] overflow-y-auto hide-scrollbar",children:n.map((i,o)=>h.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] border-t border-[#F1F5F9]",children:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.fill}}),h.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),h.jsx("div",{className:"text-[13px] text-[#64748B] text-center",children:i.value}),h.jsx("div",{className:"text-[13px] text-[#64748B] text-right",children:i.investment})]},o))})]})})]})})};function yme({columns:e=[],data:t=[],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=`200px repeat(${u.length-1}, 150px)`,f={};return u.forEach(p=>{if(p.key!=="name"){let m=0;for(let g=0;g<c.length;g++){const v=c[g][p.key];typeof v=="number"&&(m+=v)}f[p.key]=m}}),h.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:[h.jsx("div",{className:"flex-1 overflow-auto hide-scrollbar",children:c.length===0?h.jsx("div",{className:"h-full flex items-center justify-center",children:h.jsx(ln,{title:"No Data Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsxs("div",{className:"min-w-max",children:[h.jsx("div",{className:"grid bg-[#354A5E] text-white text-[14px] font-medium sticky top-0 z-30",style:{gridTemplateColumns:d},children:u.map((p,m)=>h.jsx("div",{title:p.label,className:`px-[24px] py-[16px] whitespace-nowrap overflow-hidden text-ellipsis ${m===0?"sticky left-0 z-40 bg-[#354A5E] shadow-[2px_0_5px_rgba(0,0,0,0.1)] border-r border-[#2C3E50]":""}`,children:p.label},m))}),c.map((p,m)=>h.jsx("div",{className:"grid",style:{gridTemplateColumns:d},children:u.map((g,v)=>h.jsx("div",{className:`px-[24px] py-[14px] text-[14px] flex items-center ${v===0?"bg-white sticky left-0 z-20 font-medium shadow-[2px_0_5px_rgba(0,0,0,0.05)] border-r border-gray-200":"bg-gray-50"}`,children:p[g.key]??"-"},v))},m)),h.jsx("div",{className:"grid bg-[#F8FAFC] border-t border-[#F0F0F0] sticky bottom-0 z-30",style:{gridTemplateColumns:d},children:u.map((p,m)=>h.jsx("div",{className:`px-[24px] py-[16px] ${m===0?"sticky left-0 z-40 bg-[#F8FAFC] text-[#64748B] font-medium shadow-[2px_0_5px_rgba(0,0,0,0.05)] border-r border-gray-200":"text-[#64748B] font-medium"}`,children:p.key==="name"?"Grand Total":f[p.key]||0},m))})]})}),h.jsxs("div",{className:"flex justify-end items-center px-[24px] py-[16px] text-sm bg-white border-t border-[#F0F0F0] gap-[32px]",children:[h.jsxs("div",{className:"flex items-center gap-[8px] text-gray-600 text-[14px]",children:[h.jsx("div",{children:"Rows per page:"}),h.jsx("select",{value:n,onChange:p=>{r(Number(p.target.value)),o(1)},className:"border rounded px-[8px] py-[4px]",children:l.map((p,m)=>h.jsx("option",{value:p,children:p},m))}),h.jsxs("div",{className:"ml-4 text-[14px]",children:[c.length===0?"0–0":`1–${c.length}`," of"," ",a||c.length]})]}),h.jsxs("div",{className:"flex items-center space-x-2 text-gray-600 text-[14px]",children:[h.jsx("button",{onClick:()=>o(1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(BI,{size:18})}),h.jsx("button",{onClick:()=>o(p=>p-1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx($1,{size:18})}),h.jsx("button",{onClick:()=>o(p=>p+1),disabled:i===s,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(B1,{size:18})}),h.jsx("button",{onClick:()=>o(s),disabled:i===s,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(WI,{size:18})})]})]})]})}exports.AccessPointsUsage=JI;exports.Accounting=Mfe;exports.Amenities=KI;exports.AmenitiesStatsCard=co;exports.AmenityWiseRevenue=a4;exports.AssetValueBreakdown=Kfe;exports.AssetsByType=s4;exports.BlockWiseOccupancy=Ofe;exports.BookingTrendChart=o4;exports.Bookings=i4;exports.Budgets=$fe;exports.BuildingWiseApprovals=mme;exports.Card=Ie;exports.CardAccess=ZI;exports.CashBankBalance=Wfe;exports.CommercialAccessOverview=QI;exports.CommercialAmenitiesDashboard=lme;exports.CommercialAssetManagementDashboard=ume;exports.CommercialDashboard=Khe;exports.CommercialEngagementDashboard=fme;exports.CommercialGuardPatrols=c4;exports.CommercialGuardPetrolDashboard=dme;exports.CommercialHelpdeskDashboard=tme;exports.CommercialIncidentReports=u4;exports.CommercialOccupancy=HI;exports.CommercialReportTable=d4;exports.CommercialSmartAccessDashboard=Qhe;exports.CommercialTableDashboard=d4;exports.CommercialVisitorsDashboard=rme;exports.Community=lse;exports.Complaints=ghe;exports.ComplaintsByLevel=bhe;exports.DuesAgeing=Vfe;exports.EmployeeFootfall=YI;exports.Engagement=IR;exports.EngagementStatsGrid=$he;exports.EscalationLevel=pme;exports.EventsUtilisation=The;exports.ExpenseCategories=Yfe;exports.Facilities=cse;exports.FinanceSummary=use;exports.FoodBeverages=UI;exports.GateAndSecurityStatsGrid=phe;exports.GateUpdates=Qse;exports.GuardPatrols=Jpe;exports.Header=R8;exports.Helpdesk=Zse;exports.HelpdeskStatsGrid=Phe;exports.HourlyTrafficFlow=ihe;exports.IncidentReports=she;exports.IncomeExpenditure=FI;exports.MainHeader=q8;exports.MaintenanceStatus=l4;exports.MetricCard=vb;exports.MobileAccess=ZI;exports.MoveInOutTrends=Pfe;exports.NoticeBoardStatus=Mhe;exports.OccupancyOverview=_fe;exports.OrganisationWiseVisitors=r4;exports.PortfolioAssetsByType=vme;exports.RequestBox=whe;exports.ResidentOverview=Efe;exports.RevenuebyCategory=Gfe;exports.SingleStats=Ihe;exports.StaffAttendance=VI;exports.StatsGrid=Qpe;exports.TenantsByVisitors=hme;exports.TicketEscalation=qI;exports.TicketStatus=GI;exports.Tickets=e4;exports.TicketsperCategory=t4;exports.TotalCommercialTable=yme;exports.UnitStatus=wfe;exports.VisitorUpdates=XI;exports.WeeklyVisitorPattern=n4;
|
|
482
|
+
`,children:[i?h.jsx(oa,{}):h.jsx(ia,{}),Math.abs(r),"%"]}),h.jsx("div",{className:t.deltaColor?`text-[${t.deltaColor}] font-[600]`:"text-[#64748B]",children:t.deltaLabel})]})]})},n)})})}const ime=[{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}],ome=({x:e,y:t,payload:n})=>h.jsx("foreignObject",{x:(e||0)-80,y:(t||0)-18,width:80,height:40,children:h.jsx("div",{className:"text-[12px] leading-[16px] text-[#121212]",style:{width:"80px",whiteSpace:"normal",wordBreak:"break-word",textAlign:"left"},children:n?.value||""})});function i4({data:e,bar:t}){const n=Array?.isArray(e)&&e?.length===0,i=(e==null?ime:Array?.isArray(e)?e:[]).map(o=>({...o,name:o.facility_name,color:"#8B5CF6"}));return h.jsx(Ie,{title:"Bookings",icon:h.jsx(kpe,{size:18,className:"text-[#DBB467]"}),className:"h-[288px]",children:h.jsx("div",{className:"w-full h-full flex items-center justify-center",children:n?h.jsx(ln,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):h.jsx(Pt,{width:"100%",height:"100%",children:h.jsxs(Mo,{data:i||[],layout:"vertical",margin:{top:0,right:10,left:-12,bottom:0},children:[h.jsx(Gn,{type:"number",allowDecimals:!1,tick:{fill:"#64748B",fontSize:12},axisLine:!0,tickLine:!1}),h.jsx($n,{type:"category",dataKey:"facility_name",axisLine:!1,tickLine:!1,width:100,tick:h.jsx(ome,{})}),h.jsx(kt,{cursor:{fill:"transparent"},position:{x:300,y:0},allowEscapeViewBox:{x:!0,y:!0},content:o=>o.active?h.jsx(Qt,{...o,data:i,children:h.jsx(Gr,{...o})}):null}),h.jsx(qt,{dataKey:"total_booking",barSize:40,fill:t||"#8B5CF6"})]})})})})}const ame=[{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 o4({data:e}){const t=Array.isArray(e)&&e?.length===0,n=e==null?ame:Array.isArray(e)?e:[];return h.jsx(St,{title:"Booking Trend by Organisation",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full h-[265px] mt-[28px] flex items-center justify-center",children:t?h.jsx(ln,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):h.jsx(Pt,{width:"100%",height:"100%",children:h.jsxs(Mo,{data:n||[],margin:{top:0,right:0,left:-30,bottom:0},children:[h.jsx(fr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E5E7EB"}),h.jsx(Gn,{dataKey:"building_name",axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12}}),h.jsx($n,{allowDecimals:!1,axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12},tickFormatter:r=>`${r??0}`}),h.jsx(kt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:r=>r.active?h.jsx(Qt,{...r,data:n,children:h.jsx(Gr,{...r})}):null}),h.jsx(qt,{dataKey:"no_of_booking",barSize:54,fill:"#12B981"})]})})})})}const sme=[{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"}],of=["#3C81F6","#60A5FA","#95BFFA","#BEDAFE","#DAE6FC"];function a4({data:e,currencyType:t}){const n=Array?.isArray(e)&&e?.length===0,r=e??sme,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 h.jsx(St,{title:"Amenity Wise Revenue",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"grid grid-cols-12 gap-[24px] items-center h-full mt-[16px]",children:n?h.jsx("div",{className:"col-span-12 flex items-center justify-center h-[240px]",children:h.jsx(ln,{title:"No Amenity Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"col-span-6 h-[240px] w-full max-w-[240px]",children:h.jsx(Pt,{width:"100%",height:"100%",children:h.jsxs(Hi,{children:[h.jsx(ui,{data:a||[],dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:95,stroke:"#fff",strokeWidth:1,children:a?.map?.((l,c)=>h.jsx(Ln,{fill:of?.[c%of?.length]},`cell-${c}`))}),h.jsx(kt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:l=>l.active?h.jsx(Qt,{...l,data:a,children:h.jsx(Gr,{...l,formatter:c=>s(c)})}):null})]})})}),h.jsx("div",{className:"col-span-6",children:h.jsxs("div",{className:"rounded-[12px] !overflow-hidden border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[h.jsxs("div",{className:"grid grid-cols-2 px-[12px] py-[8px] bg-[#EBEBEB] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[h.jsx("div",{children:"Amenity"}),h.jsx("div",{className:"text-right",children:"Revenue"})]}),h.jsx("div",{className:"divide-y divide-[#F1F5F9] max-h-[238px] overflow-y-auto hide-scrollbar",children:i?.map?.((l,c)=>h.jsxs("div",{className:"grid grid-cols-2 px-[16px] py-[16px] text-[14px] text-[#121212]",children:[h.jsxs("div",{className:"flex items-center gap-[12px]",children:[h.jsx("span",{className:"w-[16px] h-[7px]",style:{backgroundColor:of?.[c%of?.length]}}),h.jsx("span",{className:"text-[#64748B] text-[12px] leading-[16px]",children:l?.name||"Unknown"})]}),h.jsx("div",{className:"text-right text-[12px] leading-[16px] text-[#64748B]",children:s(l?.value||0)})]},l?.name||c))})]})})]})})})}function lme(){return h.jsxs(h.Fragment,{children:[h.jsx(xs,{text:"Amenities",Icon:Epe,iconColor:"#F59D0D"}),h.jsxs("div",{className:"p-[16px] grid grid-cols-2 mt-[24px] gap-[24px]",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-[24px]",children:[h.jsx(co,{data:[{title:"Total Bookings",value:145,delta:"+11.0%",deltaLabel:"Compared to last month",Icon:Wpe,iconColor:"#1FA05B",iconBg:"bg-emerald-50"}]}),h.jsx(co,{data:[{title:"Utilisation Rate",value:"73%",delta:"+11.0%",deltaLabel:"Compared to last month",Icon:jpe,iconColor:"#329DFF"}]}),h.jsx(co,{data:[{title:"Most Popular",value:"Table Tennis",delta:"+11.0%",deltaLabel:"Compared to last month",Icon:zI,iconColor:"#FA7E28"}]}),h.jsx(co,{data:[{title:"Pending Approvals",value:23,delta:"-8.0%",deltaLabel:"Compared to last month",Icon:$I,iconColor:"#AB0000"}]})]}),h.jsx(i4,{})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-[24px] px-[16px]",children:[h.jsx(o4,{}),h.jsx(a4,{})]})]})}const af=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],cme=[{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}],s4=({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:af[o%af.length]})):cme.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,fill:af[o%af.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?h.jsx(St,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"flex items-center justify-center h-[260px]",children:h.jsx(ln,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(St,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[h.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[h.jsx(Pt,{width:"100%",height:"100%",children:h.jsxs(Hi,{children:[h.jsx(ui,{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)=>h.jsx(Ln,{fill:i.fill},o))}),h.jsx(kt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?h.jsx(Qt,{...i,data:n,children:h.jsx(Gr,{...i})}):null})]})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),h.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),h.jsx("div",{className:"flex-1 max-w-[280px]",children:h.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[h.jsxs("div",{className:"flex items-center justify-between px-[16px] py-[12px] bg-[#F8FAFC]",children:[h.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),h.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Count"})]}),n.map((i,o)=>h.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:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.fill}}),h.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),h.jsx("div",{className:"text-[13px] text-[#64748B]",children:i.value})]},o))]})})]})})},l4=({data:e,title:t})=>{const[n,r]=k.useState({}),i=[{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}],o=k.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:i,[e]),a=s=>{const{dataKey:l}=s;r(c=>({...c,[l]:!c[l]}))};return Array.isArray(e)&&e.length===0?h.jsx(St,{title:t||"Maintenance Status",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:h.jsx(ln,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(St,{title:t||"Maintenance Status",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:Array.isArray(e)&&e.length===0?h.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):h.jsx("div",{className:`relative w-full ${t?"h-[261px]":"h-[297px]"} mt-[20px]`,children:h.jsx(Pt,{width:"100%",height:"100%",children:h.jsxs(Mo,{data:o,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[h.jsx(fr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),h.jsx(Gn,{dataKey:"name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),h.jsx($n,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),h.jsx(kt,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},allowEscapeViewBox:{x:!0,y:!0},content:s=>!s.active||!s.payload||!s.payload.length?null:h.jsx(Qt,{...s,data:o,children:h.jsxs("div",{className:"bg-[#121212] rounded-[10px] px-[14px] py-[10px] text-[12px] text-white",children:[h.jsx("div",{className:"mb-[6px] font-semibold",children:s.label}),s.payload.map((l,c)=>{const u=l.color||l.fill||"#fff";return h.jsxs("div",{className:"flex items-center gap-[6px]",children:[h.jsx("span",{className:"w-2 h-2 rounded-full inline-block",style:{backgroundColor:u}}),h.jsx("span",{className:"text-[#D1D3D4]",children:l.name}),h.jsx("span",{className:"text-white font-semibold",children:l.value})]},c)})]})})}),h.jsx(Sl,{verticalAlign:"bottom",align:"center",onClick:a,content:({payload:s})=>h.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:s.map((l,c)=>h.jsxs("div",{onClick:()=>a({dataKey:l.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[h.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:n[l.dataKey]?"#CBD5E1":l.color}}),h.jsx("span",{style:{fontSize:"12px",color:n[l.dataKey]?"#CBD5E1":"#64748B"},children:l.value})]},c))})}),h.jsx(qt,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:n.Open}),h.jsx(qt,{dataKey:"Closed",stackId:"a",fill:"#10B981",hide:n.Closed}),h.jsx(qt,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:n.Cancelled}),h.jsx(qt,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:n.OnHold,name:"On-Hold"}),h.jsx(qt,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:n.InProgress,name:"In Progress"})]})})})})})};function ume(){return h.jsxs(h.Fragment,{children:[h.jsx(xs,{text:"Asset Management",Icon:Rpe,iconColor:"#A74E8A"}),h.jsxs("div",{className:"grid grid-cols-2 mt-4 gap-[24px]",children:[h.jsx(s4,{}),h.jsx(l4,{})]})]})}function c4({data:e}){const t=[{name:"Completed",value:Number(e?.completed||0),color:"#12B981"},{name:"Not - Completed",value:Number(e?.not_completed||0),color:"#F69E0A"},{name:"Missed",value:Number(e?.missed||0),color:"#EF4444"}],n=Number(e?.completed||0)+Number(e?.not_completed||0)+Number(e?.missed||0),r=Number(e?.completed||0);return h.jsx(St,{title:"Patrol Status",className:"h-[362px]",titleWeight:"semi-bold",children:h.jsxs("div",{className:"flex flex-col items-center justify-center",children:[h.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[h.jsx(Pt,{width:"100%",height:"100%",children:h.jsxs(Hi,{children:[h.jsx(ui,{data:t,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:t.map((i,o)=>h.jsx(Ln,{fill:i.color},`cell-${o}`))}),h.jsx(kt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?h.jsx(Qt,{...i,data:t,children:h.jsx(Gr,{...i})}):null})]})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[r,"/",n]}),h.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),h.jsx("div",{className:"flex flex-col w-full text-[14px]",children:t.map((i,o)=>h.jsxs("div",{className:`flex items-center justify-between py-[10px] ${o!==t.length-1?"border-b border-[#F1F5F9]":""}`,children:[h.jsxs("div",{className:"flex items-center gap-[10px]",children:[h.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:i.color}}),h.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.name})]}),h.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.value})]},i.name))})]})})}function u4({incidentReports:e,incidentReportsDetails:t}){const n=Number(e?.open||0),r=Number(e?.in_progress||0),i=Number(e?.closed||0);return h.jsx(St,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:h.jsxs("div",{children:[h.jsxs("div",{className:"flex w-full text-center gap-[16px] mt-[24px]",children:[h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FBF4F4] h-[76px] rounded",children:[h.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#AB0000]",children:n}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FFFBF2] h-[76px] rounded",children:[h.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#F2A815]",children:r}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#F2A815]",children:"In-progress"})]}),h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#F7FEFA] h-[76px] rounded",children:[h.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:i}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),h.jsx("div",{className:"mt-4 space-y-2",children:t?.length>0?t.map((o,a)=>{const s=o?.escalation_level==="Danger"?"text-[#AB0000]":o?.escalation_level==="High"?"text-[#E7A015]":"text-[#1FA05B]";return h.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#FAFBFD] rounded-md",children:[h.jsx("div",{className:"flex items-center gap-[8px]",children:h.jsx("div",{className:"text-gray-700 font-medium",children:o?.incident_reporting_id})}),h.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${s}`,children:h.jsxs("div",{children:[o?.escalation_value," - ",o?.escalation_level]})})]},a)}):h.jsx(h.Fragment,{})})]})})}function dme(){return h.jsxs(h.Fragment,{children:[h.jsx(xs,{text:"Guard Petrol",Icon:$pe,iconColor:"#AB0000"}),h.jsxs("div",{className:"px-[16px] grid grid-cols-3 gap-[24px] mt-4",children:[h.jsx(c4,{}),h.jsx(u4,{}),h.jsx(VI,{})]})]})}function fme(){return h.jsxs(h.Fragment,{children:[h.jsx(xs,{text:"Engagement",Icon:Dpe,iconColor:"#3C81F6"}),h.jsxs("div",{className:"grid grid-cols-4 gap-[24px] mt-4",children:[h.jsx(co,{data:[{title:"Notice",value:20,deltaLabel:"Currently active",Icon:mpe,iconColor:"#1FA05B"}]}),h.jsx(co,{data:[{title:"Discussion Forum",value:9,deltaLabel:"Active threads",Icon:wpe,iconColor:"#329DFF"}]}),h.jsx(co,{data:[{title:"Polls",value:3,deltaLabel:"Currently active",Icon:Ope,iconColor:"#FA7E28"}]}),h.jsx(co,{data:[{title:"Surveys",value:8,deltaLabel:"Currently active",Icon:Tpe,iconColor:"#DBB467"}]})]})]})}function d4({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%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"},{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,m=a===0&&c.length===0,g=`repeat(${u.length}, 1fr)`;return h.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:[h.jsx("div",{className:"flex-1 overflow-auto hide-scrollbar",children:h.jsxs("div",{className:"h-full min-w-max",children:[h.jsx("div",{className:"grid bg-[#354A5E] text-white text-[16px] leading-[20px] font-medium sticky top-0 z-30",style:{gridTemplateColumns:g},children:u.map((v,x)=>h.jsx("div",{className:`px-[24px] py-[16px] whitespace-nowrap text-left ${x===0?"sticky left-0 z-40 bg-[#354A5E] text-[16px] leading-[20px] shadow-[2px_0_5px_rgba(0,0,0,0.1)] border-r border-[#2C3E50]":""}`,children:v.label},x))}),m?h.jsx("div",{className:"h-[calc(100%-50px)] flex items-center justify-center",children:h.jsx(ln,{title:"No Data Found",description:"Catch up all the data. Change the date range to see the data."})}):p.map((v,x)=>h.jsx("div",{className:"grid",style:{gridTemplateColumns:g},children:u.map((_,w)=>{const y=v[_.key],E=_.label==="Closed",S=_.label==="Open",P=typeof y=="string"&&y.includes("%"),D=y==="100%"?"bg-[#F0FEF2] text-[#36AB6C]":"bg-[#FFF0F0] text-[#AB0000]";return h.jsx("div",{className:`px-[24px] py-[16px] flex items-center ${w===0?"bg-white sticky left-0 z-20 shadow-[2px_0_5px_rgba(0,0,0,0.05)] border-r border-gray-200":"bg-gray-50"} text-[#121212]`,children:E?h.jsx("div",{className:"text-[14px] font-medium",style:{color:"#36AB6C"},children:y??"-"}):S?h.jsx("div",{className:"text-[14px] font-medium",style:{color:"#AB0000"},children:y??"-"}):P?h.jsx("div",{className:`inline-block px-[12px] py-[4px] rounded-full text-[14px] font-medium ${D}`,children:y}):h.jsx("div",{children:y??"-"})},w)})},x))]})}),h.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:[h.jsxs("div",{className:"flex items-center gap-[8px] text-gray-600 text-[14px]",children:[h.jsx("div",{children:"Rows per page:"}),h.jsx("select",{value:n,onChange:v=>{r(Number(v.target.value)),o(1)},className:"border rounded px-[8px] py-[4px]",children:l.map((v,x)=>h.jsx("option",{value:v,children:v},x))}),h.jsxs("div",{className:"ml-4 text-[14px]",children:[c?.length===0?"0–0":`1–${c?.length}`," of"," ",a||c?.length]})]}),h.jsxs("div",{className:"flex items-center space-x-2 text-gray-600 text-[14px]",children:[h.jsx("button",{onClick:()=>o(1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(BI,{size:18})}),h.jsx("button",{onClick:()=>o(v=>v-1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx($1,{size:18})}),h.jsx("button",{onClick:()=>o(v=>v+1),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(B1,{size:18})}),h.jsx("button",{onClick:()=>o(f),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(WI,{size:18})})]})]})]})}const f4=({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)}},[]),h.jsxs("div",{ref:o,className:"relative h-[32px]",children:[h.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:[h.jsx("div",{className:"text-[12px] leading-[16px] min-w-[109px] text-[#64748B]",children:t}),h.jsx(cpe,{size:16,className:"text-[#64748B]"})]}),r&&h.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)=>h.jsx("div",{className:"px-[12px] py-[8px] text-[14px] text-[#334155] hover:bg-[#F1F5F9] cursor-pointer",onClick:()=>{n(a),i(!1)},children:a},s))})]})},pme=({data:e,communities:t,title:n})=>{const[r,i]=k.useState({}),[o,a]=k.useState(""),s=t?.map(d=>d?.community_name)||[];k.useEffect(()=>{s?.length>0&&!o&&a(s[0])},[s,o]);const l=[{community_name:"L1",Cancelled:55,Open:50,OnHold:20,InProgress:10},{community_name:"L2",Cancelled:15,Open:15,OnHold:8,InProgress:5},{community_name:"L3",Cancelled:12,Open:75,OnHold:18,InProgress:7}],c=k.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:l,[e]),u=d=>{const{dataKey:f}=d||{};i(p=>({...p,[f]:!p?.[f]}))};return Array.isArray(e)&&e.length===0?h.jsx(St,{title:n||"Escalation Level By Building",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full flex items-center justify-center",children:h.jsx(ln,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(St,{title:n||"Escalation Level By Building",titleWeight:"semi-bold",className:"h-[362px]",childrenClassName:"mt-[21px]",rightContent:h.jsx(f4,{options:s,value:o,onChange:d=>a(d)}),children:h.jsx("div",{className:"w-full flex items-center justify-center",children:Array.isArray(e)&&e.length===0?h.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):h.jsx("div",{className:"relative w-full h-[261px]",children:h.jsx(Pt,{width:"100%",height:"100%",children:h.jsxs(Mo,{data:c,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[h.jsx(fr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),h.jsx(Gn,{dataKey:"community_name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),h.jsx($n,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),h.jsx(kt,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},allowEscapeViewBox:{x:!0,y:!0},content:d=>!d?.active||!d?.payload?.length?null:h.jsx(Qt,{...d,data:c,children:h.jsxs("div",{className:"bg-black rounded-[10px] px-[14px] py-[10px] text-[12px] text-white",children:[h.jsx("div",{className:"mb-[6px] font-semibold",children:d?.label}),d?.payload?.map((f,p)=>{const m=f?.color||f?.fill||"#fff";return h.jsxs("div",{className:"flex items-center gap-[6px]",children:[h.jsx("span",{className:"w-[8px] h-[8px] rounded-full inline-block",style:{backgroundColor:m}}),h.jsx("span",{className:"text-[#D1D3D4]",children:f?.name}),h.jsx("span",{className:"text-white font-semibold",children:f?.value})]},p)})]})})}),h.jsx(Sl,{verticalAlign:"bottom",align:"center",onClick:u,content:({payload:d})=>h.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:d?.map((f,p)=>h.jsxs("div",{onClick:()=>u({dataKey:f?.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[h.jsx("div",{className:`w-[16px] h-[8px] ${r?.[f?.dataKey]?"bg-slate-300":""}`,style:{backgroundColor:r?.[f?.dataKey]?"#CBD5E1":f?.color}}),h.jsx("span",{className:`text-[12px] ${r?.[f?.dataKey]?"text-[#CBD5E1]":"text-[#64748B]"}`,children:f?.value})]},p))})}),h.jsx(qt,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:r?.Open}),h.jsx(qt,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:r?.Cancelled}),h.jsx(qt,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:r?.OnHold,name:"On-Hold"}),h.jsx(qt,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:r?.InProgress,name:"In Progress"})]})})})})})},hme=({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 h.jsx(St,{title:"Top 5 Tenants by Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-[20px]",rightContent:h.jsx(f4,{options:r,value:t,onChange:a=>n(a)}),children:o?h.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:h.jsx(ln,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsx("div",{className:"w-full h-[280px]",children:h.jsx(Pt,{width:"100%",height:"100%",children:h.jsxs(tR,{data:i,margin:{top:10,right:-10,left:-10,bottom:0},children:[h.jsx("defs",{children:h.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[h.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),h.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),h.jsx(fr,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),h.jsx(Gn,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:a=>a}),h.jsx($n,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),h.jsx(kt,{cursor:!1,content:a=>h.jsx(Qt,{...a,data:i,children:(()=>{if(!a.active||!a.label)return null;const s=i.find(l=>l.day===a.label);return h.jsxs("div",{className:"bg-[#111] text-white px-[14px] py-[8px] rounded-[6px] flex flex-col gap-[6px] text-[13px]",children:[h.jsx("div",{className:"font-semibold",children:a.label}),h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-2 h-2 rounded-full bg-[#6366F1]"}),h.jsx("div",{className:"text-[#aaa]",children:"Visitors"}),h.jsx("div",{className:"font-bold",children:s?.no_of_visitors??0})]})]})})()})}),h.jsx(t1,{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}=a;return h.jsxs("g",{children:[h.jsx("circle",{cx:s,cy:l,r:6,fill:"#fff",stroke:"#6466F1",strokeWidth:2}),h.jsx("circle",{cx:s,cy:l,r:2.5,fill:"#6466F1"})]})}})]})})})})},mme=({data:e})=>{const t=[{name:"Kosmo One",total:29,pending_approval:1,cancelled:2},{name:"OWC",total:23,pending_approval:9,cancelled:3},{name:"Exora",total:40,pending_approval:12,cancelled:1},{name:"OIC - T3",total:27,pending_approval:19,cancelled:8}],n=e==null?t:Array.isArray(e)?e:[],r=Array.isArray(n)&&n.length===0;return h.jsx(St,{title:"Building Wise Approvals",titleWeight:"semi-bold",className:"h-[362px]",childrenClassName:"mt-[34px]",children:r?h.jsx("div",{className:"h-[250px] flex items-center justify-center",children:h.jsx(ln,{title:"No Data Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsxs("div",{className:"w-full border border-[#EBEBEB] rounded-[10px] overflow-hidden",children:[h.jsxs("div",{className:"grid grid-cols-4 bg-[#FAFAFA] px-[12px] py-[8px] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[h.jsx("div",{children:"Tenant"}),h.jsx("div",{className:"flex justify-end",children:"Total"}),h.jsx("div",{className:"flex justify-end",children:"Pending"}),h.jsx("div",{className:"flex justify-end",children:"Cancelled"})]}),h.jsx("div",{className:"max-h-[280px] overflow-y-auto hide-scrollbar",children:n.map((i,o)=>h.jsxs("div",{className:"grid grid-cols-4 p-[12px] text-[12px] leading-[16px] border-t border-[#EBEBEB]",children:[h.jsx("div",{className:"text-[#475569]",children:i.name}),h.jsx("div",{className:"flex justify-end text-[#36AB6C]",children:i.total}),h.jsx("div",{className:"flex justify-end text-[#F2A815]",children:i.pending_approval}),h.jsx("div",{className:"flex justify-end text-[#AB0000]",children:i.cancelled})]},o))})]})})},sf=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],gme=[{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"}],vme=({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,investment:i.investment||"-",fill:sf[o%sf.length]})):gme.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",fill:sf[o%sf.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?h.jsx(St,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx(ln,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(St,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[h.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[h.jsx(Pt,{width:"100%",height:"100%",children:h.jsxs(Hi,{children:[h.jsx(ui,{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)=>h.jsx(Ln,{fill:i.fill},o))}),h.jsx(kt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?h.jsx(Qt,{...i,data:n,children:h.jsx(Gr,{...i})}):null})]})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),h.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),h.jsx("div",{className:"flex-1 max-w-[280px]",children:h.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0]",children:[h.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] bg-[#F8FAFC]",children:[h.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),h.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-center",children:"Count"}),h.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-right",children:"Investment"})]}),h.jsx("div",{className:"max-h-[205px] overflow-y-auto hide-scrollbar",children:n.map((i,o)=>h.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] border-t border-[#F1F5F9]",children:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.fill}}),h.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),h.jsx("div",{className:"text-[13px] text-[#64748B] text-center",children:i.value}),h.jsx("div",{className:"text-[13px] text-[#64748B] text-right",children:i.investment})]},o))})]})})]})})};function yme({columns:e=[],data:t=[],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=`200px repeat(${u.length-1}, 150px)`,f={};return u.forEach(p=>{if(p.key!=="name"){let m=0;for(let g=0;g<c.length;g++){const v=c[g][p.key];typeof v=="number"&&(m+=v)}f[p.key]=m}}),h.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:[h.jsx("div",{className:"flex-1 overflow-auto hide-scrollbar",children:c.length===0?h.jsx("div",{className:"h-full flex items-center justify-center",children:h.jsx(ln,{title:"No Data Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsxs("div",{className:"min-w-max",children:[h.jsx("div",{className:"grid bg-[#354A5E] text-white text-[14px] font-medium sticky top-0 z-30",style:{gridTemplateColumns:d},children:u.map((p,m)=>h.jsx("div",{title:p.label,className:`px-[24px] py-[16px] whitespace-nowrap overflow-hidden text-ellipsis ${m===0?"sticky left-0 z-40 bg-[#354A5E] shadow-[2px_0_5px_rgba(0,0,0,0.1)] border-r border-[#2C3E50]":""}`,children:p.label},m))}),c.map((p,m)=>h.jsx("div",{className:"grid",style:{gridTemplateColumns:d},children:u.map((g,v)=>h.jsx("div",{className:`px-[24px] py-[14px] text-[14px] flex items-center ${v===0?"bg-white sticky left-0 z-20 font-medium shadow-[2px_0_5px_rgba(0,0,0,0.05)] border-r border-gray-200":"bg-gray-50"}`,children:p[g.key]??"-"},v))},m)),h.jsx("div",{className:"grid bg-[#F8FAFC] border-t border-[#F0F0F0] sticky bottom-0 z-30",style:{gridTemplateColumns:d},children:u.map((p,m)=>h.jsx("div",{className:`px-[24px] py-[16px] ${m===0?"sticky left-0 z-40 bg-[#F8FAFC] text-[#64748B] font-medium shadow-[2px_0_5px_rgba(0,0,0,0.05)] border-r border-gray-200":"text-[#64748B] font-medium"}`,children:p.key==="name"?"Grand Total":f[p.key]||0},m))})]})}),h.jsxs("div",{className:"flex justify-end items-center px-[24px] py-[16px] text-sm bg-white border-t border-[#F0F0F0] gap-[32px]",children:[h.jsxs("div",{className:"flex items-center gap-[8px] text-gray-600 text-[14px]",children:[h.jsx("div",{children:"Rows per page:"}),h.jsx("select",{value:n,onChange:p=>{r(Number(p.target.value)),o(1)},className:"border rounded px-[8px] py-[4px]",children:l.map((p,m)=>h.jsx("option",{value:p,children:p},m))}),h.jsxs("div",{className:"ml-4 text-[14px]",children:[c.length===0?"0–0":`1–${c.length}`," of"," ",a||c.length]})]}),h.jsxs("div",{className:"flex items-center space-x-2 text-gray-600 text-[14px]",children:[h.jsx("button",{onClick:()=>o(1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(BI,{size:18})}),h.jsx("button",{onClick:()=>o(p=>p-1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx($1,{size:18})}),h.jsx("button",{onClick:()=>o(p=>p+1),disabled:i===s,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(B1,{size:18})}),h.jsx("button",{onClick:()=>o(s),disabled:i===s,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(WI,{size:18})})]})]})]})}exports.AccessPointsUsage=JI;exports.Accounting=Mfe;exports.Amenities=KI;exports.AmenitiesStatsCard=co;exports.AmenityWiseRevenue=a4;exports.AssetValueBreakdown=Kfe;exports.AssetsByType=s4;exports.BlockWiseOccupancy=Ofe;exports.BookingTrendChart=o4;exports.Bookings=i4;exports.Budgets=$fe;exports.BuildingWiseApprovals=mme;exports.Card=Ie;exports.CardAccess=ZI;exports.CashBankBalance=Wfe;exports.CommercialAccessOverview=QI;exports.CommercialAmenitiesDashboard=lme;exports.CommercialAssetManagementDashboard=ume;exports.CommercialDashboard=Khe;exports.CommercialEngagementDashboard=fme;exports.CommercialGuardPatrols=c4;exports.CommercialGuardPetrolDashboard=dme;exports.CommercialHelpdeskDashboard=tme;exports.CommercialIncidentReports=u4;exports.CommercialOccupancy=HI;exports.CommercialReportTable=d4;exports.CommercialSmartAccessDashboard=Qhe;exports.CommercialTableDashboard=d4;exports.CommercialVisitorsDashboard=rme;exports.Community=lse;exports.Complaints=ghe;exports.ComplaintsByLevel=bhe;exports.DuesAgeing=Vfe;exports.EmployeeFootfall=YI;exports.Engagement=IR;exports.EngagementStatsGrid=$he;exports.EscalationLevel=pme;exports.EventsUtilisation=The;exports.ExpenseCategories=Yfe;exports.Facilities=cse;exports.FinanceSummary=use;exports.FoodBeverages=UI;exports.GateAndSecurityStatsGrid=phe;exports.GateUpdates=Qse;exports.GuardPatrols=Jpe;exports.Header=R8;exports.Helpdesk=Zse;exports.HelpdeskStatsGrid=Phe;exports.HourlyTrafficFlow=ihe;exports.IncidentReports=she;exports.IncomeExpenditure=FI;exports.MainHeader=q8;exports.MaintenanceStatus=l4;exports.MetricCard=vb;exports.MobileAccess=ZI;exports.MoveInOutTrends=Pfe;exports.NoticeBoardStatus=Mhe;exports.OccupancyOverview=_fe;exports.OrganisationWiseVisitors=r4;exports.PortfolioAssetsByType=vme;exports.RequestBox=whe;exports.ResidentOverview=Efe;exports.RevenuebyCategory=Gfe;exports.SingleStats=Ihe;exports.StaffAttendance=VI;exports.StatsGrid=Qpe;exports.TenantsByVisitors=hme;exports.TicketEscalation=qI;exports.TicketStatus=GI;exports.Tickets=e4;exports.TicketsperCategory=t4;exports.TotalCommercialTable=yme;exports.UnitStatus=wfe;exports.VisitorUpdates=XI;exports.WeeklyVisitorPattern=n4;
|
package/dist/index.es.js
CHANGED
|
@@ -56206,7 +56206,7 @@ const wf = ["#8CB33E", "#F59E0B", "#3B82F6", "#06B6D4", "#CFCFCF"], Fhe = [
|
|
|
56206
56206
|
fill: wf[o % wf.length]
|
|
56207
56207
|
// ✅ IMPORTANT
|
|
56208
56208
|
})), [e]), r = t ?? n.reduce((i, o) => i + o.value, 0);
|
|
56209
|
-
return e && e.length === 0 ? /* @__PURE__ */ h.jsx(Pt, { title: "Assets by Type", titleWeight: "semi-bold", className: "h-[362px]", children: /* @__PURE__ */ h.jsx("div", { className: "flex items-center justify-center h-[
|
|
56209
|
+
return e && e.length === 0 ? /* @__PURE__ */ h.jsx(Pt, { title: "Assets by Type", titleWeight: "semi-bold", className: "h-[362px]", children: /* @__PURE__ */ h.jsx("div", { className: "flex items-center justify-center h-[260px]", children: /* @__PURE__ */ h.jsx(
|
|
56210
56210
|
mn,
|
|
56211
56211
|
{
|
|
56212
56212
|
title: "No Assets Found",
|
package/dist/index.umd.js
CHANGED
|
@@ -479,4 +479,4 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
479
479
|
${i?"bg-[#F7FEFA] text-[#1FA05B]":"bg-[#FBF4F4] text-[#EF4444]"} p-[4px] rounded-[4px] font-medium
|
|
480
480
|
`,children:n}),h.jsx("div",{className:"!text-[#64748B]",children:r})]})]})}const Ope=[{title:"Total Visitors",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Tg,iconColor:"text-[#329DFF]"},{title:"Active Incidents",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Kae,iconColor:"text-[#F69E0A]"},{title:"Missed Patrols",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Epe,iconColor:"text-[#AB0000]"},{title:"Parking Usage",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:T8,iconColor:"text-[#36AB6C]"}];function Cpe({data:e}){const t=Array.isArray(e)&&e.length>0?e:Ope;return h.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>h.jsx(Spe,{...n},r))})}const kpe=[{title:"Maintenance",total:12,pending:3},{title:"Security",total:8,pending:1},{title:"Housekeeping",total:6,pending:2},{title:"Utilities",total:10,pending:4}],Ppe=(e="")=>e.replace(/</g,"<").replace(/>/g,">").replace(/<[^>]*>/g,"").trim();function Dpe({data:e}){const t=Array.isArray(e?.complaints_by_category)&&e.complaints_by_category.length>0?e.complaints_by_category.map(n=>({title:Ppe(n.category_name)||"—",total:n.total||0,pending:n.pending||0})):kpe;return h.jsx(Le,{title:"Complaints",titleClassName:"!text-[20px] !leading-[24px] font-semibold!",className:"w-full h-[362px] p-[24px]!",children:h.jsx("div",{className:"flex flex-col gap-[12px] max-h-full overflow-y-auto hide-scrollbar",children:t.map((n,r)=>h.jsxs("div",{className:"flex items-center justify-between bg-[#F8FAFC] rounded-[4px] p-[12px]",children:[h.jsxs("div",{className:"flex flex-col gap-[4px]",children:[h.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),h.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),h.jsxs("div",{className:"flex flex-col items-end gap-[4px]",children:[h.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#AB0000]",children:String(n.pending).padStart(2,"0")}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},r))})})}const Ape=[{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}],Tpe=()=>{const e=[{label:"Open",color:"#EF4444"},{label:"In Progress",color:"#F59D0D"},{label:"Closed",color:"#12B981"}];return h.jsx("div",{style:{display:"flex",justifyContent:"space-between",gap:"15px"},children:e.map(t=>h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[h.jsx("div",{style:{width:"6px",height:"6px",backgroundColor:t.color,transform:"rotate(45deg)"}}),h.jsx("span",{style:{fontSize:"14px"},children:t.label})]},t.label))})},Npe=({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:Ape).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 h.jsxs(Le,{title:"Complaints by Level",className:"w-full h-[362px] p-[24px]! gap-[18px]!",titleClassName:"!text-[20px] !leading-[24px] font-semibold!",children:[h.jsx(Ot,{width:"100%",height:"85%",children:h.jsxs(ko,{data:t,margin:{top:5,right:-25,left:-30,bottom:5},children:[h.jsx(sr,{strokeDasharray:"0",vertical:!1}),h.jsx(Gn,{dataKey:"level"}),h.jsx(Rn,{domain:[0,r],ticks:Array.from({length:i+1},(a,s)=>s*o)}),h.jsx(St,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},allowEscapeViewBox:{x:!0,y:!0},content:a=>!a.active||!a.payload||!a.payload.length?null:h.jsx(Yt,{...a,data:t,children:h.jsxs("div",{className:"bg-[#121212] rounded-[10px] px-[14px] py-[10px] text-[12px] text-white",children:[h.jsx("div",{className:"mb-[6px] font-semibold",children:a.label}),a.payload.map((s,l)=>{const c=s.color||s.fill||"#fff";return h.jsxs("div",{className:"flex items-center gap-[6px]",children:[h.jsx("span",{className:"w-2 h-2 rounded-full inline-block",style:{backgroundColor:c}}),h.jsx("span",{className:"text-[#D1D3D4]",children:s.name}),h.jsx("span",{className:"text-white font-semibold",children:s.value})]},l)})]})})}),h.jsx(qt,{dataKey:"open_count",name:"Open",stackId:"a",fill:"#EF4444",barSize:44,radius:[0,0,0,0]}),h.jsx(qt,{dataKey:"in_progress_count",name:"In Progress",stackId:"a",fill:"#F59D0D",barSize:44,radius:[0,0,0,0]}),h.jsx(qt,{dataKey:"closed_count",name:"Closed",stackId:"a",fill:"#12B981",barSize:44,radius:[0,0,0,0]})]})}),h.jsx(Tpe,{})]})},jpe=[{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 Mpe({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})):jpe;return h.jsx(Le,{title:"Request Box",titleClassName:"!text-[20px] !leading-[24px] font-semibold!",className:"w-full h-[362px] p-[24px]!",children:h.jsx("div",{className:"flex flex-col gap-[12px] max-h-full overflow-y-auto hide-scrollbar",children:t.map((n,r)=>h.jsxs("div",{className:"flex items-center justify-between bg-[#F8FAFC] rounded-[4px] p-[12px]",children:[h.jsxs("div",{className:"flex flex-col gap-[4px]",children:[h.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),h.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),h.jsxs("div",{className:"flex flex-col items-end gap-[4px]",children:[h.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#AB0000]",children:String(n.pending).padStart(2,"0")}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},`${n.title}-${r}`))})})}function Ipe(e){return gt({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 Fpe=["open_complaints","pending_requests","avg_response_time","resolution_rate"],Lpe={open_complaints:{title:"Open Complaints",Icon:oS,iconColor:"#AB0000",deltaLabel:"Compared to last month"},pending_requests:{title:"Pending Requests",Icon:Ipe,iconColor:"#E7A015",deltaLabel:"Compared to last month"},avg_response_time:{title:"Avg Response Time",Icon:R8,iconColor:"#1FA05B",deltaLabel:"Compared to last month"},resolution_rate:{title:"Resolution Rate",Icon:F8,iconColor:"#329DFF",deltaLabel:"Compared to last month"}},Rpe=({children:e,size:t=28,lineHeight:n=32,weight:r=500,color:i="#121212"})=>h.jsx("div",{style:{fontWeight:r,fontSize:`${t}px`,lineHeight:`${n}px`,color:i},children:e}),$pe={primary:{size:28,lineHeight:32,weight:500}},Bpe={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 Wpe({id:e,data:t}){return e&&t&&!t[e]&&t.current!==void 0?h.jsx(L4,{id:e,data:t}):h.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[16px]",children:Fpe.map(n=>h.jsx(L4,{id:n},n))})}function L4({id:e,data:t}){const n=Lpe[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=Fd,iconColor:a,deltaLabel:s}=n,l=t&&Object.keys(t).length>0?t:Bpe[e],c=r(e,l?.current),u=l?.trend_percent??"—";return l?.direction==="good"||l?.direction,h.jsx("div",{className:"h-[132px]",children:h.jsxs(Le,{title:i,titleColor:a,icon:h.jsx("div",{className:"h-[20px] w-[20px] flex items-center justify-center",children:h.jsx(o,{className:"h-[20px] w-[20px]",style:{color:a}})}),childrenClassName:"!space-y-[12px]",iconClassName:"!gap-[12px]",children:[h.jsx(Rpe,{...$pe.primary,children:c}),h.jsxs("div",{className:"flex items-center gap-[8px] text-[12px] leading-[16px]",children:[h.jsx(Ac,{value:u}),h.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:s})]})]})})}const zpe=[{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"},{title:"Maintenance Meeting",date:"25 Jun 2025",rsvp:"45/60",utilisation:75,status:"Completed"},{title:"Maintenance Meeting",date:"25 Jun 2025",rsvp:"45/60",utilisation:75,status:"Completed"}];function Vpe({title:e,date:t,rsvp:n,utilisation:r,status:i}){return h.jsxs("div",{className:"bg-[#F8FAFC] p-[12px] rounded-[4px]",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("div",{className:"text-[16px] leading-[20px] font-semibold text-[#121212]",children:e}),h.jsx("div",{className:`!text-[12px] leading-[16px] font-medium p-[4px] rounded-[4px] ${i==="Completed"?"text-[#36AB6C] bg-[#E6F7EE]":i==="Upcoming"?"text-[#329DFF] bg-[#E6F2FF]":"text-slate-500 bg-slate-100"}`,children:i})]}),h.jsx("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:t}),h.jsxs("div",{className:"mt-[8px] flex justify-between items-center",children:[h.jsxs("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:[n," RSVP"]}),h.jsxs("div",{className:"text-[#3C82F6] text-[14px] leading-[18px] font-medium",children:[r,"% utilisation"]})]}),h.jsx("div",{className:"mt-[8px] w-full bg-[#F8FAFC] h-[6px] rounded",children:h.jsx("div",{className:"h-[6px] rounded bg-[#3C82F6]",style:{width:`${r}%`}})})]})}function Hpe({data:e}){const t=Array.isArray(e)?e:zpe;return h.jsx(Le,{title:"Events Utilisation",className:"w-full h-[360px] p-[24px]!",childrenClassName:"overflow-y-auto hide-scrollbar",titleClassName:"!text-[20px] !leading-[24px] font-semibold!",children:h.jsx("div",{className:"m-auto space-y-[12px]",children:t?.length>0?t.map((n,r)=>h.jsx(Vpe,{...n},`${n.title}-${r}`)):h.jsx("div",{className:"h-full flex items-center justify-center",children:h.jsx(an,{})})})})}const Ype=[{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 Upe({label:e,value:t,subLabel:n,bgColor:r,textColor:i}){return h.jsxs("div",{className:`border-[0.5px] border-[#EBEBEB] rounded-[12px] p-[16px] ${r} h-[124px]`,children:[h.jsx("div",{className:`text-[16px] leading-[20px]! tracking-[-2%] font-medium ${i}`,children:e}),h.jsx("div",{className:"mt-[16px] text-[28px] leading-[32px] font-semibold text-[#121212]",children:t}),h.jsx("div",{className:"mt-[8px] !text-[12px] leading-[16px] text-[#64748B]",children:n})]})}function Kpe({data:e}){const t=Array.isArray(e)&&e.length>0?e:Ype;return h.jsx(Le,{title:"Notice Board Status",className:"w-full h-[360px] !p-[24px]",titleClassName:"!text-[20px] !leading-[24px] font-semibold!",children:h.jsx("div",{className:"grid grid-cols-2 gap-[24px]",children:t.map((n,r)=>h.jsx(Upe,{...n},`${n.label}-${r}`))})})}function qpe({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=Fd,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50",iconUrl:l}){return h.jsx(Le,{title:e,icon:h.jsx("div",{className:"grid place-items-center ",children:l?h.jsx("img",{src:l,alt:"icon",className:"h-8 w-8 object-contain"}):h.jsx(o,{className:`h-8 w-8 ${a}`})}),className:"h-[132px]",children:h.jsxs("div",{children:[h.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),h.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[h.jsx(Ac,{value:n}),h.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}function Gpe({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 h.jsx("div",{className:"h-full",children:t.map((n,r)=>h.jsx(qpe,{...n},r))})}function Xpe({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,icon:o,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return h.jsxs(Le,{title:e,icon:h.jsx("div",{className:"size-[20px] grid place-items-center",children:h.jsx("img",{src:o,alt:e})}),className:"h-[132px]",titleClassName:"text-[#64748B]! leading-[20px]",childrenClassName:"space-y-[8px]!",children:[h.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),h.jsxs("div",{className:"flex items-center gap-[8px] text-[12px] leading-[16px]",children:[h.jsx(Ac,{value:n}),h.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:r})]})]})}const Qpe=[{title:"Notice",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,icon:"https://res.cloudinary.com/dzqlw1ixr/image/upload/v1773902569/notice_djcorh.svg"},{title:"Post",value:83,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,icon:"https://res.cloudinary.com/dzqlw1ixr/image/upload/v1773902568/post_rivboo.svg"},{title:"Poll",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,icon:"https://res.cloudinary.com/dzqlw1ixr/image/upload/v1773902569/poll_b43jo0.svg"},{title:"Survey",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,icon:"https://res.cloudinary.com/dzqlw1ixr/image/upload/v1773902568/survey_yevzwi.svg"}];function Zpe({data:e}){const t=Array.isArray(e)&&e.length>0?e:Qpe;return h.jsx("div",{className:"px-[20px] grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:t.map((n,r)=>h.jsx(Xpe,{...n},r))})}const R4=({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 h.jsxs("div",{className:"flex flex-col items-start",children:[h.jsx("div",{className:"w-2/3 min-w-[80px] h-5 rounded-full overflow-hidden",children:h.jsx("div",{className:`h-[11px] rounded-full ${n||""}`,style:{width:n==="bg-[#12B981]"?`${a+45}%`:`${a}%`}})}),h.jsx("div",{className:`${s} !text-[12px] font-bold mt-1`,children:i??0}),h.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-1",children:r??""})]})},$4=({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 h.jsx("div",{children:h.jsxs("div",{className:"bg-white !border-[0.5px] !border-[#EBEBEB] rounded-[12px] shadow-[0_0_12px_0_#EAF2FF] p-[16px] h-[128px]",children:[h.jsxs("div",{className:"flex items-center gap-[12px] h-[20px]",style:{marginBottom:"24px"},children:[h.jsx(Tg,{className:"!text-[20px] text-[#329DFF]"}),h.jsx("div",{className:"font-medium text-[#121212] text-[16px] leading-[20px]",children:"Occupancy Overview"})]}),h.jsxs("div",{className:"flex items-start justify-between",children:[h.jsxs("div",{className:"flex flex-col gap-[4px]",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] font-normal",children:"Total Occupants"}),h.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:i??0})]}),h.jsxs("div",{className:"flex items-end gap-[4px]",children:[h.jsx(R4,{value:o??0,total:s||1,colorClass:"bg-[#3C81F6]",label:(o??0)<=1?"Employee":"Employees"}),h.jsx(R4,{value:a??0,total:s||1,colorClass:"bg-[#8B5CF6]",label:(a??0)<=1?"Admin":"Admins"})]})]})]})})};Bn.register(Fo,Lo,Bl,Ar);const B4=({data:e})=>{const t=e!=null,n=e?.employee_data,r=["HP","Adobe","Anarock","Swiggy","Infosys","Zepto"],i=[2e3,1700,1500,1200,900,800],o=[],a=[];if(t){if(n&&n.length>0)for(let d=0;d<n.length;d++)o.push(n[d].name),a.push(n[d].employees)}else for(let d=0;d<r.length;d++)o.push(r[d]),a.push(i[d]);let s=!1;if(t)if(!n||n.length===0)s=!0;else{s=!0;for(let d=0;d<n.length;d++)if(n[d].employees!==0){s=!1;break}}let l=0;for(let d=0;d<a.length;d++)a[d]>l&&(l=a[d]);const c={labels:o,datasets:[{data:a,backgroundColor:[],barThickness:34}]};for(let d=0;d<a.length;d++)c.datasets[0].backgroundColor.push("#3C81F6");const u={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff",displayColors:!1,callbacks:{label:d=>`Employees: ${d.parsed.y}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B",font:{size:12}}},y:{beginAtZero:!0,min:0,max:l>0?l+5:2e3,ticks:{stepSize:l>0?Math.ceil((l+5)/5):500,color:"#64748B",callback:d=>d},grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1}}}};return t&&s?h.jsx(Le,{className:"w-full h-[238px]",title:"Employee Footfall",period:"Today",icon:h.jsx(N4,{className:"!text-[24px] text-[#8B5CF6]"}),children:h.jsx("div",{className:"h-full flex items-center justify-center",children:h.jsx(an,{title:"No Employee footfall Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsxs(Le,{className:"w-full h-[238px]",title:"Employee Footfall",period:"Today",icon:h.jsx(N4,{className:"!text-[24px] text-[#8B5CF6]"}),children:[h.jsxs("div",{className:"mb-[10px] mt-[8px] flex flex-col gap-[4px]!",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Employees Inside"}),h.jsx("div",{className:"text-[20px] leading-[24px] font-medium text-[#3C81F6]",children:t?e.total_employees:7500})]}),h.jsx("div",{className:"h-[110px]",children:h.jsx(Wl,{data:c,options:u})})]})},Jpe="Rs",W4=["bg-blue-500","bg-red-500","bg-purple-700"],bs={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 pm(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 z4(e){if(e==null||e==="")return"0";if(typeof e=="number")return ZS(e);const t=Number(e);return Number.isNaN(t)?String(e):ZS(t)}function ehe(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||W4[p%W4.length]})),o=n?.totalOrders??n?.orders??bs.summary.totalOrders,a=n?.revenueGenerated??n?.revenue??bs.summary.revenueGenerated,s=pm(n?.growthPercentage??n?.revenueGrowth,bs.summary.growthPercentage),l=pm(n?.growthTotalPercentage??n?.orderGrowth,bs.summary.growthTotalPercentage),c=n?.currencyType||n?.currency||Jpe,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||bs.title,period:t?.period||bs.period,summary:{totalOrders:o,revenueGenerated:a,growthPercentage:s,growthTotalPercentage:l,currencyType:c},outlets:d.length>0?d:bs.outlets}}function V4({data:e,title:t,period:n,icon:r}){const i=ehe(e),o=t||i.title,a=n||i.period,s=r||h.jsx(ape,{className:"!text-[24px] text-[#FA7E28]"}),l=i.summary.totalOrders??0,c=z4(i.summary.revenueGenerated),u=pm(i.summary.growthPercentage,0),d=pm(i.summary.growthTotalPercentage,0),f=u>=0,p=d>=0;return h.jsx(Le,{className:"h-[324px]",title:o,period:a,icon:s,children:h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"flex gap-[24px]",children:[h.jsxs("div",{className:"w-full flex flex-col gap-[8px]!",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Orders"}),h.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:l}),h.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?h.jsx(Xo,{}):h.jsx(Go,{}),d,"%",h.jsx("span",{children:"from last month"})]})]}),h.jsx("div",{className:"w-full flex justify-end",children:h.jsxs("div",{className:"flex flex-col gap-[8px]",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] whitespace-nowrap",children:"Revenue Generated"}),h.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF] whitespace-nowrap",children:[i.summary.currencyType," ",c]}),h.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] whitespace-nowrap ${f?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[f?h.jsx(Xo,{}):h.jsx(Go,{}),u,"%",h.jsx("span",{children:"from last month"})]})]})})]}),h.jsx("div",{className:"mt-[16px]",children:i.outlets.map((m,g)=>h.jsxs("div",{className:g===i.outlets.length-1?"":"mb-[16px]",children:[h.jsxs("div",{className:"flex justify-between text-sm mb-[8px]",children:[h.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:m.name}),h.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[h.jsxs("div",{className:"text-[#64748B] inline-block",children:[m.orders," orders"]}),h.jsxs("div",{className:"mx-2 text-[#121212] inline-block",children:[i.summary.currencyType," ",z4(m.revenue)]})]})]}),h.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:h.jsx("div",{className:`h-[11px] rounded-full ${m.color}`,style:{width:`${m.percentage}%`}})})]},`${m.name}-${g}`))})]})})}function H4({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??"Rs"},chartData:Array.isArray(e?.chart_data)?e.chart_data.map(m=>({facility_name:m?.facility_name,total_bookings:m?.total_bookings??0,paid_revenue:m?.paid_revenue??"0",isPaid:m?.is_paid===!0})):[]}:e||{},n=t?.amenitySummary||{},i=(Array.isArray(t?.chartData)?t.chartData:[]).map(m=>({...m,isPaid:m?.isPaid===!0})),o=i.length>0&&i.every(m=>m?.isPaid===!1),a=n?.totalBookings||0,s=n?.bookingGrowth;let l=0;if(typeof s=="number")l=s;else if(typeof s=="string"){const m=s.replace("%","").trim(),g=Number(m);l=isNaN(g)?0:g}const c=i.reduce((m,g)=>{const v=g?.total_bookings||0;return m+v},0),u=i.map(m=>{const g=m?.total_bookings||0,v=m?.isPaid?`${n?.currencyType||"Rs"} ${m?.paid_revenue||"0.00"}`:"",x=c>0?Math.round(g/c*100):0;return{name:m?.facility_name||"Unknown",bookings:g,revenue:v,percentage:x,color:"bg-[#3C81F6]",isPaid:m?.isPaid}}),d=n?.growthPercentage;let f=null;if(typeof d=="number")f=d;else if(typeof d=="string"){const m=d.replace("%","").trim(),g=Number(m);f=isNaN(g)?null:g}const p=f!==null?f>=0:!0;return h.jsx(Le,{className:"h-[324px]",title:"Amenities",period:"Today",icon:h.jsx(spe,{className:"!text-[24px] text-[#8B5CF6]"}),children:h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"flex gap-[24px]",children:[h.jsxs("div",{className:"w-full flex flex-col gap-[8px]!",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Bookings"}),h.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:a}),h.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?h.jsx(Xo,{}):h.jsx(Go,{}),l,"%",h.jsx("span",{children:"from last month"})]})]}),!o&&h.jsx("div",{className:"w-full flex justify-end",children:h.jsxs("div",{className:"flex flex-col gap-[8px]",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] whitespace-nowrap",children:"Revenue Generated"}),h.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF] whitespace-nowrap",children:[n?.currencyType||"Rs"," ",n?.todayPaidRevenue??"0.00"]}),f!==null&&h.jsxs("div",{className:`w-fit inline-flex items-center gap-[4px] text-[10px] leading-[14px] p-[4px] rounded-[4px] whitespace-nowrap ${p?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[p?h.jsx(Xo,{}):h.jsx(Go,{}),f,"%",h.jsx("span",{children:"from last month"})]})]})})]}),h.jsx("div",{className:"mt-[16px]",children:u.length>0?u.map((m,g)=>h.jsxs("div",{className:g===u.length-1?"":"mb-[16px]",children:[h.jsxs("div",{className:"flex justify-between text-sm mb-[8px]",children:[h.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:m?.name}),h.jsxs("div",{className:"font-medium text-[12px] leading-[16px]",children:[h.jsxs("div",{className:"text-[#64748B] inline",children:[m?.bookings," ",m?.bookings<=1?"booking":"bookings"]}),m?.isPaid&&h.jsx("div",{className:"mx-2 text-[#121212] inline",children:m?.revenue})]})]}),h.jsx("div",{className:"h-[11px] bg-gray-100 rounded-full",children:h.jsx("div",{className:`h-[11px] rounded-full ${m?.color}`,style:{width:`${m?.percentage}%`}})})]},g)):h.jsx("div",{className:"flex items-center justify-center h-[120px]",children:h.jsx("div",{className:"text-[12px] text-[#94A3B8]",children:"No amenity usage data available"})})})]})})}Bn.register(Fo,Lo,Bl,Ar,Zr);function Y4({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:!1,pointStyle:"rect",padding:12,boxWidth:20,boxHeight:8,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 h.jsx(Le,{className:"h-[267px]",title:"Ticket Escalation Levels",period:"Today",icon:h.jsx(L8,{className:"!text-[24px] text-[#3C81F6]"}),children:h.jsx("div",{className:"h-full",children:h.jsx(Wl,{data:l,options:c})})})}const the=({active:e,payload:t})=>{if(!e||!t||!t.length)return null;const n=t[0],r=n.payload.color;return h.jsx("div",{style:{backgroundColor:"#000000",color:"#ffffff",padding:"8px 10px",borderRadius:"8px",fontSize:"12px"},children:h.jsxs("div",{className:"flex items-center gap-[8px] font-medium",children:[h.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:r}}),h.jsx("div",{children:n.name}),h.jsx("div",{className:"ml-2",children:n.value})]})})};function U4({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 h.jsx(Le,{className:"h-[267px]",title:"Ticket Status",period:"Today",icon:h.jsx(xf,{className:"!text-[24px] text-[#EF4444]"}),children:h.jsxs("div",{className:"flex h-full items-center gap-[16px]",children:[h.jsxs("div",{className:"w-[202px] h-[170px] relative",children:[h.jsx(Ot,{width:"100%",height:"100%",children:h.jsxs($i,{children:[h.jsx(ai,{data:i,innerRadius:55,outerRadius:85,dataKey:"value",stroke:"#FFFFFF",strokeWidth:2,children:i.map((a,s)=>h.jsx(In,{fill:a.color},s))}),h.jsx(St,{content:a=>h.jsx(Yt,{...a,data:i,children:h.jsx(the,{...a})})})]})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsxs("div",{className:"flex items-baseline text-[18px] leading-[22px] font-medium text-[#121212]",children:[h.jsx("div",{children:r(n.completed)}),h.jsxs("div",{className:"text-[18.18px] leading-[22.22px] text-[#121212]",children:["/",o]})]}),h.jsx("div",{className:"text-[10.1px] leading-[14.14px] text-[#64748B]",children:"Completed"})]})]}),h.jsx("div",{className:"flex-1 space-y-2",children:i.map(a=>h.jsxs("div",{className:"flex items-center justify-between text-[12px] leading-[17px] mt-[12px]",children:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"h-[7px] w-[16px]",style:{backgroundColor:a.color}}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]}),h.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px] font-medium",children:a.value})]},a.name))})]})})}const K4={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 nhe(e){const t=e>=12?"PM":"AM";let n=e%12;return n===0&&(n=12),`${n} ${t}`}function rhe(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 ihe(e=[]){return Array.from({length:24},(t,n)=>{const r=e.find(i=>rhe(i?.hour)===n)||{};return{hour:n,time:nhe(n),walkins:Number(r?.walkins??0),approved:Number(r?.pre_approved??r?.preApproved??r?.approved??0)}})}function q4({title:e,color:t,rows:n=[],children:r}){const i=h.jsxs("div",{className:"bg-white rounded-[12px] min-w-[260px] p-[16px] border-[0.5px] border-[#EBEBEB] shadow-[0px_0px_12px_0px_#EAF2FF]",children:[h.jsx("div",{className:"flex items-center gap-[8px] font-medium text-[#121212]",children:h.jsx("div",{children:e??""})}),h.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})=>h.jsxs("div",{className:"flex justify-between text-[14px] leading-[18px]",children:[h.jsx("div",{className:"text-[#64748B]",children:o??""}),h.jsx("div",{className:"font-semibold",style:{color:s||"#121212"},children:a??0})]},o))})]});return h.jsx(xM,{placement:"right-start",interactive:!0,delay:[100,0],offset:[6,0],appendTo:()=>document.body,maxWidth:"none",render:o=>h.jsx("div",{tabIndex:"-1",...o,children:i}),children:r})}function ohe({active:e,payload:t}){return!e||!t?.length?null:h.jsx("div",{className:"rounded-[8px] bg-[#121212] px-[12px] py-[8px] text-[12px] text-white shadow-lg",children:t.map(n=>h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:n.stroke}}),h.jsx("span",{className:"min-w-[82px] text-[#D1D3D4]",children:n.name}),h.jsx("span",{className:"font-semibold",children:n.value})]},n.dataKey))})}function G4({data:e}){const t=e&&Object.keys(e).length?e:K4,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 ihe(l.length?l:K4.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 h.jsx(Le,{className:"h-[377px]",title:"Visitor Updates",period:`Today at ${s}`,icon:h.jsx(Dg,{className:"!text-[24px] text-[#8B5CF6]"}),children:h.jsxs("div",{className:"flex flex-col gap-[24px]",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-y-4 gap-x-6",children:[h.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[h.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Total Visitors"}),h.jsx("div",{className:"text-[20px] font-medium text-[#08B6D4]",children:n?.totalVisitorsToday??0})]}),h.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[h.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Peak Time"}),h.jsx("div",{className:"text-[20px] font-medium text-[#8B5CF6]",children:n?.peakTime??"-"})]}),h.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[h.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Active Walk-ins"}),h.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[h.jsx("div",{className:"text-[28px] text-[#1FA05B] leading-[32px]",children:r?.walkins?.currently_inside??0}),h.jsx(q4,{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:h.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.walkins?.total_visited_today??0]})})]})]}),h.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[h.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Pre-approved Check-ins"}),h.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[h.jsx("div",{className:"text-[28px] text-[#E7A015] leading-[32px]",children:r?.preApproved?.completed_visits??0}),h.jsx(q4,{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:h.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.preApproved?.total_expected_today??0]})})]})]})]}),h.jsx("div",{className:"w-full h-[149px]",children:h.jsx(Ot,{width:"100%",height:"100%",children:h.jsxs(Sx,{data:i??[],margin:{top:5,right:0,left:0,bottom:-10},children:[h.jsx(sr,{stroke:"#E5E7EB",strokeDasharray:"4 4",vertical:!1}),h.jsx(Gn,{dataKey:"time",tickFormatter:(l,c)=>c%4===0?l:"",axisLine:!1,tickLine:!1,tick:{fill:"#121212",fontSize:10,fontWeight:400}}),h.jsx(Rn,{width:24,axisLine:!1,tickLine:!1,allowDecimals:!1,ticks:o,domain:[0,a],tick:{fill:"#64748B",fontSize:10,fontWeight:400}}),h.jsx(St,{content:l=>h.jsx(Yt,{...l,data:i,children:h.jsx(ohe,{...l})})}),h.jsx(da,{type:"monotone",dataKey:"walkins",stroke:"#22C55E",strokeWidth:2,dot:!1,name:"Walk-ins",isAnimationActive:!1}),h.jsx(da,{type:"monotone",dataKey:"approved",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved",isAnimationActive:!1})]})})})]})})}function ahe(){return h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"px-[20px] grid grid-cols-1 lg:grid-cols-[minmax(0,1fr)_minmax(0,2fr)] gap-[24px] mt-6 auto-rows-fr",children:[h.jsx($4,{}),h.jsx(B4,{})]}),h.jsxs("div",{className:"px-[20px] grid grid-cols-1 lg:grid-cols-3 gap-[24px] mt-6 auto-rows-fr",children:[h.jsx("div",{className:"mt-[-115px]",children:h.jsx(G4,{})}),h.jsx(U4,{}),h.jsx(Y4,{})]}),h.jsxs("div",{className:"px-[20px] grid grid-cols-1 lg:grid-cols-3 gap-[24px] mt-6 auto-rows-fr",children:[h.jsx(Zj,{}),h.jsx(H4,{}),h.jsx(V4,{})]})]})}function X4({data:e=null}){const t={total_entries:79.6,entries:59350,exit:40950},n=e&&Object.keys(e).length>0?e:t,r=c=>{const u=Number(c);return isNaN(u)?0:u},i=r(n.entries),o=r(n.exit),a=e&&Object.keys(e).length>0&&Number(e.entries)===0&&Number(e.exit)===0,s=[{name:"Entries",value:i,color:"#8B5CF6"},{name:"Exit",value:o,color:"#329DFF"}],l=r(n.total_entries);return h.jsx(kt,{className:"h-[362px]",title:"Access Overview",titleWeight:"semi-bold",children:a?h.jsx("div",{className:"h-[300px] flex items-center justify-center",children:h.jsx(an,{title:"No access Point Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsxs("div",{className:"flex flex-col items-center mt-[16px]",children:[h.jsxs("div",{className:"relative w-[212px] h-[212px]",children:[h.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:h.jsx("div",{className:"w-[130px] h-[130px] rounded-full shadow-[0px_12px_35px_rgba(0,0,0,0.12)]"})}),h.jsx("div",{className:"h-[212px]",children:h.jsx(Ot,{width:"100%",height:"100%",children:h.jsxs($i,{children:[h.jsx(ai,{data:s,dataKey:"value",innerRadius:65,outerRadius:100,startAngle:360,endAngle:-180,paddingAngle:1,stroke:"transparent",children:s.map((c,u)=>h.jsx(In,{fill:c.color},u))}),h.jsx(St,{content:c=>h.jsx(Yt,{...c,data:s,children:h.jsx(Rr,{...c})})})]})})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsx("div",{className:"text-[22px] leading-[27px] font-medium text-[#121212]",children:l}),h.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B]",children:"Total Access"})]})]}),h.jsxs("div",{className:"mt-[28px] flex justify-between w-full px-[20px]",children:[h.jsxs("div",{className:"flex flex-col items-center",children:[h.jsxs("div",{className:"flex items-center gap-[6px]",children:[h.jsx("div",{className:"w-[14px] h-[6px] bg-[#8B5CF6]"}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Entries"})]}),h.jsx("div",{className:"text-[18px] font-medium text-[#8B5CF6] mt-[4px]",children:i.toLocaleString()})]}),h.jsxs("div",{className:"flex flex-col items-center",children:[h.jsxs("div",{className:"flex items-center gap-[6px]",children:[h.jsx("div",{className:"w-[14px] h-[6px] bg-[#329DFF]"}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Exit"})]}),h.jsx("div",{className:"text-[18px] font-medium text-[#329DFF] mt-[4px]",children:o.toLocaleString()})]})]})]})})}function Q4({title:e="Access",data:t=[],height:n="h-[362px]"}){const r=i=>i==null?"0":Number(i).toLocaleString();return h.jsx(kt,{className:n,title:e,titleWeight:"semi-bold",children:h.jsxs("div",{className:"rounded-[12px] overflow-hidden mt-[16px]",children:[h.jsxs("div",{className:"grid grid-cols-2 bg-[#F8FAFC] py-[8px] px-[12px] text-[12px] leading-[16px] font-medium text-[#64748B]",children:[h.jsx("div",{children:"Point"}),h.jsx("div",{className:"text-right",children:"Access"})]}),t.map((i,o)=>h.jsxs("div",{className:"grid grid-cols-2 p-[12px] text-[14px] border-t border-[#E2E8F0]",children:[h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:i.label}),h.jsx("div",{className:"text-[12px] leading-[16px] text-right font-medium",style:{color:i.color||"#000"},children:r(i.value)})]},o))]})})}function Z4({data:e=[]}){const[t,n]=k.useState([]),r=e&&e.length?e:[],i=!e||e.length===0,o=e&&e.length>0&&e.every(c=>Number(c.entries)===0&&Number(c.exit)===0),a=i||o,s=c=>c>=1e3?`${c/1e3}K`:c,l=c=>{n(u=>u.includes(c)?u.filter(d=>d!==c):[...u,c])};return h.jsx(kt,{title:"Access Points Usage",titleWeight:"semi-bold",className:"h-[362px]",children:a?h.jsx("div",{className:"h-[270px] flex items-center justify-center",children:h.jsx(an,{title:"No access Point Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsx("div",{className:"mt-[24px] h-[270px] w-full",children:h.jsx(Ot,{width:"100%",height:"100%",children:h.jsxs(ko,{data:r,barSize:54,margin:{top:0,right:0,left:-20,bottom:0},children:[h.jsx(sr,{strokeDasharray:"8 8",vertical:!1}),h.jsx(sx,{y:0,stroke:"#EBEBEB"}),h.jsx(Gn,{dataKey:"block_name",tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),h.jsx(Rn,{tickFormatter:s,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),h.jsx(St,{cursor:!1,content:c=>h.jsx(Yt,{...c,data:r,children:(()=>{if(!c.active||!c.label)return null;const u=r.find(d=>d.block_name===c.label);return h.jsxs("div",{className:"bg-[#111] text-white px-[14px] py-[8px] rounded-[6px] flex flex-col gap-[6px] text-[13px]",children:[h.jsx("div",{className:"font-semibold",children:c.label}),!t.includes("entries")&&h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-2 h-2 rounded-full bg-[#329DFF]"}),h.jsx("div",{className:"text-[#aaa]",children:"Entries"}),h.jsx("div",{className:"font-bold",children:u?.entries??0})]}),!t.includes("exit")&&h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-2 h-2 rounded-full bg-[#76BDFF]"}),h.jsx("div",{className:"text-[#aaa]",children:"Exit"}),h.jsx("div",{className:"font-bold",children:u?.exit??0})]})]})})()})}),h.jsx(nl,{verticalAlign:"bottom",height:36,content:()=>{const c=[{key:"entries",label:"Entries",color:"#329DFF"},{key:"exit",label:"Exit",color:"#76BDFF"}];return h.jsx("div",{style:{display:"flex",gap:"20px",justifyContent:"center",marginTop:"20px"},children:c.map((u,d)=>{const f=t.includes(u.key);return h.jsxs("div",{onClick:()=>l(u.key),style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer",opacity:f?.4:1},children:[h.jsx("div",{style:{width:"20px",height:"8px",backgroundColor:u.color}}),h.jsx("div",{style:{fontSize:"12px",color:"#64748B"},children:u.label})]},d)})})}}),h.jsx(qt,{dataKey:"entries",stackId:"a",fill:"#329DFF",hide:t.includes("entries")}),h.jsx(qt,{dataKey:"exit",stackId:"a",fill:"#76BDFF",hide:t.includes("exit")})]})})})})}function she(e){return gt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{x:"3",y:"4",width:"18",height:"18",rx:"2",ry:"2"},child:[]},{tag:"line",attr:{x1:"16",y1:"2",x2:"16",y2:"6"},child:[]},{tag:"line",attr:{x1:"8",y1:"2",x2:"8",y2:"6"},child:[]},{tag:"line",attr:{x1:"3",y1:"10",x2:"21",y2:"10"},child:[]}]})(e)}function lhe(e){return gt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"6 9 12 15 18 9"},child:[]}]})(e)}function che(e){return gt({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},child:[]},{tag:"polyline",attr:{points:"7 10 12 15 17 10"},child:[]},{tag:"line",attr:{x1:"12",y1:"15",x2:"12",y2:"3"},child:[]}]})(e)}function xs({text:e="Smart Access",Icon:t,iconColor:n="#329DFF"}){return h.jsxs("div",{className:"px-[20px] pt-6",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[t?h.jsx("div",{className:"flex items-center justify-center",children:h.jsx(t,{size:20,style:{color:n}})}):null,h.jsx("div",{className:"text-[24px] leading-[32px] font-semibold text-[#121212]",children:e})]}),h.jsxs("div",{className:"flex items-center gap-[12px]",children:[h.jsxs("div",{className:"flex items-center gap-[8px] bg-white px-[16px] py-[8px].5 rounded-[8px] border border-[#EBEBEB] text-sm font-medium text-[#64748B] hover:bg-gray-100 transition-colors cursor-pointer",children:[h.jsx("div",{className:"flex items-center",children:h.jsx(she,{size:16})}),h.jsx("div",{children:"Today"}),h.jsx("div",{className:"flex items-center",children:h.jsx(lhe,{size:16})})]}),h.jsxs("div",{className:"flex items-center gap-[8px] px-[12px] py-[8px] rounded-[8px] border border-[#EBEBEB] bg-white text-[#7C3AED] text-[14px] font-medium hover:bg-[#E9D5FF] transition cursor-pointer",children:[h.jsx("div",{children:"Export Report"}),h.jsx("div",{className:"flex items-center",children:h.jsx(che,{size:16})})]})]})]}),h.jsx("div",{className:"mt-4 border-t border-dashed border-[#E2E8F0]"})]})}function uhe(){return h.jsxs(h.Fragment,{children:[h.jsx(xs,{text:"Smart Access",Icon:npe}),h.jsxs("div",{className:"px-[20px] grid grid-cols-1 lg:grid-cols-3 gap-[24px] mt-6 auto-rows-fr",children:[h.jsx(X4,{}),h.jsx(Z4,{})]}),h.jsx("div",{className:"mt-7 px-[20px]"})]})}Bn.register(sm,Ar,Zr);const dhe={id:"bottomGlow",afterDatasetsDraw(e,t,n){if(!n?.enabled)return;const r=e.getDatasetMeta(0);if(!r?.data?.[0])return;const{ctx:i}=e,{x:o,y:a,innerRadius:s}=r.data[0],l=Math.max(s-2,0),c=a+l*.9,u=i.createRadialGradient(o,c,0,o,c,l*1.08);u.addColorStop(0,n.color??"rgba(186, 230, 253, 0.72)"),u.addColorStop(.3,"rgba(186, 230, 253, 0.4)"),u.addColorStop(.58,"rgba(186, 230, 253, 0.16)"),u.addColorStop(1,"rgba(186, 230, 253, 0)"),i.save(),i.beginPath(),i.arc(o,a,l,0,Math.PI*2),i.clip(),i.fillStyle=u,i.beginPath(),i.ellipse(o,c,l*1.08,l*.52,0,0,Math.PI*2),i.fill(),i.restore()}},fhe={id:"centerText",afterDraw(e,t,n){const{ctx:r}=e,i=e.getDatasetMeta(0);if(!i?.data?.[0])return;const{x:o,y:a}=i.data[0],{top:s="",bottom:l="",topSize:c=24,bottomSize:u=9,topColor:d="#121212",bottomColor:f="#121212"}=n||{};r.save(),r.textAlign="center",r.textBaseline="middle",r.fillStyle=d,r.font=`600 ${c}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(s,o,a-6),r.fillStyle=f,r.font=`500 ${u}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(l,o,a+22),r.restore()}},J4=({title:e="Tickets",icon:t,firstLabel:n="First",firstValue:r=0,firstColor:i="#12B981",secondLabel:o="Second",secondValue:a=0,secondColor:s="#AB0000",growthPercentage:l="+0%",growthText:c="Compared to last month",totalLabel:u="Total",centerTopColor:d="#0F172A",centerBottomColor:f="#64748B",centerTopSize:p,centerBottomSize:m,showBottomGlow:g=!1,bottomGlowColor:v="rgba(186, 230, 253, 0.75)",widgetType:x="",resolvedWidgetType:_="",data:w})=>{const y=w?.title??e;w?.icon;const E=w?.firstLabel??n,S=Number(w?.firstValue??r??0),P=w?.firstColor??i,D=w?.secondLabel??o,T=Number(w?.secondValue??a??0),I=w?.secondColor??s,A=w?.growthPercentage??l??"+0%",C=w?.growthText??c,j=w?.totalLabel??u,N=w?.widgetType??x??_,M=w?.centerTopSize??p??(N==="commercial"?34:20),R=w?.centerBottomSize??m??(N==="commercial"?14:10),B=w?.showBottomGlow??g,V=w?.bottomGlowColor??v,z=S+T,W={labels:[E,D],datasets:[{data:[S,T],backgroundColor:[P,I],borderWidth:2,hoverOffset:4}]},Q={responsive:!0,maintainAspectRatio:!1,cutout:"68%",plugins:{legend:{display:!1},tooltip:{enabled:!1,external:ri()},centerText:{top:`${z}`,bottom:j,topSize:M,bottomSize:R,topColor:d,bottomColor:f},bottomGlow:{enabled:B,color:V}}},G=[{label:E,value:S,color:P},{label:D,value:T,color:I}],ie=A.toString().includes("+"),Z=A.toString().includes("-"),re=ie?"#1FA05B":"#AB0000";return h.jsx(kt,{title:y,className:"h-[362px] leading-[24px]",titleWeight:"semi-bold",children:h.jsxs("div",{className:"grid grid-cols-12 gap-[16px] items-center",children:[h.jsxs("div",{className:"col-span-5 space-y-[12px]",children:[G.map((oe,ce)=>h.jsxs("div",{children:[h.jsx("div",{className:"text-[12px] text-[#64748B] mb-[8px]",children:oe.label}),h.jsx("div",{className:"text-[28px] leading-[32px]",style:{color:oe.color},children:oe.value})]},ce)),h.jsxs("div",{className:`text-[12px] flex gap-[4px] ${N==="commercial"?"mt-[20px]":""} items-center`,style:{color:re},children:[ie&&h.jsx(Xo,{}),Z&&h.jsx(Go,{}),h.jsx("div",{children:A.replace("+","").replace("-","")}),h.jsx("div",{className:"text-[#64748B] text-[12px] leading-[14px] ml-[4px] whitespace-nowrap",children:C})]})]}),h.jsx("div",{className:"col-span-7",children:h.jsx("div",{className:`${N==="commercial"?"h-[260px] max-w-[263px]":"h-[158px] w-[158px]"} ml-auto mr-2`,children:h.jsx(dm,{data:W,options:Q,plugins:[dhe,fhe]})})})]})})},phe=({x:e,y:t,payload:n})=>{const r=n.value.split(" ");return h.jsx("g",{transform:`translate(${e},${t})`,children:h.jsx("text",{x:-85,y:0,textAnchor:"start",fill:"#121212",fontSize:14,children:r.map((i,o)=>h.jsx("tspan",{x:-85,dy:o===0?0:16,children:i},o))})})};function eF({data:e=[]}){const t=e&&e.length>0,n=e.map(r=>({name:r.category_name,value:r.total_complaints,color:"#08B6D4"}));return h.jsx(kt,{title:"Tickets per Category",className:"h-[362px]",titleWeight:"semi-bold",childrenClassName:"h-full mt-[24px]!",children:t?h.jsx("div",{className:"w-full h-[262px]",children:h.jsx(Ot,{width:"100%",height:"100%",children:h.jsxs(ko,{data:n,layout:"vertical",margin:{top:0,right:8,left:-20,bottom:0},children:[h.jsx(sr,{strokeDasharray:"3 3",horizontal:!1,stroke:"#E5E7EB"}),h.jsx(Gn,{type:"number",tick:{fill:"#94A3B8",fontSize:12},axisLine:!0,tickLine:!1,tickMargin:10,allowDecimals:!1}),h.jsx(Rn,{type:"category",dataKey:"name",axisLine:!1,tickLine:!1,width:132,tick:h.jsx(phe,{})}),h.jsx(St,{cursor:{fill:"transparent"},position:{x:300,y:0},allowEscapeViewBox:{x:!0,y:!0},content:r=>r.active?h.jsx(Yt,{...r,data:n,children:h.jsx(Rr,{...r})}):null}),h.jsx(qt,{dataKey:"value",barSize:36,fill:"#08B6D4"})]})})}):h.jsx(an,{title:"No Tickets Found",description:"Catch up all the data. Change the date range to see the data."})})}function B1({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 h.jsxs("div",{className:"relative bg-white !border-[0.5px] !border-[#EBEBEB] !rounded-[12px] !shadow-[0_0_12px_0_#EAF2FF] p-[16px] h-[132px]",children:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[e&&h.jsx("div",{className:"h-[20px] w-[20px]",style:{color:t,display:"flex",alignItems:"center",justifyContent:"center"},children:h.jsx(e,{className:"h-[20px] w-[20px]"})}),h.jsx("div",{className:"text-[16px] leading-[20px] tracking-[-2%] font-medium text-[#64748B]",children:n})]}),h.jsx("div",{className:"mt-[16px] text-[28px] leading-[32px] font-medium text-[#121212]",children:r}),(i||o)&&h.jsxs("div",{className:"mt-[12px] flex items-center gap-[8px]",children:[i&&h.jsxs("div",{className:"flex items-center gap-[4px] text-[12px] leading-[16px] font-medium",style:{color:l},children:[s?h.jsx(Xo,{}):h.jsx(Go,{}),Math.abs(a),"%"]}),o&&h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:o})]})]})}function hhe(){const e=[{category_name:"Plumbing",total_complaints:12},{category_name:"Electrical Issues",total_complaints:8},{category_name:"Cleaning Services",total_complaints:15}];return h.jsxs(h.Fragment,{children:[h.jsx(xs,{text:"Helpdesk",Icon:Kfe,iconColor:"#12B981"}),h.jsxs("div",{className:"flex gap-[24px] mt-[24px] px-[16px]",children:[h.jsx("div",{className:"w-[380px] h-full space-y-[16px]",children:h.jsx(J4,{title:"Tickets",icon:h.jsx(xf,{className:"h-6 w-6 text-[#EF4444]"}),firstLabel:"Resolved",firstValue:779,firstColor:"#12B981",secondLabel:"Open",secondValue:83,secondColor:"#AB0000",growthPercentage:"+9.1%",growthColor:"#1FA05B",growthText:"Compared to last month",widgetType:"commercial",totalLabel:"Total",centerTopSize:34,centerBottomSize:14,showBottomGlow:!0})}),h.jsx("div",{className:"flex-1",children:h.jsx(eF,{data:e})})]})]})}const tF=({data:e=[],onDateChange:t})=>{const[n,r]=k.useState(new Date),[i,o]=k.useState(!1),s=(v=>{const x=new Date(v);return x.setDate(x.getDate()-6),x})(n),l=v=>{try{return v.toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}catch{return""}},c=v=>{const x=new Date(v),_=new Date(x);_.setDate(_.getDate()-6),t&&t(_.toISOString(),x.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 x=v||new Date;r(x),c(x),o(!1)},m=Array.isArray(e)?e:[],g=!m.length||m.every(v=>v.no_of_visitors===0);return h.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&&h.jsx("div",{className:"anarock-datepicker absolute top-[70px] right-[24px] z-50",children:h.jsx(ZE,{selected:n,onChange:p,inline:!0,maxDate:new Date,showYearDropdown:!0,scrollableYearDropdown:!0,yearDropdownItemNumber:40})}),g?h.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:h.jsx(an,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsx("div",{className:"w-full h-[280px]",children:h.jsx(Ot,{width:"100%",height:"100%",children:h.jsxs(ZN,{data:m,margin:{top:10,right:-10,left:-10,bottom:0},children:[h.jsx("defs",{children:h.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[h.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),h.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),h.jsx(sr,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),h.jsx(Gn,{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"})}),h.jsx(Rn,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),h.jsx(St,{cursor:!1,content:v=>{const{active:x,payload:_,label:w}=v;if(!x||!_?.length)return null;const y=new Date(w).toLocaleDateString("en-GB",{day:"2-digit",month:"short"});return h.jsx(Yt,{...v,data:m,children:h.jsx(Rr,{active:x,payload:_,label:y})})}}),h.jsx(px,{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:x,cy:_,stroke:w}=v;return h.jsxs("g",{children:[h.jsx("circle",{cx:x,cy:_,r:6,fill:"#fff",stroke:"#6466F1",strokeWidth:2}),h.jsx("circle",{cx:x,cy:_,r:2.5,fill:"#6466F1"})]})}})]})})})]})},mhe=[{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}],nF=({data:e,title:t,bar:n})=>{const r=Array.isArray(e)&&e?.length===0,i=e==null?mhe:Array.isArray(e)?e:[];return h.jsx(kt,{title:t||"Organisation Wise Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",children:h.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:r?h.jsx(an,{title:t||"Organisation Wise Visitors",description:"Catch up all the data. Change the date range to see the data."}):h.jsx(Ot,{width:"100%",height:"100%",children:h.jsxs(ko,{data:i||[],margin:{top:10,right:10,left:10,bottom:-10},barCategoryGap:35,children:[h.jsx(sr,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),h.jsx(Gn,{dataKey:"building_name",tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1}),h.jsx(Rn,{width:40,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1}),h.jsx(St,{cursor:!1,content:o=>o.active?h.jsx(Yt,{...o,data:i,children:h.jsx(Rr,{...o})}):null}),h.jsx(qt,{dataKey:"no_of_visitors",name:"Visitors",maxBarSize:55,fill:n||"#3C81F6"})]})})})})};function ghe(){const e=[{day:"2026-03-05",no_of_visitors:0},{day:"2026-03-06",no_of_visitors:0},{day:"2026-03-07",no_of_visitors:0},{day:"2026-03-08",no_of_visitors:14},{day:"2026-03-09",no_of_visitors:0},{day:"2026-03-10",no_of_visitors:0},{day:"2026-03-11",no_of_visitors:0}];return h.jsxs(h.Fragment,{children:[h.jsx(xs,{text:"Visitors",Icon:Ufe,iconColor:"#884EA7"}),h.jsxs("div",{className:"grid grid-cols-2 gap-[24px] mt-[24px]",children:[h.jsx(B1,{icon:ope,iconColor:"#329DFF",title:"Visitors Expected",value:"1,247",percentage:"+11.0%",percentageText:"Compared to last month"}),h.jsx(B1,{icon:zfe,iconColor:"#1FA05B",title:"Visitors Inside",value:"800",percentageText:"Across organisations"})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-[24px] mt-[24px]",children:[h.jsx(tF,{data:e}),h.jsx(nF,{})]}),h.jsx("div",{})]})}function Ro({data:e}){return h.jsx("div",{className:"h-full",children:e.map((t,n)=>{const r=parseFloat(t.delta),i=r>=0;return h.jsx(Le,{iconClassName:"!gap-[8px]",title:h.jsx("div",{className:"text-[#64748B]",children:t.title}),icon:h.jsx(t.Icon,{className:"h-[20px] w-[20px]",style:{color:t.iconColor||"#000000"}}),className:`${t?.widget==="amenities"?"h-[139px]":"h-[124px]"}`,children:h.jsxs("div",{className:`flex flex-col gap-[8px] ${t?.widget==="amenities"?"mt-[3.5px]":"mt-0"}`,children:[h.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t.value}),h.jsxs("div",{className:`flex items-center text-[12px] leading-[16px] ${t.delta?"gap-[8px]":""}`,children:[t.delta&&h.jsxs("div",{className:`flex items-center gap-[4px] px-[6px] py-[2px] rounded-[4px] font-medium
|
|
481
481
|
${i?"text-[#1FA05B] bg-[#F7FEFA]":"text-[#E11D48] bg-[#FBF4F4]"}
|
|
482
|
-
`,children:[i?h.jsx(Xo,{}):h.jsx(Go,{}),Math.abs(r),"%"]}),h.jsx("div",{className:t.deltaColor?`text-[${t.deltaColor}] font-[600]`:"text-[#64748B]",children:t.deltaLabel})]})]})},n)})})}const vhe=[{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}],yhe=({x:e,y:t,payload:n})=>h.jsx("foreignObject",{x:(e||0)-80,y:(t||0)-18,width:80,height:40,children:h.jsx("div",{className:"text-[12px] leading-[16px] text-[#121212]",style:{width:"80px",whiteSpace:"normal",wordBreak:"break-word",textAlign:"left"},children:n?.value||""})});function rF({data:e,bar:t}){const n=Array?.isArray(e)&&e?.length===0,i=(e==null?vhe:Array?.isArray(e)?e:[]).map(o=>({...o,name:o.facility_name,color:"#8B5CF6"}));return h.jsx(Le,{title:"Bookings",icon:h.jsx(Qfe,{size:18,className:"text-[#DBB467]"}),className:"h-[288px]",children:h.jsx("div",{className:"w-full h-full flex items-center justify-center",children:n?h.jsx(an,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):h.jsx(Ot,{width:"100%",height:"100%",children:h.jsxs(ko,{data:i||[],layout:"vertical",margin:{top:0,right:10,left:-12,bottom:0},children:[h.jsx(Gn,{type:"number",allowDecimals:!1,tick:{fill:"#64748B",fontSize:12},axisLine:!0,tickLine:!1}),h.jsx(Rn,{type:"category",dataKey:"facility_name",axisLine:!1,tickLine:!1,width:100,tick:h.jsx(yhe,{})}),h.jsx(St,{cursor:{fill:"transparent"},position:{x:300,y:0},allowEscapeViewBox:{x:!0,y:!0},content:o=>o.active?h.jsx(Yt,{...o,data:i,children:h.jsx(Rr,{...o})}):null}),h.jsx(qt,{dataKey:"total_booking",barSize:40,fill:t||"#8B5CF6"})]})})})})}const bhe=[{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 iF({data:e}){const t=Array.isArray(e)&&e?.length===0,n=e==null?bhe:Array.isArray(e)?e:[];return h.jsx(kt,{title:"Booking Trend by Organisation",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full h-[265px] mt-[28px] flex items-center justify-center",children:t?h.jsx(an,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):h.jsx(Ot,{width:"100%",height:"100%",children:h.jsxs(ko,{data:n||[],margin:{top:0,right:0,left:-30,bottom:0},children:[h.jsx(sr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E5E7EB"}),h.jsx(Gn,{dataKey:"building_name",axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12}}),h.jsx(Rn,{allowDecimals:!1,axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12},tickFormatter:r=>`${r??0}`}),h.jsx(St,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:r=>r.active?h.jsx(Yt,{...r,data:n,children:h.jsx(Rr,{...r})}):null}),h.jsx(qt,{dataKey:"no_of_booking",barSize:54,fill:"#12B981"})]})})})})}const xhe=[{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"}],hm=["#3C81F6","#60A5FA","#95BFFA","#BEDAFE","#DAE6FC"];function oF({data:e,currencyType:t}){const n=Array?.isArray(e)&&e?.length===0,r=e??xhe,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 h.jsx(kt,{title:"Amenity Wise Revenue",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"grid grid-cols-12 gap-[24px] items-center h-full mt-[16px]",children:n?h.jsx("div",{className:"col-span-12 flex items-center justify-center h-[240px]",children:h.jsx(an,{title:"No Amenity Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"col-span-6 h-[240px] w-full max-w-[240px]",children:h.jsx(Ot,{width:"100%",height:"100%",children:h.jsxs($i,{children:[h.jsx(ai,{data:a||[],dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:95,stroke:"#fff",strokeWidth:1,children:a?.map?.((l,c)=>h.jsx(In,{fill:hm?.[c%hm?.length]},`cell-${c}`))}),h.jsx(St,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:l=>l.active?h.jsx(Yt,{...l,data:a,children:h.jsx(Rr,{...l,formatter:c=>s(c)})}):null})]})})}),h.jsx("div",{className:"col-span-6",children:h.jsxs("div",{className:"rounded-[12px] !overflow-hidden border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[h.jsxs("div",{className:"grid grid-cols-2 px-[12px] py-[8px] bg-[#EBEBEB] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[h.jsx("div",{children:"Amenity"}),h.jsx("div",{className:"text-right",children:"Revenue"})]}),h.jsx("div",{className:"divide-y divide-[#F1F5F9] max-h-[238px] overflow-y-auto hide-scrollbar",children:i?.map?.((l,c)=>h.jsxs("div",{className:"grid grid-cols-2 px-[16px] py-[16px] text-[14px] text-[#121212]",children:[h.jsxs("div",{className:"flex items-center gap-[12px]",children:[h.jsx("span",{className:"w-[16px] h-[7px]",style:{backgroundColor:hm?.[c%hm?.length]}}),h.jsx("span",{className:"text-[#64748B] text-[12px] leading-[16px]",children:l?.name||"Unknown"})]}),h.jsx("div",{className:"text-right text-[12px] leading-[16px] text-[#64748B]",children:s(l?.value||0)})]},l?.name||c))})]})})]})})})}function whe(){return h.jsxs(h.Fragment,{children:[h.jsx(xs,{text:"Amenities",Icon:Gfe,iconColor:"#F59D0D"}),h.jsxs("div",{className:"p-[16px] grid grid-cols-2 mt-[24px] gap-[24px]",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-[24px]",children:[h.jsx(Ro,{data:[{title:"Total Bookings",value:145,delta:"+11.0%",deltaLabel:"Compared to last month",Icon:ipe,iconColor:"#1FA05B",iconBg:"bg-emerald-50"}]}),h.jsx(Ro,{data:[{title:"Utilisation Rate",value:"73%",delta:"+11.0%",deltaLabel:"Compared to last month",Icon:epe,iconColor:"#329DFF"}]}),h.jsx(Ro,{data:[{title:"Most Popular",value:"Table Tennis",delta:"+11.0%",deltaLabel:"Compared to last month",Icon:I4,iconColor:"#FA7E28"}]}),h.jsx(Ro,{data:[{title:"Pending Approvals",value:23,delta:"-8.0%",deltaLabel:"Compared to last month",Icon:T4,iconColor:"#AB0000"}]})]}),h.jsx(rF,{})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-[24px] px-[16px]",children:[h.jsx(iF,{}),h.jsx(oF,{})]})]})}const mm=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],_he=[{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}],aF=({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:mm[o%mm.length]})):_he.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,fill:mm[o%mm.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?h.jsx(kt,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"flex items-center justify-center h-[calc(100%-50px)]",children:h.jsx(an,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(kt,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[h.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[h.jsx(Ot,{width:"100%",height:"100%",children:h.jsxs($i,{children:[h.jsx(ai,{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)=>h.jsx(In,{fill:i.fill},o))}),h.jsx(St,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?h.jsx(Yt,{...i,data:n,children:h.jsx(Rr,{...i})}):null})]})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),h.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),h.jsx("div",{className:"flex-1 max-w-[280px]",children:h.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[h.jsxs("div",{className:"flex items-center justify-between px-[16px] py-[12px] bg-[#F8FAFC]",children:[h.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),h.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Count"})]}),n.map((i,o)=>h.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:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.fill}}),h.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),h.jsx("div",{className:"text-[13px] text-[#64748B]",children:i.value})]},o))]})})]})})},sF=({data:e,title:t})=>{const[n,r]=k.useState({}),i=[{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}],o=k.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:i,[e]),a=s=>{const{dataKey:l}=s;r(c=>({...c,[l]:!c[l]}))};return Array.isArray(e)&&e.length===0?h.jsx(kt,{title:t||"Maintenance Status",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:h.jsx(an,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(kt,{title:t||"Maintenance Status",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:Array.isArray(e)&&e.length===0?h.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):h.jsx("div",{className:`relative w-full ${t?"h-[261px]":"h-[297px]"} mt-[20px]`,children:h.jsx(Ot,{width:"100%",height:"100%",children:h.jsxs(ko,{data:o,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[h.jsx(sr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),h.jsx(Gn,{dataKey:"name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),h.jsx(Rn,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),h.jsx(St,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},allowEscapeViewBox:{x:!0,y:!0},content:s=>!s.active||!s.payload||!s.payload.length?null:h.jsx(Yt,{...s,data:o,children:h.jsxs("div",{className:"bg-[#121212] rounded-[10px] px-[14px] py-[10px] text-[12px] text-white",children:[h.jsx("div",{className:"mb-[6px] font-semibold",children:s.label}),s.payload.map((l,c)=>{const u=l.color||l.fill||"#fff";return h.jsxs("div",{className:"flex items-center gap-[6px]",children:[h.jsx("span",{className:"w-2 h-2 rounded-full inline-block",style:{backgroundColor:u}}),h.jsx("span",{className:"text-[#D1D3D4]",children:l.name}),h.jsx("span",{className:"text-white font-semibold",children:l.value})]},c)})]})})}),h.jsx(nl,{verticalAlign:"bottom",align:"center",onClick:a,content:({payload:s})=>h.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:s.map((l,c)=>h.jsxs("div",{onClick:()=>a({dataKey:l.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[h.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:n[l.dataKey]?"#CBD5E1":l.color}}),h.jsx("span",{style:{fontSize:"12px",color:n[l.dataKey]?"#CBD5E1":"#64748B"},children:l.value})]},c))})}),h.jsx(qt,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:n.Open}),h.jsx(qt,{dataKey:"Closed",stackId:"a",fill:"#10B981",hide:n.Closed}),h.jsx(qt,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:n.Cancelled}),h.jsx(qt,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:n.OnHold,name:"On-Hold"}),h.jsx(qt,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:n.InProgress,name:"In Progress"})]})})})})})};function Ehe(){return h.jsxs(h.Fragment,{children:[h.jsx(xs,{text:"Asset Management",Icon:tpe,iconColor:"#A74E8A"}),h.jsxs("div",{className:"grid grid-cols-2 mt-4 gap-[24px]",children:[h.jsx(aF,{}),h.jsx(sF,{})]})]})}function lF({data:e}){const t=[{name:"Completed",value:Number(e?.completed||0),color:"#12B981"},{name:"Not - Completed",value:Number(e?.not_completed||0),color:"#F69E0A"},{name:"Missed",value:Number(e?.missed||0),color:"#EF4444"}],n=Number(e?.completed||0)+Number(e?.not_completed||0)+Number(e?.missed||0),r=Number(e?.completed||0);return h.jsx(kt,{title:"Patrol Status",className:"h-[362px]",titleWeight:"semi-bold",children:h.jsxs("div",{className:"flex flex-col items-center justify-center",children:[h.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[h.jsx(Ot,{width:"100%",height:"100%",children:h.jsxs($i,{children:[h.jsx(ai,{data:t,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:t.map((i,o)=>h.jsx(In,{fill:i.color},`cell-${o}`))}),h.jsx(St,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?h.jsx(Yt,{...i,data:t,children:h.jsx(Rr,{...i})}):null})]})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[r,"/",n]}),h.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),h.jsx("div",{className:"flex flex-col w-full text-[14px]",children:t.map((i,o)=>h.jsxs("div",{className:`flex items-center justify-between py-[10px] ${o!==t.length-1?"border-b border-[#F1F5F9]":""}`,children:[h.jsxs("div",{className:"flex items-center gap-[10px]",children:[h.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:i.color}}),h.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.name})]}),h.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.value})]},i.name))})]})})}function cF({incidentReports:e,incidentReportsDetails:t}){const n=Number(e?.open||0),r=Number(e?.in_progress||0),i=Number(e?.closed||0);return h.jsx(kt,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:h.jsxs("div",{children:[h.jsxs("div",{className:"flex w-full text-center gap-[16px] mt-[24px]",children:[h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FBF4F4] h-[76px] rounded",children:[h.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#AB0000]",children:n}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FFFBF2] h-[76px] rounded",children:[h.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#F2A815]",children:r}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#F2A815]",children:"In-progress"})]}),h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#F7FEFA] h-[76px] rounded",children:[h.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:i}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),h.jsx("div",{className:"mt-4 space-y-2",children:t?.length>0?t.map((o,a)=>{const s=o?.escalation_level==="Danger"?"text-[#AB0000]":o?.escalation_level==="High"?"text-[#E7A015]":"text-[#1FA05B]";return h.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#FAFBFD] rounded-md",children:[h.jsx("div",{className:"flex items-center gap-[8px]",children:h.jsx("div",{className:"text-gray-700 font-medium",children:o?.incident_reporting_id})}),h.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${s}`,children:h.jsxs("div",{children:[o?.escalation_value," - ",o?.escalation_level]})})]},a)}):h.jsx(h.Fragment,{})})]})})}function She(){return h.jsxs(h.Fragment,{children:[h.jsx(xs,{text:"Guard Petrol",Icon:rpe,iconColor:"#AB0000"}),h.jsxs("div",{className:"px-[16px] grid grid-cols-3 gap-[24px] mt-4",children:[h.jsx(lF,{}),h.jsx(cF,{}),h.jsx(F4,{})]})]})}function Ohe(){return h.jsxs(h.Fragment,{children:[h.jsx(xs,{text:"Engagement",Icon:Zfe,iconColor:"#3C81F6"}),h.jsxs("div",{className:"grid grid-cols-4 gap-[24px] mt-4",children:[h.jsx(Ro,{data:[{title:"Notice",value:20,deltaLabel:"Currently active",Icon:Yfe,iconColor:"#1FA05B"}]}),h.jsx(Ro,{data:[{title:"Discussion Forum",value:9,deltaLabel:"Active threads",Icon:qfe,iconColor:"#329DFF"}]}),h.jsx(Ro,{data:[{title:"Polls",value:3,deltaLabel:"Currently active",Icon:Xfe,iconColor:"#FA7E28"}]}),h.jsx(Ro,{data:[{title:"Surveys",value:8,deltaLabel:"Currently active",Icon:Jfe,iconColor:"#DBB467"}]})]})]})}function uF({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%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"},{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,m=a===0&&c.length===0,g=`repeat(${u.length}, 1fr)`;return h.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:[h.jsx("div",{className:"flex-1 overflow-auto hide-scrollbar",children:h.jsxs("div",{className:"h-full min-w-max",children:[h.jsx("div",{className:"grid bg-[#354A5E] text-white text-[16px] leading-[20px] font-medium sticky top-0 z-30",style:{gridTemplateColumns:g},children:u.map((v,x)=>h.jsx("div",{className:`px-[24px] py-[16px] whitespace-nowrap text-left ${x===0?"sticky left-0 z-40 bg-[#354A5E] text-[16px] leading-[20px] shadow-[2px_0_5px_rgba(0,0,0,0.1)] border-r border-[#2C3E50]":""}`,children:v.label},x))}),m?h.jsx("div",{className:"h-[calc(100%-50px)] flex items-center justify-center",children:h.jsx(an,{title:"No Data Found",description:"Catch up all the data. Change the date range to see the data."})}):p.map((v,x)=>h.jsx("div",{className:"grid",style:{gridTemplateColumns:g},children:u.map((_,w)=>{const y=v[_.key],E=_.label==="Closed",S=_.label==="Open",P=typeof y=="string"&&y.includes("%"),D=y==="100%"?"bg-[#F0FEF2] text-[#36AB6C]":"bg-[#FFF0F0] text-[#AB0000]";return h.jsx("div",{className:`px-[24px] py-[16px] flex items-center ${w===0?"bg-white sticky left-0 z-20 shadow-[2px_0_5px_rgba(0,0,0,0.05)] border-r border-gray-200":"bg-gray-50"} text-[#121212]`,children:E?h.jsx("div",{className:"text-[14px] font-medium",style:{color:"#36AB6C"},children:y??"-"}):S?h.jsx("div",{className:"text-[14px] font-medium",style:{color:"#AB0000"},children:y??"-"}):P?h.jsx("div",{className:`inline-block px-[12px] py-[4px] rounded-full text-[14px] font-medium ${D}`,children:y}):h.jsx("div",{children:y??"-"})},w)})},x))]})}),h.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:[h.jsxs("div",{className:"flex items-center gap-[8px] text-gray-600 text-[14px]",children:[h.jsx("div",{children:"Rows per page:"}),h.jsx("select",{value:n,onChange:v=>{r(Number(v.target.value)),o(1)},className:"border rounded px-[8px] py-[4px]",children:l.map((v,x)=>h.jsx("option",{value:v,children:v},x))}),h.jsxs("div",{className:"ml-4 text-[14px]",children:[c?.length===0?"0–0":`1–${c?.length}`," of"," ",a||c?.length]})]}),h.jsxs("div",{className:"flex items-center space-x-2 text-gray-600 text-[14px]",children:[h.jsx("button",{onClick:()=>o(1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(j4,{size:18})}),h.jsx("button",{onClick:()=>o(v=>v-1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(R1,{size:18})}),h.jsx("button",{onClick:()=>o(v=>v+1),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx($1,{size:18})}),h.jsx("button",{onClick:()=>o(f),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(M4,{size:18})})]})]})]})}const dF=({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)}},[]),h.jsxs("div",{ref:o,className:"relative h-[32px]",children:[h.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:[h.jsx("div",{className:"text-[12px] leading-[16px] min-w-[109px] text-[#64748B]",children:t}),h.jsx(Hfe,{size:16,className:"text-[#64748B]"})]}),r&&h.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)=>h.jsx("div",{className:"px-[12px] py-[8px] text-[14px] text-[#334155] hover:bg-[#F1F5F9] cursor-pointer",onClick:()=>{n(a),i(!1)},children:a},s))})]})},Che=({data:e,communities:t,title:n})=>{const[r,i]=k.useState({}),[o,a]=k.useState(""),s=t?.map(d=>d?.community_name)||[];k.useEffect(()=>{s?.length>0&&!o&&a(s[0])},[s,o]);const l=[{community_name:"L1",Cancelled:55,Open:50,OnHold:20,InProgress:10},{community_name:"L2",Cancelled:15,Open:15,OnHold:8,InProgress:5},{community_name:"L3",Cancelled:12,Open:75,OnHold:18,InProgress:7}],c=k.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:l,[e]),u=d=>{const{dataKey:f}=d||{};i(p=>({...p,[f]:!p?.[f]}))};return Array.isArray(e)&&e.length===0?h.jsx(kt,{title:n||"Escalation Level By Building",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full flex items-center justify-center",children:h.jsx(an,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(kt,{title:n||"Escalation Level By Building",titleWeight:"semi-bold",className:"h-[362px]",childrenClassName:"mt-[21px]",rightContent:h.jsx(dF,{options:s,value:o,onChange:d=>a(d)}),children:h.jsx("div",{className:"w-full flex items-center justify-center",children:Array.isArray(e)&&e.length===0?h.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):h.jsx("div",{className:"relative w-full h-[261px]",children:h.jsx(Ot,{width:"100%",height:"100%",children:h.jsxs(ko,{data:c,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[h.jsx(sr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),h.jsx(Gn,{dataKey:"community_name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),h.jsx(Rn,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),h.jsx(St,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},allowEscapeViewBox:{x:!0,y:!0},content:d=>!d?.active||!d?.payload?.length?null:h.jsx(Yt,{...d,data:c,children:h.jsxs("div",{className:"bg-black rounded-[10px] px-[14px] py-[10px] text-[12px] text-white",children:[h.jsx("div",{className:"mb-[6px] font-semibold",children:d?.label}),d?.payload?.map((f,p)=>{const m=f?.color||f?.fill||"#fff";return h.jsxs("div",{className:"flex items-center gap-[6px]",children:[h.jsx("span",{className:"w-[8px] h-[8px] rounded-full inline-block",style:{backgroundColor:m}}),h.jsx("span",{className:"text-[#D1D3D4]",children:f?.name}),h.jsx("span",{className:"text-white font-semibold",children:f?.value})]},p)})]})})}),h.jsx(nl,{verticalAlign:"bottom",align:"center",onClick:u,content:({payload:d})=>h.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:d?.map((f,p)=>h.jsxs("div",{onClick:()=>u({dataKey:f?.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[h.jsx("div",{className:`w-[16px] h-[8px] ${r?.[f?.dataKey]?"bg-slate-300":""}`,style:{backgroundColor:r?.[f?.dataKey]?"#CBD5E1":f?.color}}),h.jsx("span",{className:`text-[12px] ${r?.[f?.dataKey]?"text-[#CBD5E1]":"text-[#64748B]"}`,children:f?.value})]},p))})}),h.jsx(qt,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:r?.Open}),h.jsx(qt,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:r?.Cancelled}),h.jsx(qt,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:r?.OnHold,name:"On-Hold"}),h.jsx(qt,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:r?.InProgress,name:"In Progress"})]})})})})})},khe=({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 h.jsx(kt,{title:"Top 5 Tenants by Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-[20px]",rightContent:h.jsx(dF,{options:r,value:t,onChange:a=>n(a)}),children:o?h.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:h.jsx(an,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsx("div",{className:"w-full h-[280px]",children:h.jsx(Ot,{width:"100%",height:"100%",children:h.jsxs(ZN,{data:i,margin:{top:10,right:-10,left:-10,bottom:0},children:[h.jsx("defs",{children:h.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[h.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),h.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),h.jsx(sr,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),h.jsx(Gn,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:a=>a}),h.jsx(Rn,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),h.jsx(St,{cursor:!1,content:a=>h.jsx(Yt,{...a,data:i,children:(()=>{if(!a.active||!a.label)return null;const s=i.find(l=>l.day===a.label);return h.jsxs("div",{className:"bg-[#111] text-white px-[14px] py-[8px] rounded-[6px] flex flex-col gap-[6px] text-[13px]",children:[h.jsx("div",{className:"font-semibold",children:a.label}),h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-2 h-2 rounded-full bg-[#6366F1]"}),h.jsx("div",{className:"text-[#aaa]",children:"Visitors"}),h.jsx("div",{className:"font-bold",children:s?.no_of_visitors??0})]})]})})()})}),h.jsx(px,{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}=a;return h.jsxs("g",{children:[h.jsx("circle",{cx:s,cy:l,r:6,fill:"#fff",stroke:"#6466F1",strokeWidth:2}),h.jsx("circle",{cx:s,cy:l,r:2.5,fill:"#6466F1"})]})}})]})})})})},Phe=({data:e})=>{const t=[{name:"Kosmo One",total:29,pending_approval:1,cancelled:2},{name:"OWC",total:23,pending_approval:9,cancelled:3},{name:"Exora",total:40,pending_approval:12,cancelled:1},{name:"OIC - T3",total:27,pending_approval:19,cancelled:8}],n=e==null?t:Array.isArray(e)?e:[],r=Array.isArray(n)&&n.length===0;return h.jsx(kt,{title:"Building Wise Approvals",titleWeight:"semi-bold",className:"h-[362px]",childrenClassName:"mt-[34px]",children:r?h.jsx("div",{className:"h-[250px] flex items-center justify-center",children:h.jsx(an,{title:"No Data Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsxs("div",{className:"w-full border border-[#EBEBEB] rounded-[10px] overflow-hidden",children:[h.jsxs("div",{className:"grid grid-cols-4 bg-[#FAFAFA] px-[12px] py-[8px] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[h.jsx("div",{children:"Tenant"}),h.jsx("div",{className:"flex justify-end",children:"Total"}),h.jsx("div",{className:"flex justify-end",children:"Pending"}),h.jsx("div",{className:"flex justify-end",children:"Cancelled"})]}),h.jsx("div",{className:"max-h-[280px] overflow-y-auto hide-scrollbar",children:n.map((i,o)=>h.jsxs("div",{className:"grid grid-cols-4 p-[12px] text-[12px] leading-[16px] border-t border-[#EBEBEB]",children:[h.jsx("div",{className:"text-[#475569]",children:i.name}),h.jsx("div",{className:"flex justify-end text-[#36AB6C]",children:i.total}),h.jsx("div",{className:"flex justify-end text-[#F2A815]",children:i.pending_approval}),h.jsx("div",{className:"flex justify-end text-[#AB0000]",children:i.cancelled})]},o))})]})})},gm=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],Dhe=[{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"}],Ahe=({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,investment:i.investment||"-",fill:gm[o%gm.length]})):Dhe.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",fill:gm[o%gm.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?h.jsx(kt,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx(an,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(kt,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[h.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[h.jsx(Ot,{width:"100%",height:"100%",children:h.jsxs($i,{children:[h.jsx(ai,{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)=>h.jsx(In,{fill:i.fill},o))}),h.jsx(St,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?h.jsx(Yt,{...i,data:n,children:h.jsx(Rr,{...i})}):null})]})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),h.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),h.jsx("div",{className:"flex-1 max-w-[280px]",children:h.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0]",children:[h.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] bg-[#F8FAFC]",children:[h.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),h.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-center",children:"Count"}),h.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-right",children:"Investment"})]}),h.jsx("div",{className:"max-h-[205px] overflow-y-auto hide-scrollbar",children:n.map((i,o)=>h.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] border-t border-[#F1F5F9]",children:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.fill}}),h.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),h.jsx("div",{className:"text-[13px] text-[#64748B] text-center",children:i.value}),h.jsx("div",{className:"text-[13px] text-[#64748B] text-right",children:i.investment})]},o))})]})})]})})};function The({columns:e=[],data:t=[],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=`200px repeat(${u.length-1}, 150px)`,f={};return u.forEach(p=>{if(p.key!=="name"){let m=0;for(let g=0;g<c.length;g++){const v=c[g][p.key];typeof v=="number"&&(m+=v)}f[p.key]=m}}),h.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:[h.jsx("div",{className:"flex-1 overflow-auto hide-scrollbar",children:c.length===0?h.jsx("div",{className:"h-full flex items-center justify-center",children:h.jsx(an,{title:"No Data Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsxs("div",{className:"min-w-max",children:[h.jsx("div",{className:"grid bg-[#354A5E] text-white text-[14px] font-medium sticky top-0 z-30",style:{gridTemplateColumns:d},children:u.map((p,m)=>h.jsx("div",{title:p.label,className:`px-[24px] py-[16px] whitespace-nowrap overflow-hidden text-ellipsis ${m===0?"sticky left-0 z-40 bg-[#354A5E] shadow-[2px_0_5px_rgba(0,0,0,0.1)] border-r border-[#2C3E50]":""}`,children:p.label},m))}),c.map((p,m)=>h.jsx("div",{className:"grid",style:{gridTemplateColumns:d},children:u.map((g,v)=>h.jsx("div",{className:`px-[24px] py-[14px] text-[14px] flex items-center ${v===0?"bg-white sticky left-0 z-20 font-medium shadow-[2px_0_5px_rgba(0,0,0,0.05)] border-r border-gray-200":"bg-gray-50"}`,children:p[g.key]??"-"},v))},m)),h.jsx("div",{className:"grid bg-[#F8FAFC] border-t border-[#F0F0F0] sticky bottom-0 z-30",style:{gridTemplateColumns:d},children:u.map((p,m)=>h.jsx("div",{className:`px-[24px] py-[16px] ${m===0?"sticky left-0 z-40 bg-[#F8FAFC] text-[#64748B] font-medium shadow-[2px_0_5px_rgba(0,0,0,0.05)] border-r border-gray-200":"text-[#64748B] font-medium"}`,children:p.key==="name"?"Grand Total":f[p.key]||0},m))})]})}),h.jsxs("div",{className:"flex justify-end items-center px-[24px] py-[16px] text-sm bg-white border-t border-[#F0F0F0] gap-[32px]",children:[h.jsxs("div",{className:"flex items-center gap-[8px] text-gray-600 text-[14px]",children:[h.jsx("div",{children:"Rows per page:"}),h.jsx("select",{value:n,onChange:p=>{r(Number(p.target.value)),o(1)},className:"border rounded px-[8px] py-[4px]",children:l.map((p,m)=>h.jsx("option",{value:p,children:p},m))}),h.jsxs("div",{className:"ml-4 text-[14px]",children:[c.length===0?"0–0":`1–${c.length}`," of"," ",a||c.length]})]}),h.jsxs("div",{className:"flex items-center space-x-2 text-gray-600 text-[14px]",children:[h.jsx("button",{onClick:()=>o(1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(j4,{size:18})}),h.jsx("button",{onClick:()=>o(p=>p-1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(R1,{size:18})}),h.jsx("button",{onClick:()=>o(p=>p+1),disabled:i===s,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx($1,{size:18})}),h.jsx("button",{onClick:()=>o(s),disabled:i===s,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(M4,{size:18})})]})]})]})}se.AccessPointsUsage=Z4,se.Accounting=xfe,se.Amenities=H4,se.AmenitiesStatsCard=Ro,se.AmenityWiseRevenue=oF,se.AssetValueBreakdown=jfe,se.AssetsByType=aF,se.BlockWiseOccupancy=dfe,se.BookingTrendChart=iF,se.Bookings=rF,se.Budgets=Ofe,se.BuildingWiseApprovals=Phe,se.Card=Le,se.CardAccess=Q4,se.CashBankBalance=kfe,se.CommercialAccessOverview=X4,se.CommercialAmenitiesDashboard=whe,se.CommercialAssetManagementDashboard=Ehe,se.CommercialDashboard=ahe,se.CommercialEngagementDashboard=Ohe,se.CommercialGuardPatrols=lF,se.CommercialGuardPetrolDashboard=She,se.CommercialHelpdeskDashboard=hhe,se.CommercialIncidentReports=cF,se.CommercialOccupancy=$4,se.CommercialReportTable=uF,se.CommercialSmartAccessDashboard=uhe,se.CommercialTableDashboard=uF,se.CommercialVisitorsDashboard=ghe,se.Community=qae,se.Complaints=Dpe,se.ComplaintsByLevel=Npe,se.DuesAgeing=Dfe,se.EmployeeFootfall=B4,se.Engagement=Zj,se.EngagementStatsGrid=Zpe,se.EscalationLevel=Che,se.EventsUtilisation=Hpe,se.ExpenseCategories=Tfe,se.Facilities=Gae,se.FinanceSummary=Xae,se.FoodBeverages=V4,se.GateAndSecurityStatsGrid=Cpe,se.GateUpdates=Lse,se.GuardPatrols=fpe,se.Header=_8,se.Helpdesk=Rse,se.HelpdeskStatsGrid=Wpe,se.HourlyTrafficFlow=vpe,se.IncidentReports=xpe,se.IncomeExpenditure=k4,se.MainHeader=I8,se.MaintenanceStatus=sF,se.MetricCard=B1,se.MobileAccess=Q4,se.MoveInOutTrends=hfe,se.NoticeBoardStatus=Kpe,se.OccupancyOverview=lfe,se.OrganisationWiseVisitors=nF,se.PortfolioAssetsByType=Ahe,se.RequestBox=Mpe,se.ResidentOverview=cfe,se.RevenuebyCategory=Ife,se.SingleStats=Gpe,se.StaffAttendance=F4,se.StatsGrid=upe,se.TenantsByVisitors=khe,se.TicketEscalation=Y4,se.TicketStatus=U4,se.Tickets=J4,se.TicketsperCategory=eF,se.TotalCommercialTable=The,se.UnitStatus=sfe,se.VisitorUpdates=G4,se.WeeklyVisitorPattern=tF,Object.defineProperty(se,Symbol.toStringTag,{value:"Module"})}));
|
|
482
|
+
`,children:[i?h.jsx(Xo,{}):h.jsx(Go,{}),Math.abs(r),"%"]}),h.jsx("div",{className:t.deltaColor?`text-[${t.deltaColor}] font-[600]`:"text-[#64748B]",children:t.deltaLabel})]})]})},n)})})}const vhe=[{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}],yhe=({x:e,y:t,payload:n})=>h.jsx("foreignObject",{x:(e||0)-80,y:(t||0)-18,width:80,height:40,children:h.jsx("div",{className:"text-[12px] leading-[16px] text-[#121212]",style:{width:"80px",whiteSpace:"normal",wordBreak:"break-word",textAlign:"left"},children:n?.value||""})});function rF({data:e,bar:t}){const n=Array?.isArray(e)&&e?.length===0,i=(e==null?vhe:Array?.isArray(e)?e:[]).map(o=>({...o,name:o.facility_name,color:"#8B5CF6"}));return h.jsx(Le,{title:"Bookings",icon:h.jsx(Qfe,{size:18,className:"text-[#DBB467]"}),className:"h-[288px]",children:h.jsx("div",{className:"w-full h-full flex items-center justify-center",children:n?h.jsx(an,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):h.jsx(Ot,{width:"100%",height:"100%",children:h.jsxs(ko,{data:i||[],layout:"vertical",margin:{top:0,right:10,left:-12,bottom:0},children:[h.jsx(Gn,{type:"number",allowDecimals:!1,tick:{fill:"#64748B",fontSize:12},axisLine:!0,tickLine:!1}),h.jsx(Rn,{type:"category",dataKey:"facility_name",axisLine:!1,tickLine:!1,width:100,tick:h.jsx(yhe,{})}),h.jsx(St,{cursor:{fill:"transparent"},position:{x:300,y:0},allowEscapeViewBox:{x:!0,y:!0},content:o=>o.active?h.jsx(Yt,{...o,data:i,children:h.jsx(Rr,{...o})}):null}),h.jsx(qt,{dataKey:"total_booking",barSize:40,fill:t||"#8B5CF6"})]})})})})}const bhe=[{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 iF({data:e}){const t=Array.isArray(e)&&e?.length===0,n=e==null?bhe:Array.isArray(e)?e:[];return h.jsx(kt,{title:"Booking Trend by Organisation",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full h-[265px] mt-[28px] flex items-center justify-center",children:t?h.jsx(an,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):h.jsx(Ot,{width:"100%",height:"100%",children:h.jsxs(ko,{data:n||[],margin:{top:0,right:0,left:-30,bottom:0},children:[h.jsx(sr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E5E7EB"}),h.jsx(Gn,{dataKey:"building_name",axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12}}),h.jsx(Rn,{allowDecimals:!1,axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12},tickFormatter:r=>`${r??0}`}),h.jsx(St,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:r=>r.active?h.jsx(Yt,{...r,data:n,children:h.jsx(Rr,{...r})}):null}),h.jsx(qt,{dataKey:"no_of_booking",barSize:54,fill:"#12B981"})]})})})})}const xhe=[{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"}],hm=["#3C81F6","#60A5FA","#95BFFA","#BEDAFE","#DAE6FC"];function oF({data:e,currencyType:t}){const n=Array?.isArray(e)&&e?.length===0,r=e??xhe,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 h.jsx(kt,{title:"Amenity Wise Revenue",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"grid grid-cols-12 gap-[24px] items-center h-full mt-[16px]",children:n?h.jsx("div",{className:"col-span-12 flex items-center justify-center h-[240px]",children:h.jsx(an,{title:"No Amenity Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"col-span-6 h-[240px] w-full max-w-[240px]",children:h.jsx(Ot,{width:"100%",height:"100%",children:h.jsxs($i,{children:[h.jsx(ai,{data:a||[],dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:95,stroke:"#fff",strokeWidth:1,children:a?.map?.((l,c)=>h.jsx(In,{fill:hm?.[c%hm?.length]},`cell-${c}`))}),h.jsx(St,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:l=>l.active?h.jsx(Yt,{...l,data:a,children:h.jsx(Rr,{...l,formatter:c=>s(c)})}):null})]})})}),h.jsx("div",{className:"col-span-6",children:h.jsxs("div",{className:"rounded-[12px] !overflow-hidden border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[h.jsxs("div",{className:"grid grid-cols-2 px-[12px] py-[8px] bg-[#EBEBEB] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[h.jsx("div",{children:"Amenity"}),h.jsx("div",{className:"text-right",children:"Revenue"})]}),h.jsx("div",{className:"divide-y divide-[#F1F5F9] max-h-[238px] overflow-y-auto hide-scrollbar",children:i?.map?.((l,c)=>h.jsxs("div",{className:"grid grid-cols-2 px-[16px] py-[16px] text-[14px] text-[#121212]",children:[h.jsxs("div",{className:"flex items-center gap-[12px]",children:[h.jsx("span",{className:"w-[16px] h-[7px]",style:{backgroundColor:hm?.[c%hm?.length]}}),h.jsx("span",{className:"text-[#64748B] text-[12px] leading-[16px]",children:l?.name||"Unknown"})]}),h.jsx("div",{className:"text-right text-[12px] leading-[16px] text-[#64748B]",children:s(l?.value||0)})]},l?.name||c))})]})})]})})})}function whe(){return h.jsxs(h.Fragment,{children:[h.jsx(xs,{text:"Amenities",Icon:Gfe,iconColor:"#F59D0D"}),h.jsxs("div",{className:"p-[16px] grid grid-cols-2 mt-[24px] gap-[24px]",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-[24px]",children:[h.jsx(Ro,{data:[{title:"Total Bookings",value:145,delta:"+11.0%",deltaLabel:"Compared to last month",Icon:ipe,iconColor:"#1FA05B",iconBg:"bg-emerald-50"}]}),h.jsx(Ro,{data:[{title:"Utilisation Rate",value:"73%",delta:"+11.0%",deltaLabel:"Compared to last month",Icon:epe,iconColor:"#329DFF"}]}),h.jsx(Ro,{data:[{title:"Most Popular",value:"Table Tennis",delta:"+11.0%",deltaLabel:"Compared to last month",Icon:I4,iconColor:"#FA7E28"}]}),h.jsx(Ro,{data:[{title:"Pending Approvals",value:23,delta:"-8.0%",deltaLabel:"Compared to last month",Icon:T4,iconColor:"#AB0000"}]})]}),h.jsx(rF,{})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-[24px] px-[16px]",children:[h.jsx(iF,{}),h.jsx(oF,{})]})]})}const mm=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],_he=[{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}],aF=({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:mm[o%mm.length]})):_he.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,fill:mm[o%mm.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?h.jsx(kt,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"flex items-center justify-center h-[260px]",children:h.jsx(an,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(kt,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[h.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[h.jsx(Ot,{width:"100%",height:"100%",children:h.jsxs($i,{children:[h.jsx(ai,{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)=>h.jsx(In,{fill:i.fill},o))}),h.jsx(St,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?h.jsx(Yt,{...i,data:n,children:h.jsx(Rr,{...i})}):null})]})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),h.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),h.jsx("div",{className:"flex-1 max-w-[280px]",children:h.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[h.jsxs("div",{className:"flex items-center justify-between px-[16px] py-[12px] bg-[#F8FAFC]",children:[h.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),h.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Count"})]}),n.map((i,o)=>h.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:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.fill}}),h.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),h.jsx("div",{className:"text-[13px] text-[#64748B]",children:i.value})]},o))]})})]})})},sF=({data:e,title:t})=>{const[n,r]=k.useState({}),i=[{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}],o=k.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:i,[e]),a=s=>{const{dataKey:l}=s;r(c=>({...c,[l]:!c[l]}))};return Array.isArray(e)&&e.length===0?h.jsx(kt,{title:t||"Maintenance Status",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:h.jsx(an,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(kt,{title:t||"Maintenance Status",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:Array.isArray(e)&&e.length===0?h.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):h.jsx("div",{className:`relative w-full ${t?"h-[261px]":"h-[297px]"} mt-[20px]`,children:h.jsx(Ot,{width:"100%",height:"100%",children:h.jsxs(ko,{data:o,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[h.jsx(sr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),h.jsx(Gn,{dataKey:"name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),h.jsx(Rn,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),h.jsx(St,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},allowEscapeViewBox:{x:!0,y:!0},content:s=>!s.active||!s.payload||!s.payload.length?null:h.jsx(Yt,{...s,data:o,children:h.jsxs("div",{className:"bg-[#121212] rounded-[10px] px-[14px] py-[10px] text-[12px] text-white",children:[h.jsx("div",{className:"mb-[6px] font-semibold",children:s.label}),s.payload.map((l,c)=>{const u=l.color||l.fill||"#fff";return h.jsxs("div",{className:"flex items-center gap-[6px]",children:[h.jsx("span",{className:"w-2 h-2 rounded-full inline-block",style:{backgroundColor:u}}),h.jsx("span",{className:"text-[#D1D3D4]",children:l.name}),h.jsx("span",{className:"text-white font-semibold",children:l.value})]},c)})]})})}),h.jsx(nl,{verticalAlign:"bottom",align:"center",onClick:a,content:({payload:s})=>h.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:s.map((l,c)=>h.jsxs("div",{onClick:()=>a({dataKey:l.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[h.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:n[l.dataKey]?"#CBD5E1":l.color}}),h.jsx("span",{style:{fontSize:"12px",color:n[l.dataKey]?"#CBD5E1":"#64748B"},children:l.value})]},c))})}),h.jsx(qt,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:n.Open}),h.jsx(qt,{dataKey:"Closed",stackId:"a",fill:"#10B981",hide:n.Closed}),h.jsx(qt,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:n.Cancelled}),h.jsx(qt,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:n.OnHold,name:"On-Hold"}),h.jsx(qt,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:n.InProgress,name:"In Progress"})]})})})})})};function Ehe(){return h.jsxs(h.Fragment,{children:[h.jsx(xs,{text:"Asset Management",Icon:tpe,iconColor:"#A74E8A"}),h.jsxs("div",{className:"grid grid-cols-2 mt-4 gap-[24px]",children:[h.jsx(aF,{}),h.jsx(sF,{})]})]})}function lF({data:e}){const t=[{name:"Completed",value:Number(e?.completed||0),color:"#12B981"},{name:"Not - Completed",value:Number(e?.not_completed||0),color:"#F69E0A"},{name:"Missed",value:Number(e?.missed||0),color:"#EF4444"}],n=Number(e?.completed||0)+Number(e?.not_completed||0)+Number(e?.missed||0),r=Number(e?.completed||0);return h.jsx(kt,{title:"Patrol Status",className:"h-[362px]",titleWeight:"semi-bold",children:h.jsxs("div",{className:"flex flex-col items-center justify-center",children:[h.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[h.jsx(Ot,{width:"100%",height:"100%",children:h.jsxs($i,{children:[h.jsx(ai,{data:t,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:t.map((i,o)=>h.jsx(In,{fill:i.color},`cell-${o}`))}),h.jsx(St,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?h.jsx(Yt,{...i,data:t,children:h.jsx(Rr,{...i})}):null})]})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[r,"/",n]}),h.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),h.jsx("div",{className:"flex flex-col w-full text-[14px]",children:t.map((i,o)=>h.jsxs("div",{className:`flex items-center justify-between py-[10px] ${o!==t.length-1?"border-b border-[#F1F5F9]":""}`,children:[h.jsxs("div",{className:"flex items-center gap-[10px]",children:[h.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:i.color}}),h.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.name})]}),h.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.value})]},i.name))})]})})}function cF({incidentReports:e,incidentReportsDetails:t}){const n=Number(e?.open||0),r=Number(e?.in_progress||0),i=Number(e?.closed||0);return h.jsx(kt,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:h.jsxs("div",{children:[h.jsxs("div",{className:"flex w-full text-center gap-[16px] mt-[24px]",children:[h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FBF4F4] h-[76px] rounded",children:[h.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#AB0000]",children:n}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FFFBF2] h-[76px] rounded",children:[h.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#F2A815]",children:r}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#F2A815]",children:"In-progress"})]}),h.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#F7FEFA] h-[76px] rounded",children:[h.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:i}),h.jsx("div",{className:"text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),h.jsx("div",{className:"mt-4 space-y-2",children:t?.length>0?t.map((o,a)=>{const s=o?.escalation_level==="Danger"?"text-[#AB0000]":o?.escalation_level==="High"?"text-[#E7A015]":"text-[#1FA05B]";return h.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#FAFBFD] rounded-md",children:[h.jsx("div",{className:"flex items-center gap-[8px]",children:h.jsx("div",{className:"text-gray-700 font-medium",children:o?.incident_reporting_id})}),h.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${s}`,children:h.jsxs("div",{children:[o?.escalation_value," - ",o?.escalation_level]})})]},a)}):h.jsx(h.Fragment,{})})]})})}function She(){return h.jsxs(h.Fragment,{children:[h.jsx(xs,{text:"Guard Petrol",Icon:rpe,iconColor:"#AB0000"}),h.jsxs("div",{className:"px-[16px] grid grid-cols-3 gap-[24px] mt-4",children:[h.jsx(lF,{}),h.jsx(cF,{}),h.jsx(F4,{})]})]})}function Ohe(){return h.jsxs(h.Fragment,{children:[h.jsx(xs,{text:"Engagement",Icon:Zfe,iconColor:"#3C81F6"}),h.jsxs("div",{className:"grid grid-cols-4 gap-[24px] mt-4",children:[h.jsx(Ro,{data:[{title:"Notice",value:20,deltaLabel:"Currently active",Icon:Yfe,iconColor:"#1FA05B"}]}),h.jsx(Ro,{data:[{title:"Discussion Forum",value:9,deltaLabel:"Active threads",Icon:qfe,iconColor:"#329DFF"}]}),h.jsx(Ro,{data:[{title:"Polls",value:3,deltaLabel:"Currently active",Icon:Xfe,iconColor:"#FA7E28"}]}),h.jsx(Ro,{data:[{title:"Surveys",value:8,deltaLabel:"Currently active",Icon:Jfe,iconColor:"#DBB467"}]})]})]})}function uF({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%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"},{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,m=a===0&&c.length===0,g=`repeat(${u.length}, 1fr)`;return h.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:[h.jsx("div",{className:"flex-1 overflow-auto hide-scrollbar",children:h.jsxs("div",{className:"h-full min-w-max",children:[h.jsx("div",{className:"grid bg-[#354A5E] text-white text-[16px] leading-[20px] font-medium sticky top-0 z-30",style:{gridTemplateColumns:g},children:u.map((v,x)=>h.jsx("div",{className:`px-[24px] py-[16px] whitespace-nowrap text-left ${x===0?"sticky left-0 z-40 bg-[#354A5E] text-[16px] leading-[20px] shadow-[2px_0_5px_rgba(0,0,0,0.1)] border-r border-[#2C3E50]":""}`,children:v.label},x))}),m?h.jsx("div",{className:"h-[calc(100%-50px)] flex items-center justify-center",children:h.jsx(an,{title:"No Data Found",description:"Catch up all the data. Change the date range to see the data."})}):p.map((v,x)=>h.jsx("div",{className:"grid",style:{gridTemplateColumns:g},children:u.map((_,w)=>{const y=v[_.key],E=_.label==="Closed",S=_.label==="Open",P=typeof y=="string"&&y.includes("%"),D=y==="100%"?"bg-[#F0FEF2] text-[#36AB6C]":"bg-[#FFF0F0] text-[#AB0000]";return h.jsx("div",{className:`px-[24px] py-[16px] flex items-center ${w===0?"bg-white sticky left-0 z-20 shadow-[2px_0_5px_rgba(0,0,0,0.05)] border-r border-gray-200":"bg-gray-50"} text-[#121212]`,children:E?h.jsx("div",{className:"text-[14px] font-medium",style:{color:"#36AB6C"},children:y??"-"}):S?h.jsx("div",{className:"text-[14px] font-medium",style:{color:"#AB0000"},children:y??"-"}):P?h.jsx("div",{className:`inline-block px-[12px] py-[4px] rounded-full text-[14px] font-medium ${D}`,children:y}):h.jsx("div",{children:y??"-"})},w)})},x))]})}),h.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:[h.jsxs("div",{className:"flex items-center gap-[8px] text-gray-600 text-[14px]",children:[h.jsx("div",{children:"Rows per page:"}),h.jsx("select",{value:n,onChange:v=>{r(Number(v.target.value)),o(1)},className:"border rounded px-[8px] py-[4px]",children:l.map((v,x)=>h.jsx("option",{value:v,children:v},x))}),h.jsxs("div",{className:"ml-4 text-[14px]",children:[c?.length===0?"0–0":`1–${c?.length}`," of"," ",a||c?.length]})]}),h.jsxs("div",{className:"flex items-center space-x-2 text-gray-600 text-[14px]",children:[h.jsx("button",{onClick:()=>o(1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(j4,{size:18})}),h.jsx("button",{onClick:()=>o(v=>v-1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(R1,{size:18})}),h.jsx("button",{onClick:()=>o(v=>v+1),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx($1,{size:18})}),h.jsx("button",{onClick:()=>o(f),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(M4,{size:18})})]})]})]})}const dF=({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)}},[]),h.jsxs("div",{ref:o,className:"relative h-[32px]",children:[h.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:[h.jsx("div",{className:"text-[12px] leading-[16px] min-w-[109px] text-[#64748B]",children:t}),h.jsx(Hfe,{size:16,className:"text-[#64748B]"})]}),r&&h.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)=>h.jsx("div",{className:"px-[12px] py-[8px] text-[14px] text-[#334155] hover:bg-[#F1F5F9] cursor-pointer",onClick:()=>{n(a),i(!1)},children:a},s))})]})},Che=({data:e,communities:t,title:n})=>{const[r,i]=k.useState({}),[o,a]=k.useState(""),s=t?.map(d=>d?.community_name)||[];k.useEffect(()=>{s?.length>0&&!o&&a(s[0])},[s,o]);const l=[{community_name:"L1",Cancelled:55,Open:50,OnHold:20,InProgress:10},{community_name:"L2",Cancelled:15,Open:15,OnHold:8,InProgress:5},{community_name:"L3",Cancelled:12,Open:75,OnHold:18,InProgress:7}],c=k.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:l,[e]),u=d=>{const{dataKey:f}=d||{};i(p=>({...p,[f]:!p?.[f]}))};return Array.isArray(e)&&e.length===0?h.jsx(kt,{title:n||"Escalation Level By Building",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"w-full flex items-center justify-center",children:h.jsx(an,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(kt,{title:n||"Escalation Level By Building",titleWeight:"semi-bold",className:"h-[362px]",childrenClassName:"mt-[21px]",rightContent:h.jsx(dF,{options:s,value:o,onChange:d=>a(d)}),children:h.jsx("div",{className:"w-full flex items-center justify-center",children:Array.isArray(e)&&e.length===0?h.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):h.jsx("div",{className:"relative w-full h-[261px]",children:h.jsx(Ot,{width:"100%",height:"100%",children:h.jsxs(ko,{data:c,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[h.jsx(sr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),h.jsx(Gn,{dataKey:"community_name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),h.jsx(Rn,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),h.jsx(St,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},allowEscapeViewBox:{x:!0,y:!0},content:d=>!d?.active||!d?.payload?.length?null:h.jsx(Yt,{...d,data:c,children:h.jsxs("div",{className:"bg-black rounded-[10px] px-[14px] py-[10px] text-[12px] text-white",children:[h.jsx("div",{className:"mb-[6px] font-semibold",children:d?.label}),d?.payload?.map((f,p)=>{const m=f?.color||f?.fill||"#fff";return h.jsxs("div",{className:"flex items-center gap-[6px]",children:[h.jsx("span",{className:"w-[8px] h-[8px] rounded-full inline-block",style:{backgroundColor:m}}),h.jsx("span",{className:"text-[#D1D3D4]",children:f?.name}),h.jsx("span",{className:"text-white font-semibold",children:f?.value})]},p)})]})})}),h.jsx(nl,{verticalAlign:"bottom",align:"center",onClick:u,content:({payload:d})=>h.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:d?.map((f,p)=>h.jsxs("div",{onClick:()=>u({dataKey:f?.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[h.jsx("div",{className:`w-[16px] h-[8px] ${r?.[f?.dataKey]?"bg-slate-300":""}`,style:{backgroundColor:r?.[f?.dataKey]?"#CBD5E1":f?.color}}),h.jsx("span",{className:`text-[12px] ${r?.[f?.dataKey]?"text-[#CBD5E1]":"text-[#64748B]"}`,children:f?.value})]},p))})}),h.jsx(qt,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:r?.Open}),h.jsx(qt,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:r?.Cancelled}),h.jsx(qt,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:r?.OnHold,name:"On-Hold"}),h.jsx(qt,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:r?.InProgress,name:"In Progress"})]})})})})})},khe=({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 h.jsx(kt,{title:"Top 5 Tenants by Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-[20px]",rightContent:h.jsx(dF,{options:r,value:t,onChange:a=>n(a)}),children:o?h.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:h.jsx(an,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsx("div",{className:"w-full h-[280px]",children:h.jsx(Ot,{width:"100%",height:"100%",children:h.jsxs(ZN,{data:i,margin:{top:10,right:-10,left:-10,bottom:0},children:[h.jsx("defs",{children:h.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[h.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),h.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),h.jsx(sr,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),h.jsx(Gn,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:a=>a}),h.jsx(Rn,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),h.jsx(St,{cursor:!1,content:a=>h.jsx(Yt,{...a,data:i,children:(()=>{if(!a.active||!a.label)return null;const s=i.find(l=>l.day===a.label);return h.jsxs("div",{className:"bg-[#111] text-white px-[14px] py-[8px] rounded-[6px] flex flex-col gap-[6px] text-[13px]",children:[h.jsx("div",{className:"font-semibold",children:a.label}),h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-2 h-2 rounded-full bg-[#6366F1]"}),h.jsx("div",{className:"text-[#aaa]",children:"Visitors"}),h.jsx("div",{className:"font-bold",children:s?.no_of_visitors??0})]})]})})()})}),h.jsx(px,{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}=a;return h.jsxs("g",{children:[h.jsx("circle",{cx:s,cy:l,r:6,fill:"#fff",stroke:"#6466F1",strokeWidth:2}),h.jsx("circle",{cx:s,cy:l,r:2.5,fill:"#6466F1"})]})}})]})})})})},Phe=({data:e})=>{const t=[{name:"Kosmo One",total:29,pending_approval:1,cancelled:2},{name:"OWC",total:23,pending_approval:9,cancelled:3},{name:"Exora",total:40,pending_approval:12,cancelled:1},{name:"OIC - T3",total:27,pending_approval:19,cancelled:8}],n=e==null?t:Array.isArray(e)?e:[],r=Array.isArray(n)&&n.length===0;return h.jsx(kt,{title:"Building Wise Approvals",titleWeight:"semi-bold",className:"h-[362px]",childrenClassName:"mt-[34px]",children:r?h.jsx("div",{className:"h-[250px] flex items-center justify-center",children:h.jsx(an,{title:"No Data Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsxs("div",{className:"w-full border border-[#EBEBEB] rounded-[10px] overflow-hidden",children:[h.jsxs("div",{className:"grid grid-cols-4 bg-[#FAFAFA] px-[12px] py-[8px] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[h.jsx("div",{children:"Tenant"}),h.jsx("div",{className:"flex justify-end",children:"Total"}),h.jsx("div",{className:"flex justify-end",children:"Pending"}),h.jsx("div",{className:"flex justify-end",children:"Cancelled"})]}),h.jsx("div",{className:"max-h-[280px] overflow-y-auto hide-scrollbar",children:n.map((i,o)=>h.jsxs("div",{className:"grid grid-cols-4 p-[12px] text-[12px] leading-[16px] border-t border-[#EBEBEB]",children:[h.jsx("div",{className:"text-[#475569]",children:i.name}),h.jsx("div",{className:"flex justify-end text-[#36AB6C]",children:i.total}),h.jsx("div",{className:"flex justify-end text-[#F2A815]",children:i.pending_approval}),h.jsx("div",{className:"flex justify-end text-[#AB0000]",children:i.cancelled})]},o))})]})})},gm=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],Dhe=[{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"}],Ahe=({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,investment:i.investment||"-",fill:gm[o%gm.length]})):Dhe.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",fill:gm[o%gm.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?h.jsx(kt,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx(an,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(kt,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-[362px]",children:h.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[h.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[h.jsx(Ot,{width:"100%",height:"100%",children:h.jsxs($i,{children:[h.jsx(ai,{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)=>h.jsx(In,{fill:i.fill},o))}),h.jsx(St,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?h.jsx(Yt,{...i,data:n,children:h.jsx(Rr,{...i})}):null})]})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[h.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),h.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),h.jsx("div",{className:"flex-1 max-w-[280px]",children:h.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0]",children:[h.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] bg-[#F8FAFC]",children:[h.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),h.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-center",children:"Count"}),h.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-right",children:"Investment"})]}),h.jsx("div",{className:"max-h-[205px] overflow-y-auto hide-scrollbar",children:n.map((i,o)=>h.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] border-t border-[#F1F5F9]",children:[h.jsxs("div",{className:"flex items-center gap-[8px]",children:[h.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.fill}}),h.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),h.jsx("div",{className:"text-[13px] text-[#64748B] text-center",children:i.value}),h.jsx("div",{className:"text-[13px] text-[#64748B] text-right",children:i.investment})]},o))})]})})]})})};function The({columns:e=[],data:t=[],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=`200px repeat(${u.length-1}, 150px)`,f={};return u.forEach(p=>{if(p.key!=="name"){let m=0;for(let g=0;g<c.length;g++){const v=c[g][p.key];typeof v=="number"&&(m+=v)}f[p.key]=m}}),h.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:[h.jsx("div",{className:"flex-1 overflow-auto hide-scrollbar",children:c.length===0?h.jsx("div",{className:"h-full flex items-center justify-center",children:h.jsx(an,{title:"No Data Found",description:"Catch up all the data. Change the date range to see the data."})}):h.jsxs("div",{className:"min-w-max",children:[h.jsx("div",{className:"grid bg-[#354A5E] text-white text-[14px] font-medium sticky top-0 z-30",style:{gridTemplateColumns:d},children:u.map((p,m)=>h.jsx("div",{title:p.label,className:`px-[24px] py-[16px] whitespace-nowrap overflow-hidden text-ellipsis ${m===0?"sticky left-0 z-40 bg-[#354A5E] shadow-[2px_0_5px_rgba(0,0,0,0.1)] border-r border-[#2C3E50]":""}`,children:p.label},m))}),c.map((p,m)=>h.jsx("div",{className:"grid",style:{gridTemplateColumns:d},children:u.map((g,v)=>h.jsx("div",{className:`px-[24px] py-[14px] text-[14px] flex items-center ${v===0?"bg-white sticky left-0 z-20 font-medium shadow-[2px_0_5px_rgba(0,0,0,0.05)] border-r border-gray-200":"bg-gray-50"}`,children:p[g.key]??"-"},v))},m)),h.jsx("div",{className:"grid bg-[#F8FAFC] border-t border-[#F0F0F0] sticky bottom-0 z-30",style:{gridTemplateColumns:d},children:u.map((p,m)=>h.jsx("div",{className:`px-[24px] py-[16px] ${m===0?"sticky left-0 z-40 bg-[#F8FAFC] text-[#64748B] font-medium shadow-[2px_0_5px_rgba(0,0,0,0.05)] border-r border-gray-200":"text-[#64748B] font-medium"}`,children:p.key==="name"?"Grand Total":f[p.key]||0},m))})]})}),h.jsxs("div",{className:"flex justify-end items-center px-[24px] py-[16px] text-sm bg-white border-t border-[#F0F0F0] gap-[32px]",children:[h.jsxs("div",{className:"flex items-center gap-[8px] text-gray-600 text-[14px]",children:[h.jsx("div",{children:"Rows per page:"}),h.jsx("select",{value:n,onChange:p=>{r(Number(p.target.value)),o(1)},className:"border rounded px-[8px] py-[4px]",children:l.map((p,m)=>h.jsx("option",{value:p,children:p},m))}),h.jsxs("div",{className:"ml-4 text-[14px]",children:[c.length===0?"0–0":`1–${c.length}`," of"," ",a||c.length]})]}),h.jsxs("div",{className:"flex items-center space-x-2 text-gray-600 text-[14px]",children:[h.jsx("button",{onClick:()=>o(1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(j4,{size:18})}),h.jsx("button",{onClick:()=>o(p=>p-1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(R1,{size:18})}),h.jsx("button",{onClick:()=>o(p=>p+1),disabled:i===s,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx($1,{size:18})}),h.jsx("button",{onClick:()=>o(s),disabled:i===s,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:h.jsx(M4,{size:18})})]})]})]})}se.AccessPointsUsage=Z4,se.Accounting=xfe,se.Amenities=H4,se.AmenitiesStatsCard=Ro,se.AmenityWiseRevenue=oF,se.AssetValueBreakdown=jfe,se.AssetsByType=aF,se.BlockWiseOccupancy=dfe,se.BookingTrendChart=iF,se.Bookings=rF,se.Budgets=Ofe,se.BuildingWiseApprovals=Phe,se.Card=Le,se.CardAccess=Q4,se.CashBankBalance=kfe,se.CommercialAccessOverview=X4,se.CommercialAmenitiesDashboard=whe,se.CommercialAssetManagementDashboard=Ehe,se.CommercialDashboard=ahe,se.CommercialEngagementDashboard=Ohe,se.CommercialGuardPatrols=lF,se.CommercialGuardPetrolDashboard=She,se.CommercialHelpdeskDashboard=hhe,se.CommercialIncidentReports=cF,se.CommercialOccupancy=$4,se.CommercialReportTable=uF,se.CommercialSmartAccessDashboard=uhe,se.CommercialTableDashboard=uF,se.CommercialVisitorsDashboard=ghe,se.Community=qae,se.Complaints=Dpe,se.ComplaintsByLevel=Npe,se.DuesAgeing=Dfe,se.EmployeeFootfall=B4,se.Engagement=Zj,se.EngagementStatsGrid=Zpe,se.EscalationLevel=Che,se.EventsUtilisation=Hpe,se.ExpenseCategories=Tfe,se.Facilities=Gae,se.FinanceSummary=Xae,se.FoodBeverages=V4,se.GateAndSecurityStatsGrid=Cpe,se.GateUpdates=Lse,se.GuardPatrols=fpe,se.Header=_8,se.Helpdesk=Rse,se.HelpdeskStatsGrid=Wpe,se.HourlyTrafficFlow=vpe,se.IncidentReports=xpe,se.IncomeExpenditure=k4,se.MainHeader=I8,se.MaintenanceStatus=sF,se.MetricCard=B1,se.MobileAccess=Q4,se.MoveInOutTrends=hfe,se.NoticeBoardStatus=Kpe,se.OccupancyOverview=lfe,se.OrganisationWiseVisitors=nF,se.PortfolioAssetsByType=Ahe,se.RequestBox=Mpe,se.ResidentOverview=cfe,se.RevenuebyCategory=Ife,se.SingleStats=Gpe,se.StaffAttendance=F4,se.StatsGrid=upe,se.TenantsByVisitors=khe,se.TicketEscalation=Y4,se.TicketStatus=U4,se.Tickets=J4,se.TicketsperCategory=eF,se.TotalCommercialTable=The,se.UnitStatus=sfe,se.VisitorUpdates=G4,se.WeeklyVisitorPattern=tF,Object.defineProperty(se,Symbol.toStringTag,{value:"Module"})}));
|