1"use strict";(self.webpackChunk_minimal_minimal_kit_react=self.webpackChunk_minimal_minimal_kit_react||[]).push([[7581],{62720:(e,t,n)=>{n.d(t,{Z:()=>l});var r=n(66934),i=n(20890),o=n(5977),a=n(80184);const s=(0,r.ZP)("div")((e=>{let{theme:t}=e;return{height:"100%",display:"flex",textAlign:"center",alignItems:"center",flexDirection:"column",justifyContent:"center",padding:t.spacing(8,2)}}));function l(e){let{title:t,description:n,img:r,...l}=e;return(0,a.jsxs)(s,{...l,children:[(0,a.jsx)(o.Z,{disabledEffect:!0,visibleByDefault:!0,alt:"empty content",src:r||"/assets/illustrations/illustration_empty_content.svg",sx:{height:240,mb:3}}),(0,a.jsx)(i.Z,{variant:"h5",gutterBottom:!0,children:t}),n&&(0,a.jsx)(i.Z,{variant:"body2",sx:{color:"text.secondary"},children:n})]})}},18456:(e,t,n)=>{n.d(t,{Z:()=>h});var r=n(697),i=n(20890),o=n(50533),a=n(43504),s=n(93517),l=n(80184);function c(e){let{links:t,activeLast:n=!1,...o}=e;const a=t[t.length-1].name,c=t.map((e=>(0,l.jsx)(d,{link:e},e.name))),h=t.map((e=>(0,l.jsx)("div",{children:e.name!==a?(0,l.jsx)(d,{link:e}):(0,l.jsx)(i.Z,{variant:"body2",sx:{maxWidth:260,overflow:"hidden",whiteSpace:"nowrap",color:"text.disabled",textOverflow:"ellipsis"},children:a})},e.name)));return(0,l.jsx)(s.Z,{separator:(0,l.jsx)(r.Z,{component:"span",sx:{width:4,height:4,borderRadius:"50%",bgcolor:"text.disabled"}}),...o,children:n?c:h})}function d(e){let{link:t}=e;const{href:n,name:i,icon:s}=t;return(0,l.jsxs)(o.Z,{variant:"body2",component:a.rU,to:n||"#",sx:{lineHeight:2,display:"flex",alignItems:"center",color:"text.primary","& > div":{display:"inherit"}},children:[s&&(0,l.jsx)(r.Z,{sx:{mr:1,"& svg":{width:20,height:20}},children:s}),i]},i)}function h(e){let{links:t,action:n,heading:a,moreLink:s=[],sx:d,...h}=e;return(0,l.jsxs)(r.Z,{sx:{mb:5,...d},children:[(0,l.jsxs)(r.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,l.jsxs)(r.Z,{sx:{flexGrow:1},children:[(0,l.jsx)(i.Z,{variant:"h4",gutterBottom:!0,children:a}),(0,l.jsx)(c,{links:t,...h})]}),n&&(0,l.jsx)(r.Z,{sx:{flexShrink:0},children:n})]}),(0,l.jsx)(r.Z,{sx:{mt:2},children:"string"===typeof s?(0,l.jsx)(o.Z,{href:s,target:"_blank",rel:"noopener",variant:"body2",children:s}):s.map((e=>(0,l.jsx)(o.Z,{noWrap:!0,href:e,variant:"body2",target:"_blank",rel:"noopener",sx:{display:"table"},children:e},e)))})]})}},52502:(e,t,n)=>{n.d(t,{$W:()=>f,K:()=>j,V7:()=>h,et:()=>s,Nl:()=>b,hM:()=>m});var r=n(35855),i=n(68745),o=n(62720),a=n(80184);function s(e){let{isNotFound:t}=e;return(0,a.jsx)(r.Z,{children:t?(0,a.jsx)(i.Z,{colSpan:12,children:(0,a.jsx)(o.Z,{title:"No Data",sx:{"& span.MuiBox-root":{height:160}}})}):(0,a.jsx)(i.Z,{colSpan:12,sx:{p:0}})})}var l=n(13400),c=n(53026),d=n(51086);function h(e){let{actions:t,open:n,onClose:r,onOpen:i}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.Z,{onClick:i,children:(0,a.jsx)(c.Z,{icon:"eva:more-vertical-fill",width:20,height:20})}),(0,a.jsx)(d.Z,{open:Boolean(n),anchorEl:n,onClose:r,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"},arrow:"right-top",sx:{mt:-1,width:160,"& .MuiMenuItem-root":{px:1,typography:"body2",borderRadius:.75,"& svg":{mr:2,width:20,height:20}}},children:t})]})}var u=n(36314),x=n(47047);function m(e){let{...t}=e;return(0,a.jsx)(r.Z,{...t,sx:{fontFamily:"aptos"},children:(0,a.jsx)(i.Z,{colSpan:12,children:(0,a.jsxs)(u.Z,{spacing:3,direction:"row",alignItems:"center",children:[(0,a.jsx)(x.Z,{variant:"rectangular",width:40,height:40,sx:{borderRadius:1,flexShrink:0}}),(0,a.jsx)(x.Z,{variant:"text",width:"100%",height:20}),(0,a.jsx)(x.Z,{variant:"text",width:160,height:20}),(0,a.jsx)(x.Z,{variant:"text",width:160,height:20}),(0,a.jsx)(x.Z,{variant:"text",width:160,height:20}),(0,a.jsx)(x.Z,{variant:"text",width:160,height:20})]})})})}function f(e){let{emptyRows:t,height:n}=e;return t?(0,a.jsx)(r.Z,{sx:{...n&&{height:n*t}},children:(0,a.jsx)(i.Z,{colSpan:9})}):null}var g=n(56890),p=n(80720),Z=n(697);const v={border:0,margin:-1,padding:0,width:"1px",height:"1px",overflow:"hidden",position:"absolute",whiteSpace:"nowrap",clip:"rect(0 0 0 0)"};function j(e){let{order:t,orderBy:n,rowCount:o=0,headLabel:s,numSelected:l=0,onSort:c,onSelectAllRows:d,sx:h}=e;return(0,a.jsx)(g.Z,{sx:h,children:(0,a.jsx)(r.Z,{children:s.map((e=>(0,a.jsx)(i.Z,{align:e.align||"left",sortDirection:n===e.id&&t,sx:{width:e.width,minWidth:e.minWidth},children:c?(0,a.jsxs)(p.Z,{hideSortIcon:!0,active:n===e.id,direction:n===e.id?t:"asc",onClick:()=>c(e.id),sx:{textTransform:"capitalize"},children:[e.label,n===e.id?(0,a.jsx)(Z.Z,{sx:{...v},children:"desc"===t?"sorted descending":"sorted ascending"}):null]}):e.label},e.id)))})})}var w=n(94454),y=n(20890);function b(e){let{dense:t,actions:n,rowCount:r,numSelected:i,onSelectAllRows:o,sx:s,...l}=e;return(0,a.jsxs)(u.Z,{direction:"row",alignItems:"center",sx:{px:2,top:0,left:8,right:8,zIndex:9,height:58,borderRadius:1,position:"absolute",bgcolor:"primary.lighter",...t&&{pl:1,height:38},...s},...l,children:[(0,a.jsx)(w.Z,{indeterminate:i>0&&i<r,checked:r>0&&i===r,onChange:e=>o(e.target.checked)}),(0,a.jsxs)(y.Z,{variant:"subtitle1",sx:{ml:2,flexGrow:1,color:"primary.main",...t&&{ml:3}},children:[i," selected"]}),n&&n]})}},20096:(e,t,n)=>{n.d(t,{ZP:()=>i,fQ:()=>s,sQ:()=>a});var r=n(72791);function i(e){const[t,n]=(0,r.useState)((null===e||void 0===e?void 0:e.defaultDense)||!1),[i,o]=(0,r.useState)((null===e||void 0===e?void 0:e.defaultOrderBy)||"name"),[a,s]=(0,r.useState)((null===e||void 0===e?void 0:e.defaultOrder)||"asc"),[l,c]=(0,r.useState)((null===e||void 0===e?void 0:e.defaultCurrentPage)||0),[d,h]=(0,r.useState)((null===e||void 0===e?void 0:e.defaultRowsPerPage)||5),[u,x]=(0,r.useState)((null===e||void 0===e?void 0:e.defaultSelected)||[]);return{dense:t,order:a,page:l,setPage:c,orderBy:i,rowsPerPage:d,selected:u,setSelected:x,onSelectRow:e=>{const t=u.indexOf(e);let n=[];-1===t?n=n.concat(u,e):0===t?n=n.concat(u.slice(1)):t===u.length-1?n=n.
1concat(u.slice(0,-1)):t>0&&(n=n.concat(u.slice(0,t),u.slice(t+1))),x(n)},onSelectAllRows:(e,t)=>{x(e?t:[])},onSort:e=>{""!==e&&(s(i===e&&"asc"===a?"desc":"asc"),o(e))},onChangePage:(e,t)=>{c(t)},onChangeDense:e=>{n(e.target.checked)},onChangeRowsPerPage:e=>{h(parseInt(e.target.value,10)),c(0)}}}function o(e,t,n){return t[n]<e[n]?-1:t[n]>e[n]?1:0}function a(e,t){return"desc"===e?(e,n)=>o(e,n,t):(e,n)=>-o(e,n,t)}function s(e,t,n){return e>0?Math.max(0,(1+e)*t-n):0}},77581:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Y});var r=n(53305),i=n(72791),o=n(16871),a=n(43504),s=n(89164),l=n(94294),c=n(57621),d=n(39281),h=n(20068),u=n(13400),x=n(79836),m=n(53382),f=n(697),g=n(67492),p=n(85523),Z=n(9955),v=n(34747),j=n(18829),w=n(38072),y=n(85703),b=n(20096),S=n(25212),D=n(53026),C=n(27578),P=n(18456),k=n(52502),M=n(13915),R=n(13967),B=n(35855),_=n(68745),I=n(94454),N=n(20890),A=n(23786),E=n(22654),X=n(7870),L=n(41758),O=n(5977),T=n(80184);function W(e){let{row:t,selected:n,onEditRow:r,onSelectRow:o,onDeleteRow:a}=e;const s=(0,R.Z)(),{name:l,cover:c,createdAt:d,inventoryType:h,price:u}=t,[x,m]=(0,i.useState)(null),f=()=>{m(null)};return(0,T.jsxs)(B.Z,{hover:!0,selected:n,children:[(0,T.jsx)(_.Z,{padding:"checkbox",children:(0,T.jsx)(I.Z,{checked:n,onClick:o})}),(0,T.jsxs)(_.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,T.jsx)(O.Z,{disabledEffect:!0,alt:l,src:c,sx:{borderRadius:1.5,width:48,height:48,mr:2}}),(0,T.jsx)(N.Z,{variant:"subtitle2",noWrap:!0,children:l})]}),(0,T.jsx)(_.Z,{children:(0,E.Mu)(d)}),(0,T.jsx)(_.Z,{align:"center",children:(0,T.jsx)(L.Z,{variant:"light"===s.palette.mode?"ghost":"filled",color:("out_of_stock"===h?"error":"low_stock"===h&&"warning")||"success",sx:{textTransform:"capitalize"},children:h?(0,M.G)(h):""})}),(0,T.jsx)(_.Z,{align:"right",children:(0,X.e_)(u)}),(0,T.jsx)(_.Z,{align:"right",children:(0,T.jsx)(k.V7,{open:x,onOpen:e=>{m(e.currentTarget)},onClose:f,actions:(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(A.Z,{onClick:()=>{a(),f()},sx:{color:"error.main"},children:[(0,T.jsx)(D.Z,{icon:"eva:trash-2-outline"}),"Delete"]}),(0,T.jsxs)(A.Z,{onClick:()=>{r(),f()},children:[(0,T.jsx)(D.Z,{icon:"eva:edit-fill"}),"Edit"]})]})})})]})}var F=n(36314),z=n(48550),H=n(63466);function G(e){let{filterName:t,onFilterName:n}=e;return(0,T.jsxs)(F.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{py:2.5,px:3},children:[(0,T.jsx)(z.Z,{value:t,onChange:e=>n(e.target.value),placeholder:"Search product...",InputProps:{startAdornment:(0,T.jsx)(H.Z,{position:"start",children:(0,T.jsx)(D.Z,{icon:"eva:search-fill",sx:{color:"text.disabled",width:20,height:20}})})}}),(0,T.jsx)(h.Z,{title:"Filter list",children:(0,T.jsx)(u.Z,{children:(0,T.jsx)(D.Z,{icon:"ic:round-filter-list"})})})]})}const Q=[{id:"name",label:"Product",align:"left"},{id:"createdAt",label:"Create at",align:"left"},{id:"inventoryType",label:"Status",align:"center",width:180},{id:"price",label:"Price",align:"right"},{id:""}];function Y(){const{dense:e,page:t,order:n,orderBy:M,rowsPerPage:R,setPage:B,selected:_,setSelected:I,onSelectRow:N,onSelectAllRows:A,onSort:E,onChangeDense:X,onChangePage:L,onChangeRowsPerPage:O}=(0,b.ZP)({defaultOrderBy:"createdAt"}),{themeStretch:F}=(0,y.Z)(),z=(0,o.s0)(),H=(0,v.I0)(),{products:Y,isLoading:K}=(0,v.v9)((e=>e.product)),[U,V]=(0,i.useState)([]),[$,q]=(0,i.useState)("");(0,i.useEffect)((()=>{H((0,j.Xp)())}),[H]),(0,i.useEffect)((()=>{Y.length&&V(Y)}),[Y]);const J=function(e){let{tableData:t,comparator:n,filterName:r}=e;const i=t.map(((e,t)=>[e,t]));i.sort(((e,t)=>{const r=n(e[0],t[0]);return 0!==r?r:e[1]-t[1]})),t=i.map((e=>e[0])),r&&(t=t.filter((e=>-1!==e.name.toLowerCase().indexOf(r.toLowerCase()))));return t}({tableData:U,comparator:(0,b.sQ)(n,M),filterName:$}),ee=e?60:80,te=!J.length&&!!$||!K&&!J.length;return(0,T.jsx)(S.Z,{title:"Ecommerce: Product List",children:(0,T.jsxs)(s.Z,{maxWidth:!F&&"lg",children:[(0,T.jsx)(P.Z,{heading:"Product List",links:[{name:"Dashboard",href:w.vB.root},{name:"E-Commerce",href:w.vB.eCommerce.root},{name:"Product List"}],action:(0,T.jsx)(l.Z,{variant:"contained",startIcon:(0,T.jsx)(D.Z,{icon:"eva:plus-fill"}),component:a.rU,to:w.vB.eCommerce.new,children:"New Product"})}),(0,T.jsxs)(c.Z,{children:[(0,T.jsx)(G,{filterName:$,onFilterName:e=>{q(e),B(0)}}),(0,T.jsx)(C.Z,{children:(0,T.jsxs)(d.Z,{sx:{minWidth:960,position:"relative"},children:[_.length>0&&(0,T.jsx)(k.Nl,{dense:e,numSelected:_.length,rowCount:U.length,onSelectAllRows:e=>A(e,U.map((e=>e.id))),actions:(0,T.jsx)(h.Z,{title:"Delete",children:(0,T.jsx)(u.Z,{color:"primary",onClick:()=>(e=>{const t=U.filter((t=>!e.includes(t.id)));I([]),V(t)}
1)(_),children:(0,T.jsx)(D.Z,{icon:"eva:trash-2-outline"})})})}),(0,T.jsxs)(x.Z,{size:e?"small":"medium",children:[(0,T.jsx)(k.K,{order:n,orderBy:M,headLabel:Q,rowCount:U.length,numSelected:_.length,onSort:E,onSelectAllRows:e=>A(e,U.map((e=>e.id)))}),(0,T.jsxs)(m.Z,{children:[(K?[...Array(R)]:J).slice(t*R,t*R+R).map(((e,t)=>e?(0,T.jsx)(W,{row:e,selected:_.includes(e.id),onSelectRow:()=>N(e.id),onDeleteRow:()=>(e=>{const t=U.filter((t=>t.id!==e));I([]),V(t)})(e.id),onEditRow:()=>{return t=e.name,void z(w.vB.eCommerce.edit((0,r.o)(t)));var t}},e.id):!te&&(0,T.jsx)(k.hM,{sx:{height:ee}},t))),(0,T.jsx)(k.$W,{height:ee,emptyRows:(0,b.fQ)(t,R,U.length)}),(0,T.jsx)(k.et,{isNotFound:te})]})]})]})}),(0,T.jsxs)(f.Z,{sx:{position:"relative"},children:[(0,T.jsx)(g.Z,{rowsPerPageOptions:[5,10,25],component:"div",count:J.length,rowsPerPage:R,page:t,onPageChange:L,onRowsPerPageChange:O}),(0,T.jsx)(p.Z,{control:(0,T.jsx)(Z.Z,{checked:e,onChange:X}),label:"Dense",sx:{px:3,py:1.5,top:0,position:{md:"absolute"}}})]})]})]})})}},22654:(e,t,n)=>{n.d(t,{DY:()=>l,Mu:()=>o,Pp:()=>s,zM:()=>a});var r=n(16386),i=n(24054);function o(e){return(0,r.Z)(new Date(e),"dd MMMM yyyy")}function a(e){return(0,r.Z)(new Date(e),"dd MMM yyyy HH:mm")}function s(e){return(0,r.Z)(new Date(e),"dd/MM/yyyy hh:mm p")}function l(e){return(0,i.Z)(new Date(e),{addSuffix:!0})}},24054:(e,t,n)=>{n.d(t,{Z:()=>p});var r=n(24408),i=n(27277),o=n(79990),a=n(71786),s=n(38126),l=n(38527),c=n(41049),d=n(8938),h=n(4697),u=n(4522),x=1440,m=2520,f=43200,g=86400;function p(e,t){return(0,u.Z)(1,arguments),function(e,t,n){var p,Z;(0,u.Z)(2,arguments);var v=(0,r.j)(),j=null!==(p=null!==(Z=null===n||void 0===n?void 0:n.locale)&&void 0!==Z?Z:v.locale)&&void 0!==p?p:s.Z;if(!j.formatDistance)throw new RangeError("locale must contain formatDistance property");var w=(0,i.Z)(e,t);if(isNaN(w))throw new RangeError("Invalid time value");var y,b,S=(0,d.Z)((0,c.Z)(n),{addSuffix:Boolean(null===n||void 0===n?void 0:n.addSuffix),comparison:w});w>0?(y=(0,l.Z)(t),b=(0,l.Z)(e)):(y=(0,l.Z)(e),b=(0,l.Z)(t));var D,C=(0,a.Z)(b,y),P=((0,h.Z)(b)-(0,h.Z)(y))/1e3,k=Math.round((C-P)/60);if(k<2)return null!==n&&void 0!==n&&n.includeSeconds?C<5?j.formatDistance("lessThanXSeconds",5,S):C<10?j.formatDistance("lessThanXSeconds",10,S):C<20?j.formatDistance("lessThanXSeconds",20,S):C<40?j.formatDistance("halfAMinute",0,S):C<60?j.formatDistance("lessThanXMinutes",1,S):j.formatDistance("xMinutes",1,S):0===k?j.formatDistance("lessThanXMinutes",1,S):j.formatDistance("xMinutes",k,S);if(k<45)return j.formatDistance("xMinutes",k,S);if(k<90)return j.formatDistance("aboutXHours",1,S);if(k<x){var M=Math.round(k/60);return j.formatDistance("aboutXHours",M,S)}if(k<m)return j.formatDistance("xDays",1,S);if(k<f){var R=Math.round(k/x);return j.formatDistance("xDays",R,S)}if(k<g)return D=Math.round(k/f),j.formatDistance("aboutXMonths",D,S);if((D=(0,o.Z)(b,y))<12){var B=Math.round(k/f);return j.formatDistance("xMonths",B,S)}var _=D%12,I=Math.floor(D/12);return _<3?j.formatDistance("aboutXYears",I,S):_<9?j.formatDistance("overXYears",I,S):j.formatDistance("almostXYears",I+1,S)}(e,Date.now(),t)}},53305:(e,t,n)=>{n.d(t,{o:()=>o});var r=n(29388),i=n(17254);function o(e,t){return void 0===t&&(t={}),function(e,t){return void 0===t&&(t={}),(0,i.B)(e,(0,r.pi)({delimiter:"."},t))}(e,(0,r.pi)({delimiter:"-"},t))}},13915:(e,t,n)=>{n.d(t,{G:()=>s});var r=n(29388),i=n(17254),o=n(48652);function a(e,t){var n=e.toLowerCase();return 0===t?(0,o.l)(n):n}function s(e,t){return void 0===t&&(t={}),(0,i.B)(e,(0,r.pi)({delimiter:" ",transform:a},t))}}}]); 2//# sourceMappingURL=7581.cc1c6ef2.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.