(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1726],{44267:function(e,t,n){"use strict";n.d(t,{Z:function(){return b}});var o=n(87462),r=n(63366),a=n(67294),l=n(86010),i=n(58510),s=n(90948),u=n(71657),d=n(1977),c=n(8027);function getCardContentUtilityClass(e){return(0,c.ZP)("MuiCardContent",e)}(0,d.Z)("MuiCardContent",["root"]);var p=n(85893);let h=["className","component"],useUtilityClasses=e=>{let{classes:t}=e;return(0,i.Z)({root:["root"]},getCardContentUtilityClass,t)},f=(0,s.ZP)("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(e,t)=>t.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}})),m=a.forwardRef(function(e,t){let n=(0,u.Z)({props:e,name:"MuiCardContent"}),{className:a,component:i="div"}=n,s=(0,r.Z)(n,h),d=(0,o.Z)({},n,{component:i}),c=useUtilityClasses(d);return(0,p.jsx)(f,(0,o.Z)({as:i,className:(0,l.Z)(c.root,a),ownerState:d,ref:t},s))});var b=m},71497:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboards/manufacturerMerchant/SalesChart",function(){return n(70715)}])},1342:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{noSSR:function(){return noSSR},default:function(){return dynamic}});let o=n(38754),r=(n(67294),o._(n(24304)));function convertModule(e){return{default:(null==e?void 0:e.default)||e}}function noSSR(e,t){return delete t.webpack,delete t.modules,e(t)}function dynamic(e,t){let n=r.default,o={loading:e=>{let{error:t,isLoading:n,pastDelay:o}=e;return null}};e instanceof Promise?o.loader=()=>e:"function"==typeof e?o.loader=e:"object"==typeof e&&(o={...o,...e}),o={...o,...t};let a=o.loader;return(o.loadableGenerated&&(o={...o,...o.loadableGenerated},delete o.loadableGenerated),"boolean"!=typeof o.ssr||o.ssr)?n({...o,loader:()=>null!=a?a().then(convertModule):Promise.resolve(convertModule(()=>null))}):(delete o.webpack,delete o.modules,noSSR(n,o))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},30043:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"LoadableContext",{enumerable:!0,get:function(){return a}});let o=n(38754),r=o._(n(67294)),a=r.default.createContext(null)},24304:function(e,t,n){"use strict";/**
@copyright (c) 2017-present James Kyle <me@thejameskyle.com>
 MIT License
 Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
 The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
*/Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return u}});let o=n(38754),r=o._(n(67294)),a=n(30043),l=[],i=[],s=!1;function load(e){let t=e(),n={loading:!0,loaded:null,error:null};return n.promise=t.then(e=>(n.loading=!1,n.loaded=e,e)).catch(e=>{throw n.loading=!1,n.error=e,e}),n}let LoadableSubscription=class LoadableSubscription{promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};let{_res:e,_opts:t}=this;e.loading&&("number"==typeof t.delay&&(0===t.delay?this._state.pastDelay=!0:this._delay=setTimeout(()=>{this._update({pastDelay:!0})},t.delay)),"number"==typeof t.timeout&&(this._timeout=setTimeout(()=>{this._update({timedOut:!0})},t.timeout))),this._res.promise.then(()=>{this._update({}),this._clearTimeouts()}).catch(e=>{this._update({}),this._clearTimeouts()}),this._update({})}_update(e){this._state={...this._state,error:this._res.error,loaded:this._res.loaded,loading:this._res.loading,...e},this._callbacks.forEach(e=>e())}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}constructor(e,t){this._loadFn=e,this._opts=t,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}};function Loadable(e){return function(e,t){let n=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},t),o=null;function init(){if(!o){let t=new LoadableSubscription(e,n);o={getCurrentValue:t.getCurrentValue.bind(t),subscribe:t.subscribe.bind(t),retry:t.retry.bind(t),promise:t.promise.bind(t)}}return o.promise()}if(!s){let e=n.webpack?n.webpack():n.modules;e&&i.push(t=>{for(let n of e)if(t.includes(n))return init()})}function LoadableComponent(e,t){!function(){init();let e=r.default.useContext(a.LoadableContext);e&&Array.isArray(n.modules)&&n.modules.forEach(t=>{e(t)})}();let l=r.default.useSyncExternalStore(o.subscribe,o.getCurrentValue,o.getCurrentValue);return r.default.useImperativeHandle(t,()=>({retry:o.retry}),[]),r.default.useMemo(()=>{var t;return l.loading||l.error?r.default.createElement(n.loading,{isLoading:l.loading,pastDelay:l.pastDelay,timedOut:l.timedOut,error:l.error,retry:o.retry}):l.loaded?r.default.createElement((t=l.loaded)&&t.default?t.default:t,e):null},[e,l])}return LoadableComponent.preload=()=>init(),LoadableComponent.displayName="LoadableComponent",r.default.forwardRef(LoadableComponent)}(load,e)}function flushInitializers(e,t){let n=[];for(;e.length;){let o=e.pop();n.push(o(t))}return Promise.all(n).then(()=>{if(e.length)return flushInitializers(e,t)})}Loadable.preloadAll=()=>new Promise((e,t)=>{flushInitializers(l).then(e,t)}),Loadable.preloadReady=e=>(void 0===e&&(e=[]),new Promise(t=>{let res=()=>(s=!0,t());flushInitializers(i,e).then(res,res)})),window.__NEXT_PRELOADREADY=Loadable.preloadReady;let u=Loadable},94744:function(e,t,n){"use strict";var o=n(5152),r=n.n(o);let a=r()(()=>Promise.all([n.e(4814),n.e(7229)]).then(n.bind(n,47229)),{loadableGenerated:{webpack:()=>[47229]},ssr:!1});t.Z=a},70715:function(e,t,n){"use strict";n.r(t);var o=n(85893),r=n(99226),a=n(66242),l=n(2734),i=n(15861),s=n(44267),u=n(94744),d=n(98456);t.default=e=>{let{getData:t}=e,n=(0,l.Z)(),c=!t,p=t&&0===t.length,h=0,f=[],m=[],b=[n.palette.primary.main,n.palette.success.main,n.palette.warning.main,n.palette.error.main,n.palette.info.main,n.palette.secondary.main];c||p||t.forEach(e=>{h+=e.totalRevenue||0,f.push(e.totalRevenue||0),m.push(e.storeDisplayName)});let _=f.length>0?f:[0],y={chart:{type:"donut",height:"100%"},colors:b.slice(0,f.length),stroke:{width:0},legend:{show:!1},tooltip:{enabled:!0,custom:e=>{let{seriesIndex:t,series:o,dataPointIndex:r,w:a}=e,l=m[t]||"Unknown Store",i=o[t];return'<div style="padding: 10px; font-size: 14px; color: '.concat(n.palette.text.primary,';">\n                  <strong>').concat(l,"</strong><br />\n                  Revenue: ₹ ").concat(i.toLocaleString()," \n                </div>")}},dataLabels:{enabled:!0,formatter:e=>"".concat(e.toFixed(0),"%"),style:{fontSize:"11px",fontWeight:"bold"}},plotOptions:{pie:{donut:{size:"70%",labels:{show:!0,total:{show:!0,label:"Total Revenue",fontSize:"16px",color:n.palette.text.secondary,formatter:()=>h?"₹ ".concat(h.toLocaleString()):"No Data"}}}}},responsive:[{breakpoint:1024,options:{chart:{height:330}}},{breakpoint:768,options:{chart:{height:280},plotOptions:{pie:{donut:{size:"65%"}}}}},{breakpoint:480,options:{chart:{height:240},plotOptions:{pie:{donut:{size:"60%"}}}}}]};return(0,o.jsx)(a.Z,{sx:{width:"100%",height:"400px",margin:"auto",borderRadius:2},children:(0,o.jsxs)(s.Z,{children:[(0,o.jsx)(i.Z,{variant:"h6",sx:{mb:8},children:"Store Revenue"}),c?(0,o.jsx)(r.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:300},children:(0,o.jsx)(d.Z,{})}):p?(0,o.jsx)(r.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:300},children:(0,o.jsx)(i.Z,{variant:"h6",sx:{color:n.palette.text.secondary},children:"No Data Available"})}):(0,o.jsx)(r.Z,{sx:{flex:1,height:300,maxWidth:"100%"},children:(0,o.jsx)(u.Z,{type:"donut",series:_,options:y,height:"100%"})})]})})}},5152:function(e,t,n){e.exports=n(1342)}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=71497)}),_N_E=e.O()}]);