(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5201],{24322:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/consumer-management/consumer-orders/CardOrder",function(){return r(28817)}])},1342:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{noSSR:function(){return noSSR},default:function(){return dynamic}});let o=r(38754),a=(r(67294),o._(r(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 r=a.default,o={loading:e=>{let{error:t,isLoading:r,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 n=o.loader;return(o.loadableGenerated&&(o={...o,...o.loadableGenerated},delete o.loadableGenerated),"boolean"!=typeof o.ssr||o.ssr)?r({...o,loader:()=>null!=n?n().then(convertModule):Promise.resolve(convertModule(()=>null))}):(delete o.webpack,delete o.modules,noSSR(r,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,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"LoadableContext",{enumerable:!0,get:function(){return n}});let o=r(38754),a=o._(r(67294)),n=a.default.createContext(null)},24304:function(e,t,r){"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 d}});let o=r(38754),a=o._(r(67294)),n=r(30043),l=[],i=[],s=!1;function load(e){let t=e(),r={loading:!0,loaded:null,error:null};return r.promise=t.then(e=>(r.loading=!1,r.loaded=e,e)).catch(e=>{throw r.loading=!1,r.error=e,e}),r}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 r=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,r);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=r.webpack?r.webpack():r.modules;e&&i.push(t=>{for(let r of e)if(t.includes(r))return init()})}function LoadableComponent(e,t){!function(){init();let e=a.default.useContext(n.LoadableContext);e&&Array.isArray(r.modules)&&r.modules.forEach(t=>{e(t)})}();let l=a.default.useSyncExternalStore(o.subscribe,o.getCurrentValue,o.getCurrentValue);return a.default.useImperativeHandle(t,()=>({retry:o.retry}),[]),a.default.useMemo(()=>{var t;return l.loading||l.error?a.default.createElement(r.loading,{isLoading:l.loading,pastDelay:l.pastDelay,timedOut:l.timedOut,error:l.error,retry:o.retry}):l.loaded?a.default.createElement((t=l.loaded)&&t.default?t.default:t,e):null},[e,l])}return LoadableComponent.preload=()=>init(),LoadableComponent.displayName="LoadableComponent",a.default.forwardRef(LoadableComponent)}(load,e)}function flushInitializers(e,t){let r=[];for(;e.length;){let o=e.pop();r.push(o(t))}return Promise.all(r).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 d=Loadable},28817:function(e,t,r){"use strict";r.r(t);var o=r(85893),a=r(67294),n=r(99226),l=r(66242),i=r(15861),s=r(5152),d=r.n(s),u=r(87066),c=r(81406),f=r(42412);let h=d()(()=>Promise.all([r.e(4814),r.e(7229)]).then(r.bind(r,47229)),{loadableGenerated:{webpack:()=>[47229]},ssr:!1});t.default=()=>{let[e,t]=(0,a.useState)([]),getCardOrderData=async()=>{let e=window.localStorage.getItem(f.Z.storageTokenKeyName);try{let r=await u.Z.get("".concat(c.Ao,"/api/orders/order-graph"),{headers:{Authorization:"Bearer ".concat(e)}});t(r.data.graphSeriesList)}catch(e){console.error("Error:",e)}};(0,a.useEffect)(()=>{getCardOrderData()},[]);let r={chart:{id:"order-graph",type:"line",height:"100%",toolbar:{show:!1},offsetY:-10},xaxis:{categories:e.length?e[0].xAxis:[],axisBorder:{show:!1},axisTicks:{show:!0,color:"#333"},labels:{show:!1}},yaxis:{show:!1},grid:{show:!1},stroke:{curve:"smooth",width:2},fill:{type:"gradient",gradient:{shadeIntensity:1,opacityFrom:.7,opacityTo:.25,stops:[0,100,100,100]}},colors:["#00c292","#FF5733","#FFC107","#FF6F61"]};return(0,o.jsx)(l.Z,{sx:{padding:0,borderRadius:"8px",boxShadow:"none !important",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",margin:"0 -8px",background:"#00000000"},children:(0,o.jsx)(n.Z,{sx:{display:"flex",justifyContent:"space-between",width:"100%"},children:e.map((e,t)=>{console.log(e,"ddddd");let a=null==e?void 0:e.percentage;return console.log(a,"fdfd"),(0,o.jsxs)(l.Z,{sx:{padding:"1rem",textAlign:"center",borderRadius:"8px",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)",display:"flex",flexDirection:"column",justifyContent:"space-between",position:"relative",flex:1,margin:1,backgroundColor:"white"},children:[(0,o.jsxs)(n.Z,{sx:{paddingBottom:.5},children:[(0,o.jsx)(i.Z,{variant:"body2",fontWeight:"500",textTransform:"capitalize",gutterBottom:!0,children:e.name}),(0,o.jsx)(i.Z,{variant:"h6",sx:{fontWeight:"bold",paddingTop:.5},children:e.value})]}),(0,o.jsxs)(n.Z,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:1},children:[(0,o.jsx)(n.Z,{sx:{marginLeft:0,minWidth:"50px"},children:(0,o.jsxs)(i.Z,{variant:"body2",color:"text.secondary",children:["Last Week: ",a>=0?"+":"",a]})}),(0,o.jsx)(n.Z,{sx:{flex:1,height:90},children:(0,o.jsx)(h,{options:{...r,colors:[r.colors[t%r.colors.length]]},series:[{name:e.name,data:e.data}],type:"line",height:90})})]})]},t)})})})}},5152:function(e,t,r){e.exports=r(1342)}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=24322)}),_N_E=e.O()}]);