anarock-widgets 1.0.348 → 1.0.349
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 +4 -4
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -391,4 +391,4 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
391
391
|
`,`1) content: element.innerHTML
|
|
392
392
|
`,"2) content: () => element.cloneNode(true)"].join(" "))}var s=i.reduce(function(l,c){var u=c&&Fpe(c,r);return u&&l.push(u),l},[]);return hu(e)?s[0]:s}Zu.defaultProps=xr;Zu.setDefaultProps=Rpe;Zu.currentInput=yi;Object.assign({},Gx,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});Zu.setDefaultProps({render:NI});function jI(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var RI=typeof window<"u"&&typeof document<"u";function fb(e,t){e&&(typeof e=="function"&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function JP(){return RI&&document.createElement("div")}function Bpe(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}function II(e,t){if(e===t)return!0;if(typeof e=="object"&&e!=null&&typeof t=="object"&&t!=null){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(t.hasOwnProperty(n)){if(!II(e[n],t[n]))return!1}else return!1;return!0}else return!1}function Wpe(e){var t=[];return e.forEach(function(n){t.find(function(r){return II(n,r)})||t.push(n)}),t}function Vpe(e,t){var n,r;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:Wpe([].concat(((n=e.popperOptions)==null?void 0:n.modifiers)||[],((r=t.popperOptions)==null?void 0:r.modifiers)||[]))})})}var jv=RI?P.useLayoutEffect:P.useEffect;function zpe(e){var t=P.useRef();return t.current||(t.current=typeof e=="function"?e():e),t.current}function ek(e,t,n){n.split(/\s+/).forEach(function(r){r&&e.classList[t](r)})}var Hpe={name:"className",defaultValue:"",fn:function(t){var n=t.popper.firstElementChild,r=function(){var s;return!!((s=t.props.render)!=null&&s.$$tippy)};function i(){if(t.props.className&&!r()){process.env.NODE_ENV!=="production"&&console.warn(["@tippyjs/react: Cannot use `className` prop in conjunction with","`render` prop. Place the className on the element you are","rendering."].join(" "));return}ek(n,"add",t.props.className)}function o(){r()&&ek(n,"remove",t.props.className)}return{onCreate:i,onBeforeUpdate:o,onAfterUpdate:i}}};function Ype(e){function t(n){var r=n.children,i=n.content,o=n.visible,a=n.singleton,s=n.render,l=n.reference,c=n.disabled,u=c===void 0?!1:c,d=n.ignoreAttributes,f=d===void 0?!0:d;n.__source,n.__self;var p=jI(n,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),h=o!==void 0,g=a!==void 0,v=P.useState(!1),x=v[0],_=v[1],w=P.useState({}),y=w[0],E=w[1],S=P.useState(),k=S[0],D=S[1],T=zpe(function(){return{container:JP(),renders:1}}),R=Object.assign({ignoreAttributes:f},p,{content:T.container});h&&(process.env.NODE_ENV!=="production"&&["trigger","hideOnClick","showOnCreate"].forEach(function(M){R[M]!==void 0&&console.warn(["@tippyjs/react: Cannot specify `"+M+"` prop in","controlled mode (`visible` prop)"].join(" "))}),R.trigger="manual",R.hideOnClick=!1),g&&(u=!0);var A=R,C=R.plugins||[];s&&(A=Object.assign({},R,{plugins:g&&a.data!=null?[].concat(C,[{fn:function(){return{onTrigger:function($,B){var z=a.data.children.find(function(V){var W=V.instance;return W.reference===B.currentTarget});$.state.$$activeSingletonInstance=z.instance,D(z.content)}}}}]):C,render:function(){return{popper:T.container}}}));var N=[l].concat(r?[r.type]:[]);return jv(function(){var M=l;l&&l.hasOwnProperty("current")&&(M=l.current);var j=e(M||T.ref||JP(),Object.assign({},A,{plugins:[Hpe].concat(R.plugins||[])}));return T.instance=j,u&&j.disable(),o&&j.show(),g&&a.hook({instance:j,content:i,props:A,setSingletonContent:D}),_(!0),function(){j.destroy(),a?.cleanup(j)}},N),jv(function(){var M;if(T.renders===1){T.renders++;return}var j=T.instance;j.setProps(Vpe(j.props,A)),(M=j.popperInstance)==null||M.forceUpdate(),u?j.disable():j.enable(),h&&(o?j.show():j.hide()),g&&a.hook({instance:j,content:i,props:A,setSingletonContent:D})}),jv(function(){var M;if(s){var j=T.instance;j.setProps({popperOptions:Object.assign({},j.props.popperOptions,{modifiers:[].concat((((M=j.props.popperOptions)==null?void 0:M.modifiers)||[]).filter(function($){var B=$.name;return B!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(B){var z,V=B.state,W=(z=V.modifiersData)==null?void 0:z.hide;(y.placement!==V.placement||y.referenceHidden!==W?.isReferenceHidden||y.escaped!==W?.hasPopperEscaped)&&E({placement:V.placement,referenceHidden:W?.isReferenceHidden,escaped:W?.hasPopperEscaped}),V.attributes.popper={}}}])})})}},[y.placement,y.referenceHidden,y.escaped].concat(N)),P.createElement(P.Fragment,null,r?P.cloneElement(r,{ref:function(j){T.ref=j,fb(r.ref,j)}}):null,x&&wi.createPortal(s?s(Bpe(y),k,T.instance):i,T.container))}return t}var Upe=(function(e,t){return P.forwardRef(function(r,i){var o=r.children,a=jI(r,["children"]);return P.createElement(e,Object.assign({},t,a),o?P.cloneElement(o,{ref:function(l){fb(i,l),fb(o.ref,l)}}):null)})}),Kpe=Upe(Ype(Zu));const Pr=({children:e,active:t,payload:n,coordinate:r,data:i,offsetY:o=40})=>!t||!n?.length?null:m.jsx("div",{style:{position:"absolute",transform:`translate(${r.x}px, ${r.y}px)`,pointerEvents:"none",zIndex:99999},children:m.jsx(Kpe,{content:e,visible:!0,placement:"right",offset:[0,5],arrow:!0,theme:"custom-black",children:m.jsx("div",{style:{width:0,height:0,background:"black"}})})}),qpe=({active:e,payload:t})=>{if(!e||!t||!t.length)return null;const n=t[0],r=n.payload.color;return m.jsx("div",{style:{backgroundColor:"#000000",color:"#ffffff",padding:"8px 10px",borderRadius:"8px",fontSize:"12px"},children:m.jsxs("div",{className:"flex items-center gap-[8px] font-medium",children:[m.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:r}}),m.jsx("div",{children:n.name}),m.jsx("div",{className:"ml-2",children:n.value})]})})};function Gpe({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 m.jsx(Ie,{className:"h-[267px]",title:"Ticket Status",period:"Today",icon:m.jsx(Qv,{className:"!text-[24px] text-[#EF4444]"}),children:m.jsxs("div",{className:"flex h-full items-center gap-[16px]",children:[m.jsxs("div",{className:"w-[202px] h-[170px] relative",children:[m.jsx(Ot,{width:"100%",height:"100%",children:m.jsxs(zi,{children:[m.jsx(ai,{data:i,innerRadius:55,outerRadius:85,dataKey:"value",stroke:"#FFFFFF",strokeWidth:2,children:i.map((a,s)=>m.jsx(In,{fill:a.color},s))}),m.jsx(Dt,{content:a=>m.jsx(Pr,{...a,data:i,children:m.jsx(qpe,{...a})})})]})}),m.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[m.jsxs("div",{className:"flex items-baseline text-[18px] leading-[22px] font-medium text-[#121212]",children:[m.jsx("div",{children:r(n.completed)}),m.jsxs("div",{className:"text-[18.18px] leading-[22.22px] text-[#121212]",children:["/",o]})]}),m.jsx("div",{className:"text-[10.1px] leading-[14.14px] text-[#64748B]",children:"Completed"})]})]}),m.jsx("div",{className:"flex-1 space-y-2",children:i.map(a=>m.jsxs("div",{className:"flex items-center justify-between text-[12px] leading-[17px] mt-[12px]",children:[m.jsxs("div",{className:"flex items-center gap-[8px]",children:[m.jsx("div",{className:"h-[7px] w-[16px]",style:{backgroundColor:a.color}}),m.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]}),m.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px] font-medium",children:a.value})]},a.name))})]})})}const tk={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 Xpe(e){const t=e>=12?"PM":"AM";let n=e%12;return n===0&&(n=12),`${n} ${t}`}function Qpe(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 Zpe(e=[]){return Array.from({length:24},(t,n)=>{const r=e.find(i=>Qpe(i?.hour)===n)||{};return{hour:n,time:Xpe(n),walkins:Number(r?.walkins??0),approved:Number(r?.pre_approved??r?.preApproved??r?.approved??0)}})}function nk({title:e,color:t,rows:n=[],children:r}){const i=m.jsxs("div",{className:"bg-white rounded-[12px] min-w-[260px] p-[16px] border-[0.5px] border-[#EBEBEB] shadow-[0px_0px_12px_0px_#EAF2FF]",children:[m.jsx("div",{className:"flex items-center gap-[8px] font-medium text-[#121212]",children:m.jsx("div",{children:e??""})}),m.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})=>m.jsxs("div",{className:"flex justify-between text-[14px] leading-[18px]",children:[m.jsx("div",{className:"text-[#64748B]",children:o??""}),m.jsx("div",{className:"font-semibold",style:{color:s||"#121212"},children:a??0})]},o))})]});return m.jsx(kR,{placement:"right-start",interactive:!0,delay:[100,0],offset:[6,0],appendTo:()=>document.body,maxWidth:"none",render:o=>m.jsx("div",{tabIndex:"-1",...o,children:i}),children:r})}function Jpe({active:e,payload:t}){return!e||!t?.length?null:m.jsx("div",{className:"rounded-[8px] bg-[#121212] px-[12px] py-[8px] text-[12px] text-white shadow-lg",children:t.map(n=>m.jsxs("div",{className:"flex items-center gap-[8px]",children:[m.jsx("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:n.stroke}}),m.jsx("span",{className:"min-w-[82px] text-[#D1D3D4]",children:n.name}),m.jsx("span",{className:"font-semibold",children:n.value})]},n.dataKey))})}function ehe({data:e}){const t=e&&Object.keys(e).length?e:tk,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=P.useMemo(()=>{const l=t?.chart_data??[];return Zpe(l.length?l:tk.chart_data)},[t]),{yAxisTicks:o,yAxisMax:a}=P.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 m.jsx(Ie,{className:"h-[377px]",title:"Visitor Updates",period:`Today at ${s}`,icon:m.jsx(Vb,{className:"!text-[24px] text-[#8B5CF6]"}),children:m.jsxs("div",{className:"flex flex-col gap-[24px]",children:[m.jsxs("div",{className:"grid grid-cols-2 gap-y-4 gap-x-6",children:[m.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[m.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Total Visitors"}),m.jsx("div",{className:"text-[20px] font-medium text-[#08B6D4]",children:n?.totalVisitorsToday??0})]}),m.jsxs("div",{className:"flex flex-col gap-[8px]!",children:[m.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Peak Time"}),m.jsx("div",{className:"text-[20px] font-medium text-[#8B5CF6]",children:n?.peakTime??"-"})]}),m.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[m.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Active Walk-ins"}),m.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[m.jsx("div",{className:"text-[28px] text-[#1FA05B] leading-[32px]",children:r?.walkins?.currently_inside??0}),m.jsx(nk,{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:m.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.walkins?.total_visited_today??0]})})]})]}),m.jsxs("div",{className:"mt-2 flex flex-col gap-[8px]!",children:[m.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Pre-approved Check-ins"}),m.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[m.jsx("div",{className:"text-[28px] text-[#E7A015] leading-[32px]",children:r?.preApproved?.completed_visits??0}),m.jsx(nk,{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:m.jsxs("div",{className:"text-[#64748B] cursor-pointer text-[20px] leading-[32px]",children:["/",r?.preApproved?.total_expected_today??0]})})]})]})]}),m.jsx("div",{className:"w-full h-[149px]",children:m.jsx(Ot,{width:"100%",height:"100%",children:m.jsxs(Yx,{data:i??[],margin:{top:5,right:0,left:0,bottom:-10},children:[m.jsx(ur,{stroke:"#E5E7EB",strokeDasharray:"4 4",vertical:!1}),m.jsx(Un,{dataKey:"time",tickFormatter:(l,c)=>c%4===0?l:"",axisLine:!1,tickLine:!1,tick:{fill:"#121212",fontSize:10,fontWeight:400}}),m.jsx(Ln,{width:24,axisLine:!1,tickLine:!1,allowDecimals:!1,ticks:o,domain:[0,a],tick:{fill:"#64748B",fontSize:10,fontWeight:400}}),m.jsx(Dt,{content:l=>m.jsx(Pr,{...l,data:i,children:m.jsx(Jpe,{...l})})}),m.jsx(Qo,{type:"monotone",dataKey:"walkins",stroke:"#22C55E",strokeWidth:2,dot:!1,name:"Walk-ins",isAnimationActive:!1}),m.jsx(Qo,{type:"monotone",dataKey:"approved",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved",isAnimationActive:!1})]})})})]})})}function the({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 m.jsx(kt,{className:"h-[362px]",title:"Access Overview",titleWeight:"semi-bold",children:a?m.jsx("div",{className:"h-[300px] flex items-center justify-center",children:m.jsx(En,{title:"No access Point Found",description:"Catch up all the data. Change the date range to see the data."})}):m.jsxs("div",{className:"flex flex-col items-center mt-[16px]",children:[m.jsxs("div",{className:"relative w-[212px] h-[212px]",children:[m.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:m.jsx("div",{className:"w-[130px] h-[130px] rounded-full shadow-[0px_12px_35px_rgba(0,0,0,0.12)]"})}),m.jsx("div",{className:"h-[212px]",children:m.jsx(Ot,{width:"100%",height:"100%",children:m.jsxs(zi,{children:[m.jsx(ai,{data:s,dataKey:"value",innerRadius:65,outerRadius:100,startAngle:360,endAngle:-180,paddingAngle:1,stroke:"transparent",children:s.map((c,u)=>m.jsx(In,{fill:c.color},u))}),m.jsx(Dt,{content:c=>m.jsx(Pr,{...c,data:s,children:m.jsx(Fi,{...c})})})]})})}),m.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[m.jsx("div",{className:"text-[22px] leading-[27px] font-medium text-[#121212]",children:l}),m.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B]",children:"Total Access"})]})]}),m.jsxs("div",{className:"mt-[28px] flex justify-between w-full px-[20px]",children:[m.jsxs("div",{className:"flex flex-col items-center",children:[m.jsxs("div",{className:"flex items-center gap-[6px]",children:[m.jsx("div",{className:"w-[14px] h-[6px] bg-[#8B5CF6]"}),m.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Entries"})]}),m.jsx("div",{className:"text-[18px] font-medium text-[#8B5CF6] mt-[4px]",children:i.toLocaleString()})]}),m.jsxs("div",{className:"flex flex-col items-center",children:[m.jsxs("div",{className:"flex items-center gap-[6px]",children:[m.jsx("div",{className:"w-[14px] h-[6px] bg-[#329DFF]"}),m.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Exit"})]}),m.jsx("div",{className:"text-[18px] font-medium text-[#329DFF] mt-[4px]",children:o.toLocaleString()})]})]})]})})}function LI({title:e="Access",data:t=[],height:n="h-[362px]"}){const r=i=>i==null?"0":Number(i).toLocaleString();return m.jsx(kt,{className:n,title:e,titleWeight:"semi-bold",children:m.jsxs("div",{className:"rounded-[12px] overflow-hidden mt-[16px]",children:[m.jsxs("div",{className:"grid grid-cols-2 bg-[#F8FAFC] py-[8px] px-[12px] text-[12px] leading-[16px] font-medium text-[#64748B]",children:[m.jsx("div",{children:"Point"}),m.jsx("div",{className:"text-right",children:"Access"})]}),t.map((i,o)=>m.jsxs("div",{className:"grid grid-cols-2 p-[12px] text-[14px] border-t border-[#E2E8F0]",children:[m.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:i.label}),m.jsx("div",{className:"text-[12px] leading-[16px] text-right font-medium",style:{color:i.color||"#000"},children:r(i.value)})]},o))]})})}function nhe({data:e=[]}){const[t,n]=P.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 m.jsx(kt,{title:"Access Points Usage",titleWeight:"semi-bold",className:"h-[362px]",children:a?m.jsx("div",{className:"h-[270px] flex items-center justify-center",children:m.jsx(En,{title:"No access Point Found",description:"Catch up all the data. Change the date range to see the data."})}):m.jsx("div",{className:"mt-[24px] h-[270px] w-full",children:m.jsx(Ot,{width:"100%",height:"100%",children:m.jsxs(No,{data:r,barSize:54,margin:{top:0,right:0,left:-20,bottom:0},children:[m.jsx(ur,{strokeDasharray:"8 8",vertical:!1}),m.jsx(Rx,{y:0,stroke:"#EBEBEB"}),m.jsx(Un,{dataKey:"block_name",tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),m.jsx(Ln,{tickFormatter:s,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1}),m.jsx(Dt,{cursor:!1,content:c=>m.jsx(Pr,{...c,data:r,children:(()=>{if(!c.active||!c.label)return null;const u=r.find(d=>d.block_name===c.label);return m.jsxs("div",{className:"bg-[#111] text-white px-[14px] py-[8px] rounded-[6px] flex flex-col gap-[6px] text-[13px]",children:[m.jsx("div",{className:"font-semibold",children:c.label}),!t.includes("entries")&&m.jsxs("div",{className:"flex items-center gap-[8px]",children:[m.jsx("div",{className:"w-2 h-2 rounded-full bg-[#329DFF]"}),m.jsx("div",{className:"text-[#aaa]",children:"Entries"}),m.jsx("div",{className:"font-bold",children:u?.entries??0})]}),!t.includes("exit")&&m.jsxs("div",{className:"flex items-center gap-[8px]",children:[m.jsx("div",{className:"w-2 h-2 rounded-full bg-[#76BDFF]"}),m.jsx("div",{className:"text-[#aaa]",children:"Exit"}),m.jsx("div",{className:"font-bold",children:u?.exit??0})]})]})})()})}),m.jsx(El,{verticalAlign:"bottom",height:36,content:()=>{const c=[{key:"entries",label:"Entries",color:"#329DFF"},{key:"exit",label:"Exit",color:"#76BDFF"}];return m.jsx("div",{style:{display:"flex",gap:"20px",justifyContent:"center",marginTop:"20px"},children:c.map((u,d)=>{const f=t.includes(u.key);return m.jsxs("div",{onClick:()=>l(u.key),style:{display:"flex",alignItems:"center",gap:"8px",cursor:"pointer",opacity:f?.4:1},children:[m.jsx("div",{style:{width:"20px",height:"8px",backgroundColor:u.color}}),m.jsx("div",{style:{fontSize:"12px",color:"#64748B"},children:u.label})]},d)})})}}),m.jsx(Kt,{dataKey:"entries",stackId:"a",fill:"#329DFF",hide:t.includes("entries")}),m.jsx(Kt,{dataKey:"exit",stackId:"a",fill:"#76BDFF",hide:t.includes("exit")})]})})})})}const rhe=({x:e,y:t,payload:n})=>{const r=n.value.split(" ");return m.jsx("g",{transform:`translate(${e},${t})`,children:m.jsx("text",{x:-85,y:0,textAnchor:"start",fill:"#121212",fontSize:14,children:r.map((i,o)=>m.jsx("tspan",{x:-85,dy:o===0?0:16,children:i},o))})})};function ihe({data:e=[]}){const t=e&&e.length>0,n=e.map(r=>({name:r.category_name,value:r.total_complaints,color:"#08B6D4"}));return m.jsx(kt,{title:"Tickets per Category",className:"h-[362px]",titleWeight:"semi-bold",childrenClassName:"h-full mt-[24px]!",children:t?m.jsx("div",{className:"w-full h-[262px]",children:m.jsx(Ot,{width:"100%",height:"100%",children:m.jsxs(No,{data:n,layout:"vertical",margin:{top:0,right:8,left:-20,bottom:0},children:[m.jsx(ur,{strokeDasharray:"3 3",horizontal:!1,stroke:"#E5E7EB"}),m.jsx(Un,{type:"number",tick:{fill:"#94A3B8",fontSize:12},axisLine:!0,tickLine:!1,tickMargin:10,allowDecimals:!1}),m.jsx(Ln,{type:"category",dataKey:"name",axisLine:!1,tickLine:!1,width:132,tick:m.jsx(rhe,{})}),m.jsx(Dt,{cursor:{fill:"transparent"},position:{x:300,y:0},allowEscapeViewBox:{x:!0,y:!0},content:r=>r.active?m.jsx(Pr,{...r,data:n,children:m.jsx(Fi,{...r})}):null}),m.jsx(Kt,{dataKey:"value",barSize:36,fill:"#08B6D4"})]})})}):m.jsx(En,{title:"No Tickets Found",description:"Catch up all the data. Change the date range to see the data."})})}function ohe({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 m.jsxs("div",{className:"relative bg-white !border-[0.5px] !border-[#EBEBEB] !rounded-[12px] !shadow-[0_0_12px_0_#EAF2FF] p-[16px]",children:[m.jsxs("div",{className:"flex items-center gap-[8px]",children:[e&&m.jsx("div",{className:"h-[20px] w-[20px]",style:{color:t,display:"flex",alignItems:"center",justifyContent:"center"},children:m.jsx(e,{className:"h-[20px] w-[20px]"})}),m.jsx("div",{className:"text-[16px] leading-[20px] font-medium text-[#64748B]",children:n})]}),m.jsx("div",{className:"mt-[16px] text-[28px] leading-[32px] font-medium text-[#121212]",children:r}),(i||o)&&m.jsxs("div",{className:"mt-[12px] flex items-center gap-[8px]",children:[i&&m.jsxs("div",{className:"flex items-center gap-[4px] text-[12px] leading-[16px] font-medium",style:{color:l},children:[s?m.jsx(rs,{}):m.jsx(ns,{}),Math.abs(a),"%"]}),o&&m.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:o})]})]})}const ahe=({data:e=[],onDateChange:t})=>{const[n,r]=P.useState(new Date),[i,o]=P.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)},h=Array.isArray(e)?e:[],g=!h.length||h.every(v=>v.no_of_visitors===0);return m.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&&m.jsx("div",{className:"anarock-datepicker absolute top-[70px] right-[24px] z-50",children:m.jsx(kD,{selected:n,onChange:p,inline:!0,maxDate:new Date,showYearDropdown:!0,scrollableYearDropdown:!0,yearDropdownItemNumber:40})}),g?m.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:m.jsx(En,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):m.jsx("div",{className:"w-full h-[280px]",children:m.jsx(Ot,{width:"100%",height:"100%",children:m.jsxs(kj,{data:h,margin:{top:10,right:-10,left:-10,bottom:0},children:[m.jsx("defs",{children:m.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[m.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),m.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),m.jsx(ur,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),m.jsx(Un,{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"})}),m.jsx(Ln,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),m.jsx(Dt,{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 m.jsx(Pr,{...v,data:h,children:m.jsx(Fi,{active:x,payload:_,label:y})})}}),m.jsx(Bx,{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 m.jsxs("g",{children:[m.jsx("circle",{cx:x,cy:_,r:6,fill:"#fff",stroke:"#6466F1",strokeWidth:2}),m.jsx("circle",{cx:x,cy:_,r:2.5,fill:"#6466F1"})]})}})]})})})]})},she=[{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}],lhe=({data:e,title:t,bar:n})=>{const r=Array.isArray(e)&&e?.length===0,i=e==null?she:Array.isArray(e)?e:[];return m.jsx(kt,{title:t||"Organisation Wise Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-6",children:m.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:r?m.jsx(En,{title:t||"Organisation Wise Visitors",description:"Catch up all the data. Change the date range to see the data."}):m.jsx(Ot,{width:"100%",height:"100%",children:m.jsxs(No,{data:i||[],margin:{top:10,right:10,left:10,bottom:-10},barCategoryGap:35,children:[m.jsx(ur,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),m.jsx(Un,{dataKey:"building_name",tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1}),m.jsx(Ln,{width:40,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1}),m.jsx(Dt,{cursor:!1,content:o=>o.active?m.jsx(Pr,{...o,data:i,children:m.jsx(Fi,{...o})}):null}),m.jsx(Kt,{dataKey:"no_of_visitors",name:"Visitors",maxBarSize:55,fill:n||"#3C81F6"})]})})})})};function che({data:e}){return m.jsx("div",{className:"h-full",children:e.map((t,n)=>{const r=parseFloat(t.delta),i=r>=0;return m.jsx(Ie,{iconClassName:"!gap-[8px]",title:m.jsx("div",{className:"text-[#64748B]",children:t.title}),icon:m.jsx(t.Icon,{className:"h-[20px] w-[20px]",style:{color:t.iconColor||"#000000"}}),className:`${t?.widget==="amenities"?"h-[139px]":"h-[124px]"}`,children:m.jsxs("div",{className:`flex flex-col gap-[8px] ${t?.widget==="amenities"?"mt-[3.5px]":"mt-0"}`,children:[m.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t.value}),m.jsxs("div",{className:`flex items-center text-[12px] leading-[16px] ${t.delta?"gap-[8px]":""}`,children:[t.delta&&m.jsxs("div",{className:`flex items-center gap-[4px] px-[6px] py-[2px] rounded-[4px] font-medium
|
|
393
393
|
${i?"text-[#1FA05B] bg-[#F7FEFA]":"text-[#E11D48] bg-[#FBF4F4]"}
|
|
394
|
-
`,children:[i?m.jsx(rs,{}):m.jsx(ns,{}),Math.abs(r),"%"]}),m.jsx("div",{style:{color:"#64748B"},children:t.deltaLabel})]})]})},n)})})}const uhe=[{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}],dhe=({x:e,y:t,payload:n})=>m.jsx("foreignObject",{x:(e||0)-80,y:(t||0)-18,width:80,height:40,children:m.jsx("div",{className:"text-[12px] leading-[16px] text-[#121212]",style:{width:"80px",whiteSpace:"normal",wordBreak:"break-word",textAlign:"left"},children:n?.value||""})});function fhe({data:e,bar:t}){const n=Array?.isArray(e)&&e?.length===0,i=(e==null?uhe:Array?.isArray(e)?e:[]).map(o=>({...o,name:o.facility_name,color:"#8B5CF6"}));return m.jsx(Ie,{title:"Bookings",icon:m.jsx(lfe,{size:18,className:"text-[#DBB467]"}),className:"h-[288px]",children:m.jsx("div",{className:"w-full h-full flex items-center justify-center",children:n?m.jsx(En,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):m.jsx(Ot,{width:"100%",height:"100%",children:m.jsxs(No,{data:i||[],layout:"vertical",margin:{top:0,right:10,left:-12,bottom:0},children:[m.jsx(Un,{type:"number",allowDecimals:!1,tick:{fill:"#64748B",fontSize:12},axisLine:!0,tickLine:!1}),m.jsx(Ln,{type:"category",dataKey:"facility_name",axisLine:!1,tickLine:!1,width:100,tick:m.jsx(dhe,{})}),m.jsx(Dt,{cursor:{fill:"transparent"},position:{x:300,y:0},allowEscapeViewBox:{x:!0,y:!0},content:o=>o.active?m.jsx(Pr,{...o,data:i,children:m.jsx(Fi,{...o})}):null}),m.jsx(Kt,{dataKey:"total_booking",barSize:40,fill:t||"#8B5CF6"})]})})})})}const phe=[{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 hhe({data:e}){const t=Array.isArray(e)&&e?.length===0,n=e==null?phe:Array.isArray(e)?e:[];return m.jsx(kt,{title:"Booking Trend by Organisation",titleWeight:"semi-bold",className:"h-[362px]",children:m.jsx("div",{className:"w-full h-[265px] mt-[28px] flex items-center justify-center",children:t?m.jsx(En,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):m.jsx(Ot,{width:"100%",height:"100%",children:m.jsxs(No,{data:n||[],margin:{top:0,right:0,left:-30,bottom:0},children:[m.jsx(ur,{strokeDasharray:"3 3",vertical:!1,stroke:"#E5E7EB"}),m.jsx(Un,{dataKey:"building_name",axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12}}),m.jsx(Ln,{allowDecimals:!1,axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12},tickFormatter:r=>`${r??0}`}),m.jsx(Dt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:r=>r.active?m.jsx(Pr,{...r,data:n,children:m.jsx(Fi,{...r})}):null}),m.jsx(Kt,{dataKey:"no_of_booking",barSize:54,fill:"#12B981"})]})})})})}const mhe=[{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"}],rf=["#3C81F6","#60A5FA","#95BFFA","#BEDAFE","#DAE6FC"];function ghe({data:e,currencyType:t}){const n=Array?.isArray(e)&&e?.length===0,r=e??mhe,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 m.jsx(kt,{title:"Amenity Wise Revenue",titleWeight:"semi-bold",className:"h-[362px]",children:m.jsx("div",{className:"grid grid-cols-12 gap-[24px] items-center h-full mt-[16px]",children:n?m.jsx("div",{className:"col-span-12 flex items-center justify-center h-[240px]",children:m.jsx(En,{title:"No Amenity Found",description:"Catch up all the data. Change the date range to see the data."})}):m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"col-span-6 h-[240px] w-full max-w-[240px]",children:m.jsx(Ot,{width:"100%",height:"100%",children:m.jsxs(zi,{children:[m.jsx(ai,{data:a||[],dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:95,stroke:"#fff",strokeWidth:1,children:a?.map?.((l,c)=>m.jsx(In,{fill:rf?.[c%rf?.length]},`cell-${c}`))}),m.jsx(Dt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:l=>l.active?m.jsx(Pr,{...l,data:a,children:m.jsx(Fi,{...l,formatter:c=>s(c)})}):null})]})})}),m.jsx("div",{className:"col-span-6",children:m.jsxs("div",{className:"rounded-[12px] !overflow-hidden border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[m.jsxs("div",{className:"grid grid-cols-2 px-[12px] py-[8px] bg-[#EBEBEB] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[m.jsx("div",{children:"Amenity"}),m.jsx("div",{className:"text-right",children:"Revenue"})]}),m.jsx("div",{className:"divide-y divide-[#F1F5F9] max-h-[238px] overflow-y-auto hide-scrollbar",children:i?.map?.((l,c)=>m.jsxs("div",{className:"grid grid-cols-2 px-[16px] py-[16px] text-[14px] text-[#121212]",children:[m.jsxs("div",{className:"flex items-center gap-[12px]",children:[m.jsx("span",{className:"w-[16px] h-[7px]",style:{backgroundColor:rf?.[c%rf?.length]}}),m.jsx("span",{className:"text-[#64748B] text-[12px] leading-[16px]",children:l?.name||"Unknown"})]}),m.jsx("div",{className:"text-right text-[12px] leading-[16px] text-[#64748B]",children:s(l?.value||0)})]},l?.name||c))})]})})]})})})}const of=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],vhe=[{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}],yhe=({rows:e,totalAssets:t})=>{const n=P.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:of[o%of.length]})):vhe.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,fill:of[o%of.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?m.jsx(kt,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:m.jsx("div",{className:"flex items-center justify-center h-full",children:m.jsx(En,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):m.jsx(kt,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:m.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[m.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[m.jsx(Ot,{width:"100%",height:"100%",children:m.jsxs(zi,{children:[m.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)=>m.jsx(In,{fill:i.fill},o))}),m.jsx(Dt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?m.jsx(Pr,{...i,data:n,children:m.jsx(Fi,{...i})}):null})]})}),m.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[m.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),m.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),m.jsx("div",{className:"flex-1 max-w-[280px]",children:m.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[m.jsxs("div",{className:"flex items-center justify-between px-[16px] py-[12px] bg-[#F8FAFC]",children:[m.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),m.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Count"})]}),n.map((i,o)=>m.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:[m.jsxs("div",{className:"flex items-center gap-[8px]",children:[m.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.fill}}),m.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),m.jsx("div",{className:"text-[13px] text-[#64748B]",children:i.value})]},o))]})})]})})},bhe=({data:e,title:t})=>{const[n,r]=P.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=P.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?m.jsx(kt,{title:t||"Maintenance Status",titleWeight:"semi-bold",className:"h-full",children:m.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:m.jsx(En,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):m.jsx(kt,{title:t||"Maintenance Status",titleWeight:"semi-bold",className:"h-full",children:m.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:Array.isArray(e)&&e.length===0?m.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):m.jsx("div",{className:"relative w-full h-[297px] mt-[20px]",children:m.jsx(Ot,{width:"100%",height:"100%",children:m.jsxs(No,{data:o,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[m.jsx(ur,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),m.jsx(Un,{dataKey:"name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),m.jsx(Ln,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),m.jsx(Dt,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},allowEscapeViewBox:{x:!0,y:!0},content:s=>!s.active||!s.payload||!s.payload.length?null:m.jsx(Pr,{...s,data:o,children:m.jsxs("div",{className:"bg-black rounded-[10px] px-[14px] py-[10px] text-[12px] text-white",children:[m.jsx("div",{className:"mb-[6px] font-semibold",children:s.label}),s.payload.map((l,c)=>{const u=l.color||l.fill||"#fff";return m.jsxs("div",{className:"flex items-center gap-[6px]",children:[m.jsx("span",{className:"w-2 h-2 rounded-full inline-block",style:{backgroundColor:u}}),m.jsx("span",{className:"text-[#D1D3D4]",children:l.name}),m.jsx("span",{className:"text-white font-semibold",children:l.value})]},c)})]})})}),m.jsx(El,{verticalAlign:"bottom",align:"center",onClick:a,content:({payload:s})=>m.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:s.map((l,c)=>m.jsxs("div",{onClick:()=>a({dataKey:l.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[m.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:n[l.dataKey]?"#CBD5E1":l.color}}),m.jsx("span",{style:{fontSize:"12px",color:n[l.dataKey]?"#CBD5E1":"#64748B"},children:l.value})]},c))})}),m.jsx(Kt,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:n.Open}),m.jsx(Kt,{dataKey:"Closed",stackId:"a",fill:"#10B981",hide:n.Closed}),m.jsx(Kt,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:n.Cancelled}),m.jsx(Kt,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:n.OnHold,name:"On-Hold"}),m.jsx(Kt,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:n.InProgress,name:"In Progress"})]})})})})})};function xhe({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 m.jsx(kt,{title:"Patrol Status",className:"h-[362px]",titleWeight:"semi-bold",children:m.jsxs("div",{className:"flex flex-col items-center justify-center",children:[m.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[m.jsx(Ot,{width:"100%",height:"100%",children:m.jsxs(zi,{children:[m.jsx(ai,{data:t,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:t.map((i,o)=>m.jsx(In,{fill:i.color},`cell-${o}`))}),m.jsx(Dt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?m.jsx(Pr,{...i,data:t,children:m.jsx(Fi,{...i})}):null})]})}),m.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[m.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[r,"/",n]}),m.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),m.jsx("div",{className:"flex flex-col w-full text-[14px]",children:t.map((i,o)=>m.jsxs("div",{className:`flex items-center justify-between py-[10px] ${o!==t.length-1?"border-b border-[#F1F5F9]":""}`,children:[m.jsxs("div",{className:"flex items-center gap-[10px]",children:[m.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:i.color}}),m.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.name})]}),m.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.value})]},i.name))})]})})}function whe({incidentReports:e,incidentReportsDetails:t}){const n=Number(e?.open||0),r=Number(e?.in_progress||0),i=Number(e?.closed||0);return m.jsx(kt,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:m.jsxs("div",{children:[m.jsxs("div",{className:"flex w-full text-center gap-[16px] mt-[24px]",children:[m.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FBF4F4] h-[76px] rounded",children:[m.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#AB0000]",children:n}),m.jsx("div",{className:"text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),m.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FFFBF2] h-[76px] rounded",children:[m.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#F2A815]",children:r}),m.jsx("div",{className:"text-[12px] leading-[16px] text-[#F2A815]",children:"In-progress"})]}),m.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#F7FEFA] h-[76px] rounded",children:[m.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:i}),m.jsx("div",{className:"text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),m.jsx("div",{className:"mt-4 space-y-2",children:t?.length>0?t.map((o,a)=>{const s=o?.severity==="Danger"?"text-[#AB0000]":o?.severity==="High"?"text-[#E7A015]":"text-[#1FA05B]";return m.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#FAFBFD] rounded-md",children:[m.jsx("div",{className:"flex items-center gap-[8px]",children:m.jsx("div",{className:"text-gray-700 font-medium",children:o?.incident_code})}),m.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${s}`,children:m.jsxs("div",{children:[o?.severity_level," - ",o?.severity]})})]},a)}):m.jsx(m.Fragment,{})})]})})}function _he({columns:e=[{key:"a",label:"Organisation"},{key:"b",label:"Item"},{key:"c",label:"Closed"},{key:"d",label:"Open"},{key:"e",label:"AOV"},{key:"f",label:"% Revenue"}],data:t=[{a:"Google",b:"Coffee",c:"34,908",d:"₹ 57,21,288",e:"₹ 450",f:"43.6%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"}],rowsPerPage:n=10,setRowsPerPage:r=()=>{},currentPage:i=1,setCurrentPage:o=()=>{},totalRows:a=0,totalPages:s=1,pageOptions:l=[10,20,30,40,50]}){const c=Array.isArray(t)?t:[],u=Array.isArray(e)?e:[],d=n>0?Math.ceil(c.length/n):1,f=s||d,p=c,h=a===0&&c.length===0,g=`repeat(${u.length}, 1fr)`;return m.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:[m.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[m.jsx("div",{className:"grid bg-[#354A5E] text-white text-[16px] leading-[20px] font-medium shrink-0",style:{gridTemplateColumns:g},children:u.map((v,x)=>m.jsx("div",{className:"px-[24px] py-[16px] text-[16px] leading-[20px] whitespace-nowrap text-left",children:v.label},x))}),m.jsx("div",{className:"flex-1 overflow-y-auto hide-scrollbar",children:h?m.jsx(En,{title:"No Data Found",description:"Catch up all the data. Change the date range to see the data."}):p.map((v,x)=>m.jsx("div",{className:"grid",style:{gridTemplateColumns:g},children:u.map((_,w)=>{const y=v[_.key],E=_.label==="Closed",S=_.label==="Open",k=typeof y=="string"&&y.includes("%"),D=y==="100%"?"bg-[#F0FEF2] text-[#36AB6C]":"bg-[#FFF0F0] text-[#AB0000]";return m.jsx("div",{className:`px-[24px] py-[16px] flex items-center justify-start ${w===0?"bg-white":"bg-gray-50"} text-[#121212]`,children:E?m.jsx("div",{className:"text-[14px] font-medium",style:{color:"#36AB6C"},children:y??"-"}):S?m.jsx("div",{className:"text-[14px] font-medium",style:{color:"#AB0000"},children:y??"-"}):k?m.jsx("div",{className:`inline-block px-[12px] py-[4px] rounded-full text-[14px] font-medium ${D}`,children:y}):m.jsx("div",{children:y??"-"})},w)})},x))})]}),m.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:[m.jsxs("div",{className:"flex items-center gap-[8px] text-gray-600 text-[14px]",children:[m.jsx("div",{children:"Rows per page:"}),m.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)=>m.jsx("option",{value:v,children:v},x))}),m.jsxs("div",{className:"ml-4 text-[14px]",children:[c?.length===0?"0–0":`1–${c?.length}`," of"," ",a||c?.length]})]}),m.jsxs("div",{className:"flex items-center space-x-2 text-gray-600 text-[14px]",children:[m.jsx("button",{onClick:()=>o(1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:m.jsx(ife,{size:18})}),m.jsx("button",{onClick:()=>o(v=>v-1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:m.jsx(wI,{size:18})}),m.jsx("button",{onClick:()=>o(v=>v+1),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:m.jsx(_I,{size:18})}),m.jsx("button",{onClick:()=>o(f),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:m.jsx(afe,{size:18})})]})]})]})}const $I=({options:e=[],value:t,onChange:n})=>{const[r,i]=P.useState(!1),o=P.useRef(null);return P.useEffect(()=>{const a=s=>{o.current&&!o.current.contains(s.target)&&i(!1)};return document.addEventListener("mousedown",a),()=>{document.removeEventListener("mousedown",a)}},[]),m.jsxs("div",{ref:o,className:"relative h-[32px]",children:[m.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:[m.jsx("div",{className:"text-[12px] leading-[16px] min-w-[109px] text-[#64748B]",children:t}),m.jsx(efe,{size:16,className:"text-[#64748B]"})]}),r&&m.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)=>m.jsx("div",{className:"px-[12px] py-[8px] text-[14px] text-[#334155] hover:bg-[#F1F5F9] cursor-pointer",onClick:()=>{n(a),i(!1)},children:a},s))})]})},Ehe=({data:e})=>{const[t,n]=P.useState({}),[r,i]=P.useState("Kosmo One"),o=["Kosmo One","Kosmo Two","Kosmo Three"],a=[{name:"L1",Cancelled:55,Open:50,OnHold:20,InProgress:10},{name:"L2",Cancelled:15,Open:15,OnHold:8,InProgress:5},{name:"L3",Cancelled:12,Open:75,OnHold:18,InProgress:7}],s=P.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:a,[e]),l=c=>{const{dataKey:u}=c;n(d=>({...d,[u]:!d[u]}))};return Array.isArray(e)&&e.length===0?m.jsx(kt,{title:"Escalation Level By Building",titleWeight:"semi-bold",className:"h-full",children:m.jsx("div",{className:"w-full h-[362px] flex items-center justify-center",children:m.jsx(En,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):m.jsx(kt,{title:"Escalation Level By Building",titleWeight:"semi-bold",className:"h-[362px]",childrenClassName:"mt-[21px]",rightContent:m.jsx($I,{options:o,value:r,onChange:c=>i(c)}),children:m.jsx("div",{className:"w-full flex items-center justify-center",children:Array.isArray(e)&&e.length===0?m.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):m.jsx("div",{className:"relative w-full h-[261px]",children:m.jsx(Ot,{width:"100%",height:"100%",children:m.jsxs(No,{data:s,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[m.jsx(ur,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),m.jsx(Un,{dataKey:"name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),m.jsx(Ln,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),m.jsx(Dt,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},content:({active:c,payload:u,label:d})=>!c||!u||!u.length?null:m.jsxs("div",{style:{backgroundColor:"#000",borderRadius:"10px",padding:"10px 14px",fontSize:"12px",color:"#fff"},children:[m.jsx("div",{style:{marginBottom:"6px",fontWeight:600},children:d}),u.map((f,p)=>{const h=f.color||f.fill||"#fff";return m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[m.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:h,display:"inline-block"}}),m.jsx("span",{style:{color:"#D1D3D4"},children:f.name}),m.jsx("span",{style:{color:"#fff",fontWeight:600},children:f.value})]},p)})]})}),m.jsx(El,{verticalAlign:"bottom",align:"center",onClick:l,content:({payload:c})=>m.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:c.map((u,d)=>m.jsxs("div",{onClick:()=>l({dataKey:u.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[m.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:t[u.dataKey]?"#CBD5E1":u.color}}),m.jsx("span",{style:{fontSize:"12px",color:t[u.dataKey]?"#CBD5E1":"#64748B"},children:u.value})]},d))})}),m.jsx(Kt,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:t.Open}),m.jsx(Kt,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:t.Cancelled}),m.jsx(Kt,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:t.OnHold,name:"On-Hold"}),m.jsx(Kt,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:t.InProgress,name:"In Progress"})]})})})})})},She=({data:e=[]})=>{const[t,n]=P.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 m.jsx(kt,{title:"Top 5 Tenants by Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-[20px]",rightContent:m.jsx($I,{options:r,value:t,onChange:a=>n(a)}),children:o?m.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:m.jsx(En,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):m.jsx("div",{className:"w-full h-[280px]",children:m.jsx(Ot,{width:"100%",height:"100%",children:m.jsxs(kj,{data:i,margin:{top:10,right:-10,left:-10,bottom:0},children:[m.jsx("defs",{children:m.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[m.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),m.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),m.jsx(ur,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),m.jsx(Un,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:a=>new Date(a).toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}),m.jsx(Ln,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),m.jsx(Dt,{cursor:!1,content:({active:a,payload:s,label:l,coordinate:c})=>{if(!a||!s?.length)return null;const u=new Date(l).toLocaleDateString("en-GB",{day:"2-digit",month:"short"});return m.jsx(Fi,{active:a,payload:s,label:u})}}),m.jsx(Bx,{type:"monotone",dataKey:"no_of_visitors",stroke:"#6366F1",strokeWidth:2,fill:"url(#colorVisitors)",dot:{r:5,stroke:"#6366F1",strokeWidth:2,fill:"#fff"},activeDot:a=>{const{cx:s,cy:l,stroke:c}=a;return m.jsxs("g",{children:[m.jsx("circle",{cx:s,cy:l,r:6,fill:"#fff",stroke:"#6466F1",strokeWidth:2}),m.jsx("circle",{cx:s,cy:l,r:2.5,fill:"#6466F1"})]})}})]})})})})},Ohe=({data:e})=>{const t=[{name:"Kosmo One",total:29,pending:1,cancelled:2},{name:"OWC",total:23,pending:9,cancelled:3},{name:"Exora",total:40,pending:12,cancelled:1},{name:"OIC - T3",total:27,pending:19,cancelled:8}],n=e&&e.length?e:t;return m.jsx(kt,{title:"Building Wise Approvals",titleWeight:"semi-bold",className:"h-full",childrenClassName:"mt-[34px]",children:m.jsxs("div",{className:"w-full border border-[#EBEBEB] rounded-[10px] overflow-hidden",children:[m.jsxs("div",{className:"grid grid-cols-4 bg-[#FAFAFA] px-[12px] py-[8px] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[m.jsx("div",{children:"Tenant"}),m.jsx("div",{className:"flex justify-end",children:"Total"}),m.jsx("div",{className:"flex justify-end",children:"Pending"}),m.jsx("div",{className:"flex justify-end",children:"Cancelled"})]}),m.jsx("div",{className:"max-h-[280px] overflow-y-auto hide-scrollbar",children:n.map((r,i)=>m.jsxs("div",{className:"grid grid-cols-4 p-[12px] text-[12px] leading-[16px] border-t border-[#EBEBEB]",children:[m.jsx("div",{className:"text-[#475569]",children:r.name}),m.jsx("div",{className:"flex justify-end text-[#36AB6C] font-[400]",children:r.total}),m.jsx("div",{className:"flex justify-end text-[#F2A815] font-[400]",children:r.pending}),m.jsx("div",{className:"flex justify-end text-[#AB0000] font-[400]",children:r.cancelled})]},i))})]})})},af=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],Che=[{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"}],Phe=({rows:e,totalAssets:t})=>{const n=P.useMemo(()=>e?e.length===0?[]:e.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",color:af[o%af.length]})):Che.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",color:af[o%af.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?m.jsx(kt,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:m.jsx("div",{className:"flex items-center justify-center h-full",children:m.jsx(En,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):m.jsx(kt,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:m.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[m.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[m.jsx(Ot,{width:"100%",height:"100%",children:m.jsx(zi,{children:m.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)=>m.jsx(In,{fill:i.color},o))})})}),m.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[m.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),m.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),m.jsx("div",{className:"flex-1 max-w-[280px]",children:m.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[m.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] bg-[#F8FAFC]",children:[m.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),m.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-center",children:"Count"}),m.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-right",children:"Investment"})]}),m.jsx("div",{className:"max-h-[205px] overflow-y-auto hide-scrollbar",children:n.map((i,o)=>m.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] border-t border-[#F1F5F9]",children:[m.jsxs("div",{className:"flex items-center gap-[8px]",children:[m.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.color}}),m.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),m.jsx("div",{className:"text-[13px] text-[#64748B] text-center",children:i.value}),m.jsx("div",{className:"text-[13px] text-[#64748B] text-right",children:i.investment})]},o))})]})})]})})};exports.AccessPointsUsage=nhe;exports.Accounting=Ode;exports.Amenities=upe;exports.AmenitiesStatsCard=che;exports.AmenityWiseRevenue=ghe;exports.AssetValueBreakdown=Lde;exports.AssetsByType=yhe;exports.BlockWiseOccupancy=yde;exports.BookingTrendChart=hhe;exports.Bookings=fhe;exports.Budgets=Dde;exports.BuildingWiseApprovals=Ohe;exports.Card=Ie;exports.CardAccess=LI;exports.CashBankBalance=Tde;exports.CommercialAccessOverview=the;exports.CommercialGuardPatrols=xhe;exports.CommercialIncidentReports=whe;exports.CommercialOccupancy=ope;exports.CommercialReportTable=_he;exports.Community=eae;exports.Complaints=Mfe;exports.ComplaintsByLevel=Ife;exports.DuesAgeing=Nde;exports.EmployeeFootfall=ape;exports.Engagement=tae;exports.EngagementStatsGrid=ipe;exports.EscalationLevel=Ehe;exports.EventsUtilisation=qfe;exports.ExpenseCategories=Rde;exports.Facilities=nae;exports.FinanceSummary=rae;exports.FoodBeverages=cpe;exports.GateAndSecurityStatsGrid=Dfe;exports.GateUpdates=Hae;exports.GuardPatrols=hfe;exports.Header=s8;exports.Helpdesk=Yae;exports.HelpdeskStatsGrid=Yfe;exports.HourlyTrafficFlow=bfe;exports.IncidentReports=_fe;exports.IncomeExpenditure=bI;exports.MainHeader=x8;exports.MaintenanceStatus=bhe;exports.MetricCard=ohe;exports.MobileAccess=LI;exports.MoveInOutTrends=xde;exports.NoticeBoardStatus=Qfe;exports.OccupancyOverview=mde;exports.OrganisationWiseVisitors=lhe;exports.PortfolioAssetsByType=Phe;exports.RequestBox=$fe;exports.ResidentOverview=vde;exports.RevenuebyCategory=Fde;exports.SingleStats=epe;exports.StaffAttendance=Ofe;exports.StatsGrid=Hde;exports.TenantsByVisitors=She;exports.TicketEscalation=dpe;exports.TicketStatus=Gpe;exports.Tickets=yI;exports.TicketsperCategory=ihe;exports.UnitStatus=yI;exports.VisitorUpdates=ehe;exports.WeeklyVisitorPattern=ahe;
|
|
394
|
+
`,children:[i?m.jsx(rs,{}):m.jsx(ns,{}),Math.abs(r),"%"]}),m.jsx("div",{style:{color:"#64748B"},children:t.deltaLabel})]})]})},n)})})}const uhe=[{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}],dhe=({x:e,y:t,payload:n})=>m.jsx("foreignObject",{x:(e||0)-80,y:(t||0)-18,width:80,height:40,children:m.jsx("div",{className:"text-[12px] leading-[16px] text-[#121212]",style:{width:"80px",whiteSpace:"normal",wordBreak:"break-word",textAlign:"left"},children:n?.value||""})});function fhe({data:e,bar:t}){const n=Array?.isArray(e)&&e?.length===0,i=(e==null?uhe:Array?.isArray(e)?e:[]).map(o=>({...o,name:o.facility_name,color:"#8B5CF6"}));return m.jsx(Ie,{title:"Bookings",icon:m.jsx(lfe,{size:18,className:"text-[#DBB467]"}),className:"h-[288px]",children:m.jsx("div",{className:"w-full h-full flex items-center justify-center",children:n?m.jsx(En,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):m.jsx(Ot,{width:"100%",height:"100%",children:m.jsxs(No,{data:i||[],layout:"vertical",margin:{top:0,right:10,left:-12,bottom:0},children:[m.jsx(Un,{type:"number",allowDecimals:!1,tick:{fill:"#64748B",fontSize:12},axisLine:!0,tickLine:!1}),m.jsx(Ln,{type:"category",dataKey:"facility_name",axisLine:!1,tickLine:!1,width:100,tick:m.jsx(dhe,{})}),m.jsx(Dt,{cursor:{fill:"transparent"},position:{x:300,y:0},allowEscapeViewBox:{x:!0,y:!0},content:o=>o.active?m.jsx(Pr,{...o,data:i,children:m.jsx(Fi,{...o})}):null}),m.jsx(Kt,{dataKey:"total_booking",barSize:40,fill:t||"#8B5CF6"})]})})})})}const phe=[{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 hhe({data:e}){const t=Array.isArray(e)&&e?.length===0,n=e==null?phe:Array.isArray(e)?e:[];return m.jsx(kt,{title:"Booking Trend by Organisation",titleWeight:"semi-bold",className:"h-[362px]",children:m.jsx("div",{className:"w-full h-[265px] mt-[28px] flex items-center justify-center",children:t?m.jsx(En,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):m.jsx(Ot,{width:"100%",height:"100%",children:m.jsxs(No,{data:n||[],margin:{top:0,right:0,left:-30,bottom:0},children:[m.jsx(ur,{strokeDasharray:"3 3",vertical:!1,stroke:"#E5E7EB"}),m.jsx(Un,{dataKey:"building_name",axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12}}),m.jsx(Ln,{allowDecimals:!1,axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12},tickFormatter:r=>`${r??0}`}),m.jsx(Dt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:r=>r.active?m.jsx(Pr,{...r,data:n,children:m.jsx(Fi,{...r})}):null}),m.jsx(Kt,{dataKey:"no_of_booking",barSize:54,fill:"#12B981"})]})})})})}const mhe=[{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"}],rf=["#3C81F6","#60A5FA","#95BFFA","#BEDAFE","#DAE6FC"];function ghe({data:e,currencyType:t}){const n=Array?.isArray(e)&&e?.length===0,r=e??mhe,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 m.jsx(kt,{title:"Amenity Wise Revenue",titleWeight:"semi-bold",className:"h-[362px]",children:m.jsx("div",{className:"grid grid-cols-12 gap-[24px] items-center h-full mt-[16px]",children:n?m.jsx("div",{className:"col-span-12 flex items-center justify-center h-[240px]",children:m.jsx(En,{title:"No Amenity Found",description:"Catch up all the data. Change the date range to see the data."})}):m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"col-span-6 h-[240px] w-full max-w-[240px]",children:m.jsx(Ot,{width:"100%",height:"100%",children:m.jsxs(zi,{children:[m.jsx(ai,{data:a||[],dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:95,stroke:"#fff",strokeWidth:1,children:a?.map?.((l,c)=>m.jsx(In,{fill:rf?.[c%rf?.length]},`cell-${c}`))}),m.jsx(Dt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:l=>l.active?m.jsx(Pr,{...l,data:a,children:m.jsx(Fi,{...l,formatter:c=>s(c)})}):null})]})})}),m.jsx("div",{className:"col-span-6",children:m.jsxs("div",{className:"rounded-[12px] !overflow-hidden border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[m.jsxs("div",{className:"grid grid-cols-2 px-[12px] py-[8px] bg-[#EBEBEB] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[m.jsx("div",{children:"Amenity"}),m.jsx("div",{className:"text-right",children:"Revenue"})]}),m.jsx("div",{className:"divide-y divide-[#F1F5F9] max-h-[238px] overflow-y-auto hide-scrollbar",children:i?.map?.((l,c)=>m.jsxs("div",{className:"grid grid-cols-2 px-[16px] py-[16px] text-[14px] text-[#121212]",children:[m.jsxs("div",{className:"flex items-center gap-[12px]",children:[m.jsx("span",{className:"w-[16px] h-[7px]",style:{backgroundColor:rf?.[c%rf?.length]}}),m.jsx("span",{className:"text-[#64748B] text-[12px] leading-[16px]",children:l?.name||"Unknown"})]}),m.jsx("div",{className:"text-right text-[12px] leading-[16px] text-[#64748B]",children:s(l?.value||0)})]},l?.name||c))})]})})]})})})}const of=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],vhe=[{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}],yhe=({rows:e,totalAssets:t})=>{const n=P.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:of[o%of.length]})):vhe.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,fill:of[o%of.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?m.jsx(kt,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:m.jsx("div",{className:"flex items-center justify-center h-full",children:m.jsx(En,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):m.jsx(kt,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:m.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[m.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[m.jsx(Ot,{width:"100%",height:"100%",children:m.jsxs(zi,{children:[m.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)=>m.jsx(In,{fill:i.fill},o))}),m.jsx(Dt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?m.jsx(Pr,{...i,data:n,children:m.jsx(Fi,{...i})}):null})]})}),m.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[m.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),m.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),m.jsx("div",{className:"flex-1 max-w-[280px]",children:m.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[m.jsxs("div",{className:"flex items-center justify-between px-[16px] py-[12px] bg-[#F8FAFC]",children:[m.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),m.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Count"})]}),n.map((i,o)=>m.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:[m.jsxs("div",{className:"flex items-center gap-[8px]",children:[m.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.fill}}),m.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),m.jsx("div",{className:"text-[13px] text-[#64748B]",children:i.value})]},o))]})})]})})},bhe=({data:e,title:t})=>{const[n,r]=P.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=P.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?m.jsx(kt,{title:t||"Maintenance Status",titleWeight:"semi-bold",className:"h-full",children:m.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:m.jsx(En,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):m.jsx(kt,{title:t||"Maintenance Status",titleWeight:"semi-bold",className:"h-full",children:m.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:Array.isArray(e)&&e.length===0?m.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):m.jsx("div",{className:"relative w-full h-[297px] mt-[20px]",children:m.jsx(Ot,{width:"100%",height:"100%",children:m.jsxs(No,{data:o,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[m.jsx(ur,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),m.jsx(Un,{dataKey:"name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),m.jsx(Ln,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),m.jsx(Dt,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},allowEscapeViewBox:{x:!0,y:!0},content:s=>!s.active||!s.payload||!s.payload.length?null:m.jsx(Pr,{...s,data:o,children:m.jsxs("div",{className:"bg-black rounded-[10px] px-[14px] py-[10px] text-[12px] text-white",children:[m.jsx("div",{className:"mb-[6px] font-semibold",children:s.label}),s.payload.map((l,c)=>{const u=l.color||l.fill||"#fff";return m.jsxs("div",{className:"flex items-center gap-[6px]",children:[m.jsx("span",{className:"w-2 h-2 rounded-full inline-block",style:{backgroundColor:u}}),m.jsx("span",{className:"text-[#D1D3D4]",children:l.name}),m.jsx("span",{className:"text-white font-semibold",children:l.value})]},c)})]})})}),m.jsx(El,{verticalAlign:"bottom",align:"center",onClick:a,content:({payload:s})=>m.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:s.map((l,c)=>m.jsxs("div",{onClick:()=>a({dataKey:l.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[m.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:n[l.dataKey]?"#CBD5E1":l.color}}),m.jsx("span",{style:{fontSize:"12px",color:n[l.dataKey]?"#CBD5E1":"#64748B"},children:l.value})]},c))})}),m.jsx(Kt,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:n.Open}),m.jsx(Kt,{dataKey:"Closed",stackId:"a",fill:"#10B981",hide:n.Closed}),m.jsx(Kt,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:n.Cancelled}),m.jsx(Kt,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:n.OnHold,name:"On-Hold"}),m.jsx(Kt,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:n.InProgress,name:"In Progress"})]})})})})})};function xhe({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 m.jsx(kt,{title:"Patrol Status",className:"h-[362px]",titleWeight:"semi-bold",children:m.jsxs("div",{className:"flex flex-col items-center justify-center",children:[m.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[m.jsx(Ot,{width:"100%",height:"100%",children:m.jsxs(zi,{children:[m.jsx(ai,{data:t,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:t.map((i,o)=>m.jsx(In,{fill:i.color},`cell-${o}`))}),m.jsx(Dt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?m.jsx(Pr,{...i,data:t,children:m.jsx(Fi,{...i})}):null})]})}),m.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[m.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px]",children:[r,"/",n]}),m.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),m.jsx("div",{className:"flex flex-col w-full text-[14px]",children:t.map((i,o)=>m.jsxs("div",{className:`flex items-center justify-between py-[10px] ${o!==t.length-1?"border-b border-[#F1F5F9]":""}`,children:[m.jsxs("div",{className:"flex items-center gap-[10px]",children:[m.jsx("div",{className:"inline-block w-[16px] h-[7px]",style:{backgroundColor:i.color}}),m.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.name})]}),m.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:i.value})]},i.name))})]})})}function whe({incidentReports:e,incidentReportsDetails:t}){const n=Number(e?.open||0),r=Number(e?.in_progress||0),i=Number(e?.closed||0);return m.jsx(kt,{title:"Incident Reports",className:"h-[362px]",titleWeight:"semi-bold",children:m.jsxs("div",{children:[m.jsxs("div",{className:"flex w-full text-center gap-[16px] mt-[24px]",children:[m.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FBF4F4] h-[76px] rounded",children:[m.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#AB0000]",children:n}),m.jsx("div",{className:"text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),m.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#FFFBF2] h-[76px] rounded",children:[m.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#F2A815]",children:r}),m.jsx("div",{className:"text-[12px] leading-[16px] text-[#F2A815]",children:"In-progress"})]}),m.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#F7FEFA] h-[76px] rounded",children:[m.jsx("div",{className:"text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:i}),m.jsx("div",{className:"text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),m.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 m.jsxs("div",{className:"flex items-center justify-between p-[12px] bg-[#FAFBFD] rounded-md",children:[m.jsx("div",{className:"flex items-center gap-[8px]",children:m.jsx("div",{className:"text-gray-700 font-medium",children:o?.incident_reporting_id})}),m.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${s}`,children:m.jsxs("div",{children:[o?.escalation_value," - ",o?.escalation_level]})})]},a)}):m.jsx(m.Fragment,{})})]})})}function _he({columns:e=[{key:"a",label:"Organisation"},{key:"b",label:"Item"},{key:"c",label:"Closed"},{key:"d",label:"Open"},{key:"e",label:"AOV"},{key:"f",label:"% Revenue"}],data:t=[{a:"Google",b:"Coffee",c:"34,908",d:"₹ 57,21,288",e:"₹ 450",f:"43.6%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"}],rowsPerPage:n=10,setRowsPerPage:r=()=>{},currentPage:i=1,setCurrentPage:o=()=>{},totalRows:a=0,totalPages:s=1,pageOptions:l=[10,20,30,40,50]}){const c=Array.isArray(t)?t:[],u=Array.isArray(e)?e:[],d=n>0?Math.ceil(c.length/n):1,f=s||d,p=c,h=a===0&&c.length===0,g=`repeat(${u.length}, 1fr)`;return m.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:[m.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[m.jsx("div",{className:"grid bg-[#354A5E] text-white text-[16px] leading-[20px] font-medium shrink-0",style:{gridTemplateColumns:g},children:u.map((v,x)=>m.jsx("div",{className:"px-[24px] py-[16px] text-[16px] leading-[20px] whitespace-nowrap text-left",children:v.label},x))}),m.jsx("div",{className:"flex-1 overflow-y-auto hide-scrollbar",children:h?m.jsx(En,{title:"No Data Found",description:"Catch up all the data. Change the date range to see the data."}):p.map((v,x)=>m.jsx("div",{className:"grid",style:{gridTemplateColumns:g},children:u.map((_,w)=>{const y=v[_.key],E=_.label==="Closed",S=_.label==="Open",k=typeof y=="string"&&y.includes("%"),D=y==="100%"?"bg-[#F0FEF2] text-[#36AB6C]":"bg-[#FFF0F0] text-[#AB0000]";return m.jsx("div",{className:`px-[24px] py-[16px] flex items-center justify-start ${w===0?"bg-white":"bg-gray-50"} text-[#121212]`,children:E?m.jsx("div",{className:"text-[14px] font-medium",style:{color:"#36AB6C"},children:y??"-"}):S?m.jsx("div",{className:"text-[14px] font-medium",style:{color:"#AB0000"},children:y??"-"}):k?m.jsx("div",{className:`inline-block px-[12px] py-[4px] rounded-full text-[14px] font-medium ${D}`,children:y}):m.jsx("div",{children:y??"-"})},w)})},x))})]}),m.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:[m.jsxs("div",{className:"flex items-center gap-[8px] text-gray-600 text-[14px]",children:[m.jsx("div",{children:"Rows per page:"}),m.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)=>m.jsx("option",{value:v,children:v},x))}),m.jsxs("div",{className:"ml-4 text-[14px]",children:[c?.length===0?"0–0":`1–${c?.length}`," of"," ",a||c?.length]})]}),m.jsxs("div",{className:"flex items-center space-x-2 text-gray-600 text-[14px]",children:[m.jsx("button",{onClick:()=>o(1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:m.jsx(ife,{size:18})}),m.jsx("button",{onClick:()=>o(v=>v-1),disabled:i===1,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:m.jsx(wI,{size:18})}),m.jsx("button",{onClick:()=>o(v=>v+1),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:m.jsx(_I,{size:18})}),m.jsx("button",{onClick:()=>o(f),disabled:i===f,className:"p-[8px] rounded hover:bg-gray-100 disabled:opacity-40",children:m.jsx(afe,{size:18})})]})]})]})}const $I=({options:e=[],value:t,onChange:n})=>{const[r,i]=P.useState(!1),o=P.useRef(null);return P.useEffect(()=>{const a=s=>{o.current&&!o.current.contains(s.target)&&i(!1)};return document.addEventListener("mousedown",a),()=>{document.removeEventListener("mousedown",a)}},[]),m.jsxs("div",{ref:o,className:"relative h-[32px]",children:[m.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:[m.jsx("div",{className:"text-[12px] leading-[16px] min-w-[109px] text-[#64748B]",children:t}),m.jsx(efe,{size:16,className:"text-[#64748B]"})]}),r&&m.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)=>m.jsx("div",{className:"px-[12px] py-[8px] text-[14px] text-[#334155] hover:bg-[#F1F5F9] cursor-pointer",onClick:()=>{n(a),i(!1)},children:a},s))})]})},Ehe=({data:e})=>{const[t,n]=P.useState({}),[r,i]=P.useState("Kosmo One"),o=["Kosmo One","Kosmo Two","Kosmo Three"],a=[{name:"L1",Cancelled:55,Open:50,OnHold:20,InProgress:10},{name:"L2",Cancelled:15,Open:15,OnHold:8,InProgress:5},{name:"L3",Cancelled:12,Open:75,OnHold:18,InProgress:7}],s=P.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:a,[e]),l=c=>{const{dataKey:u}=c;n(d=>({...d,[u]:!d[u]}))};return Array.isArray(e)&&e.length===0?m.jsx(kt,{title:"Escalation Level By Building",titleWeight:"semi-bold",className:"h-full",children:m.jsx("div",{className:"w-full h-[362px] flex items-center justify-center",children:m.jsx(En,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):m.jsx(kt,{title:"Escalation Level By Building",titleWeight:"semi-bold",className:"h-[362px]",childrenClassName:"mt-[21px]",rightContent:m.jsx($I,{options:o,value:r,onChange:c=>i(c)}),children:m.jsx("div",{className:"w-full flex items-center justify-center",children:Array.isArray(e)&&e.length===0?m.jsx("div",{className:"text-[#94A3B8] text-sm",children:"No Data Found"}):m.jsx("div",{className:"relative w-full h-[261px]",children:m.jsx(Ot,{width:"100%",height:"100%",children:m.jsxs(No,{data:s,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[m.jsx(ur,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),m.jsx(Un,{dataKey:"name",tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1}),m.jsx(Ln,{tick:{fill:"#64748B",fontSize:12},axisLine:!1,tickLine:!1,allowDecimals:!1}),m.jsx(Dt,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},content:({active:c,payload:u,label:d})=>!c||!u||!u.length?null:m.jsxs("div",{style:{backgroundColor:"#000",borderRadius:"10px",padding:"10px 14px",fontSize:"12px",color:"#fff"},children:[m.jsx("div",{style:{marginBottom:"6px",fontWeight:600},children:d}),u.map((f,p)=>{const h=f.color||f.fill||"#fff";return m.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[m.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:h,display:"inline-block"}}),m.jsx("span",{style:{color:"#D1D3D4"},children:f.name}),m.jsx("span",{style:{color:"#fff",fontWeight:600},children:f.value})]},p)})]})}),m.jsx(El,{verticalAlign:"bottom",align:"center",onClick:l,content:({payload:c})=>m.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:c.map((u,d)=>m.jsxs("div",{onClick:()=>l({dataKey:u.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[m.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:t[u.dataKey]?"#CBD5E1":u.color}}),m.jsx("span",{style:{fontSize:"12px",color:t[u.dataKey]?"#CBD5E1":"#64748B"},children:u.value})]},d))})}),m.jsx(Kt,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:t.Open}),m.jsx(Kt,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:t.Cancelled}),m.jsx(Kt,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:t.OnHold,name:"On-Hold"}),m.jsx(Kt,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:t.InProgress,name:"In Progress"})]})})})})})},She=({data:e=[]})=>{const[t,n]=P.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 m.jsx(kt,{title:"Top 5 Tenants by Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-[20px]",rightContent:m.jsx($I,{options:r,value:t,onChange:a=>n(a)}),children:o?m.jsx("div",{className:"w-full h-[280px] flex items-center justify-center",children:m.jsx(En,{title:"No Visitors Found",description:"Catch up all the data. Change the date range to see the data."})}):m.jsx("div",{className:"w-full h-[280px]",children:m.jsx(Ot,{width:"100%",height:"100%",children:m.jsxs(kj,{data:i,margin:{top:10,right:-10,left:-10,bottom:0},children:[m.jsx("defs",{children:m.jsxs("linearGradient",{id:"colorVisitors",x1:"0",y1:"0",x2:"0",y2:"1",children:[m.jsx("stop",{offset:"0%",stopColor:"#6366F1",stopOpacity:.25}),m.jsx("stop",{offset:"100%",stopColor:"#6366F1",stopOpacity:0})]})}),m.jsx(ur,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),m.jsx(Un,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:a=>new Date(a).toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}),m.jsx(Ln,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),m.jsx(Dt,{cursor:!1,content:({active:a,payload:s,label:l,coordinate:c})=>{if(!a||!s?.length)return null;const u=new Date(l).toLocaleDateString("en-GB",{day:"2-digit",month:"short"});return m.jsx(Fi,{active:a,payload:s,label:u})}}),m.jsx(Bx,{type:"monotone",dataKey:"no_of_visitors",stroke:"#6366F1",strokeWidth:2,fill:"url(#colorVisitors)",dot:{r:5,stroke:"#6366F1",strokeWidth:2,fill:"#fff"},activeDot:a=>{const{cx:s,cy:l,stroke:c}=a;return m.jsxs("g",{children:[m.jsx("circle",{cx:s,cy:l,r:6,fill:"#fff",stroke:"#6466F1",strokeWidth:2}),m.jsx("circle",{cx:s,cy:l,r:2.5,fill:"#6466F1"})]})}})]})})})})},Ohe=({data:e})=>{const t=[{name:"Kosmo One",total:29,pending:1,cancelled:2},{name:"OWC",total:23,pending:9,cancelled:3},{name:"Exora",total:40,pending:12,cancelled:1},{name:"OIC - T3",total:27,pending:19,cancelled:8}],n=e&&e.length?e:t;return m.jsx(kt,{title:"Building Wise Approvals",titleWeight:"semi-bold",className:"h-full",childrenClassName:"mt-[34px]",children:m.jsxs("div",{className:"w-full border border-[#EBEBEB] rounded-[10px] overflow-hidden",children:[m.jsxs("div",{className:"grid grid-cols-4 bg-[#FAFAFA] px-[12px] py-[8px] text-[12px] leading-[16px] font-semibold text-[#64748B]",children:[m.jsx("div",{children:"Tenant"}),m.jsx("div",{className:"flex justify-end",children:"Total"}),m.jsx("div",{className:"flex justify-end",children:"Pending"}),m.jsx("div",{className:"flex justify-end",children:"Cancelled"})]}),m.jsx("div",{className:"max-h-[280px] overflow-y-auto hide-scrollbar",children:n.map((r,i)=>m.jsxs("div",{className:"grid grid-cols-4 p-[12px] text-[12px] leading-[16px] border-t border-[#EBEBEB]",children:[m.jsx("div",{className:"text-[#475569]",children:r.name}),m.jsx("div",{className:"flex justify-end text-[#36AB6C] font-[400]",children:r.total}),m.jsx("div",{className:"flex justify-end text-[#F2A815] font-[400]",children:r.pending}),m.jsx("div",{className:"flex justify-end text-[#AB0000] font-[400]",children:r.cancelled})]},i))})]})})},af=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],Che=[{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"}],Phe=({rows:e,totalAssets:t})=>{const n=P.useMemo(()=>e?e.length===0?[]:e.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",color:af[o%af.length]})):Che.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",color:af[o%af.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?m.jsx(kt,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:m.jsx("div",{className:"flex items-center justify-center h-full",children:m.jsx(En,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):m.jsx(kt,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:m.jsxs("div",{className:"flex items-center justify-between h-full mt-[16px]",children:[m.jsxs("div",{className:"relative w-[252px] h-[273px]",children:[m.jsx(Ot,{width:"100%",height:"100%",children:m.jsx(zi,{children:m.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)=>m.jsx(In,{fill:i.color},o))})})}),m.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[m.jsx("div",{className:"text-[24px] leading-[33px] font-medium text-[#121212]",children:r}),m.jsx("div",{className:"text-[12px] leading-[17px] text-[#64748B] mt-[2px]",children:"Total Assets"})]})]}),m.jsx("div",{className:"flex-1 max-w-[280px]",children:m.jsxs("div",{className:"rounded-[12px] overflow-hidden bg-white border border-[#E2E8F0] !border-r-1 border-r-[#E2E8F0]! !pr-0 !mr-0",children:[m.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] bg-[#F8FAFC]",children:[m.jsx("div",{className:"text-[12px] font-medium text-[#64748B]",children:"Asset"}),m.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-center",children:"Count"}),m.jsx("div",{className:"text-[12px] font-medium text-[#64748B] text-right",children:"Investment"})]}),m.jsx("div",{className:"max-h-[205px] overflow-y-auto hide-scrollbar",children:n.map((i,o)=>m.jsxs("div",{className:"grid grid-cols-3 px-[16px] py-[12px] border-t border-[#F1F5F9]",children:[m.jsxs("div",{className:"flex items-center gap-[8px]",children:[m.jsx("div",{className:"w-[16px] h-[7px]",style:{backgroundColor:i.color}}),m.jsx("div",{className:"text-[13px] text-[#475569]",children:i.name})]}),m.jsx("div",{className:"text-[13px] text-[#64748B] text-center",children:i.value}),m.jsx("div",{className:"text-[13px] text-[#64748B] text-right",children:i.investment})]},o))})]})})]})})};exports.AccessPointsUsage=nhe;exports.Accounting=Ode;exports.Amenities=upe;exports.AmenitiesStatsCard=che;exports.AmenityWiseRevenue=ghe;exports.AssetValueBreakdown=Lde;exports.AssetsByType=yhe;exports.BlockWiseOccupancy=yde;exports.BookingTrendChart=hhe;exports.Bookings=fhe;exports.Budgets=Dde;exports.BuildingWiseApprovals=Ohe;exports.Card=Ie;exports.CardAccess=LI;exports.CashBankBalance=Tde;exports.CommercialAccessOverview=the;exports.CommercialGuardPatrols=xhe;exports.CommercialIncidentReports=whe;exports.CommercialOccupancy=ope;exports.CommercialReportTable=_he;exports.Community=eae;exports.Complaints=Mfe;exports.ComplaintsByLevel=Ife;exports.DuesAgeing=Nde;exports.EmployeeFootfall=ape;exports.Engagement=tae;exports.EngagementStatsGrid=ipe;exports.EscalationLevel=Ehe;exports.EventsUtilisation=qfe;exports.ExpenseCategories=Rde;exports.Facilities=nae;exports.FinanceSummary=rae;exports.FoodBeverages=cpe;exports.GateAndSecurityStatsGrid=Dfe;exports.GateUpdates=Hae;exports.GuardPatrols=hfe;exports.Header=s8;exports.Helpdesk=Yae;exports.HelpdeskStatsGrid=Yfe;exports.HourlyTrafficFlow=bfe;exports.IncidentReports=_fe;exports.IncomeExpenditure=bI;exports.MainHeader=x8;exports.MaintenanceStatus=bhe;exports.MetricCard=ohe;exports.MobileAccess=LI;exports.MoveInOutTrends=xde;exports.NoticeBoardStatus=Qfe;exports.OccupancyOverview=mde;exports.OrganisationWiseVisitors=lhe;exports.PortfolioAssetsByType=Phe;exports.RequestBox=$fe;exports.ResidentOverview=vde;exports.RevenuebyCategory=Fde;exports.SingleStats=epe;exports.StaffAttendance=Ofe;exports.StatsGrid=Hde;exports.TenantsByVisitors=She;exports.TicketEscalation=dpe;exports.TicketStatus=Gpe;exports.Tickets=yI;exports.TicketsperCategory=ihe;exports.UnitStatus=yI;exports.VisitorUpdates=ehe;exports.WeeklyVisitorPattern=ahe;
|
package/dist/index.es.js
CHANGED
|
@@ -55825,21 +55825,21 @@ function ame({ incidentReports: e, incidentReportsDetails: t }) {
|
|
|
55825
55825
|
] })
|
|
55826
55826
|
] }),
|
|
55827
55827
|
/* @__PURE__ */ m.jsx("div", { className: "mt-4 space-y-2", children: t?.length > 0 ? t.map((o, a) => {
|
|
55828
|
-
const s = o?.
|
|
55828
|
+
const s = o?.escalation_level === "Danger" ? "text-[#AB0000]" : o?.escalation_level === "High" ? "text-[#E7A015]" : "text-[#1FA05B]";
|
|
55829
55829
|
return /* @__PURE__ */ m.jsxs(
|
|
55830
55830
|
"div",
|
|
55831
55831
|
{
|
|
55832
55832
|
className: "flex items-center justify-between p-[12px] bg-[#FAFBFD] rounded-md",
|
|
55833
55833
|
children: [
|
|
55834
|
-
/* @__PURE__ */ m.jsx("div", { className: "flex items-center gap-[8px]", children: /* @__PURE__ */ m.jsx("div", { className: "text-gray-700 font-medium", children: o?.
|
|
55834
|
+
/* @__PURE__ */ m.jsx("div", { className: "flex items-center gap-[8px]", children: /* @__PURE__ */ m.jsx("div", { className: "text-gray-700 font-medium", children: o?.incident_reporting_id }) }),
|
|
55835
55835
|
/* @__PURE__ */ m.jsx(
|
|
55836
55836
|
"div",
|
|
55837
55837
|
{
|
|
55838
55838
|
className: `!text-[12px] font-semibold flex items-center gap-[4px] ${s}`,
|
|
55839
55839
|
children: /* @__PURE__ */ m.jsxs("div", { children: [
|
|
55840
|
-
o?.
|
|
55840
|
+
o?.escalation_value,
|
|
55841
55841
|
" - ",
|
|
55842
|
-
o?.
|
|
55842
|
+
o?.escalation_level
|
|
55843
55843
|
] })
|
|
55844
55844
|
}
|
|
55845
55845
|
)
|
package/dist/index.umd.js
CHANGED
|
@@ -391,4 +391,4 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
391
391
|
`,`1) content: element.innerHTML
|
|
392
392
|
`,"2) content: () => element.cloneNode(true)"].join(" "))}var s=i.reduce(function(l,c){var u=c&&mpe(c,r);return u&&l.push(u),l},[]);return Xu(e)?s[0]:s}Zu.defaultProps=Pr,Zu.setDefaultProps=dpe,Zu.currentInput=Ui,Object.assign({},sx,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),Zu.setDefaultProps({render:kR});function DR(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var AR=typeof window<"u"&&typeof document<"u";function j1(e,t){e&&(typeof e=="function"&&e(t),{}.hasOwnProperty.call(e,"current")&&(e.current=t))}function TR(){return AR&&document.createElement("div")}function gpe(e){var t={"data-placement":e.placement};return e.referenceHidden&&(t["data-reference-hidden"]=""),e.escaped&&(t["data-escaped"]=""),t}function MR(e,t){if(e===t)return!0;if(typeof e=="object"&&e!=null&&typeof t=="object"&&t!=null){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(t.hasOwnProperty(n)){if(!MR(e[n],t[n]))return!1}else return!1;return!0}else return!1}function vpe(e){var t=[];return e.forEach(function(n){t.find(function(r){return MR(n,r)})||t.push(n)}),t}function ype(e,t){var n,r;return Object.assign({},t,{popperOptions:Object.assign({},e.popperOptions,t.popperOptions,{modifiers:vpe([].concat(((n=e.popperOptions)==null?void 0:n.modifiers)||[],((r=t.popperOptions)==null?void 0:r.modifiers)||[]))})})}var I1=AR?P.useLayoutEffect:P.useEffect;function bpe(e){var t=P.useRef();return t.current||(t.current=typeof e=="function"?e():e),t.current}function NR(e,t,n){n.split(/\s+/).forEach(function(r){r&&e.classList[t](r)})}var xpe={name:"className",defaultValue:"",fn:function(t){var n=t.popper.firstElementChild,r=function(){var s;return!!((s=t.props.render)!=null&&s.$$tippy)};function i(){if(t.props.className&&!r()){process.env.NODE_ENV!=="production"&&console.warn(["@tippyjs/react: Cannot use `className` prop in conjunction with","`render` prop. Place the className on the element you are","rendering."].join(" "));return}NR(n,"add",t.props.className)}function o(){r()&&NR(n,"remove",t.props.className)}return{onCreate:i,onBeforeUpdate:o,onAfterUpdate:i}}};function wpe(e){function t(n){var r=n.children,i=n.content,o=n.visible,a=n.singleton,s=n.render,l=n.reference,c=n.disabled,u=c===void 0?!1:c,d=n.ignoreAttributes,f=d===void 0?!0:d;n.__source,n.__self;var p=DR(n,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),m=o!==void 0,g=a!==void 0,v=P.useState(!1),x=v[0],_=v[1],w=P.useState({}),y=w[0],E=w[1],S=P.useState(),k=S[0],D=S[1],T=bpe(function(){return{container:TR(),renders:1}}),I=Object.assign({ignoreAttributes:f},p,{content:T.container});m&&(process.env.NODE_ENV!=="production"&&["trigger","hideOnClick","showOnCreate"].forEach(function(M){I[M]!==void 0&&console.warn(["@tippyjs/react: Cannot specify `"+M+"` prop in","controlled mode (`visible` prop)"].join(" "))}),I.trigger="manual",I.hideOnClick=!1),g&&(u=!0);var A=I,C=I.plugins||[];s&&(A=Object.assign({},I,{plugins:g&&a.data!=null?[].concat(C,[{fn:function(){return{onTrigger:function($,B){var z=a.data.children.find(function(V){var W=V.instance;return W.reference===B.currentTarget});$.state.$$activeSingletonInstance=z.instance,D(z.content)}}}}]):C,render:function(){return{popper:T.container}}}));var N=[l].concat(r?[r.type]:[]);return I1(function(){var M=l;l&&l.hasOwnProperty("current")&&(M=l.current);var j=e(M||T.ref||TR(),Object.assign({},A,{plugins:[xpe].concat(I.plugins||[])}));return T.instance=j,u&&j.disable(),o&&j.show(),g&&a.hook({instance:j,content:i,props:A,setSingletonContent:D}),_(!0),function(){j.destroy(),a?.cleanup(j)}},N),I1(function(){var M;if(T.renders===1){T.renders++;return}var j=T.instance;j.setProps(ype(j.props,A)),(M=j.popperInstance)==null||M.forceUpdate(),u?j.disable():j.enable(),m&&(o?j.show():j.hide()),g&&a.hook({instance:j,content:i,props:A,setSingletonContent:D})}),I1(function(){var M;if(s){var j=T.instance;j.setProps({popperOptions:Object.assign({},j.props.popperOptions,{modifiers:[].concat((((M=j.props.popperOptions)==null?void 0:M.modifiers)||[]).filter(function($){var B=$.name;return B!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(B){var z,V=B.state,W=(z=V.modifiersData)==null?void 0:z.hide;(y.placement!==V.placement||y.referenceHidden!==W?.isReferenceHidden||y.escaped!==W?.hasPopperEscaped)&&E({placement:V.placement,referenceHidden:W?.isReferenceHidden,escaped:W?.hasPopperEscaped}),V.attributes.popper={}}}])})})}},[y.placement,y.referenceHidden,y.escaped].concat(N)),P.createElement(P.Fragment,null,r?P.cloneElement(r,{ref:function(j){T.ref=j,j1(r.ref,j)}}):null,x&&ci.createPortal(s?s(gpe(y),k,T.instance):i,T.container))}return t}var _pe=(function(e,t){return P.forwardRef(function(r,i){var o=r.children,a=DR(r,["children"]);return P.createElement(e,Object.assign({},t,a),o?P.cloneElement(o,{ref:function(l){j1(i,l),j1(o.ref,l)}}):null)})}),Epe=_pe(wpe(Zu));const kr=({children:e,active:t,payload:n,coordinate:r,data:i,offsetY:o=40})=>!t||!n?.length?null:h.jsx("div",{style:{position:"absolute",transform:`translate(${r.x}px, ${r.y}px)`,pointerEvents:"none",zIndex:99999},children:h.jsx(Epe,{content:e,visible:!0,placement:"right",offset:[0,5],arrow:!0,theme:"custom-black",children:h.jsx("div",{style:{width:0,height:0,background:"black"}})})}),Spe=({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 Ope({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(Og,{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(Et,{width:"100%",height:"100%",children:h.jsxs(Ii,{children:[h.jsx(ni,{data:i,innerRadius:55,outerRadius:85,dataKey:"value",stroke:"#FFFFFF",strokeWidth:2,children:i.map((a,s)=>h.jsx(Nn,{fill:a.color},s))}),h.jsx(Dt,{content:a=>h.jsx(kr,{...a,data:i,children:h.jsx(Spe,{...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 jR={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 Cpe(e){const t=e>=12?"PM":"AM";let n=e%12;return n===0&&(n=12),`${n} ${t}`}function Ppe(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 kpe(e=[]){return Array.from({length:24},(t,n)=>{const r=e.find(i=>Ppe(i?.hour)===n)||{};return{hour:n,time:Cpe(n),walkins:Number(r?.walkins??0),approved:Number(r?.pre_approved??r?.preApproved??r?.approved??0)}})}function IR({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(zN,{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 Dpe({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 Ape({data:e}){const t=e&&Object.keys(e).length?e:jR,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=P.useMemo(()=>{const l=t?.chart_data??[];return kpe(l.length?l:jR.chart_data)},[t]),{yAxisTicks:o,yAxisMax:a}=P.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(Sg,{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(IR,{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(IR,{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(Et,{width:"100%",height:"100%",children:h.jsxs(J0,{data:i??[],margin:{top:5,right:0,left:0,bottom:-10},children:[h.jsx(rr,{stroke:"#E5E7EB",strokeDasharray:"4 4",vertical:!1}),h.jsx(Un,{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(Dt,{content:l=>h.jsx(kr,{...l,data:i,children:h.jsx(Dpe,{...l})})}),h.jsx(la,{type:"monotone",dataKey:"walkins",stroke:"#22C55E",strokeWidth:2,dot:!1,name:"Walk-ins",isAnimationActive:!1}),h.jsx(la,{type:"monotone",dataKey:"approved",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved",isAnimationActive:!1})]})})})]})})}function Tpe({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(At,{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(En,{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(Et,{width:"100%",height:"100%",children:h.jsxs(Ii,{children:[h.jsx(ni,{data:s,dataKey:"value",innerRadius:65,outerRadius:100,startAngle:360,endAngle:-180,paddingAngle:1,stroke:"transparent",children:s.map((c,u)=>h.jsx(Nn,{fill:c.color},u))}),h.jsx(Dt,{content:c=>h.jsx(kr,{...c,data:s,children:h.jsx(Ci,{...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 RR({title:e="Access",data:t=[],height:n="h-[362px]"}){const r=i=>i==null?"0":Number(i).toLocaleString();return h.jsx(At,{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 Mpe({data:e=[]}){const[t,n]=P.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(At,{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(En,{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(Et,{width:"100%",height:"100%",children:h.jsxs(Oo,{data:r,barSize:54,margin:{top:0,right:0,left:-20,bottom:0},children:[h.jsx(rr,{strokeDasharray:"8 8",vertical:!1}),h.jsx(R0,{y:0,stroke:"#EBEBEB"}),h.jsx(Un,{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(Dt,{cursor:!1,content:c=>h.jsx(kr,{...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(Gs,{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(Ut,{dataKey:"entries",stackId:"a",fill:"#329DFF",hide:t.includes("entries")}),h.jsx(Ut,{dataKey:"exit",stackId:"a",fill:"#76BDFF",hide:t.includes("exit")})]})})})})}const Npe=({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 jpe({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(At,{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(Et,{width:"100%",height:"100%",children:h.jsxs(Oo,{data:n,layout:"vertical",margin:{top:0,right:8,left:-20,bottom:0},children:[h.jsx(rr,{strokeDasharray:"3 3",horizontal:!1,stroke:"#E5E7EB"}),h.jsx(Un,{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(Npe,{})}),h.jsx(Dt,{cursor:{fill:"transparent"},position:{x:300,y:0},allowEscapeViewBox:{x:!0,y:!0},content:r=>r.active?h.jsx(kr,{...r,data:n,children:h.jsx(Ci,{...r})}):null}),h.jsx(Ut,{dataKey:"value",barSize:36,fill:"#08B6D4"})]})})}):h.jsx(En,{title:"No Tickets Found",description:"Catch up all the data. Change the date range to see the data."})})}function Ipe({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]",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] 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(Ta,{}):h.jsx(Aa,{}),Math.abs(a),"%"]}),o&&h.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:o})]})]})}const Rpe=({data:e=[],onDateChange:t})=>{const[n,r]=P.useState(new Date),[i,o]=P.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(At,{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(KE,{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(En,{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(Et,{width:"100%",height:"100%",children:h.jsxs(iM,{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(rr,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),h.jsx(Un,{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(Dt,{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(kr,{...v,data:m,children:h.jsx(Ci,{active:x,payload:_,label:y})})}}),h.jsx(V0,{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"})]})}})]})})})]})},Lpe=[{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}],$pe=({data:e,title:t,bar:n})=>{const r=Array.isArray(e)&&e?.length===0,i=e==null?Lpe:Array.isArray(e)?e:[];return h.jsx(At,{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(En,{title:t||"Organisation Wise Visitors",description:"Catch up all the data. Change the date range to see the data."}):h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Oo,{data:i||[],margin:{top:10,right:10,left:10,bottom:-10},barCategoryGap:35,children:[h.jsx(rr,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),h.jsx(Un,{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(Dt,{cursor:!1,content:o=>o.active?h.jsx(kr,{...o,data:i,children:h.jsx(Ci,{...o})}):null}),h.jsx(Ut,{dataKey:"no_of_visitors",name:"Visitors",maxBarSize:55,fill:n||"#3C81F6"})]})})})})};function Fpe({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
|
|
393
393
|
${i?"text-[#1FA05B] bg-[#F7FEFA]":"text-[#E11D48] bg-[#FBF4F4]"}
|
|
394
|
-
`,children:[i?h.jsx(Ta,{}):h.jsx(Aa,{}),Math.abs(r),"%"]}),h.jsx("div",{style:{color:"#64748B"},children:t.deltaLabel})]})]})},n)})})}const Bpe=[{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}],Wpe=({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 Vpe({data:e,bar:t}){const n=Array?.isArray(e)&&e?.length===0,i=(e==null?Bpe:Array?.isArray(e)?e:[]).map(o=>({...o,name:o.facility_name,color:"#8B5CF6"}));return h.jsx(Le,{title:"Bookings",icon:h.jsx(Bde,{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(En,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Oo,{data:i||[],layout:"vertical",margin:{top:0,right:10,left:-12,bottom:0},children:[h.jsx(Un,{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(Wpe,{})}),h.jsx(Dt,{cursor:{fill:"transparent"},position:{x:300,y:0},allowEscapeViewBox:{x:!0,y:!0},content:o=>o.active?h.jsx(kr,{...o,data:i,children:h.jsx(Ci,{...o})}):null}),h.jsx(Ut,{dataKey:"total_booking",barSize:40,fill:t||"#8B5CF6"})]})})})})}const zpe=[{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 Hpe({data:e}){const t=Array.isArray(e)&&e?.length===0,n=e==null?zpe:Array.isArray(e)?e:[];return h.jsx(At,{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(En,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Oo,{data:n||[],margin:{top:0,right:0,left:-30,bottom:0},children:[h.jsx(rr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E5E7EB"}),h.jsx(Un,{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(Dt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:r=>r.active?h.jsx(kr,{...r,data:n,children:h.jsx(Ci,{...r})}):null}),h.jsx(Ut,{dataKey:"no_of_booking",barSize:54,fill:"#12B981"})]})})})})}const Ype=[{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"}],cm=["#3C81F6","#60A5FA","#95BFFA","#BEDAFE","#DAE6FC"];function Upe({data:e,currencyType:t}){const n=Array?.isArray(e)&&e?.length===0,r=e??Ype,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(At,{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(En,{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(Et,{width:"100%",height:"100%",children:h.jsxs(Ii,{children:[h.jsx(ni,{data:a||[],dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:95,stroke:"#fff",strokeWidth:1,children:a?.map?.((l,c)=>h.jsx(Nn,{fill:cm?.[c%cm?.length]},`cell-${c}`))}),h.jsx(Dt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:l=>l.active?h.jsx(kr,{...l,data:a,children:h.jsx(Ci,{...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:cm?.[c%cm?.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))})]})})]})})})}const um=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],Kpe=[{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}],qpe=({rows:e,totalAssets:t})=>{const n=P.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:um[o%um.length]})):Kpe.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,fill:um[o%um.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?h.jsx(At,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx(En,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(At,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",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(Et,{width:"100%",height:"100%",children:h.jsxs(Ii,{children:[h.jsx(ni,{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(Nn,{fill:i.fill},o))}),h.jsx(Dt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?h.jsx(kr,{...i,data:n,children:h.jsx(Ci,{...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))]})})]})})},Gpe=({data:e,title:t})=>{const[n,r]=P.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=P.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(At,{title:t||"Maintenance Status",titleWeight:"semi-bold",className:"h-full",children:h.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:h.jsx(En,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(At,{title:t||"Maintenance Status",titleWeight:"semi-bold",className:"h-full",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 h-[297px] mt-[20px]",children:h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Oo,{data:o,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[h.jsx(rr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),h.jsx(Un,{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(Dt,{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(kr,{...s,data:o,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: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(Gs,{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(Ut,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:n.Open}),h.jsx(Ut,{dataKey:"Closed",stackId:"a",fill:"#10B981",hide:n.Closed}),h.jsx(Ut,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:n.Cancelled}),h.jsx(Ut,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:n.OnHold,name:"On-Hold"}),h.jsx(Ut,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:n.InProgress,name:"In Progress"})]})})})})})};function Xpe({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(At,{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(Et,{width:"100%",height:"100%",children:h.jsxs(Ii,{children:[h.jsx(ni,{data:t,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:t.map((i,o)=>h.jsx(Nn,{fill:i.color},`cell-${o}`))}),h.jsx(Dt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?h.jsx(kr,{...i,data:t,children:h.jsx(Ci,{...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 Qpe({incidentReports:e,incidentReportsDetails:t}){const n=Number(e?.open||0),r=Number(e?.in_progress||0),i=Number(e?.closed||0);return h.jsx(At,{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?.severity==="Danger"?"text-[#AB0000]":o?.severity==="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_code})}),h.jsx("div",{className:`!text-[12px] font-semibold flex items-center gap-[4px] ${s}`,children:h.jsxs("div",{children:[o?.severity_level," - ",o?.severity]})})]},a)}):h.jsx(h.Fragment,{})})]})})}function Zpe({columns:e=[{key:"a",label:"Organisation"},{key:"b",label:"Item"},{key:"c",label:"Closed"},{key:"d",label:"Open"},{key:"e",label:"AOV"},{key:"f",label:"% Revenue"}],data:t=[{a:"Google",b:"Coffee",c:"34,908",d:"₹ 57,21,288",e:"₹ 450",f:"43.6%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"}],rowsPerPage:n=10,setRowsPerPage:r=()=>{},currentPage:i=1,setCurrentPage:o=()=>{},totalRows:a=0,totalPages:s=1,pageOptions:l=[10,20,30,40,50]}){const c=Array.isArray(t)?t:[],u=Array.isArray(e)?e:[],d=n>0?Math.ceil(c.length/n):1,f=s||d,p=c,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.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[h.jsx("div",{className:"grid bg-[#354A5E] text-white text-[16px] leading-[20px] font-medium shrink-0",style:{gridTemplateColumns:g},children:u.map((v,x)=>h.jsx("div",{className:"px-[24px] py-[16px] text-[16px] leading-[20px] whitespace-nowrap text-left",children:v.label},x))}),h.jsx("div",{className:"flex-1 overflow-y-auto hide-scrollbar",children:m?h.jsx(En,{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",k=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 justify-start ${w===0?"bg-white":"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??"-"}):k?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($de,{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(nR,{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(rR,{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(Fde,{size:18})})]})]})]})}const LR=({options:e=[],value:t,onChange:n})=>{const[r,i]=P.useState(!1),o=P.useRef(null);return P.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(Lde,{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))})]})},Jpe=({data:e})=>{const[t,n]=P.useState({}),[r,i]=P.useState("Kosmo One"),o=["Kosmo One","Kosmo Two","Kosmo Three"],a=[{name:"L1",Cancelled:55,Open:50,OnHold:20,InProgress:10},{name:"L2",Cancelled:15,Open:15,OnHold:8,InProgress:5},{name:"L3",Cancelled:12,Open:75,OnHold:18,InProgress:7}],s=P.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:a,[e]),l=c=>{const{dataKey:u}=c;n(d=>({...d,[u]:!d[u]}))};return Array.isArray(e)&&e.length===0?h.jsx(At,{title:"Escalation Level By Building",titleWeight:"semi-bold",className:"h-full",children:h.jsx("div",{className:"w-full h-[362px] flex items-center justify-center",children:h.jsx(En,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(At,{title:"Escalation Level By Building",titleWeight:"semi-bold",className:"h-[362px]",childrenClassName:"mt-[21px]",rightContent:h.jsx(LR,{options:o,value:r,onChange:c=>i(c)}),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(Et,{width:"100%",height:"100%",children:h.jsxs(Oo,{data:s,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[h.jsx(rr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),h.jsx(Un,{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(Dt,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},content:({active:c,payload:u,label:d})=>!c||!u||!u.length?null:h.jsxs("div",{style:{backgroundColor:"#000",borderRadius:"10px",padding:"10px 14px",fontSize:"12px",color:"#fff"},children:[h.jsx("div",{style:{marginBottom:"6px",fontWeight:600},children:d}),u.map((f,p)=>{const m=f.color||f.fill||"#fff";return h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[h.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:m,display:"inline-block"}}),h.jsx("span",{style:{color:"#D1D3D4"},children:f.name}),h.jsx("span",{style:{color:"#fff",fontWeight:600},children:f.value})]},p)})]})}),h.jsx(Gs,{verticalAlign:"bottom",align:"center",onClick:l,content:({payload:c})=>h.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:c.map((u,d)=>h.jsxs("div",{onClick:()=>l({dataKey:u.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[h.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:t[u.dataKey]?"#CBD5E1":u.color}}),h.jsx("span",{style:{fontSize:"12px",color:t[u.dataKey]?"#CBD5E1":"#64748B"},children:u.value})]},d))})}),h.jsx(Ut,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:t.Open}),h.jsx(Ut,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:t.Cancelled}),h.jsx(Ut,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:t.OnHold,name:"On-Hold"}),h.jsx(Ut,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:t.InProgress,name:"In Progress"})]})})})})})},ehe=({data:e=[]})=>{const[t,n]=P.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(At,{title:"Top 5 Tenants by Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-[20px]",rightContent:h.jsx(LR,{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(En,{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(Et,{width:"100%",height:"100%",children:h.jsxs(iM,{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(rr,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),h.jsx(Un,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:a=>new Date(a).toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}),h.jsx(Rn,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),h.jsx(Dt,{cursor:!1,content:({active:a,payload:s,label:l,coordinate:c})=>{if(!a||!s?.length)return null;const u=new Date(l).toLocaleDateString("en-GB",{day:"2-digit",month:"short"});return h.jsx(Ci,{active:a,payload:s,label:u})}}),h.jsx(V0,{type:"monotone",dataKey:"no_of_visitors",stroke:"#6366F1",strokeWidth:2,fill:"url(#colorVisitors)",dot:{r:5,stroke:"#6366F1",strokeWidth:2,fill:"#fff"},activeDot:a=>{const{cx:s,cy:l,stroke:c}=a;return 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"})]})}})]})})})})},the=({data:e})=>{const t=[{name:"Kosmo One",total:29,pending:1,cancelled:2},{name:"OWC",total:23,pending:9,cancelled:3},{name:"Exora",total:40,pending:12,cancelled:1},{name:"OIC - T3",total:27,pending:19,cancelled:8}],n=e&&e.length?e:t;return h.jsx(At,{title:"Building Wise Approvals",titleWeight:"semi-bold",className:"h-full",childrenClassName:"mt-[34px]",children: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((r,i)=>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:r.name}),h.jsx("div",{className:"flex justify-end text-[#36AB6C] font-[400]",children:r.total}),h.jsx("div",{className:"flex justify-end text-[#F2A815] font-[400]",children:r.pending}),h.jsx("div",{className:"flex justify-end text-[#AB0000] font-[400]",children:r.cancelled})]},i))})]})})},dm=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],nhe=[{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"}],rhe=({rows:e,totalAssets:t})=>{const n=P.useMemo(()=>e?e.length===0?[]:e.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",color:dm[o%dm.length]})):nhe.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",color:dm[o%dm.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?h.jsx(At,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx(En,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(At,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",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(Et,{width:"100%",height:"100%",children:h.jsx(Ii,{children:h.jsx(ni,{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(Nn,{fill:i.color},o))})})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",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:"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.color}}),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))})]})})]})})};ue.AccessPointsUsage=Mpe,ue.Accounting=dde,ue.Amenities=Bfe,ue.AmenitiesStatsCard=Fpe,ue.AmenityWiseRevenue=Upe,ue.AssetValueBreakdown=Ede,ue.AssetsByType=qpe,ue.BlockWiseOccupancy=ide,ue.BookingTrendChart=Hpe,ue.Bookings=Vpe,ue.Budgets=mde,ue.BuildingWiseApprovals=the,ue.Card=Le,ue.CardAccess=RR,ue.CashBankBalance=vde,ue.CommercialAccessOverview=Tpe,ue.CommercialGuardPatrols=Xpe,ue.CommercialIncidentReports=Qpe,ue.CommercialOccupancy=Ife,ue.CommercialReportTable=Zpe,ue.Community=Boe,ue.Complaints=lfe,ue.ComplaintsByLevel=ffe,ue.DuesAgeing=bde,ue.EmployeeFootfall=Rfe,ue.Engagement=Woe,ue.EngagementStatsGrid=jfe,ue.EscalationLevel=Jpe,ue.EventsUtilisation=Sfe,ue.ExpenseCategories=wde,ue.Facilities=Voe,ue.FinanceSummary=zoe,ue.FoodBeverages=Ffe,ue.GateAndSecurityStatsGrid=ofe,ue.GateUpdates=Aae,ue.GuardPatrols=Hde,ue.Header=q3,ue.Helpdesk=Tae,ue.HelpdeskStatsGrid=wfe,ue.HourlyTrafficFlow=Gde,ue.IncidentReports=Zde,ue.IncomeExpenditure=QI,ue.MainHeader=s8,ue.MaintenanceStatus=Gpe,ue.MetricCard=Ipe,ue.MobileAccess=RR,ue.MoveInOutTrends=ade,ue.NoticeBoardStatus=Pfe,ue.OccupancyOverview=tde,ue.OrganisationWiseVisitors=$pe,ue.PortfolioAssetsByType=rhe,ue.RequestBox=hfe,ue.ResidentOverview=rde,ue.RevenuebyCategory=Ode,ue.SingleStats=Afe,ue.StaffAttendance=tfe,ue.StatsGrid=Ade,ue.TenantsByVisitors=ehe,ue.TicketEscalation=Wfe,ue.TicketStatus=Ope,ue.Tickets=qI,ue.TicketsperCategory=jpe,ue.UnitStatus=qI,ue.VisitorUpdates=Ape,ue.WeeklyVisitorPattern=Rpe,Object.defineProperty(ue,Symbol.toStringTag,{value:"Module"})}));
|
|
394
|
+
`,children:[i?h.jsx(Ta,{}):h.jsx(Aa,{}),Math.abs(r),"%"]}),h.jsx("div",{style:{color:"#64748B"},children:t.deltaLabel})]})]})},n)})})}const Bpe=[{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}],Wpe=({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 Vpe({data:e,bar:t}){const n=Array?.isArray(e)&&e?.length===0,i=(e==null?Bpe:Array?.isArray(e)?e:[]).map(o=>({...o,name:o.facility_name,color:"#8B5CF6"}));return h.jsx(Le,{title:"Bookings",icon:h.jsx(Bde,{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(En,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Oo,{data:i||[],layout:"vertical",margin:{top:0,right:10,left:-12,bottom:0},children:[h.jsx(Un,{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(Wpe,{})}),h.jsx(Dt,{cursor:{fill:"transparent"},position:{x:300,y:0},allowEscapeViewBox:{x:!0,y:!0},content:o=>o.active?h.jsx(kr,{...o,data:i,children:h.jsx(Ci,{...o})}):null}),h.jsx(Ut,{dataKey:"total_booking",barSize:40,fill:t||"#8B5CF6"})]})})})})}const zpe=[{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 Hpe({data:e}){const t=Array.isArray(e)&&e?.length===0,n=e==null?zpe:Array.isArray(e)?e:[];return h.jsx(At,{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(En,{title:"No Booking Found",description:"Catch up all the data. Change the date range to see the data."}):h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Oo,{data:n||[],margin:{top:0,right:0,left:-30,bottom:0},children:[h.jsx(rr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E5E7EB"}),h.jsx(Un,{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(Dt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:r=>r.active?h.jsx(kr,{...r,data:n,children:h.jsx(Ci,{...r})}):null}),h.jsx(Ut,{dataKey:"no_of_booking",barSize:54,fill:"#12B981"})]})})})})}const Ype=[{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"}],cm=["#3C81F6","#60A5FA","#95BFFA","#BEDAFE","#DAE6FC"];function Upe({data:e,currencyType:t}){const n=Array?.isArray(e)&&e?.length===0,r=e??Ype,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(At,{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(En,{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(Et,{width:"100%",height:"100%",children:h.jsxs(Ii,{children:[h.jsx(ni,{data:a||[],dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:95,stroke:"#fff",strokeWidth:1,children:a?.map?.((l,c)=>h.jsx(Nn,{fill:cm?.[c%cm?.length]},`cell-${c}`))}),h.jsx(Dt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:l=>l.active?h.jsx(kr,{...l,data:a,children:h.jsx(Ci,{...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:cm?.[c%cm?.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))})]})})]})})})}const um=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],Kpe=[{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}],qpe=({rows:e,totalAssets:t})=>{const n=P.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:um[o%um.length]})):Kpe.map((i,o)=>({name:i.asset_group_name,facility_name:i.asset_group_name,value:i.asset_count||0,fill:um[o%um.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?h.jsx(At,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx(En,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(At,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",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(Et,{width:"100%",height:"100%",children:h.jsxs(Ii,{children:[h.jsx(ni,{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(Nn,{fill:i.fill},o))}),h.jsx(Dt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?h.jsx(kr,{...i,data:n,children:h.jsx(Ci,{...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))]})})]})})},Gpe=({data:e,title:t})=>{const[n,r]=P.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=P.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(At,{title:t||"Maintenance Status",titleWeight:"semi-bold",className:"h-full",children:h.jsx("div",{className:"w-full h-[260px] flex items-center justify-center",children:h.jsx(En,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(At,{title:t||"Maintenance Status",titleWeight:"semi-bold",className:"h-full",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 h-[297px] mt-[20px]",children:h.jsx(Et,{width:"100%",height:"100%",children:h.jsxs(Oo,{data:o,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[h.jsx(rr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),h.jsx(Un,{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(Dt,{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(kr,{...s,data:o,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: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(Gs,{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(Ut,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:n.Open}),h.jsx(Ut,{dataKey:"Closed",stackId:"a",fill:"#10B981",hide:n.Closed}),h.jsx(Ut,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:n.Cancelled}),h.jsx(Ut,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:n.OnHold,name:"On-Hold"}),h.jsx(Ut,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:n.InProgress,name:"In Progress"})]})})})})})};function Xpe({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(At,{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(Et,{width:"100%",height:"100%",children:h.jsxs(Ii,{children:[h.jsx(ni,{data:t,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:t.map((i,o)=>h.jsx(Nn,{fill:i.color},`cell-${o}`))}),h.jsx(Dt,{cursor:!1,allowEscapeViewBox:{x:!0,y:!0},content:i=>i.active?h.jsx(kr,{...i,data:t,children:h.jsx(Ci,{...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 Qpe({incidentReports:e,incidentReportsDetails:t}){const n=Number(e?.open||0),r=Number(e?.in_progress||0),i=Number(e?.closed||0);return h.jsx(At,{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 Zpe({columns:e=[{key:"a",label:"Organisation"},{key:"b",label:"Item"},{key:"c",label:"Closed"},{key:"d",label:"Open"},{key:"e",label:"AOV"},{key:"f",label:"% Revenue"}],data:t=[{a:"Google",b:"Coffee",c:"34,908",d:"₹ 57,21,288",e:"₹ 450",f:"43.6%"},{a:"Uber",b:"Paneer Combo",c:"12,000",d:"₹ 12,00,000",e:"₹ 500",f:"100%"}],rowsPerPage:n=10,setRowsPerPage:r=()=>{},currentPage:i=1,setCurrentPage:o=()=>{},totalRows:a=0,totalPages:s=1,pageOptions:l=[10,20,30,40,50]}){const c=Array.isArray(t)?t:[],u=Array.isArray(e)?e:[],d=n>0?Math.ceil(c.length/n):1,f=s||d,p=c,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.jsxs("div",{className:"flex flex-col flex-1 overflow-hidden",children:[h.jsx("div",{className:"grid bg-[#354A5E] text-white text-[16px] leading-[20px] font-medium shrink-0",style:{gridTemplateColumns:g},children:u.map((v,x)=>h.jsx("div",{className:"px-[24px] py-[16px] text-[16px] leading-[20px] whitespace-nowrap text-left",children:v.label},x))}),h.jsx("div",{className:"flex-1 overflow-y-auto hide-scrollbar",children:m?h.jsx(En,{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",k=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 justify-start ${w===0?"bg-white":"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??"-"}):k?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($de,{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(nR,{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(rR,{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(Fde,{size:18})})]})]})]})}const LR=({options:e=[],value:t,onChange:n})=>{const[r,i]=P.useState(!1),o=P.useRef(null);return P.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(Lde,{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))})]})},Jpe=({data:e})=>{const[t,n]=P.useState({}),[r,i]=P.useState("Kosmo One"),o=["Kosmo One","Kosmo Two","Kosmo Three"],a=[{name:"L1",Cancelled:55,Open:50,OnHold:20,InProgress:10},{name:"L2",Cancelled:15,Open:15,OnHold:8,InProgress:5},{name:"L3",Cancelled:12,Open:75,OnHold:18,InProgress:7}],s=P.useMemo(()=>e?Array.isArray(e)&&e.length===0?[]:e:a,[e]),l=c=>{const{dataKey:u}=c;n(d=>({...d,[u]:!d[u]}))};return Array.isArray(e)&&e.length===0?h.jsx(At,{title:"Escalation Level By Building",titleWeight:"semi-bold",className:"h-full",children:h.jsx("div",{className:"w-full h-[362px] flex items-center justify-center",children:h.jsx(En,{title:"No Maintenance Assets Status Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(At,{title:"Escalation Level By Building",titleWeight:"semi-bold",className:"h-[362px]",childrenClassName:"mt-[21px]",rightContent:h.jsx(LR,{options:o,value:r,onChange:c=>i(c)}),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(Et,{width:"100%",height:"100%",children:h.jsxs(Oo,{data:s,barSize:54,barCategoryGap:"40%",margin:{top:20,right:20,left:-20,bottom:0},children:[h.jsx(rr,{strokeDasharray:"3 3",vertical:!1,stroke:"#E2E8F0"}),h.jsx(Un,{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(Dt,{cursor:{fill:"rgba(148, 163, 184, 0.12)"},content:({active:c,payload:u,label:d})=>!c||!u||!u.length?null:h.jsxs("div",{style:{backgroundColor:"#000",borderRadius:"10px",padding:"10px 14px",fontSize:"12px",color:"#fff"},children:[h.jsx("div",{style:{marginBottom:"6px",fontWeight:600},children:d}),u.map((f,p)=>{const m=f.color||f.fill||"#fff";return h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[h.jsx("span",{style:{width:"8px",height:"8px",borderRadius:"50%",backgroundColor:m,display:"inline-block"}}),h.jsx("span",{style:{color:"#D1D3D4"},children:f.name}),h.jsx("span",{style:{color:"#fff",fontWeight:600},children:f.value})]},p)})]})}),h.jsx(Gs,{verticalAlign:"bottom",align:"center",onClick:l,content:({payload:c})=>h.jsx("div",{className:"flex items-center justify-center gap-[16px] pt-4 flex-wrap",children:c.map((u,d)=>h.jsxs("div",{onClick:()=>l({dataKey:u.dataKey}),className:"flex items-center gap-[8px] cursor-pointer",children:[h.jsx("div",{style:{width:"16px",height:"8px",backgroundColor:t[u.dataKey]?"#CBD5E1":u.color}}),h.jsx("span",{style:{fontSize:"12px",color:t[u.dataKey]?"#CBD5E1":"#64748B"},children:u.value})]},d))})}),h.jsx(Ut,{dataKey:"Open",stackId:"a",fill:"#3B82F6",hide:t.Open}),h.jsx(Ut,{dataKey:"Cancelled",stackId:"a",fill:"#B91C1C",hide:t.Cancelled}),h.jsx(Ut,{dataKey:"OnHold",stackId:"a",fill:"#64748B",hide:t.OnHold,name:"On-Hold"}),h.jsx(Ut,{dataKey:"InProgress",stackId:"a",fill:"#F59E0B",hide:t.InProgress,name:"In Progress"})]})})})})})},ehe=({data:e=[]})=>{const[t,n]=P.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(At,{title:"Top 5 Tenants by Visitors",titleWeight:"semi-bold",className:"h-[360px]",childrenClassName:"mt-[20px]",rightContent:h.jsx(LR,{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(En,{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(Et,{width:"100%",height:"100%",children:h.jsxs(iM,{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(rr,{strokeDasharray:"3 3",vertical:!1,stroke:"#F1F5F9"}),h.jsx(Un,{dataKey:"day",type:"category",scale:"point",padding:{left:20,right:20},tick:{fontSize:12,fill:"#64748B"},axisLine:!0,tickLine:!1,tickFormatter:a=>new Date(a).toLocaleDateString("en-GB",{day:"2-digit",month:"short"})}),h.jsx(Rn,{width:35,tick:{fontSize:12,fill:"#64748B"},axisLine:!1,tickLine:!1,allowDecimals:!1,domain:[0,"dataMax + 2"]}),h.jsx(Dt,{cursor:!1,content:({active:a,payload:s,label:l,coordinate:c})=>{if(!a||!s?.length)return null;const u=new Date(l).toLocaleDateString("en-GB",{day:"2-digit",month:"short"});return h.jsx(Ci,{active:a,payload:s,label:u})}}),h.jsx(V0,{type:"monotone",dataKey:"no_of_visitors",stroke:"#6366F1",strokeWidth:2,fill:"url(#colorVisitors)",dot:{r:5,stroke:"#6366F1",strokeWidth:2,fill:"#fff"},activeDot:a=>{const{cx:s,cy:l,stroke:c}=a;return 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"})]})}})]})})})})},the=({data:e})=>{const t=[{name:"Kosmo One",total:29,pending:1,cancelled:2},{name:"OWC",total:23,pending:9,cancelled:3},{name:"Exora",total:40,pending:12,cancelled:1},{name:"OIC - T3",total:27,pending:19,cancelled:8}],n=e&&e.length?e:t;return h.jsx(At,{title:"Building Wise Approvals",titleWeight:"semi-bold",className:"h-full",childrenClassName:"mt-[34px]",children: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((r,i)=>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:r.name}),h.jsx("div",{className:"flex justify-end text-[#36AB6C] font-[400]",children:r.total}),h.jsx("div",{className:"flex justify-end text-[#F2A815] font-[400]",children:r.pending}),h.jsx("div",{className:"flex justify-end text-[#AB0000] font-[400]",children:r.cancelled})]},i))})]})})},dm=["#8CB33E","#F59E0B","#3B82F6","#06B6D4","#CFCFCF"],nhe=[{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"}],rhe=({rows:e,totalAssets:t})=>{const n=P.useMemo(()=>e?e.length===0?[]:e.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",color:dm[o%dm.length]})):nhe.map((i,o)=>({name:i.asset_group_name,value:i.asset_count||0,investment:i.investment||"-",color:dm[o%dm.length]})),[e]),r=t??n.reduce((i,o)=>i+o.value,0);return e&&e.length===0?h.jsx(At,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",children:h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx(En,{title:"No Assets Found",description:"Catch up all the data. Change the date range to see the data."})})}):h.jsx(At,{title:"Assets by Type",titleWeight:"semi-bold",className:"h-full",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(Et,{width:"100%",height:"100%",children:h.jsx(Ii,{children:h.jsx(ni,{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(Nn,{fill:i.color},o))})})}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",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:"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.color}}),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))})]})})]})})};ue.AccessPointsUsage=Mpe,ue.Accounting=dde,ue.Amenities=Bfe,ue.AmenitiesStatsCard=Fpe,ue.AmenityWiseRevenue=Upe,ue.AssetValueBreakdown=Ede,ue.AssetsByType=qpe,ue.BlockWiseOccupancy=ide,ue.BookingTrendChart=Hpe,ue.Bookings=Vpe,ue.Budgets=mde,ue.BuildingWiseApprovals=the,ue.Card=Le,ue.CardAccess=RR,ue.CashBankBalance=vde,ue.CommercialAccessOverview=Tpe,ue.CommercialGuardPatrols=Xpe,ue.CommercialIncidentReports=Qpe,ue.CommercialOccupancy=Ife,ue.CommercialReportTable=Zpe,ue.Community=Boe,ue.Complaints=lfe,ue.ComplaintsByLevel=ffe,ue.DuesAgeing=bde,ue.EmployeeFootfall=Rfe,ue.Engagement=Woe,ue.EngagementStatsGrid=jfe,ue.EscalationLevel=Jpe,ue.EventsUtilisation=Sfe,ue.ExpenseCategories=wde,ue.Facilities=Voe,ue.FinanceSummary=zoe,ue.FoodBeverages=Ffe,ue.GateAndSecurityStatsGrid=ofe,ue.GateUpdates=Aae,ue.GuardPatrols=Hde,ue.Header=q3,ue.Helpdesk=Tae,ue.HelpdeskStatsGrid=wfe,ue.HourlyTrafficFlow=Gde,ue.IncidentReports=Zde,ue.IncomeExpenditure=QI,ue.MainHeader=s8,ue.MaintenanceStatus=Gpe,ue.MetricCard=Ipe,ue.MobileAccess=RR,ue.MoveInOutTrends=ade,ue.NoticeBoardStatus=Pfe,ue.OccupancyOverview=tde,ue.OrganisationWiseVisitors=$pe,ue.PortfolioAssetsByType=rhe,ue.RequestBox=hfe,ue.ResidentOverview=rde,ue.RevenuebyCategory=Ode,ue.SingleStats=Afe,ue.StaffAttendance=tfe,ue.StatsGrid=Ade,ue.TenantsByVisitors=ehe,ue.TicketEscalation=Wfe,ue.TicketStatus=Ope,ue.Tickets=qI,ue.TicketsperCategory=jpe,ue.UnitStatus=qI,ue.VisitorUpdates=Ape,ue.WeeklyVisitorPattern=Rpe,Object.defineProperty(ue,Symbol.toStringTag,{value:"Module"})}));
|