anarock-widgets 1.0.152 → 1.0.153
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +8 -7
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -273,4 +273,4 @@ Take a look at the reducer(s) handling this action type: ${p.type}.
|
|
|
273
273
|
* Released under the MIT License
|
|
274
274
|
*/class Zoe{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const o=n.listeners[i],a=n.duration;o.forEach(s=>s({chart:t,initial:n.initial,numSteps:a,currentStep:Math.min(r-n.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=uj.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const o=r.items;let a=o.length-1,s=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),s=!0):(o[a]=o[o.length-1],o.pop());s&&(i.draw(),this._notify(i,r,t,"progress")),o.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ci=new Zoe;const D2="transparent",Joe={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=y2(e||D2),i=r.valid&&y2(t||D2);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class eae{constructor(t,n,r,i){const o=n[r];i=md([t.to,i,o,t.from]);const a=md([t.from,o,i]);this._active=!0,this._fn=t.fn||Joe[t.type||typeof a],this._easing=cc[t.easing]||cc.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=a,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],o=r-this._start,a=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=md([t.to,n,i,t.from]),this._from=md([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,o=this._from,a=this._loop,s=this._to;let l;if(this._active=o!==s&&(a||n<r),!this._active){this._target[i]=s,this._notify(!0);return}if(n<0){this._target[i]=o;return}l=n/r%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(o,s,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}}class Ej{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Ae(t))return;const n=Object.keys(Nt.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const o=t[i];if(!Ae(o))return;const a={};for(const s of n)a[s]=o[s];(Xt(o.properties)&&o.properties||[i]).forEach(s=>{(s===i||!r.has(s))&&r.set(s,a)})})}_animateOptions(t,n){const r=n.options,i=nae(t,r);if(!i)return[];const o=this._createAnimations(i,r);return r.$shared&&tae(t.options.$animations,r).then(()=>{t.options=r},()=>{}),o}_createAnimations(t,n){const r=this._properties,i=[],o=t.$animations||(t.$animations={}),a=Object.keys(n),s=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,n));continue}const u=n[c];let d=o[c];const f=r.get(c);if(d)if(f&&d.active()){d.update(f,u,s);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}o[c]=d=new eae(f,t,c,u),i.push(d)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return Ci.add(this._chart,r),!0}}function tae(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const o=e[r[i]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function nae(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function T2(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:r?o:i,end:r?i:o}}function rae(e,t,n){if(n===!1)return!1;const r=T2(e,n),i=T2(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function iae(e){let t,n,r,i;return Ae(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function Oj(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,o;for(i=0,o=r.length;i<o;++i)n.push(r[i].index);return n}function A2(e,t,n,r={}){const i=e.keys,o=r.mode==="single";let a,s,l,c;if(t===null)return;let u=!1;for(a=0,s=i.length;a<s;++a){if(l=+i[a],l===n){if(u=!0,r.all)continue;break}c=e.values[l],Ar(c)&&(o||t===0||di(t)===di(c))&&(t+=c)}return!u&&!r.all?0:t}function oae(e,t){const{iScale:n,vScale:r}=t,i=n.axis==="x"?"x":"y",o=r.axis==="x"?"x":"y",a=Object.keys(e),s=new Array(a.length);let l,c,u;for(l=0,c=a.length;l<c;++l)u=a[l],s[l]={[i]:u,[o]:e[u]};return s}function Mg(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function aae(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function sae(e){const{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function lae(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function M2(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const o=e[i.index];if(n&&o>0||!n&&o<0)return i.index}return null}function N2(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:o,vScale:a,index:s}=r,l=o.axis,c=a.axis,u=aae(o,a,r),d=t.length;let f;for(let p=0;p<d;++p){const m=t[p],{[l]:h,[c]:g}=m,y=m._stacks||(m._stacks={});f=y[c]=lae(i,u,h),f[s]=g,f._top=M2(f,a,!0,r.type),f._bottom=M2(f,a,!1,r.type);const S=f._visualValues||(f._visualValues={});S[s]=g}}function Ng(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function cae(e,t){return qa(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function uae(e,t,n){return qa(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Rl(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const o=i._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const jg=e=>e==="reset"||e==="none",j2=(e,t)=>t?e:Object.assign({},e),dae=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Oj(n,!0),values:null};class xh{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Mg(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Rl(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,f,p,m)=>d==="x"?f:d==="r"?m:p,o=n.xAxisID=Se(r.xAxisID,Ng(t,"x")),a=n.yAxisID=Se(r.yAxisID,Ng(t,"y")),s=n.rAxisID=Se(r.rAxisID,Ng(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,o,a,s),u=n.vAxisID=i(l,a,o,s);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(a),n.rScale=this.getScaleForId(s),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&m2(this._data,this),t._stacked&&Rl(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Ae(n)){const i=this._cachedMeta;this._data=oae(n,i)}else if(r!==n){if(r){m2(r,this);const i=this._cachedMeta;Rl(i),i._parsed=[]}n&&Object.isExtensible(n)&&Hie(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const o=n._stacked;n._stacked=Mg(n.vScale,n),n.stack!==r.stack&&(i=!0,Rl(n),n.stack=r.stack),this._resyncElements(t),(i||o!==n._stacked)&&(N2(this,n._parsed),n._stacked=Mg(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:i}=this,{iScale:o,_stacked:a}=r,s=o.axis;let l=t===0&&n===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,f;if(this._parsing===!1)r._parsed=i,r._sorted=!0,f=i;else{Xt(i[t])?f=this.parseArrayData(r,i,t,n):Ae(i[t])?f=this.parseObjectData(r,i,t,n):f=this.parsePrimitiveData(r,i,t,n);const p=()=>d[s]===null||c&&d[s]<c[s];for(u=0;u<n;++u)r._parsed[u+t]=d=f[u],l&&(p()&&(l=!1),c=d);r._sorted=l}a&&N2(this,f)}parsePrimitiveData(t,n,r,i){const{iScale:o,vScale:a}=t,s=o.axis,l=a.axis,c=o.getLabels(),u=o===a,d=new Array(i);let f,p,m;for(f=0,p=i;f<p;++f)m=f+r,d[f]={[s]:u||o.parse(c[m],m),[l]:a.parse(n[m],m)};return d}parseArrayData(t,n,r,i){const{xScale:o,yScale:a}=t,s=new Array(i);let l,c,u,d;for(l=0,c=i;l<c;++l)u=l+r,d=n[u],s[l]={x:o.parse(d[0],u),y:a.parse(d[1],u)};return s}parseObjectData(t,n,r,i){const{xScale:o,yScale:a}=t,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,c=new Array(i);let u,d,f,p;for(u=0,d=i;u<d;++u)f=u+r,p=n[f],c[u]={x:o.parse(Wa(p,s),f),y:a.parse(Wa(p,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,o=this._cachedMeta,a=n[t.axis],s={keys:Oj(i,!0),values:n._stacks[t.axis]._visualValues};return A2(s,a,o.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const o=r[n.axis];let a=o===null?NaN:o;const s=i&&r._stacks[n.axis];i&&s&&(i.values=s,a=A2(i,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,o=r._sorted&&t===r.iScale,a=i.length,s=this._getOtherScale(t),l=dae(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=sae(s);let f,p;function m(){p=i[f];const h=p[s.axis];return!Ar(p[t.axis])||u>h||d<h}for(f=0;f<a&&!(!m()&&(this.updateRangeFromParsed(c,t,p,l),o));++f);if(o){for(f=a-1;f>=0;--f)if(!m()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,o,a;for(i=0,o=n.length;i<o;++i)a=n[i][t.axis],Ar(a)&&r.push(a);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,o=this.getParsed(t);return{label:r?""+r.getLabelForValue(o[r.axis]):"",value:i?""+i.getLabelForValue(o[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=iae(Se(this.options.clip,rae(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],o=n.chartArea,a=[],s=this._drawStart||0,l=this._drawCount||i.length-s,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,o,s,l),u=s;u<s+l;++u){const d=i[u];d.hidden||(d.active&&c?a.push(d):d.draw(t,o))}for(u=0;u<a.length;++u)a[u].draw(t,o)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const i=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];o=a.$context||(a.$context=uae(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=i.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=cae(this.chart.getContext(),this.index)),o.dataset=i,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=r,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const i=n==="active",o=this._cachedDataOpts,a=t+"-"+n,s=o[a],l=this.enableOptionSharing&&$c(r);if(s)return j2(s,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),p=Object.keys(Nt.elements[t]),m=()=>this.getContext(r,i,n),h=c.resolveNamedOptions(f,p,m,d);return h.$shared&&(h.$shared=l,o[a]=Object.freeze(j2(h,l))),h}_resolveAnimations(t,n,r){const i=this.chart,o=this._cachedDataOpts,a=`animation-${n}`,s=o[a];if(s)return s;let l;if(i.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,r,n))}const c=new Ej(i,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||jg(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,o=this.getSharedOptions(r),a=this.includeOptions(n,o)||o!==i;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:a}}updateElement(t,n,r,i){jg(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!jg(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const o=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[s,l,c]of this._syncList)this[s](l,c);this._syncList=[];const i=r.length,o=n.length,a=Math.min(o,i);a&&this.parse(0,a),o>i?this._insertElements(i,o-i,t):o<i&&this._removeElements(o,i-o)}_insertElements(t,n,r=!0){const i=this._cachedMeta,o=i.data,a=t+n;let s;const l=c=>{for(c.length+=n,s=c.length-1;s>=a;s--)c[s]=c[s-n]};for(l(o),s=t;s<a;++s)o[s]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(o,t,n,"reset")}updateElements(t,n,r,i){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,n);r._stacked&&Rl(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function fae(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let i=0,o=n.length;i<o;i++)r=r.concat(n[i].controller.getAllParsedValues(e));e._cache.$bar=cj(r.sort((i,o)=>i-o))}return e._cache.$bar}function pae(e){const t=e.iScale,n=fae(t,e.type);let r=t._length,i,o,a,s;const l=()=>{a===32767||a===-32768||($c(s)&&(r=Math.min(r,Math.abs(a-s)||r)),s=a)};for(i=0,o=n.length;i<o;++i)a=t.getPixelForValue(n[i]),l();for(s=void 0,i=0,o=t.ticks.length;i<o;++i)a=t.getPixelForTick(i),l();return r}function hae(e,t,n,r){const i=n.barThickness;let o,a;return Ye(i)?(o=t.min*n.categoryPercentage,a=n.barPercentage):(o=i*r,a=1),{chunk:o/r,ratio:a,start:t.pixels[e]-o/2}}function mae(e,t,n,r){const i=t.pixels,o=i[e];let a=e>0?i[e-1]:null,s=e<i.length-1?i[e+1]:null;const l=n.categoryPercentage;a===null&&(a=o-(s===null?t.end-t.start:s-o)),s===null&&(s=o+o-a);const c=o-(o-Math.min(a,s))/2*l;return{chunk:Math.abs(s-a)/2*l/r,ratio:n.barPercentage,start:c}}function gae(e,t,n,r){const i=n.parse(e[0],r),o=n.parse(e[1],r),a=Math.min(i,o),s=Math.max(i,o);let l=a,c=s;Math.abs(a)>Math.abs(s)&&(l=s,c=a),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:i,end:o,min:a,max:s}}function Pj(e,t,n,r){return Xt(e)?gae(e,t,n,r):t[n.axis]=n.parse(e,r),t}function R2(e,t,n,r){const i=e.iScale,o=e.vScale,a=i.getLabels(),s=i===o,l=[];let c,u,d,f;for(c=n,u=n+r;c<u;++c)f=t[c],d={},d[i.axis]=s||i.parse(a[c],c),l.push(Pj(f,d,o,c));return l}function Rg(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function vae(e,t,n){return e!==0?di(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function yae(e){let t,n,r,i,o;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(i="end",o="start"):(i="start",o="end"),{start:n,end:r,reverse:t,top:i,bottom:o}}function bae(e,t,n,r){let i=t.borderSkipped;const o={};if(!i){e.borderSkipped=o;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:s,reverse:l,top:c,bottom:u}=yae(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=c:(n._bottom||0)===r?i=u:(o[I2(u,a,s,l)]=!0,i=c)),o[I2(i,a,s,l)]=!0,e.borderSkipped=o}function I2(e,t,n,r){return r?(e=xae(e,t,n),e=L2(e,n,t)):e=L2(e,t,n),e}function xae(e,t,n){return e===t?n:e===n?t:e}function L2(e,t,n){return e==="start"?t:e==="end"?n:e}function wae(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class _ae extends xh{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,n,r,i){return R2(t,n,r,i)}parseArrayData(t,n,r,i){return R2(t,n,r,i)}parseObjectData(t,n,r,i){const{iScale:o,vScale:a}=t,{xAxisKey:s="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?s:l,u=a.axis==="x"?s:l,d=[];let f,p,m,h;for(f=r,p=r+i;f<p;++f)h=n[f],m={},m[o.axis]=o.parse(Wa(h,c),f),d.push(Pj(Wa(h,u),m,a,f));return d}updateRangeFromParsed(t,n,r,i){super.updateRangeFromParsed(t,n,r,i);const o=r._custom;o&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:i}=n,o=this.getParsed(t),a=o._custom,s=Rg(a)?"["+a.start+", "+a.end+"]":""+i.getLabelForValue(o[i.axis]);return{label:""+r.getLabelForValue(o[r.axis]),value:s}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,i){const o=i==="reset",{index:a,_cachedMeta:{vScale:s}}=this,l=s.getBasePixel(),c=s.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(n,i);for(let p=n;p<n+r;p++){const m=this.getParsed(p),h=o||Ye(m[s.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),g=this._calculateBarIndexPixels(p,u),y=(m._stacks||{})[s.axis],S={horizontal:c,base:h.base,enableBorderRadius:!y||Rg(m._custom)||a===y._top||a===y._bottom,x:c?h.head:g.center,y:c?g.center:h.head,height:c?g.size:Math.abs(h.size),width:c?Math.abs(h.size):g.size};f&&(S.options=d||this.resolveDataElementOptions(p,t[p].active?"active":i));const w=S.options||t[p].options;bae(S,w,y,a),wae(S,w,u.ratio),this.updateElement(t[p],p,S,i)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),o=r.options.stacked,a=[],s=this._cachedMeta.controller.getParsed(n),l=s&&s[r.axis],c=u=>{const d=u._parsed.find(p=>p[r.axis]===l),f=d&&d[u.vScale.axis];if(Ye(f)||isNaN(f))return!0};for(const u of i)if(!(n!==void 0&&c(u))&&((o===!1||a.indexOf(u.stack)===-1||o===void 0&&u.stack===void 0)&&a.push(u.stack),u.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(r=>t[r].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)t[Se(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,r){const i=this._getStacks(t,r),o=n!==void 0?i.indexOf(n):-1;return o===-1?i.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,i=[];let o,a;for(o=0,a=n.data.length;o<a;++o)i.push(r.getPixelForValue(this.getParsed(o)[r.axis],o));const s=t.barThickness;return{min:s||pae(n),pixels:i,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:s?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:i},options:{base:o,minBarLength:a}}=this,s=o||0,l=this.getParsed(t),c=l._custom,u=Rg(c);let d=l[n.axis],f=0,p=r?this.applyStack(n,l,r):d,m,h;p!==d&&(f=p-d,p=d),u&&(d=c.barStart,p=c.barEnd-c.barStart,d!==0&&di(d)!==di(c.barEnd)&&(f=0),f+=d);const g=!Ye(o)&&!u?o:f;let y=n.getPixelForValue(g);if(this.chart.getDataVisibility(t)?m=n.getPixelForValue(f+p):m=y,h=m-y,Math.abs(h)<a){h=vae(h,n,s)*a,d===s&&(y-=h/2);const S=n.getPixelForDecimal(0),w=n.getPixelForDecimal(1),x=Math.min(S,w),_=Math.max(S,w);y=Math.max(Math.min(y,_),x),m=y+h,r&&!u&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(m)-n.getValueForPixel(y))}if(y===n.getPixelForValue(s)){const S=di(h)*n.getLineWidthForValue(s)/2;y+=S,h-=S}return{size:h,base:y,head:m,center:m+h/2}}_calculateBarIndexPixels(t,n){const r=n.scale,i=this.options,o=i.skipNull,a=Se(i.maxBarThickness,1/0);let s,l;const c=this._getAxisCount();if(n.grouped){const u=o?this._getStackCount(t):n.stackCount,d=i.barThickness==="flex"?mae(t,n,i,u*c):hae(t,n,i,u*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,p=this._getAxis().indexOf(Se(f,this.getFirstScaleIdForIndexAxis())),m=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+p;s=d.start+d.chunk*m+d.chunk/2,l=Math.min(a,d.chunk*d.ratio)}else s=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(a,n.min*n.ratio);return{base:s-l/2,head:s+l/2,center:s,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,i=r.length;let o=0;for(;o<i;++o)this.getParsed(o)[n.axis]!==null&&!r[o].hidden&&r[o].draw(this._ctx)}}function Sae(e,t,n){let r=1,i=1,o=0,a=0;if(t<Pt){const s=e,l=s+t,c=Math.cos(s),u=Math.sin(s),d=Math.cos(l),f=Math.sin(l),p=(w,x,_)=>Wc(w,s,l,!0)?1:Math.max(x,x*n,_,_*n),m=(w,x,_)=>Wc(w,s,l,!0)?-1:Math.min(x,x*n,_,_*n),h=p(0,c,d),g=p(Vt,u,f),y=m(rt,c,d),S=m(rt+Vt,u,f);r=(h-y)/2,i=(g-S)/2,o=-(h+y)/2,a=-(g+S)/2}return{ratioX:r,ratioY:i,offsetX:o,offsetY:a}}class Eae extends xh{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((o,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}};constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=r;else{let o=l=>+r[l];if(Ae(r[t])){const{key:l="value"}=this._parsing;o=c=>+Wa(r[c],l)}let a,s;for(a=t,s=t+n;a<s;++a)i._parsed[a]=o(a)}}_getRotation(){return Li(this.options.rotation-90)}_getCircumference(){return Li(this.options.circumference)}_getRotationExtents(){let t=Pt,n=-Pt;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const i=this.chart.getDatasetMeta(r).controller,o=i._getRotation(),a=i._getCircumference();t=Math.min(t,o),n=Math.max(n,o+a)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,i=this._cachedMeta,o=i.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,s=Math.max((Math.min(r.width,r.height)-a)/2,0),l=Math.min(Cie(this.options.cutout,s),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:p,offsetX:m,offsetY:h}=Sae(d,u,l),g=(r.width-a)/f,y=(r.height-a)/p,S=Math.max(Math.min(g,y)/2,0),w=ij(this.options.radius,S),x=Math.max(w*l,0),_=(w-x)/this._getVisibleDatasetWeightTotal();this.offsetX=m*w,this.offsetY=h*w,i.total=this.calculateTotal(),this.outerRadius=w-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const r=this.options,i=this._cachedMeta,o=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*o/Pt)}updateElements(t,n,r,i){const o=i==="reset",a=this.chart,s=a.chartArea,c=a.options.animation,u=(s.left+s.right)/2,d=(s.top+s.bottom)/2,f=o&&c.animateScale,p=f?0:this.innerRadius,m=f?0:this.outerRadius,{sharedOptions:h,includeOptions:g}=this._getSharedOptions(n,i);let y=this._getRotation(),S;for(S=0;S<n;++S)y+=this._circumference(S,o);for(S=n;S<n+r;++S){const w=this._circumference(S,o),x=t[S],_={x:u+this.offsetX,y:d+this.offsetY,startAngle:y,endAngle:y+w,circumference:w,outerRadius:m,innerRadius:p};g&&(_.options=h||this.resolveDataElementOptions(S,x.active?"active":i)),y+=w,this.updateElement(x,S,_,i)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,i;for(i=0;i<n.length;i++){const o=t._parsed[i];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(r+=Math.abs(o))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Pt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],o=fx(n._parsed[t],r.options.locale);return{label:i[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const r=this.chart;let i,o,a,s,l;if(!t){for(i=0,o=r.data.datasets.length;i<o;++i)if(r.isDatasetVisible(i)){a=r.getDatasetMeta(i),t=a.data,s=a.controller;break}}if(!t)return 0;for(i=0,o=t.length;i<o;++i)l=s.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,i=t.length;r<i;++r){const o=this.resolveDataElementOptions(r);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(Se(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Oae extends xh{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:o}=n,a=this.chart._animationsDisabled;let{start:s,count:l}=Kie(n,i,a);this._drawStart=s,this._drawCount=l,qie(n)&&(s=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!o._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!a,options:c},t),this.updateElements(i,s,l,t)}updateElements(t,n,r,i){const o=i==="reset",{iScale:a,vScale:s,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,i),f=a.axis,p=s.axis,{spanGaps:m,segment:h}=this.options,g=Bc(m)?m:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||o||i==="none",S=n+r,w=t.length;let x=n>0&&this.getParsed(n-1);for(let _=0;_<w;++_){const E=t[_],C=y?E:{};if(_<n||_>=S){C.skip=!0;continue}const D=this.getParsed(_),A=Ye(D[p]),R=C[f]=a.getPixelForValue(D[f],_),T=C[p]=o||A?s.getBasePixel():s.getPixelForValue(l?this.applyStack(s,D,l):D[p],_);C.skip=isNaN(R)||isNaN(T)||A,C.stop=_>0&&Math.abs(D[f]-x[f])>g,h&&(C.parsed=D,C.raw=c.data[_]),d&&(C.options=u||this.resolveDataElementOptions(_,E.active?"active":i)),y||this.updateElement(E,_,C,i),x=D}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const o=i[0].size(this.resolveDataElementOptions(0)),a=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}function na(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class wx{static override(t){Object.assign(wx.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return na()}parse(){return na()}format(){return na()}add(){return na()}diff(){return na()}startOf(){return na()}endOf(){return na()}}var Pae={_date:wx};function Cae(e,t,n,r){const{controller:i,data:o,_sorted:a}=e,s=i._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(s&&t===s.axis&&t!=="r"&&a&&o.length){const c=s._reversePixels?zie:wa;if(r){if(i._sharedOptions){const u=o[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const f=c(o,t,n-d),p=c(o,t,n+d);return{lo:f.lo,hi:p.hi}}}}else{const u=c(o,t,n);if(l){const{vScale:d}=i._cachedMeta,{_parsed:f}=e,p=f.slice(0,u.lo+1).reverse().findIndex(h=>!Ye(h[d.axis]));u.lo-=Math.max(0,p);const m=f.slice(u.hi).findIndex(h=>!Ye(h[d.axis]));u.hi+=Math.max(0,m)}return u}}return{lo:0,hi:o.length-1}}function wh(e,t,n,r,i){const o=e.getSortedVisibleDatasetMetas(),a=n[t];for(let s=0,l=o.length;s<l;++s){const{index:c,data:u}=o[s],{lo:d,hi:f}=Cae(o[s],t,a,i);for(let p=d;p<=f;++p){const m=u[p];m.skip||r(m,c,p)}}}function kae(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const o=t?Math.abs(r.x-i.x):0,a=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function Ig(e,t,n,r,i){const o=[];return!i&&!e.isPointInArea(t)||wh(e,n,t,function(s,l,c){!i&&!zc(s,e.chartArea,0)||s.inRange(t.x,t.y,r)&&o.push({element:s,datasetIndex:l,index:c})},!0),o}function Dae(e,t,n,r){let i=[];function o(a,s,l){const{startAngle:c,endAngle:u}=a.getProps(["startAngle","endAngle"],r),{angle:d}=sj(a,{x:t.x,y:t.y});Wc(d,c,u)&&i.push({element:a,datasetIndex:s,index:l})}return wh(e,n,t,o),i}function Tae(e,t,n,r,i,o){let a=[];const s=kae(n);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const p=u.inRange(t.x,t.y,i);if(r&&!p)return;const m=u.getCenterPoint(i);if(!(!!o||e.isPointInArea(m))&&!p)return;const g=s(t,m);g<l?(a=[{element:u,datasetIndex:d,index:f}],l=g):g===l&&a.push({element:u,datasetIndex:d,index:f})}return wh(e,n,t,c),a}function Lg(e,t,n,r,i,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!r?Dae(e,t,n,i):Tae(e,t,n,r,i,o)}function F2(e,t,n,r,i){const o=[],a=n==="x"?"inXRange":"inYRange";let s=!1;return wh(e,n,t,(l,c,u)=>{l[a]&&l[a](t[n],i)&&(o.push({element:l,datasetIndex:c,index:u}),s=s||l.inRange(t.x,t.y,i))}),r&&!s?[]:o}var Aae={modes:{index(e,t,n,r){const i=da(t,e),o=n.axis||"x",a=n.includeInvisible||!1,s=n.intersect?Ig(e,i,o,r,a):Lg(e,i,o,!1,r,a),l=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=s[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const i=da(t,e),o=n.axis||"xy",a=n.includeInvisible||!1;let s=n.intersect?Ig(e,i,o,r,a):Lg(e,i,o,!1,r,a);if(s.length>0){const l=s[0].datasetIndex,c=e.getDatasetMeta(l).data;s=[];for(let u=0;u<c.length;++u)s.push({element:c[u],datasetIndex:l,index:u})}return s},point(e,t,n,r){const i=da(t,e),o=n.axis||"xy",a=n.includeInvisible||!1;return Ig(e,i,o,r,a)},nearest(e,t,n,r){const i=da(t,e),o=n.axis||"xy",a=n.includeInvisible||!1;return Lg(e,i,o,n.intersect,r,a)},x(e,t,n,r){const i=da(t,e);return F2(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=da(t,e);return F2(e,i,"y",n.intersect,r)}}};const Cj=["left","top","right","bottom"];function Il(e,t){return e.filter(n=>n.pos===t)}function $2(e,t){return e.filter(n=>Cj.indexOf(n.pos)===-1&&n.box.axis===t)}function Ll(e,t){return e.sort((n,r)=>{const i=t?r:n,o=t?n:r;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function Mae(e){const t=[];let n,r,i,o,a,s;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:o,options:{stack:a,stackWeight:s=1}}=i,t.push({index:n,box:i,pos:o,horizontal:i.isHorizontal(),weight:i.weight,stack:a&&o+a,stackWeight:s});return t}function Nae(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:o}=n;if(!r||!Cj.includes(i))continue;const a=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function jae(e,t){const n=Nae(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let o,a,s;for(o=0,a=e.length;o<a;++o){s=e[o];const{fullSize:l}=s.box,c=n[s.stack],u=c&&s.stackWeight/c.weight;s.horizontal?(s.width=u?u*r:l&&t.availableWidth,s.height=i):(s.width=r,s.height=u?u*i:l&&t.availableHeight)}return n}function Rae(e){const t=Mae(e),n=Ll(t.filter(c=>c.box.fullSize),!0),r=Ll(Il(t,"left"),!0),i=Ll(Il(t,"right")),o=Ll(Il(t,"top"),!0),a=Ll(Il(t,"bottom")),s=$2(t,"x"),l=$2(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:i.concat(l).concat(a).concat(s),chartArea:Il(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:o.concat(a).concat(s)}}function B2(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function kj(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Iae(e,t,n,r){const{pos:i,box:o}=n,a=e.maxPadding;if(!Ae(i)){n.size&&(e[i]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?o.height:o.width),n.size=d.size/d.count,e[i]+=n.size}o.getPadding&&kj(a,o.getPadding());const s=Math.max(0,t.outerWidth-B2(a,e,"left","right")),l=Math.max(0,t.outerHeight-B2(a,e,"top","bottom")),c=s!==e.w,u=l!==e.h;return e.w=s,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function Lae(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function Fae(e,t){const n=t.maxPadding;function r(i){const o={left:0,top:0,right:0,bottom:0};return i.forEach(a=>{o[a]=Math.max(t[a],n[a])}),o}return r(e?["left","right"]:["top","bottom"])}function Ql(e,t,n,r){const i=[];let o,a,s,l,c,u;for(o=0,a=e.length,c=0;o<a;++o){s=e[o],l=s.box,l.update(s.width||t.w,s.height||t.h,Fae(s.horizontal,t));const{same:d,other:f}=Iae(t,n,s,r);c|=d&&i.length,u=u||f,l.fullSize||i.push(s)}return c&&Ql(i,t,n,r)||u}function bd(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function W2(e,t,n,r){const i=n.padding;let{x:o,y:a}=t;for(const s of e){const l=s.box,c=r[s.stack]||{placed:0,weight:1},u=s.stackWeight/c.weight||1;if(s.horizontal){const d=t.w*u,f=c.size||l.height;$c(c.start)&&(a=c.start),l.fullSize?bd(l,i.left,a,n.outerWidth-i.right-i.left,f):bd(l,t.left+c.placed,a,d,f),c.start=a,c.placed+=d,a=l.bottom}else{const d=t.h*u,f=c.size||l.width;$c(c.start)&&(o=c.start),l.fullSize?bd(l,o,i.top,f,n.outerHeight-i.bottom-i.top):bd(l,o,t.top+c.placed,f,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=a}var wo={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const i=Wr(e.options.layout.padding),o=Math.max(t-i.width,0),a=Math.max(n-i.height,0),s=Rae(e.boxes),l=s.vertical,c=s.horizontal;Xe(e.boxes,h=>{typeof h.beforeLayout=="function"&&h.beforeLayout()});const u=l.reduce((h,g)=>g.box.options&&g.box.options.display===!1?h:h+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/u,hBoxMaxHeight:a/2}),f=Object.assign({},i);kj(f,Wr(r));const p=Object.assign({maxPadding:f,w:o,h:a,x:i.left,y:i.top},i),m=jae(l.concat(c),d);Ql(s.fullSize,p,d,m),Ql(l,p,d,m),Ql(c,p,d,m)&&Ql(l,p,d,m),Lae(p),W2(s.leftAndTop,p,d,m),p.x+=p.w,p.y+=p.h,W2(s.rightAndBottom,p,d,m),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},Xe(s.chartArea,h=>{const g=h.box;Object.assign(g,e.chartArea),g.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class Dj{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class $ae extends Dj{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const $d="$chartjs",Bae={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},z2=e=>e===null||e==="";function Wae(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[$d]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",z2(i)){const o=O2(e,"width");o!==void 0&&(e.width=o)}if(z2(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=O2(e,"height");o!==void 0&&(e.height=o)}return e}const Tj=Loe?{passive:!0}:!1;function zae(e,t,n){e&&e.addEventListener(t,n,Tj)}function Vae(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Tj)}function Hae(e,t){const n=Bae[e.type]||e.type,{x:r,y:i}=da(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function np(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function Yae(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let a=!1;for(const s of o)a=a||np(s.addedNodes,r),a=a&&!np(s.removedNodes,r);a&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function Uae(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let a=!1;for(const s of o)a=a||np(s.removedNodes,r),a=a&&!np(s.addedNodes,r);a&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const Vc=new Map;let V2=0;function Aj(){const e=window.devicePixelRatio;e!==V2&&(V2=e,Vc.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Kae(e,t){Vc.size||window.addEventListener("resize",Aj),Vc.set(e,t)}function qae(e){Vc.delete(e),Vc.size||window.removeEventListener("resize",Aj)}function Gae(e,t,n){const r=e.canvas,i=r&&xx(r);if(!i)return;const o=dj((s,l)=>{const c=i.clientWidth;n(s,l),c<i.clientWidth&&n()},window),a=new ResizeObserver(s=>{const l=s[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return a.observe(i),Kae(e,o),a}function Fg(e,t,n){n&&n.disconnect(),t==="resize"&&qae(e)}function Xae(e,t,n){const r=e.canvas,i=dj(o=>{e.ctx!==null&&n(Hae(o,e))},e);return zae(r,t,i),i}class Qae extends Dj{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(Wae(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[$d])return!1;const r=n[$d].initial;["height","width"].forEach(o=>{const a=r[o];Ye(a)?n.removeAttribute(o):n.setAttribute(o,a)});const i=r.style||{};return Object.keys(i).forEach(o=>{n.style[o]=i[o]}),n.width=n.width,delete n[$d],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),a={attach:Yae,detach:Uae,resize:Gae}[n]||Xae;i[n]=a(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:Fg,detach:Fg,resize:Fg}[n]||Vae)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return Ioe(t,n,r,i)}isAttached(t){const n=t&&xx(t);return!!(n&&n.isConnected)}}function Zae(e){return!bx()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?$ae:Qae}let Ko=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return Bc(this.x)&&Bc(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(o=>{i[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),i}};function Jae(e,t){const n=e.options.ticks,r=ese(e),i=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?nse(t):[],a=o.length,s=o[0],l=o[a-1],c=[];if(a>i)return rse(t,c,o,a/i),c;const u=tse(o,t,i);if(a>0){let d,f;const p=a>1?Math.round((l-s)/(a-1)):null;for(xd(t,c,u,Ye(p)?0:s-p,s),d=0,f=a-1;d<f;d++)xd(t,c,u,o[d],o[d+1]);return xd(t,c,u,l,Ye(p)?t.length:l+p),c}return xd(t,c,u),c}function ese(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function tse(e,t,n){const r=ise(e),i=t.length/n;if(!r)return Math.max(i,1);const o=Rie(r);for(let a=0,s=o.length-1;a<s;a++){const l=o[a];if(l>i)return l}return Math.max(i,1)}function nse(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function rse(e,t,n,r){let i=0,o=n[0],a;for(r=Math.ceil(r),a=0;a<e.length;a++)a===o&&(t.push(e[a]),i++,o=n[i*r])}function xd(e,t,n,r,i){const o=Se(r,0),a=Math.min(Se(i,e.length),e.length);let s=0,l,c,u;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),u=o;u<0;)s++,u=Math.round(o+s*n);for(c=Math.max(o,0);c<a;c++)c===u&&(t.push(e[c]),s++,u=Math.round(o+s*n))}function ise(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const ose=e=>e==="left"?"right":e==="right"?"left":e,H2=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Y2=(e,t)=>Math.min(t||e,e);function U2(e,t){const n=[],r=e.length/t,i=e.length;let o=0;for(;o<i;o+=r)n.push(e[Math.floor(o)]);return n}function ase(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),o=e._startPixel,a=e._endPixel,s=1e-6;let l=e.getPixelForTick(i),c;if(!(n&&(r===1?c=Math.max(l-o,a-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<o-s||l>a+s)))return l}function sse(e,t){Xe(e,n=>{const r=n.gc,i=r.length/2;let o;if(i>t){for(o=0;o<i;++o)delete n.data[r[o]];r.splice(0,i)}})}function Fl(e){return e.drawTicks?e.tickLength:0}function K2(e,t){if(!e.display)return 0;const n=Yn(e.font,t),r=Wr(e.padding);return(Xt(e.text)?e.text.length:1)*n.lineHeight+r.height}function lse(e,t){return qa(e,{scale:t,type:"scale"})}function cse(e,t,n){return qa(e,{tick:n,index:t,type:"tick"})}function use(e,t,n){let r=fj(e);return(n&&t!=="right"||!n&&t==="right")&&(r=ose(r)),r}function dse(e,t,n,r){const{top:i,left:o,bottom:a,right:s,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,f,p,m;const h=a-i,g=s-o;if(e.isHorizontal()){if(p=Jn(r,o,s),Ae(n)){const y=Object.keys(n)[0],S=n[y];m=u[y].getPixelForValue(S)+h-t}else n==="center"?m=(c.bottom+c.top)/2+h-t:m=H2(e,n,t);f=s-o}else{if(Ae(n)){const y=Object.keys(n)[0],S=n[y];p=u[y].getPixelForValue(S)-g+t}else n==="center"?p=(c.left+c.right)/2-g+t:p=H2(e,n,t);m=Jn(r,a,i),d=n==="left"?-Vt:Vt}return{titleX:p,titleY:m,maxWidth:f,rotation:d}}class dl extends Ko{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:i}=this;return t=Kr(t,Number.POSITIVE_INFINITY),n=Kr(n,Number.NEGATIVE_INFINITY),r=Kr(r,Number.POSITIVE_INFINITY),i=Kr(i,Number.NEGATIVE_INFINITY),{min:Kr(t,r),max:Kr(n,i),minDefined:Ar(t),maxDefined:Ar(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:o}=this.getUserBounds(),a;if(i&&o)return{min:n,max:r};const s=this.getMatchingVisibleMetas();for(let l=0,c=s.length;l<c;++l)a=s[l].controller.getMinMax(this,t),i||(n=Math.min(n,a.min)),o||(r=Math.max(r,a.max));return n=o&&n>r?r:n,r=i&&n>r?n:r,{min:Kr(n,Kr(r,n)),max:Kr(r,Kr(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){ct(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:o,ticks:a}=this.options,s=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=hoe(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=s<this.ticks.length;this._convertTicksToLabels(l?U2(this.ticks,s):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Jae(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){ct(this.options.afterUpdate,[this])}beforeSetDimensions(){ct(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){ct(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),ct(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ct(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,o;for(r=0,i=t.length;r<i;r++)o=t[r],o.label=ct(n.callback,[o.value,r,t],this)}afterTickToLabelConversion(){ct(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ct(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Y2(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,o=n.maxRotation;let a=i,s,l,c;if(!this._isVisible()||!n.display||i>=o||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,p=bn(this.chart.width-d,0,this.maxWidth);s=t.offset?this.maxWidth/r:p/(r-1),d+6>s&&(s=p/(r-(t.offset?.5:1)),l=this.maxHeight-Fl(t.grid)-n.padding-K2(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),a=$ie(Math.min(Math.asin(bn((u.highest.height+6)/s,-1,1)),Math.asin(bn(l/c,-1,1))-Math.asin(bn(f/c,-1,1)))),a=Math.max(i,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){ct(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ct(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:o}}=this,a=this._isVisible(),s=this.isHorizontal();if(a){const l=K2(i,n.options.font);if(s?(t.width=this.maxWidth,t.height=Fl(o)+l):(t.height=this.maxHeight,t.width=Fl(o)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),p=r.padding*2,m=Li(this.labelRotation),h=Math.cos(m),g=Math.sin(m);if(s){const y=r.mirror?0:g*d.width+h*f.height;t.height=Math.min(this.maxHeight,t.height+y+p)}else{const y=r.mirror?0:h*d.width+g*f.height;t.width=Math.min(this.maxWidth,t.width+y+p)}this._calculatePadding(c,u,g,h)}}this._handleMargins(),s?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,i){const{ticks:{align:o,padding:a},position:s}=this.options,l=this.labelRotation!==0,c=s!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,p=0;l?c?(f=i*t.width,p=r*n.height):(f=r*t.height,p=i*n.width):o==="start"?p=n.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,p=n.width/2),this.paddingLeft=Math.max((f-u+a)*this.width/(this.width-u),0),this.paddingRight=Math.max((p-d+a)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;o==="start"?(u=0,d=t.height):o==="end"&&(u=n.height,d=0),this.paddingTop=u+a,this.paddingBottom=d+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){ct(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)Ye(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=U2(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:o}=this,a=[],s=[],l=Math.floor(n/Y2(n,r));let c=0,u=0,d,f,p,m,h,g,y,S,w,x,_;for(d=0;d<n;d+=l){if(m=t[d].label,h=this._resolveTickFontOptions(d),i.font=g=h.string,y=o[g]=o[g]||{data:{},gc:[]},S=h.lineHeight,w=x=0,!Ye(m)&&!Xt(m))w=x2(i,y.data,y.gc,w,m),x=S;else if(Xt(m))for(f=0,p=m.length;f<p;++f)_=m[f],!Ye(_)&&!Xt(_)&&(w=x2(i,y.data,y.gc,w,_),x+=S);a.push(w),s.push(x),c=Math.max(w,c),u=Math.max(x,u)}sse(o,n);const E=a.indexOf(c),C=s.indexOf(u),D=A=>({width:a[A]||0,height:s[A]||0});return{first:D(0),last:D(n-1),widest:D(E),highest:D(C),widths:a,heights:s}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return Wie(this._alignToPixels?ta(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=cse(this.getContext(),t,r))}return this.$context||(this.$context=lse(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Li(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,s=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*r>s*i?s/r:l/i:l*i<s*r?l/r:s/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:o,position:a,border:s}=i,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Fl(o),p=[],m=s.setContext(this.getContext()),h=m.display?m.width:0,g=h/2,y=function(L){return ta(r,L,h)};let S,w,x,_,E,C,D,A,R,T,O,N;if(a==="top")S=y(this.bottom),C=this.bottom-f,A=S-g,T=y(t.top)+g,N=t.bottom;else if(a==="bottom")S=y(this.top),T=t.top,N=y(t.bottom)-g,C=S+g,A=this.top+f;else if(a==="left")S=y(this.right),E=this.right-f,D=S-g,R=y(t.left)+g,O=t.right;else if(a==="right")S=y(this.left),R=t.left,O=y(t.right)-g,E=S+g,D=this.left+f;else if(n==="x"){if(a==="center")S=y((t.top+t.bottom)/2+.5);else if(Ae(a)){const L=Object.keys(a)[0],$=a[L];S=y(this.chart.scales[L].getPixelForValue($))}T=t.top,N=t.bottom,C=S+g,A=C+f}else if(n==="y"){if(a==="center")S=y((t.left+t.right)/2);else if(Ae(a)){const L=Object.keys(a)[0],$=a[L];S=y(this.chart.scales[L].getPixelForValue($))}E=S-g,D=E-f,R=t.left,O=t.right}const M=Se(i.ticks.maxTicksLimit,d),I=Math.max(1,Math.ceil(d/M));for(w=0;w<d;w+=I){const L=this.getContext(w),$=o.setContext(L),V=s.setContext(L),W=$.lineWidth,B=$.color,X=V.dash||[],q=V.dashOffset,re=$.tickWidth,J=$.tickColor,ee=$.tickBorderDash||[],ie=$.tickBorderDashOffset;x=ase(this,w,l),x!==void 0&&(_=ta(r,x,W),c?E=D=R=O=_:C=A=T=N=_,p.push({tx1:E,ty1:C,tx2:D,ty2:A,x1:R,y1:T,x2:O,y2:N,width:W,color:B,borderDash:X,borderDashOffset:q,tickWidth:re,tickColor:J,tickBorderDash:ee,tickBorderDashOffset:ie}))}return this._ticksLength=d,this._borderValue=S,p}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:o}=r,a=this.isHorizontal(),s=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=o,f=Fl(r.grid),p=f+u,m=d?-u:p,h=-Li(this.labelRotation),g=[];let y,S,w,x,_,E,C,D,A,R,T,O,N="middle";if(i==="top")E=this.bottom-m,C=this._getXAxisLabelAlignment();else if(i==="bottom")E=this.top+m,C=this._getXAxisLabelAlignment();else if(i==="left"){const I=this._getYAxisLabelAlignment(f);C=I.textAlign,_=I.x}else if(i==="right"){const I=this._getYAxisLabelAlignment(f);C=I.textAlign,_=I.x}else if(n==="x"){if(i==="center")E=(t.top+t.bottom)/2+p;else if(Ae(i)){const I=Object.keys(i)[0],L=i[I];E=this.chart.scales[I].getPixelForValue(L)+p}C=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")_=(t.left+t.right)/2-p;else if(Ae(i)){const I=Object.keys(i)[0],L=i[I];_=this.chart.scales[I].getPixelForValue(L)}C=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?N="top":l==="end"&&(N="bottom"));const M=this._getLabelSizes();for(y=0,S=s.length;y<S;++y){w=s[y],x=w.label;const I=o.setContext(this.getContext(y));D=this.getPixelForTick(y)+o.labelOffset,A=this._resolveTickFontOptions(y),R=A.lineHeight,T=Xt(x)?x.length:1;const L=T/2,$=I.color,V=I.textStrokeColor,W=I.textStrokeWidth;let B=C;a?(_=D,C==="inner"&&(y===S-1?B=this.options.reverse?"left":"right":y===0?B=this.options.reverse?"right":"left":B="center"),i==="top"?c==="near"||h!==0?O=-T*R+R/2:c==="center"?O=-M.highest.height/2-L*R+R:O=-M.highest.height+R/2:c==="near"||h!==0?O=R/2:c==="center"?O=M.highest.height/2-L*R:O=M.highest.height-T*R,d&&(O*=-1),h!==0&&!I.showLabelBackdrop&&(_+=R/2*Math.sin(h))):(E=D,O=(1-T)*R/2);let X;if(I.showLabelBackdrop){const q=Wr(I.backdropPadding),re=M.heights[y],J=M.widths[y];let ee=O-q.top,ie=0-q.left;switch(N){case"middle":ee-=re/2;break;case"bottom":ee-=re;break}switch(C){case"center":ie-=J/2;break;case"right":ie-=J;break;case"inner":y===S-1?ie-=J:y>0&&(ie-=J/2);break}X={left:ie,top:ee,width:J+q.width,height:re+q.height,color:I.backdropColor}}g.push({label:x,font:A,textOffset:O,options:{rotation:h,color:$,strokeColor:V,strokeWidth:W,textAlign:B,textBaseline:N,translation:[_,E],backdrop:X}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Li(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:o}}=this.options,a=this._getLabelSizes(),s=t+o,l=a.widest.width;let c,u;return n==="left"?i?(u=this.right+o,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-s,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?i?(u=this.left+o,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+s,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:o,height:a}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,o,a),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(o=>o.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const s=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(o=0,a=i.length;o<a;++o){const l=i[o];n.drawOnChartArea&&s({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&s({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:i}}=this,o=r.setContext(this.getContext()),a=r.display?o.width:0;if(!a)return;const s=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,f;this.isHorizontal()?(c=ta(t,this.left,a)-a/2,u=ta(t,this.right,s)+s/2,d=f=l):(d=ta(t,this.top,a)-a/2,f=ta(t,this.bottom,s)+s/2,c=u=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&px(r,i);const o=this.getLabelItems(t);for(const a of o){const s=a.options,l=a.font,c=a.label,u=a.textOffset;Jf(r,c,0,u,l,s)}i&&hx(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const o=Yn(r.font),a=Wr(r.padding),s=r.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||Ae(n)?(l+=a.bottom,Xt(r.text)&&(l+=o.lineHeight*(r.text.length-1))):l+=a.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=dse(this,l,n,s);Jf(t,r.text,0,0,o,{color:r.color,maxWidth:d,rotation:f,textAlign:use(s,n,i),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=Se(t.grid&&t.grid.z,-1),i=Se(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==dl.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let o,a;for(o=0,a=n.length;o<a;++o){const s=n[o];s[r]===this.id&&(!t||s.type===t)&&i.push(s)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return Yn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class wd{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;hse(n)&&(r=this.register(n));const i=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in i||(i[o]=t,fse(t,a,r),this.override&&Nt.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,i=this.scope;r in n&&delete n[r],i&&r in Nt[i]&&(delete Nt[i][r],this.override&&delete za[r])}}function fse(e,t,n){const r=Fc(Object.create(null),[n?Nt.get(n):{},Nt.get(t),e.defaults]);Nt.set(t,r),e.defaultRoutes&&pse(t,e.defaultRoutes),e.descriptors&&Nt.describe(t,e.descriptors)}function pse(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),o=[e].concat(r).join("."),a=t[n].split("."),s=a.pop(),l=a.join(".");Nt.route(o,i,l,s)})}function hse(e){return"id"in e&&"defaults"in e}class mse{constructor(){this.controllers=new wd(xh,"datasets",!0),this.elements=new wd(Ko,"elements"),this.plugins=new wd(Object,"plugins"),this.scales=new wd(dl,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(i=>{const o=r||this._getRegistryForType(i);r||o.isForType(i)||o===this.plugins&&i.id?this._exec(t,o,i):Xe(i,a=>{const s=r||this._getRegistryForType(a);this._exec(t,s,a)})})}_exec(t,n,r){const i=cx(t);ct(r["before"+i],[],r),n[t](r),ct(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var Gr=new mse;class gse{constructor(){this._init=[]}notify(t,n,r,i){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=i?this._descriptors(t).filter(i):this._descriptors(t),a=this._notify(o,t,n,r);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,n,r,i){i=i||{};for(const o of t){const a=o.plugin,s=a[r],l=[n,i,o.options];if(ct(s,l,a)===!1&&i.cancelable)return!1}return!0}invalidate(){Ye(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,i=Se(r.options&&r.options.plugins,{}),o=vse(r);return i===!1&&!n?[]:bse(t,o,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(o,a)=>o.filter(s=>!a.some(l=>s.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function vse(e){const t={},n=[],r=Object.keys(Gr.plugins.items);for(let o=0;o<r.length;o++)n.push(Gr.getPlugin(r[o]));const i=e.plugins||[];for(let o=0;o<i.length;o++){const a=i[o];n.indexOf(a)===-1&&(n.push(a),t[a.id]=!0)}return{plugins:n,localIds:t}}function yse(e,t){return!t&&e===!1?null:e===!0?{}:e}function bse(e,{plugins:t,localIds:n},r,i){const o=[],a=e.getContext();for(const s of t){const l=s.id,c=yse(r[l],i);c!==null&&o.push({plugin:s,options:xse(e.config,{plugin:s,local:n[l]},c,a)})}return o}function xse(e,{plugin:t,local:n},r,i){const o=e.pluginScopeKeys(t),a=e.getOptionScopes(r,o);return n&&t.defaults&&a.push(t.defaults),e.createResolver(a,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function uy(e,t){const n=Nt.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function wse(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function _se(e,t){return e===t?"_index_":"_value_"}function q2(e){if(e==="x"||e==="y"||e==="r")return e}function Sse(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function dy(e,...t){if(q2(e))return e;for(const n of t){const r=n.axis||Sse(n.position)||e.length>1&&q2(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function G2(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Ese(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return G2(e,"x",n[0])||G2(e,"y",n[0])}return{}}function Ose(e,t){const n=za[e.type]||{scales:{}},r=t.scales||{},i=uy(e.type,t),o=Object.create(null);return Object.keys(r).forEach(a=>{const s=r[a];if(!Ae(s))return console.error(`Invalid scale configuration for scale: ${a}`);if(s._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=dy(a,s,Ese(a,e),Nt.scales[s.type]),c=_se(l,i),u=n.scales||{};o[a]=sc(Object.create(null),[{axis:l},s,u[l],u[c]])}),e.data.datasets.forEach(a=>{const s=a.type||e.type,l=a.indexAxis||uy(s,t),u=(za[s]||{}).scales||{};Object.keys(u).forEach(d=>{const f=wse(d,l),p=a[f+"AxisID"]||f;o[p]=o[p]||Object.create(null),sc(o[p],[{axis:f},r[p],u[d]])})}),Object.keys(o).forEach(a=>{const s=o[a];sc(s,[Nt.scales[s.type],Nt.scale])}),o}function Mj(e){const t=e.options||(e.options={});t.plugins=Se(t.plugins,{}),t.scales=Ose(e,t)}function Nj(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Pse(e){return e=e||{},e.data=Nj(e.data),Mj(e),e}const X2=new Map,jj=new Set;function _d(e,t){let n=X2.get(e);return n||(n=t(),X2.set(e,n),jj.add(n)),n}const $l=(e,t,n)=>{const r=Wa(t,n);r!==void 0&&e.add(r)};class Cse{constructor(t){this._config=Pse(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Nj(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Mj(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return _d(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return _d(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return _d(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return _d(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:o}=this,a=this._cachedScopes(t,r),s=a.get(n);if(s)return s;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>$l(l,t,d))),u.forEach(d=>$l(l,i,d)),u.forEach(d=>$l(l,za[o]||{},d)),u.forEach(d=>$l(l,Nt,d)),u.forEach(d=>$l(l,ly,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),jj.has(n)&&a.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,za[n]||{},Nt.datasets[n]||{},{type:n},Nt,ly]}resolveNamedOptions(t,n,r,i=[""]){const o={$shared:!0},{resolver:a,subPrefixes:s}=Q2(this._resolverCache,t,i);let l=a;if(Dse(a,n)){o.$shared=!1,r=Fo(r)?r():r;const c=this.createResolver(t,r,s);l=Hs(a,r,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,r=[""],i){const{resolver:o}=Q2(this._resolverCache,t,r);return Ae(n)?Hs(o,n,void 0,i):o}}function Q2(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let o=r.get(i);return o||(o={resolver:gx(t,n),subPrefixes:n.filter(s=>!s.toLowerCase().includes("hover"))},r.set(i,o)),o}const kse=e=>Ae(e)&&Object.getOwnPropertyNames(e).some(t=>Fo(e[t]));function Dse(e,t){const{isScriptable:n,isIndexable:r}=gj(e);for(const i of t){const o=n(i),a=r(i),s=(a||o)&&e[i];if(o&&(Fo(s)||kse(s))||a&&Xt(s))return!0}return!1}var Tse="4.5.0";const Ase=["top","bottom","left","right","chartArea"];function Z2(e,t){return e==="top"||e==="bottom"||Ase.indexOf(e)===-1&&t==="x"}function J2(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function eP(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),ct(n&&n.onComplete,[e],t)}function Mse(e){const t=e.chart,n=t.options.animation;ct(n&&n.onProgress,[e],t)}function Rj(e){return bx()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Bd={},tP=e=>{const t=Rj(e);return Object.values(Bd).filter(n=>n.canvas===t).pop()};function Nse(e,t,n){const r=Object.keys(e);for(const i of r){const o=+i;if(o>=t){const a=e[i];delete e[i],(n>0||o>t)&&(e[o+n]=a)}}}function jse(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}let Mn=class{static defaults=Nt;static instances=Bd;static overrides=za;static registry=Gr;static version=Tse;static getChart=tP;static register(...t){Gr.add(...t),nP()}static unregister(...t){Gr.remove(...t),nP()}constructor(t,n){const r=this.config=new Cse(n),i=Rj(t),o=tP(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||Zae(i)),this.platform.updateConfig(r);const s=this.platform.acquireContext(i,a.aspectRatio),l=s&&s.canvas,c=l&&l.height,u=l&&l.width;if(this.id=Pie(),this.ctx=s,this.canvas=l,this.width=u,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new gse,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Yie(d=>this.update(d),a.resizeDelay||0),this._dataChanges=[],Bd[this.id]=this,!s||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ci.listen(this,"complete",eP),Ci.listen(this,"progress",Mse),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:o}=this;return Ye(t)?n&&o?o:i?r/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Gr}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():E2(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return w2(this.canvas,this.ctx),this}stop(){return Ci.stop(this),this}resize(t,n){Ci.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(i,t,n,o),s=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,E2(this,s,!0)&&(this.notifyPlugins("resize",{size:a}),ct(r.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Xe(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((a,s)=>(a[s]=!1,a),{});let o=[];n&&(o=o.concat(Object.keys(n).map(a=>{const s=n[a],l=dy(a,s),c=l==="r",u=l==="x";return{options:s,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Xe(o,a=>{const s=a.options,l=s.id,c=dy(l,s),u=Se(s.type,a.dtype);(s.position===void 0||Z2(s.position,c)!==Z2(a.dposition))&&(s.position=a.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const f=Gr.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(s,t)}),Xe(i,(a,s)=>{a||delete r[s]}),Xe(r,a=>{wo.configure(this,a,a.options),wo.addBox(this,a)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,o)=>i.index-o.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(J2("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const o=n[r];let a=this.getDatasetMeta(r);const s=o.type||this.config.type;if(a.type&&a.type!==s&&(this._destroyDatasetMeta(r),a=this.getDatasetMeta(r)),a.type=s,a.indexAxis=o.indexAxis||uy(s,this.options),a.order=o.order||0,a.index=r,a.label=""+o.label,a.visible=this.isDatasetVisible(r),a.controller)a.controller.updateIndex(r),a.controller.linkScales();else{const l=Gr.getController(s),{datasetElementType:c,dataElementType:u}=Nt.datasets[s];Object.assign(l,{dataElementType:Gr.getElement(u),datasetElementType:c&&Gr.getElement(c)}),a.controller=new l(this,r),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Xe(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!i&&o.indexOf(d)===-1;d.buildOrUpdateElements(f),a=Math.max(+d.getMaxOverflow(),a)}a=this._minPadding=r.layout.autoPadding?a:0,this._updateLayout(a),i||Xe(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(J2("z","_idx"));const{_active:s,_lastEvent:l}=this;l?this._eventHandler(l,!0):s.length&&this._updateHoverStyles(s,s,!0),this.render()}_updateScales(){Xe(this.scales,t=>{wo.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!d2(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:o}of n){const a=r==="_removeElements"?-o:o;Nse(t,i,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(t.filter(a=>a[0]===o).map((a,s)=>s+","+a.splice(1).join(","))),i=r(0);for(let o=1;o<n;o++)if(!d2(i,r(o)))return;return Array.from(i).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;wo.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Xe(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,o)=>{i._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,Fo(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Ci.has(this)?this.attached&&!Ci.running(this)&&Ci.start(this):(this.draw(),eP({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,i)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let i,o;for(i=0,o=n.length;i<o;++i){const a=n[i];(!t||a.visible)&&r.push(a)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r={meta:t,index:t.index,cancelable:!0},i=Qoe(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&px(n,i),t.controller.draw(),i&&hx(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return zc(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const o=Aae.modes[n];return typeof o=="function"?o(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(o=>o&&o._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=qa(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const i=r?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,i);$c(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),a.update(o,{visible:r}),this.update(s=>s.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),Ci.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),w2(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Bd[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(o,a)=>{n.addEventListener(this,o,a),t[o]=a},i=(o,a,s)=>{o.offsetX=a,o.offsetY=s,this._eventHandler(o)};Xe(this.options.events,o=>r(o,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const s=()=>{i("attach",s),this.attached=!0,this.resize(),r("resize",o),r("detach",a)};a=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),r("attach",s)},n.isAttached(this.canvas)?s():a()}unbindEvents(){Xe(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Xe(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let o,a,s,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),s=0,l=t.length;s<l;++s){a=t[s];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[i+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:o,index:a})=>{const s=this.getDatasetMeta(o);if(!s)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:s.data[a],index:a}});!Xf(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const i=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),a=o(n,t),s=r?t:o(t,n);a.length&&this.updateHoverStyle(a,i.mode,!1),s.length&&i.mode&&this.updateHoverStyle(s,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const o=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(o||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:o}=this,a=n,s=this._getActiveElements(t,i,r,a),l=Mie(t),c=jse(t,this._lastEvent,r,l);r&&(this._lastEvent=null,ct(o.onHover,[t,s,this],this),l&&ct(o.onClick,[t,s,this],this));const u=!Xf(s,i);return(u||n)&&(this._active=s,this._updateHoverStyles(s,i,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,i)}};function nP(){return Xe(Mn.instances,e=>e._plugins.invalidate())}function Rse(e,t,n){const{startAngle:r,x:i,y:o,outerRadius:a,innerRadius:s,options:l}=t,{borderWidth:c,borderJoinStyle:u}=l,d=Math.min(c/a,Rr(r-n));if(e.beginPath(),e.arc(i,o,a-c/2,r+d/2,n-d/2),s>0){const f=Math.min(c/s,Rr(r-n));e.arc(i,o,s+c/2,n-f/2,r+f/2,!0)}else{const f=Math.min(c/2,a*Rr(r-n));if(u==="round")e.arc(i,o,f,n-rt/2,r+rt/2,!0);else if(u==="bevel"){const p=2*f*f,m=-p*Math.cos(n+rt/2)+i,h=-p*Math.sin(n+rt/2)+o,g=p*Math.cos(r+rt/2)+i,y=p*Math.sin(r+rt/2)+o;e.lineTo(m,h),e.lineTo(g,y)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function Ise(e,t,n){const{startAngle:r,pixelMargin:i,x:o,y:a,outerRadius:s,innerRadius:l}=t;let c=i/s;e.beginPath(),e.arc(o,a,s,r-c,n+c),l>i?(c=i/l,e.arc(o,a,l,n+c,r-c,!0)):e.arc(o,a,i,n+Vt,r-Vt),e.closePath(),e.clip()}function Lse(e){return mx(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Fse(e,t,n,r){const i=Lse(e.options.borderRadius),o=(n-t)/2,a=Math.min(o,r*t/2),s=l=>{const c=(n-Math.min(o,l))*r/2;return bn(l,0,Math.min(o,c))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:bn(i.innerStart,0,a),innerEnd:bn(i.innerEnd,0,a)}}function cs(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function rp(e,t,n,r,i,o){const{x:a,y:s,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-c,0),f=u>0?u+r+n+c:0;let p=0;const m=i-l;if(r){const I=u>0?u-r:0,L=d>0?d-r:0,$=(I+L)/2,V=$!==0?m*$/($+r):m;p=(m-V)/2}const h=Math.max(.001,m*d-n/rt)/d,g=(m-h)/2,y=l+g+p,S=i-g-p,{outerStart:w,outerEnd:x,innerStart:_,innerEnd:E}=Fse(t,f,d,S-y),C=d-w,D=d-x,A=y+w/C,R=S-x/D,T=f+_,O=f+E,N=y+_/T,M=S-E/O;if(e.beginPath(),o){const I=(A+R)/2;if(e.arc(a,s,d,A,I),e.arc(a,s,d,I,R),x>0){const W=cs(D,R,a,s);e.arc(W.x,W.y,x,R,S+Vt)}const L=cs(O,S,a,s);if(e.lineTo(L.x,L.y),E>0){const W=cs(O,M,a,s);e.arc(W.x,W.y,E,S+Vt,M+Math.PI)}const $=(S-E/f+(y+_/f))/2;if(e.arc(a,s,f,S-E/f,$,!0),e.arc(a,s,f,$,y+_/f,!0),_>0){const W=cs(T,N,a,s);e.arc(W.x,W.y,_,N+Math.PI,y-Vt)}const V=cs(C,y,a,s);if(e.lineTo(V.x,V.y),w>0){const W=cs(C,A,a,s);e.arc(W.x,W.y,w,y-Vt,A)}}else{e.moveTo(a,s);const I=Math.cos(A)*d+a,L=Math.sin(A)*d+s;e.lineTo(I,L);const $=Math.cos(R)*d+a,V=Math.sin(R)*d+s;e.lineTo($,V)}e.closePath()}function $se(e,t,n,r,i){const{fullCircles:o,startAngle:a,circumference:s}=t;let l=t.endAngle;if(o){rp(e,t,n,r,l,i);for(let c=0;c<o;++c)e.fill();isNaN(s)||(l=a+(s%Pt||Pt))}return rp(e,t,n,r,l,i),e.fill(),l}function Bse(e,t,n,r,i){const{fullCircles:o,startAngle:a,circumference:s,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:f,borderRadius:p}=l,m=l.borderAlign==="inner";if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=f,m?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let h=t.endAngle;if(o){rp(e,t,n,r,h,i);for(let g=0;g<o;++g)e.stroke();isNaN(s)||(h=a+(s%Pt||Pt))}m&&Ise(e,t,h),l.selfJoin&&h-a>=rt&&p===0&&u!=="miter"&&Rse(e,t,h),o||(rp(e,t,n,r,h,i),e.stroke())}class _x extends Ko{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,n,r){const i=this.getProps(["x","y"],r),{angle:o,distance:a}=sj(i,{x:t,y:n}),{startAngle:s,endAngle:l,innerRadius:c,outerRadius:u,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),f=(this.options.spacing+this.options.borderWidth)/2,p=Se(d,l-s),m=Wc(o,s,l)&&s!==l,h=p>=Pt||m,g=xo(a,c+f,u+f);return h&&g}getCenterPoint(t){const{x:n,y:r,startAngle:i,endAngle:o,innerRadius:a,outerRadius:s}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,u=(i+o)/2,d=(a+s+c+l)/2;return{x:n+Math.cos(u)*d,y:r+Math.sin(u)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:n,circumference:r}=this,i=(n.offset||0)/4,o=(n.spacing||0)/2,a=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=r>Pt?Math.floor(r/Pt):0,r===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const s=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(s)*i,Math.sin(s)*i);const l=1-Math.sin(Math.min(rt,r||0)),c=i*l;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,$se(t,this,c,o,a),Bse(t,this,c,o,a),t.restore()}}function Ij(e,t,n=t){e.lineCap=Se(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Se(n.borderDash,t.borderDash)),e.lineDashOffset=Se(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Se(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Se(n.borderWidth,t.borderWidth),e.strokeStyle=Se(n.borderColor,t.borderColor)}function Wse(e,t,n){e.lineTo(n.x,n.y)}function zse(e){return e.stepped?ooe:e.tension||e.cubicInterpolationMode==="monotone"?aoe:Wse}function Lj(e,t,n={}){const r=e.length,{start:i=0,end:o=r-1}=n,{start:a,end:s}=t,l=Math.max(i,a),c=Math.min(o,s),u=i<a&&o<a||i>s&&o>s;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function Vse(e,t,n,r){const{points:i,options:o}=t,{count:a,start:s,loop:l,ilen:c}=Lj(i,n,r),u=zse(o);let{move:d=!0,reverse:f}=r||{},p,m,h;for(p=0;p<=c;++p)m=i[(s+(f?c-p:p))%a],!m.skip&&(d?(e.moveTo(m.x,m.y),d=!1):u(e,h,m,f,o.stepped),h=m);return l&&(m=i[(s+(f?c:0))%a],u(e,h,m,f,o.stepped)),!!l}function Hse(e,t,n,r){const i=t.points,{count:o,start:a,ilen:s}=Lj(i,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,f,p,m,h,g,y;const S=x=>(a+(c?s-x:x))%o,w=()=>{h!==g&&(e.lineTo(u,g),e.lineTo(u,h),e.lineTo(u,y))};for(l&&(p=i[S(0)],e.moveTo(p.x,p.y)),f=0;f<=s;++f){if(p=i[S(f)],p.skip)continue;const x=p.x,_=p.y,E=x|0;E===m?(_<h?h=_:_>g&&(g=_),u=(d*u+x)/++d):(w(),e.lineTo(x,_),m=E,d=0,h=g=_),y=_}w()}function fy(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Hse:Vse}function Yse(e){return e.stepped?Foe:e.tension||e.cubicInterpolationMode==="monotone"?$oe:fa}function Use(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Ij(e,t.options),e.stroke(i)}function Kse(e,t,n,r){const{segments:i,options:o}=t,a=fy(t);for(const s of i)Ij(e,o,s.style),e.beginPath(),a(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const qse=typeof Path2D=="function";function Gse(e,t,n,r){qse&&!t.options.segment?Use(e,t,n,r):Kse(e,t,n,r)}class Sx extends Ko{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;Toe(this._points,r,t,i,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Koe(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,i=t[n],o=this.points,a=Hoe(this,{property:n,start:i,end:i});if(!a.length)return;const s=[],l=Yse(r);let c,u;for(c=0,u=a.length;c<u;++c){const{start:d,end:f}=a[c],p=o[d],m=o[f];if(p===m){s.push(p);continue}const h=Math.abs((i-p[n])/(m[n]-p[n])),g=l(p,m,h,r.stepped);g[n]=t[n],s.push(g)}return s.length===1?s[0]:s}pathSegment(t,n,r){return fy(this)(t,this,n,r)}path(t,n,r){const i=this.segments,o=fy(this);let a=this._loop;n=n||0,r=r||this.points.length-n;for(const s of i)a&=o(t,this,s,{start:n,end:n+r-1});return!!a}draw(t,n,r,i){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Gse(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function rP(e,t,n,r){const i=e.options,{[n]:o}=e.getProps([n],r);return Math.abs(t-o)<i.radius+i.hitRadius}class Ex extends Ko{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,n,r){const i=this.options,{x:o,y:a}=this.getProps(["x","y"],r);return Math.pow(t-o,2)+Math.pow(n-a,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(t,n){return rP(this,t,"x",n)}inYRange(t,n){return rP(this,t,"y",n)}getCenterPoint(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);const r=n&&t.borderWidth||0;return(n+r)*2}draw(t,n){const r=this.options;this.skip||r.radius<.1||!zc(this,n,this.size(r)/2)||(t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.fillStyle=r.backgroundColor,cy(t,r,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Fj(e,t){const{x:n,y:r,base:i,width:o,height:a}=e.getProps(["x","y","base","width","height"],t);let s,l,c,u,d;return e.horizontal?(d=a/2,s=Math.min(n,i),l=Math.max(n,i),c=r-d,u=r+d):(d=o/2,s=n-d,l=n+d,c=Math.min(r,i),u=Math.max(r,i)),{left:s,top:c,right:l,bottom:u}}function _o(e,t,n,r){return e?0:bn(t,n,r)}function Xse(e,t,n){const r=e.options.borderWidth,i=e.borderSkipped,o=mj(r);return{t:_o(i.top,o.top,0,n),r:_o(i.right,o.right,0,t),b:_o(i.bottom,o.bottom,0,n),l:_o(i.left,o.left,0,t)}}function Qse(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,o=xs(i),a=Math.min(t,n),s=e.borderSkipped,l=r||Ae(i);return{topLeft:_o(!l||s.top||s.left,o.topLeft,0,a),topRight:_o(!l||s.top||s.right,o.topRight,0,a),bottomLeft:_o(!l||s.bottom||s.left,o.bottomLeft,0,a),bottomRight:_o(!l||s.bottom||s.right,o.bottomRight,0,a)}}function Zse(e){const t=Fj(e),n=t.right-t.left,r=t.bottom-t.top,i=Xse(e,n/2,r/2),o=Qse(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:o},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,o.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(i.b,i.r))}}}}function $g(e,t,n,r){const i=t===null,o=n===null,s=e&&!(i&&o)&&Fj(e,r);return s&&(i||xo(t,s.left,s.right))&&(o||xo(n,s.top,s.bottom))}function Jse(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function ele(e,t){e.rect(t.x,t.y,t.w,t.h)}function Bg(e,t,n={}){const r=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-r,a=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+r,y:e.y+i,w:e.w+o,h:e.h+a,radius:e.radius}}class fl extends Ko{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:i}}=this,{inner:o,outer:a}=Zse(this),s=Jse(a.radius)?ep:ele;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),s(t,Bg(a,n,o)),t.clip(),s(t,Bg(o,-n,a)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),s(t,Bg(o,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,r){return $g(this,t,n,r)}inXRange(t,n){return $g(this,t,null,n)}inYRange(t,n){return $g(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:i,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+i)/2:n,y:o?r:(r+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}const iP=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},tle=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class oP extends Ko{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=ct(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,i=Yn(r.font),o=i.size,a=this._computeTitleHeight(),{boxWidth:s,itemHeight:l}=iP(r,o);let c,u;n.font=i.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(a,o,s,l)+10):(u=this.maxHeight,c=this._fitCols(a,i,s,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:o,maxWidth:a,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=i+s;let d=t;o.textAlign="left",o.textBaseline="middle";let f=-1,p=-u;return this.legendItems.forEach((m,h)=>{const g=r+n/2+o.measureText(m.text).width;(h===0||c[c.length-1]+g+2*s>a)&&(d+=u,c[c.length-(h>0?0:1)]=0,p+=u,f++),l[h]={left:0,top:p,row:f,width:g,height:i},c[c.length-1]+=g+s}),d}_fitCols(t,n,r,i){const{ctx:o,maxHeight:a,options:{labels:{padding:s}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=a-t;let d=s,f=0,p=0,m=0,h=0;return this.legendItems.forEach((g,y)=>{const{itemWidth:S,itemHeight:w}=nle(r,n,o,g,i);y>0&&p+w+2*s>u&&(d+=f+s,c.push({width:f,height:p}),m+=f+s,h++,f=p=0),l[y]={left:m,top:p,col:h,width:S,height:w},f=Math.max(f,S),p+=w+s}),d+=f,c.push({width:f,height:p}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:o}}=this,a=ws(o,this.left,this.width);if(this.isHorizontal()){let s=0,l=Jn(r,this.left+i,this.right-this.lineWidths[s]);for(const c of n)s!==c.row&&(s=c.row,l=Jn(r,this.left+i,this.right-this.lineWidths[s])),c.top+=this.top+t+i,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+i}else{let s=0,l=Jn(r,this.top+t+i,this.bottom-this.columnSizes[s].height);for(const c of n)c.col!==s&&(s=c.col,l=Jn(r,this.top+t+i,this.bottom-this.columnSizes[s].height)),c.top=l,c.left+=this.left+i,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;px(t,this),this._draw(),hx(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:o,labels:a}=t,s=Nt.color,l=ws(t.rtl,this.left,this.width),c=Yn(a.font),{padding:u}=a,d=c.size,f=d/2;let p;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:m,boxHeight:h,itemHeight:g}=iP(a,d),y=function(E,C,D){if(isNaN(m)||m<=0||isNaN(h)||h<0)return;i.save();const A=Se(D.lineWidth,1);if(i.fillStyle=Se(D.fillStyle,s),i.lineCap=Se(D.lineCap,"butt"),i.lineDashOffset=Se(D.lineDashOffset,0),i.lineJoin=Se(D.lineJoin,"miter"),i.lineWidth=A,i.strokeStyle=Se(D.strokeStyle,s),i.setLineDash(Se(D.lineDash,[])),a.usePointStyle){const R={radius:h*Math.SQRT2/2,pointStyle:D.pointStyle,rotation:D.rotation,borderWidth:A},T=l.xPlus(E,m/2),O=C+f;hj(i,R,T,O,a.pointStyleWidth&&m)}else{const R=C+Math.max((d-h)/2,0),T=l.leftForLtr(E,m),O=xs(D.borderRadius);i.beginPath(),Object.values(O).some(N=>N!==0)?ep(i,{x:T,y:R,w:m,h,radius:O}):i.rect(T,R,m,h),i.fill(),A!==0&&i.stroke()}i.restore()},S=function(E,C,D){Jf(i,D.text,E,C+g/2,c,{strikethrough:D.hidden,textAlign:l.textAlign(D.textAlign)})},w=this.isHorizontal(),x=this._computeTitleHeight();w?p={x:Jn(o,this.left+u,this.right-r[0]),y:this.top+u+x,line:0}:p={x:this.left+u,y:Jn(o,this.top+x+u,this.bottom-n[0].height),line:0},wj(this.ctx,t.textDirection);const _=g+u;this.legendItems.forEach((E,C)=>{i.strokeStyle=E.fontColor,i.fillStyle=E.fontColor;const D=i.measureText(E.text).width,A=l.textAlign(E.textAlign||(E.textAlign=a.textAlign)),R=m+f+D;let T=p.x,O=p.y;l.setWidth(this.width),w?C>0&&T+R+u>this.right&&(O=p.y+=_,p.line++,T=p.x=Jn(o,this.left+u,this.right-r[p.line])):C>0&&O+_>this.bottom&&(T=p.x=T+n[p.line].width+u,p.line++,O=p.y=Jn(o,this.top+x+u,this.bottom-n[p.line].height));const N=l.x(T);if(y(N,O,E),T=Uie(A,T+m+f,w?T+R:this.right,t.rtl),S(l.x(T),O,E),w)p.x+=R+u;else if(typeof E.text!="string"){const M=c.lineHeight;p.y+=$j(E,M)+u}else p.y+=_}),_j(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=Yn(n.font),i=Wr(n.padding);if(!n.display)return;const o=ws(t.rtl,this.left,this.width),a=this.ctx,s=n.position,l=r.size/2,c=i.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=Jn(t.align,d,this.right-f);else{const m=this.columnSizes.reduce((h,g)=>Math.max(h,g.height),0);u=c+Jn(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const p=Jn(s,d,d+f);a.textAlign=o.textAlign(fj(s)),a.textBaseline="middle",a.strokeStyle=n.color,a.fillStyle=n.color,a.font=r.string,Jf(a,n.text,p,u,r)}_computeTitleHeight(){const t=this.options.title,n=Yn(t.font),r=Wr(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,o;if(xo(t,this.left,this.right)&&xo(n,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;r<o.length;++r)if(i=o[r],xo(t,i.left,i.left+i.width)&&xo(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!ole(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,o=tle(i,r);i&&!o&&ct(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!o&&ct(n.onHover,[t,r,this],this)}else r&&ct(n.onClick,[t,r,this],this)}}function nle(e,t,n,r,i){const o=rle(r,e,t,n),a=ile(i,r,t.lineHeight);return{itemWidth:o,itemHeight:a}}function rle(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((o,a)=>o.length>a.length?o:a)),t+n.size/2+r.measureText(i).width}function ile(e,t,n){let r=e;return typeof t.text!="string"&&(r=$j(t,n)),r}function $j(e,t){const n=e.text?e.text.length:0;return t*n}function ole(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var Vr={id:"legend",_element:oP,start(e,t,n){const r=e.legend=new oP({ctx:e.ctx,options:n,chart:e});wo.configure(e,r,n),wo.addBox(e,r)},stop(e){wo.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;wo.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:o,useBorderRadius:a,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Wr(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:a&&(s||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};const Zl={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,o=0;for(t=0,n=e.length;t<n;++t){const s=e[t].element;if(s&&s.hasValue()){const l=s.tooltipPosition();r.add(l.x),i+=l.y,++o}}return o===0||r.size===0?!1:{x:[...r].reduce((s,l)=>s+l)/r.size,y:i/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,o,a,s;for(o=0,a=e.length;o<a;++o){const l=e[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=sy(t,c);u<i&&(i=u,s=l)}}if(s){const l=s.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function qr(e,t){return t&&(Xt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function ki(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
275
275
|
`)>-1?e.split(`
|
|
276
|
-
`):e}function ale(e,t){const{element:n,datasetIndex:r,index:i}=t,o=e.getDatasetMeta(r).controller,{label:a,value:s}=o.getLabelAndValue(i);return{chart:e,label:a,parsed:o.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:s,dataset:o.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function aP(e,t){const n=e.chart.ctx,{body:r,footer:i,title:o}=e,{boxWidth:a,boxHeight:s}=t,l=Yn(t.bodyFont),c=Yn(t.titleFont),u=Yn(t.footerFont),d=o.length,f=i.length,p=r.length,m=Wr(t.padding);let h=m.height,g=0,y=r.reduce((x,_)=>x+_.before.length+_.lines.length+_.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,d&&(h+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const x=t.displayColors?Math.max(s,l.lineHeight):l.lineHeight;h+=p*x+(y-p)*l.lineHeight+(y-1)*t.bodySpacing}f&&(h+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let S=0;const w=function(x){g=Math.max(g,n.measureText(x).width+S)};return n.save(),n.font=c.string,Xe(e.title,w),n.font=l.string,Xe(e.beforeBody.concat(e.afterBody),w),S=t.displayColors?a+2+t.boxPadding:0,Xe(r,x=>{Xe(x.before,w),Xe(x.lines,w),Xe(x.after,w)}),S=0,n.font=u.string,Xe(e.footer,w),n.restore(),g+=m.width,{width:g,height:h}}function sle(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function lle(e,t,n,r){const{x:i,width:o}=r,a=n.caretSize+n.caretPadding;if(e==="left"&&i+o+a>t.width||e==="right"&&i-o-a<0)return!0}function cle(e,t,n,r){const{x:i,width:o}=n,{width:a,chartArea:{left:s,right:l}}=e;let c="center";return r==="center"?c=i<=(s+l)/2?"left":"right":i<=o/2?c="left":i>=a-o/2&&(c="right"),lle(c,e,t,n)&&(c="center"),c}function sP(e,t,n){const r=n.yAlign||t.yAlign||sle(e,n);return{xAlign:n.xAlign||t.xAlign||cle(e,t,n,r),yAlign:r}}function ule(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function dle(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function lP(e,t,n,r){const{caretSize:i,caretPadding:o,cornerRadius:a}=e,{xAlign:s,yAlign:l}=n,c=i+o,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=xs(a);let m=ule(t,s);const h=dle(t,l,c);return l==="center"?s==="left"?m+=c:s==="right"&&(m-=c):s==="left"?m-=Math.max(u,f)+i:s==="right"&&(m+=Math.max(d,p)+i),{x:bn(m,0,r.width-t.width),y:bn(h,0,r.height-t.height)}}function Sd(e,t,n){const r=Wr(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function cP(e){return qr([],ki(e))}function fle(e,t,n){return qa(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function uP(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Bj={beforeTitle:Pi,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:Pi,beforeBody:Pi,beforeLabel:Pi,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return Ye(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Pi,afterBody:Pi,beforeFooter:Pi,footer:Pi,afterFooter:Pi};function In(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?Bj[t].call(n,r):i}class dP extends Ko{static positioners=Zl;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,o=new Ej(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=fle(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=In(r,"beforeTitle",this,t),o=In(r,"title",this,t),a=In(r,"afterTitle",this,t);let s=[];return s=qr(s,ki(i)),s=qr(s,ki(o)),s=qr(s,ki(a)),s}getBeforeBody(t,n){return cP(In(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Xe(t,o=>{const a={before:[],lines:[],after:[]},s=uP(r,o);qr(a.before,ki(In(s,"beforeLabel",this,o))),qr(a.lines,In(s,"label",this,o)),qr(a.after,ki(In(s,"afterLabel",this,o))),i.push(a)}),i}getAfterBody(t,n){return cP(In(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=In(r,"beforeFooter",this,t),o=In(r,"footer",this,t),a=In(r,"afterFooter",this,t);let s=[];return s=qr(s,ki(i)),s=qr(s,ki(o)),s=qr(s,ki(a)),s}_createItems(t){const n=this._active,r=this.chart.data,i=[],o=[],a=[];let s=[],l,c;for(l=0,c=n.length;l<c;++l)s.push(ale(this.chart,n[l]));return t.filter&&(s=s.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(s=s.sort((u,d)=>t.itemSort(u,d,r))),Xe(s,u=>{const d=uP(t.callbacks,u);i.push(In(d,"labelColor",this,u)),o.push(In(d,"labelPointStyle",this,u)),a.push(In(d,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=s,s}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let o,a=[];if(!i.length)this.opacity!==0&&(o={opacity:0});else{const s=Zl[r.position].call(this,i,this._eventPosition);a=this._createItems(r),this.title=this.getTitle(a,r),this.beforeBody=this.getBeforeBody(a,r),this.body=this.getBody(a,r),this.afterBody=this.getAfterBody(a,r),this.footer=this.getFooter(a,r);const l=this._size=aP(this,r),c=Object.assign({},s,l),u=sP(this.chart,r,c),d=lP(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:s.x,caretY:s.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const o=this.getCaretPosition(t,r,i);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:o}=this,{caretSize:a,cornerRadius:s}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=xs(s),{x:f,y:p}=t,{width:m,height:h}=n;let g,y,S,w,x,_;return o==="center"?(x=p+h/2,i==="left"?(g=f,y=g-a,w=x+a,_=x-a):(g=f+m,y=g+a,w=x-a,_=x+a),S=g):(i==="left"?y=f+Math.max(l,u)+a:i==="right"?y=f+m-Math.max(c,d)-a:y=this.caretX,o==="top"?(w=p,x=w-a,g=y-a,S=y+a):(w=p+h,x=w+a,g=y+a,S=y-a),_=w),{x1:g,x2:y,x3:S,y1:w,y2:x,y3:_}}drawTitle(t,n,r){const i=this.title,o=i.length;let a,s,l;if(o){const c=ws(r.rtl,this.x,this.width);for(t.x=Sd(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",a=Yn(r.titleFont),s=r.titleSpacing,n.fillStyle=r.titleColor,n.font=a.string,l=0;l<o;++l)n.fillText(i[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s,l+1===o&&(t.y+=r.titleMarginBottom-s)}}_drawColorBox(t,n,r,i,o){const a=this.labelColors[r],s=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=o,u=Yn(o.bodyFont),d=Sd(this,"left",o),f=i.x(d),p=l<u.lineHeight?(u.lineHeight-l)/2:0,m=n.y+p;if(o.usePointStyle){const h={radius:Math.min(c,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},g=i.leftForLtr(f,c)+c/2,y=m+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,cy(t,h,g,y),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,cy(t,h,g,y)}else{t.lineWidth=Ae(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const h=i.leftForLtr(f,c),g=i.leftForLtr(i.xPlus(f,1),c-2),y=xs(a.borderRadius);Object.values(y).some(S=>S!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ep(t,{x:h,y:m,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),ep(t,{x:g,y:m+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(h,m,c,l),t.strokeRect(h,m,c,l),t.fillStyle=a.backgroundColor,t.fillRect(g,m+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:o,bodyAlign:a,displayColors:s,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=Yn(r.bodyFont);let f=d.lineHeight,p=0;const m=ws(r.rtl,this.x,this.width),h=function(D){n.fillText(D,m.x(t.x+p),t.y+f/2),t.y+=f+o},g=m.textAlign(a);let y,S,w,x,_,E,C;for(n.textAlign=a,n.textBaseline="middle",n.font=d.string,t.x=Sd(this,g,r),n.fillStyle=r.bodyColor,Xe(this.beforeBody,h),p=s&&g!=="right"?a==="center"?c/2+u:c+2+u:0,x=0,E=i.length;x<E;++x){for(y=i[x],S=this.labelTextColors[x],n.fillStyle=S,Xe(y.before,h),w=y.lines,s&&w.length&&(this._drawColorBox(n,t,x,m,r),f=Math.max(d.lineHeight,l)),_=0,C=w.length;_<C;++_)h(w[_]),f=d.lineHeight;Xe(y.after,h)}p=0,f=d.lineHeight,Xe(this.afterBody,h),t.y-=o}drawFooter(t,n,r){const i=this.footer,o=i.length;let a,s;if(o){const l=ws(r.rtl,this.x,this.width);for(t.x=Sd(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",a=Yn(r.footerFont),n.fillStyle=r.footerColor,n.font=a.string,s=0;s<o;++s)n.fillText(i[s],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:o,yAlign:a}=this,{x:s,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:f,bottomLeft:p,bottomRight:m}=xs(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(s+d,l),a==="top"&&this.drawCaret(t,n,r,i),n.lineTo(s+c-f,l),n.quadraticCurveTo(s+c,l,s+c,l+f),a==="center"&&o==="right"&&this.drawCaret(t,n,r,i),n.lineTo(s+c,l+u-m),n.quadraticCurveTo(s+c,l+u,s+c-m,l+u),a==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(s+p,l+u),n.quadraticCurveTo(s,l+u,s,l+u-p),a==="center"&&o==="left"&&this.drawCaret(t,n,r,i),n.lineTo(s,l+d),n.quadraticCurveTo(s,l,s+d,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,o=r&&r.y;if(i||o){const a=Zl[t.position].call(this,this._active,this._eventPosition);if(!a)return;const s=this._size=aP(this,t),l=Object.assign({},a,this._size),c=sP(n,t,l),u=lP(t,l,c,n);(i._to!==u.x||o._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=s.width,this.height=s.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const a=Wr(n.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&s&&(t.save(),t.globalAlpha=r,this.drawBackground(o,t,i,n),wj(t,n.textDirection),o.y+=a.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),_j(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:s,index:l})=>{const c=this.chart.getDatasetMeta(s);if(!c)throw new Error("Cannot find a dataset at index "+s);return{datasetIndex:s,element:c.data[l],index:l}}),o=!Xf(r,i),a=this._positionChanged(i,n);(o||a)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,o=this._active||[],a=this._getActiveElements(t,o,n,r),s=this._positionChanged(a,t),l=n||!Xf(a,o)||s;return l&&(this._active=a,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const o=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(s=>this.chart.data.datasets[s.datasetIndex]&&this.chart.getDatasetMeta(s.datasetIndex).controller.getParsed(s.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,o.mode,o,r);return o.reverse&&a.reverse(),a}_positionChanged(t,n){const{caretX:r,caretY:i,options:o}=this,a=Zl[o.position].call(this,t,n);return a!==!1&&(r!==a.x||i!==a.y)}}var jr={id:"tooltip",_element:dP,positioners:Zl,afterInit(e,t,n){n&&(e.tooltip=new dP({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Bj},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const ple=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function hle(e,t,n,r){const i=e.indexOf(t);if(i===-1)return ple(e,t,n,r);const o=e.lastIndexOf(t);return i!==o?n:i}const mle=(e,t)=>e===null?null:bn(Math.round(e),0,t);function fP(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class lo extends dl{static id="category";static defaults={ticks:{callback:fP}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:o}of n)r[i]===o&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(Ye(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:hle(r,t,Se(n,t),this._addedLabels),mle(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let a=t;a<=n;a++)i.push({value:a});return i}getLabelForValue(t){return fP.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function gle(e,t){const n=[],{bounds:i,step:o,min:a,max:s,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,p=o||1,m=u-1,{min:h,max:g}=t,y=!Ye(a),S=!Ye(s),w=!Ye(c),x=(g-h)/(d+1);let _=p2((g-h)/m/p)*p,E,C,D,A;if(_<1e-14&&!y&&!S)return[{value:h},{value:g}];A=Math.ceil(g/_)-Math.floor(h/_),A>m&&(_=p2(A*_/m/p)*p),Ye(l)||(E=Math.pow(10,l),_=Math.ceil(_*E)/E),i==="ticks"?(C=Math.floor(h/_)*_,D=Math.ceil(g/_)*_):(C=h,D=g),y&&S&&o&&Lie((s-a)/o,_/1e3)?(A=Math.round(Math.min((s-a)/_,u)),_=(s-a)/A,C=a,D=s):w?(C=y?a:C,D=S?s:D,A=c-1,_=(D-C)/A):(A=(D-C)/_,lc(A,Math.round(A),_/1e3)?A=Math.round(A):A=Math.ceil(A));const R=Math.max(h2(_),h2(C));E=Math.pow(10,Ye(l)?R:l),C=Math.round(C*E)/E,D=Math.round(D*E)/E;let T=0;for(y&&(f&&C!==a?(n.push({value:a}),C<a&&T++,lc(Math.round((C+T*_)*E)/E,a,pP(a,x,e))&&T++):C<a&&T++);T<A;++T){const O=Math.round((C+T*_)*E)/E;if(S&&O>s)break;n.push({value:O})}return S&&f&&D!==s?n.length&&lc(n[n.length-1].value,s,pP(s,x,e))?n[n.length-1].value=s:n.push({value:s}):(!S||D===s)&&n.push({value:D}),n}function pP(e,t,{horizontal:n,minRotation:r}){const i=Li(r),o=(n?Math.sin(i):Math.cos(i))||.001,a=.75*t*(""+e).length;return Math.min(t/o,a)}class vle extends dl{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return Ye(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:o}=this;const a=l=>i=n?i:l,s=l=>o=r?o:l;if(t){const l=di(i),c=di(o);l<0&&c<0?s(0):l>0&&c>0&&a(0)}if(i===o){let l=o===0?1:Math.abs(o*.05);s(o+l),t||a(i-l)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,a=gle(i,o);return t.bounds==="ticks"&&Fie(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return fx(t,this.chart.options.locale,this.options.ticks.format)}}class co extends vle{static id="linear";static defaults={ticks:{callback:pj.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Ar(t)?t:0,this.max=Ar(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Li(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const _h={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},zn=Object.keys(_h);function hP(e,t){return e-t}function mP(e,t){if(Ye(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:o}=e._parseOpts;let a=t;return typeof r=="function"&&(a=r(a)),Ar(a)||(a=typeof r=="string"?n.parse(a,r):n.parse(a)),a===null?null:(i&&(a=i==="week"&&(Bc(o)||o===!0)?n.startOf(a,"isoWeek",o):n.startOf(a,i)),+a)}function gP(e,t,n,r){const i=zn.length;for(let o=zn.indexOf(e);o<i-1;++o){const a=_h[zn[o]],s=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(s*a.size))<=r)return zn[o]}return zn[i-1]}function yle(e,t,n,r,i){for(let o=zn.length-1;o>=zn.indexOf(n);o--){const a=zn[o];if(_h[a].common&&e._adapter.diff(i,r,a)>=t-1)return a}return zn[n?zn.indexOf(n):0]}function ble(e){for(let t=zn.indexOf(e)+1,n=zn.length;t<n;++t)if(_h[zn[t]].common)return zn[t]}function vP(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=ux(n,t),o=n[r]>=t?n[r]:n[i];e[o]=!0}}function xle(e,t,n,r){const i=e._adapter,o=+i.startOf(t[0].value,r),a=t[t.length-1].value;let s,l;for(s=o;s<=a;s=+i.add(s,1,r))l=n[s],l>=0&&(t[l].major=!0);return t}function yP(e,t,n){const r=[],i={},o=t.length;let a,s;for(a=0;a<o;++a)s=t[a],i[s]=a,r.push({value:s,major:!1});return o===0||!n?r:xle(e,r,i,n)}class bP extends dl{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),i=this._adapter=new Pae._date(t.adapters.date);i.init(n),sc(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:mP(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:o,minDefined:a,maxDefined:s}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!s&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!a||!s)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=Ar(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),o=Ar(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,o-1),this.max=Math.max(i+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const o=this.min,a=this.max,s=Vie(i,o,a);return this._unit=n.unit||(r.autoSkip?gP(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):yle(this,s.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:ble(this._unit),this.initOffsets(i),t.reverse&&s.reverse(),yP(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,o;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;n=bn(n,0,a),r=bn(r,0,a),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,o=i.time,a=o.unit||gP(o.minUnit,n,r,this._getLabelCapacity(n)),s=Se(i.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=Bc(l)||l===!0,u={};let d=n,f,p;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":a),t.diff(r,n,a)>1e5*s)throw new Error(n+" and "+r+" are too far apart with stepSize of "+s+" "+a);const m=i.ticks.source==="data"&&this.getDataTimestamps();for(f=d,p=0;f<r;f=+t.add(f,s,a),p++)vP(u,f,m);return(f===r||i.bounds==="ticks"||p===1)&&vP(u,f,m),Object.keys(u).sort(hP).map(h=>+h)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,o=this._unit,a=n||i[o];return this._adapter.format(t,a)}_tickFormatFunction(t,n,r,i){const o=this.options,a=o.ticks.callback;if(a)return ct(a,[t,n,r],this);const s=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&s[l],d=c&&s[c],f=r[n],p=c&&d&&f&&f.major;return this._adapter.format(t,i||(p?d:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=Li(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(i),a=Math.sin(i),s=this._resolveTickFontOptions(0).size;return{w:r*o+s*a,h:r*a+s*o}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,o=this._tickFormatFunction(t,0,yP(this,[t],this._majorUnit),i),a=this._getLabelSize(o),s=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return s>0?s:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(mP(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return cj(t.sort(hP))}}function Ed(e,t,n){let r=0,i=e.length-1,o,a,s,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=wa(e,"pos",t)),{pos:o,time:s}=e[r],{pos:a,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=wa(e,"time",t)),{time:o,pos:s}=e[r],{time:a,pos:l}=e[i]);const c=a-o;return c?s+(l-s)*(t-o)/c:s}class Qce extends bP{static id="timeseries";static defaults=bP.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Ed(n,this.min),this._tableRange=Ed(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],o=[];let a,s,l,c,u;for(a=0,s=t.length;a<s;++a)c=t[a],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(a=0,s=i.length;a<s;++a)u=i[a+1],l=i[a-1],c=i[a],Math.round((u+l)/2)!==c&&o.push({time:c,pos:a/(s-1)});return o}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,o)=>i-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Ed(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Ed(this._table,r*this._tableRange+this._minPos,!0)}}const Wj="label";function xP(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function wle(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function zj(e,t){e.labels=t}function Vj(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Wj;const r=[];e.datasets=t.map(i=>{const o=e.datasets.find(a=>a[n]===i[n]);return!o||!i.data||r.includes(o)?{...i}:(r.push(o),Object.assign(o,i),o)})}function _le(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Wj;const n={labels:[],datasets:[]};return zj(n,e.labels),Vj(n,e.datasets,t),n}function Sle(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:o,type:a,data:s,options:l,plugins:c=[],fallbackContent:u,updateMode:d,...f}=e,p=k.useRef(null),m=k.useRef(null),h=()=>{p.current&&(m.current=new Mn(p.current,{type:a,data:_le(s,o),options:l&&{...l},plugins:c}),xP(t,m.current))},g=()=>{xP(t,null),m.current&&(m.current.destroy(),m.current=null)};return k.useEffect(()=>{!i&&m.current&&l&&wle(m.current,l)},[i,l]),k.useEffect(()=>{!i&&m.current&&zj(m.current.config.data,s.labels)},[i,s.labels]),k.useEffect(()=>{!i&&m.current&&s.datasets&&Vj(m.current.config.data,s.datasets,o)},[i,s.datasets]),k.useEffect(()=>{m.current&&(i?(g(),setTimeout(h)):m.current.update(d))},[i,l,s.labels,s.datasets,d]),k.useEffect(()=>{m.current&&(g(),setTimeout(h))},[a]),k.useEffect(()=>(h(),()=>g()),[]),k.createElement("canvas",{ref:p,role:"img",height:n,width:r,...f},u)}const Ele=k.forwardRef(Sle);function Ox(e,t){return Mn.register(t),k.forwardRef((n,r)=>k.createElement(Ele,{...n,ref:r,type:e}))}const Px=Ox("line",Oae),pl=Ox("bar",_ae),Cx=Ox("doughnut",Eae);Mn.register(_x,jr,Vr);const Ole={id:"centerText",afterDraw(e,t,n){const{ctx:r}=e,i=e.getDatasetMeta(0);if(!i?.data?.[0])return;const{x:o,y:a}=i.data[0],{top:s="",bottom:l="",topSize:c=20,bottomSize:u=10,topColor:d="#0F172A",bottomColor:f="#64748B"}=n||{};r.save(),r.textAlign="center",r.textBaseline="middle",r.fillStyle=d,r.font=`600 ${c}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(s,o,a-5),r.fillStyle=f,r.font=`500 ${u}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(l,o,a+12),r.restore()}},Ple=({sold:e=847,unsold:t=73,growthPct:n="+9.1%"})=>{const r=e+t,i={labels:["Sold","Unsold"],datasets:[{data:[e,t],backgroundColor:["#12B981","#EF4444"],borderWidth:2,hoverOffset:4}]},o={responsive:!0,maintainAspectRatio:!1,cutout:"68%",plugins:{legend:{display:!1},tooltip:{callbacks:{label:a=>`${a.label}: ${a.parsed}`},displayColors:!1},centerText:{top:`${r}`,bottom:"Total Units",topSize:20,bottomSize:10}}};return b.jsx(Ne,{title:"Unit Status",period:"This Month",icon:b.jsx(zy,{className:"h-6 w-6 text-green-600"}),className:"h-[238px]",children:b.jsxs("div",{className:"grid grid-cols-12 gap-[16px] items-center",children:[b.jsxs("div",{className:"col-span-5 space-y-3",children:[b.jsxs("div",{children:[b.jsx("div",{className:"!text-[12px] lending-[16px] text-[#64748B]",children:"Sold"}),b.jsx("div",{className:"text-[28px] leading-[32px] text-[#1FA05B]",children:e})]}),b.jsxs("div",{children:[b.jsx("div",{className:"!text-[12px] lending-[16px] text-[#64748B]",children:"Unsold"}),b.jsx("div",{className:"text-[28px] leading-[32px] text-[#EF4444]",children:t})]}),b.jsxs("div",{className:"text-[10px] text-[#1FA05B] flex gap-[8px] items-center ",children:[n," ",b.jsx("div",{className:"text-[#64748B] text-[10px]",children:"Compared to last month"})]})]}),b.jsx("div",{className:"col-span-7",children:b.jsx("div",{className:"h-[158px] w-[158px] ml-auto mr-2",children:b.jsx(Cx,{data:i,options:o,plugins:[Ole]})})})]})})},wP=({value:e=0,total:t=1,colorClass:n="",label:r=""})=>{const i=Math.max(0,Math.min(100,e/(t||1)*100)),o=n==="bg-[#8B5CF6]"?"text-[#8B5CF6]":n==="bg-[#12B981]"?"text-[#12B981]":"text-slate-600";return b.jsxs("div",{className:"flex flex-col items-start",children:[b.jsx("div",{className:"w-2/3 min-w-[80px] h-3 rounded-full overflow-hidden",children:b.jsx("div",{className:`h-3 rounded-full ${n}`,style:{width:`${i}%`}})}),b.jsx("div",{className:`${o} !text-[12px] font-bold mt-1`,children:e}),b.jsx("div",{className:"!text-[12px] text-[#64748B] mt-1",children:r})]})},_P=({title:e,value:t,suffix:n,valueClass:r=""})=>b.jsxs("div",{className:"bg-white border border-[#EBEBEB] rounded-xl shadow-[0_0_12px_0_#EAF2FF] h-[98px] p-4 flex flex-col justify-center",children:[b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#121212] mb-1",children:e}),b.jsxs("div",{className:`text-[28px] leading-[32px] flex item gap-[4px] font-medium ${r}`,children:[t," ",n&&b.jsx("div",{className:"text-[28px] leading-[32px] font-medium",children:n})]})]}),Cle=({totalUnits:e=847,occupiedUnits:t=756,ownerCount:n=700,tenantCount:r=56,avgResidents:i=4.4,avgLeaseMonths:o=18})=>{const a=n+r;return b.jsxs("div",{children:[b.jsxs("div",{className:"bg-white border border-[#EBEBEB] rounded-xl shadow-[0_0_12px_0_#EAF2FF] p-4 h-[128px]",children:[b.jsxs("div",{className:"flex items-center gap-[12px] mb-4",children:[b.jsx(Hy,{className:"h-6 w-6 text-[#329DFF]"}),b.jsx("div",{className:"font-medium text-[#121212]",children:"Occupancy Overview"})]}),b.jsxs("div",{className:"flex items-center justify-between gap-",children:[b.jsxs("div",{children:[b.jsx("div",{className:"text-xs leading-[16px] text-[#64748B]",children:"Occupied Units"}),b.jsxs("div",{className:"flex items-center gap-1",children:[b.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),b.jsxs("div",{className:"text-[#64748B] text-[20px] leading-[32px]",children:["/",e]})]})]}),b.jsxs("div",{className:"flex items-end",children:[b.jsx(wP,{value:n,total:a,colorClass:"bg-[#8B5CF6]",label:"Owner"}),b.jsx(wP,{value:r,total:a,colorClass:"bg-[#12B981]",label:"Tenant"})]})]})]}),b.jsxs("div",{className:"mt-2.5 grid grid-cols-2 gap-[12px]",children:[b.jsx(_P,{title:"Avg Residents Per Unit",value:i,valueClass:"text-[#8B5CF6]"}),b.jsx(_P,{title:"Avg Lease Period",value:o,suffix:"months",valueClass:"text-[#E7A015]"})]})]})};Mn.register(_x,jr,Vr);const kle={id:"centerText",afterDraw(e,t,n){const{ctx:r}=e,i=e.getDatasetMeta(0);if(!i?.data?.[0])return;const{x:o,y:a}=i.data[0],{top:s="",bottom:l="",topSize:c=20,bottomSize:u=10,topColor:d="#0F172A",bottomColor:f="#64748B"}=n||{};r.save(),r.textAlign="center",r.textBaseline="middle",r.fillStyle=d,r.font=`600 ${c}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(s,o,a-5),r.fillStyle=f,r.font=`500 ${u}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(l,o,a+12),r.restore()}},Dle=({ownerCount:e=1e3,tenantCount:t=200,nonResidingOwners:n=26,growthPct:r="+9.1%"})=>{const i=Math.max(e-n,0),o=e+t,a={labels:["Owners","Tenants","Non-residing Owner"],datasets:[{data:[i,t,n],backgroundColor:["#3C81F6","#08B6D4","#8B5CF6"],borderWidth:2,hoverOffset:4}]},s={responsive:!0,maintainAspectRatio:!1,cutout:"68%",plugins:{legend:{display:!1},tooltip:{callbacks:{label:l=>`${l.label}: ${l.parsed}`},displayColors:!1},centerText:{top:`${o}`,bottom:"Total Members",topSize:20,bottomSize:10}}};return b.jsx(Ne,{title:"Resident Overview",icon:b.jsx(ok,{className:"h-6 w-6 text-[#8B5CF6]"}),className:"h-[238px]",children:b.jsxs("div",{className:" flex-1 min-h-0 grid grid-cols-12 gap-[16px] items-center",children:[b.jsxs("div",{className:"col-span-5",children:[b.jsxs("div",{children:[b.jsx("div",{className:"!text-[12px] text-[#64748B] leading-[16px]",children:"Total Owners"}),b.jsx("div",{className:"text-[28px] leading-[32px ] text-[#3C81F6]",children:e})]}),b.jsxs("div",{children:[b.jsx("div",{className:"!text-[12px] text-[#64748B] leading-[16px]",children:"Total Tenants"}),b.jsx("div",{className:"text-[28px] leading-[32px ] text-[#08B6D4]",children:t})]}),b.jsxs("div",{className:"text-[10px] text-[#1FA05B] flex gap-2 items-center",children:[r," ",b.jsx("div",{className:"text-[#64748B] ",children:"Compared to last month"})]})]}),b.jsx("div",{className:"col-span-7",children:b.jsx("div",{className:"h-[162px] w-[162px] ml-auto mr-2",children:b.jsx(Cx,{data:a,options:s,plugins:[kle]})})})]})})};Mn.register(lo,co,fl,jr,Vr);const Tle=({blocks:e=[{name:"Block A",owner:110,rented:24,vacant:8},{name:"Block B",owner:95,rented:18,vacant:6},{name:"Block C",owner:65,rented:12,vacant:18},{name:"Block D",owner:78,rented:16,vacant:30}]})=>{const t=e.map(s=>s.name),n=e.map(s=>s.owner),r=e.map(s=>s.rented),i=e.map(s=>s.vacant),o={labels:t,datasets:[{label:"Owner",data:n,backgroundColor:"#3C81F6",barThickness:40},{label:"",data:n.map(()=>2),backgroundColor:"transparent",barThickness:40},{label:"Rented",data:r,backgroundColor:"#8B5CF6",barThickness:40},{label:"",data:r.map(()=>2),backgroundColor:"transparent",barThickness:40},{label:"Vacant",data:i,backgroundColor:"#08B6D4",barThickness:40}]},a={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,pointStyle:"rectRot",padding:20}},tooltip:{callbacks:{label:s=>`${s.dataset.label}: ${s.parsed.y}`}}},scales:{x:{stacked:!0,grid:{display:!1},ticks:{color:"#64748B"}},y:{stacked:!0,beginAtZero:!0,suggestedMax:180,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:20}}}};return b.jsx(Ne,{title:"Block-wise Occupancy",period:b.jsx(An,{className:"text-xl text-[#884EA7]"}),className:"w-full h-[360px]",titleWeight:"semi-bold",children:b.jsx(pl,{data:o,options:a})})};Mn.register(lo,co,Ex,Sx,jr,Vr);const Ale=e=>{const[t,n]=String(e).split(" ");return`${{Jan:"January",Feb:"February",Mar:"March",Apr:"April",May:"May",Jun:"June",Jul:"July",Aug:"August",Sep:"September",Oct:"October",Nov:"November",Dec:"December"}[t]||t} 20${n}`},Mle=({labels:e=["Jan 25","Feb 25","Mar 25","Apr 25","May 25"],moveIn:t=[24,27,20,26,23],moveOut:n=[12,17,8,5,16]})=>{const r={labels:e,datasets:[{label:"Move-in",data:t,borderColor:"#12B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#12B981",pointStyle:"rectRot",fill:!1},{label:"Move-out",data:n,borderColor:"#8B5CF6",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#8B5CF6",pointStyle:"rectRot",fill:!1}]},i={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:o=>Ale(o[0].label),label:o=>`${o.dataset.label}: ${o.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return b.jsx(Ne,{title:"Move-in/Out Trends",className:"w-full h-[360px]",period:b.jsx(An,{className:"text-[20px] text-[#884EA7]"}),titleWeight:"semi-bold",children:b.jsx(Px,{data:r,options:i})})};Mn.register(lo,co,Ex,Sx,jr,Vr);const Nle=e=>{const[t,n]=String(e).split(" ");return`${{Jan:"January",Feb:"February",Mar:"March",Apr:"April",May:"May",Jun:"June",Jul:"July",Aug:"August",Sep:"September",Oct:"October",Nov:"November",Dec:"December"}[t]||t} 20${n}`},Hj=({labels:e=["Jan 25","Feb 25","Mar 25","Apr 25","May 25"],moveIn:t=[24,27,20,26,23],moveOut:n=[4,17,8,5,16,4,7]})=>{const r={labels:e,datasets:[{label:"Income",data:t,borderColor:"#10B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#10B981",pointStyle:"rectRot",fill:!1},{label:"Expenditure",data:n,borderColor:"#AB0000",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#AB0000",pointStyle:"rectRot",fill:!1}]},i={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:o=>Nle(o[0].label),label:o=>`${o.dataset.label}: ${o.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return b.jsx(Px,{data:r,options:i})};function SP({label:e,value:t,positive:n,bgColor:r,delta:i,deltaLabel:o,textColor:a}){return b.jsxs("div",{className:`rounded-lg p-4 ${r} border border-[#EBEBEB] h-[126px]`,children:[b.jsx("div",{className:`text-[16px] leading-[20px] ${a}`,children:e}),b.jsx("div",{className:"mt-[16px] leading-[28px] !text-[24px] font-medium text-[#121212]",children:t}),b.jsxs("div",{className:"mt-[8px] flex items-center gap-[8px] leading-[14px] text-[10px]",children:[b.jsx("div",{className:n?"text-[#1FA05B] font-medium":"text-[#EF4444] font-medium",children:i}),b.jsx("div",{className:"text-[#64748B] ",children:o})]})]})}function jle(){return b.jsxs(Ne,{title:"Accounting",className:"w-full h-[523px]",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[b.jsxs("div",{className:"grid grid-cols-2 gap-[16px]",children:[b.jsx(SP,{label:"Total Income",value:"AED 5.68M",delta:"+4.4%",positive:!0,bgColor:"bg-slate-50",deltaLabel:"Compared to last month",textColor:"text-[#1FA05B]"}),b.jsx(SP,{label:"Total Expenditure",value:"AED 1.83M",delta:"-1.1%",positive:!1,bgColor:"bg-slate-50",deltaLabel:"Compared to last month",textColor:"text-[#AB0000]"})]}),b.jsx("div",{className:"h-[254px] mt-[35.5px]",children:b.jsx(Hj,{})})]})}Mn.register(lo,co,fl,jr,Vr);const Rle=()=>{const e=["Maintenance","Security","Utilities","Housekeeping","Administration","Others"],r={labels:e,datasets:[{label:"Budget",data:[55e3,56e3,64e3,38e3,54e3,65e3],backgroundColor:"#93C5FD",barThickness:60},{label:"Actual",data:[63e3,48e3,51300,28e3,42e3,35e3],backgroundColor:"#3B82F6",barThickness:60}]},i={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,pointStyle:"rectRot",padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:6,callbacks:{title:o=>e[o[0].dataIndex],label:o=>{const a=o.parsed.y;return`${o.dataset.label}: AED ${(a/1e3).toFixed(1)}K`}}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B"}},y:{beginAtZero:!0,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",callback:o=>`${o/1e3}K`}}}};return b.jsx(Ne,{title:"Budget vs Actuals",className:"w-full h-[362px]",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:b.jsx(pl,{data:r,options:i})})},Ile=()=>{const e=[{title:"Primary Account",amount:285e4,subtitle:"Savings"},{title:"Emergency Fund",amount:12e5,subtitle:"Fixed deposit"},{title:"Maintenance Fund",amount:68e4,subtitle:"Current"}],t=e.reduce((r,i)=>r+i.amount,0),n=r=>r>=1e6?`AED ${(r/1e6).toFixed(2)}M`:r>=1e3?`AED ${(r/1e3).toFixed(1)}K`:`AED ${r}`;return b.jsxs(Ne,{title:"Cash & Bank Balance",className:"w-full h-[362px]",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),children:[b.jsx("div",{className:"flex flex-col gap-[12px]",children:e.map((r,i)=>b.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-lg p-3",children:[b.jsxs("div",{className:"flex flex-col",children:[b.jsx("div",{className:"text-[14px] font-medium text-[#121212]",children:r.title}),b.jsx("div",{className:"!text-[12px] text-[#64748B]",children:r?.subtitle})]}),b.jsx("div",{className:"flex flex-col items-end",children:b.jsx("div",{className:"text-[14px] text-[#1FA05B] font-semibold",children:n(r.amount)})})]},i))}),b.jsxs("div",{className:"flex items-center justify-between border-t border-[#EBEBEB] h-[68px] px-3",children:[b.jsx("div",{className:"text-[14px] font-medium text-[#121212]",children:"Total"}),b.jsx("div",{className:"text-[16px] text-[#1FA05B] font-bold",children:n(t)})]})]})};Mn.register(lo,co,fl,jr,Vr);const Lle=()=>{const e=["Current Month","1-3 Months","3-6 Months","6+ Months"],t=[13e3,9400,8800,7200],n=[18,12,18,6],r={labels:e,datasets:[{label:"Due",data:t,backgroundColor:"#EF4444",barThickness:60}]},i={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:6,callbacks:{title:o=>e[o[0].dataIndex],label:o=>`Due: AED ${(o.parsed.y/1e3).toFixed(1)}K`,afterLabel:o=>`Units Count: ${n[o.dataIndex]}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B"}},y:{beginAtZero:!0,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",callback:o=>`${o/1e3}K`}}}};return b.jsxs(Ne,{title:"Dues Ageing",className:"w-full h-[362px]",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[b.jsx("div",{className:"grid grid-cols-4 md:grid-cols-4 gap-[12px] h-[48px]",children:e.map((o,a)=>b.jsx("div",{className:"p-2 rounded-lg bg-slate-50",children:b.jsxs("div",{className:"flex justify-between items-start",children:[b.jsx("div",{className:"font-medium leading-[16px] !text-[12px] rounded",children:o}),b.jsxs("div",{className:"text-right",children:[b.jsxs("div",{className:"text-red-600 font-medium leading-[16px] !text-[12px]",children:["AED ",(t[a]/1e3).toFixed(1),"K"]}),b.jsxs("div",{className:" text-gray-500 leading-[14px] text-[10px]",children:[n[a]," Units"]})]})]})},o))}),b.jsx("div",{className:"h-[192px]",children:b.jsx(pl,{data:r,options:i})})]})};Mn.register(_x,jr,Vr);const Fle=()=>{const e=["Maintenance","Utilities","Security","Administration","Others"],t=[45e4,32e4,28e4,18e4,12e4],n={labels:e,datasets:[{label:"Expenses",data:t,backgroundColor:["#08B6D4","#8B5CF6","#EF4444","#F69E0A","#12B981"],borderColor:"#FFFFFF",borderWidth:2,cutout:"70%"}]},r=t.reduce((o,a)=>o+a,0),i={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:10,callbacks:{label:o=>`${o.label}: AED ${o.formattedValue}`}}}};return b.jsxs(Ne,{title:"Expense Categories",className:"w-full h-[523px]",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[b.jsxs("div",{className:"relative h-[259px] flex justify-center items-center",children:[b.jsx(Cx,{data:n,options:i}),b.jsxs("div",{className:"absolute text-center",children:[b.jsxs("div",{className:"!text-[24px] font-medium leading-[28px] text-[#121212]",children:["AED ",(r/1e6).toFixed(2),"M"]}),b.jsx("div",{className:"text-[#121212] leading-[18px] text-[14px]",children:"Total Expenses"})]})]}),b.jsx("div",{className:"space-y-2",children:e.map((o,a)=>b.jsxs("div",{className:"flex justify-between items-center text-[14px] pb-2",children:[b.jsxs("div",{className:"flex items-center gap-[8px] !text-[12px] leading-[16px] text-[#64748B]",children:[b.jsx("div",{className:"w-[7px] h-[7px] rotate-45",style:{backgroundColor:n.datasets[0].backgroundColor[a]}}),o]}),b.jsxs("div",{className:"leading-[16px] !text-[12px] text-[#64748B]",children:["AED ",(t[a]/1e3).toFixed(0),"K"]})]},o))})]})},Bl=[{name:"Gym Equipment",value:1e6,color:"#08B6D4"},{name:"Security",value:8e5,color:"#EF4444"},{name:"Others",value:6e5,color:"#F59E0B"},{name:"Pool Maintenance",value:7e5,color:"#8B5CF6"},{name:"Administration",value:52e4,color:"#10B981"}];function $le(){const e=Bl.reduce((t,n)=>t+n.value,0);return b.jsx(Ne,{title:"Asset Value Breakdown",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",titleWeight:"semi-bold",children:b.jsxs("div",{className:"flex flex-col items-center justify-center",children:[b.jsxs("div",{className:"w-[214px] h-[181px] relative",children:[b.jsx(xi,{width:"100%",height:"100%",children:b.jsxs(bu,{children:[b.jsx(il,{data:Bl,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:Bl.map((t,n)=>b.jsx(Br,{fill:t.color},`cell-${n}`))}),b.jsx(bi,{formatter:t=>`AED ${t.toLocaleString()}`})]})}),b.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[b.jsxs("div",{className:"font-medium text-lg leading-[12px] ",children:["AED ",(e/1e6).toFixed(2),"M"]}),b.jsx("div",{className:"text-[10px] leading-[12.59px] text-[#121212] mt-[6px]",children:"Total Assets"})]})]}),b.jsxs("div",{className:"flex justify-between w-full px-4 sm:px-8 mt-4 text-[14px]",children:[b.jsx("div",{className:"flex flex-col gap-[8px]",children:Bl.slice(0,3).map(t=>b.jsxs("div",{className:"flex items-center gap-[8px]",children:[b.jsx("div",{className:"inline-block h-[7px] w-[7px] rotate-45",style:{backgroundColor:t.color}}),b.jsx("div",{className:"text-[#64748B] leading-[16px] !text-[12px]",children:t.name})]},t.name))}),b.jsx("div",{className:"flex flex-col gap-[8px] items-start",children:Bl.slice(3).map(t=>b.jsxs("div",{className:"flex items-center gap-[8px]",children:[b.jsx("div",{className:"inline-block h-[7px] w-[7px] rotate-45",style:{backgroundColor:t.color}}),b.jsx("div",{className:"text-[#64748B] leading-[16px] !text-[12px]",children:t.name})]},t.name))})]})]})})}Mn.register(lo,co,fl,jr,Vr);const Ble=()=>{const e=["Gym","Parking","Swimming Pool","Community Hall","Tennis Court"],t=[13e3,9400,8800,7200,6e3],n=[18,12,18,6],r={labels:e,datasets:[{label:"Due",data:t,backgroundColor:"#8B5CF6",barThickness:60}]},i={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:6,callbacks:{title:o=>e[o[0].dataIndex],label:o=>`Due: AED ${(o.parsed.y/1e3).toFixed(1)}K`,afterLabel:o=>`Units Count: ${n[o.dataIndex]}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B"}},y:{beginAtZero:!0,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",callback:o=>`${o/1e3}K`}}}};return b.jsx(Ne,{title:"Revenue by Category",className:"w-full h-[362px]",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:b.jsx(pl,{data:r,options:i})})};function Wle(e){return Fe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15 5l0 2"},child:[]},{tag:"path",attr:{d:"M15 11l0 2"},child:[]},{tag:"path",attr:{d:"M15 17l0 2"},child:[]},{tag:"path",attr:{d:"M5 5h14a2 2 0 0 1 2 2v3a2 2 0 0 0 0 4v3a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-3a2 2 0 0 0 0 -4v-3a2 2 0 0 1 2 -2"},child:[]}]})(e)}function zle(e){return Fe({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M855.7 210.8l-42.4-42.4a8.03 8.03 0 0 0-11.3 0L168.3 801.9a8.03 8.03 0 0 0 0 11.3l42.4 42.4c3.1 3.1 8.2 3.1 11.3 0L855.6 222c3.2-3 3.2-8.1.1-11.2zM304 448c79.4 0 144-64.6 144-144s-64.6-144-144-144-144 64.6-144 144 64.6 144 144 144zm0-216c39.7 0 72 32.3 72 72s-32.3 72-72 72-72-32.3-72-72 32.3-72 72-72zm416 344c-79.4 0-144 64.6-144 144s64.6 144 144 144 144-64.6 144-144-64.6-144-144-144zm0 216c-39.7 0-72-32.3-72-72s32.3-72 72-72 72 32.3 72 72-32.3 72-72 72z"},child:[]}]})(e)}function Vle({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=Kc,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return b.jsxs(Ne,{title:e,icon:b.jsx("div",{className:"h-6 w-6 grid place-items-center",children:b.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[b.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),b.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[b.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),b.jsx("div",{className:"text-slate-500",children:r})]})]})}function Hle(){const e=[{title:"Total Bookings",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:ik,iconColor:"text-emerald-600"},{title:"Utilisation Rate",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:zle,iconColor:"text-[#329DFF]"},{title:"Revenue",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Wle,iconColor:"text-[#FA7E28]"},{title:"Pending Dues",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:ak,iconColor:"text-[#DBB467]"}];return b.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:e.map((t,n)=>b.jsx(Vle,{...t},n))})}const Od=[{name:"Completed",value:46,color:"#12B981"},{name:"Delayed",value:2,color:"#EF4444"},{name:"Missed",value:2,color:"#F69E0A"}];function Yle(){const t=Od.find(n=>n.name==="Completed")?.value||0;return b.jsx(Ne,{title:"Guard Patrols",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",children:b.jsxs("div",{className:"flex flex-col items-center justify-center",children:[b.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[b.jsx(xi,{width:"100%",height:"100%",children:b.jsxs(bu,{children:[b.jsx(il,{data:Od,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:Od.map((n,r)=>b.jsx(Br,{fill:n.color},`cell-${r}`))}),b.jsx(bi,{formatter:n=>n.toLocaleString()})]})}),b.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[b.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px] ",children:[t,"/",50]}),b.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),b.jsx("div",{className:"flex flex-col gap-[8px] mt-3 w-full px-6 text-[14px]",children:Od.map(n=>b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("div",{className:"flex items-center gap-[8px]",children:[b.jsx("div",{className:"inline-block w-[7px] h-[7px] rotate-45",style:{backgroundColor:n.color}}),b.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:n.name})]}),b.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:n.value})]},n.name))})]})})}Mn.register(lo,co,Ex,Sx,jr,Vr);const Ule=()=>{const t={labels:["10 AM","12 PM","2 PM","4 PM","6 PM","8 PM","10 PM"],datasets:[{label:"Guest",data:[9,5,12,7,3,6,4],borderColor:"#EF4444",backgroundColor:"rgba(239,68,68,0.15)",pointBackgroundColor:"#EF4444",pointStyle:"rectRot",fill:!1},{label:"Cab",data:[15,12,10,14,7,12,8],borderColor:"#7C3AED",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#7C3AED",pointStyle:"rectRot",fill:!1},{label:"Delivery",data:[22,18,16,20,22,14,17],borderColor:"#10B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#10B981",pointStyle:"rectRot",fill:!1},{label:"Service",data:[13,12,8,9,5,10,7],borderColor:"#F59E0B",backgroundColor:"rgba(245,158,11,0.15)",pointBackgroundColor:"#F59E0B",pointStyle:"rectRot",fill:!1}]},n={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:r=>r[0].label,label:r=>`${r.dataset.label} ${r.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return b.jsx(Ne,{title:"Hourly Traffic Flow",className:"w-full h-[362px]",period:b.jsx(An,{className:"text-[20px] text-[#884EA7]"}),children:b.jsx(Px,{data:t,options:n})})};function Kle(){return b.jsx(Ne,{title:"Incident Reports",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",children:b.jsxs("div",{children:[b.jsxs("div",{className:"flex w-full text-center gap-[24px]",children:[b.jsxs("div",{className:"flex-1 py-3 bg-[#FBF4F4] h-[76px] rounded",children:[b.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#AB0000]",children:"3"}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),b.jsxs("div",{className:"flex-1 py-3 bg-[#FFFBF2] h-[76px] rounded",children:[b.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#E7A015]",children:"5"}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#E7A015]",children:"In-progress"})]}),b.jsxs("div",{className:"flex-1 py-3 bg-[#F7FEFA] h-[76px] rounded",children:[b.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:"12"}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),b.jsxs("div",{className:"mt-4 ",children:[b.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#FAFBFD] rounded-md border border-[#FAFBFD]",children:[b.jsxs("div",{className:"flex items-center gap-[8px]",children:[b.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center bg-[#AB0000]",children:b.jsx("div",{className:"text-white !text-[12px] font-bold",children:"!"})}),b.jsx("div",{className:"text-gray-700 font-medium",children:"INC 001"})]}),b.jsxs("div",{className:"px-3 py-1 rounded-full !text-[12px] font-semibold flex items-center gap-[4px] text-[#AB0000] bg-red-50",children:[b.jsx("div",{children:"4 - Danger"}),b.jsx("div",{className:"w-2 h-2 rounded-full bg-[#AB0000]"})]})]}),b.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#FAFBFD] rounded-md border border-[#FAFBFD]",children:[b.jsxs("div",{className:"flex items-center gap-[8px]",children:[b.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center bg-[#E7A015]",children:b.jsx(vw,{className:"text-white text-[10px]"})}),b.jsx("div",{className:"text-gray-700 font-medium",children:"INC 002"})]}),b.jsxs("div",{className:"px-3 py-1 rounded-full !text-[12px] font-semibold flex items-center gap-[4px] text-[#E7A015] bg-yellow-50",children:[b.jsx("div",{children:"3 - High"}),b.jsx("div",{className:"w-2 h-2 rounded-full bg-[#E7A015]"})]})]}),b.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#FAFBFD] rounded-md border border-[#FAFBFD]",children:[b.jsxs("div",{className:"flex items-center gap-[8px]",children:[b.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center bg-[#1FA05B]",children:b.jsx(vw,{className:"text-white text-[10px]"})}),b.jsx("div",{className:"text-gray-700 font-medium",children:"INC 003"})]}),b.jsxs("div",{className:"px-3 py-1 rounded-full !text-[12px] font-semibold flex items-center gap-[4px] text-[#1FA05B] bg-green-50",children:[b.jsx("div",{children:"1 - Low"}),b.jsx("div",{className:"w-2 h-2 rounded-full bg-[#1FA05B]"})]})]})]})]})})}function qle(){return b.jsx(Ne,{title:"Staff Attendance",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",children:b.jsxs("div",{children:[b.jsxs("div",{className:"flex w-full text-center h-[76px] gap-[16px] mb-2",children:[b.jsxs("div",{className:"flex-1 py-4 bg-green-50 rounded-md",children:[b.jsx("div",{className:"!text-[24px] leading-[18px] font-medium text-[#1FA05B] pb-[8px]",children:"25"}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#1FA05B]",children:"Present"})]}),b.jsxs("div",{className:"flex-1 py-4 bg-red-50 rounded-md",children:[b.jsx("div",{className:"!text-[24px] leading-[18px] font-medium text-[#AB0000] pb-[8px]",children:"1"}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#AB0000]",children:"Absent"})]})]}),b.jsxs("div",{className:"mt-[24px] ",children:[b.jsxs("div",{className:"flex justify-between items-center p-3 bg-[#FAFBFD] rounded-md",children:[b.jsx("div",{className:" font-medium !text-[12px] leading-[18px]",children:"Security guards"}),b.jsx("div",{className:"text-[#64748B] leading[20px] text-[14px]",children:"12/12 Present"})]}),b.jsxs("div",{className:"flex justify-between items-center p-3 bg-[#FAFBFD] rounded-md",children:[b.jsx("div",{className:" font-medium !text-[12px] leading-[18px]",children:"Housekeeping"}),b.jsx("div",{className:"text-[#64748B] leading[20px] text-[14px]",children:"7/8 Present"})]}),b.jsxs("div",{className:"flex justify-between items-center p-3 bg-[#FAFBFD] rounded-md",children:[b.jsx("div",{className:" font-medium !text-[12px] leading-[18px]",children:"Maintenance"}),b.jsx("div",{className:"text-[#64748B] leading[20px] text-[14px]",children:"4/4 Present"})]}),b.jsxs("div",{className:"flex justify-between items-center p-3 bg-[#FAFBFD] rounded-md",children:[b.jsx("div",{className:" font-medium !text-[12px] leading-[18px]",children:"Gardening"}),b.jsx("div",{className:"text-[#64748B] leading[20px] text-[14px]",children:"2/2 Present"})]})]})]})})}function Gle(e){return Fe({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M116,132V96a12,12,0,0,1,24,0v36a12,12,0,0,1-24,0Zm12,56a16,16,0,1,0-16-16A16,16,0,0,0,128,188ZM228,56v56c0,54.29-26.32,87.22-48.4,105.29-23.71,19.39-47.44,26-48.44,26.29a12.1,12.1,0,0,1-6.32,0c-1-.28-24.73-6.9-48.44-26.29C54.32,199.22,28,166.29,28,112V56A20,20,0,0,1,48,36H208A20,20,0,0,1,228,56Zm-24,4H52v52c0,35.71,13.09,64.69,38.91,86.15A126.14,126.14,0,0,0,128,219.38a126.28,126.28,0,0,0,37.09-21.23C190.91,176.69,204,147.71,204,112Z"},child:[]}]})(e)}function Xle({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=Kc,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return b.jsxs(Ne,{title:e,icon:b.jsx("div",{className:"h-6 w-6 grid place-items-center",children:b.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[b.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),b.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[b.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),b.jsx("div",{className:"text-slate-500",children:r})]})]})}function Qle(){const e=[{title:"Total Visitors",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Hy,iconColor:"text-[#329DFF]"},{title:"Active Incidents",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:pre,iconColor:"text-[#F69E0A]"},{title:"Missed Patrols",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Gle,iconColor:"text-[#AB0000]"},{title:"Parking Usage",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:k3,iconColor:"text-[#36AB6C]"}];return b.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:e.map((t,n)=>b.jsx(Xle,{...t},n))})}const Zle=[{title:"Maintenance",total:12,pending:3},{title:"Security",total:8,pending:1},{title:"Housekeeping",total:6,pending:2},{title:"Utilities",total:10,pending:4}],Jle=(e="")=>e.replace(/</g,"<").replace(/>/g,">").replace(/<[^>]*>/g,"").trim();function ece({data:e}){const t=Array.isArray(e?.complaints_by_category)&&e.complaints_by_category.length>0?e.complaints_by_category.map(n=>({title:Jle(n.category_name)||"—",total:n.total||0,pending:n.pending||0})):Zle;return b.jsx(Ne,{title:"Complaints",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:b.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>b.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-lg p-3 h-[62px]",children:[b.jsxs("div",{className:"flex flex-col",children:[b.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),b.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),b.jsxs("div",{className:"flex flex-col items-end",children:[b.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},r))})})}const tce=e=>{const t={0:"𝟎",1:"𝟏",2:"𝟐",3:"𝟑",4:"𝟒",5:"𝟓",6:"𝟔",7:"𝟕",8:"𝟖",9:"𝟗"};return String(e).split("").map(n=>t[n]||n).join("")},nce=[{level:"Level 1",open_count:3,in_progress_count:4,closed_count:5,total:12},{level:"Level 2",open_count:1,in_progress_count:1,closed_count:1,total:3},{level:"Level 3",open_count:5,in_progress_count:2,closed_count:3,total:10}],rce=({active:e,payload:t,label:n})=>{if(!e||!t)return null;const r=[{key:"open_count",label:"Open",color:"#EF4444"},{key:"in_progress_count",label:"In Progress",color:"#F59D0D"},{key:"closed_count",label:"Closed",color:"#12B981"}];return b.jsxs("div",{style:{backgroundColor:"#0B0B0B",padding:"14px 40px 14px 18px",borderRadius:"10px",color:"#ffffff"},children:[b.jsx("div",{style:{color:"#ffffff",fontSize:"12px",fontWeight:"900",marginBottom:"10px"},children:n}),r.map((i,o)=>{const a=t[0]?.payload[i.key]||0,s=tce(a);return b.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:o<r.length-1?"8px":"0",fontSize:"12px"},children:[b.jsx("div",{style:{width:"8px",height:"8px",backgroundColor:i.color,transform:"rotate(45deg)",marginRight:"8px"}}),b.jsx("span",{style:{color:"D1D3D4",minWidth:"100px"},children:i.label}),b.jsx("span",{style:{marginLeft:"auto",fontWeight:"700"},children:s})]},i.key)})]})},ice=()=>{const e=[{label:"Open",color:"#EF4444"},{label:"In Progress",color:"#F59D0D"},{label:"Closed",color:"#12B981"}];return b.jsx("div",{style:{display:"flex",justifyContent:"space-between",gap:"15px"},children:e.map(t=>b.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[b.jsx("div",{style:{width:"6px",height:"6px",backgroundColor:t.color,transform:"rotate(45deg)"}}),b.jsx("span",{style:{fontSize:"14px"},children:t.label})]},t.label))})},oce=({data:e})=>{const t=k.useMemo(()=>(Array.isArray(e?.complaints_by_level)&&e.complaints_by_level.some(l=>Number(l.total)>0)?e.complaints_by_level:nce).map(l=>({level:l.level||"—",open_count:Number(l.open_count)||0,in_progress_count:Number(l.in_progress_count)||0,closed_count:Number(l.closed_count)||0,total:Number(l.total)||0})),[e]),n=k.useMemo(()=>Math.max(...t.map(a=>a.total),5),[t]),r=Math.ceil(n*1.2),i=6,o=Math.max(Math.ceil(n/i),1);return b.jsxs(Ne,{title:"Complaints by Level",className:"w-full h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:[b.jsx(xi,{width:"100%",height:"85%",children:b.jsxs(qM,{data:t,margin:{top:5,right:-25,left:-30,bottom:5},children:[b.jsx(ol,{strokeDasharray:"0",vertical:!1}),b.jsx(al,{dataKey:"level"}),b.jsx($a,{domain:[0,r],ticks:Array.from({length:i+1},(a,s)=>s*o)}),b.jsx(bi,{content:b.jsx(rce,{}),cursor:!1}),b.jsx(nc,{dataKey:"open_count",stackId:"a",fill:"#EF4444",barSize:44,radius:[0,0,0,0]}),b.jsx(nc,{dataKey:"in_progress_count",stackId:"a",fill:"#F59D0D",barSize:44,radius:[0,0,0,0]}),b.jsx(nc,{dataKey:"closed_count",stackId:"a",fill:"#12B981",barSize:44,radius:[0,0,0,0]})]})}),b.jsx(ice,{})]})},ace=[{title:"Maintenance",total:18,pending:4},{title:"Security",total:11,pending:2},{title:"Housekeeping",total:9,pending:3},{title:"Utilities",total:14,pending:5}];function sce({data:e}){const t=Array.isArray(e?.request_box_by_type)&&e.request_box_by_type.length>0?e.request_box_by_type.map(n=>({title:n.category_name||"—",total:Number(n.total)||0,pending:Number(n.pending)||0})):ace;return b.jsx(Ne,{title:"Request Box",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:b.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>b.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-lg p-3 h-[62px]",children:[b.jsxs("div",{className:"flex flex-col",children:[b.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),b.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),b.jsxs("div",{className:"flex flex-col items-end",children:[b.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},`${n.title}-${r}`))})})}function lce(e){return Fe({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinejoin:"round",strokeWidth:"32",d:"M416 221.25V416a48 48 0 0 1-48 48H144a48 48 0 0 1-48-48V96a48 48 0 0 1 48-48h98.75a32 32 0 0 1 22.62 9.37l141.26 141.26a32 32 0 0 1 9.37 22.62z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M256 56v120a32 32 0 0 0 32 32h120m-232 80h160m-160 80h160"},child:[]}]})(e)}const cce=["open_complaints","pending_requests","avg_response_time","resolution_rate"],uce={open_complaints:{title:"Open Complaints",Icon:ik,iconColor:"#AB0000",deltaLabel:"Compared to last month"},pending_requests:{title:"Pending Requests",Icon:lce,iconColor:"#E7A015",deltaLabel:"Compared to last month"},avg_response_time:{title:"Avg Response Time",Icon:L3,iconColor:"#1FA05B",deltaLabel:"Compared to last month"},resolution_rate:{title:"Resolution Rate",Icon:N3,iconColor:"#329DFF",deltaLabel:"Compared to last month"}},dce=({children:e,size:t=28,lineHeight:n=32,weight:r=500,color:i="#121212"})=>b.jsx("div",{style:{fontWeight:r,fontSize:`${t}px`,lineHeight:`${n}px`,color:i},children:e}),fce={primary:{size:28,lineHeight:32,weight:500}},pce={open_complaints:{current:24,trend_percent:"-8%",direction:"bad"},pending_requests:{current:17,trend_percent:"-5%",direction:"bad"},avg_response_time:{current:"2.4 h",trend_percent:"+6%",direction:"good"},resolution_rate:{current:"89%",trend_percent:"+4%",direction:"good"}};function hce({id:e,data:t}){return e&&t&&!t[e]&&t.current!==void 0?b.jsx(EP,{id:e,data:t}):b.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:cce.map(n=>b.jsx(EP,{id:n},n))})}function EP({id:e,data:t}){const n=uce[e];if(!n)return null;const r=(d,f)=>f==null?"—":d==="avg_response_time"?typeof f=="number"?`${f} h`:f:d==="resolution_rate"&&typeof f=="number"?`${f}%`:f,{title:i,Icon:o=Kc,iconColor:a,deltaLabel:s}=n,l=t&&Object.keys(t).length>0?t:pce[e],c=r(e,l?.current),u=l?.trend_percent??"—";return l?.direction==="good"||l?.direction,b.jsx("div",{className:"h-[132px]",children:b.jsxs(Ne,{title:i,titleColor:a,icon:b.jsx("div",{className:"h-[20px] w-[20px] flex items-center justify-center",children:b.jsx(o,{className:"h-[20px] w-[20px]",style:{color:a}})}),childrenClassName:"!space-y-[12px]",iconClassName:"!gap-[12px]",children:[b.jsx(dce,{...fce.primary,children:c}),b.jsxs("div",{className:"flex items-center gap-[8px] text-[12px] leading-[16px]",children:[b.jsx(Yy,{value:u}),b.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:s})]})]})})}function OP({title:e,date:t,rsvp:n,utilisation:r,status:i}){return b.jsxs("div",{className:" bg-[#F8FAFC] h-[106px] px-3 mt-3",children:[b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsx("div",{className:"text-[16px] leading-[20px] font-semibold text-[#121212]",children:e}),b.jsx("div",{className:`!text-[12px] font-medium leading-[16px] px-2 py-1 ${i==="Completed"?"text-[#36AB6C] bg-[#E6F7EE]":i==="Upcoming"?"text-[#329DFF] bg-[#E6F2FF]":"text-slate-500 bg-slate-100"}`,children:i})]}),b.jsx("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:t}),b.jsxs("div",{className:"flex justify-between items-center mt-2",children:[b.jsxs("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:[n," RSVP"]}),b.jsxs("div",{className:"text-[#3C82F6] text-[14px] leading-[18px] font-medium",children:[r,"% utilisation"]})]}),b.jsx("div",{className:"w-full bg-[#F8FAFC] h-[6px] rounded mt-2 mb-3",children:b.jsx("div",{className:"h-[6px] rounded bg-[#3C82F6]",style:{width:`${r}%`}})})]})}function mce(){return b.jsx(Ne,{title:"Events Utilisation",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"w-full h-[360px]",children:b.jsxs("div",{children:[b.jsx(OP,{title:"Holi Celebration",date:"25 Jun 2025",rsvp:"78/100",utilisation:71,status:"Upcoming"}),b.jsx(OP,{title:"Maintenance Meeting",date:"25 Jun 2025",rsvp:"45/60",utilisation:75,status:"Completed"})]})})}function Pd({label:e,value:t,subLabel:n,bgColor:r,textColor:i}){return b.jsxs("div",{className:`rounded-lg p-4 ${r} h-[124px]`,children:[b.jsx("div",{className:`text-[16px] font-medium ${i} leading-[20px]`,children:e}),b.jsx("div",{className:"mt-4 text-[28px] leading-[32px] font-semibold text-[#121212]",children:t}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-2",children:n})]})}function gce(){return b.jsx(Ne,{title:"Notice Board Status",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"w-full h-[360px]",children:b.jsxs("div",{className:"grid grid-cols-2 gap-[16px]",children:[b.jsx(Pd,{label:"Active",value:138,subLabel:"3 expiring soon",bgColor:"bg-[#F0FFF7]",textColor:"text-[#1FA05B]"}),b.jsx(Pd,{label:"Scheduled",value:13,subLabel:"4 this week",bgColor:"bg-[#FFFBF2]",textColor:"text-[#E7A015]"}),b.jsx(Pd,{label:"Recurring",value:3,subLabel:"All active",bgColor:"bg-[#EDF6FF]",textColor:"text-[#329DFF]"}),b.jsx(Pd,{label:"Expired",value:7,subLabel:"4 recent",bgColor:"bg-[#F6F6F6]",textColor:"text-[#64748B]"})]})})}function Yj(e){return Fe({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M20 22H4C3.44772 22 3 21.5523 3 21V3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22ZM19 20V4H5V20H19ZM8 9H16V11H8V9ZM8 13H16V15H8V13Z"},child:[]}]})(e)}function vce({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=Kc,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return b.jsx(Ne,{title:e,icon:b.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:b.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:b.jsxs("div",{children:[b.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),b.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[b.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),b.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}function yce({data:e}){const t=[{title:e?.title||"Total Bookings",value:145,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Yj,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"}];return b.jsx("div",{className:"h-full",children:t.map((n,r)=>b.jsx(vce,{...n},r))})}function bce(e){return Fe({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"},child:[]}]})(e)}function xce({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=Kc,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return b.jsx(Ne,{title:e,icon:b.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:b.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:b.jsxs("div",{children:[b.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),b.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[b.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),b.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}function wce(){const e=[{title:"Notice",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Yj,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"},{title:"Post",value:83,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:D3,iconColor:"text-[#329DFF]",iconBg:"bg-emerald-50"},{title:"Poll",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:dre,iconColor:"text-[#FA7E28]",iconBg:"bg-orange-100"},{title:"Poll",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:bce,iconColor:"text-[#DBB467]",iconBg:"bg-yellow-100"}];return b.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:e.map((t,n)=>b.jsx(xce,{...t},n))})}const PP=({value:e=0,total:t=1,colorClass:n="",label:r=""})=>{const i=Math.max(0,Math.min(100,e/(t||1)*100)),o=n==="bg-[#8B5CF6]"?"text-[#8B5CF6]":n==="bg-[#12B981]"?"text-[#12B981]":"text-slate-600";return b.jsxs("div",{className:"flex flex-col items-start",children:[b.jsx("div",{className:"w-2/3 min-w-[80px] h-3 rounded-full overflow-hidden",children:b.jsx("div",{className:`h-[11px] rounded-full ${n}`,style:{width:n==="bg-[#12B981]"?`${i+45}%`:`${i}%`}})}),b.jsx("div",{className:`${o} !text-[12px] font-bold mt-1`,children:e}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-1",children:r})]})},_ce=({occupiedUnits:e=9e3,EmployeesCount:t=8910,AdminsCount:n=90})=>{const r=t+n;return b.jsx("div",{children:b.jsxs("div",{className:"bg-white !border-[0.5px] !border-[#EBEBEB] rounded-xl shadow-[0_0_12px_0_#EAF2FF] p-4 h-[128px]",children:[b.jsxs("div",{className:"flex items-center gap-[12px] h-[20px]",style:{marginBottom:"24px"},children:[b.jsx(Hy,{className:"!text-[20px] text-[#329DFF]"}),b.jsx("div",{className:"font-medium text-[#121212]",children:"Occupancy Overview (Static Data)"})]}),b.jsxs("div",{className:"flex items-start justify-between",children:[b.jsxs("div",{children:[b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] font-normal",children:"Total Occupants"}),b.jsx("div",{className:"flex items-center gap-1",children:b.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:e})})]}),b.jsxs("div",{className:"flex items-end",children:[b.jsx(PP,{value:t,total:r,colorClass:"bg-[#8B5CF6]",label:"Employees"}),b.jsx(PP,{value:n,total:r,colorClass:"bg-[#12B981]",label:"Admins"})]})]})]})})};Mn.register(lo,co,fl,jr);const Sce=()=>{const t={labels:["HP","Adobe","Anarock","Swiggy","Infosys","Zepto"],datasets:[{data:[2e3,1700,1500,1200,900,800],backgroundColor:["#329DFF","#EF4645","#8A2E64","#F69E0A","#A2BB40","#8B5CF6"],barThickness:34}]},n={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff",displayColors:!1,callbacks:{label:r=>`Employees: ${r.parsed.y}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B",font:{size:12}}},y:{beginAtZero:!0,max:2e3,ticks:{stepSize:500,color:"#64748B"},grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1}}}};return b.jsxs(Ne,{className:"w-full h-[238px]",title:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(A5,{className:"!text-[20px] text-[#8B5CF6]"}),b.jsx("div",{className:"font-medium text-[#121212]",children:"Employee Footfall (Static Data)"})]}),period:b.jsx("span",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Today"}),children:[b.jsxs("div",{style:{marginBottom:"16px",marginTop:"8px"},children:[b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Employees Inside"}),b.jsx("div",{className:"text-[20px] leading-[24px] font-medium text-[#1FA05B]",children:"7,500"})]}),b.jsx("div",{className:"h-[97px]",children:b.jsx(pl,{data:t,options:n})})]})};function Ece(){return b.jsx(Ne,{className:"h-[324px]",title:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(T5,{className:"!text-[20px] text-[#FA7E28]"}),b.jsx("div",{className:"font-medium text-[#121212]",children:"Food & Beverages (Static Data)"})]}),period:b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Today"}),children:b.jsxs("div",{className:"flex flex-col h-full",children:[b.jsxs("div",{className:"grid grid-cols-2 gap-6 mb-6",children:[b.jsxs("div",{children:[b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Orders"}),b.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:247})]}),b.jsxs("div",{children:[b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Revenue Generated"}),b.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF]",children:["₹ ","82K"]}),b.jsxs("div",{className:"inline-flex items-center gap-1 mt-2 text-[10px] leading-[14px] px-2 py-1 rounded-full text-[#1FA05B] bg-green-50",children:[b.jsx(nk,{}),8,"%",b.jsx("span",{children:"from last month"})]})]})]}),b.jsxs("div",{className:"space-y-5",children:[b.jsxs("div",{children:[b.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[b.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:"HP"}),b.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[b.jsx("div",{className:"text-[#64748B] inline-block",children:"120 orders"}),b.jsx("div",{className:"mx-2 text-[#121212] inline-block",children:"₹ 45K"})]})]}),b.jsx("div",{className:"h-3 bg-gray-100 rounded-full",children:b.jsx("div",{className:"h-3 bg-blue-500 rounded-full",style:{width:"70%"}})})]}),b.jsxs("div",{children:[b.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[b.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:"Adobe"}),b.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[b.jsx("div",{className:"text-[#64748B] inline-block",children:"85 orders"}),b.jsx("div",{className:"mx-2 text-[#121212] inline-block",children:"₹ 23K"})]})]}),b.jsx("div",{className:"h-3 bg-gray-100 rounded-full",children:b.jsx("div",{className:"h-3 bg-red-500 rounded-full",style:{width:"50%"}})})]}),b.jsxs("div",{children:[b.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[b.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:"Anarock"}),b.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[b.jsx("div",{className:"text-[#64748B] inline-block",children:"42 orders"}),b.jsx("div",{className:"mx-2 text-[#121212] inline-block",children:"₹ 14K"})]})]}),b.jsx("div",{className:"h-3 bg-gray-100 rounded-full",children:b.jsx("div",{className:"h-3 bg-purple-700 rounded-full",style:{width:"25%"}})})]})]})]})})}function Oce({data:e}){const t=e?.amenitySummary||{},n=Array.isArray(e?.chartData)?e.chartData:[],r=n.length>0&&n.every(c=>c?.isPaid===!1),i=t?.totalBookings||0,o=n.reduce((c,u)=>{const d=u?.isPaid?u?.paid_bookings||0:u?.unpaid_bookings||0;return c+d},0),a=n.map(c=>{const u=c?.isPaid?c?.paid_bookings||0:c?.unpaid_bookings||0,d=c?.isPaid?`₹${c?.paid_revenue||"0.00"}`:"",f=o>0?Math.round(u/o*100):0;return{name:c?.facility_name||"Unknown",bookings:u,revenue:d,percentage:f,color:c?.isPaid?"bg-violet-500":"bg-slate-400",isPaid:c?.isPaid}}),s=typeof t?.growth_percentage=="number"?t.growth_percentage:null,l=s!==null?s>=0:!0;return b.jsx(Ne,{className:"h-[324px]",title:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(C3,{className:"!text-[20px] text-[#884EA7]"}),b.jsx("div",{className:"font-medium text-[#121212]",children:"Amenities"})]}),period:b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Today"}),children:b.jsxs("div",{className:"flex flex-col h-full",children:[b.jsxs("div",{className:"grid grid-cols-2 gap-6 mb-6",children:[b.jsxs("div",{children:[b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Bookings"}),b.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:i})]}),!r&&b.jsxs("div",{children:[b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Revenue Generated"}),b.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF]",children:["₹",t?.todayPaidRevenue??"0.00"]}),s!==null&&b.jsxs("div",{className:`inline-flex items-center gap-1 mt-2 text-[10px] leading-[14px] px-2 py-1 rounded-full ${l?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[l?b.jsx(nk,{}):b.jsx(O3,{}),s,"%",b.jsx("span",{children:"from last month"})]})]})]}),b.jsx("div",{className:"space-y-5",children:a.length>0?a.map((c,u)=>b.jsxs("div",{children:[b.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[b.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:c.name}),b.jsxs("div",{className:"font-medium text-[12px] leading-[16px]",children:[b.jsxs("div",{className:"text-[#64748B] inline",children:[c.bookings," bookings"]}),c.isPaid&&b.jsx("div",{className:"mx-2 text-[#121212] inline",children:c.revenue})]})]}),b.jsx("div",{className:"h-3 bg-gray-100 rounded-full",children:b.jsx("div",{className:`h-3 rounded-full ${c.color}`,style:{width:`${c.percentage}%`}})})]},u)):b.jsx("div",{className:"flex items-center justify-center h-[120px]",children:b.jsx("div",{className:"text-[12px] text-[#94A3B8]",children:"No amenity usage data available"})})})]})})}Mn.register(lo,co,fl,jr,Vr);function Pce({data:e=[]}){const t=[{level:"L1",open_count:55,in_progress_count:22,on_hold:15,closed_count:6},{level:"L2",open_count:45,in_progress_count:25,on_hold:18,closed_count:5},{level:"L3",open_count:58,in_progress_count:23,on_hold:14,closed_count:6}],n=e.length>0?e:t,r=[],i=[],o=[],a=[],s=[];for(let u=0;u<n.length;u++)r.push(n[u].level),i.push(Number(n[u].open_count)),o.push(Number(n[u].in_progress_count)),a.push(Number(n[u].on_hold)),s.push(Number(n[u].closed_count));const l={labels:r,datasets:[{label:"Open",data:i,backgroundColor:"#3B82F6",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"In Progress",data:o,backgroundColor:"#F59E0B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"On-Hold",data:a,backgroundColor:"#64748B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"Closed",data:s,backgroundColor:"#10B981",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"}]},c={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,pointStyle:"rectRot",padding:20,color:"#64748B"}},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff"}},scales:{x:{stacked:!0,grid:{display:!1},ticks:{color:"#64748B"}},y:{stacked:!0,beginAtZero:!0,grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1},ticks:{color:"#64748B",stepSize:1,precision:0,callback:u=>Math.round(u)}}}};return b.jsx(Ne,{className:"h-[267px]",title:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(j3,{className:"!text-[20px] text-[#3C81F6]"}),b.jsx("div",{className:"font-medium text-[#121212]",children:"Ticket Escalation Levels"})]}),period:b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Today"}),children:b.jsx("div",{className:"h-full",children:b.jsx(pl,{data:l,options:c})})})}const Cce=({active:e,payload:t})=>!e||!t||!t.length?null:b.jsxs("div",{style:{backgroundColor:"#000000",color:"#ffffff",padding:"8px 10px",borderRadius:"8px",fontSize:"12px"},children:[b.jsx("div",{className:"font-medium",children:t[0].name}),b.jsx("div",{children:t[0].value})]});function kce({data:e=null}){const n=e||{open:12,on_hold:5,cancelled:3,completed:156,in_progress:8,total_complaints:184},r=a=>{const s=Number(a);return isNaN(s)?0:s},i=[{name:"Completed",value:r(n.completed),color:"#10B981"},{name:"Open",value:r(n.open),color:"#3B82F6"},{name:"In Progress",value:r(n.in_progress),color:"#F59E0B"},{name:"On Hold",value:r(n.on_hold),color:"#6B7280"},{name:"Cancelled",value:r(n.cancelled),color:"#EF4444"}],o=r(n.total_complaints);return b.jsx(Ne,{className:"h-[267px]",title:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(rv,{className:"!text-[20px] text-[#EF4444]"}),b.jsx("div",{className:"font-medium text-[#121212]",children:"Ticket Status"})]}),period:b.jsx("span",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Today"}),children:b.jsxs("div",{className:"flex h-full items-center gap-4",children:[b.jsxs("div",{className:"w-[202px] h-[170px] relative",children:[b.jsx(xi,{width:"100%",height:"100%",children:b.jsxs(bu,{children:[b.jsx(il,{data:i,innerRadius:55,outerRadius:85,dataKey:"value",stroke:"#FFFFFF",strokeWidth:2,children:i.map((a,s)=>b.jsx(Br,{fill:a.color},s))}),b.jsx(bi,{content:b.jsx(Cce,{}),wrapperStyle:{zIndex:1e3}})]})}),b.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[b.jsxs("div",{className:"flex items-baseline text-[18px] leading-[22px] font-medium text-[#121212]",children:[b.jsx("div",{children:r(n.completed)}),b.jsxs("div",{className:"text-[18.18px] leading-[22.22px] text-[#121212]",children:["/",o]})]}),b.jsx("div",{className:"text-[10.1px] leading-[14.14px] text-[#64748B]",children:"Completed"})]})]}),b.jsx("div",{className:"flex-1 space-y-2",children:i.map(a=>b.jsxs("div",{className:"flex items-center justify-between text-sm",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx("div",{className:"h-[7px] w-[16px]",style:{backgroundColor:a.color}}),b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]}),b.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px] font-medium",children:a.value})]},a.name))})]})})}const CP={visitorSummary:{totalVisitorsToday:150,peakTime:"2:00 - 4:00PM",peakCount:50,activeWalkins:18,preApprovedCheckins:3},popupData:{walkins:{currently_inside:18,total_visited_today:58},preApproved:{completed_visits:3,total_expected_today:5}},chartData:[{hour:"10 AM",walkins:22,preApproved:30},{hour:"12 PM",walkins:15,preApproved:28},{hour:"2 PM",walkins:30,preApproved:38},{hour:"4 PM",walkins:45,preApproved:50},{hour:"6 PM",walkins:25,preApproved:40}]};function kP({title:e,color:t,rows:n=[],children:r}){const i=b.jsxs("div",{className:"bg-white rounded-xl min-w-[260px] p-4",children:[b.jsxs("div",{className:"flex items-center gap-2 font-medium text-[#121212]",children:[b.jsx(Mp,{className:`text-[20px] ${t}`}),b.jsx("div",{children:e??""})]}),b.jsx("div",{className:"mt-3 pt-3 border-t border-dashed border-gray-200 space-y-2",children:n?.map(({label:o,value:a,valueColor:s})=>b.jsxs("div",{className:"flex justify-between text-[14px]",children:[b.jsx("div",{children:o??""}),b.jsx("div",{className:"font-semibold",style:{color:s||"#121212"},children:a??0})]},o))})]});return b.jsx(ej,{content:i,placement:"right-start",interactive:!0,delay:[100,0],offset:[6,0],appendTo:()=>document.body,theme:"light-border",maxWidth:"none",children:r})}function Dce({data:e}){const t=e&&Object.keys(e).length?e:CP,n=t?.visitorSummary??{},r={walkins:{currently_inside:Number(t?.walkinsPopupData?.walkinsInside??0),total_visited_today:Number(t?.walkinsPopupData?.totalWalkins??0)},preApproved:{completed_visits:Number(t?.preApprovedPopupData?.preApprovedCheckIns??0),total_expected_today:Number(t?.preApprovedPopupData?.totalPreApprovedCheckIns??0)}},i=k.useMemo(()=>{const a=t?.chartData??[];if(!a.length)return CP.chartData;const s=[];for(let l=0;l<a.length;l++)s.push({time:a[l]?.hour??"-",walkins:a[l]?.walkins??0,approved:a[l]?.preApproved??0});return s},[t]),o=new Date().toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit",hour12:!0});return b.jsx(Ne,{className:"h-[377px]",title:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(Mp,{className:"!text-[20px] text-[#8B5CF6]"}),b.jsx("div",{className:"font-medium text-[#121212]",children:"Visitor Updates"})]}),period:b.jsx("div",{className:"flex items-center gap-1 text-[12px] text-[#64748B]",children:b.jsxs("div",{children:["Today at ",o]})}),children:b.jsxs("div",{className:"flex flex-col mt-2",children:[b.jsxs("div",{className:"grid grid-cols-2 gap-y-4 gap-x-6 mb-6",children:[b.jsxs("div",{children:[b.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Total Visitors"}),b.jsx("div",{className:"text-[20px] font-medium text-[#08B6D4]",children:n?.totalVisitorsToday??0})]}),b.jsxs("div",{children:[b.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Peak Time"}),b.jsx("div",{className:"text-[20px] font-medium text-[#8B5CF6]",children:n?.peakTime??"-"})]}),b.jsxs("div",{className:"mt-2",children:[b.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Active Walk-ins"}),b.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[b.jsx("div",{className:"text-[28px] text-[#1FA05B] leading-[32px]",children:r?.walkins?.currently_inside??0}),b.jsx(kP,{title:"Active Walk-ins",color:"text-[#1FA05B]",rows:[{label:"Currently Inside",value:r?.walkins?.currently_inside??0,valueColor:"#1FA05B"},{label:"Total Visited Today",value:r?.walkins?.total_visited_today??0}],children:b.jsxs("div",{className:"text-gray-400 cursor-pointer ml-1 leading-[32px]",children:["/",r?.walkins?.total_visited_today??0]})})]})]}),b.jsxs("div",{className:"mt-2",children:[b.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Pre-approved Check-ins"}),b.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[b.jsx("div",{className:"text-[28px] text-[#E7A015] leading-[32px]",children:r?.preApproved?.completed_visits??0}),b.jsx(kP,{title:"Pre-approved Check-ins",color:"text-[#E7A015]",rows:[{label:"Completed Visits",value:r?.preApproved?.completed_visits??0,valueColor:"#E7A015"},{label:"Total Expected Check-ins Today",value:r?.preApproved?.total_expected_today??0}],children:b.jsxs("div",{className:"text-gray-400 cursor-pointer ml-1 leading-[32px]",children:["/",r?.preApproved?.total_expected_today??0]})})]})]})]}),b.jsx("div",{className:"w-full h-[179px]",children:b.jsx(xi,{width:"100%",height:"100%",children:b.jsxs(B0,{data:i??[],children:[b.jsx(ol,{stroke:"#E5E7EB",strokeDasharray:"4 4",vertical:!1}),b.jsx(al,{dataKey:"time",axisLine:!1,tickLine:!1,tick:{fill:"#121212",fontSize:12}}),b.jsx($a,{width:30,axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12}}),b.jsx(bi,{}),b.jsx(Co,{type:"monotone",dataKey:"walkins",stroke:"#22C55E",strokeWidth:2,dot:!1}),b.jsx(Co,{type:"monotone",dataKey:"approved",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",dot:!1})]})})})]})})}exports.Accounting=jle;exports.Amenities=Oce;exports.AssetValueBreakdown=$le;exports.BlockWiseOccupancy=Tle;exports.Budgets=Rle;exports.Card=Ne;exports.CashBankBalance=Ile;exports.CommercialOccupancy=_ce;exports.Community=hre;exports.Complaints=ece;exports.ComplaintsByLevel=oce;exports.DuesAgeing=Lle;exports.EmployeeFootfall=Sce;exports.Engagement=mre;exports.EngagementStatsGrid=wce;exports.EventsUtilisation=mce;exports.ExpenseCategories=Fle;exports.Facilities=gre;exports.FinanceSummary=vre;exports.FoodBeverages=Ece;exports.GateAndSecurityStatsGrid=Qle;exports.GateUpdates=nie;exports.GuardPatrols=Yle;exports.Header=v3;exports.Helpdesk=rie;exports.HelpdeskStatsGrid=hce;exports.HourlyTrafficFlow=Ule;exports.IncidentReports=Kle;exports.IncomeExpenditure=Hj;exports.MainHeader=M3;exports.MoveInOutTrends=Mle;exports.NoticeBoardStatus=gce;exports.OccupancyOverview=Cle;exports.RequestBox=sce;exports.ResidentOverview=Dle;exports.RevenuebyCategory=Ble;exports.SingleStats=yce;exports.StaffAttendance=qle;exports.StatsGrid=Hle;exports.TicketEscalation=Pce;exports.TicketStatus=kce;exports.UnitStatus=Ple;exports.VisitorUpdates=Dce;
|
|
276
|
+
`):e}function ale(e,t){const{element:n,datasetIndex:r,index:i}=t,o=e.getDatasetMeta(r).controller,{label:a,value:s}=o.getLabelAndValue(i);return{chart:e,label:a,parsed:o.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:s,dataset:o.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function aP(e,t){const n=e.chart.ctx,{body:r,footer:i,title:o}=e,{boxWidth:a,boxHeight:s}=t,l=Yn(t.bodyFont),c=Yn(t.titleFont),u=Yn(t.footerFont),d=o.length,f=i.length,p=r.length,m=Wr(t.padding);let h=m.height,g=0,y=r.reduce((x,_)=>x+_.before.length+_.lines.length+_.after.length,0);if(y+=e.beforeBody.length+e.afterBody.length,d&&(h+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),y){const x=t.displayColors?Math.max(s,l.lineHeight):l.lineHeight;h+=p*x+(y-p)*l.lineHeight+(y-1)*t.bodySpacing}f&&(h+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let S=0;const w=function(x){g=Math.max(g,n.measureText(x).width+S)};return n.save(),n.font=c.string,Xe(e.title,w),n.font=l.string,Xe(e.beforeBody.concat(e.afterBody),w),S=t.displayColors?a+2+t.boxPadding:0,Xe(r,x=>{Xe(x.before,w),Xe(x.lines,w),Xe(x.after,w)}),S=0,n.font=u.string,Xe(e.footer,w),n.restore(),g+=m.width,{width:g,height:h}}function sle(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function lle(e,t,n,r){const{x:i,width:o}=r,a=n.caretSize+n.caretPadding;if(e==="left"&&i+o+a>t.width||e==="right"&&i-o-a<0)return!0}function cle(e,t,n,r){const{x:i,width:o}=n,{width:a,chartArea:{left:s,right:l}}=e;let c="center";return r==="center"?c=i<=(s+l)/2?"left":"right":i<=o/2?c="left":i>=a-o/2&&(c="right"),lle(c,e,t,n)&&(c="center"),c}function sP(e,t,n){const r=n.yAlign||t.yAlign||sle(e,n);return{xAlign:n.xAlign||t.xAlign||cle(e,t,n,r),yAlign:r}}function ule(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function dle(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function lP(e,t,n,r){const{caretSize:i,caretPadding:o,cornerRadius:a}=e,{xAlign:s,yAlign:l}=n,c=i+o,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=xs(a);let m=ule(t,s);const h=dle(t,l,c);return l==="center"?s==="left"?m+=c:s==="right"&&(m-=c):s==="left"?m-=Math.max(u,f)+i:s==="right"&&(m+=Math.max(d,p)+i),{x:bn(m,0,r.width-t.width),y:bn(h,0,r.height-t.height)}}function Sd(e,t,n){const r=Wr(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function cP(e){return qr([],ki(e))}function fle(e,t,n){return qa(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function uP(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Bj={beforeTitle:Pi,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:Pi,beforeBody:Pi,beforeLabel:Pi,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return Ye(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Pi,afterBody:Pi,beforeFooter:Pi,footer:Pi,afterFooter:Pi};function In(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?Bj[t].call(n,r):i}class dP extends Ko{static positioners=Zl;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,o=new Ej(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=fle(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=In(r,"beforeTitle",this,t),o=In(r,"title",this,t),a=In(r,"afterTitle",this,t);let s=[];return s=qr(s,ki(i)),s=qr(s,ki(o)),s=qr(s,ki(a)),s}getBeforeBody(t,n){return cP(In(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Xe(t,o=>{const a={before:[],lines:[],after:[]},s=uP(r,o);qr(a.before,ki(In(s,"beforeLabel",this,o))),qr(a.lines,In(s,"label",this,o)),qr(a.after,ki(In(s,"afterLabel",this,o))),i.push(a)}),i}getAfterBody(t,n){return cP(In(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=In(r,"beforeFooter",this,t),o=In(r,"footer",this,t),a=In(r,"afterFooter",this,t);let s=[];return s=qr(s,ki(i)),s=qr(s,ki(o)),s=qr(s,ki(a)),s}_createItems(t){const n=this._active,r=this.chart.data,i=[],o=[],a=[];let s=[],l,c;for(l=0,c=n.length;l<c;++l)s.push(ale(this.chart,n[l]));return t.filter&&(s=s.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(s=s.sort((u,d)=>t.itemSort(u,d,r))),Xe(s,u=>{const d=uP(t.callbacks,u);i.push(In(d,"labelColor",this,u)),o.push(In(d,"labelPointStyle",this,u)),a.push(In(d,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=s,s}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let o,a=[];if(!i.length)this.opacity!==0&&(o={opacity:0});else{const s=Zl[r.position].call(this,i,this._eventPosition);a=this._createItems(r),this.title=this.getTitle(a,r),this.beforeBody=this.getBeforeBody(a,r),this.body=this.getBody(a,r),this.afterBody=this.getAfterBody(a,r),this.footer=this.getFooter(a,r);const l=this._size=aP(this,r),c=Object.assign({},s,l),u=sP(this.chart,r,c),d=lP(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:s.x,caretY:s.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const o=this.getCaretPosition(t,r,i);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:o}=this,{caretSize:a,cornerRadius:s}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=xs(s),{x:f,y:p}=t,{width:m,height:h}=n;let g,y,S,w,x,_;return o==="center"?(x=p+h/2,i==="left"?(g=f,y=g-a,w=x+a,_=x-a):(g=f+m,y=g+a,w=x-a,_=x+a),S=g):(i==="left"?y=f+Math.max(l,u)+a:i==="right"?y=f+m-Math.max(c,d)-a:y=this.caretX,o==="top"?(w=p,x=w-a,g=y-a,S=y+a):(w=p+h,x=w+a,g=y+a,S=y-a),_=w),{x1:g,x2:y,x3:S,y1:w,y2:x,y3:_}}drawTitle(t,n,r){const i=this.title,o=i.length;let a,s,l;if(o){const c=ws(r.rtl,this.x,this.width);for(t.x=Sd(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",a=Yn(r.titleFont),s=r.titleSpacing,n.fillStyle=r.titleColor,n.font=a.string,l=0;l<o;++l)n.fillText(i[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s,l+1===o&&(t.y+=r.titleMarginBottom-s)}}_drawColorBox(t,n,r,i,o){const a=this.labelColors[r],s=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=o,u=Yn(o.bodyFont),d=Sd(this,"left",o),f=i.x(d),p=l<u.lineHeight?(u.lineHeight-l)/2:0,m=n.y+p;if(o.usePointStyle){const h={radius:Math.min(c,l)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},g=i.leftForLtr(f,c)+c/2,y=m+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,cy(t,h,g,y),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,cy(t,h,g,y)}else{t.lineWidth=Ae(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const h=i.leftForLtr(f,c),g=i.leftForLtr(i.xPlus(f,1),c-2),y=xs(a.borderRadius);Object.values(y).some(S=>S!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ep(t,{x:h,y:m,w:c,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),ep(t,{x:g,y:m+1,w:c-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(h,m,c,l),t.strokeRect(h,m,c,l),t.fillStyle=a.backgroundColor,t.fillRect(g,m+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:o,bodyAlign:a,displayColors:s,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=Yn(r.bodyFont);let f=d.lineHeight,p=0;const m=ws(r.rtl,this.x,this.width),h=function(D){n.fillText(D,m.x(t.x+p),t.y+f/2),t.y+=f+o},g=m.textAlign(a);let y,S,w,x,_,E,C;for(n.textAlign=a,n.textBaseline="middle",n.font=d.string,t.x=Sd(this,g,r),n.fillStyle=r.bodyColor,Xe(this.beforeBody,h),p=s&&g!=="right"?a==="center"?c/2+u:c+2+u:0,x=0,E=i.length;x<E;++x){for(y=i[x],S=this.labelTextColors[x],n.fillStyle=S,Xe(y.before,h),w=y.lines,s&&w.length&&(this._drawColorBox(n,t,x,m,r),f=Math.max(d.lineHeight,l)),_=0,C=w.length;_<C;++_)h(w[_]),f=d.lineHeight;Xe(y.after,h)}p=0,f=d.lineHeight,Xe(this.afterBody,h),t.y-=o}drawFooter(t,n,r){const i=this.footer,o=i.length;let a,s;if(o){const l=ws(r.rtl,this.x,this.width);for(t.x=Sd(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",a=Yn(r.footerFont),n.fillStyle=r.footerColor,n.font=a.string,s=0;s<o;++s)n.fillText(i[s],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:o,yAlign:a}=this,{x:s,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:f,bottomLeft:p,bottomRight:m}=xs(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(s+d,l),a==="top"&&this.drawCaret(t,n,r,i),n.lineTo(s+c-f,l),n.quadraticCurveTo(s+c,l,s+c,l+f),a==="center"&&o==="right"&&this.drawCaret(t,n,r,i),n.lineTo(s+c,l+u-m),n.quadraticCurveTo(s+c,l+u,s+c-m,l+u),a==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(s+p,l+u),n.quadraticCurveTo(s,l+u,s,l+u-p),a==="center"&&o==="left"&&this.drawCaret(t,n,r,i),n.lineTo(s,l+d),n.quadraticCurveTo(s,l,s+d,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,o=r&&r.y;if(i||o){const a=Zl[t.position].call(this,this._active,this._eventPosition);if(!a)return;const s=this._size=aP(this,t),l=Object.assign({},a,this._size),c=sP(n,t,l),u=lP(t,l,c,n);(i._to!==u.x||o._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=s.width,this.height=s.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const a=Wr(n.padding),s=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&s&&(t.save(),t.globalAlpha=r,this.drawBackground(o,t,i,n),wj(t,n.textDirection),o.y+=a.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),_j(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:s,index:l})=>{const c=this.chart.getDatasetMeta(s);if(!c)throw new Error("Cannot find a dataset at index "+s);return{datasetIndex:s,element:c.data[l],index:l}}),o=!Xf(r,i),a=this._positionChanged(i,n);(o||a)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,o=this._active||[],a=this._getActiveElements(t,o,n,r),s=this._positionChanged(a,t),l=n||!Xf(a,o)||s;return l&&(this._active=a,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const o=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(s=>this.chart.data.datasets[s.datasetIndex]&&this.chart.getDatasetMeta(s.datasetIndex).controller.getParsed(s.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,o.mode,o,r);return o.reverse&&a.reverse(),a}_positionChanged(t,n){const{caretX:r,caretY:i,options:o}=this,a=Zl[o.position].call(this,t,n);return a!==!1&&(r!==a.x||i!==a.y)}}var jr={id:"tooltip",_element:dP,positioners:Zl,afterInit(e,t,n){n&&(e.tooltip=new dP({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Bj},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const ple=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function hle(e,t,n,r){const i=e.indexOf(t);if(i===-1)return ple(e,t,n,r);const o=e.lastIndexOf(t);return i!==o?n:i}const mle=(e,t)=>e===null?null:bn(Math.round(e),0,t);function fP(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class lo extends dl{static id="category";static defaults={ticks:{callback:fP}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:o}of n)r[i]===o&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(Ye(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:hle(r,t,Se(n,t),this._addedLabels),mle(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let a=t;a<=n;a++)i.push({value:a});return i}getLabelForValue(t){return fP.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function gle(e,t){const n=[],{bounds:i,step:o,min:a,max:s,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,p=o||1,m=u-1,{min:h,max:g}=t,y=!Ye(a),S=!Ye(s),w=!Ye(c),x=(g-h)/(d+1);let _=p2((g-h)/m/p)*p,E,C,D,A;if(_<1e-14&&!y&&!S)return[{value:h},{value:g}];A=Math.ceil(g/_)-Math.floor(h/_),A>m&&(_=p2(A*_/m/p)*p),Ye(l)||(E=Math.pow(10,l),_=Math.ceil(_*E)/E),i==="ticks"?(C=Math.floor(h/_)*_,D=Math.ceil(g/_)*_):(C=h,D=g),y&&S&&o&&Lie((s-a)/o,_/1e3)?(A=Math.round(Math.min((s-a)/_,u)),_=(s-a)/A,C=a,D=s):w?(C=y?a:C,D=S?s:D,A=c-1,_=(D-C)/A):(A=(D-C)/_,lc(A,Math.round(A),_/1e3)?A=Math.round(A):A=Math.ceil(A));const R=Math.max(h2(_),h2(C));E=Math.pow(10,Ye(l)?R:l),C=Math.round(C*E)/E,D=Math.round(D*E)/E;let T=0;for(y&&(f&&C!==a?(n.push({value:a}),C<a&&T++,lc(Math.round((C+T*_)*E)/E,a,pP(a,x,e))&&T++):C<a&&T++);T<A;++T){const O=Math.round((C+T*_)*E)/E;if(S&&O>s)break;n.push({value:O})}return S&&f&&D!==s?n.length&&lc(n[n.length-1].value,s,pP(s,x,e))?n[n.length-1].value=s:n.push({value:s}):(!S||D===s)&&n.push({value:D}),n}function pP(e,t,{horizontal:n,minRotation:r}){const i=Li(r),o=(n?Math.sin(i):Math.cos(i))||.001,a=.75*t*(""+e).length;return Math.min(t/o,a)}class vle extends dl{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return Ye(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:o}=this;const a=l=>i=n?i:l,s=l=>o=r?o:l;if(t){const l=di(i),c=di(o);l<0&&c<0?s(0):l>0&&c>0&&a(0)}if(i===o){let l=o===0?1:Math.abs(o*.05);s(o+l),t||a(i-l)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,a=gle(i,o);return t.bounds==="ticks"&&Fie(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return fx(t,this.chart.options.locale,this.options.ticks.format)}}class co extends vle{static id="linear";static defaults={ticks:{callback:pj.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Ar(t)?t:0,this.max=Ar(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Li(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const _h={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},zn=Object.keys(_h);function hP(e,t){return e-t}function mP(e,t){if(Ye(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:o}=e._parseOpts;let a=t;return typeof r=="function"&&(a=r(a)),Ar(a)||(a=typeof r=="string"?n.parse(a,r):n.parse(a)),a===null?null:(i&&(a=i==="week"&&(Bc(o)||o===!0)?n.startOf(a,"isoWeek",o):n.startOf(a,i)),+a)}function gP(e,t,n,r){const i=zn.length;for(let o=zn.indexOf(e);o<i-1;++o){const a=_h[zn[o]],s=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(s*a.size))<=r)return zn[o]}return zn[i-1]}function yle(e,t,n,r,i){for(let o=zn.length-1;o>=zn.indexOf(n);o--){const a=zn[o];if(_h[a].common&&e._adapter.diff(i,r,a)>=t-1)return a}return zn[n?zn.indexOf(n):0]}function ble(e){for(let t=zn.indexOf(e)+1,n=zn.length;t<n;++t)if(_h[zn[t]].common)return zn[t]}function vP(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=ux(n,t),o=n[r]>=t?n[r]:n[i];e[o]=!0}}function xle(e,t,n,r){const i=e._adapter,o=+i.startOf(t[0].value,r),a=t[t.length-1].value;let s,l;for(s=o;s<=a;s=+i.add(s,1,r))l=n[s],l>=0&&(t[l].major=!0);return t}function yP(e,t,n){const r=[],i={},o=t.length;let a,s;for(a=0;a<o;++a)s=t[a],i[s]=a,r.push({value:s,major:!1});return o===0||!n?r:xle(e,r,i,n)}class bP extends dl{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),i=this._adapter=new Pae._date(t.adapters.date);i.init(n),sc(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:mP(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:o,minDefined:a,maxDefined:s}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!s&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!a||!s)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=Ar(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),o=Ar(o)&&!isNaN(o)?o:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,o-1),this.max=Math.max(i+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const o=this.min,a=this.max,s=Vie(i,o,a);return this._unit=n.unit||(r.autoSkip?gP(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):yle(this,s.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:ble(this._unit),this.initOffsets(i),t.reverse&&s.reverse(),yP(this,s,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,o;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;n=bn(n,0,a),r=bn(r,0,a),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,o=i.time,a=o.unit||gP(o.minUnit,n,r,this._getLabelCapacity(n)),s=Se(i.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=Bc(l)||l===!0,u={};let d=n,f,p;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":a),t.diff(r,n,a)>1e5*s)throw new Error(n+" and "+r+" are too far apart with stepSize of "+s+" "+a);const m=i.ticks.source==="data"&&this.getDataTimestamps();for(f=d,p=0;f<r;f=+t.add(f,s,a),p++)vP(u,f,m);return(f===r||i.bounds==="ticks"||p===1)&&vP(u,f,m),Object.keys(u).sort(hP).map(h=>+h)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,o=this._unit,a=n||i[o];return this._adapter.format(t,a)}_tickFormatFunction(t,n,r,i){const o=this.options,a=o.ticks.callback;if(a)return ct(a,[t,n,r],this);const s=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&s[l],d=c&&s[c],f=r[n],p=c&&d&&f&&f.major;return this._adapter.format(t,i||(p?d:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=Li(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(i),a=Math.sin(i),s=this._resolveTickFontOptions(0).size;return{w:r*o+s*a,h:r*a+s*o}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,o=this._tickFormatFunction(t,0,yP(this,[t],this._majorUnit),i),a=this._getLabelSize(o),s=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return s>0?s:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(mP(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return cj(t.sort(hP))}}function Ed(e,t,n){let r=0,i=e.length-1,o,a,s,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=wa(e,"pos",t)),{pos:o,time:s}=e[r],{pos:a,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=wa(e,"time",t)),{time:o,pos:s}=e[r],{time:a,pos:l}=e[i]);const c=a-o;return c?s+(l-s)*(t-o)/c:s}class Qce extends bP{static id="timeseries";static defaults=bP.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Ed(n,this.min),this._tableRange=Ed(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],o=[];let a,s,l,c,u;for(a=0,s=t.length;a<s;++a)c=t[a],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(a=0,s=i.length;a<s;++a)u=i[a+1],l=i[a-1],c=i[a],Math.round((u+l)/2)!==c&&o.push({time:c,pos:a/(s-1)});return o}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,o)=>i-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Ed(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Ed(this._table,r*this._tableRange+this._minPos,!0)}}const Wj="label";function xP(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function wle(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function zj(e,t){e.labels=t}function Vj(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Wj;const r=[];e.datasets=t.map(i=>{const o=e.datasets.find(a=>a[n]===i[n]);return!o||!i.data||r.includes(o)?{...i}:(r.push(o),Object.assign(o,i),o)})}function _le(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Wj;const n={labels:[],datasets:[]};return zj(n,e.labels),Vj(n,e.datasets,t),n}function Sle(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:o,type:a,data:s,options:l,plugins:c=[],fallbackContent:u,updateMode:d,...f}=e,p=k.useRef(null),m=k.useRef(null),h=()=>{p.current&&(m.current=new Mn(p.current,{type:a,data:_le(s,o),options:l&&{...l},plugins:c}),xP(t,m.current))},g=()=>{xP(t,null),m.current&&(m.current.destroy(),m.current=null)};return k.useEffect(()=>{!i&&m.current&&l&&wle(m.current,l)},[i,l]),k.useEffect(()=>{!i&&m.current&&zj(m.current.config.data,s.labels)},[i,s.labels]),k.useEffect(()=>{!i&&m.current&&s.datasets&&Vj(m.current.config.data,s.datasets,o)},[i,s.datasets]),k.useEffect(()=>{m.current&&(i?(g(),setTimeout(h)):m.current.update(d))},[i,l,s.labels,s.datasets,d]),k.useEffect(()=>{m.current&&(g(),setTimeout(h))},[a]),k.useEffect(()=>(h(),()=>g()),[]),k.createElement("canvas",{ref:p,role:"img",height:n,width:r,...f},u)}const Ele=k.forwardRef(Sle);function Ox(e,t){return Mn.register(t),k.forwardRef((n,r)=>k.createElement(Ele,{...n,ref:r,type:e}))}const Px=Ox("line",Oae),pl=Ox("bar",_ae),Cx=Ox("doughnut",Eae);Mn.register(_x,jr,Vr);const Ole={id:"centerText",afterDraw(e,t,n){const{ctx:r}=e,i=e.getDatasetMeta(0);if(!i?.data?.[0])return;const{x:o,y:a}=i.data[0],{top:s="",bottom:l="",topSize:c=20,bottomSize:u=10,topColor:d="#0F172A",bottomColor:f="#64748B"}=n||{};r.save(),r.textAlign="center",r.textBaseline="middle",r.fillStyle=d,r.font=`600 ${c}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(s,o,a-5),r.fillStyle=f,r.font=`500 ${u}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(l,o,a+12),r.restore()}},Ple=({sold:e=847,unsold:t=73,growthPct:n="+9.1%"})=>{const r=e+t,i={labels:["Sold","Unsold"],datasets:[{data:[e,t],backgroundColor:["#12B981","#EF4444"],borderWidth:2,hoverOffset:4}]},o={responsive:!0,maintainAspectRatio:!1,cutout:"68%",plugins:{legend:{display:!1},tooltip:{callbacks:{label:a=>`${a.label}: ${a.parsed}`},displayColors:!1},centerText:{top:`${r}`,bottom:"Total Units",topSize:20,bottomSize:10}}};return b.jsx(Ne,{title:"Unit Status",period:"This Month",icon:b.jsx(zy,{className:"h-6 w-6 text-green-600"}),className:"h-[238px]",children:b.jsxs("div",{className:"grid grid-cols-12 gap-[16px] items-center",children:[b.jsxs("div",{className:"col-span-5 space-y-3",children:[b.jsxs("div",{children:[b.jsx("div",{className:"!text-[12px] lending-[16px] text-[#64748B]",children:"Sold"}),b.jsx("div",{className:"text-[28px] leading-[32px] text-[#1FA05B]",children:e})]}),b.jsxs("div",{children:[b.jsx("div",{className:"!text-[12px] lending-[16px] text-[#64748B]",children:"Unsold"}),b.jsx("div",{className:"text-[28px] leading-[32px] text-[#EF4444]",children:t})]}),b.jsxs("div",{className:"text-[10px] text-[#1FA05B] flex gap-[8px] items-center ",children:[n," ",b.jsx("div",{className:"text-[#64748B] text-[10px]",children:"Compared to last month"})]})]}),b.jsx("div",{className:"col-span-7",children:b.jsx("div",{className:"h-[158px] w-[158px] ml-auto mr-2",children:b.jsx(Cx,{data:i,options:o,plugins:[Ole]})})})]})})},wP=({value:e=0,total:t=1,colorClass:n="",label:r=""})=>{const i=Math.max(0,Math.min(100,e/(t||1)*100)),o=n==="bg-[#8B5CF6]"?"text-[#8B5CF6]":n==="bg-[#12B981]"?"text-[#12B981]":"text-slate-600";return b.jsxs("div",{className:"flex flex-col items-start",children:[b.jsx("div",{className:"w-2/3 min-w-[80px] h-3 rounded-full overflow-hidden",children:b.jsx("div",{className:`h-3 rounded-full ${n}`,style:{width:`${i}%`}})}),b.jsx("div",{className:`${o} !text-[12px] font-bold mt-1`,children:e}),b.jsx("div",{className:"!text-[12px] text-[#64748B] mt-1",children:r})]})},_P=({title:e,value:t,suffix:n,valueClass:r=""})=>b.jsxs("div",{className:"bg-white border border-[#EBEBEB] rounded-xl shadow-[0_0_12px_0_#EAF2FF] h-[98px] p-4 flex flex-col justify-center",children:[b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#121212] mb-1",children:e}),b.jsxs("div",{className:`text-[28px] leading-[32px] flex item gap-[4px] font-medium ${r}`,children:[t," ",n&&b.jsx("div",{className:"text-[28px] leading-[32px] font-medium",children:n})]})]}),Cle=({totalUnits:e=847,occupiedUnits:t=756,ownerCount:n=700,tenantCount:r=56,avgResidents:i=4.4,avgLeaseMonths:o=18})=>{const a=n+r;return b.jsxs("div",{children:[b.jsxs("div",{className:"bg-white border border-[#EBEBEB] rounded-xl shadow-[0_0_12px_0_#EAF2FF] p-4 h-[128px]",children:[b.jsxs("div",{className:"flex items-center gap-[12px] mb-4",children:[b.jsx(Hy,{className:"h-6 w-6 text-[#329DFF]"}),b.jsx("div",{className:"font-medium text-[#121212]",children:"Occupancy Overview"})]}),b.jsxs("div",{className:"flex items-center justify-between gap-",children:[b.jsxs("div",{children:[b.jsx("div",{className:"text-xs leading-[16px] text-[#64748B]",children:"Occupied Units"}),b.jsxs("div",{className:"flex items-center gap-1",children:[b.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),b.jsxs("div",{className:"text-[#64748B] text-[20px] leading-[32px]",children:["/",e]})]})]}),b.jsxs("div",{className:"flex items-end",children:[b.jsx(wP,{value:n,total:a,colorClass:"bg-[#8B5CF6]",label:"Owner"}),b.jsx(wP,{value:r,total:a,colorClass:"bg-[#12B981]",label:"Tenant"})]})]})]}),b.jsxs("div",{className:"mt-2.5 grid grid-cols-2 gap-[12px]",children:[b.jsx(_P,{title:"Avg Residents Per Unit",value:i,valueClass:"text-[#8B5CF6]"}),b.jsx(_P,{title:"Avg Lease Period",value:o,suffix:"months",valueClass:"text-[#E7A015]"})]})]})};Mn.register(_x,jr,Vr);const kle={id:"centerText",afterDraw(e,t,n){const{ctx:r}=e,i=e.getDatasetMeta(0);if(!i?.data?.[0])return;const{x:o,y:a}=i.data[0],{top:s="",bottom:l="",topSize:c=20,bottomSize:u=10,topColor:d="#0F172A",bottomColor:f="#64748B"}=n||{};r.save(),r.textAlign="center",r.textBaseline="middle",r.fillStyle=d,r.font=`600 ${c}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(s,o,a-5),r.fillStyle=f,r.font=`500 ${u}px Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif`,r.fillText(l,o,a+12),r.restore()}},Dle=({ownerCount:e=1e3,tenantCount:t=200,nonResidingOwners:n=26,growthPct:r="+9.1%"})=>{const i=Math.max(e-n,0),o=e+t,a={labels:["Owners","Tenants","Non-residing Owner"],datasets:[{data:[i,t,n],backgroundColor:["#3C81F6","#08B6D4","#8B5CF6"],borderWidth:2,hoverOffset:4}]},s={responsive:!0,maintainAspectRatio:!1,cutout:"68%",plugins:{legend:{display:!1},tooltip:{callbacks:{label:l=>`${l.label}: ${l.parsed}`},displayColors:!1},centerText:{top:`${o}`,bottom:"Total Members",topSize:20,bottomSize:10}}};return b.jsx(Ne,{title:"Resident Overview",icon:b.jsx(ok,{className:"h-6 w-6 text-[#8B5CF6]"}),className:"h-[238px]",children:b.jsxs("div",{className:" flex-1 min-h-0 grid grid-cols-12 gap-[16px] items-center",children:[b.jsxs("div",{className:"col-span-5",children:[b.jsxs("div",{children:[b.jsx("div",{className:"!text-[12px] text-[#64748B] leading-[16px]",children:"Total Owners"}),b.jsx("div",{className:"text-[28px] leading-[32px ] text-[#3C81F6]",children:e})]}),b.jsxs("div",{children:[b.jsx("div",{className:"!text-[12px] text-[#64748B] leading-[16px]",children:"Total Tenants"}),b.jsx("div",{className:"text-[28px] leading-[32px ] text-[#08B6D4]",children:t})]}),b.jsxs("div",{className:"text-[10px] text-[#1FA05B] flex gap-2 items-center",children:[r," ",b.jsx("div",{className:"text-[#64748B] ",children:"Compared to last month"})]})]}),b.jsx("div",{className:"col-span-7",children:b.jsx("div",{className:"h-[162px] w-[162px] ml-auto mr-2",children:b.jsx(Cx,{data:a,options:s,plugins:[kle]})})})]})})};Mn.register(lo,co,fl,jr,Vr);const Tle=({blocks:e=[{name:"Block A",owner:110,rented:24,vacant:8},{name:"Block B",owner:95,rented:18,vacant:6},{name:"Block C",owner:65,rented:12,vacant:18},{name:"Block D",owner:78,rented:16,vacant:30}]})=>{const t=e.map(s=>s.name),n=e.map(s=>s.owner),r=e.map(s=>s.rented),i=e.map(s=>s.vacant),o={labels:t,datasets:[{label:"Owner",data:n,backgroundColor:"#3C81F6",barThickness:40},{label:"",data:n.map(()=>2),backgroundColor:"transparent",barThickness:40},{label:"Rented",data:r,backgroundColor:"#8B5CF6",barThickness:40},{label:"",data:r.map(()=>2),backgroundColor:"transparent",barThickness:40},{label:"Vacant",data:i,backgroundColor:"#08B6D4",barThickness:40}]},a={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,pointStyle:"rectRot",padding:20}},tooltip:{callbacks:{label:s=>`${s.dataset.label}: ${s.parsed.y}`}}},scales:{x:{stacked:!0,grid:{display:!1},ticks:{color:"#64748B"}},y:{stacked:!0,beginAtZero:!0,suggestedMax:180,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:20}}}};return b.jsx(Ne,{title:"Block-wise Occupancy",period:b.jsx(An,{className:"text-xl text-[#884EA7]"}),className:"w-full h-[360px]",titleWeight:"semi-bold",children:b.jsx(pl,{data:o,options:a})})};Mn.register(lo,co,Ex,Sx,jr,Vr);const Ale=e=>{const[t,n]=String(e).split(" ");return`${{Jan:"January",Feb:"February",Mar:"March",Apr:"April",May:"May",Jun:"June",Jul:"July",Aug:"August",Sep:"September",Oct:"October",Nov:"November",Dec:"December"}[t]||t} 20${n}`},Mle=({labels:e=["Jan 25","Feb 25","Mar 25","Apr 25","May 25"],moveIn:t=[24,27,20,26,23],moveOut:n=[12,17,8,5,16]})=>{const r={labels:e,datasets:[{label:"Move-in",data:t,borderColor:"#12B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#12B981",pointStyle:"rectRot",fill:!1},{label:"Move-out",data:n,borderColor:"#8B5CF6",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#8B5CF6",pointStyle:"rectRot",fill:!1}]},i={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:o=>Ale(o[0].label),label:o=>`${o.dataset.label}: ${o.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return b.jsx(Ne,{title:"Move-in/Out Trends",className:"w-full h-[360px]",period:b.jsx(An,{className:"text-[20px] text-[#884EA7]"}),titleWeight:"semi-bold",children:b.jsx(Px,{data:r,options:i})})};Mn.register(lo,co,Ex,Sx,jr,Vr);const Nle=e=>{const[t,n]=String(e).split(" ");return`${{Jan:"January",Feb:"February",Mar:"March",Apr:"April",May:"May",Jun:"June",Jul:"July",Aug:"August",Sep:"September",Oct:"October",Nov:"November",Dec:"December"}[t]||t} 20${n}`},Hj=({labels:e=["Jan 25","Feb 25","Mar 25","Apr 25","May 25"],moveIn:t=[24,27,20,26,23],moveOut:n=[4,17,8,5,16,4,7]})=>{const r={labels:e,datasets:[{label:"Income",data:t,borderColor:"#10B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#10B981",pointStyle:"rectRot",fill:!1},{label:"Expenditure",data:n,borderColor:"#AB0000",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#AB0000",pointStyle:"rectRot",fill:!1}]},i={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:o=>Nle(o[0].label),label:o=>`${o.dataset.label}: ${o.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return b.jsx(Px,{data:r,options:i})};function SP({label:e,value:t,positive:n,bgColor:r,delta:i,deltaLabel:o,textColor:a}){return b.jsxs("div",{className:`rounded-lg p-4 ${r} border border-[#EBEBEB] h-[126px]`,children:[b.jsx("div",{className:`text-[16px] leading-[20px] ${a}`,children:e}),b.jsx("div",{className:"mt-[16px] leading-[28px] !text-[24px] font-medium text-[#121212]",children:t}),b.jsxs("div",{className:"mt-[8px] flex items-center gap-[8px] leading-[14px] text-[10px]",children:[b.jsx("div",{className:n?"text-[#1FA05B] font-medium":"text-[#EF4444] font-medium",children:i}),b.jsx("div",{className:"text-[#64748B] ",children:o})]})]})}function jle(){return b.jsxs(Ne,{title:"Accounting",className:"w-full h-[523px]",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[b.jsxs("div",{className:"grid grid-cols-2 gap-[16px]",children:[b.jsx(SP,{label:"Total Income",value:"AED 5.68M",delta:"+4.4%",positive:!0,bgColor:"bg-slate-50",deltaLabel:"Compared to last month",textColor:"text-[#1FA05B]"}),b.jsx(SP,{label:"Total Expenditure",value:"AED 1.83M",delta:"-1.1%",positive:!1,bgColor:"bg-slate-50",deltaLabel:"Compared to last month",textColor:"text-[#AB0000]"})]}),b.jsx("div",{className:"h-[254px] mt-[35.5px]",children:b.jsx(Hj,{})})]})}Mn.register(lo,co,fl,jr,Vr);const Rle=()=>{const e=["Maintenance","Security","Utilities","Housekeeping","Administration","Others"],r={labels:e,datasets:[{label:"Budget",data:[55e3,56e3,64e3,38e3,54e3,65e3],backgroundColor:"#93C5FD",barThickness:60},{label:"Actual",data:[63e3,48e3,51300,28e3,42e3,35e3],backgroundColor:"#3B82F6",barThickness:60}]},i={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,pointStyle:"rectRot",padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:6,callbacks:{title:o=>e[o[0].dataIndex],label:o=>{const a=o.parsed.y;return`${o.dataset.label}: AED ${(a/1e3).toFixed(1)}K`}}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B"}},y:{beginAtZero:!0,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",callback:o=>`${o/1e3}K`}}}};return b.jsx(Ne,{title:"Budget vs Actuals",className:"w-full h-[362px]",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:b.jsx(pl,{data:r,options:i})})},Ile=()=>{const e=[{title:"Primary Account",amount:285e4,subtitle:"Savings"},{title:"Emergency Fund",amount:12e5,subtitle:"Fixed deposit"},{title:"Maintenance Fund",amount:68e4,subtitle:"Current"}],t=e.reduce((r,i)=>r+i.amount,0),n=r=>r>=1e6?`AED ${(r/1e6).toFixed(2)}M`:r>=1e3?`AED ${(r/1e3).toFixed(1)}K`:`AED ${r}`;return b.jsxs(Ne,{title:"Cash & Bank Balance",className:"w-full h-[362px]",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),children:[b.jsx("div",{className:"flex flex-col gap-[12px]",children:e.map((r,i)=>b.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-lg p-3",children:[b.jsxs("div",{className:"flex flex-col",children:[b.jsx("div",{className:"text-[14px] font-medium text-[#121212]",children:r.title}),b.jsx("div",{className:"!text-[12px] text-[#64748B]",children:r?.subtitle})]}),b.jsx("div",{className:"flex flex-col items-end",children:b.jsx("div",{className:"text-[14px] text-[#1FA05B] font-semibold",children:n(r.amount)})})]},i))}),b.jsxs("div",{className:"flex items-center justify-between border-t border-[#EBEBEB] h-[68px] px-3",children:[b.jsx("div",{className:"text-[14px] font-medium text-[#121212]",children:"Total"}),b.jsx("div",{className:"text-[16px] text-[#1FA05B] font-bold",children:n(t)})]})]})};Mn.register(lo,co,fl,jr,Vr);const Lle=()=>{const e=["Current Month","1-3 Months","3-6 Months","6+ Months"],t=[13e3,9400,8800,7200],n=[18,12,18,6],r={labels:e,datasets:[{label:"Due",data:t,backgroundColor:"#EF4444",barThickness:60}]},i={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:6,callbacks:{title:o=>e[o[0].dataIndex],label:o=>`Due: AED ${(o.parsed.y/1e3).toFixed(1)}K`,afterLabel:o=>`Units Count: ${n[o.dataIndex]}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B"}},y:{beginAtZero:!0,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",callback:o=>`${o/1e3}K`}}}};return b.jsxs(Ne,{title:"Dues Ageing",className:"w-full h-[362px]",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[b.jsx("div",{className:"grid grid-cols-4 md:grid-cols-4 gap-[12px] h-[48px]",children:e.map((o,a)=>b.jsx("div",{className:"p-2 rounded-lg bg-slate-50",children:b.jsxs("div",{className:"flex justify-between items-start",children:[b.jsx("div",{className:"font-medium leading-[16px] !text-[12px] rounded",children:o}),b.jsxs("div",{className:"text-right",children:[b.jsxs("div",{className:"text-red-600 font-medium leading-[16px] !text-[12px]",children:["AED ",(t[a]/1e3).toFixed(1),"K"]}),b.jsxs("div",{className:" text-gray-500 leading-[14px] text-[10px]",children:[n[a]," Units"]})]})]})},o))}),b.jsx("div",{className:"h-[192px]",children:b.jsx(pl,{data:r,options:i})})]})};Mn.register(_x,jr,Vr);const Fle=()=>{const e=["Maintenance","Utilities","Security","Administration","Others"],t=[45e4,32e4,28e4,18e4,12e4],n={labels:e,datasets:[{label:"Expenses",data:t,backgroundColor:["#08B6D4","#8B5CF6","#EF4444","#F69E0A","#12B981"],borderColor:"#FFFFFF",borderWidth:2,cutout:"70%"}]},r=t.reduce((o,a)=>o+a,0),i={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:10,callbacks:{label:o=>`${o.label}: AED ${o.formattedValue}`}}}};return b.jsxs(Ne,{title:"Expense Categories",className:"w-full h-[523px]",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:[b.jsxs("div",{className:"relative h-[259px] flex justify-center items-center",children:[b.jsx(Cx,{data:n,options:i}),b.jsxs("div",{className:"absolute text-center",children:[b.jsxs("div",{className:"!text-[24px] font-medium leading-[28px] text-[#121212]",children:["AED ",(r/1e6).toFixed(2),"M"]}),b.jsx("div",{className:"text-[#121212] leading-[18px] text-[14px]",children:"Total Expenses"})]})]}),b.jsx("div",{className:"space-y-2",children:e.map((o,a)=>b.jsxs("div",{className:"flex justify-between items-center text-[14px] pb-2",children:[b.jsxs("div",{className:"flex items-center gap-[8px] !text-[12px] leading-[16px] text-[#64748B]",children:[b.jsx("div",{className:"w-[7px] h-[7px] rotate-45",style:{backgroundColor:n.datasets[0].backgroundColor[a]}}),o]}),b.jsxs("div",{className:"leading-[16px] !text-[12px] text-[#64748B]",children:["AED ",(t[a]/1e3).toFixed(0),"K"]})]},o))})]})},Bl=[{name:"Gym Equipment",value:1e6,color:"#08B6D4"},{name:"Security",value:8e5,color:"#EF4444"},{name:"Others",value:6e5,color:"#F59E0B"},{name:"Pool Maintenance",value:7e5,color:"#8B5CF6"},{name:"Administration",value:52e4,color:"#10B981"}];function $le(){const e=Bl.reduce((t,n)=>t+n.value,0);return b.jsx(Ne,{title:"Asset Value Breakdown",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",titleWeight:"semi-bold",children:b.jsxs("div",{className:"flex flex-col items-center justify-center",children:[b.jsxs("div",{className:"w-[214px] h-[181px] relative",children:[b.jsx(xi,{width:"100%",height:"100%",children:b.jsxs(bu,{children:[b.jsx(il,{data:Bl,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:Bl.map((t,n)=>b.jsx(Br,{fill:t.color},`cell-${n}`))}),b.jsx(bi,{formatter:t=>`AED ${t.toLocaleString()}`})]})}),b.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[b.jsxs("div",{className:"font-medium text-lg leading-[12px] ",children:["AED ",(e/1e6).toFixed(2),"M"]}),b.jsx("div",{className:"text-[10px] leading-[12.59px] text-[#121212] mt-[6px]",children:"Total Assets"})]})]}),b.jsxs("div",{className:"flex justify-between w-full px-4 sm:px-8 mt-4 text-[14px]",children:[b.jsx("div",{className:"flex flex-col gap-[8px]",children:Bl.slice(0,3).map(t=>b.jsxs("div",{className:"flex items-center gap-[8px]",children:[b.jsx("div",{className:"inline-block h-[7px] w-[7px] rotate-45",style:{backgroundColor:t.color}}),b.jsx("div",{className:"text-[#64748B] leading-[16px] !text-[12px]",children:t.name})]},t.name))}),b.jsx("div",{className:"flex flex-col gap-[8px] items-start",children:Bl.slice(3).map(t=>b.jsxs("div",{className:"flex items-center gap-[8px]",children:[b.jsx("div",{className:"inline-block h-[7px] w-[7px] rotate-45",style:{backgroundColor:t.color}}),b.jsx("div",{className:"text-[#64748B] leading-[16px] !text-[12px]",children:t.name})]},t.name))})]})]})})}Mn.register(lo,co,fl,jr,Vr);const Ble=()=>{const e=["Gym","Parking","Swimming Pool","Community Hall","Tennis Court"],t=[13e3,9400,8800,7200,6e3],n=[18,12,18,6],r={labels:e,datasets:[{label:"Due",data:t,backgroundColor:"#8B5CF6",barThickness:60}]},i={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:6,callbacks:{title:o=>e[o[0].dataIndex],label:o=>`Due: AED ${(o.parsed.y/1e3).toFixed(1)}K`,afterLabel:o=>`Units Count: ${n[o.dataIndex]}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B"}},y:{beginAtZero:!0,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",callback:o=>`${o/1e3}K`}}}};return b.jsx(Ne,{title:"Revenue by Category",className:"w-full h-[362px]",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),titleWeight:"semi-bold",children:b.jsx(pl,{data:r,options:i})})};function Wle(e){return Fe({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15 5l0 2"},child:[]},{tag:"path",attr:{d:"M15 11l0 2"},child:[]},{tag:"path",attr:{d:"M15 17l0 2"},child:[]},{tag:"path",attr:{d:"M5 5h14a2 2 0 0 1 2 2v3a2 2 0 0 0 0 4v3a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-3a2 2 0 0 0 0 -4v-3a2 2 0 0 1 2 -2"},child:[]}]})(e)}function zle(e){return Fe({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M855.7 210.8l-42.4-42.4a8.03 8.03 0 0 0-11.3 0L168.3 801.9a8.03 8.03 0 0 0 0 11.3l42.4 42.4c3.1 3.1 8.2 3.1 11.3 0L855.6 222c3.2-3 3.2-8.1.1-11.2zM304 448c79.4 0 144-64.6 144-144s-64.6-144-144-144-144 64.6-144 144 64.6 144 144 144zm0-216c39.7 0 72 32.3 72 72s-32.3 72-72 72-72-32.3-72-72 32.3-72 72-72zm416 344c-79.4 0-144 64.6-144 144s64.6 144 144 144 144-64.6 144-144-64.6-144-144-144zm0 216c-39.7 0-72-32.3-72-72s32.3-72 72-72 72 32.3 72 72-32.3 72-72 72z"},child:[]}]})(e)}function Vle({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=Kc,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return b.jsxs(Ne,{title:e,icon:b.jsx("div",{className:"h-6 w-6 grid place-items-center",children:b.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[b.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),b.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[b.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),b.jsx("div",{className:"text-slate-500",children:r})]})]})}function Hle(){const e=[{title:"Total Bookings",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:ik,iconColor:"text-emerald-600"},{title:"Utilisation Rate",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:zle,iconColor:"text-[#329DFF]"},{title:"Revenue",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Wle,iconColor:"text-[#FA7E28]"},{title:"Pending Dues",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:ak,iconColor:"text-[#DBB467]"}];return b.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:e.map((t,n)=>b.jsx(Vle,{...t},n))})}const Od=[{name:"Completed",value:46,color:"#12B981"},{name:"Delayed",value:2,color:"#EF4444"},{name:"Missed",value:2,color:"#F69E0A"}];function Yle(){const t=Od.find(n=>n.name==="Completed")?.value||0;return b.jsx(Ne,{title:"Guard Patrols",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",children:b.jsxs("div",{className:"flex flex-col items-center justify-center",children:[b.jsxs("div",{className:"w-[215px] h-[182px] relative",children:[b.jsx(xi,{width:"100%",height:"100%",children:b.jsxs(bu,{children:[b.jsx(il,{data:Od,innerRadius:60,outerRadius:90,paddingAngle:2,dataKey:"value",nameKey:"name",children:Od.map((n,r)=>b.jsx(Br,{fill:n.color},`cell-${r}`))}),b.jsx(bi,{formatter:n=>n.toLocaleString()})]})}),b.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[b.jsxs("div",{className:"font-medium text-[19.35px] leading-[23.65px] ",children:[t,"/",50]}),b.jsx("div",{className:"text-[10.75px] leading-[15.05px] text-[#64748B]",children:"Completed"})]})]}),b.jsx("div",{className:"flex flex-col gap-[8px] mt-3 w-full px-6 text-[14px]",children:Od.map(n=>b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("div",{className:"flex items-center gap-[8px]",children:[b.jsx("div",{className:"inline-block w-[7px] h-[7px] rotate-45",style:{backgroundColor:n.color}}),b.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:n.name})]}),b.jsx("div",{className:"leading-[16.09px] text-[12.07px] text-[#64748B]",children:n.value})]},n.name))})]})})}Mn.register(lo,co,Ex,Sx,jr,Vr);const Ule=()=>{const t={labels:["10 AM","12 PM","2 PM","4 PM","6 PM","8 PM","10 PM"],datasets:[{label:"Guest",data:[9,5,12,7,3,6,4],borderColor:"#EF4444",backgroundColor:"rgba(239,68,68,0.15)",pointBackgroundColor:"#EF4444",pointStyle:"rectRot",fill:!1},{label:"Cab",data:[15,12,10,14,7,12,8],borderColor:"#7C3AED",backgroundColor:"rgba(124,58,237,0.15)",pointBackgroundColor:"#7C3AED",pointStyle:"rectRot",fill:!1},{label:"Delivery",data:[22,18,16,20,22,14,17],borderColor:"#10B981",backgroundColor:"rgba(16,185,129,0.15)",pointBackgroundColor:"#10B981",pointStyle:"rectRot",fill:!1},{label:"Service",data:[13,12,8,9,5,10,7],borderColor:"#F59E0B",backgroundColor:"rgba(245,158,11,0.15)",pointBackgroundColor:"#F59E0B",pointStyle:"rectRot",fill:!1}]},n={responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,boxWidth:10,boxHeight:10,padding:20}},tooltip:{backgroundColor:"#0F172A",titleColor:"#FFFFFF",bodyColor:"#FFFFFF",displayColors:!1,padding:12,caretSize:0,callbacks:{title:r=>r[0].label,label:r=>`${r.dataset.label} ${r.parsed.y}`}}},scales:{x:{grid:{color:"#F1F5F9"},ticks:{color:"#64748B"}},y:{beginAtZero:!0,suggestedMax:28,grid:{color:"#F1F5F9"},ticks:{color:"#64748B",stepSize:4,precision:0}}},elements:{line:{borderWidth:2,tension:0},point:{radius:0,hoverRadius:3,hitRadius:10}}};return b.jsx(Ne,{title:"Hourly Traffic Flow",className:"w-full h-[362px]",period:b.jsx(An,{className:"text-[20px] text-[#884EA7]"}),children:b.jsx(Px,{data:t,options:n})})};function Kle(){return b.jsx(Ne,{title:"Incident Reports",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",children:b.jsxs("div",{children:[b.jsxs("div",{className:"flex w-full text-center gap-[24px]",children:[b.jsxs("div",{className:"flex-1 py-3 bg-[#FBF4F4] h-[76px] rounded",children:[b.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#AB0000]",children:"3"}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#AB0000]",children:"Open"})]}),b.jsxs("div",{className:"flex-1 py-3 bg-[#FFFBF2] h-[76px] rounded",children:[b.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#E7A015]",children:"5"}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#E7A015]",children:"In-progress"})]}),b.jsxs("div",{className:"flex-1 py-3 bg-[#F7FEFA] h-[76px] rounded",children:[b.jsx("div",{className:"!text-[24px] leading-[28px] font-medium text-[#1FA05B]",children:"12"}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#1FA05B]",children:"Closed"})]})]}),b.jsxs("div",{className:"mt-4 ",children:[b.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#FAFBFD] rounded-md border border-[#FAFBFD]",children:[b.jsxs("div",{className:"flex items-center gap-[8px]",children:[b.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center bg-[#AB0000]",children:b.jsx("div",{className:"text-white !text-[12px] font-bold",children:"!"})}),b.jsx("div",{className:"text-gray-700 font-medium",children:"INC 001"})]}),b.jsxs("div",{className:"px-3 py-1 rounded-full !text-[12px] font-semibold flex items-center gap-[4px] text-[#AB0000] bg-red-50",children:[b.jsx("div",{children:"4 - Danger"}),b.jsx("div",{className:"w-2 h-2 rounded-full bg-[#AB0000]"})]})]}),b.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#FAFBFD] rounded-md border border-[#FAFBFD]",children:[b.jsxs("div",{className:"flex items-center gap-[8px]",children:[b.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center bg-[#E7A015]",children:b.jsx(vw,{className:"text-white text-[10px]"})}),b.jsx("div",{className:"text-gray-700 font-medium",children:"INC 002"})]}),b.jsxs("div",{className:"px-3 py-1 rounded-full !text-[12px] font-semibold flex items-center gap-[4px] text-[#E7A015] bg-yellow-50",children:[b.jsx("div",{children:"3 - High"}),b.jsx("div",{className:"w-2 h-2 rounded-full bg-[#E7A015]"})]})]}),b.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#FAFBFD] rounded-md border border-[#FAFBFD]",children:[b.jsxs("div",{className:"flex items-center gap-[8px]",children:[b.jsx("div",{className:"w-4 h-4 rounded-full flex items-center justify-center bg-[#1FA05B]",children:b.jsx(vw,{className:"text-white text-[10px]"})}),b.jsx("div",{className:"text-gray-700 font-medium",children:"INC 003"})]}),b.jsxs("div",{className:"px-3 py-1 rounded-full !text-[12px] font-semibold flex items-center gap-[4px] text-[#1FA05B] bg-green-50",children:[b.jsx("div",{children:"1 - Low"}),b.jsx("div",{className:"w-2 h-2 rounded-full bg-[#1FA05B]"})]})]})]})]})})}function qle(){return b.jsx(Ne,{title:"Staff Attendance",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"h-[362px]",children:b.jsxs("div",{children:[b.jsxs("div",{className:"flex w-full text-center h-[76px] gap-[16px] mb-2",children:[b.jsxs("div",{className:"flex-1 py-4 bg-green-50 rounded-md",children:[b.jsx("div",{className:"!text-[24px] leading-[18px] font-medium text-[#1FA05B] pb-[8px]",children:"25"}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#1FA05B]",children:"Present"})]}),b.jsxs("div",{className:"flex-1 py-4 bg-red-50 rounded-md",children:[b.jsx("div",{className:"!text-[24px] leading-[18px] font-medium text-[#AB0000] pb-[8px]",children:"1"}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#AB0000]",children:"Absent"})]})]}),b.jsxs("div",{className:"mt-[24px] ",children:[b.jsxs("div",{className:"flex justify-between items-center p-3 bg-[#FAFBFD] rounded-md",children:[b.jsx("div",{className:" font-medium !text-[12px] leading-[18px]",children:"Security guards"}),b.jsx("div",{className:"text-[#64748B] leading[20px] text-[14px]",children:"12/12 Present"})]}),b.jsxs("div",{className:"flex justify-between items-center p-3 bg-[#FAFBFD] rounded-md",children:[b.jsx("div",{className:" font-medium !text-[12px] leading-[18px]",children:"Housekeeping"}),b.jsx("div",{className:"text-[#64748B] leading[20px] text-[14px]",children:"7/8 Present"})]}),b.jsxs("div",{className:"flex justify-between items-center p-3 bg-[#FAFBFD] rounded-md",children:[b.jsx("div",{className:" font-medium !text-[12px] leading-[18px]",children:"Maintenance"}),b.jsx("div",{className:"text-[#64748B] leading[20px] text-[14px]",children:"4/4 Present"})]}),b.jsxs("div",{className:"flex justify-between items-center p-3 bg-[#FAFBFD] rounded-md",children:[b.jsx("div",{className:" font-medium !text-[12px] leading-[18px]",children:"Gardening"}),b.jsx("div",{className:"text-[#64748B] leading[20px] text-[14px]",children:"2/2 Present"})]})]})]})})}function Gle(e){return Fe({attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M116,132V96a12,12,0,0,1,24,0v36a12,12,0,0,1-24,0Zm12,56a16,16,0,1,0-16-16A16,16,0,0,0,128,188ZM228,56v56c0,54.29-26.32,87.22-48.4,105.29-23.71,19.39-47.44,26-48.44,26.29a12.1,12.1,0,0,1-6.32,0c-1-.28-24.73-6.9-48.44-26.29C54.32,199.22,28,166.29,28,112V56A20,20,0,0,1,48,36H208A20,20,0,0,1,228,56Zm-24,4H52v52c0,35.71,13.09,64.69,38.91,86.15A126.14,126.14,0,0,0,128,219.38a126.28,126.28,0,0,0,37.09-21.23C190.91,176.69,204,147.71,204,112Z"},child:[]}]})(e)}function Xle({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=Kc,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return b.jsxs(Ne,{title:e,icon:b.jsx("div",{className:"h-6 w-6 grid place-items-center",children:b.jsx(o,{className:`h-6 w-6 ${a}`})}),children:[b.jsx("div",{className:"text-4xl font-semibold tracking-tight text-[#121212]",children:t}),b.jsxs("div",{className:"flex items-center gap-[8px] text-[14px]",children:[b.jsx("div",{className:i?"text-emerald-600 font-medium":"text-rose-600 font-medium",children:n}),b.jsx("div",{className:"text-slate-500",children:r})]})]})}function Qle(){const e=[{title:"Total Visitors",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Hy,iconColor:"text-[#329DFF]"},{title:"Active Incidents",value:73,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:pre,iconColor:"text-[#F69E0A]"},{title:"Missed Patrols",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Gle,iconColor:"text-[#AB0000]"},{title:"Parking Usage",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:k3,iconColor:"text-[#36AB6C]"}];return b.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:e.map((t,n)=>b.jsx(Xle,{...t},n))})}const Zle=[{title:"Maintenance",total:12,pending:3},{title:"Security",total:8,pending:1},{title:"Housekeeping",total:6,pending:2},{title:"Utilities",total:10,pending:4}],Jle=(e="")=>e.replace(/</g,"<").replace(/>/g,">").replace(/<[^>]*>/g,"").trim();function ece({data:e}){const t=Array.isArray(e?.complaints_by_category)&&e.complaints_by_category.length>0?e.complaints_by_category.map(n=>({title:Jle(n.category_name)||"—",total:n.total||0,pending:n.pending||0})):Zle;return b.jsx(Ne,{title:"Complaints",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:b.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>b.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-lg p-3 h-[62px]",children:[b.jsxs("div",{className:"flex flex-col",children:[b.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),b.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),b.jsxs("div",{className:"flex flex-col items-end",children:[b.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},r))})})}const tce=e=>{const t={0:"𝟎",1:"𝟏",2:"𝟐",3:"𝟑",4:"𝟒",5:"𝟓",6:"𝟔",7:"𝟕",8:"𝟖",9:"𝟗"};return String(e).split("").map(n=>t[n]||n).join("")},nce=[{level:"Level 1",open_count:3,in_progress_count:4,closed_count:5,total:12},{level:"Level 2",open_count:1,in_progress_count:1,closed_count:1,total:3},{level:"Level 3",open_count:5,in_progress_count:2,closed_count:3,total:10}],rce=({active:e,payload:t,label:n})=>{if(!e||!t)return null;const r=[{key:"open_count",label:"Open",color:"#EF4444"},{key:"in_progress_count",label:"In Progress",color:"#F59D0D"},{key:"closed_count",label:"Closed",color:"#12B981"}];return b.jsxs("div",{style:{backgroundColor:"#0B0B0B",padding:"14px 40px 14px 18px",borderRadius:"10px",color:"#ffffff"},children:[b.jsx("div",{style:{color:"#ffffff",fontSize:"12px",fontWeight:"900",marginBottom:"10px"},children:n}),r.map((i,o)=>{const a=t[0]?.payload[i.key]||0,s=tce(a);return b.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:o<r.length-1?"8px":"0",fontSize:"12px"},children:[b.jsx("div",{style:{width:"8px",height:"8px",backgroundColor:i.color,transform:"rotate(45deg)",marginRight:"8px"}}),b.jsx("span",{style:{color:"D1D3D4",minWidth:"100px"},children:i.label}),b.jsx("span",{style:{marginLeft:"auto",fontWeight:"700"},children:s})]},i.key)})]})},ice=()=>{const e=[{label:"Open",color:"#EF4444"},{label:"In Progress",color:"#F59D0D"},{label:"Closed",color:"#12B981"}];return b.jsx("div",{style:{display:"flex",justifyContent:"space-between",gap:"15px"},children:e.map(t=>b.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[b.jsx("div",{style:{width:"6px",height:"6px",backgroundColor:t.color,transform:"rotate(45deg)"}}),b.jsx("span",{style:{fontSize:"14px"},children:t.label})]},t.label))})},oce=({data:e})=>{const t=k.useMemo(()=>(Array.isArray(e?.complaints_by_level)&&e.complaints_by_level.some(l=>Number(l.total)>0)?e.complaints_by_level:nce).map(l=>({level:l.level||"—",open_count:Number(l.open_count)||0,in_progress_count:Number(l.in_progress_count)||0,closed_count:Number(l.closed_count)||0,total:Number(l.total)||0})),[e]),n=k.useMemo(()=>Math.max(...t.map(a=>a.total),5),[t]),r=Math.ceil(n*1.2),i=6,o=Math.max(Math.ceil(n/i),1);return b.jsxs(Ne,{title:"Complaints by Level",className:"w-full h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:[b.jsx(xi,{width:"100%",height:"85%",children:b.jsxs(qM,{data:t,margin:{top:5,right:-25,left:-30,bottom:5},children:[b.jsx(ol,{strokeDasharray:"0",vertical:!1}),b.jsx(al,{dataKey:"level"}),b.jsx($a,{domain:[0,r],ticks:Array.from({length:i+1},(a,s)=>s*o)}),b.jsx(bi,{content:b.jsx(rce,{}),cursor:!1}),b.jsx(nc,{dataKey:"open_count",stackId:"a",fill:"#EF4444",barSize:44,radius:[0,0,0,0]}),b.jsx(nc,{dataKey:"in_progress_count",stackId:"a",fill:"#F59D0D",barSize:44,radius:[0,0,0,0]}),b.jsx(nc,{dataKey:"closed_count",stackId:"a",fill:"#12B981",barSize:44,radius:[0,0,0,0]})]})}),b.jsx(ice,{})]})},ace=[{title:"Maintenance",total:18,pending:4},{title:"Security",total:11,pending:2},{title:"Housekeeping",total:9,pending:3},{title:"Utilities",total:14,pending:5}];function sce({data:e}){const t=Array.isArray(e?.request_box_by_type)&&e.request_box_by_type.length>0?e.request_box_by_type.map(n=>({title:n.category_name||"—",total:Number(n.total)||0,pending:Number(n.pending)||0})):ace;return b.jsx(Ne,{title:"Request Box",className:"h-[362px]",titleWeight:"semi-bold",titleClassName:"!text-[20px] !leading-[24px]",children:b.jsx("div",{className:"flex flex-col gap-[12px]",children:t.map((n,r)=>b.jsxs("div",{className:"flex items-center justify-between bg-[#F9FAFB] rounded-lg p-3 h-[62px]",children:[b.jsxs("div",{className:"flex flex-col",children:[b.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-[#121212] capitalize",children:n.title}),b.jsxs("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:["Total: ",n.total]})]}),b.jsxs("div",{className:"flex flex-col items-end",children:[b.jsx("div",{className:"text-[14px] leading-[18px] font-medium text-red-700",children:String(n.pending).padStart(2,"0")}),b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Pending"})]})]},`${n.title}-${r}`))})})}function lce(e){return Fe({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinejoin:"round",strokeWidth:"32",d:"M416 221.25V416a48 48 0 0 1-48 48H144a48 48 0 0 1-48-48V96a48 48 0 0 1 48-48h98.75a32 32 0 0 1 22.62 9.37l141.26 141.26a32 32 0 0 1 9.37 22.62z"},child:[]},{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M256 56v120a32 32 0 0 0 32 32h120m-232 80h160m-160 80h160"},child:[]}]})(e)}const cce=["open_complaints","pending_requests","avg_response_time","resolution_rate"],uce={open_complaints:{title:"Open Complaints",Icon:ik,iconColor:"#AB0000",deltaLabel:"Compared to last month"},pending_requests:{title:"Pending Requests",Icon:lce,iconColor:"#E7A015",deltaLabel:"Compared to last month"},avg_response_time:{title:"Avg Response Time",Icon:L3,iconColor:"#1FA05B",deltaLabel:"Compared to last month"},resolution_rate:{title:"Resolution Rate",Icon:N3,iconColor:"#329DFF",deltaLabel:"Compared to last month"}},dce=({children:e,size:t=28,lineHeight:n=32,weight:r=500,color:i="#121212"})=>b.jsx("div",{style:{fontWeight:r,fontSize:`${t}px`,lineHeight:`${n}px`,color:i},children:e}),fce={primary:{size:28,lineHeight:32,weight:500}},pce={open_complaints:{current:24,trend_percent:"-8%",direction:"bad"},pending_requests:{current:17,trend_percent:"-5%",direction:"bad"},avg_response_time:{current:"2.4 h",trend_percent:"+6%",direction:"good"},resolution_rate:{current:"89%",trend_percent:"+4%",direction:"good"}};function hce({id:e,data:t}){return e&&t&&!t[e]&&t.current!==void 0?b.jsx(EP,{id:e,data:t}):b.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:cce.map(n=>b.jsx(EP,{id:n},n))})}function EP({id:e,data:t}){const n=uce[e];if(!n)return null;const r=(d,f)=>f==null?"—":d==="avg_response_time"?typeof f=="number"?`${f} h`:f:d==="resolution_rate"&&typeof f=="number"?`${f}%`:f,{title:i,Icon:o=Kc,iconColor:a,deltaLabel:s}=n,l=t&&Object.keys(t).length>0?t:pce[e],c=r(e,l?.current),u=l?.trend_percent??"—";return l?.direction==="good"||l?.direction,b.jsx("div",{className:"h-[132px]",children:b.jsxs(Ne,{title:i,titleColor:a,icon:b.jsx("div",{className:"h-[20px] w-[20px] flex items-center justify-center",children:b.jsx(o,{className:"h-[20px] w-[20px]",style:{color:a}})}),childrenClassName:"!space-y-[12px]",iconClassName:"!gap-[12px]",children:[b.jsx(dce,{...fce.primary,children:c}),b.jsxs("div",{className:"flex items-center gap-[8px] text-[12px] leading-[16px]",children:[b.jsx(Yy,{value:u}),b.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:s})]})]})})}function OP({title:e,date:t,rsvp:n,utilisation:r,status:i}){return b.jsxs("div",{className:" bg-[#F8FAFC] h-[106px] px-3 mt-3",children:[b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsx("div",{className:"text-[16px] leading-[20px] font-semibold text-[#121212]",children:e}),b.jsx("div",{className:`!text-[12px] font-medium leading-[16px] px-2 py-1 ${i==="Completed"?"text-[#36AB6C] bg-[#E6F7EE]":i==="Upcoming"?"text-[#329DFF] bg-[#E6F2FF]":"text-slate-500 bg-slate-100"}`,children:i})]}),b.jsx("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:t}),b.jsxs("div",{className:"flex justify-between items-center mt-2",children:[b.jsxs("div",{className:"text-[14px] leading-[18px] text-[#64748B]",children:[n," RSVP"]}),b.jsxs("div",{className:"text-[#3C82F6] text-[14px] leading-[18px] font-medium",children:[r,"% utilisation"]})]}),b.jsx("div",{className:"w-full bg-[#F8FAFC] h-[6px] rounded mt-2 mb-3",children:b.jsx("div",{className:"h-[6px] rounded bg-[#3C82F6]",style:{width:`${r}%`}})})]})}function mce(){return b.jsx(Ne,{title:"Events Utilisation",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"w-full h-[360px]",children:b.jsxs("div",{children:[b.jsx(OP,{title:"Holi Celebration",date:"25 Jun 2025",rsvp:"78/100",utilisation:71,status:"Upcoming"}),b.jsx(OP,{title:"Maintenance Meeting",date:"25 Jun 2025",rsvp:"45/60",utilisation:75,status:"Completed"})]})})}function Pd({label:e,value:t,subLabel:n,bgColor:r,textColor:i}){return b.jsxs("div",{className:`rounded-lg p-4 ${r} h-[124px]`,children:[b.jsx("div",{className:`text-[16px] font-medium ${i} leading-[20px]`,children:e}),b.jsx("div",{className:"mt-4 text-[28px] leading-[32px] font-semibold text-[#121212]",children:t}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-2",children:n})]})}function gce(){return b.jsx(Ne,{title:"Notice Board Status",period:b.jsx(An,{className:"h-5 w-5 text-[#884EA7] cursor-pointer"}),className:"w-full h-[360px]",children:b.jsxs("div",{className:"grid grid-cols-2 gap-[16px]",children:[b.jsx(Pd,{label:"Active",value:138,subLabel:"3 expiring soon",bgColor:"bg-[#F0FFF7]",textColor:"text-[#1FA05B]"}),b.jsx(Pd,{label:"Scheduled",value:13,subLabel:"4 this week",bgColor:"bg-[#FFFBF2]",textColor:"text-[#E7A015]"}),b.jsx(Pd,{label:"Recurring",value:3,subLabel:"All active",bgColor:"bg-[#EDF6FF]",textColor:"text-[#329DFF]"}),b.jsx(Pd,{label:"Expired",value:7,subLabel:"4 recent",bgColor:"bg-[#F6F6F6]",textColor:"text-[#64748B]"})]})})}function Yj(e){return Fe({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M20 22H4C3.44772 22 3 21.5523 3 21V3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22ZM19 20V4H5V20H19ZM8 9H16V11H8V9ZM8 13H16V15H8V13Z"},child:[]}]})(e)}function vce({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=Kc,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return b.jsx(Ne,{title:e,icon:b.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:b.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:b.jsxs("div",{children:[b.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),b.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[b.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),b.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}function yce({data:e}){const t=[{title:e?.title||"Total Bookings",value:145,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Yj,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"}];return b.jsx("div",{className:"h-full",children:t.map((n,r)=>b.jsx(vce,{...n},r))})}function bce(e){return Fe({attr:{fill:"none",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"},child:[]}]})(e)}function xce({title:e,value:t,delta:n,deltaLabel:r,positive:i=!0,Icon:o=Kc,iconColor:a="text-emerald-600",iconBg:s="bg-emerald-50"}){return b.jsx(Ne,{title:e,icon:b.jsx("div",{className:`h-6 w-6 grid place-items-center rounded-md ${s}`,children:b.jsx(o,{className:`h-4 w-4 ${a}`})}),className:"h-[132px]",children:b.jsxs("div",{children:[b.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:t}),b.jsxs("div",{className:"flex items-center gap-[8px] pt-[8px] !text-[12px] leading-[16px]",children:[b.jsx("div",{className:i?"text-[#1FA05B] font-medium":"text-rose-600 font-medium",children:n}),b.jsx("div",{className:"text-[#64748B]",children:r})]})]})})}function wce(){const e=[{title:"Notice",value:160,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:Yj,iconColor:"text-emerald-600",iconBg:"bg-emerald-50"},{title:"Post",value:83,delta:"+2.0%",deltaLabel:"Compared to last month",positive:!0,Icon:D3,iconColor:"text-[#329DFF]",iconBg:"bg-emerald-50"},{title:"Poll",value:3,delta:"+11.0%",deltaLabel:"Compared to last month",positive:!0,Icon:dre,iconColor:"text-[#FA7E28]",iconBg:"bg-orange-100"},{title:"Poll",value:5,delta:"-8.0%",deltaLabel:"Compared to last month",positive:!1,Icon:bce,iconColor:"text-[#DBB467]",iconBg:"bg-yellow-100"}];return b.jsx("div",{className:"px-5 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-[24px]",children:e.map((t,n)=>b.jsx(xce,{...t},n))})}const PP=({value:e=0,total:t=1,colorClass:n="",label:r=""})=>{const i=Math.max(0,Math.min(100,e/(t||1)*100)),o=n==="bg-[#8B5CF6]"?"text-[#8B5CF6]":n==="bg-[#12B981]"?"text-[#12B981]":"text-slate-600";return b.jsxs("div",{className:"flex flex-col items-start",children:[b.jsx("div",{className:"w-2/3 min-w-[80px] h-3 rounded-full overflow-hidden",children:b.jsx("div",{className:`h-[11px] rounded-full ${n}`,style:{width:n==="bg-[#12B981]"?`${i+45}%`:`${i}%`}})}),b.jsx("div",{className:`${o} !text-[12px] font-bold mt-1`,children:e}),b.jsx("div",{className:"!text-[12px] leading-[16px] text-[#64748B] mt-1",children:r})]})},_ce=({occupiedUnits:e=9e3,EmployeesCount:t=8910,AdminsCount:n=90})=>{const r=t+n;return b.jsx("div",{children:b.jsxs("div",{className:"bg-white !border-[0.5px] !border-[#EBEBEB] rounded-xl shadow-[0_0_12px_0_#EAF2FF] p-4 h-[128px]",children:[b.jsxs("div",{className:"flex items-center gap-[12px] h-[20px]",style:{marginBottom:"24px"},children:[b.jsx(Hy,{className:"!text-[20px] text-[#329DFF]"}),b.jsx("div",{className:"font-medium text-[#121212]",children:"Occupancy Overview (Static Data)"})]}),b.jsxs("div",{className:"flex items-start justify-between",children:[b.jsxs("div",{children:[b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B] font-normal",children:"Total Occupants"}),b.jsx("div",{className:"flex items-center gap-1",children:b.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#121212]",children:e})})]}),b.jsxs("div",{className:"flex items-end",children:[b.jsx(PP,{value:t,total:r,colorClass:"bg-[#8B5CF6]",label:"Employees"}),b.jsx(PP,{value:n,total:r,colorClass:"bg-[#12B981]",label:"Admins"})]})]})]})})};Mn.register(lo,co,fl,jr);const Sce=()=>{const t={labels:["HP","Adobe","Anarock","Swiggy","Infosys","Zepto"],datasets:[{data:[2e3,1700,1500,1200,900,800],backgroundColor:["#329DFF","#EF4645","#8A2E64","#F69E0A","#A2BB40","#8B5CF6"],barThickness:34}]},n={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff",displayColors:!1,callbacks:{label:r=>`Employees: ${r.parsed.y}`}}},scales:{x:{grid:{display:!1},ticks:{color:"#64748B",font:{size:12}}},y:{beginAtZero:!0,max:2e3,ticks:{stepSize:500,color:"#64748B"},grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1}}}};return b.jsxs(Ne,{className:"w-full h-[238px]",title:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(A5,{className:"!text-[20px] text-[#8B5CF6]"}),b.jsx("div",{className:"font-medium text-[#121212]",children:"Employee Footfall (Static Data)"})]}),period:b.jsx("span",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Today"}),children:[b.jsxs("div",{style:{marginBottom:"16px",marginTop:"8px"},children:[b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Employees Inside"}),b.jsx("div",{className:"text-[20px] leading-[24px] font-medium text-[#1FA05B]",children:"7,500"})]}),b.jsx("div",{className:"h-[97px]",children:b.jsx(pl,{data:t,options:n})})]})};function Ece(){return b.jsx(Ne,{className:"h-[324px]",title:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(T5,{className:"!text-[20px] text-[#FA7E28]"}),b.jsx("div",{className:"font-medium text-[#121212]",children:"Food & Beverages (Static Data)"})]}),period:b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Today"}),children:b.jsxs("div",{className:"flex flex-col h-full",children:[b.jsxs("div",{className:"grid grid-cols-2 gap-6 mb-6",children:[b.jsxs("div",{children:[b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Orders"}),b.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:247})]}),b.jsxs("div",{children:[b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Revenue Generated"}),b.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF]",children:["₹ ","82K"]}),b.jsxs("div",{className:"inline-flex items-center gap-1 mt-2 text-[10px] leading-[14px] px-2 py-1 rounded-full text-[#1FA05B] bg-green-50",children:[b.jsx(nk,{}),8,"%",b.jsx("span",{children:"from last month"})]})]})]}),b.jsxs("div",{className:"space-y-5",children:[b.jsxs("div",{children:[b.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[b.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:"HP"}),b.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[b.jsx("div",{className:"text-[#64748B] inline-block",children:"120 orders"}),b.jsx("div",{className:"mx-2 text-[#121212] inline-block",children:"₹ 45K"})]})]}),b.jsx("div",{className:"h-3 bg-gray-100 rounded-full",children:b.jsx("div",{className:"h-3 bg-blue-500 rounded-full",style:{width:"70%"}})})]}),b.jsxs("div",{children:[b.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[b.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:"Adobe"}),b.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[b.jsx("div",{className:"text-[#64748B] inline-block",children:"85 orders"}),b.jsx("div",{className:"mx-2 text-[#121212] inline-block",children:"₹ 23K"})]})]}),b.jsx("div",{className:"h-3 bg-gray-100 rounded-full",children:b.jsx("div",{className:"h-3 bg-red-500 rounded-full",style:{width:"50%"}})})]}),b.jsxs("div",{children:[b.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[b.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:"Anarock"}),b.jsxs("div",{className:"font-medium text-[12px] leading-[16px] flex items-center",children:[b.jsx("div",{className:"text-[#64748B] inline-block",children:"42 orders"}),b.jsx("div",{className:"mx-2 text-[#121212] inline-block",children:"₹ 14K"})]})]}),b.jsx("div",{className:"h-3 bg-gray-100 rounded-full",children:b.jsx("div",{className:"h-3 bg-purple-700 rounded-full",style:{width:"25%"}})})]})]})]})})}function Oce({data:e}){const t=e?.amenitySummary||{},n=Array.isArray(e?.chartData)?e.chartData:[],r=n.length>0&&n.every(c=>c?.isPaid===!1),i=t?.totalBookings||0,o=n.reduce((c,u)=>{const d=u?.isPaid?u?.paid_bookings||0:u?.unpaid_bookings||0;return c+d},0),a=n.map(c=>{const u=c?.isPaid?c?.paid_bookings||0:c?.unpaid_bookings||0,d=c?.isPaid?`₹${c?.paid_revenue||"0.00"}`:"",f=o>0?Math.round(u/o*100):0;return{name:c?.facility_name||"Unknown",bookings:u,revenue:d,percentage:f,color:c?.isPaid?"bg-violet-500":"bg-slate-400",isPaid:c?.isPaid}}),s=typeof t?.growth_percentage=="number"?t.growth_percentage:null,l=s!==null?s>=0:!0;return b.jsx(Ne,{className:"h-[324px]",title:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(C3,{className:"!text-[20px] text-[#884EA7]"}),b.jsx("div",{className:"font-medium text-[#121212]",children:"Amenities"})]}),period:b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Today"}),children:b.jsxs("div",{className:"flex flex-col h-full",children:[b.jsxs("div",{className:"grid grid-cols-2 gap-6 mb-6",children:[b.jsxs("div",{children:[b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Total Bookings"}),b.jsx("div",{className:"text-[28px] leading-[32px] font-medium text-[#8B5CF6]",children:i})]}),!r&&b.jsxs("div",{children:[b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Revenue Generated"}),b.jsxs("div",{className:"text-[28px] leading-[32px] font-medium text-[#329DFF]",children:["₹",t?.todayPaidRevenue??"0.00"]}),s!==null&&b.jsxs("div",{className:`inline-flex items-center gap-1 mt-2 text-[10px] leading-[14px] px-2 py-1 rounded-full ${l?"text-[#1FA05B] bg-green-50":"text-red-600 bg-red-50"}`,children:[l?b.jsx(nk,{}):b.jsx(O3,{}),s,"%",b.jsx("span",{children:"from last month"})]})]})]}),b.jsx("div",{className:"space-y-5",children:a?.length>0?a?.map((c,u)=>b.jsxs("div",{children:[b.jsxs("div",{className:"flex justify-between text-sm mb-2",children:[b.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px]",children:c?.name}),b.jsxs("div",{className:"font-medium text-[12px] leading-[16px]",children:[b.jsxs("div",{className:"text-[#64748B] inline",children:[c?.bookings," ",c?.bookings<=1?"booking":"bookings"]}),c?.isPaid&&b.jsx("div",{className:"mx-2 text-[#121212] inline",children:c?.revenue})]})]}),b.jsx("div",{className:"h-3 bg-gray-100 rounded-full",children:b.jsx("div",{className:`h-3 rounded-full ${c?.color}`,style:{width:`${c?.percentage}%`}})})]},u)):b.jsx("div",{className:"flex items-center justify-center h-[120px]",children:b.jsx("div",{className:"text-[12px] text-[#94A3B8]",children:"No amenity usage data available"})})})]})})}Mn.register(lo,co,fl,jr,Vr);function Pce({data:e=[]}){const t=[{level:"L1",open_count:55,in_progress_count:22,on_hold:15,closed_count:6},{level:"L2",open_count:45,in_progress_count:25,on_hold:18,closed_count:5},{level:"L3",open_count:58,in_progress_count:23,on_hold:14,closed_count:6}],n=e.length>0?e:t,r=[],i=[],o=[],a=[],s=[];for(let u=0;u<n.length;u++)r.push(n[u].level),i.push(Number(n[u].open_count)),o.push(Number(n[u].in_progress_count)),a.push(Number(n[u].on_hold)),s.push(Number(n[u].closed_count));const l={labels:r,datasets:[{label:"Open",data:i,backgroundColor:"#3B82F6",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"In Progress",data:o,backgroundColor:"#F59E0B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"On-Hold",data:a,backgroundColor:"#64748B",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"},{label:"Closed",data:s,backgroundColor:"#10B981",borderColor:"#FFFFFF",borderWidth:2,barThickness:38,stack:"tickets"}]},c={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{usePointStyle:!0,pointStyle:"rectRot",padding:20,color:"#64748B"}},tooltip:{backgroundColor:"#0F172A",titleColor:"#fff",bodyColor:"#fff"}},scales:{x:{stacked:!0,grid:{display:!1},ticks:{color:"#64748B"}},y:{stacked:!0,beginAtZero:!0,grid:{display:!1,color:"#E5E7EB",borderDash:[4,4],drawBorder:!1},ticks:{color:"#64748B",stepSize:1,precision:0,callback:u=>Math.round(u)}}}};return b.jsx(Ne,{className:"h-[267px]",title:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(j3,{className:"!text-[20px] text-[#3C81F6]"}),b.jsx("div",{className:"font-medium text-[#121212]",children:"Ticket Escalation Levels"})]}),period:b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Today"}),children:b.jsx("div",{className:"h-full",children:b.jsx(pl,{data:l,options:c})})})}const Cce=({active:e,payload:t})=>!e||!t||!t.length?null:b.jsxs("div",{style:{backgroundColor:"#000000",color:"#ffffff",padding:"8px 10px",borderRadius:"8px",fontSize:"12px"},children:[b.jsx("div",{className:"font-medium",children:t[0].name}),b.jsx("div",{children:t[0].value})]});function kce({data:e=null}){const n=e||{open:12,on_hold:5,cancelled:3,completed:156,in_progress:8,total_complaints:184},r=a=>{const s=Number(a);return isNaN(s)?0:s},i=[{name:"Completed",value:r(n.completed),color:"#10B981"},{name:"Open",value:r(n.open),color:"#3B82F6"},{name:"In Progress",value:r(n.in_progress),color:"#F59E0B"},{name:"On Hold",value:r(n.on_hold),color:"#6B7280"},{name:"Cancelled",value:r(n.cancelled),color:"#EF4444"}],o=r(n.total_complaints);return b.jsx(Ne,{className:"h-[267px]",title:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(rv,{className:"!text-[20px] text-[#EF4444]"}),b.jsx("div",{className:"font-medium text-[#121212]",children:"Ticket Status"})]}),period:b.jsx("span",{className:"text-[12px] leading-[16px] text-[#64748B]",children:"Today"}),children:b.jsxs("div",{className:"flex h-full items-center gap-4",children:[b.jsxs("div",{className:"w-[202px] h-[170px] relative",children:[b.jsx(xi,{width:"100%",height:"100%",children:b.jsxs(bu,{children:[b.jsx(il,{data:i,innerRadius:55,outerRadius:85,dataKey:"value",stroke:"#FFFFFF",strokeWidth:2,children:i.map((a,s)=>b.jsx(Br,{fill:a.color},s))}),b.jsx(bi,{content:b.jsx(Cce,{}),wrapperStyle:{zIndex:1e3}})]})}),b.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center pointer-events-none",children:[b.jsxs("div",{className:"flex items-baseline text-[18px] leading-[22px] font-medium text-[#121212]",children:[b.jsx("div",{children:r(n.completed)}),b.jsxs("div",{className:"text-[18.18px] leading-[22.22px] text-[#121212]",children:["/",o]})]}),b.jsx("div",{className:"text-[10.1px] leading-[14.14px] text-[#64748B]",children:"Completed"})]})]}),b.jsx("div",{className:"flex-1 space-y-2",children:i.map(a=>b.jsxs("div",{className:"flex items-center justify-between text-sm",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx("div",{className:"h-[7px] w-[16px]",style:{backgroundColor:a.color}}),b.jsx("div",{className:"text-[12px] leading-[16px] text-[#64748B]",children:a.name})]}),b.jsx("div",{className:"text-[#64748B] text-[12px] leading-[16px] font-medium",children:a.value})]},a.name))})]})})}const CP={visitorSummary:{totalVisitorsToday:150,peakTime:"2:00 - 4:00PM",peakCount:50,activeWalkins:18,preApprovedCheckins:3},popupData:{walkins:{currently_inside:18,total_visited_today:58},preApproved:{completed_visits:3,total_expected_today:5}},chartData:[{hour:"10 AM",walkins:22,preApproved:30},{hour:"12 PM",walkins:15,preApproved:28},{hour:"2 PM",walkins:30,preApproved:38},{hour:"4 PM",walkins:45,preApproved:50},{hour:"6 PM",walkins:25,preApproved:40}]};function kP({title:e,color:t,rows:n=[],children:r}){const i=b.jsxs("div",{className:"bg-white rounded-xl min-w-[260px] p-4",children:[b.jsxs("div",{className:"flex items-center gap-2 font-medium text-[#121212]",children:[b.jsx(Mp,{className:`text-[20px] ${t}`}),b.jsx("div",{children:e??""})]}),b.jsx("div",{className:"mt-3 pt-3 border-t border-dashed border-gray-200 space-y-2",children:n?.map(({label:o,value:a,valueColor:s})=>b.jsxs("div",{className:"flex justify-between text-[14px]",children:[b.jsx("div",{children:o??""}),b.jsx("div",{className:"font-semibold",style:{color:s||"#121212"},children:a??0})]},o))})]});return b.jsx(ej,{content:i,placement:"right-start",interactive:!0,delay:[100,0],offset:[6,0],appendTo:()=>document.body,theme:"light-border",maxWidth:"none",children:r})}function Dce({data:e}){const t=e&&Object.keys(e).length?e:CP,n=t?.visitorSummary??{},r={walkins:{currently_inside:Number(t?.walkinsPopupData?.walkinsInside??0),total_visited_today:Number(t?.walkinsPopupData?.totalWalkins??0)},preApproved:{completed_visits:Number(t?.preApprovedPopupData?.preApprovedCheckIns??0),total_expected_today:Number(t?.preApprovedPopupData?.totalPreApprovedCheckIns??0)}},i=k.useMemo(()=>{const a=t?.chartData??[];if(!a.length)return CP.chartData;const s=[];for(let l=0;l<a.length;l++)s.push({time:a[l]?.hour??"-",walkins:a[l]?.walkins??0,approved:a[l]?.preApproved??0});return s},[t]),o=new Date().toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit",hour12:!0});return b.jsx(Ne,{className:"h-[377px]",title:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(Mp,{className:"!text-[20px] text-[#8B5CF6]"}),b.jsx("div",{className:"font-medium text-[#121212]",children:"Visitor Updates"})]}),period:b.jsx("div",{className:"flex items-center gap-1 text-[12px] text-[#64748B]",children:b.jsxs("div",{children:["Today at ",o]})}),children:b.jsxs("div",{className:"flex flex-col mt-2",children:[b.jsxs("div",{className:"grid grid-cols-2 gap-y-4 gap-x-6 mb-6",children:[b.jsxs("div",{children:[b.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Total Visitors"}),b.jsx("div",{className:"text-[20px] font-medium text-[#08B6D4]",children:n?.totalVisitorsToday??0})]}),b.jsxs("div",{children:[b.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Peak Time"}),b.jsx("div",{className:"text-[20px] font-medium text-[#8B5CF6]",children:n?.peakTime??"-"})]}),b.jsxs("div",{className:"mt-2",children:[b.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Active Walk-ins"}),b.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[b.jsx("div",{className:"text-[28px] text-[#1FA05B] leading-[32px]",children:r?.walkins?.currently_inside??0}),b.jsx(kP,{title:"Active Walk-ins",color:"text-[#1FA05B]",rows:[{label:"Currently Inside",value:r?.walkins?.currently_inside??0,valueColor:"#1FA05B"},{label:"Total Visited Today",value:r?.walkins?.total_visited_today??0}],children:b.jsxs("div",{className:"text-gray-400 cursor-pointer ml-1 leading-[32px]",children:["/",r?.walkins?.total_visited_today??0]})})]})]}),b.jsxs("div",{className:"mt-2",children:[b.jsx("div",{className:"text-[10px] text-[#64748B]",children:"Pre-approved Check-ins"}),b.jsxs("div",{className:"flex items-baseline text-xl font-medium leading-[32px]",children:[b.jsx("div",{className:"text-[28px] text-[#E7A015] leading-[32px]",children:r?.preApproved?.completed_visits??0}),b.jsx(kP,{title:"Pre-approved Check-ins",color:"text-[#E7A015]",rows:[{label:"Completed Visits",value:r?.preApproved?.completed_visits??0,valueColor:"#E7A015"},{label:"Total Expected Check-ins Today",value:r?.preApproved?.total_expected_today??0}],children:b.jsxs("div",{className:"text-gray-400 cursor-pointer ml-1 leading-[32px]",children:["/",r?.preApproved?.total_expected_today??0]})})]})]})]}),b.jsx("div",{className:"w-full h-[179px]",children:b.jsx(xi,{width:"100%",height:"100%",children:b.jsxs(B0,{data:i??[],children:[b.jsx(ol,{stroke:"#E5E7EB",strokeDasharray:"4 4",vertical:!1}),b.jsx(al,{dataKey:"time",axisLine:!1,tickLine:!1,tick:{fill:"#121212",fontSize:12}}),b.jsx($a,{width:30,axisLine:!1,tickLine:!1,tick:{fill:"#64748B",fontSize:12}}),b.jsx(bi,{}),b.jsx(Co,{type:"monotone",dataKey:"walkins",stroke:"#22C55E",strokeWidth:2,dot:!1}),b.jsx(Co,{type:"monotone",dataKey:"approved",stroke:"#F59E0B",strokeWidth:2,strokeDasharray:"5 5",dot:!1})]})})})]})})}exports.Accounting=jle;exports.Amenities=Oce;exports.AssetValueBreakdown=$le;exports.BlockWiseOccupancy=Tle;exports.Budgets=Rle;exports.Card=Ne;exports.CashBankBalance=Ile;exports.CommercialOccupancy=_ce;exports.Community=hre;exports.Complaints=ece;exports.ComplaintsByLevel=oce;exports.DuesAgeing=Lle;exports.EmployeeFootfall=Sce;exports.Engagement=mre;exports.EngagementStatsGrid=wce;exports.EventsUtilisation=mce;exports.ExpenseCategories=Fle;exports.Facilities=gre;exports.FinanceSummary=vre;exports.FoodBeverages=Ece;exports.GateAndSecurityStatsGrid=Qle;exports.GateUpdates=nie;exports.GuardPatrols=Yle;exports.Header=v3;exports.Helpdesk=rie;exports.HelpdeskStatsGrid=hce;exports.HourlyTrafficFlow=Ule;exports.IncidentReports=Kle;exports.IncomeExpenditure=Hj;exports.MainHeader=M3;exports.MoveInOutTrends=Mle;exports.NoticeBoardStatus=gce;exports.OccupancyOverview=Cle;exports.RequestBox=sce;exports.ResidentOverview=Dle;exports.RevenuebyCategory=Ble;exports.SingleStats=yce;exports.StaffAttendance=qle;exports.StatsGrid=Hle;exports.TicketEscalation=Pce;exports.TicketStatus=kce;exports.UnitStatus=Ple;exports.VisitorUpdates=Dce;
|