Files
aso/public/client-portal/assets/Index.2400d697.js
2022-05-26 17:35:47 +07:00

4 lines
14 KiB
JavaScript

var Ce=Object.defineProperty,Te=Object.defineProperties;var _e=Object.getOwnPropertyDescriptors;var Y=Object.getOwnPropertySymbols;var $e=Object.prototype.hasOwnProperty,Me=Object.prototype.propertyIsEnumerable;var Q=(e,t,o)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Z=(e,t)=>{for(var o in t||(t={}))$e.call(t,o)&&Q(e,o,t[o]);if(Y)for(var o of Y(t))Me.call(t,o)&&Q(e,o,t[o]);return e},ee=(e,t)=>Te(e,_e(t));import{aq as Ne,h as M,ar as Pe,i as Ie,as as Se,at as ke,au as He,av as Re,aw as we,ax as ze,ay as Ae,u as De,az as Oe,aA as je,aB as Be,r as f,g as I,a as S,s as k,_ as m,m as H,b as R,d as w,e as a,f as z,aC as Fe,l as L,aD as Ee,aE as me,aF as Le,ak as Ue,t as qe,aG as $,ah as Ge,j as h,N as We,T as te,aH as Ke,aI as ae,aJ as oe,aK as ne,aL as re,aM as le,ap as se,V as Ve,D as Je,aN as Xe,O as Ye,aO as Qe}from"./index.a0fea176.js";import{P as Ze}from"./Page.2d85a4f5.js";import{G as B}from"./Grid.88bbcf29.js";import{C as et}from"./Card.c3493c67.js";function tt(e,t){return()=>null}function at(e,t){return()=>null}function ot(e,t,o,n,c){return null}const nt={configure:e=>{console.warn(["MUI: `ClassNameGenerator` import from `@mui/material/utils` is outdated and might cause unexpected issues.","","You should use `import { unstable_ClassNameGenerator } from '@mui/material/className'` instead","","The detail of the issue: https://github.com/mui/material-ui/issues/30011#issuecomment-1024993401","","The updated documentation: https://mui.com/guides/classname-generator/"].join(`
`)),Ne.configure(e)}};var rt=Object.freeze(Object.defineProperty({__proto__:null,unstable_ClassNameGenerator:nt,capitalize:M,createChainedFunction:Pe,createSvgIcon:Ie,debounce:Se,deprecatedPropType:tt,isMuiElement:ke,ownerDocument:He,ownerWindow:Re,requirePropFactory:at,setRef:we,unstable_useEnhancedEffect:ze,unstable_useId:Ae,unsupportedProp:ot,useControlled:De,useEventCallback:Oe,useForkRef:je,useIsFocusVisible:Be},Symbol.toStringTag,{value:"Module"}));const lt=f.exports.createContext();var he=lt;function st(e){return I("MuiTable",e)}S("MuiTable",["root","stickyHeader"]);const it=["className","component","padding","size","stickyHeader"],ct=e=>{const{classes:t,stickyHeader:o}=e;return w({root:["root",o&&"stickyHeader"]},st,t)},dt=k("table",{name:"MuiTable",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.stickyHeader&&t.stickyHeader]}})(({theme:e,ownerState:t})=>m({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":m({},e.typography.body2,{padding:e.spacing(2),color:(e.vars||e).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},t.stickyHeader&&{borderCollapse:"separate"})),ie="table",ut=f.exports.forwardRef(function(t,o){const n=H({props:t,name:"MuiTable"}),{className:c,component:l=ie,padding:u="normal",size:d="medium",stickyHeader:i=!1}=n,y=R(n,it),b=m({},n,{component:l,padding:u,size:d,stickyHeader:i}),x=ct(b),A=f.exports.useMemo(()=>({padding:u,size:d,stickyHeader:i}),[u,d,i]);return a(he.Provider,{value:A,children:a(dt,m({as:l,role:l===ie?null:"table",ref:o,className:z(x.root,c),ownerState:b},y))})});var ce=ut;const pt=f.exports.createContext();var U=pt;function gt(e){return I("MuiTableBody",e)}S("MuiTableBody",["root"]);const mt=["className","component"],ht=e=>{const{classes:t}=e;return w({root:["root"]},gt,t)},ft=k("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-row-group"}),bt={variant:"body"},de="tbody",vt=f.exports.forwardRef(function(t,o){const n=H({props:t,name:"MuiTableBody"}),{className:c,component:l=de}=n,u=R(n,mt),d=m({},n,{component:l}),i=ht(d);return a(U.Provider,{value:bt,children:a(ft,m({className:z(i.root,c),as:l,ref:o,role:l===de?null:"rowgroup",ownerState:d},u))})});var F=vt;function yt(e){return I("MuiTableCell",e)}const xt=S("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]);var Ct=xt;const Tt=["align","className","component","padding","scope","size","sortDirection","variant"],_t=e=>{const{classes:t,variant:o,align:n,padding:c,size:l,stickyHeader:u}=e,d={root:["root",o,u&&"stickyHeader",n!=="inherit"&&`align${M(n)}`,c!=="normal"&&`padding${M(c)}`,`size${M(l)}`]};return w(d,yt,t)},$t=k("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,t[o.variant],t[`size${M(o.size)}`],o.padding!=="normal"&&t[`padding${M(o.padding)}`],o.align!=="inherit"&&t[`align${M(o.align)}`],o.stickyHeader&&t.stickyHeader]}})(({theme:e,ownerState:t})=>m({},e.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:`1px solid
${e.palette.mode==="light"?Fe(L(e.palette.divider,1),.88):Ee(L(e.palette.divider,1),.68)}`,textAlign:"left",padding:16},t.variant==="head"&&{color:e.palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium},t.variant==="body"&&{color:e.palette.text.primary},t.variant==="footer"&&{color:e.palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)},t.size==="small"&&{padding:"6px 16px",[`&.${Ct.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},t.padding==="checkbox"&&{width:48,padding:"0 0 0 4px"},t.padding==="none"&&{padding:0},t.align==="left"&&{textAlign:"left"},t.align==="center"&&{textAlign:"center"},t.align==="right"&&{textAlign:"right",flexDirection:"row-reverse"},t.align==="justify"&&{textAlign:"justify"},t.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:e.palette.background.default})),Mt=f.exports.forwardRef(function(t,o){const n=H({props:t,name:"MuiTableCell"}),{align:c="inherit",className:l,component:u,padding:d,scope:i,size:y,sortDirection:b,variant:x}=n,A=R(n,Tt),v=f.exports.useContext(he),_=f.exports.useContext(U),D=_&&_.variant==="head";let N;u?N=u:N=D?"th":"td";let O=i;!O&&D&&(O="col");const j=x||_&&_.variant,E=m({},n,{align:c,component:N,padding:d||(v&&v.padding?v.padding:"normal"),size:y||(v&&v.size?v.size:"medium"),sortDirection:b,stickyHeader:j==="head"&&v&&v.stickyHeader,variant:j}),W=_t(E);let C=null;return b&&(C=b==="asc"?"ascending":"descending"),a($t,m({as:N,ref:o,className:z(W.root,l),"aria-sort":C,scope:O,ownerState:E},A))});var r=Mt;function Nt(e){return I("MuiTableContainer",e)}S("MuiTableContainer",["root"]);const Pt=["className","component"],It=e=>{const{classes:t}=e;return w({root:["root"]},Nt,t)},St=k("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(e,t)=>t.root})({width:"100%",overflowX:"auto"}),kt=f.exports.forwardRef(function(t,o){const n=H({props:t,name:"MuiTableContainer"}),{className:c,component:l="div"}=n,u=R(n,Pt),d=m({},n,{component:l}),i=It(d);return a(St,m({ref:o,as:l,className:z(i.root,c),ownerState:d},u))});var Ht=kt;function Rt(e){return I("MuiTableHead",e)}S("MuiTableHead",["root"]);const wt=["className","component"],zt=e=>{const{classes:t}=e;return w({root:["root"]},Rt,t)},At=k("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-header-group"}),Dt={variant:"head"},ue="thead",Ot=f.exports.forwardRef(function(t,o){const n=H({props:t,name:"MuiTableHead"}),{className:c,component:l=ue}=n,u=R(n,wt),d=m({},n,{component:l}),i=zt(d);return a(U.Provider,{value:Dt,children:a(At,m({as:l,className:z(i.root,c),ref:o,role:l===ue?null:"rowgroup",ownerState:d},u))})});var jt=Ot;function Bt(e){return I("MuiTableRow",e)}const Ft=S("MuiTableRow",["root","selected","hover","head","footer"]);var pe=Ft;const Et=["className","component","hover","selected"],Lt=e=>{const{classes:t,selected:o,hover:n,head:c,footer:l}=e;return w({root:["root",o&&"selected",n&&"hover",c&&"head",l&&"footer"]},Bt,t)},Ut=k("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:o}=e;return[t.root,o.head&&t.head,o.footer&&t.footer]}})(({theme:e})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${pe.hover}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${pe.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:L(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:L(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)}}})),ge="tr",qt=f.exports.forwardRef(function(t,o){const n=H({props:t,name:"MuiTableRow"}),{className:c,component:l=ge,hover:u=!1,selected:d=!1}=n,i=R(n,Et),y=f.exports.useContext(U),b=m({},n,{component:l,hover:u,selected:d,head:y&&y.variant==="head",footer:y&&y.variant==="footer"}),x=Lt(b);return a(Ut,m({as:l,ref:o,className:z(x.root,c),role:l===ge?null:"row",ownerState:b},i))});var T=qt,K={},q={exports:{}};(function(e){function t(o){return o&&o.__esModule?o:{default:o}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(q);var G={},Gt=me(rt);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=Gt})(G);var V=me(Le),Wt=q.exports;Object.defineProperty(K,"__esModule",{value:!0});var fe=K.default=void 0,Kt=Wt(G),Vt=V,Jt=(0,Kt.default)((0,Vt.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown");fe=K.default=Jt;var J={},Xt=q.exports;Object.defineProperty(J,"__esModule",{value:!0});var be=J.default=void 0,Yt=Xt(G),Qt=V,Zt=(0,Yt.default)((0,Qt.jsx)("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"KeyboardArrowRight");be=J.default=Zt;var X={},ea=q.exports;Object.defineProperty(X,"__esModule",{value:!0});var ve=X.default=void 0,ta=ea(G),aa=V,oa=(0,ta.default)((0,aa.jsx)("path",{d:"M5 4v2h14V4H5zm0 10h4v6h6v-6h4l-7-7-7 7z"}),"Publish");ve=X.default=oa;function ca(){const{themeStretch:e}=Ue();qe();function t(s){return ee(Z({},s),{history:[{date:"2020-01-05",customerId:"11091700",amount:3},{date:"2020-01-02",customerId:"Anonymous",amount:1}]})}function o(s){const{row:p}=s,[P,xe]=$.useState(!1);return h($.Fragment,{children:[h(T,{sx:{"& > *":{borderBottom:"unset"}},children:[a(r,{children:a(Je,{"aria-label":"expand row",size:"small",onClick:()=>xe(!P),children:P?a(fe,{}):a(be,{})})}),a(r,{align:"left",children:p.code}),a(r,{align:"left",children:p.name}),a(r,{align:"right",children:p.nik}),a(r,{align:"right",children:p.plan_code}),a(r,{align:"right",children:p.number_of_claim}),a(r,{align:"right",children:p.number_of_families}),a(r,{align:"right",children:a(se,{variant:"outlined",color:"success",size:"small",children:"Active"})})]}),a(T,{children:a(r,{style:{paddingBottom:0,paddingTop:0},colSpan:6,children:a(Xe,{in:P,timeout:"auto",unmountOnExit:!0,children:h(Ye,{sx:{margin:1},children:[a(te,{variant:"h6",gutterBottom:!0,component:"div",children:"History"}),h(ce,{size:"small","aria-label":"purchases",children:[a(jt,{children:h(T,{children:[a(r,{children:"Date"}),a(r,{children:"Customer"}),a(r,{align:"right",children:"Amount"}),a(r,{align:"right",children:"Total price ($)"})]})}),a(F,{children:p.history?p.history.map(g=>h(T,{children:[a(r,{component:"th",scope:"row",children:g==null?void 0:g.date}),a(r,{children:g==null?void 0:g.customerId}),a(r,{align:"right",children:g==null?void 0:g.amount}),a(r,{align:"right",children:Math.round((g==null?void 0:g.amount)*1e3*100)/100})]},g==null?void 0:g.date)):a(T,{children:a(r,{colSpan:8,children:"No Data"})})})]})]})})})})]})}const[n,c]=$.useState(!0),[l,u]=$.useState([]),d=async()=>{c(!0);const s=await Qe.get("/members");c(!1),u(s.data.map(t))};f.exports.useEffect(()=>{d()},[]);const i={fontWeight:"bold"},y=48,b=8,x={PaperProps:{style:{maxHeight:y*4.5+b,width:250}}},A=["PLAN001","PLAN002","PLAN003","PLAN004","PLAN005"];function v(s,p,P){return{fontWeight:p.indexOf(s)===-1?P.typography.fontWeightRegular:P.typography.fontWeightMedium}}const _=Ge(),[D,N]=$.useState([]),O=s=>{const{target:{value:p}}=s;N(typeof p=="string"?p.split(","):p)},[j,E]=$.useState([]),W=s=>{const{target:{value:p}}=s;E(typeof p=="string"?p.split(","):p)},C=$.useRef(null),ye=s=>{C!=null&&C.current?C.current.click():alert("No file selected")};return a(Ze,{title:"Member List",children:h(We,{maxWidth:e?!1:"xl",children:[a(te,{variant:"h3",component:"h1",paragraph:!0,children:"Member List"}),h(B,{container:!0,spacing:2,sx:{mb:2},justifyContent:"flex-end",children:[a(B,{item:!0,children:a(Ke,{id:"outlined-basic",label:"Search",variant:"outlined",sx:{width:400}})}),a(B,{item:!0,children:h(ae,{sx:{width:200},children:[a(oe,{id:"plan-id-label",children:"PlanID"}),a(ne,{labelId:"plan-id-label",id:"plan-id",multiple:!0,value:D,onChange:O,input:a(re,{label:"PlanID"}),MenuProps:x,children:A.map(s=>a(le,{value:s,style:v(s,D,_),children:s},s))})]})}),a(B,{item:!0,children:h(ae,{sx:{width:200},children:[a(oe,{id:"status-filter-label",children:"Status"}),a(ne,{labelId:"status-filter-label",id:"status-filter",multiple:!0,value:j,onChange:W,input:a(re,{label:"Status"}),MenuProps:x,children:["Active","Suspended"].map(s=>a(le,{value:s,style:v(s,j,_),children:s},s))})]})}),h(B,{item:!0,children:[a("input",{id:"importMember",ref:C,style:{display:"none"},type:"file",accept:".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, text/plain"}),a(se,{variant:"outlined",startIcon:a(ve,{}),sx:{p:1.8},onClick:ye,children:"Import"})]})]}),a(et,{children:a(Ht,{component:Ve,children:h(ce,{"aria-label":"collapsible table",children:[a(F,{children:h(T,{children:[a(r,{style:i,align:"left",children:"Detail"}),a(r,{style:i,align:"left",children:"MemberID"}),a(r,{style:i,align:"left",children:"Name"}),a(r,{style:i,align:"right",children:"NIK"}),a(r,{style:i,align:"right",children:"PlanID"}),a(r,{style:i,align:"right",children:"Claim\xA0(time)"}),a(r,{style:i,align:"right",children:"Family\xA0(person)"}),a(r,{style:i,align:"right",children:"Status"})]})}),n?a(F,{children:a(T,{children:a(r,{colSpan:8,align:"center",children:"Loading"})})}):l.length==0?a(F,{children:a(T,{children:a(r,{colSpan:8,align:"center",children:"No Data"})})}):a(F,{children:l.map(s=>a(o,{row:s},s.code))})]})})})]})})}export{ca as default};