anarock-widgets 1.0.16 → 1.0.18

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 CHANGED
@@ -196,7 +196,7 @@ Take a look at the reducer(s) handling this action type: ${h.type}.
196
196
  *
197
197
  * This source code is licensed under the MIT license found in the
198
198
  * LICENSE file in the root directory of this source tree.
199
- */var pb;function K8(){return pb||(pb=1,process.env.NODE_ENV!=="production"&&(function(){function e(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=k,r=typeof Object.is=="function"?Object.is:e,n=t.useSyncExternalStore,i=t.useRef,a=t.useEffect,o=t.useMemo,s=t.useDebugValue;Of.useSyncExternalStoreWithSelector=function(l,c,u,f,d){var h=i(null);if(h.current===null){var m={hasValue:!1,value:null};h.current=m}else m=h.current;h=o(function(){function g(w){if(!v){if(v=!0,b=w,w=f(w),d!==void 0&&m.hasValue){var O=m.value;if(d(O,w))return x=O}return x=w}if(O=x,r(b,w))return O;var E=f(w);return d!==void 0&&d(O,E)?(b=w,O):(b=w,x=E)}var v=!1,b,x,S=u===void 0?null:u;return[function(){return g(c())},S===null?void 0:function(){return g(S())}]},[c,u,f,d]);var p=n(l,h[0],h[1]);return a(function(){m.hasValue=!0,m.value=p},[p]),s(p),p},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Of}var mb;function q8(){return mb||(mb=1,process.env.NODE_ENV==="production"?ls.exports=U8():ls.exports=K8()),ls.exports}q8();function Y8(e){e()}function G8(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Y8(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const i=t={callback:r,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!n||e===null||(n=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var gb={notify(){},get:()=>[]};function X8(e,t){let r,n=gb,i=0,a=!1;function o(p){u();const g=n.subscribe(p);let v=!1;return()=>{v||(v=!0,g(),f())}}function s(){n.notify()}function l(){m.onStateChange&&m.onStateChange()}function c(){return a}function u(){i++,r||(r=e.subscribe(l),n=G8())}function f(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=gb)}function d(){a||(a=!0,u())}function h(){a&&(a=!1,f())}const m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:l,isSubscribed:c,trySubscribe:d,tryUnsubscribe:h,getListeners:()=>n};return m}var Z8=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",J8=Z8(),Q8=()=>typeof navigator<"u"&&navigator.product==="ReactNative",ez=Q8(),tz=()=>J8||ez?A.useLayoutEffect:A.useEffect,rz=tz(),nz=Symbol.for("react-redux-context"),iz=typeof globalThis<"u"?globalThis:{};function az(){if(!A.createContext)return{};const e=iz[nz]??=new Map;let t=e.get(A.createContext);return t||(t=A.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(A.createContext,t)),t}var oz=az();function sz(e){const{children:t,context:r,serverState:n,store:i}=e,a=A.useMemo(()=>{const l=X8(i),c={store:i,subscription:l,getServerState:n?()=>n:void 0};if(process.env.NODE_ENV==="production")return c;{const{identityFunctionCheck:u="once",stabilityCheck:f="once"}=e;return Object.assign(c,{stabilityCheck:f,identityFunctionCheck:u})}},[i,n]),o=A.useMemo(()=>i.getState(),[i]);rz(()=>{const{subscription:l}=a;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),o!==i.getState()&&l.notifyNestedSubs(),()=>{l.tryUnsubscribe(),l.onStateChange=void 0}},[a,o]);const s=r||oz;return A.createElement(s.Provider,{value:a},t)}var lz=sz,cz=(e,t)=>t,Kp=N([cz,ue,l2,ft,Q2,an,g$,ct],w$),qp=e=>{var t=e.currentTarget.getBoundingClientRect(),r=t.width/e.currentTarget.offsetWidth,n=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/r),chartY:Math.round((e.clientY-t.top)/n)}},JS=lr("mouseClick"),QS=go();QS.startListening({actionCreator:JS,effect:(e,t)=>{var r=e.payload,n=Kp(t.getState(),qp(r));n?.activeIndex!=null&&t.dispatch(O4({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var Nd=lr("mouseMove"),eO=go();eO.startListening({actionCreator:Nd,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=gp(n,n.tooltip.settings.shared),a=Kp(n,qp(r));i==="axis"&&(a?.activeIndex!=null?t.dispatch(K2({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate})):t.dispatch(U2()))}});var vb={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index"},tO=Qt({name:"rootProps",initialState:vb,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:vb.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className}}}),uz=tO.reducer,{updateOptions:fz}=tO.actions,rO=Qt({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,t)=>t.payload}}),{updatePolarOptions:dz}=rO.actions,hz=rO.reducer,nO=lr("keyDown"),iO=lr("focus"),Yp=go();Yp.startListening({actionCreator:nO,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip,a=e.payload;if(!(a!=="ArrowRight"&&a!=="ArrowLeft"&&a!=="Enter")){var o=Number(vp(i,na(r))),s=an(r);if(a==="Enter"){var l=fl(r,"axis","hover",String(i.index));t.dispatch(Ad({active:!i.active,activeIndex:i.index,activeDataKey:i.dataKey,activeCoordinate:l}));return}var c=m4(r),u=c==="left-to-right"?1:-1,f=a==="ArrowRight"?1:-1,d=o+f*u;if(!(s==null||d>=s.length||d<0)){var h=fl(r,"axis","hover",String(d));t.dispatch(Ad({active:!0,activeIndex:d.toString(),activeDataKey:void 0,activeCoordinate:h}))}}}}});Yp.startListening({actionCreator:iO,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip;if(!i.active&&i.index==null){var a="0",o=fl(r,"axis","hover",String(a));t.dispatch(Ad({activeDataKey:void 0,active:!0,activeIndex:a,activeCoordinate:o}))}}}});var ir=lr("externalEvent"),aO=go();aO.startListening({actionCreator:ir,effect:(e,t)=>{if(e.payload.handler!=null){var r=t.getState(),n={activeCoordinate:o$(r),activeDataKey:nS(r),activeIndex:xn(r),activeLabel:rS(r),activeTooltipIndex:xn(r),isTooltipActive:s$(r)};e.payload.handler(n,e.payload.reactEvent)}}});var pz=N([ra],e=>e.tooltipItemPayloads),mz=N([pz,ko,(e,t,r)=>t,(e,t,r)=>r],(e,t,r,n)=>{var i=e.find(s=>s.settings.dataKey===n);if(i!=null){var{positions:a}=i;if(a!=null){var o=t(a,r);return o}}}),oO=lr("touchMove"),sO=go();sO.startListening({actionCreator:oO,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=gp(n,n.tooltip.settings.shared);if(i==="axis"){var a=Kp(n,qp({clientX:r.touches[0].clientX,clientY:r.touches[0].clientY,currentTarget:r.currentTarget}));a?.activeIndex!=null&&t.dispatch(K2({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate}))}else if(i==="item"){var o,s=r.touches[0],l=document.elementFromPoint(s.clientX,s.clientY);if(!l||!l.getAttribute)return;var c=l.getAttribute(Vw),u=(o=l.getAttribute(Hw))!==null&&o!==void 0?o:void 0,f=mz(t.getState(),c,u);t.dispatch(H2({activeDataKey:u,activeIndex:c,activeCoordinate:f}))}}});var gz=fw({brush:e3,cartesianAxis:N6,chartData:$$,errorBars:Q6,graphicalItems:QF,layout:kj,legend:vD,options:j$,polarAxis:gF,polarOptions:hz,referenceElements:s3,rootProps:uz,tooltip:A4}),vz=function(t){return ej({reducer:gz,preloadedState:t,middleware:r=>r({serializableCheck:!1}).concat([QS.middleware,eO.middleware,Yp.middleware,aO.middleware,sO.middleware]),devTools:En.devToolsEnabled})};function lO(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,i=Ft(),a=k.useRef(null);if(i)return r;a.current==null&&(a.current=vz(t));var o=fh;return A.createElement(lz,{context:o,store:a.current},r)}function cO(e){var{layout:t,width:r,height:n,margin:i}=e,a=et(),o=Ft();return k.useEffect(()=>{o||(a(Ej(t)),a(Pj({width:r,height:n})),a(Aj(i)))},[a,o,t,r,n,i]),null}function uO(e){var t=et();return k.useEffect(()=>{t(fz(e))},[t,e]),null}var yz=["children"];function bz(e,t){if(e==null)return{};var r,n,i=xz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function xz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function wl(){return wl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wl.apply(null,arguments)}var wz={width:"100%",height:"100%"},_z=k.forwardRef((e,t)=>{var r=Kw(),n=qw(),i=Zw();if(!Fi(r)||!Fi(n))return null;var{children:a,otherAttributes:o,title:s,desc:l}=e,c,u;return typeof o.tabIndex=="number"?c=o.tabIndex:c=i?0:void 0,typeof o.role=="string"?u=o.role:u=i?"application":void 0,A.createElement(j1,wl({},o,{title:s,desc:l,role:u,tabIndex:c,width:r,height:n,style:wz,ref:t}),a)}),Sz=e=>{var{children:t}=e,r=G(ac);if(!r)return null;var{width:n,height:i,y:a,x:o}=r;return A.createElement(j1,{width:n,height:i,x:o,y:a},t)},yb=k.forwardRef((e,t)=>{var{children:r}=e,n=bz(e,yz),i=Ft();return i?A.createElement(Sz,null,r):A.createElement(_z,wl({ref:t},n),r)});function Oz(){var e=et(),[t,r]=k.useState(null),n=G(iD);return k.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;Jt(a)&&a!==n&&e(Cj(a))}},[t,e,n]),r}function bb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Az(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bb(Object(r),!0).forEach(function(n){Ez(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ez(e,t,r){return(t=Pz(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Pz(e){var t=Cz(e,"string");return typeof t=="symbol"?t:t+""}function Cz(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var kz=k.forwardRef((e,t)=>{var{children:r,className:n,height:i,onClick:a,onContextMenu:o,onDoubleClick:s,onMouseDown:l,onMouseEnter:c,onMouseLeave:u,onMouseMove:f,onMouseUp:d,onTouchEnd:h,onTouchMove:m,onTouchStart:p,style:g,width:v}=e,b=et(),[x,S]=k.useState(null),[w,O]=k.useState(null);K$();var E=Oz(),C=k.useCallback(V=>{E(V),typeof t=="function"&&t(V),S(V),O(V)},[E,t,S,O]),M=k.useCallback(V=>{b(JS(V)),b(ir({handler:a,reactEvent:V}))},[b,a]),R=k.useCallback(V=>{b(Nd(V)),b(ir({handler:c,reactEvent:V}))},[b,c]),j=k.useCallback(V=>{b(U2()),b(ir({handler:u,reactEvent:V}))},[b,u]),_=k.useCallback(V=>{b(Nd(V)),b(ir({handler:f,reactEvent:V}))},[b,f]),I=k.useCallback(()=>{b(iO())},[b]),D=k.useCallback(V=>{b(nO(V.key))},[b]),L=k.useCallback(V=>{b(ir({handler:o,reactEvent:V}))},[b,o]),W=k.useCallback(V=>{b(ir({handler:s,reactEvent:V}))},[b,s]),H=k.useCallback(V=>{b(ir({handler:l,reactEvent:V}))},[b,l]),te=k.useCallback(V=>{b(ir({handler:d,reactEvent:V}))},[b,d]),Q=k.useCallback(V=>{b(ir({handler:p,reactEvent:V}))},[b,p]),F=k.useCallback(V=>{b(oO(V)),b(ir({handler:m,reactEvent:V}))},[b,m]),U=k.useCallback(V=>{b(ir({handler:h,reactEvent:V}))},[b,h]);return A.createElement(cS.Provider,{value:x},A.createElement(jk.Provider,{value:w},A.createElement("div",{className:he("recharts-wrapper",n),style:Az({position:"relative",cursor:"default",width:v,height:i},g),onClick:M,onContextMenu:L,onDoubleClick:W,onFocus:I,onKeyDown:D,onMouseDown:H,onMouseEnter:R,onMouseLeave:j,onMouseMove:_,onMouseUp:te,onTouchEnd:U,onTouchMove:F,onTouchStart:Q,ref:C},r)))}),Tz=["children","className","width","height","style","compact","title","desc"];function Mz(e,t){if(e==null)return{};var r,n,i=jz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function jz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var fO=k.forwardRef((e,t)=>{var{children:r,className:n,width:i,height:a,style:o,compact:s,title:l,desc:c}=e,u=Mz(e,Tz),f=Dr(u);return s?A.createElement(yb,{otherAttributes:f,title:l,desc:c},r):A.createElement(kz,{className:n,style:o,width:i,height:a,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},A.createElement(yb,{otherAttributes:f,title:l,desc:c,ref:t},A.createElement(c3,null,r)))}),Dz=["width","height"];function Id(){return Id=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Id.apply(null,arguments)}function Nz(e,t){if(e==null)return{};var r,n,i=Iz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Iz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Rz={top:5,right:5,bottom:5,left:5},$z={accessibilityLayer:!0,layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:Rz,reverseStackOrder:!1,syncMethod:"index"},dO=k.forwardRef(function(t,r){var n,i=_t(t.categoricalChartProps,$z),{width:a,height:o}=i,s=Nz(i,Dz);if(!Fi(a)||!Fi(o))return null;var{chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:f,categoricalChartProps:d}=t,h={chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:f,eventEmitter:void 0};return A.createElement(lO,{preloadedState:{options:h},reduxStoreName:(n=d.id)!==null&&n!==void 0?n:l},A.createElement(zS,{chartData:d.data}),A.createElement(cO,{width:a,height:o,layout:i.layout,margin:i.margin}),A.createElement(uO,{accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className}),A.createElement(fO,Id({},s,{width:a,height:o,ref:r})))}),Lz=["axis"],Rd=k.forwardRef((e,t)=>A.createElement(dO,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Lz,tooltipPayloadSearcher:Ap,categoricalChartProps:e,ref:t})),Fz=["axis","item"],Bz=k.forwardRef((e,t)=>A.createElement(dO,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Fz,tooltipPayloadSearcher:Ap,categoricalChartProps:e,ref:t}));function zz(e){var t=et();return k.useEffect(()=>{t(dz(e))},[t,e]),null}var Wz=["width","height","layout"];function $d(){return $d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$d.apply(null,arguments)}function Vz(e,t){if(e==null)return{};var r,n,i=Hz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Hz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Uz={top:5,right:5,bottom:5,left:5},Kz={accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:Uz,reverseStackOrder:!1,syncMethod:"index",layout:"radial"},qz=k.forwardRef(function(t,r){var n,i=_t(t.categoricalChartProps,Kz),{width:a,height:o,layout:s}=i,l=Vz(i,Wz);if(!Fi(a)||!Fi(o))return null;var{chartName:c,defaultTooltipEventType:u,validateTooltipEventTypes:f,tooltipPayloadSearcher:d}=t,h={chartName:c,defaultTooltipEventType:u,validateTooltipEventTypes:f,tooltipPayloadSearcher:d,eventEmitter:void 0};return A.createElement(lO,{preloadedState:{options:h},reduxStoreName:(n=i.id)!==null&&n!==void 0?n:c},A.createElement(zS,{chartData:i.data}),A.createElement(cO,{width:a,height:o,layout:s,margin:i.margin}),A.createElement(uO,{accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className}),A.createElement(zz,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),A.createElement(fO,$d({width:a,height:o},l,{ref:r})))}),Yz=["item"],Gz={layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},Cc=k.forwardRef((e,t)=>{var r=_t(e,Gz);return A.createElement(qz,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:Yz,tooltipPayloadSearcher:Ap,categoricalChartProps:r,ref:t})});function Xz({isStatic:e,data:t}){const r=({value:u})=>{const f=u>=0;return y.jsx("div",{className:`p-1 rounded text-[10px] leading-[14px] font-medium ${f?"bg-[#F7FEFA] text-[#1FA05B]":"bg-[#FFF2F2] text-[#AB0000]"}`,children:f?`+${u}%`:`${u}%`})},n=Number(t?.thisMonthMoveIns??t?.lastMonthMoveIns??0),i=Number(t?.thisMonthMoveOuts??t?.lastMonthMoveOuts??0),a=Number(t?.moveInPercentChange??t?.moveInChange??0),o=Number(t?.moveOutPercentChange??t?.moveOutChange??0),s=[{name:"Move-ins",value:n},{name:"Move-outs",value:i}],l={purple:"#8B5CF6",indigo:"#6366F1"},c=({active:u,payload:f})=>!u||!f||!f.length?null:y.jsx("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:f.map((d,h)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:d.color,marginRight:6}}),d.name,": ",y.jsx("div",{className:"font-semibold",children:d.value})]},h))});return y.jsx(ge,{title:"Community",period:"This Month",icon:y.jsx(eh,{className:"!text-[24px] text-[#329DFF]"}),className:`${e&&"max-h-[184px]"} h-[184px] mb-4 break-inside-avoid`,children:y.jsxs("div",{className:"flex",children:[y.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Move-in/Out Count"}),y.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium !text-[#8B5CF6]",children:n+i})]}),y.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] space-x-1 flex items-center",children:[y.jsx(r,{value:((a+o)/2).toFixed(2)}),y.jsx("div",{className:"whitespace-nowrap",children:"Compared to last month"})]})]}),y.jsx("div",{className:"w-[50%] h-[111px] flex justify-end",children:y.jsx(gi,{width:"75%",height:"100%",children:y.jsxs(Cc,{children:[y.jsxs(Mo,{data:s,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:[y.jsx(jr,{fill:l.purple}),y.jsx(jr,{fill:l.indigo})]}),y.jsx(mi,{content:y.jsx(c,{})})]})})})]})})}function Zz({isStatic:e,data:t}){const r=[{name:"Notice",value:Number(t?.total_notices||0)},{name:"Post",value:Number(t?.total_topics||0)},{name:"Poll",value:Number(t?.total_polls||0)},{name:"Survey",value:Number(t?.total_surveys||0)}],n={Notice:"#8B5CF6",Post:"#22C55E",Poll:"#3B82F6",Survey:"#F59E0B"},i=({active:a,payload:o,label:s})=>!a||!o||!o.length?null:y.jsxs("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:[s&&y.jsx("div",{className:"font-medium mb-1",children:s}),o.map((l,c)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:l.color,marginRight:6}}),l.name,": ",y.jsx("div",{className:"font-semibold",children:l.value})]},c))]});return y.jsx(ge,{title:"Engagement",period:"This Month",icon:y.jsx(b1,{className:"!text-[24px] text-[#DBB467]"}),className:`${e&&"max-h-[303px]"} h-[303px]`,children:y.jsx(gi,{width:"100%",height:"100%",children:y.jsxs(Bz,{data:r,layout:"vertical",margin:{top:4,right:8,left:8,bottom:0},children:[y.jsx(Ac,{stroke:"#e5e7eb",strokeDasharray:"3 3",horizontal:!1}),y.jsx(Pc,{type:"category",dataKey:"name",width:40,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400}}),y.jsx(Ec,{type:"number",axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400}}),y.jsx(mi,{content:y.jsx(i,{}),cursor:{fill:"transparent"}}),y.jsx(FS,{dataKey:"value",barSize:40,isAnimationActive:!1,children:r.map(a=>y.jsx(jr,{fill:n[a.name]},a.name))})]})})})}function Jz(e){if(!e)return 0;const[t,r]=e.split(" ");let[n,i]=t.split(":").map(Number);return r==="PM"&&n!==12&&(n+=12),r==="AM"&&n===12&&(n=0),n*60+i}function Qz(e){let t=Math.floor(e/60);const r=t>=12?"PM":"AM";return t=t%12||12,`${t} ${r}`}function e7(e){const r={};for(let n=0;n<e.length;n++){const i=e[n],a=Jz(i.slot_start_time),o=Math.floor(a/240)*240,s=o+240,l=`${o}-${s}`;r[l]||(r[l]={time:Qz(s),bookings:0,total:0}),r[l].bookings+=Number(i?.slot_bookings||0),r[l].total+=Number(i?.total_slots||0)}return Object.values(r)}function t7({isStatic:e,data:t}){const r=Number(t?.totalBookings||0),n=Number(t?.totalSlots||0),i=Number(t?.utilizationRate||0),a=k.useMemo(()=>t?.slots?.length?e7(t.slots):[],[t]),o=({active:l,payload:c,label:u})=>!l||!c||!c.length?null:y.jsxs("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:[u&&y.jsx("div",{className:"font-medium mb-1",children:u}),c.map((f,d)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:f.color,marginRight:6}}),f.name,": ",y.jsx("div",{className:"font-semibold",children:f.value})]},d))]}),s=a.length>0?Math.max(...a.map(l=>l.total),5):5;return y.jsxs(ge,{title:"Facilities",period:"Today",icon:y.jsx(y1,{className:"!text-[24px] text-[#8B5CF6]"}),className:`${e&&"max-h-[305px]"} h-[305px] mb-4 break-inside-avoid`,children:[y.jsxs("div",{className:"grid grid-cols-3 gap-[24px] mb-[16px]",children:[y.jsxs("div",{className:"flex flex-col gap-[4px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Bookings"}),y.jsx("div",{className:"!m-0 !text-[24px] !leading-[28px] !font-medium text-[#8B5CF6]",children:r})]}),y.jsxs("div",{className:"flex flex-col gap-[4px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Total Slots"}),y.jsx("div",{className:"!m-0 !text-[24px] !leading-[28px] !font-medium text-[#F59E0B]",children:n})]}),y.jsxs("div",{className:"flex flex-col gap-[4px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Utilisation Rate"}),y.jsxs("div",{className:"!m-0 !text-[24px] !leading-[28px] !font-medium !text-[#329DFF]",children:[Number.isFinite(i)?i.toFixed(2):"0.00","%"]})]})]}),y.jsx("div",{className:"w-full h-[150px]",children:y.jsx(gi,{width:"100%",height:"100%",children:y.jsxs(Rd,{data:a,margin:{top:0,right:0,left:0,bottom:0},children:[y.jsx(Ac,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),y.jsx(Ec,{dataKey:"time",tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1}),y.jsx(Pc,{yAxisId:"left",domain:[0,s],tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400},axisLine:!1,tickLine:!1}),y.jsx(mi,{content:y.jsx(o,{})}),y.jsx(yl,{yAxisId:"left",type:"monotone",dataKey:"bookings",name:"Bookings",stroke:"#8B5CF6",strokeWidth:2,dot:!1}),y.jsx(yl,{yAxisId:"left",type:"monotone",dataKey:"total",name:"Total Slots",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",dot:!1})]})})})]})}function r7({data:e}){const t=e?.incomeSummary||{},r=e?.expenditureSummary||{};function n(i){if(i==null||isNaN(i))return"0";const a=Number(i);return a>=1e9?(a/1e9).toFixed(a%1e9===0?0:2)+"B":a>=1e6?(a/1e6).toFixed(a%1e6===0?0:2)+"M":a>=1e3?(a/1e3).toFixed(a%1e3===0?0:2)+"K":a.toFixed(a%1===0?0:2)}return y.jsx(ge,{title:"Income",period:"This Month",icon:y.jsx(bg,{className:"!text-[24px] text-green-600"}),className:"!gap-[16px] break-inside-avoid h-[232px] overflow-hidden",children:y.jsxs("div",{children:[y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mb-2",children:[y.jsx("div",{children:"Opening"}),y.jsx("div",{children:"Income"}),y.jsx("div",{children:"Collection"}),y.jsx("div",{children:"Closing"})]}),y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212] mb-2",children:[y.jsxs("div",{children:[n(t.opening_balance)," AED"]}),y.jsxs("div",{children:[n(t.income)," AED"]}),y.jsxs("div",{children:[n(t.collection)," AED"]}),y.jsxs("div",{children:[n(t.closing_balance)," AED"]})]}),y.jsx("hr",{className:"my-4 border-t border-dashed border-gray-300"}),y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsxs("div",{className:"flex items-center gap-[12px]",children:[y.jsx(bg,{className:"!text-[24px] text-red-600"}),y.jsx("div",{style:{fontWeight:500,fontSize:"16px",lineHeight:"20px"},className:"!my-0 !font-medium !text-[16px] !leading-[20px] !text-[#121212]",children:"Expenditure"})]}),y.jsx("div",{className:"!text-[12px] !leading-[16px] !text-[#64748B]",children:"This Month"})]}),y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mt-4 mb-2",children:[y.jsx("div",{children:"Opening"}),y.jsx("div",{children:"Expenditure"}),y.jsx("div",{children:"Payment"}),y.jsx("div",{children:"Outstanding"})]}),y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212]",children:[y.jsxs("div",{children:[n(r.opening_balance)," AED"]}),y.jsxs("div",{children:[n(r.expenditure)," AED"]}),y.jsxs("div",{children:[n(r.payment)," AED"]}),y.jsxs("div",{children:[n(r.outstanding)," AED"]})]})]})})}function n7(e){const t=e>=12?"PM":"AM";let r=e%12;return r===0&&(r=12),`${r} ${t}`}function i7(e){const r={};for(let n=0;n<e.length;n++){const i=e[n],a=Number(i.hour??0),s=Math.floor(a/4)*4+4,l=s;r[l]||(r[l]={time:n7(s),walkins:0,checkins:0}),r[l].walkins+=Number(i.walkins??0),r[l].checkins+=Number(i.preApproved??0)}return Object.values(r)}function a7({isStatic:e,data:t}){const r={green:"#12B981",amber:"#F69E0A"},n=t?.summary?.activeWalkins||{},i=t?.summary?.preApprovedCheckins||{},a=t?.summary?.staffAttendance||{},o=t?.chart?.length>0?i7(t.chart):[],s=({active:l,payload:c,label:u})=>!l||!c||!c.length?null:y.jsxs("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:[u&&y.jsx("div",{className:"font-medium mb-1",children:u}),c.map((f,d)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:f.color,marginRight:6}}),f.name,": ",y.jsx("div",{className:"font-semibold",children:f.value})]},d))]});return y.jsx(ge,{title:"Gate Updates",period:"Today",icon:y.jsx(w1,{className:"!text-[24px] text-[#37CC6D]"}),className:`${e?"max-h-[303px]":""} h-[251px] mb-4 break-inside-avoid`,children:y.jsxs("div",{children:[y.jsxs("div",{className:"flex flex-wrap gap-x-2 gap-y-2 text-[14px] mb-2",children:[y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B]",children:"Active Walk-ins"}),y.jsxs("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium text-[#1FA05B] flex",children:[n.visitor_in??0,y.jsxs("div",{className:"!m-0 !text-[20px] !leading-[32px] !text-[#64748B]",children:["/",n.total_pass??0]})]})]}),y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B]",children:"Pre-approved Check-ins"}),y.jsxs("div",{className:"!m-0 text-[28px] leading-[32px] font-medium text-[#E7A015] flex",children:[i.expected_pass_scanned??0,y.jsxs("div",{className:"text-[20px] leading-[32px] text-[#64748B]",children:["/",i.total_expected_pass??0]})]})]}),y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B]",children:"Staff Attendance"}),y.jsxs("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium text-[#1FA05B] flex",children:[a.total_in_now??0,y.jsxs("div",{className:"!m-0 !text-[20px] !leading-[32px] !text-[#64748B]",children:["/",a.total_in_today??0]})]})]})]}),y.jsx("div",{className:"w-full h-[200px]",children:y.jsx(gi,{width:"100%",height:"60%",children:y.jsxs(Rd,{data:o,margin:{top:0,right:0,left:0,bottom:0},children:[y.jsx(Ec,{dataKey:"time",tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400}}),y.jsx(Pc,{yAxisId:"left",domain:[0,30],ticks:[0,10,20,30],tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400},axisLine:!1,tickLine:!1,width:25}),y.jsx(Ac,{strokeDasharray:"3 3",stroke:"#f3f4f6"}),y.jsx(mi,{content:y.jsx(s,{})}),y.jsx(yl,{type:"monotone",dataKey:"walkins",stroke:r.green,strokeWidth:2,dot:!1,name:"Walk-ins"}),y.jsx(Rd,{type:"monotone",dataKey:"checkins",stroke:r.amber,strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved"})]})})})]})})}function o7({isStatic:e,data:t}){const r=({value:c})=>{if(c==null||isNaN(c))return null;const u=c>=0;return y.jsx("div",{className:`p-1 rounded text-[10px] leading-[14px] font-medium ${u?"bg-[#F7FEFA] text-[#1FA05B]":"bg-[#FFF2F2] text-[#AB0000]"}`,children:u?`+${c}%`:`${c}%`})},n=[{name:"L1",value:Number(t?.today_L1||0)},{name:"L2",value:Number(t?.today_L2||0)},{name:"L3",value:Number(t?.today_L3||0)},{name:"No Level",value:Number(t?.today_NoLevel||0)}],a=n.reduce((c,u)=>c+u.value,0)===0?[{name:"No Data",value:1}]:n,o=["#1FA05B","#E7A015","#FA7E28","#EF4444","#CBD5E1"],s=({color:c})=>y.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:c,marginRight:"6px"}}),l=({active:c,payload:u})=>!c||!u||!u.length?null:y.jsx("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:u.map((f,d)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx(s,{color:f.color}),f.name,": ",y.jsx("div",{className:"font-semibold",children:f.value})]},d))});return y.jsx(ge,{title:"Helpdesk",period:"Today",icon:y.jsx(pk,{className:"!text-[24px] text-[#FA7E28]"}),className:`${e&&"max-h-[186px]"} h-[186px] mb-4 break-inside-avoid`,children:y.jsxs("div",{className:"flex gap-[12px] h-fit",children:[y.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Open Complaints"}),y.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium text-[#FA7E28]",children:t?.today_open_complaints??0})]}),y.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] space-x-1",children:[y.jsx(r,{value:t?.percent_change}),y.jsx("div",{className:"whitespace-nowrap",children:"Compared to yesterday"})]})]}),y.jsx("div",{className:"w-[50%] h-[110px] flex justify-end",children:y.jsx(gi,{width:"75%",height:"100%",children:y.jsxs(Cc,{children:[y.jsx(Mo,{data:a,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:a.map((c,u)=>y.jsx(jr,{fill:o[u]||"#CBD5E1"},c.name))}),y.jsx(mi,{content:y.jsx(l,{})})]})})})]})})}/*!
199
+ */var pb;function K8(){return pb||(pb=1,process.env.NODE_ENV!=="production"&&(function(){function e(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=k,r=typeof Object.is=="function"?Object.is:e,n=t.useSyncExternalStore,i=t.useRef,a=t.useEffect,o=t.useMemo,s=t.useDebugValue;Of.useSyncExternalStoreWithSelector=function(l,c,u,f,d){var h=i(null);if(h.current===null){var m={hasValue:!1,value:null};h.current=m}else m=h.current;h=o(function(){function g(w){if(!v){if(v=!0,b=w,w=f(w),d!==void 0&&m.hasValue){var O=m.value;if(d(O,w))return x=O}return x=w}if(O=x,r(b,w))return O;var E=f(w);return d!==void 0&&d(O,E)?(b=w,O):(b=w,x=E)}var v=!1,b,x,S=u===void 0?null:u;return[function(){return g(c())},S===null?void 0:function(){return g(S())}]},[c,u,f,d]);var p=n(l,h[0],h[1]);return a(function(){m.hasValue=!0,m.value=p},[p]),s(p),p},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Of}var mb;function q8(){return mb||(mb=1,process.env.NODE_ENV==="production"?ls.exports=U8():ls.exports=K8()),ls.exports}q8();function Y8(e){e()}function G8(){let e=null,t=null;return{clear(){e=null,t=null},notify(){Y8(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const i=t={callback:r,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!n||e===null||(n=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var gb={notify(){},get:()=>[]};function X8(e,t){let r,n=gb,i=0,a=!1;function o(p){u();const g=n.subscribe(p);let v=!1;return()=>{v||(v=!0,g(),f())}}function s(){n.notify()}function l(){m.onStateChange&&m.onStateChange()}function c(){return a}function u(){i++,r||(r=e.subscribe(l),n=G8())}function f(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=gb)}function d(){a||(a=!0,u())}function h(){a&&(a=!1,f())}const m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:l,isSubscribed:c,trySubscribe:d,tryUnsubscribe:h,getListeners:()=>n};return m}var Z8=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",J8=Z8(),Q8=()=>typeof navigator<"u"&&navigator.product==="ReactNative",ez=Q8(),tz=()=>J8||ez?A.useLayoutEffect:A.useEffect,rz=tz(),nz=Symbol.for("react-redux-context"),iz=typeof globalThis<"u"?globalThis:{};function az(){if(!A.createContext)return{};const e=iz[nz]??=new Map;let t=e.get(A.createContext);return t||(t=A.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(A.createContext,t)),t}var oz=az();function sz(e){const{children:t,context:r,serverState:n,store:i}=e,a=A.useMemo(()=>{const l=X8(i),c={store:i,subscription:l,getServerState:n?()=>n:void 0};if(process.env.NODE_ENV==="production")return c;{const{identityFunctionCheck:u="once",stabilityCheck:f="once"}=e;return Object.assign(c,{stabilityCheck:f,identityFunctionCheck:u})}},[i,n]),o=A.useMemo(()=>i.getState(),[i]);rz(()=>{const{subscription:l}=a;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),o!==i.getState()&&l.notifyNestedSubs(),()=>{l.tryUnsubscribe(),l.onStateChange=void 0}},[a,o]);const s=r||oz;return A.createElement(s.Provider,{value:a},t)}var lz=sz,cz=(e,t)=>t,Kp=N([cz,ue,l2,ft,Q2,an,g$,ct],w$),qp=e=>{var t=e.currentTarget.getBoundingClientRect(),r=t.width/e.currentTarget.offsetWidth,n=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/r),chartY:Math.round((e.clientY-t.top)/n)}},JS=lr("mouseClick"),QS=go();QS.startListening({actionCreator:JS,effect:(e,t)=>{var r=e.payload,n=Kp(t.getState(),qp(r));n?.activeIndex!=null&&t.dispatch(O4({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var Nd=lr("mouseMove"),eO=go();eO.startListening({actionCreator:Nd,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=gp(n,n.tooltip.settings.shared),a=Kp(n,qp(r));i==="axis"&&(a?.activeIndex!=null?t.dispatch(K2({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate})):t.dispatch(U2()))}});var vb={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index"},tO=Qt({name:"rootProps",initialState:vb,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:vb.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className}}}),uz=tO.reducer,{updateOptions:fz}=tO.actions,rO=Qt({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,t)=>t.payload}}),{updatePolarOptions:dz}=rO.actions,hz=rO.reducer,nO=lr("keyDown"),iO=lr("focus"),Yp=go();Yp.startListening({actionCreator:nO,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip,a=e.payload;if(!(a!=="ArrowRight"&&a!=="ArrowLeft"&&a!=="Enter")){var o=Number(vp(i,na(r))),s=an(r);if(a==="Enter"){var l=fl(r,"axis","hover",String(i.index));t.dispatch(Ad({active:!i.active,activeIndex:i.index,activeDataKey:i.dataKey,activeCoordinate:l}));return}var c=m4(r),u=c==="left-to-right"?1:-1,f=a==="ArrowRight"?1:-1,d=o+f*u;if(!(s==null||d>=s.length||d<0)){var h=fl(r,"axis","hover",String(d));t.dispatch(Ad({active:!0,activeIndex:d.toString(),activeDataKey:void 0,activeCoordinate:h}))}}}}});Yp.startListening({actionCreator:iO,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip;if(!i.active&&i.index==null){var a="0",o=fl(r,"axis","hover",String(a));t.dispatch(Ad({activeDataKey:void 0,active:!0,activeIndex:a,activeCoordinate:o}))}}}});var ir=lr("externalEvent"),aO=go();aO.startListening({actionCreator:ir,effect:(e,t)=>{if(e.payload.handler!=null){var r=t.getState(),n={activeCoordinate:o$(r),activeDataKey:nS(r),activeIndex:xn(r),activeLabel:rS(r),activeTooltipIndex:xn(r),isTooltipActive:s$(r)};e.payload.handler(n,e.payload.reactEvent)}}});var pz=N([ra],e=>e.tooltipItemPayloads),mz=N([pz,ko,(e,t,r)=>t,(e,t,r)=>r],(e,t,r,n)=>{var i=e.find(s=>s.settings.dataKey===n);if(i!=null){var{positions:a}=i;if(a!=null){var o=t(a,r);return o}}}),oO=lr("touchMove"),sO=go();sO.startListening({actionCreator:oO,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=gp(n,n.tooltip.settings.shared);if(i==="axis"){var a=Kp(n,qp({clientX:r.touches[0].clientX,clientY:r.touches[0].clientY,currentTarget:r.currentTarget}));a?.activeIndex!=null&&t.dispatch(K2({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate}))}else if(i==="item"){var o,s=r.touches[0],l=document.elementFromPoint(s.clientX,s.clientY);if(!l||!l.getAttribute)return;var c=l.getAttribute(Vw),u=(o=l.getAttribute(Hw))!==null&&o!==void 0?o:void 0,f=mz(t.getState(),c,u);t.dispatch(H2({activeDataKey:u,activeIndex:c,activeCoordinate:f}))}}});var gz=fw({brush:e3,cartesianAxis:N6,chartData:$$,errorBars:Q6,graphicalItems:QF,layout:kj,legend:vD,options:j$,polarAxis:gF,polarOptions:hz,referenceElements:s3,rootProps:uz,tooltip:A4}),vz=function(t){return ej({reducer:gz,preloadedState:t,middleware:r=>r({serializableCheck:!1}).concat([QS.middleware,eO.middleware,Yp.middleware,aO.middleware,sO.middleware]),devTools:En.devToolsEnabled})};function lO(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,i=Ft(),a=k.useRef(null);if(i)return r;a.current==null&&(a.current=vz(t));var o=fh;return A.createElement(lz,{context:o,store:a.current},r)}function cO(e){var{layout:t,width:r,height:n,margin:i}=e,a=et(),o=Ft();return k.useEffect(()=>{o||(a(Ej(t)),a(Pj({width:r,height:n})),a(Aj(i)))},[a,o,t,r,n,i]),null}function uO(e){var t=et();return k.useEffect(()=>{t(fz(e))},[t,e]),null}var yz=["children"];function bz(e,t){if(e==null)return{};var r,n,i=xz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function xz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function wl(){return wl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wl.apply(null,arguments)}var wz={width:"100%",height:"100%"},_z=k.forwardRef((e,t)=>{var r=Kw(),n=qw(),i=Zw();if(!Fi(r)||!Fi(n))return null;var{children:a,otherAttributes:o,title:s,desc:l}=e,c,u;return typeof o.tabIndex=="number"?c=o.tabIndex:c=i?0:void 0,typeof o.role=="string"?u=o.role:u=i?"application":void 0,A.createElement(j1,wl({},o,{title:s,desc:l,role:u,tabIndex:c,width:r,height:n,style:wz,ref:t}),a)}),Sz=e=>{var{children:t}=e,r=G(ac);if(!r)return null;var{width:n,height:i,y:a,x:o}=r;return A.createElement(j1,{width:n,height:i,x:o,y:a},t)},yb=k.forwardRef((e,t)=>{var{children:r}=e,n=bz(e,yz),i=Ft();return i?A.createElement(Sz,null,r):A.createElement(_z,wl({ref:t},n),r)});function Oz(){var e=et(),[t,r]=k.useState(null),n=G(iD);return k.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;Jt(a)&&a!==n&&e(Cj(a))}},[t,e,n]),r}function bb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Az(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bb(Object(r),!0).forEach(function(n){Ez(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bb(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ez(e,t,r){return(t=Pz(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Pz(e){var t=Cz(e,"string");return typeof t=="symbol"?t:t+""}function Cz(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var kz=k.forwardRef((e,t)=>{var{children:r,className:n,height:i,onClick:a,onContextMenu:o,onDoubleClick:s,onMouseDown:l,onMouseEnter:c,onMouseLeave:u,onMouseMove:f,onMouseUp:d,onTouchEnd:h,onTouchMove:m,onTouchStart:p,style:g,width:v}=e,b=et(),[x,S]=k.useState(null),[w,O]=k.useState(null);K$();var E=Oz(),C=k.useCallback(V=>{E(V),typeof t=="function"&&t(V),S(V),O(V)},[E,t,S,O]),M=k.useCallback(V=>{b(JS(V)),b(ir({handler:a,reactEvent:V}))},[b,a]),R=k.useCallback(V=>{b(Nd(V)),b(ir({handler:c,reactEvent:V}))},[b,c]),j=k.useCallback(V=>{b(U2()),b(ir({handler:u,reactEvent:V}))},[b,u]),_=k.useCallback(V=>{b(Nd(V)),b(ir({handler:f,reactEvent:V}))},[b,f]),I=k.useCallback(()=>{b(iO())},[b]),D=k.useCallback(V=>{b(nO(V.key))},[b]),L=k.useCallback(V=>{b(ir({handler:o,reactEvent:V}))},[b,o]),W=k.useCallback(V=>{b(ir({handler:s,reactEvent:V}))},[b,s]),H=k.useCallback(V=>{b(ir({handler:l,reactEvent:V}))},[b,l]),te=k.useCallback(V=>{b(ir({handler:d,reactEvent:V}))},[b,d]),Q=k.useCallback(V=>{b(ir({handler:p,reactEvent:V}))},[b,p]),F=k.useCallback(V=>{b(oO(V)),b(ir({handler:m,reactEvent:V}))},[b,m]),U=k.useCallback(V=>{b(ir({handler:h,reactEvent:V}))},[b,h]);return A.createElement(cS.Provider,{value:x},A.createElement(jk.Provider,{value:w},A.createElement("div",{className:he("recharts-wrapper",n),style:Az({position:"relative",cursor:"default",width:v,height:i},g),onClick:M,onContextMenu:L,onDoubleClick:W,onFocus:I,onKeyDown:D,onMouseDown:H,onMouseEnter:R,onMouseLeave:j,onMouseMove:_,onMouseUp:te,onTouchEnd:U,onTouchMove:F,onTouchStart:Q,ref:C},r)))}),Tz=["children","className","width","height","style","compact","title","desc"];function Mz(e,t){if(e==null)return{};var r,n,i=jz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function jz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var fO=k.forwardRef((e,t)=>{var{children:r,className:n,width:i,height:a,style:o,compact:s,title:l,desc:c}=e,u=Mz(e,Tz),f=Dr(u);return s?A.createElement(yb,{otherAttributes:f,title:l,desc:c},r):A.createElement(kz,{className:n,style:o,width:i,height:a,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},A.createElement(yb,{otherAttributes:f,title:l,desc:c,ref:t},A.createElement(c3,null,r)))}),Dz=["width","height"];function Id(){return Id=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Id.apply(null,arguments)}function Nz(e,t){if(e==null)return{};var r,n,i=Iz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Iz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Rz={top:5,right:5,bottom:5,left:5},$z={accessibilityLayer:!0,layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:Rz,reverseStackOrder:!1,syncMethod:"index"},dO=k.forwardRef(function(t,r){var n,i=_t(t.categoricalChartProps,$z),{width:a,height:o}=i,s=Nz(i,Dz);if(!Fi(a)||!Fi(o))return null;var{chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:f,categoricalChartProps:d}=t,h={chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:f,eventEmitter:void 0};return A.createElement(lO,{preloadedState:{options:h},reduxStoreName:(n=d.id)!==null&&n!==void 0?n:l},A.createElement(zS,{chartData:d.data}),A.createElement(cO,{width:a,height:o,layout:i.layout,margin:i.margin}),A.createElement(uO,{accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className}),A.createElement(fO,Id({},s,{width:a,height:o,ref:r})))}),Lz=["axis"],Rd=k.forwardRef((e,t)=>A.createElement(dO,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Lz,tooltipPayloadSearcher:Ap,categoricalChartProps:e,ref:t})),Fz=["axis","item"],Bz=k.forwardRef((e,t)=>A.createElement(dO,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Fz,tooltipPayloadSearcher:Ap,categoricalChartProps:e,ref:t}));function zz(e){var t=et();return k.useEffect(()=>{t(dz(e))},[t,e]),null}var Wz=["width","height","layout"];function $d(){return $d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$d.apply(null,arguments)}function Vz(e,t){if(e==null)return{};var r,n,i=Hz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Hz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var Uz={top:5,right:5,bottom:5,left:5},Kz={accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:Uz,reverseStackOrder:!1,syncMethod:"index",layout:"radial"},qz=k.forwardRef(function(t,r){var n,i=_t(t.categoricalChartProps,Kz),{width:a,height:o,layout:s}=i,l=Vz(i,Wz);if(!Fi(a)||!Fi(o))return null;var{chartName:c,defaultTooltipEventType:u,validateTooltipEventTypes:f,tooltipPayloadSearcher:d}=t,h={chartName:c,defaultTooltipEventType:u,validateTooltipEventTypes:f,tooltipPayloadSearcher:d,eventEmitter:void 0};return A.createElement(lO,{preloadedState:{options:h},reduxStoreName:(n=i.id)!==null&&n!==void 0?n:c},A.createElement(zS,{chartData:i.data}),A.createElement(cO,{width:a,height:o,layout:s,margin:i.margin}),A.createElement(uO,{accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className}),A.createElement(zz,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),A.createElement(fO,$d({width:a,height:o},l,{ref:r})))}),Yz=["item"],Gz={layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},Cc=k.forwardRef((e,t)=>{var r=_t(e,Gz);return A.createElement(qz,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:Yz,tooltipPayloadSearcher:Ap,categoricalChartProps:r,ref:t})});function Xz({isStatic:e,data:t}){const r=({value:u})=>{const f=u>=0;return y.jsx("div",{className:`p-1 rounded text-[10px] leading-[14px] font-medium ${f?"bg-[#F7FEFA] text-[#1FA05B]":"bg-[#FFF2F2] text-[#AB0000]"}`,children:f?`+${u}%`:`${u}%`})},n=Number(t?.thisMonthMoveIns??t?.lastMonthMoveIns??0),i=Number(t?.thisMonthMoveOuts??t?.lastMonthMoveOuts??0),a=Number(t?.moveInPercentChange??t?.moveInChange??0),o=Number(t?.moveOutPercentChange??t?.moveOutChange??0),s=[{name:"Move-ins",value:n},{name:"Move-outs",value:i}],l={purple:"#8B5CF6",indigo:"#6366F1"},c=({active:u,payload:f})=>!u||!f||!f.length?null:y.jsx("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:f.map((d,h)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:d.color,marginRight:6}}),d.name,": ",y.jsx("div",{className:"font-semibold",children:d.value})]},h))});return y.jsx(ge,{title:"Community",period:"This Month",icon:y.jsx(eh,{className:"!text-[24px] text-[#329DFF]"}),className:`${e&&"max-h-[184px]"} h-[184px] mb-4 break-inside-avoid`,children:y.jsxs("div",{className:"flex",children:[y.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Move-in/Out Count"}),y.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium !text-[#8B5CF6]",children:n+i})]}),y.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] space-x-1 flex items-center",children:[y.jsx(r,{value:((a+o)/2).toFixed(2)}),y.jsx("div",{className:"whitespace-nowrap",children:"Compared to last month"})]})]}),y.jsx("div",{className:"w-[50%] h-[111px] flex justify-end",children:y.jsx(gi,{width:"75%",height:"100%",children:y.jsxs(Cc,{children:[y.jsxs(Mo,{data:s,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:[y.jsx(jr,{fill:l.purple}),y.jsx(jr,{fill:l.indigo})]}),y.jsx(mi,{content:y.jsx(c,{})})]})})})]})})}function Zz({isStatic:e,data:t}){const r=[{name:"Notice",value:Number(t?.total_notices||0)},{name:"Post",value:Number(t?.total_topics||0)},{name:"Poll",value:Number(t?.total_polls||0)},{name:"Survey",value:Number(t?.total_surveys||0)}],n={Notice:"#8B5CF6",Post:"#22C55E",Poll:"#3B82F6",Survey:"#F59E0B"},i=({active:a,payload:o,label:s})=>!a||!o||!o.length?null:y.jsxs("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:[s&&y.jsx("div",{className:"font-medium mb-1",children:s}),o.map((l,c)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:l.color,marginRight:6}}),l.name,": ",y.jsx("div",{className:"font-semibold",children:l.value})]},c))]});return y.jsx(ge,{title:"Engagement",period:"This Month",icon:y.jsx(b1,{className:"!text-[24px] text-[#DBB467]"}),className:`${e&&"max-h-[303px]"} h-[303px]`,children:y.jsx(gi,{width:"100%",height:"100%",children:y.jsxs(Bz,{data:r,layout:"vertical",margin:{top:4,right:8,left:8,bottom:0},children:[y.jsx(Ac,{stroke:"#e5e7eb",strokeDasharray:"3 3",horizontal:!1}),y.jsx(Pc,{type:"category",dataKey:"name",width:40,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400}}),y.jsx(Ec,{type:"number",axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400}}),y.jsx(mi,{content:y.jsx(i,{}),cursor:{fill:"transparent"}}),y.jsx(FS,{dataKey:"value",barSize:40,isAnimationActive:!1,children:r.map(a=>y.jsx(jr,{fill:n[a.name]},a.name))})]})})})}function Jz(e){if(!e)return 0;const[t,r]=e.split(" ");let[n,i]=t.split(":").map(Number);return r==="PM"&&n!==12&&(n+=12),r==="AM"&&n===12&&(n=0),n*60+i}function Qz(e){let t=Math.floor(e/60);const r=t>=12?"PM":"AM";return t=t%12||12,`${t} ${r}`}function e7(e){const r={};for(let n=0;n<e.length;n++){const i=e[n],a=Jz(i.slot_start_time),o=Math.floor(a/240)*240,s=o+240,l=`${o}-${s}`;r[l]||(r[l]={time:Qz(s),bookings:0,total:0}),r[l].bookings+=Number(i?.slot_bookings||0),r[l].total+=Number(i?.total_slots||0)}return Object.values(r)}function t7({isStatic:e,data:t}){const r=Number(t?.totalBookings||0),n=Number(t?.totalSlots||0),i=Number(t?.utilizationRate||0),a=k.useMemo(()=>t?.slots?.length?e7(t.slots):[],[t]),o=({active:l,payload:c,label:u})=>!l||!c||!c.length?null:y.jsxs("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:[u&&y.jsx("div",{className:"font-medium mb-1",children:u}),c.map((f,d)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:f.color,marginRight:6}}),f.name,": ",y.jsx("div",{className:"font-semibold",children:f.value})]},d))]}),s=a.length>0?Math.max(...a.map(l=>l.total),5):5;return y.jsxs(ge,{title:"Facilities",period:"Today",icon:y.jsx(y1,{className:"!text-[24px] text-[#8B5CF6]"}),className:`${e&&"max-h-[305px]"} h-[305px] mb-4 break-inside-avoid`,children:[y.jsxs("div",{className:"grid grid-cols-3 gap-[24px] mb-[16px]",children:[y.jsxs("div",{className:"flex flex-col gap-[4px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Bookings"}),y.jsx("div",{className:"!m-0 !text-[24px] !leading-[28px] !font-medium text-[#8B5CF6]",children:r})]}),y.jsxs("div",{className:"flex flex-col gap-[4px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Total Slots"}),y.jsx("div",{className:"!m-0 !text-[24px] !leading-[28px] !font-medium text-[#F59E0B]",children:n})]}),y.jsxs("div",{className:"flex flex-col gap-[4px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Utilisation Rate"}),y.jsxs("div",{className:"!m-0 !text-[24px] !leading-[28px] !font-medium !text-[#329DFF]",children:[Number.isFinite(i)?i.toFixed(2):"0.00","%"]})]})]}),y.jsx("div",{className:"w-full h-[150px]",children:y.jsx(gi,{width:"100%",height:"100%",children:y.jsxs(Rd,{data:a,margin:{top:0,right:0,left:0,bottom:0},children:[y.jsx(Ac,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),y.jsx(Ec,{dataKey:"time",tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1}),y.jsx(Pc,{yAxisId:"left",domain:[0,s],tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400},axisLine:!1,tickLine:!1}),y.jsx(mi,{content:y.jsx(o,{})}),y.jsx(yl,{yAxisId:"left",type:"monotone",dataKey:"bookings",name:"Bookings",stroke:"#8B5CF6",strokeWidth:2,dot:!1}),y.jsx(yl,{yAxisId:"left",type:"monotone",dataKey:"total",name:"Total Slots",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",dot:!1})]})})})]})}function r7({data:e}){const t=e?.incomeSummary||{},r=e?.expenditureSummary||{};function n(i){if(i==null||isNaN(i))return"0";const a=Number(i);return a>=1e9?(a/1e9).toFixed(a%1e9===0?0:2)+"B":a>=1e6?(a/1e6).toFixed(a%1e6===0?0:2)+"M":a>=1e3?(a/1e3).toFixed(a%1e3===0?0:2)+"K":a.toFixed(a%1===0?0:2)}return y.jsx(ge,{title:"Income",period:"This Month",icon:y.jsx(bg,{className:"!text-[24px] text-green-600"}),className:"!gap-[16px] break-inside-avoid h-[232px] overflow-hidden",children:y.jsxs("div",{children:[y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mb-2",children:[y.jsx("div",{children:"Opening"}),y.jsx("div",{children:"Income"}),y.jsx("div",{children:"Collection"}),y.jsx("div",{children:"Closing"})]}),y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212] mb-2",children:[y.jsxs("div",{children:[n(t.opening_balance)," ",t?.currency_type]}),y.jsxs("div",{children:[n(t.income)," ",t?.currency_type]}),y.jsxs("div",{children:[n(t.collection)," ",t?.currency_type]}),y.jsxs("div",{children:[n(t.closing_balance)," ",t?.currency_type]})]}),y.jsx("hr",{className:"my-4 border-t border-dashed border-gray-300"}),y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsxs("div",{className:"flex items-center gap-[12px]",children:[y.jsx(bg,{className:"!text-[24px] text-red-600"}),y.jsx("div",{style:{fontWeight:500,fontSize:"16px",lineHeight:"20px"},className:"!my-0 !font-medium !text-[16px] !leading-[20px] !text-[#121212]",children:"Expenditure"})]}),y.jsx("div",{className:"!text-[12px] !leading-[16px] !text-[#64748B]",children:"This Month"})]}),y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mt-4 mb-2",children:[y.jsx("div",{children:"Opening"}),y.jsx("div",{children:"Expenditure"}),y.jsx("div",{children:"Payment"}),y.jsx("div",{children:"Outstanding"})]}),y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212]",children:[y.jsxs("div",{children:[n(r.opening_balance)," ",r?.currency_type]}),y.jsxs("div",{children:[n(r.expenditure)," ",r?.currency_type]}),y.jsxs("div",{children:[n(r.payment)," ",r?.currency_type]}),y.jsxs("div",{children:[n(r.outstanding)," ",r?.currency_type]})]})]})})}function n7(e){const t=e>=12?"PM":"AM";let r=e%12;return r===0&&(r=12),`${r} ${t}`}function i7(e){const r={};for(let n=0;n<e.length;n++){const i=e[n],a=Number(i.hour??0),s=Math.floor(a/4)*4+4,l=s;r[l]||(r[l]={time:n7(s),walkins:0,checkins:0}),r[l].walkins+=Number(i.walkins??0),r[l].checkins+=Number(i.preApproved??0)}return Object.values(r)}function a7({isStatic:e,data:t}){const r={green:"#12B981",amber:"#F69E0A"},n=t?.summary?.activeWalkins||{},i=t?.summary?.preApprovedCheckins||{},a=t?.summary?.staffAttendance||{},o=t?.chart?.length>0?i7(t.chart):[],s=({active:l,payload:c,label:u})=>!l||!c||!c.length?null:y.jsxs("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:[u&&y.jsx("div",{className:"font-medium mb-1",children:u}),c.map((f,d)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:f.color,marginRight:6}}),f.name,": ",y.jsx("div",{className:"font-semibold",children:f.value})]},d))]});return y.jsx(ge,{title:"Gate Updates",period:"Today",icon:y.jsx(w1,{className:"!text-[24px] text-[#37CC6D]"}),className:`${e?"max-h-[303px]":""} h-[251px] mb-4 break-inside-avoid`,children:y.jsxs("div",{children:[y.jsxs("div",{className:"flex flex-wrap gap-x-2 gap-y-2 text-[14px] mb-2",children:[y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B]",children:"Active Walk-ins"}),y.jsxs("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium text-[#1FA05B] flex",children:[n.visitor_in??0,y.jsxs("div",{className:"!m-0 !text-[20px] !leading-[32px] !text-[#64748B]",children:["/",n.total_pass??0]})]})]}),y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B]",children:"Pre-approved Check-ins"}),y.jsxs("div",{className:"!m-0 text-[28px] leading-[32px] font-medium text-[#E7A015] flex",children:[i.expected_pass_scanned??0,y.jsxs("div",{className:"text-[20px] leading-[32px] text-[#64748B]",children:["/",i.total_expected_pass??0]})]})]}),y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B]",children:"Staff Attendance"}),y.jsxs("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium text-[#1FA05B] flex",children:[a.total_in_now??0,y.jsxs("div",{className:"!m-0 !text-[20px] !leading-[32px] !text-[#64748B]",children:["/",a.total_in_today??0]})]})]})]}),y.jsx("div",{className:"w-full h-[200px]",children:y.jsx(gi,{width:"100%",height:"60%",children:y.jsxs(Rd,{data:o,margin:{top:0,right:0,left:0,bottom:0},children:[y.jsx(Ec,{dataKey:"time",tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400}}),y.jsx(Pc,{yAxisId:"left",domain:[0,30],ticks:[0,10,20,30],tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400},axisLine:!1,tickLine:!1,width:25}),y.jsx(Ac,{strokeDasharray:"3 3",stroke:"#f3f4f6"}),y.jsx(mi,{content:y.jsx(s,{})}),y.jsx(yl,{type:"monotone",dataKey:"walkins",stroke:r.green,strokeWidth:2,dot:!1,name:"Walk-ins"}),y.jsx(Rd,{type:"monotone",dataKey:"checkins",stroke:r.amber,strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved"})]})})})]})})}function o7({isStatic:e,data:t}){const r=({value:c})=>{if(c==null||isNaN(c))return null;const u=c>=0;return y.jsx("div",{className:`p-1 rounded text-[10px] leading-[14px] font-medium ${u?"bg-[#F7FEFA] text-[#1FA05B]":"bg-[#FFF2F2] text-[#AB0000]"}`,children:u?`+${c}%`:`${c}%`})},n=[{name:"L1",value:Number(t?.today_L1||0)},{name:"L2",value:Number(t?.today_L2||0)},{name:"L3",value:Number(t?.today_L3||0)},{name:"No Level",value:Number(t?.today_NoLevel||0)}],a=n.reduce((c,u)=>c+u.value,0)===0?[{name:"No Data",value:1}]:n,o=["#1FA05B","#E7A015","#FA7E28","#EF4444","#CBD5E1"],s=({color:c})=>y.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:c,marginRight:"6px"}}),l=({active:c,payload:u})=>!c||!u||!u.length?null:y.jsx("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:u.map((f,d)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx(s,{color:f.color}),f.name,": ",y.jsx("div",{className:"font-semibold",children:f.value})]},d))});return y.jsx(ge,{title:"Helpdesk",period:"Today",icon:y.jsx(pk,{className:"!text-[24px] text-[#FA7E28]"}),className:`${e&&"max-h-[186px]"} h-[186px] mb-4 break-inside-avoid`,children:y.jsxs("div",{className:"flex gap-[12px] h-fit",children:[y.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Open Complaints"}),y.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium text-[#FA7E28]",children:t?.today_open_complaints??0})]}),y.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] space-x-1",children:[y.jsx(r,{value:t?.percent_change}),y.jsx("div",{className:"whitespace-nowrap",children:"Compared to yesterday"})]})]}),y.jsx("div",{className:"w-[50%] h-[110px] flex justify-end",children:y.jsx(gi,{width:"75%",height:"100%",children:y.jsxs(Cc,{children:[y.jsx(Mo,{data:a,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:a.map((c,u)=>y.jsx(jr,{fill:o[u]||"#CBD5E1"},c.name))}),y.jsx(mi,{content:y.jsx(l,{})})]})})})]})})}/*!
200
200
  * @kurkle/color v0.3.4
201
201
  * https://github.com/kurkle/color#readme
202
202
  * (c) 2024 Jukka Kurkela
package/dist/index.es.js CHANGED
@@ -22850,19 +22850,23 @@ function AU({ data: e }) {
22850
22850
  /* @__PURE__ */ y.jsxs("div", { className: "grid grid-cols-4 !text-[12px] font-medium text-[#121212] mb-2", children: [
22851
22851
  /* @__PURE__ */ y.jsxs("div", { children: [
22852
22852
  n(t.opening_balance),
22853
- " AED"
22853
+ " ",
22854
+ t?.currency_type
22854
22855
  ] }),
22855
22856
  /* @__PURE__ */ y.jsxs("div", { children: [
22856
22857
  n(t.income),
22857
- " AED"
22858
+ " ",
22859
+ t?.currency_type
22858
22860
  ] }),
22859
22861
  /* @__PURE__ */ y.jsxs("div", { children: [
22860
22862
  n(t.collection),
22861
- " AED"
22863
+ " ",
22864
+ t?.currency_type
22862
22865
  ] }),
22863
22866
  /* @__PURE__ */ y.jsxs("div", { children: [
22864
22867
  n(t.closing_balance),
22865
- " AED"
22868
+ " ",
22869
+ t?.currency_type
22866
22870
  ] })
22867
22871
  ] }),
22868
22872
  /* @__PURE__ */ y.jsx("hr", { className: "my-4 border-t border-dashed border-gray-300" }),
@@ -22889,19 +22893,23 @@ function AU({ data: e }) {
22889
22893
  /* @__PURE__ */ y.jsxs("div", { className: "grid grid-cols-4 !text-[12px] font-medium text-[#121212]", children: [
22890
22894
  /* @__PURE__ */ y.jsxs("div", { children: [
22891
22895
  n(r.opening_balance),
22892
- " AED"
22896
+ " ",
22897
+ r?.currency_type
22893
22898
  ] }),
22894
22899
  /* @__PURE__ */ y.jsxs("div", { children: [
22895
22900
  n(r.expenditure),
22896
- " AED"
22901
+ " ",
22902
+ r?.currency_type
22897
22903
  ] }),
22898
22904
  /* @__PURE__ */ y.jsxs("div", { children: [
22899
22905
  n(r.payment),
22900
- " AED"
22906
+ " ",
22907
+ r?.currency_type
22901
22908
  ] }),
22902
22909
  /* @__PURE__ */ y.jsxs("div", { children: [
22903
22910
  n(r.outstanding),
22904
- " AED"
22911
+ " ",
22912
+ r?.currency_type
22905
22913
  ] })
22906
22914
  ] })
22907
22915
  ] })
package/dist/index.umd.js CHANGED
@@ -196,7 +196,7 @@ Take a look at the reducer(s) handling this action type: ${h.type}.
196
196
  *
197
197
  * This source code is licensed under the MIT license found in the
198
198
  * LICENSE file in the root directory of this source tree.
199
- */var g2;function _8(){return g2||(g2=1,process.env.NODE_ENV!=="production"&&(function(){function e(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=k,r=typeof Object.is=="function"?Object.is:e,n=t.useSyncExternalStore,i=t.useRef,a=t.useEffect,o=t.useMemo,s=t.useDebugValue;yp.useSyncExternalStoreWithSelector=function(l,c,u,f,d){var h=i(null);if(h.current===null){var m={hasValue:!1,value:null};h.current=m}else m=h.current;h=o(function(){function g(w){if(!v){if(v=!0,b=w,w=f(w),d!==void 0&&m.hasValue){var O=m.value;if(d(O,w))return x=O}return x=w}if(O=x,r(b,w))return O;var E=f(w);return d!==void 0&&d(O,E)?(b=w,O):(b=w,x=E)}var v=!1,b,x,S=u===void 0?null:u;return[function(){return g(c())},S===null?void 0:function(){return g(S())}]},[c,u,f,d]);var p=n(l,h[0],h[1]);return a(function(){m.hasValue=!0,m.value=p},[p]),s(p),p},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),yp}var v2;function S8(){return v2||(v2=1,process.env.NODE_ENV==="production"?ec.exports=w8():ec.exports=_8()),ec.exports}S8();function O8(e){e()}function A8(){let e=null,t=null;return{clear(){e=null,t=null},notify(){O8(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const i=t={callback:r,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!n||e===null||(n=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var y2={notify(){},get:()=>[]};function E8(e,t){let r,n=y2,i=0,a=!1;function o(p){u();const g=n.subscribe(p);let v=!1;return()=>{v||(v=!0,g(),f())}}function s(){n.notify()}function l(){m.onStateChange&&m.onStateChange()}function c(){return a}function u(){i++,r||(r=e.subscribe(l),n=A8())}function f(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=y2)}function d(){a||(a=!0,u())}function h(){a&&(a=!1,f())}const m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:l,isSubscribed:c,trySubscribe:d,tryUnsubscribe:h,getListeners:()=>n};return m}var P8=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",C8=P8(),k8=()=>typeof navigator<"u"&&navigator.product==="ReactNative",T8=k8(),M8=()=>C8||T8?A.useLayoutEffect:A.useEffect,j8=M8(),D8=Symbol.for("react-redux-context"),N8=typeof globalThis<"u"?globalThis:{};function I8(){if(!A.createContext)return{};const e=N8[D8]??=new Map;let t=e.get(A.createContext);return t||(t=A.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(A.createContext,t)),t}var $8=I8();function R8(e){const{children:t,context:r,serverState:n,store:i}=e,a=A.useMemo(()=>{const l=E8(i),c={store:i,subscription:l,getServerState:n?()=>n:void 0};if(process.env.NODE_ENV==="production")return c;{const{identityFunctionCheck:u="once",stabilityCheck:f="once"}=e;return Object.assign(c,{stabilityCheck:f,identityFunctionCheck:u})}},[i,n]),o=A.useMemo(()=>i.getState(),[i]);j8(()=>{const{subscription:l}=a;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),o!==i.getState()&&l.notifyNestedSubs(),()=>{l.tryUnsubscribe(),l.onStateChange=void 0}},[a,o]);const s=r||$8;return A.createElement(s.Provider,{value:a},t)}var L8=R8,F8=(e,t)=>t,bp=N([F8,ue,m1,ct,hw,Qr,K$,st],Z$),xp=e=>{var t=e.currentTarget.getBoundingClientRect(),r=t.width/e.currentTarget.offsetWidth,n=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/r),chartY:Math.round((e.clientY-t.top)/n)}},b2=ar("mouseClick"),x2=ka();x2.startListening({actionCreator:b2,effect:(e,t)=>{var r=e.payload,n=bp(t.getState(),xp(r));n?.activeIndex!=null&&t.dispatch(e$({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var wp=ar("mouseMove"),w2=ka();w2.startListening({actionCreator:wp,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=gh(n,n.tooltip.settings.shared),a=bp(n,xp(r));i==="axis"&&(a?.activeIndex!=null?t.dispatch(nw({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate})):t.dispatch(rw()))}});var _2={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index"},S2=qt({name:"rootProps",initialState:_2,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:_2.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className}}}),B8=S2.reducer,{updateOptions:z8}=S2.actions,O2=qt({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,t)=>t.payload}}),{updatePolarOptions:W8}=O2.actions,V8=O2.reducer,A2=ar("keyDown"),E2=ar("focus"),_p=ka();_p.startListening({actionCreator:A2,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip,a=e.payload;if(!(a!=="ArrowRight"&&a!=="ArrowLeft"&&a!=="Enter")){var o=Number(bh(i,Yi(r))),s=Qr(r);if(a==="Enter"){var l=Rl(r,"axis","hover",String(i.index));t.dispatch(yh({active:!i.active,activeIndex:i.index,activeDataKey:i.dataKey,activeCoordinate:l}));return}var c=U4(r),u=c==="left-to-right"?1:-1,f=a==="ArrowRight"?1:-1,d=o+f*u;if(!(s==null||d>=s.length||d<0)){var h=Rl(r,"axis","hover",String(d));t.dispatch(yh({active:!0,activeIndex:d.toString(),activeDataKey:void 0,activeCoordinate:h}))}}}}}),_p.startListening({actionCreator:E2,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip;if(!i.active&&i.index==null){var a="0",o=Rl(r,"axis","hover",String(a));t.dispatch(yh({activeDataKey:void 0,active:!0,activeIndex:a,activeCoordinate:o}))}}}});var ur=ar("externalEvent"),P2=ka();P2.startListening({actionCreator:ur,effect:(e,t)=>{if(e.payload.handler!=null){var r=t.getState(),n={activeCoordinate:$$(r),activeDataKey:vw(r),activeIndex:wn(r),activeLabel:gw(r),activeTooltipIndex:wn(r),isTooltipActive:R$(r)};e.payload.handler(n,e.payload.reactEvent)}}});var H8=N([qi],e=>e.tooltipItemPayloads),U8=N([H8,no,(e,t,r)=>t,(e,t,r)=>r],(e,t,r,n)=>{var i=e.find(s=>s.settings.dataKey===n);if(i!=null){var{positions:a}=i;if(a!=null){var o=t(a,r);return o}}}),C2=ar("touchMove"),k2=ka();k2.startListening({actionCreator:C2,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=gh(n,n.tooltip.settings.shared);if(i==="axis"){var a=bp(n,xp({clientX:r.touches[0].clientX,clientY:r.touches[0].clientY,currentTarget:r.currentTarget}));a?.activeIndex!=null&&t.dispatch(nw({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate}))}else if(i==="item"){var o,s=r.touches[0],l=document.elementFromPoint(s.clientX,s.clientY);if(!l||!l.getAttribute)return;var c=l.getAttribute(z0),u=(o=l.getAttribute(W0))!==null&&o!==void 0?o:void 0,f=U8(t.getState(),c,u);t.dispatch(tw({activeDataKey:u,activeIndex:c,activeCoordinate:f}))}}});var K8=Hy({brush:TB,cartesianAxis:u6,chartData:hR,errorBars:k6,graphicalItems:kF,layout:oj,legend:Yj,options:lR,polarAxis:KL,polarOptions:V8,referenceElements:RB,rootProps:B8,tooltip:t$}),q8=function(t){return MM({reducer:K8,preloadedState:t,middleware:r=>r({serializableCheck:!1}).concat([x2.middleware,w2.middleware,_p.middleware,P2.middleware,k2.middleware]),devTools:dn.devToolsEnabled})};function T2(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,i=Nt(),a=k.useRef(null);if(i)return r;a.current==null&&(a.current=q8(t));var o=pf;return A.createElement(L8,{context:o,store:a.current},r)}function M2(e){var{layout:t,width:r,height:n,margin:i}=e,a=Ze(),o=Nt();return k.useEffect(()=>{o||(a(nj(t)),a(ij({width:r,height:n})),a(rj(i)))},[a,o,t,r,n,i]),null}function j2(e){var t=Ze();return k.useEffect(()=>{t(z8(e))},[t,e]),null}var Y8=["children"];function G8(e,t){if(e==null)return{};var r,n,i=X8(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function X8(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function tc(){return tc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tc.apply(null,arguments)}var Z8={width:"100%",height:"100%"},J8=k.forwardRef((e,t)=>{var r=U0(),n=K0(),i=Q0();if(!Di(r)||!Di(n))return null;var{children:a,otherAttributes:o,title:s,desc:l}=e,c,u;return typeof o.tabIndex=="number"?c=o.tabIndex:c=i?0:void 0,typeof o.role=="string"?u=o.role:u=i?"application":void 0,A.createElement(fv,tc({},o,{title:s,desc:l,role:u,tabIndex:c,width:r,height:n,style:Z8,ref:t}),a)}),Q8=e=>{var{children:t}=e,r=G(Xs);if(!r)return null;var{width:n,height:i,y:a,x:o}=r;return A.createElement(fv,{width:n,height:i,x:o,y:a},t)},D2=k.forwardRef((e,t)=>{var{children:r}=e,n=G8(e,Y8),i=Nt();return i?A.createElement(Q8,null,r):A.createElement(J8,tc({ref:t},n),r)});function ez(){var e=Ze(),[t,r]=k.useState(null),n=G(Ij);return k.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;Yt(a)&&a!==n&&e(aj(a))}},[t,e,n]),r}function N2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function tz(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?N2(Object(r),!0).forEach(function(n){rz(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N2(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rz(e,t,r){return(t=nz(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nz(e){var t=iz(e,"string");return typeof t=="symbol"?t:t+""}function iz(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var az=k.forwardRef((e,t)=>{var{children:r,className:n,height:i,onClick:a,onContextMenu:o,onDoubleClick:s,onMouseDown:l,onMouseEnter:c,onMouseLeave:u,onMouseMove:f,onMouseUp:d,onTouchEnd:h,onTouchMove:m,onTouchStart:p,style:g,width:v}=e,b=Ze(),[x,S]=k.useState(null),[w,O]=k.useState(null);_R();var E=ez(),C=k.useCallback(V=>{E(V),typeof t=="function"&&t(V),S(V),O(V)},[E,t,S,O]),M=k.useCallback(V=>{b(b2(V)),b(ur({handler:a,reactEvent:V}))},[b,a]),$=k.useCallback(V=>{b(wp(V)),b(ur({handler:c,reactEvent:V}))},[b,c]),j=k.useCallback(V=>{b(rw()),b(ur({handler:u,reactEvent:V}))},[b,u]),_=k.useCallback(V=>{b(wp(V)),b(ur({handler:f,reactEvent:V}))},[b,f]),I=k.useCallback(()=>{b(E2())},[b]),D=k.useCallback(V=>{b(A2(V.key))},[b]),L=k.useCallback(V=>{b(ur({handler:o,reactEvent:V}))},[b,o]),W=k.useCallback(V=>{b(ur({handler:s,reactEvent:V}))},[b,s]),H=k.useCallback(V=>{b(ur({handler:l,reactEvent:V}))},[b,l]),te=k.useCallback(V=>{b(ur({handler:d,reactEvent:V}))},[b,d]),Q=k.useCallback(V=>{b(ur({handler:p,reactEvent:V}))},[b,p]),F=k.useCallback(V=>{b(C2(V)),b(ur({handler:m,reactEvent:V}))},[b,m]),U=k.useCallback(V=>{b(ur({handler:h,reactEvent:V}))},[b,h]);return A.createElement(Ew.Provider,{value:x},A.createElement(ck.Provider,{value:w},A.createElement("div",{className:de("recharts-wrapper",n),style:tz({position:"relative",cursor:"default",width:v,height:i},g),onClick:M,onContextMenu:L,onDoubleClick:W,onFocus:I,onKeyDown:D,onMouseDown:H,onMouseEnter:$,onMouseLeave:j,onMouseMove:_,onMouseUp:te,onTouchEnd:U,onTouchMove:F,onTouchStart:Q,ref:C},r)))}),oz=["children","className","width","height","style","compact","title","desc"];function sz(e,t){if(e==null)return{};var r,n,i=lz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function lz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var I2=k.forwardRef((e,t)=>{var{children:r,className:n,width:i,height:a,style:o,compact:s,title:l,desc:c}=e,u=sz(e,oz),f=Ar(u);return s?A.createElement(D2,{otherAttributes:f,title:l,desc:c},r):A.createElement(az,{className:n,style:o,width:i,height:a,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},A.createElement(D2,{otherAttributes:f,title:l,desc:c,ref:t},A.createElement(FB,null,r)))}),cz=["width","height"];function Sp(){return Sp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sp.apply(null,arguments)}function uz(e,t){if(e==null)return{};var r,n,i=fz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function fz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var dz={top:5,right:5,bottom:5,left:5},hz={accessibilityLayer:!0,layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:dz,reverseStackOrder:!1,syncMethod:"index"},$2=k.forwardRef(function(t,r){var n,i=_t(t.categoricalChartProps,hz),{width:a,height:o}=i,s=uz(i,cz);if(!Di(a)||!Di(o))return null;var{chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:f,categoricalChartProps:d}=t,h={chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:f,eventEmitter:void 0};return A.createElement(T2,{preloadedState:{options:h},reduxStoreName:(n=d.id)!==null&&n!==void 0?n:l},A.createElement(J_,{chartData:d.data}),A.createElement(M2,{width:a,height:o,layout:i.layout,margin:i.margin}),A.createElement(j2,{accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className}),A.createElement(I2,Sp({},s,{width:a,height:o,ref:r})))}),pz=["axis"],Op=k.forwardRef((e,t)=>A.createElement($2,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:pz,tooltipPayloadSearcher:Th,categoricalChartProps:e,ref:t})),mz=["axis","item"],gz=k.forwardRef((e,t)=>A.createElement($2,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:mz,tooltipPayloadSearcher:Th,categoricalChartProps:e,ref:t}));function vz(e){var t=Ze();return k.useEffect(()=>{t(W8(e))},[t,e]),null}var yz=["width","height","layout"];function Ap(){return Ap=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ap.apply(null,arguments)}function bz(e,t){if(e==null)return{};var r,n,i=xz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function xz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var wz={top:5,right:5,bottom:5,left:5},_z={accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:wz,reverseStackOrder:!1,syncMethod:"index",layout:"radial"},Sz=k.forwardRef(function(t,r){var n,i=_t(t.categoricalChartProps,_z),{width:a,height:o,layout:s}=i,l=bz(i,yz);if(!Di(a)||!Di(o))return null;var{chartName:c,defaultTooltipEventType:u,validateTooltipEventTypes:f,tooltipPayloadSearcher:d}=t,h={chartName:c,defaultTooltipEventType:u,validateTooltipEventTypes:f,tooltipPayloadSearcher:d,eventEmitter:void 0};return A.createElement(T2,{preloadedState:{options:h},reduxStoreName:(n=i.id)!==null&&n!==void 0?n:c},A.createElement(J_,{chartData:i.data}),A.createElement(M2,{width:a,height:o,layout:s,margin:i.margin}),A.createElement(j2,{accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className}),A.createElement(vz,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),A.createElement(I2,Ap({width:a,height:o},l,{ref:r})))}),Oz=["item"],Az={layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},rc=k.forwardRef((e,t)=>{var r=_t(e,Az);return A.createElement(Sz,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:Oz,tooltipPayloadSearcher:Th,categoricalChartProps:r,ref:t})});function Ez({isStatic:e,data:t}){const r=({value:u})=>{const f=u>=0;return y.jsx("div",{className:`p-1 rounded text-[10px] leading-[14px] font-medium ${f?"bg-[#F7FEFA] text-[#1FA05B]":"bg-[#FFF2F2] text-[#AB0000]"}`,children:f?`+${u}%`:`${u}%`})},n=Number(t?.thisMonthMoveIns??t?.lastMonthMoveIns??0),i=Number(t?.thisMonthMoveOuts??t?.lastMonthMoveOuts??0),a=Number(t?.moveInPercentChange??t?.moveInChange??0),o=Number(t?.moveOutPercentChange??t?.moveOutChange??0),s=[{name:"Move-ins",value:n},{name:"Move-outs",value:i}],l={purple:"#8B5CF6",indigo:"#6366F1"},c=({active:u,payload:f})=>!u||!f||!f.length?null:y.jsx("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:f.map((d,h)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:d.color,marginRight:6}}),d.name,": ",y.jsx("div",{className:"font-semibold",children:d.value})]},h))});return y.jsx(me,{title:"Community",period:"This Month",icon:y.jsx(su,{className:"!text-[24px] text-[#329DFF]"}),className:`${e&&"max-h-[184px]"} h-[184px] mb-4 break-inside-avoid`,children:y.jsxs("div",{className:"flex",children:[y.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Move-in/Out Count"}),y.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium !text-[#8B5CF6]",children:n+i})]}),y.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] space-x-1 flex items-center",children:[y.jsx(r,{value:((a+o)/2).toFixed(2)}),y.jsx("div",{className:"whitespace-nowrap",children:"Compared to last month"})]})]}),y.jsx("div",{className:"w-[50%] h-[111px] flex justify-end",children:y.jsx(ii,{width:"75%",height:"100%",children:y.jsxs(rc,{children:[y.jsxs(lo,{data:s,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:[y.jsx(kr,{fill:l.purple}),y.jsx(kr,{fill:l.indigo})]}),y.jsx(ni,{content:y.jsx(c,{})})]})})})]})})}function Pz({isStatic:e,data:t}){const r=[{name:"Notice",value:Number(t?.total_notices||0)},{name:"Post",value:Number(t?.total_topics||0)},{name:"Poll",value:Number(t?.total_polls||0)},{name:"Survey",value:Number(t?.total_surveys||0)}],n={Notice:"#8B5CF6",Post:"#22C55E",Poll:"#3B82F6",Survey:"#F59E0B"},i=({active:a,payload:o,label:s})=>!a||!o||!o.length?null:y.jsxs("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:[s&&y.jsx("div",{className:"font-medium mb-1",children:s}),o.map((l,c)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:l.color,marginRight:6}}),l.name,": ",y.jsx("div",{className:"font-semibold",children:l.value})]},c))]});return y.jsx(me,{title:"Engagement",period:"This Month",icon:y.jsx(Wg,{className:"!text-[24px] text-[#DBB467]"}),className:`${e&&"max-h-[303px]"} h-[303px]`,children:y.jsx(ii,{width:"100%",height:"100%",children:y.jsxs(gz,{data:r,layout:"vertical",margin:{top:4,right:8,left:8,bottom:0},children:[y.jsx(Yl,{stroke:"#e5e7eb",strokeDasharray:"3 3",horizontal:!1}),y.jsx(Ql,{type:"category",dataKey:"name",width:40,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400}}),y.jsx(Zl,{type:"number",axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400}}),y.jsx(ni,{content:y.jsx(i,{}),cursor:{fill:"transparent"}}),y.jsx(Y_,{dataKey:"value",barSize:40,isAnimationActive:!1,children:r.map(a=>y.jsx(kr,{fill:n[a.name]},a.name))})]})})})}function Cz(e){if(!e)return 0;const[t,r]=e.split(" ");let[n,i]=t.split(":").map(Number);return r==="PM"&&n!==12&&(n+=12),r==="AM"&&n===12&&(n=0),n*60+i}function kz(e){let t=Math.floor(e/60);const r=t>=12?"PM":"AM";return t=t%12||12,`${t} ${r}`}function Tz(e){const r={};for(let n=0;n<e.length;n++){const i=e[n],a=Cz(i.slot_start_time),o=Math.floor(a/240)*240,s=o+240,l=`${o}-${s}`;r[l]||(r[l]={time:kz(s),bookings:0,total:0}),r[l].bookings+=Number(i?.slot_bookings||0),r[l].total+=Number(i?.total_slots||0)}return Object.values(r)}function Mz({isStatic:e,data:t}){const r=Number(t?.totalBookings||0),n=Number(t?.totalSlots||0),i=Number(t?.utilizationRate||0),a=k.useMemo(()=>t?.slots?.length?Tz(t.slots):[],[t]),o=({active:l,payload:c,label:u})=>!l||!c||!c.length?null:y.jsxs("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:[u&&y.jsx("div",{className:"font-medium mb-1",children:u}),c.map((f,d)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:f.color,marginRight:6}}),f.name,": ",y.jsx("div",{className:"font-semibold",children:f.value})]},d))]}),s=a.length>0?Math.max(...a.map(l=>l.total),5):5;return y.jsxs(me,{title:"Facilities",period:"Today",icon:y.jsx(zg,{className:"!text-[24px] text-[#8B5CF6]"}),className:`${e&&"max-h-[305px]"} h-[305px] mb-4 break-inside-avoid`,children:[y.jsxs("div",{className:"grid grid-cols-3 gap-[24px] mb-[16px]",children:[y.jsxs("div",{className:"flex flex-col gap-[4px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Bookings"}),y.jsx("div",{className:"!m-0 !text-[24px] !leading-[28px] !font-medium text-[#8B5CF6]",children:r})]}),y.jsxs("div",{className:"flex flex-col gap-[4px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Total Slots"}),y.jsx("div",{className:"!m-0 !text-[24px] !leading-[28px] !font-medium text-[#F59E0B]",children:n})]}),y.jsxs("div",{className:"flex flex-col gap-[4px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Utilisation Rate"}),y.jsxs("div",{className:"!m-0 !text-[24px] !leading-[28px] !font-medium !text-[#329DFF]",children:[Number.isFinite(i)?i.toFixed(2):"0.00","%"]})]})]}),y.jsx("div",{className:"w-full h-[150px]",children:y.jsx(ii,{width:"100%",height:"100%",children:y.jsxs(Op,{data:a,margin:{top:0,right:0,left:0,bottom:0},children:[y.jsx(Yl,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),y.jsx(Zl,{dataKey:"time",tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1}),y.jsx(Ql,{yAxisId:"left",domain:[0,s],tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400},axisLine:!1,tickLine:!1}),y.jsx(ni,{content:y.jsx(o,{})}),y.jsx(Gl,{yAxisId:"left",type:"monotone",dataKey:"bookings",name:"Bookings",stroke:"#8B5CF6",strokeWidth:2,dot:!1}),y.jsx(Gl,{yAxisId:"left",type:"monotone",dataKey:"total",name:"Total Slots",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",dot:!1})]})})})]})}function jz({data:e}){const t=e?.incomeSummary||{},r=e?.expenditureSummary||{};function n(i){if(i==null||isNaN(i))return"0";const a=Number(i);return a>=1e9?(a/1e9).toFixed(a%1e9===0?0:2)+"B":a>=1e6?(a/1e6).toFixed(a%1e6===0?0:2)+"M":a>=1e3?(a/1e3).toFixed(a%1e3===0?0:2)+"K":a.toFixed(a%1===0?0:2)}return y.jsx(me,{title:"Income",period:"This Month",icon:y.jsx(Vg,{className:"!text-[24px] text-green-600"}),className:"!gap-[16px] break-inside-avoid h-[232px] overflow-hidden",children:y.jsxs("div",{children:[y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mb-2",children:[y.jsx("div",{children:"Opening"}),y.jsx("div",{children:"Income"}),y.jsx("div",{children:"Collection"}),y.jsx("div",{children:"Closing"})]}),y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212] mb-2",children:[y.jsxs("div",{children:[n(t.opening_balance)," AED"]}),y.jsxs("div",{children:[n(t.income)," AED"]}),y.jsxs("div",{children:[n(t.collection)," AED"]}),y.jsxs("div",{children:[n(t.closing_balance)," AED"]})]}),y.jsx("hr",{className:"my-4 border-t border-dashed border-gray-300"}),y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsxs("div",{className:"flex items-center gap-[12px]",children:[y.jsx(Vg,{className:"!text-[24px] text-red-600"}),y.jsx("div",{style:{fontWeight:500,fontSize:"16px",lineHeight:"20px"},className:"!my-0 !font-medium !text-[16px] !leading-[20px] !text-[#121212]",children:"Expenditure"})]}),y.jsx("div",{className:"!text-[12px] !leading-[16px] !text-[#64748B]",children:"This Month"})]}),y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mt-4 mb-2",children:[y.jsx("div",{children:"Opening"}),y.jsx("div",{children:"Expenditure"}),y.jsx("div",{children:"Payment"}),y.jsx("div",{children:"Outstanding"})]}),y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212]",children:[y.jsxs("div",{children:[n(r.opening_balance)," AED"]}),y.jsxs("div",{children:[n(r.expenditure)," AED"]}),y.jsxs("div",{children:[n(r.payment)," AED"]}),y.jsxs("div",{children:[n(r.outstanding)," AED"]})]})]})})}function Dz(e){const t=e>=12?"PM":"AM";let r=e%12;return r===0&&(r=12),`${r} ${t}`}function Nz(e){const r={};for(let n=0;n<e.length;n++){const i=e[n],a=Number(i.hour??0),s=Math.floor(a/4)*4+4,l=s;r[l]||(r[l]={time:Dz(s),walkins:0,checkins:0}),r[l].walkins+=Number(i.walkins??0),r[l].checkins+=Number(i.preApproved??0)}return Object.values(r)}function Iz({isStatic:e,data:t}){const r={green:"#12B981",amber:"#F69E0A"},n=t?.summary?.activeWalkins||{},i=t?.summary?.preApprovedCheckins||{},a=t?.summary?.staffAttendance||{},o=t?.chart?.length>0?Nz(t.chart):[],s=({active:l,payload:c,label:u})=>!l||!c||!c.length?null:y.jsxs("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:[u&&y.jsx("div",{className:"font-medium mb-1",children:u}),c.map((f,d)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:f.color,marginRight:6}}),f.name,": ",y.jsx("div",{className:"font-semibold",children:f.value})]},d))]});return y.jsx(me,{title:"Gate Updates",period:"Today",icon:y.jsx(Ug,{className:"!text-[24px] text-[#37CC6D]"}),className:`${e?"max-h-[303px]":""} h-[251px] mb-4 break-inside-avoid`,children:y.jsxs("div",{children:[y.jsxs("div",{className:"flex flex-wrap gap-x-2 gap-y-2 text-[14px] mb-2",children:[y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B]",children:"Active Walk-ins"}),y.jsxs("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium text-[#1FA05B] flex",children:[n.visitor_in??0,y.jsxs("div",{className:"!m-0 !text-[20px] !leading-[32px] !text-[#64748B]",children:["/",n.total_pass??0]})]})]}),y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B]",children:"Pre-approved Check-ins"}),y.jsxs("div",{className:"!m-0 text-[28px] leading-[32px] font-medium text-[#E7A015] flex",children:[i.expected_pass_scanned??0,y.jsxs("div",{className:"text-[20px] leading-[32px] text-[#64748B]",children:["/",i.total_expected_pass??0]})]})]}),y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B]",children:"Staff Attendance"}),y.jsxs("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium text-[#1FA05B] flex",children:[a.total_in_now??0,y.jsxs("div",{className:"!m-0 !text-[20px] !leading-[32px] !text-[#64748B]",children:["/",a.total_in_today??0]})]})]})]}),y.jsx("div",{className:"w-full h-[200px]",children:y.jsx(ii,{width:"100%",height:"60%",children:y.jsxs(Op,{data:o,margin:{top:0,right:0,left:0,bottom:0},children:[y.jsx(Zl,{dataKey:"time",tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400}}),y.jsx(Ql,{yAxisId:"left",domain:[0,30],ticks:[0,10,20,30],tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400},axisLine:!1,tickLine:!1,width:25}),y.jsx(Yl,{strokeDasharray:"3 3",stroke:"#f3f4f6"}),y.jsx(ni,{content:y.jsx(s,{})}),y.jsx(Gl,{type:"monotone",dataKey:"walkins",stroke:r.green,strokeWidth:2,dot:!1,name:"Walk-ins"}),y.jsx(Op,{type:"monotone",dataKey:"checkins",stroke:r.amber,strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved"})]})})})]})})}function $z({isStatic:e,data:t}){const r=({value:c})=>{if(c==null||isNaN(c))return null;const u=c>=0;return y.jsx("div",{className:`p-1 rounded text-[10px] leading-[14px] font-medium ${u?"bg-[#F7FEFA] text-[#1FA05B]":"bg-[#FFF2F2] text-[#AB0000]"}`,children:u?`+${c}%`:`${c}%`})},n=[{name:"L1",value:Number(t?.today_L1||0)},{name:"L2",value:Number(t?.today_L2||0)},{name:"L3",value:Number(t?.today_L3||0)},{name:"No Level",value:Number(t?.today_NoLevel||0)}],a=n.reduce((c,u)=>c+u.value,0)===0?[{name:"No Data",value:1}]:n,o=["#1FA05B","#E7A015","#FA7E28","#EF4444","#CBD5E1"],s=({color:c})=>y.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:c,marginRight:"6px"}}),l=({active:c,payload:u})=>!c||!u||!u.length?null:y.jsx("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:u.map((f,d)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx(s,{color:f.color}),f.name,": ",y.jsx("div",{className:"font-semibold",children:f.value})]},d))});return y.jsx(me,{title:"Helpdesk",period:"Today",icon:y.jsx(UC,{className:"!text-[24px] text-[#FA7E28]"}),className:`${e&&"max-h-[186px]"} h-[186px] mb-4 break-inside-avoid`,children:y.jsxs("div",{className:"flex gap-[12px] h-fit",children:[y.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Open Complaints"}),y.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium text-[#FA7E28]",children:t?.today_open_complaints??0})]}),y.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] space-x-1",children:[y.jsx(r,{value:t?.percent_change}),y.jsx("div",{className:"whitespace-nowrap",children:"Compared to yesterday"})]})]}),y.jsx("div",{className:"w-[50%] h-[110px] flex justify-end",children:y.jsx(ii,{width:"75%",height:"100%",children:y.jsxs(rc,{children:[y.jsx(lo,{data:a,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:a.map((c,u)=>y.jsx(kr,{fill:o[u]||"#CBD5E1"},c.name))}),y.jsx(ni,{content:y.jsx(l,{})})]})})})]})})}/*!
199
+ */var g2;function _8(){return g2||(g2=1,process.env.NODE_ENV!=="production"&&(function(){function e(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=k,r=typeof Object.is=="function"?Object.is:e,n=t.useSyncExternalStore,i=t.useRef,a=t.useEffect,o=t.useMemo,s=t.useDebugValue;yp.useSyncExternalStoreWithSelector=function(l,c,u,f,d){var h=i(null);if(h.current===null){var m={hasValue:!1,value:null};h.current=m}else m=h.current;h=o(function(){function g(w){if(!v){if(v=!0,b=w,w=f(w),d!==void 0&&m.hasValue){var O=m.value;if(d(O,w))return x=O}return x=w}if(O=x,r(b,w))return O;var E=f(w);return d!==void 0&&d(O,E)?(b=w,O):(b=w,x=E)}var v=!1,b,x,S=u===void 0?null:u;return[function(){return g(c())},S===null?void 0:function(){return g(S())}]},[c,u,f,d]);var p=n(l,h[0],h[1]);return a(function(){m.hasValue=!0,m.value=p},[p]),s(p),p},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),yp}var v2;function S8(){return v2||(v2=1,process.env.NODE_ENV==="production"?ec.exports=w8():ec.exports=_8()),ec.exports}S8();function O8(e){e()}function A8(){let e=null,t=null;return{clear(){e=null,t=null},notify(){O8(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const i=t={callback:r,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!n||e===null||(n=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var y2={notify(){},get:()=>[]};function E8(e,t){let r,n=y2,i=0,a=!1;function o(p){u();const g=n.subscribe(p);let v=!1;return()=>{v||(v=!0,g(),f())}}function s(){n.notify()}function l(){m.onStateChange&&m.onStateChange()}function c(){return a}function u(){i++,r||(r=e.subscribe(l),n=A8())}function f(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=y2)}function d(){a||(a=!0,u())}function h(){a&&(a=!1,f())}const m={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:l,isSubscribed:c,trySubscribe:d,tryUnsubscribe:h,getListeners:()=>n};return m}var P8=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",C8=P8(),k8=()=>typeof navigator<"u"&&navigator.product==="ReactNative",T8=k8(),M8=()=>C8||T8?A.useLayoutEffect:A.useEffect,j8=M8(),D8=Symbol.for("react-redux-context"),N8=typeof globalThis<"u"?globalThis:{};function I8(){if(!A.createContext)return{};const e=N8[D8]??=new Map;let t=e.get(A.createContext);return t||(t=A.createContext(null),process.env.NODE_ENV!=="production"&&(t.displayName="ReactRedux"),e.set(A.createContext,t)),t}var $8=I8();function R8(e){const{children:t,context:r,serverState:n,store:i}=e,a=A.useMemo(()=>{const l=E8(i),c={store:i,subscription:l,getServerState:n?()=>n:void 0};if(process.env.NODE_ENV==="production")return c;{const{identityFunctionCheck:u="once",stabilityCheck:f="once"}=e;return Object.assign(c,{stabilityCheck:f,identityFunctionCheck:u})}},[i,n]),o=A.useMemo(()=>i.getState(),[i]);j8(()=>{const{subscription:l}=a;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),o!==i.getState()&&l.notifyNestedSubs(),()=>{l.tryUnsubscribe(),l.onStateChange=void 0}},[a,o]);const s=r||$8;return A.createElement(s.Provider,{value:a},t)}var L8=R8,F8=(e,t)=>t,bp=N([F8,ue,m1,ct,hw,Qr,K$,st],Z$),xp=e=>{var t=e.currentTarget.getBoundingClientRect(),r=t.width/e.currentTarget.offsetWidth,n=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/r),chartY:Math.round((e.clientY-t.top)/n)}},b2=ar("mouseClick"),x2=ka();x2.startListening({actionCreator:b2,effect:(e,t)=>{var r=e.payload,n=bp(t.getState(),xp(r));n?.activeIndex!=null&&t.dispatch(e$({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var wp=ar("mouseMove"),w2=ka();w2.startListening({actionCreator:wp,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=gh(n,n.tooltip.settings.shared),a=bp(n,xp(r));i==="axis"&&(a?.activeIndex!=null?t.dispatch(nw({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate})):t.dispatch(rw()))}});var _2={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index"},S2=qt({name:"rootProps",initialState:_2,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:_2.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className}}}),B8=S2.reducer,{updateOptions:z8}=S2.actions,O2=qt({name:"polarOptions",initialState:null,reducers:{updatePolarOptions:(e,t)=>t.payload}}),{updatePolarOptions:W8}=O2.actions,V8=O2.reducer,A2=ar("keyDown"),E2=ar("focus"),_p=ka();_p.startListening({actionCreator:A2,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip,a=e.payload;if(!(a!=="ArrowRight"&&a!=="ArrowLeft"&&a!=="Enter")){var o=Number(bh(i,Yi(r))),s=Qr(r);if(a==="Enter"){var l=Rl(r,"axis","hover",String(i.index));t.dispatch(yh({active:!i.active,activeIndex:i.index,activeDataKey:i.dataKey,activeCoordinate:l}));return}var c=U4(r),u=c==="left-to-right"?1:-1,f=a==="ArrowRight"?1:-1,d=o+f*u;if(!(s==null||d>=s.length||d<0)){var h=Rl(r,"axis","hover",String(d));t.dispatch(yh({active:!0,activeIndex:d.toString(),activeDataKey:void 0,activeCoordinate:h}))}}}}}),_p.startListening({actionCreator:E2,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:i}=r.tooltip;if(!i.active&&i.index==null){var a="0",o=Rl(r,"axis","hover",String(a));t.dispatch(yh({activeDataKey:void 0,active:!0,activeIndex:a,activeCoordinate:o}))}}}});var ur=ar("externalEvent"),P2=ka();P2.startListening({actionCreator:ur,effect:(e,t)=>{if(e.payload.handler!=null){var r=t.getState(),n={activeCoordinate:$$(r),activeDataKey:vw(r),activeIndex:wn(r),activeLabel:gw(r),activeTooltipIndex:wn(r),isTooltipActive:R$(r)};e.payload.handler(n,e.payload.reactEvent)}}});var H8=N([qi],e=>e.tooltipItemPayloads),U8=N([H8,no,(e,t,r)=>t,(e,t,r)=>r],(e,t,r,n)=>{var i=e.find(s=>s.settings.dataKey===n);if(i!=null){var{positions:a}=i;if(a!=null){var o=t(a,r);return o}}}),C2=ar("touchMove"),k2=ka();k2.startListening({actionCreator:C2,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=gh(n,n.tooltip.settings.shared);if(i==="axis"){var a=bp(n,xp({clientX:r.touches[0].clientX,clientY:r.touches[0].clientY,currentTarget:r.currentTarget}));a?.activeIndex!=null&&t.dispatch(nw({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate}))}else if(i==="item"){var o,s=r.touches[0],l=document.elementFromPoint(s.clientX,s.clientY);if(!l||!l.getAttribute)return;var c=l.getAttribute(z0),u=(o=l.getAttribute(W0))!==null&&o!==void 0?o:void 0,f=U8(t.getState(),c,u);t.dispatch(tw({activeDataKey:u,activeIndex:c,activeCoordinate:f}))}}});var K8=Hy({brush:TB,cartesianAxis:u6,chartData:hR,errorBars:k6,graphicalItems:kF,layout:oj,legend:Yj,options:lR,polarAxis:KL,polarOptions:V8,referenceElements:RB,rootProps:B8,tooltip:t$}),q8=function(t){return MM({reducer:K8,preloadedState:t,middleware:r=>r({serializableCheck:!1}).concat([x2.middleware,w2.middleware,_p.middleware,P2.middleware,k2.middleware]),devTools:dn.devToolsEnabled})};function T2(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,i=Nt(),a=k.useRef(null);if(i)return r;a.current==null&&(a.current=q8(t));var o=pf;return A.createElement(L8,{context:o,store:a.current},r)}function M2(e){var{layout:t,width:r,height:n,margin:i}=e,a=Ze(),o=Nt();return k.useEffect(()=>{o||(a(nj(t)),a(ij({width:r,height:n})),a(rj(i)))},[a,o,t,r,n,i]),null}function j2(e){var t=Ze();return k.useEffect(()=>{t(z8(e))},[t,e]),null}var Y8=["children"];function G8(e,t){if(e==null)return{};var r,n,i=X8(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function X8(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function tc(){return tc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tc.apply(null,arguments)}var Z8={width:"100%",height:"100%"},J8=k.forwardRef((e,t)=>{var r=U0(),n=K0(),i=Q0();if(!Di(r)||!Di(n))return null;var{children:a,otherAttributes:o,title:s,desc:l}=e,c,u;return typeof o.tabIndex=="number"?c=o.tabIndex:c=i?0:void 0,typeof o.role=="string"?u=o.role:u=i?"application":void 0,A.createElement(fv,tc({},o,{title:s,desc:l,role:u,tabIndex:c,width:r,height:n,style:Z8,ref:t}),a)}),Q8=e=>{var{children:t}=e,r=G(Xs);if(!r)return null;var{width:n,height:i,y:a,x:o}=r;return A.createElement(fv,{width:n,height:i,x:o,y:a},t)},D2=k.forwardRef((e,t)=>{var{children:r}=e,n=G8(e,Y8),i=Nt();return i?A.createElement(Q8,null,r):A.createElement(J8,tc({ref:t},n),r)});function ez(){var e=Ze(),[t,r]=k.useState(null),n=G(Ij);return k.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;Yt(a)&&a!==n&&e(aj(a))}},[t,e,n]),r}function N2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function tz(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?N2(Object(r),!0).forEach(function(n){rz(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N2(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function rz(e,t,r){return(t=nz(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nz(e){var t=iz(e,"string");return typeof t=="symbol"?t:t+""}function iz(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var az=k.forwardRef((e,t)=>{var{children:r,className:n,height:i,onClick:a,onContextMenu:o,onDoubleClick:s,onMouseDown:l,onMouseEnter:c,onMouseLeave:u,onMouseMove:f,onMouseUp:d,onTouchEnd:h,onTouchMove:m,onTouchStart:p,style:g,width:v}=e,b=Ze(),[x,S]=k.useState(null),[w,O]=k.useState(null);_R();var E=ez(),C=k.useCallback(V=>{E(V),typeof t=="function"&&t(V),S(V),O(V)},[E,t,S,O]),M=k.useCallback(V=>{b(b2(V)),b(ur({handler:a,reactEvent:V}))},[b,a]),$=k.useCallback(V=>{b(wp(V)),b(ur({handler:c,reactEvent:V}))},[b,c]),j=k.useCallback(V=>{b(rw()),b(ur({handler:u,reactEvent:V}))},[b,u]),_=k.useCallback(V=>{b(wp(V)),b(ur({handler:f,reactEvent:V}))},[b,f]),I=k.useCallback(()=>{b(E2())},[b]),D=k.useCallback(V=>{b(A2(V.key))},[b]),L=k.useCallback(V=>{b(ur({handler:o,reactEvent:V}))},[b,o]),W=k.useCallback(V=>{b(ur({handler:s,reactEvent:V}))},[b,s]),H=k.useCallback(V=>{b(ur({handler:l,reactEvent:V}))},[b,l]),te=k.useCallback(V=>{b(ur({handler:d,reactEvent:V}))},[b,d]),Q=k.useCallback(V=>{b(ur({handler:p,reactEvent:V}))},[b,p]),F=k.useCallback(V=>{b(C2(V)),b(ur({handler:m,reactEvent:V}))},[b,m]),U=k.useCallback(V=>{b(ur({handler:h,reactEvent:V}))},[b,h]);return A.createElement(Ew.Provider,{value:x},A.createElement(ck.Provider,{value:w},A.createElement("div",{className:de("recharts-wrapper",n),style:tz({position:"relative",cursor:"default",width:v,height:i},g),onClick:M,onContextMenu:L,onDoubleClick:W,onFocus:I,onKeyDown:D,onMouseDown:H,onMouseEnter:$,onMouseLeave:j,onMouseMove:_,onMouseUp:te,onTouchEnd:U,onTouchMove:F,onTouchStart:Q,ref:C},r)))}),oz=["children","className","width","height","style","compact","title","desc"];function sz(e,t){if(e==null)return{};var r,n,i=lz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function lz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var I2=k.forwardRef((e,t)=>{var{children:r,className:n,width:i,height:a,style:o,compact:s,title:l,desc:c}=e,u=sz(e,oz),f=Ar(u);return s?A.createElement(D2,{otherAttributes:f,title:l,desc:c},r):A.createElement(az,{className:n,style:o,width:i,height:a,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},A.createElement(D2,{otherAttributes:f,title:l,desc:c,ref:t},A.createElement(FB,null,r)))}),cz=["width","height"];function Sp(){return Sp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sp.apply(null,arguments)}function uz(e,t){if(e==null)return{};var r,n,i=fz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function fz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var dz={top:5,right:5,bottom:5,left:5},hz={accessibilityLayer:!0,layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:dz,reverseStackOrder:!1,syncMethod:"index"},$2=k.forwardRef(function(t,r){var n,i=_t(t.categoricalChartProps,hz),{width:a,height:o}=i,s=uz(i,cz);if(!Di(a)||!Di(o))return null;var{chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:f,categoricalChartProps:d}=t,h={chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:f,eventEmitter:void 0};return A.createElement(T2,{preloadedState:{options:h},reduxStoreName:(n=d.id)!==null&&n!==void 0?n:l},A.createElement(J_,{chartData:d.data}),A.createElement(M2,{width:a,height:o,layout:i.layout,margin:i.margin}),A.createElement(j2,{accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className}),A.createElement(I2,Sp({},s,{width:a,height:o,ref:r})))}),pz=["axis"],Op=k.forwardRef((e,t)=>A.createElement($2,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:pz,tooltipPayloadSearcher:Th,categoricalChartProps:e,ref:t})),mz=["axis","item"],gz=k.forwardRef((e,t)=>A.createElement($2,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:mz,tooltipPayloadSearcher:Th,categoricalChartProps:e,ref:t}));function vz(e){var t=Ze();return k.useEffect(()=>{t(W8(e))},[t,e]),null}var yz=["width","height","layout"];function Ap(){return Ap=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ap.apply(null,arguments)}function bz(e,t){if(e==null)return{};var r,n,i=xz(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function xz(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}var wz={top:5,right:5,bottom:5,left:5},_z={accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:wz,reverseStackOrder:!1,syncMethod:"index",layout:"radial"},Sz=k.forwardRef(function(t,r){var n,i=_t(t.categoricalChartProps,_z),{width:a,height:o,layout:s}=i,l=bz(i,yz);if(!Di(a)||!Di(o))return null;var{chartName:c,defaultTooltipEventType:u,validateTooltipEventTypes:f,tooltipPayloadSearcher:d}=t,h={chartName:c,defaultTooltipEventType:u,validateTooltipEventTypes:f,tooltipPayloadSearcher:d,eventEmitter:void 0};return A.createElement(T2,{preloadedState:{options:h},reduxStoreName:(n=i.id)!==null&&n!==void 0?n:c},A.createElement(J_,{chartData:i.data}),A.createElement(M2,{width:a,height:o,layout:s,margin:i.margin}),A.createElement(j2,{accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className}),A.createElement(vz,{cx:i.cx,cy:i.cy,startAngle:i.startAngle,endAngle:i.endAngle,innerRadius:i.innerRadius,outerRadius:i.outerRadius}),A.createElement(I2,Ap({width:a,height:o},l,{ref:r})))}),Oz=["item"],Az={layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},rc=k.forwardRef((e,t)=>{var r=_t(e,Az);return A.createElement(Sz,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:Oz,tooltipPayloadSearcher:Th,categoricalChartProps:r,ref:t})});function Ez({isStatic:e,data:t}){const r=({value:u})=>{const f=u>=0;return y.jsx("div",{className:`p-1 rounded text-[10px] leading-[14px] font-medium ${f?"bg-[#F7FEFA] text-[#1FA05B]":"bg-[#FFF2F2] text-[#AB0000]"}`,children:f?`+${u}%`:`${u}%`})},n=Number(t?.thisMonthMoveIns??t?.lastMonthMoveIns??0),i=Number(t?.thisMonthMoveOuts??t?.lastMonthMoveOuts??0),a=Number(t?.moveInPercentChange??t?.moveInChange??0),o=Number(t?.moveOutPercentChange??t?.moveOutChange??0),s=[{name:"Move-ins",value:n},{name:"Move-outs",value:i}],l={purple:"#8B5CF6",indigo:"#6366F1"},c=({active:u,payload:f})=>!u||!f||!f.length?null:y.jsx("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:f.map((d,h)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:d.color,marginRight:6}}),d.name,": ",y.jsx("div",{className:"font-semibold",children:d.value})]},h))});return y.jsx(me,{title:"Community",period:"This Month",icon:y.jsx(su,{className:"!text-[24px] text-[#329DFF]"}),className:`${e&&"max-h-[184px]"} h-[184px] mb-4 break-inside-avoid`,children:y.jsxs("div",{className:"flex",children:[y.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Move-in/Out Count"}),y.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium !text-[#8B5CF6]",children:n+i})]}),y.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] space-x-1 flex items-center",children:[y.jsx(r,{value:((a+o)/2).toFixed(2)}),y.jsx("div",{className:"whitespace-nowrap",children:"Compared to last month"})]})]}),y.jsx("div",{className:"w-[50%] h-[111px] flex justify-end",children:y.jsx(ii,{width:"75%",height:"100%",children:y.jsxs(rc,{children:[y.jsxs(lo,{data:s,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:[y.jsx(kr,{fill:l.purple}),y.jsx(kr,{fill:l.indigo})]}),y.jsx(ni,{content:y.jsx(c,{})})]})})})]})})}function Pz({isStatic:e,data:t}){const r=[{name:"Notice",value:Number(t?.total_notices||0)},{name:"Post",value:Number(t?.total_topics||0)},{name:"Poll",value:Number(t?.total_polls||0)},{name:"Survey",value:Number(t?.total_surveys||0)}],n={Notice:"#8B5CF6",Post:"#22C55E",Poll:"#3B82F6",Survey:"#F59E0B"},i=({active:a,payload:o,label:s})=>!a||!o||!o.length?null:y.jsxs("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:[s&&y.jsx("div",{className:"font-medium mb-1",children:s}),o.map((l,c)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:l.color,marginRight:6}}),l.name,": ",y.jsx("div",{className:"font-semibold",children:l.value})]},c))]});return y.jsx(me,{title:"Engagement",period:"This Month",icon:y.jsx(Wg,{className:"!text-[24px] text-[#DBB467]"}),className:`${e&&"max-h-[303px]"} h-[303px]`,children:y.jsx(ii,{width:"100%",height:"100%",children:y.jsxs(gz,{data:r,layout:"vertical",margin:{top:4,right:8,left:8,bottom:0},children:[y.jsx(Yl,{stroke:"#e5e7eb",strokeDasharray:"3 3",horizontal:!1}),y.jsx(Ql,{type:"category",dataKey:"name",width:40,axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400}}),y.jsx(Zl,{type:"number",axisLine:!1,tickLine:!1,tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400}}),y.jsx(ni,{content:y.jsx(i,{}),cursor:{fill:"transparent"}}),y.jsx(Y_,{dataKey:"value",barSize:40,isAnimationActive:!1,children:r.map(a=>y.jsx(kr,{fill:n[a.name]},a.name))})]})})})}function Cz(e){if(!e)return 0;const[t,r]=e.split(" ");let[n,i]=t.split(":").map(Number);return r==="PM"&&n!==12&&(n+=12),r==="AM"&&n===12&&(n=0),n*60+i}function kz(e){let t=Math.floor(e/60);const r=t>=12?"PM":"AM";return t=t%12||12,`${t} ${r}`}function Tz(e){const r={};for(let n=0;n<e.length;n++){const i=e[n],a=Cz(i.slot_start_time),o=Math.floor(a/240)*240,s=o+240,l=`${o}-${s}`;r[l]||(r[l]={time:kz(s),bookings:0,total:0}),r[l].bookings+=Number(i?.slot_bookings||0),r[l].total+=Number(i?.total_slots||0)}return Object.values(r)}function Mz({isStatic:e,data:t}){const r=Number(t?.totalBookings||0),n=Number(t?.totalSlots||0),i=Number(t?.utilizationRate||0),a=k.useMemo(()=>t?.slots?.length?Tz(t.slots):[],[t]),o=({active:l,payload:c,label:u})=>!l||!c||!c.length?null:y.jsxs("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:[u&&y.jsx("div",{className:"font-medium mb-1",children:u}),c.map((f,d)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:f.color,marginRight:6}}),f.name,": ",y.jsx("div",{className:"font-semibold",children:f.value})]},d))]}),s=a.length>0?Math.max(...a.map(l=>l.total),5):5;return y.jsxs(me,{title:"Facilities",period:"Today",icon:y.jsx(zg,{className:"!text-[24px] text-[#8B5CF6]"}),className:`${e&&"max-h-[305px]"} h-[305px] mb-4 break-inside-avoid`,children:[y.jsxs("div",{className:"grid grid-cols-3 gap-[24px] mb-[16px]",children:[y.jsxs("div",{className:"flex flex-col gap-[4px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Bookings"}),y.jsx("div",{className:"!m-0 !text-[24px] !leading-[28px] !font-medium text-[#8B5CF6]",children:r})]}),y.jsxs("div",{className:"flex flex-col gap-[4px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Total Slots"}),y.jsx("div",{className:"!m-0 !text-[24px] !leading-[28px] !font-medium text-[#F59E0B]",children:n})]}),y.jsxs("div",{className:"flex flex-col gap-[4px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Utilisation Rate"}),y.jsxs("div",{className:"!m-0 !text-[24px] !leading-[28px] !font-medium !text-[#329DFF]",children:[Number.isFinite(i)?i.toFixed(2):"0.00","%"]})]})]}),y.jsx("div",{className:"w-full h-[150px]",children:y.jsx(ii,{width:"100%",height:"100%",children:y.jsxs(Op,{data:a,margin:{top:0,right:0,left:0,bottom:0},children:[y.jsx(Yl,{strokeDasharray:"3 3",stroke:"#EBEBEB"}),y.jsx(Zl,{dataKey:"time",tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400},axisLine:!1,tickLine:!1}),y.jsx(Ql,{yAxisId:"left",domain:[0,s],tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400},axisLine:!1,tickLine:!1}),y.jsx(ni,{content:y.jsx(o,{})}),y.jsx(Gl,{yAxisId:"left",type:"monotone",dataKey:"bookings",name:"Bookings",stroke:"#8B5CF6",strokeWidth:2,dot:!1}),y.jsx(Gl,{yAxisId:"left",type:"monotone",dataKey:"total",name:"Total Slots",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",dot:!1})]})})})]})}function jz({data:e}){const t=e?.incomeSummary||{},r=e?.expenditureSummary||{};function n(i){if(i==null||isNaN(i))return"0";const a=Number(i);return a>=1e9?(a/1e9).toFixed(a%1e9===0?0:2)+"B":a>=1e6?(a/1e6).toFixed(a%1e6===0?0:2)+"M":a>=1e3?(a/1e3).toFixed(a%1e3===0?0:2)+"K":a.toFixed(a%1===0?0:2)}return y.jsx(me,{title:"Income",period:"This Month",icon:y.jsx(Vg,{className:"!text-[24px] text-green-600"}),className:"!gap-[16px] break-inside-avoid h-[232px] overflow-hidden",children:y.jsxs("div",{children:[y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mb-2",children:[y.jsx("div",{children:"Opening"}),y.jsx("div",{children:"Income"}),y.jsx("div",{children:"Collection"}),y.jsx("div",{children:"Closing"})]}),y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212] mb-2",children:[y.jsxs("div",{children:[n(t.opening_balance)," ",t?.currency_type]}),y.jsxs("div",{children:[n(t.income)," ",t?.currency_type]}),y.jsxs("div",{children:[n(t.collection)," ",t?.currency_type]}),y.jsxs("div",{children:[n(t.closing_balance)," ",t?.currency_type]})]}),y.jsx("hr",{className:"my-4 border-t border-dashed border-gray-300"}),y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsxs("div",{className:"flex items-center gap-[12px]",children:[y.jsx(Vg,{className:"!text-[24px] text-red-600"}),y.jsx("div",{style:{fontWeight:500,fontSize:"16px",lineHeight:"20px"},className:"!my-0 !font-medium !text-[16px] !leading-[20px] !text-[#121212]",children:"Expenditure"})]}),y.jsx("div",{className:"!text-[12px] !leading-[16px] !text-[#64748B]",children:"This Month"})]}),y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] text-[#64748B] mt-4 mb-2",children:[y.jsx("div",{children:"Opening"}),y.jsx("div",{children:"Expenditure"}),y.jsx("div",{children:"Payment"}),y.jsx("div",{children:"Outstanding"})]}),y.jsxs("div",{className:"grid grid-cols-4 !text-[12px] font-medium text-[#121212]",children:[y.jsxs("div",{children:[n(r.opening_balance)," ",r?.currency_type]}),y.jsxs("div",{children:[n(r.expenditure)," ",r?.currency_type]}),y.jsxs("div",{children:[n(r.payment)," ",r?.currency_type]}),y.jsxs("div",{children:[n(r.outstanding)," ",r?.currency_type]})]})]})})}function Dz(e){const t=e>=12?"PM":"AM";let r=e%12;return r===0&&(r=12),`${r} ${t}`}function Nz(e){const r={};for(let n=0;n<e.length;n++){const i=e[n],a=Number(i.hour??0),s=Math.floor(a/4)*4+4,l=s;r[l]||(r[l]={time:Dz(s),walkins:0,checkins:0}),r[l].walkins+=Number(i.walkins??0),r[l].checkins+=Number(i.preApproved??0)}return Object.values(r)}function Iz({isStatic:e,data:t}){const r={green:"#12B981",amber:"#F69E0A"},n=t?.summary?.activeWalkins||{},i=t?.summary?.preApprovedCheckins||{},a=t?.summary?.staffAttendance||{},o=t?.chart?.length>0?Nz(t.chart):[],s=({active:l,payload:c,label:u})=>!l||!c||!c.length?null:y.jsxs("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:[u&&y.jsx("div",{className:"font-medium mb-1",children:u}),c.map((f,d)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx("div",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:f.color,marginRight:6}}),f.name,": ",y.jsx("div",{className:"font-semibold",children:f.value})]},d))]});return y.jsx(me,{title:"Gate Updates",period:"Today",icon:y.jsx(Ug,{className:"!text-[24px] text-[#37CC6D]"}),className:`${e?"max-h-[303px]":""} h-[251px] mb-4 break-inside-avoid`,children:y.jsxs("div",{children:[y.jsxs("div",{className:"flex flex-wrap gap-x-2 gap-y-2 text-[14px] mb-2",children:[y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B]",children:"Active Walk-ins"}),y.jsxs("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium text-[#1FA05B] flex",children:[n.visitor_in??0,y.jsxs("div",{className:"!m-0 !text-[20px] !leading-[32px] !text-[#64748B]",children:["/",n.total_pass??0]})]})]}),y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B]",children:"Pre-approved Check-ins"}),y.jsxs("div",{className:"!m-0 text-[28px] leading-[32px] font-medium text-[#E7A015] flex",children:[i.expected_pass_scanned??0,y.jsxs("div",{className:"text-[20px] leading-[32px] text-[#64748B]",children:["/",i.total_expected_pass??0]})]})]}),y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B]",children:"Staff Attendance"}),y.jsxs("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium text-[#1FA05B] flex",children:[a.total_in_now??0,y.jsxs("div",{className:"!m-0 !text-[20px] !leading-[32px] !text-[#64748B]",children:["/",a.total_in_today??0]})]})]})]}),y.jsx("div",{className:"w-full h-[200px]",children:y.jsx(ii,{width:"100%",height:"60%",children:y.jsxs(Op,{data:o,margin:{top:0,right:0,left:0,bottom:0},children:[y.jsx(Zl,{dataKey:"time",tick:{fontSize:10,lineHeight:14,fill:"#121212",fontWeight:400}}),y.jsx(Ql,{yAxisId:"left",domain:[0,30],ticks:[0,10,20,30],tick:{fontSize:10,lineHeight:14,fill:"#64748B",fontWeight:400},axisLine:!1,tickLine:!1,width:25}),y.jsx(Yl,{strokeDasharray:"3 3",stroke:"#f3f4f6"}),y.jsx(ni,{content:y.jsx(s,{})}),y.jsx(Gl,{type:"monotone",dataKey:"walkins",stroke:r.green,strokeWidth:2,dot:!1,name:"Walk-ins"}),y.jsx(Op,{type:"monotone",dataKey:"checkins",stroke:r.amber,strokeWidth:2,strokeDasharray:"5 5",dot:!1,name:"Pre-approved"})]})})})]})})}function $z({isStatic:e,data:t}){const r=({value:c})=>{if(c==null||isNaN(c))return null;const u=c>=0;return y.jsx("div",{className:`p-1 rounded text-[10px] leading-[14px] font-medium ${u?"bg-[#F7FEFA] text-[#1FA05B]":"bg-[#FFF2F2] text-[#AB0000]"}`,children:u?`+${c}%`:`${c}%`})},n=[{name:"L1",value:Number(t?.today_L1||0)},{name:"L2",value:Number(t?.today_L2||0)},{name:"L3",value:Number(t?.today_L3||0)},{name:"No Level",value:Number(t?.today_NoLevel||0)}],a=n.reduce((c,u)=>c+u.value,0)===0?[{name:"No Data",value:1}]:n,o=["#1FA05B","#E7A015","#FA7E28","#EF4444","#CBD5E1"],s=({color:c})=>y.jsx("span",{style:{display:"inline-block",width:"8px",height:"8px",borderRadius:"50%",backgroundColor:c,marginRight:"6px"}}),l=({active:c,payload:u})=>!c||!u||!u.length?null:y.jsx("div",{className:"bg-black text-white !text-[12px] px-3 py-2 rounded-lg shadow-lg",children:u.map((f,d)=>y.jsxs("div",{className:"capitalize flex gap-[4px] items-center leading-relaxed",children:[y.jsx(s,{color:f.color}),f.name,": ",y.jsx("div",{className:"font-semibold",children:f.value})]},d))});return y.jsx(me,{title:"Helpdesk",period:"Today",icon:y.jsx(UC,{className:"!text-[24px] text-[#FA7E28]"}),className:`${e&&"max-h-[186px]"} h-[186px] mb-4 break-inside-avoid`,children:y.jsxs("div",{className:"flex gap-[12px] h-fit",children:[y.jsxs("div",{className:"w-[50%] flex flex-col gap-[28px]",children:[y.jsxs("div",{className:"flex flex-col gap-[8px]",children:[y.jsx("div",{className:"!m-0 !text-[12px] !leading-[16px] !text-[#64748B]",children:"Open Complaints"}),y.jsx("div",{className:"!m-0 !text-[28px] !leading-[32px] !font-medium text-[#FA7E28]",children:t?.today_open_complaints??0})]}),y.jsxs("div",{className:"!m-0 !text-[10px] !leading-[14px] !text-[#64748B] space-x-1",children:[y.jsx(r,{value:t?.percent_change}),y.jsx("div",{className:"whitespace-nowrap",children:"Compared to yesterday"})]})]}),y.jsx("div",{className:"w-[50%] h-[110px] flex justify-end",children:y.jsx(ii,{width:"75%",height:"100%",children:y.jsxs(rc,{children:[y.jsx(lo,{data:a,innerRadius:36,outerRadius:52,paddingAngle:2,dataKey:"value",children:a.map((c,u)=>y.jsx(kr,{fill:o[u]||"#CBD5E1"},c.name))}),y.jsx(ni,{content:y.jsx(l,{})})]})})})]})})}/*!
200
200
  * @kurkle/color v0.3.4
201
201
  * https://github.com/kurkle/color#readme
202
202
  * (c) 2024 Jukka Kurkela
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anarock-widgets",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "main": "dist/index.cjs.js",
5
5
  "module": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",