Files
aso/public/hospital-portal/assets/Dashboard.a47c1c02.js
Server D3 Linksehat 1bf608b1ed Server 103 Commit
2024-07-18 16:05:33 +07:00

2 lines
80 KiB
JavaScript

import{H as Eo,r as a,J as At,K as No,M as nt,N as zo,t as O,O as Ho,f as o,p as St,n as wt,s as re,Q as Y,U as ze,q as ut,_ as lt,V as qo,X as et,v as ve,j as c,w as pt,Y as Bt,Z as kt,$ as lo,a0 as Ot,g as It,P as qt,a1 as Vo,a2 as Ko,a3 as Uo,T as C,a4 as zt,a5 as Io,x as Do,a6 as Go,S as D,h as ke,L as ot,a7 as dt,a8 as Xe,a9 as io,aa as Vt,i as Rt,ab as Oe,ac as Dt,y as Ge,B as rt,ad as Yo,ae as Xo,m as Ct,af as jo,ag as st,a as Kt,G as $o,ah as Ht,ai as ct,D as so,aj as Jo,C as Qo,ak as co}from"./index.0bd1b173.js";import{P as Zo}from"./Page.2cb3f593.js";import{r as Ut,i as Gt,a as Yt,G as vt}from"./jsx-runtime_commonjs-proxy.a874f6f0.js";import{P as ko,D as ea,g as ta,K as oa,a as aa,b as Oo,c as Po,L as Xt,d as jt,e as Jt,f as na,l as uo,T as ra,h as la,i as ia,j as po,k as Ft,m as He,n as Ro,o as sa}from"./Label.7aa0a81e.js";import{C as tt}from"./Card.018c951f.js";import{m as _o}from"./jsonToFormData.2e1405f3.js";let it;function To(){if(it)return it;const e=document.createElement("div"),t=document.createElement("div");return t.style.width="10px",t.style.height="1px",e.appendChild(t),e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e),it="reverse",e.scrollLeft>0?it="default":(e.scrollLeft=1,e.scrollLeft===0&&(it="negative")),document.body.removeChild(e),it}function fo(e,t){const n=e.scrollLeft;if(t!=="rtl")return n;switch(To()){case"negative":return e.scrollWidth-e.clientWidth+n;case"reverse":return e.scrollWidth-e.clientWidth-n;default:return n}}function go(e){return typeof e.normalize<"u"?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}function ca(e={}){const{ignoreAccents:t=!0,ignoreCase:n=!0,limit:i,matchFrom:s="any",stringify:f,trim:b=!1}=e;return(h,{inputValue:u,getOptionLabel:P})=>{let T=b?u.trim():u;n&&(T=T.toLowerCase()),t&&(T=go(T));const L=T?h.filter(H=>{let M=(f||P)(H);return n&&(M=M.toLowerCase()),t&&(M=go(M)),s==="start"?M.indexOf(T)===0:M.indexOf(T)>-1}):h;return typeof i=="number"?L.slice(0,i):L}}function Wt(e,t){for(let n=0;n<e.length;n+=1)if(t(e[n]))return n;return-1}const da=ca(),ho=5,ua=e=>{var t;return e.current!==null&&((t=e.current.parentElement)==null?void 0:t.contains(document.activeElement))};function pa(e){const{unstable_isActiveElementInListbox:t=ua,unstable_classNamePrefix:n="Mui",autoComplete:i=!1,autoHighlight:s=!1,autoSelect:f=!1,blurOnSelect:b=!1,clearOnBlur:h=!e.freeSolo,clearOnEscape:u=!1,componentName:P="useAutocomplete",defaultValue:T=e.multiple?[]:null,disableClearable:L=!1,disableCloseOnSelect:H=!1,disabled:M,disabledItemsFocusable:q=!1,disableListWrap:E=!1,filterOptions:$=da,filterSelectedOptions:V=!1,freeSolo:F=!1,getOptionDisabled:W,getOptionLabel:N=l=>{var r;return(r=l.label)!=null?r:l},groupBy:K,handleHomeEndKeys:j=!e.freeSolo,id:X,includeInputInList:ue=!1,inputValue:le,isOptionEqualToValue:y=(l,r)=>l===r,multiple:x=!1,onChange:v,onClose:B,onHighlightChange:J,onInputChange:te,onOpen:Pe,open:Me,openOnFocus:Se=!1,options:U,readOnly:be=!1,selectOnFocus:je=!e.freeSolo,value:we}=e,pe=Eo(X);let ae=N;ae=l=>{const r=N(l);return typeof r!="string"?String(r):r};const Ke=a.exports.useRef(!1),Fe=a.exports.useRef(!0),oe=a.exports.useRef(null),me=a.exports.useRef(null),[Ce,qe]=a.exports.useState(null),[fe,Re]=a.exports.useState(-1),Ve=s?0:-1,ge=a.exports.useRef(Ve),[R,Je]=At({controlled:we,default:T,name:P}),[Q,Ae]=At({controlled:le,default:"",name:P,state:"inputValue"}),[Ie,We]=a.exports.useState(!1),ce=a.exports.useCallback((l,r)=>{if(!(x?R.length<r.length:r!==null)&&!h)return;let A;if(x)A="";else if(r==null)A="";else{const ne=ae(r);A=typeof ne=="string"?ne:""}Q!==A&&(Ae(A),te&&te(l,A,"reset"))},[ae,Q,x,te,Ae,h,R]),[_e,Ue]=At({controlled:Me,default:!1,name:P,state:"open"}),[Be,Qe]=a.exports.useState(!0),Ee=!x&&R!=null&&Q===ae(R),he=_e&&!be,p=he?$(U.filter(l=>!(V&&(x?R:[R]).some(r=>r!==null&&y(l,r)))),{inputValue:Ee&&Be?"":Q,getOptionLabel:ae}):[],d=No({filteredOptions:p,value:R});a.exports.useEffect(()=>{const l=R!==d.value;Ie&&!l||F&&!l||ce(null,R)},[R,ce,Ie,d.value,F]);const g=_e&&p.length>0&&!be,w=nt(l=>{l===-1?oe.current.focus():Ce.querySelector(`[data-tag-index="${l}"]`).focus()});a.exports.useEffect(()=>{x&&fe>R.length-1&&(Re(-1),w(-1))},[R,x,fe,w]);function m(l,r){if(!me.current||l===-1)return-1;let I=l;for(;;){if(r==="next"&&I===p.length||r==="previous"&&I===-1)return-1;const A=me.current.querySelector(`[data-option-index="${I}"]`),ne=q?!1:!A||A.disabled||A.getAttribute("aria-disabled")==="true";if(A&&!A.hasAttribute("tabindex")||ne)I+=r==="next"?1:-1;else return I}}const ee=nt(({event:l,index:r,reason:I="auto"})=>{if(ge.current=r,r===-1?oe.current.removeAttribute("aria-activedescendant"):oe.current.setAttribute("aria-activedescendant",`${pe}-option-${r}`),J&&J(l,r===-1?null:p[r],I),!me.current)return;const A=me.current.querySelector(`[role="option"].${n}-focused`);A&&(A.classList.remove(`${n}-focused`),A.classList.remove(`${n}-focusVisible`));const ne=me.current.parentElement.querySelector('[role="listbox"]');if(!ne)return;if(r===-1){ne.scrollTop=0;return}const $e=me.current.querySelector(`[data-option-index="${r}"]`);if(!!$e&&($e.classList.add(`${n}-focused`),I==="keyboard"&&$e.classList.add(`${n}-focusVisible`),ne.scrollHeight>ne.clientHeight&&I!=="mouse")){const ye=$e,Ye=ne.clientHeight+ne.scrollTop,ro=ye.offsetTop+ye.offsetHeight;ro>Ye?ne.scrollTop=ro-ne.clientHeight:ye.offsetTop-ye.offsetHeight*(K?1.3:0)<ne.scrollTop&&(ne.scrollTop=ye.offsetTop-ye.offsetHeight*(K?1.3:0))}}),S=nt(({event:l,diff:r,direction:I="next",reason:A="auto"})=>{if(!he)return;const $e=m((()=>{const ye=p.length-1;if(r==="reset")return Ve;if(r==="start")return 0;if(r==="end")return ye;const Ye=ge.current+r;return Ye<0?Ye===-1&&ue?-1:E&&ge.current!==-1||Math.abs(r)>1?0:ye:Ye>ye?Ye===ye+1&&ue?-1:E||Math.abs(r)>1?ye:0:Ye})(),I);if(ee({index:$e,reason:A,event:l}),i&&r!=="reset")if($e===-1)oe.current.value=Q;else{const ye=ae(p[$e]);oe.current.value=ye,ye.toLowerCase().indexOf(Q.toLowerCase())===0&&Q.length>0&&oe.current.setSelectionRange(Q.length,ye.length)}}),k=()=>{var l;if(ge.current!==-1&&d.filteredOptions&&d.filteredOptions.length!==p.length&&(x?d.value.every((r,I)=>ae(R[I])===ae(r)):ae((l=d.value)!=null?l:"")===ae(R!=null?R:""))){const r=d.filteredOptions[ge.current];if(r&&p.some(A=>ae(A)===ae(r)))return!0}return!1},de=a.exports.useCallback(()=>{if(!he||k())return;const l=x?R[0]:R;if(p.length===0||l==null){S({diff:"reset"});return}if(!!me.current){if(l!=null){const r=p[ge.current];if(x&&r&&Wt(R,A=>y(r,A))!==-1)return;const I=Wt(p,A=>y(A,l));I===-1?S({diff:"reset"}):ee({index:I});return}if(ge.current>=p.length-1){ee({index:p.length-1});return}ee({index:ge.current})}},[p.length,x?!1:R,V,S,ee,he,Q,x]),_=nt(l=>{zo(me,l),l&&de()});a.exports.useEffect(()=>{de()},[de]);const ie=l=>{_e||(Ue(!0),Qe(!0),Pe&&Pe(l))},Ne=(l,r)=>{!_e||(Ue(!1),B&&B(l,r))},Le=(l,r,I,A)=>{if(x){if(R.length===r.length&&R.every((ne,$e)=>ne===r[$e]))return}else if(R===r)return;v&&v(l,r,I,A),Je(r)},xe=a.exports.useRef(!1),se=(l,r,I="selectOption",A="options")=>{let ne=I,$e=r;if(x){$e=Array.isArray(R)?R.slice():[];const ye=Wt($e,Ye=>y(r,Ye));ye===-1?$e.push(r):A!=="freeSolo"&&($e.splice(ye,1),ne="removeOption")}ce(l,$e),Le(l,$e,ne,{option:r}),!H&&(!l||!l.ctrlKey&&!l.metaKey)&&Ne(l,ne),(b===!0||b==="touch"&&xe.current||b==="mouse"&&!xe.current)&&oe.current.blur()};function De(l,r){if(l===-1)return-1;let I=l;for(;;){if(r==="next"&&I===R.length||r==="previous"&&I===-1)return-1;const A=Ce.querySelector(`[data-tag-index="${I}"]`);if(!A||!A.hasAttribute("tabindex")||A.disabled||A.getAttribute("aria-disabled")==="true")I+=r==="next"?1:-1;else return I}}const _t=(l,r)=>{if(!x)return;Q===""&&Ne(l,"toggleInput");let I=fe;fe===-1?Q===""&&r==="previous"&&(I=R.length-1):(I+=r==="next"?1:-1,I<0&&(I=0),I===R.length&&(I=-1)),I=De(I,r),Re(I),w(I)},$t=l=>{Ke.current=!0,Ae(""),te&&te(l,"","clear"),Le(l,x?[]:null,"clear")},ao=l=>r=>{if(l.onKeyDown&&l.onKeyDown(r),!r.defaultMuiPrevented&&(fe!==-1&&["ArrowLeft","ArrowRight"].indexOf(r.key)===-1&&(Re(-1),w(-1)),r.which!==229))switch(r.key){case"Home":he&&j&&(r.preventDefault(),S({diff:"start",direction:"next",reason:"keyboard",event:r}));break;case"End":he&&j&&(r.preventDefault(),S({diff:"end",direction:"previous",reason:"keyboard",event:r}));break;case"PageUp":r.preventDefault(),S({diff:-ho,direction:"previous",reason:"keyboard",event:r}),ie(r);break;case"PageDown":r.preventDefault(),S({diff:ho,direction:"next",reason:"keyboard",event:r}),ie(r);break;case"ArrowDown":r.preventDefault(),S({diff:1,direction:"next",reason:"keyboard",event:r}),ie(r);break;case"ArrowUp":r.preventDefault(),S({diff:-1,direction:"previous",reason:"keyboard",event:r}),ie(r);break;case"ArrowLeft":_t(r,"previous");break;case"ArrowRight":_t(r,"next");break;case"Enter":if(ge.current!==-1&&he){const I=p[ge.current],A=W?W(I):!1;if(r.preventDefault(),A)return;se(r,I,"selectOption"),i&&oe.current.setSelectionRange(oe.current.value.length,oe.current.value.length)}else F&&Q!==""&&Ee===!1&&(x&&r.preventDefault(),se(r,Q,"createOption","freeSolo"));break;case"Escape":he?(r.preventDefault(),r.stopPropagation(),Ne(r,"escape")):u&&(Q!==""||x&&R.length>0)&&(r.preventDefault(),r.stopPropagation(),$t(r));break;case"Backspace":if(x&&!be&&Q===""&&R.length>0){const I=fe===-1?R.length-1:fe,A=R.slice();A.splice(I,1),Le(r,A,"removeOption",{option:R[I]})}break;case"Delete":if(x&&!be&&Q===""&&R.length>0&&fe!==-1){const I=fe,A=R.slice();A.splice(I,1),Le(r,A,"removeOption",{option:R[I]})}break}},Tt=l=>{We(!0),Se&&!Ke.current&&ie(l)},ft=l=>{if(t(me)){oe.current.focus();return}We(!1),Fe.current=!0,Ke.current=!1,f&&ge.current!==-1&&he?se(l,p[ge.current],"blur"):f&&F&&Q!==""?se(l,Q,"blur","freeSolo"):h&&ce(l,R),Ne(l,"blur")},gt=l=>{const r=l.target.value;Q!==r&&(Ae(r),Qe(!1),te&&te(l,r,"input")),r===""?!L&&!x&&Le(l,null,"clear"):ie(l)},ht=l=>{ee({event:l,index:Number(l.currentTarget.getAttribute("data-option-index")),reason:"mouse"})},bt=()=>{xe.current=!0},xt=l=>{const r=Number(l.currentTarget.getAttribute("data-option-index"));se(l,p[r],"selectOption"),xe.current=!1},Z=l=>r=>{const I=R.slice();I.splice(l,1),Le(r,I,"removeOption",{option:R[l]})},Te=l=>{_e?Ne(l,"toggleInput"):ie(l)},Ze=l=>{l.target.getAttribute("id")!==pe&&l.preventDefault()},Mt=()=>{oe.current.focus(),je&&Fe.current&&oe.current.selectionEnd-oe.current.selectionStart===0&&oe.current.select(),Fe.current=!1},Wo=l=>{(Q===""||!_e)&&Te(l)};let Lt=F&&Q.length>0;Lt=Lt||(x?R.length>0:R!==null);let no=p;return K&&(no=p.reduce((l,r,I)=>{const A=K(r);return l.length>0&&l[l.length-1].group===A?l[l.length-1].options.push(r):l.push({key:I,index:I,group:A,options:[r]}),l},[])),M&&Ie&&ft(),{getRootProps:(l={})=>O({"aria-owns":g?`${pe}-listbox`:null},l,{onKeyDown:ao(l),onMouseDown:Ze,onClick:Mt}),getInputLabelProps:()=>({id:`${pe}-label`,htmlFor:pe}),getInputProps:()=>({id:pe,value:Q,onBlur:ft,onFocus:Tt,onChange:gt,onMouseDown:Wo,"aria-activedescendant":he?"":null,"aria-autocomplete":i?"both":"list","aria-controls":g?`${pe}-listbox`:void 0,"aria-expanded":g,autoComplete:"off",ref:oe,autoCapitalize:"none",spellCheck:"false",role:"combobox"}),getClearProps:()=>({tabIndex:-1,onClick:$t}),getPopupIndicatorProps:()=>({tabIndex:-1,onClick:Te}),getTagProps:({index:l})=>O({key:l,"data-tag-index":l,tabIndex:-1},!be&&{onDelete:Z(l)}),getListboxProps:()=>({role:"listbox",id:`${pe}-listbox`,"aria-labelledby":`${pe}-label`,ref:_,onMouseDown:l=>{l.preventDefault()}}),getOptionProps:({index:l,option:r})=>{const I=(x?R:[R]).some(ne=>ne!=null&&y(r,ne)),A=W?W(r):!1;return{key:ae(r),tabIndex:-1,role:"option",id:`${pe}-option-${l}`,onMouseOver:ht,onClick:xt,onTouchStart:bt,"data-option-index":l,"aria-disabled":A,"aria-selected":I}},id:pe,inputValue:Q,value:R,dirty:Lt,popupOpen:he,focused:Ie||fe!==-1,anchorEl:Ce,setAnchorEl:qe,focusedTag:fe,groupedOptions:no}}const fa=Ho(o("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function ga(e){return wt("MuiChip",e)}const ha=St("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),G=ha,ba=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],xa=e=>{const{classes:t,disabled:n,size:i,color:s,iconColor:f,onDelete:b,clickable:h,variant:u}=e,P={root:["root",u,n&&"disabled",`size${Y(i)}`,`color${Y(s)}`,h&&"clickable",h&&`clickableColor${Y(s)}`,b&&"deletable",b&&`deletableColor${Y(s)}`,`${u}${Y(s)}`],label:["label",`label${Y(i)}`],avatar:["avatar",`avatar${Y(i)}`,`avatarColor${Y(s)}`],icon:["icon",`icon${Y(i)}`,`iconColor${Y(f)}`],deleteIcon:["deleteIcon",`deleteIcon${Y(i)}`,`deleteIconColor${Y(s)}`,`deleteIcon${Y(u)}Color${Y(s)}`]};return pt(P,ga,t)},va=re("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{color:i,iconColor:s,clickable:f,onDelete:b,size:h,variant:u}=n;return[{[`& .${G.avatar}`]:t.avatar},{[`& .${G.avatar}`]:t[`avatar${Y(h)}`]},{[`& .${G.avatar}`]:t[`avatarColor${Y(i)}`]},{[`& .${G.icon}`]:t.icon},{[`& .${G.icon}`]:t[`icon${Y(h)}`]},{[`& .${G.icon}`]:t[`iconColor${Y(s)}`]},{[`& .${G.deleteIcon}`]:t.deleteIcon},{[`& .${G.deleteIcon}`]:t[`deleteIcon${Y(h)}`]},{[`& .${G.deleteIcon}`]:t[`deleteIconColor${Y(i)}`]},{[`& .${G.deleteIcon}`]:t[`deleteIcon${Y(u)}Color${Y(i)}`]},t.root,t[`size${Y(h)}`],t[`color${Y(i)}`],f&&t.clickable,f&&i!=="default"&&t[`clickableColor${Y(i)})`],b&&t.deletable,b&&i!=="default"&&t[`deletableColor${Y(i)}`],t[u],t[`${u}${Y(i)}`]]}})(({theme:e,ownerState:t})=>{const n=ze(e.palette.text.primary,.26),i=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return O({maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"default",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${G.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${G.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:i,fontSize:e.typography.pxToRem(12)},[`& .${G.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${G.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${G.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${G.icon}`]:O({marginLeft:5,marginRight:-6},t.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},t.iconColor===t.color&&O({color:e.vars?e.vars.palette.Chip.defaultIconColor:i},t.color!=="default"&&{color:"inherit"})),[`& .${G.deleteIcon}`]:O({WebkitTapHighlightColor:"transparent",color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.26)`:n,fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.4)`:ze(n,.4)}},t.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},t.color!=="default"&&{color:e.vars?`rgba(${e.vars.palette[t.color].contrastTextChannel} / 0.7)`:ze(e.palette[t.color].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[t.color].contrastText}})},t.size==="small"&&{height:24},t.color!=="default"&&{backgroundColor:(e.vars||e).palette[t.color].main,color:(e.vars||e).palette[t.color].contrastText},t.onDelete&&{[`&.${G.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:ze(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},t.onDelete&&t.color!=="default"&&{[`&.${G.focusVisible}`]:{backgroundColor:(e.vars||e).palette[t.color].dark}})},({theme:e,ownerState:t})=>O({},t.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:ze(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)},[`&.${G.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:ze(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)},"&:active":{boxShadow:(e.vars||e).shadows[1]}},t.clickable&&t.color!=="default"&&{[`&:hover, &.${G.focusVisible}`]:{backgroundColor:(e.vars||e).palette[t.color].dark}}),({theme:e,ownerState:t})=>O({},t.variant==="outlined"&&{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${G.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${G.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${G.avatar}`]:{marginLeft:4},[`& .${G.avatarSmall}`]:{marginLeft:2},[`& .${G.icon}`]:{marginLeft:4},[`& .${G.iconSmall}`]:{marginLeft:2},[`& .${G.deleteIcon}`]:{marginRight:5},[`& .${G.deleteIconSmall}`]:{marginRight:3}},t.variant==="outlined"&&t.color!=="default"&&{color:(e.vars||e).palette[t.color].main,border:`1px solid ${e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.7)`:ze(e.palette[t.color].main,.7)}`,[`&.${G.clickable}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:ze(e.palette[t.color].main,e.palette.action.hoverOpacity)},[`&.${G.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.focusOpacity})`:ze(e.palette[t.color].main,e.palette.action.focusOpacity)},[`& .${G.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.7)`:ze(e.palette[t.color].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[t.color].main}}})),ma=re("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:i}=n;return[t.label,t[`label${Y(i)}`]]}})(({ownerState:e})=>O({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},e.size==="small"&&{paddingLeft:8,paddingRight:8}));function bo(e){return e.key==="Backspace"||e.key==="Delete"}const Ca=a.exports.forwardRef(function(t,n){const i=ut({props:t,name:"MuiChip"}),{avatar:s,className:f,clickable:b,color:h="default",component:u,deleteIcon:P,disabled:T=!1,icon:L,label:H,onClick:M,onDelete:q,onKeyDown:E,onKeyUp:$,size:V="medium",variant:F="filled",tabIndex:W,skipFocusWhenDisabled:N=!1}=i,K=lt(i,ba),j=a.exports.useRef(null),X=qo(j,n),ue=U=>{U.stopPropagation(),q&&q(U)},le=U=>{U.currentTarget===U.target&&bo(U)&&U.preventDefault(),E&&E(U)},y=U=>{U.currentTarget===U.target&&(q&&bo(U)?q(U):U.key==="Escape"&&j.current&&j.current.blur()),$&&$(U)},x=b!==!1&&M?!0:b,v=x||q?et:u||"div",B=O({},i,{component:v,disabled:T,size:V,color:h,iconColor:a.exports.isValidElement(L)&&L.props.color||h,onDelete:!!q,clickable:x,variant:F}),J=xa(B),te=v===et?O({component:u||"div",focusVisibleClassName:J.focusVisible},q&&{disableRipple:!0}):{};let Pe=null;q&&(Pe=P&&a.exports.isValidElement(P)?a.exports.cloneElement(P,{className:ve(P.props.className,J.deleteIcon),onClick:ue}):o(fa,{className:ve(J.deleteIcon),onClick:ue}));let Me=null;s&&a.exports.isValidElement(s)&&(Me=a.exports.cloneElement(s,{className:ve(J.avatar,s.props.className)}));let Se=null;return L&&a.exports.isValidElement(L)&&(Se=a.exports.cloneElement(L,{className:ve(J.icon,L.props.className)})),c(va,O({as:v,className:ve(J.root,f),disabled:x&&T?!0:void 0,onClick:M,onKeyDown:le,onKeyUp:y,ref:X,tabIndex:N&&T?-1:W,ownerState:B},te,K,{children:[Me||Se,o(ma,{className:ve(J.label),ownerState:B,children:H}),Pe]}))}),ya=Ca;function Sa(e){return wt("MuiAutocomplete",e)}const wa=St("MuiAutocomplete",["root","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]),z=wa;var xo,vo;const Ia=["autoComplete","autoHighlight","autoSelect","blurOnSelect","ChipProps","className","clearIcon","clearOnBlur","clearOnEscape","clearText","closeText","componentsProps","defaultValue","disableClearable","disableCloseOnSelect","disabled","disabledItemsFocusable","disableListWrap","disablePortal","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","fullWidth","getLimitTagsText","getOptionDisabled","getOptionLabel","isOptionEqualToValue","groupBy","handleHomeEndKeys","id","includeInputInList","inputValue","limitTags","ListboxComponent","ListboxProps","loading","loadingText","multiple","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","PaperComponent","PopperComponent","popupIcon","readOnly","renderGroup","renderInput","renderOption","renderTags","selectOnFocus","size","slotProps","value"],Da=e=>{const{classes:t,disablePortal:n,focused:i,fullWidth:s,hasClearIcon:f,hasPopupIcon:b,inputFocused:h,popupOpen:u,size:P}=e,T={root:["root",i&&"focused",s&&"fullWidth",f&&"hasClearIcon",b&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",h&&"inputFocused"],tag:["tag",`tagSize${Y(P)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",u&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return pt(T,Sa,t)},$a=re("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{fullWidth:i,hasClearIcon:s,hasPopupIcon:f,inputFocused:b,size:h}=n;return[{[`& .${z.tag}`]:t.tag},{[`& .${z.tag}`]:t[`tagSize${Y(h)}`]},{[`& .${z.inputRoot}`]:t.inputRoot},{[`& .${z.input}`]:t.input},{[`& .${z.input}`]:b&&t.inputFocused},t.root,i&&t.fullWidth,f&&t.hasPopupIcon,s&&t.hasClearIcon]}})(({ownerState:e})=>O({[`&.${z.focused} .${z.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${z.clearIndicator}`]:{visibility:"visible"}}},e.fullWidth&&{width:"100%"},{[`& .${z.tag}`]:O({margin:3,maxWidth:"calc(100% - 6px)"},e.size==="small"&&{margin:2,maxWidth:"calc(100% - 4px)"}),[`& .${z.inputRoot}`]:{flexWrap:"wrap",[`.${z.hasPopupIcon}&, .${z.hasClearIcon}&`]:{paddingRight:26+4},[`.${z.hasPopupIcon}.${z.hasClearIcon}&`]:{paddingRight:52+4},[`& .${z.input}`]:{width:0,minWidth:30}},[`& .${Bt.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${Bt.root}.${kt.sizeSmall}`]:{[`& .${Bt.input}`]:{padding:"2px 4px 3px 0"}},[`& .${lo.root}`]:{padding:9,[`.${z.hasPopupIcon}&, .${z.hasClearIcon}&`]:{paddingRight:26+4+9},[`.${z.hasPopupIcon}.${z.hasClearIcon}&`]:{paddingRight:52+4+9},[`& .${z.input}`]:{padding:"7.5px 4px 7.5px 6px"},[`& .${z.endAdornment}`]:{right:9}},[`& .${lo.root}.${kt.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${z.input}`]:{padding:"2.5px 4px 2.5px 6px"}},[`& .${Ot.root}`]:{paddingTop:19,paddingLeft:8,[`.${z.hasPopupIcon}&, .${z.hasClearIcon}&`]:{paddingRight:26+4+9},[`.${z.hasPopupIcon}.${z.hasClearIcon}&`]:{paddingRight:52+4+9},[`& .${Ot.input}`]:{padding:"7px 4px"},[`& .${z.endAdornment}`]:{right:9}},[`& .${Ot.root}.${kt.sizeSmall}`]:{paddingBottom:1,[`& .${Ot.input}`]:{padding:"2.5px 4px"}},[`& .${kt.hiddenLabel}`]:{paddingTop:8},[`& .${z.input}`]:O({flexGrow:1,textOverflow:"ellipsis",opacity:0},e.inputFocused&&{opacity:1})})),ka=re("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(e,t)=>t.endAdornment})({position:"absolute",right:0,top:"calc(50% - 14px)"}),Oa=re(It,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(e,t)=>t.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),Pa=re(It,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:({ownerState:e},t)=>O({},t.popupIndicator,e.popupOpen&&t.popupIndicatorOpen)})(({ownerState:e})=>O({padding:2,marginRight:-2},e.popupOpen&&{transform:"rotate(180deg)"})),Ra=re(ko,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${z.option}`]:t.option},t.popper,n.disablePortal&&t.popperDisablePortal]}})(({theme:e,ownerState:t})=>O({zIndex:(e.vars||e).zIndex.modal},t.disablePortal&&{position:"absolute"})),_a=re(qt,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(e,t)=>t.paper})(({theme:e})=>O({},e.typography.body1,{overflow:"auto"})),Ta=re("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(e,t)=>t.loading})(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"})),Ma=re("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(e,t)=>t.noOptions})(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"})),La=re("div",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(e,t)=>t.listbox})(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${z.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[e.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${z.focused}`]:{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${z.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:ze(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${z.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:ze(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${z.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:ze(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}}})),Aa=re(Vo,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(e,t)=>t.groupLabel})(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8})),Ba=re("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(e,t)=>t.groupUl})({padding:0,[`& .${z.option}`]:{paddingLeft:24}}),Fa=a.exports.forwardRef(function(t,n){var i,s,f,b;const h=ut({props:t,name:"MuiAutocomplete"}),{autoComplete:u=!1,autoHighlight:P=!1,autoSelect:T=!1,blurOnSelect:L=!1,ChipProps:H,className:M,clearIcon:q=xo||(xo=o(Ko,{fontSize:"small"})),clearOnBlur:E=!h.freeSolo,clearOnEscape:$=!1,clearText:V="Clear",closeText:F="Close",componentsProps:W={},defaultValue:N=h.multiple?[]:null,disableClearable:K=!1,disableCloseOnSelect:j=!1,disabled:X=!1,disabledItemsFocusable:ue=!1,disableListWrap:le=!1,disablePortal:y=!1,filterSelectedOptions:x=!1,forcePopupIcon:v="auto",freeSolo:B=!1,fullWidth:J=!1,getLimitTagsText:te=Z=>`+${Z}`,getOptionLabel:Pe=Z=>{var Te;return(Te=Z.label)!=null?Te:Z},groupBy:Me,handleHomeEndKeys:Se=!h.freeSolo,includeInputInList:U=!1,limitTags:be=-1,ListboxComponent:je="ul",ListboxProps:we,loading:pe=!1,loadingText:ae="Loading\u2026",multiple:Ke=!1,noOptionsText:Fe="No options",openOnFocus:oe=!1,openText:me="Open",PaperComponent:Ce=qt,PopperComponent:qe=ko,popupIcon:fe=vo||(vo=o(Uo,{})),readOnly:Re=!1,renderGroup:Ve,renderInput:ge,renderOption:R,renderTags:Je,selectOnFocus:Q=!h.freeSolo,size:Ae="medium",slotProps:Ie={}}=h,We=lt(h,Ia),{getRootProps:ce,getInputProps:_e,getInputLabelProps:Ue,getPopupIndicatorProps:Be,getClearProps:Qe,getTagProps:Ee,getListboxProps:he,getOptionProps:p,value:d,dirty:g,id:w,popupOpen:m,focused:ee,focusedTag:S,anchorEl:k,setAnchorEl:de,inputValue:_,groupedOptions:ie}=pa(O({},h,{componentName:"Autocomplete"})),Ne=!K&&!X&&g&&!Re,Le=(!B||v===!0)&&v!==!1,xe=O({},h,{disablePortal:y,focused:ee,fullWidth:J,hasClearIcon:Ne,hasPopupIcon:Le,inputFocused:S===-1,popupOpen:m,size:Ae}),se=Da(xe);let De;if(Ke&&d.length>0){const Z=Te=>O({className:se.tag,disabled:X},Ee(Te));Je?De=Je(d,Z,xe):De=d.map((Te,Ze)=>o(ya,O({label:Pe(Te),size:Ae},Z({index:Ze}),H)))}if(be>-1&&Array.isArray(De)){const Z=De.length-be;!ee&&Z>0&&(De=De.splice(0,be),De.push(o("span",{className:se.tag,children:te(Z)},De.length)))}const $t=Ve||(Z=>c("li",{children:[o(Aa,{className:se.groupLabel,ownerState:xe,component:"div",children:Z.group}),o(Ba,{className:se.groupUl,ownerState:xe,children:Z.children})]},Z.key)),Tt=R||((Z,Te)=>o("li",O({},Z,{children:Pe(Te)}))),ft=(Z,Te)=>{const Ze=p({option:Z,index:Te});return Tt(O({},Ze,{className:se.option}),Z,{selected:Ze["aria-selected"],index:Te,inputValue:_})},gt=(i=Ie.clearIndicator)!=null?i:W.clearIndicator,ht=(s=Ie.paper)!=null?s:W.paper,bt=(f=Ie.popper)!=null?f:W.popper,xt=(b=Ie.popupIndicator)!=null?b:W.popupIndicator;return c(a.exports.Fragment,{children:[o($a,O({ref:n,className:ve(se.root,M),ownerState:xe},ce(We),{children:ge({id:w,disabled:X,fullWidth:!0,size:Ae==="small"?"small":void 0,InputLabelProps:Ue(),InputProps:O({ref:de,className:se.inputRoot,startAdornment:De},(Ne||Le)&&{endAdornment:c(ka,{className:se.endAdornment,ownerState:xe,children:[Ne?o(Oa,O({},Qe(),{"aria-label":V,title:V,ownerState:xe},gt,{className:ve(se.clearIndicator,gt==null?void 0:gt.className),children:q})):null,Le?o(Pa,O({},Be(),{disabled:X,"aria-label":m?F:me,title:m?F:me,ownerState:xe},xt,{className:ve(se.popupIndicator,xt==null?void 0:xt.className),children:fe})):null]})}),inputProps:O({className:se.input,disabled:X,readOnly:Re},_e())})})),k?o(Ra,O({as:qe,disablePortal:y,style:{width:k?k.clientWidth:null},ownerState:xe,role:"presentation",anchorEl:k,open:m},bt,{className:ve(se.popper,bt==null?void 0:bt.className),children:c(_a,O({ownerState:xe,as:Ce},ht,{className:ve(se.paper,ht==null?void 0:ht.className),children:[pe&&ie.length===0?o(Ta,{className:se.loading,ownerState:xe,children:ae}):null,ie.length===0&&!B&&!pe?o(Ma,{className:se.noOptions,ownerState:xe,role:"presentation",onMouseDown:Z=>{Z.preventDefault()},children:Fe}):null,ie.length>0?o(La,O({as:je,className:se.listbox,ownerState:xe},he(),we,{children:ie.map((Z,Te)=>Me?$t({key:Z.key,group:Z.group,children:Z.options.map((Ze,Mt)=>ft(Ze,Z.index+Mt))}):ft(Z,Te))})):null]}))})):null]})}),Et=Fa,Wa=["className","id"],Ea=e=>{const{classes:t}=e;return pt({root:["root"]},ta,t)},Na=re(C,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:"16px 24px",flex:"0 0 auto"}),za=a.exports.forwardRef(function(t,n){const i=ut({props:t,name:"MuiDialogTitle"}),{className:s,id:f}=i,b=lt(i,Wa),h=i,u=Ea(h),{titleId:P=f}=a.exports.useContext(ea);return o(Na,O({component:"h2",className:ve(u.root,s),ownerState:h,ref:n,variant:"h6",id:P},b))}),Mo=za;function Ha(e){return wt("MuiTab",e)}const qa=St("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),at=qa,Va=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],Ka=e=>{const{classes:t,textColor:n,fullWidth:i,wrapped:s,icon:f,label:b,selected:h,disabled:u}=e,P={root:["root",f&&b&&"labelIcon",`textColor${Y(n)}`,i&&"fullWidth",s&&"wrapped",h&&"selected",u&&"disabled"],iconWrapper:["iconWrapper"]};return pt(P,Ha,t)},Ua=re(et,{name:"MuiTab",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.label&&n.icon&&t.labelIcon,t[`textColor${Y(n.textColor)}`],n.fullWidth&&t.fullWidth,n.wrapped&&t.wrapped]}})(({theme:e,ownerState:t})=>O({},e.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},t.label&&{flexDirection:t.iconPosition==="top"||t.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},t.icon&&t.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${at.iconWrapper}`]:O({},t.iconPosition==="top"&&{marginBottom:6},t.iconPosition==="bottom"&&{marginTop:6},t.iconPosition==="start"&&{marginRight:e.spacing(1)},t.iconPosition==="end"&&{marginLeft:e.spacing(1)})},t.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${at.selected}`]:{opacity:1},[`&.${at.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}},t.textColor==="primary"&&{color:(e.vars||e).palette.text.secondary,[`&.${at.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${at.disabled}`]:{color:(e.vars||e).palette.text.disabled}},t.textColor==="secondary"&&{color:(e.vars||e).palette.text.secondary,[`&.${at.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${at.disabled}`]:{color:(e.vars||e).palette.text.disabled}},t.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},t.wrapped&&{fontSize:e.typography.pxToRem(12)})),Ga=a.exports.forwardRef(function(t,n){const i=ut({props:t,name:"MuiTab"}),{className:s,disabled:f=!1,disableFocusRipple:b=!1,fullWidth:h,icon:u,iconPosition:P="top",indicator:T,label:L,onChange:H,onClick:M,onFocus:q,selected:E,selectionFollowsFocus:$,textColor:V="inherit",value:F,wrapped:W=!1}=i,N=lt(i,Va),K=O({},i,{disabled:f,disableFocusRipple:b,selected:E,icon:!!u,iconPosition:P,label:!!L,fullWidth:h,textColor:V,wrapped:W}),j=Ka(K),X=u&&L&&a.exports.isValidElement(u)?a.exports.cloneElement(u,{className:ve(j.iconWrapper,u.props.className)}):u,ue=y=>{!E&&H&&H(y,F),M&&M(y)},le=y=>{$&&!E&&H&&H(y,F),q&&q(y)};return c(Ua,O({focusRipple:!b,className:ve(j.root,s),ref:n,role:"tab","aria-selected":E,disabled:f,onClick:ue,onFocus:le,ownerState:K,tabIndex:E?0:-1},N,{children:[P==="top"||P==="start"?c(a.exports.Fragment,{children:[X,L]}):c(a.exports.Fragment,{children:[L,X]}),T]}))}),mt=Ga;function Ya(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function Xa(e,t,n,i={},s=()=>{}){const{ease:f=Ya,duration:b=300}=i;let h=null;const u=t[e];let P=!1;const T=()=>{P=!0},L=H=>{if(P){s(new Error("Animation cancelled"));return}h===null&&(h=H);const M=Math.min(1,(H-h)/b);if(t[e]=f(M)*(n-u)+u,M>=1){requestAnimationFrame(()=>{s(null)});return}requestAnimationFrame(L)};return u===n?(s(new Error("Element already at target position")),T):(requestAnimationFrame(L),T)}const ja=["onChange"],Ja={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function Qa(e){const{onChange:t}=e,n=lt(e,ja),i=a.exports.useRef(),s=a.exports.useRef(null),f=()=>{i.current=s.current.offsetHeight-s.current.clientHeight};return a.exports.useEffect(()=>{const b=zt(()=>{const u=i.current;f(),u!==i.current&&t(i.current)}),h=Io(s.current);return h.addEventListener("resize",b),()=>{b.clear(),h.removeEventListener("resize",b)}},[t]),a.exports.useEffect(()=>{f(),t(i.current)},[t]),o("div",O({style:Ja,ref:s},n))}function Za(e){return wt("MuiTabScrollButton",e)}const en=St("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),tn=en;var mo,Co;const on=["className","direction","orientation","disabled"],an=e=>{const{classes:t,orientation:n,disabled:i}=e;return pt({root:["root",n,i&&"disabled"]},Za,t)},nn=re(et,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.orientation&&t[n.orientation]]}})(({ownerState:e})=>O({width:40,flexShrink:0,opacity:.8,[`&.${tn.disabled}`]:{opacity:0}},e.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${e.isRtl?-90:90}deg)`}})),rn=a.exports.forwardRef(function(t,n){const i=ut({props:t,name:"MuiTabScrollButton"}),{className:s,direction:f}=i,b=lt(i,on),u=Do().direction==="rtl",P=O({isRtl:u},i),T=an(P);return o(nn,O({component:"div",className:ve(T.root,s),ref:n,role:null,ownerState:P,tabIndex:null},b,{children:f==="left"?mo||(mo=o(oa,{fontSize:"small"})):Co||(Co=o(aa,{fontSize:"small"}))}))}),ln=rn;function sn(e){return wt("MuiTabs",e)}const cn=St("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Nt=cn,dn=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],yo=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,So=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,Pt=(e,t,n)=>{let i=!1,s=n(e,t);for(;s;){if(s===e.firstChild){if(i)return;i=!0}const f=s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||f)s=n(e,s);else{s.focus();return}}},un=e=>{const{vertical:t,fixed:n,hideScrollbar:i,scrollableX:s,scrollableY:f,centered:b,scrollButtonsHideMobile:h,classes:u}=e;return pt({root:["root",t&&"vertical"],scroller:["scroller",n&&"fixed",i&&"hideScrollbar",s&&"scrollableX",f&&"scrollableY"],flexContainer:["flexContainer",t&&"flexContainerVertical",b&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",h&&"scrollButtonsHideMobile"],scrollableX:[s&&"scrollableX"],hideScrollbar:[i&&"hideScrollbar"]},sn,u)},pn=re("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Nt.scrollButtons}`]:t.scrollButtons},{[`& .${Nt.scrollButtons}`]:n.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,n.vertical&&t.vertical]}})(({ownerState:e,theme:t})=>O({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},e.vertical&&{flexDirection:"column"},e.scrollButtonsHideMobile&&{[`& .${Nt.scrollButtons}`]:{[t.breakpoints.down("sm")]:{display:"none"}}})),fn=re("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.scroller,n.fixed&&t.fixed,n.hideScrollbar&&t.hideScrollbar,n.scrollableX&&t.scrollableX,n.scrollableY&&t.scrollableY]}})(({ownerState:e})=>O({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},e.fixed&&{overflowX:"hidden",width:"100%"},e.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},e.scrollableX&&{overflowX:"auto",overflowY:"hidden"},e.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),gn=re("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.flexContainer,n.vertical&&t.flexContainerVertical,n.centered&&t.centered]}})(({ownerState:e})=>O({display:"flex"},e.vertical&&{flexDirection:"column"},e.centered&&{justifyContent:"center"})),hn=re("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(e,t)=>t.indicator})(({ownerState:e,theme:t})=>O({position:"absolute",height:2,bottom:0,width:"100%",transition:t.transitions.create()},e.indicatorColor==="primary"&&{backgroundColor:(t.vars||t).palette.primary.main},e.indicatorColor==="secondary"&&{backgroundColor:(t.vars||t).palette.secondary.main},e.vertical&&{height:"100%",width:2,right:0})),bn=re(Qa,{name:"MuiTabs",slot:"ScrollbarSize"})({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),wo={},xn=a.exports.forwardRef(function(t,n){const i=ut({props:t,name:"MuiTabs"}),s=Do(),f=s.direction==="rtl",{"aria-label":b,"aria-labelledby":h,action:u,centered:P=!1,children:T,className:L,component:H="div",allowScrollButtonsMobile:M=!1,indicatorColor:q="primary",onChange:E,orientation:$="horizontal",ScrollButtonComponent:V=ln,scrollButtons:F="auto",selectionFollowsFocus:W,TabIndicatorProps:N={},TabScrollButtonProps:K={},textColor:j="primary",value:X,variant:ue="standard",visibleScrollbar:le=!1}=i,y=lt(i,dn),x=ue==="scrollable",v=$==="vertical",B=v?"scrollTop":"scrollLeft",J=v?"top":"left",te=v?"bottom":"right",Pe=v?"clientHeight":"clientWidth",Me=v?"height":"width",Se=O({},i,{component:H,allowScrollButtonsMobile:M,indicatorColor:q,orientation:$,vertical:v,scrollButtons:F,textColor:j,variant:ue,visibleScrollbar:le,fixed:!x,hideScrollbar:x&&!le,scrollableX:x&&!v,scrollableY:x&&v,centered:P&&!x,scrollButtonsHideMobile:!M}),U=un(Se),[be,je]=a.exports.useState(!1),[we,pe]=a.exports.useState(wo),[ae,Ke]=a.exports.useState({start:!1,end:!1}),[Fe,oe]=a.exports.useState({overflow:"hidden",scrollbarWidth:0}),me=new Map,Ce=a.exports.useRef(null),qe=a.exports.useRef(null),fe=()=>{const p=Ce.current;let d;if(p){const w=p.getBoundingClientRect();d={clientWidth:p.clientWidth,scrollLeft:p.scrollLeft,scrollTop:p.scrollTop,scrollLeftNormalized:fo(p,s.direction),scrollWidth:p.scrollWidth,top:w.top,bottom:w.bottom,left:w.left,right:w.right}}let g;if(p&&X!==!1){const w=qe.current.children;if(w.length>0){const m=w[me.get(X)];g=m?m.getBoundingClientRect():null}}return{tabsMeta:d,tabMeta:g}},Re=nt(()=>{const{tabsMeta:p,tabMeta:d}=fe();let g=0,w;if(v)w="top",d&&p&&(g=d.top-p.top+p.scrollTop);else if(w=f?"right":"left",d&&p){const ee=f?p.scrollLeftNormalized+p.clientWidth-p.scrollWidth:p.scrollLeft;g=(f?-1:1)*(d[w]-p[w]+ee)}const m={[w]:g,[Me]:d?d[Me]:0};if(isNaN(we[w])||isNaN(we[Me]))pe(m);else{const ee=Math.abs(we[w]-m[w]),S=Math.abs(we[Me]-m[Me]);(ee>=1||S>=1)&&pe(m)}}),Ve=(p,{animation:d=!0}={})=>{d?Xa(B,Ce.current,p,{duration:s.transitions.duration.standard}):Ce.current[B]=p},ge=p=>{let d=Ce.current[B];v?d+=p:(d+=p*(f?-1:1),d*=f&&To()==="reverse"?-1:1),Ve(d)},R=()=>{const p=Ce.current[Pe];let d=0;const g=Array.from(qe.current.children);for(let w=0;w<g.length;w+=1){const m=g[w];if(d+m[Pe]>p){w===0&&(d=p);break}d+=m[Pe]}return d},Je=()=>{ge(-1*R())},Q=()=>{ge(R())},Ae=a.exports.useCallback(p=>{oe({overflow:null,scrollbarWidth:p})},[]),Ie=()=>{const p={};p.scrollbarSizeListener=x?o(bn,{onChange:Ae,className:ve(U.scrollableX,U.hideScrollbar)}):null;const d=ae.start||ae.end,g=x&&(F==="auto"&&d||F===!0);return p.scrollButtonStart=g?o(V,O({orientation:$,direction:f?"right":"left",onClick:Je,disabled:!ae.start},K,{className:ve(U.scrollButtons,K.className)})):null,p.scrollButtonEnd=g?o(V,O({orientation:$,direction:f?"left":"right",onClick:Q,disabled:!ae.end},K,{className:ve(U.scrollButtons,K.className)})):null,p},We=nt(p=>{const{tabsMeta:d,tabMeta:g}=fe();if(!(!g||!d)){if(g[J]<d[J]){const w=d[B]+(g[J]-d[J]);Ve(w,{animation:p})}else if(g[te]>d[te]){const w=d[B]+(g[te]-d[te]);Ve(w,{animation:p})}}}),ce=nt(()=>{if(x&&F!==!1){const{scrollTop:p,scrollHeight:d,clientHeight:g,scrollWidth:w,clientWidth:m}=Ce.current;let ee,S;if(v)ee=p>1,S=p<d-g-1;else{const k=fo(Ce.current,s.direction);ee=f?k<w-m-1:k>1,S=f?k>1:k<w-m-1}(ee!==ae.start||S!==ae.end)&&Ke({start:ee,end:S})}});a.exports.useEffect(()=>{const p=zt(()=>{Ce.current&&(Re(),ce())}),d=Io(Ce.current);d.addEventListener("resize",p);let g;return typeof ResizeObserver<"u"&&(g=new ResizeObserver(p),Array.from(qe.current.children).forEach(w=>{g.observe(w)})),()=>{p.clear(),d.removeEventListener("resize",p),g&&g.disconnect()}},[Re,ce]);const _e=a.exports.useMemo(()=>zt(()=>{ce()}),[ce]);a.exports.useEffect(()=>()=>{_e.clear()},[_e]),a.exports.useEffect(()=>{je(!0)},[]),a.exports.useEffect(()=>{Re(),ce()}),a.exports.useEffect(()=>{We(wo!==we)},[We,we]),a.exports.useImperativeHandle(u,()=>({updateIndicator:Re,updateScrollButtons:ce}),[Re,ce]);const Ue=o(hn,O({},N,{className:ve(U.indicator,N.className),ownerState:Se,style:O({},we,N.style)}));let Be=0;const Qe=a.exports.Children.map(T,p=>{if(!a.exports.isValidElement(p))return null;const d=p.props.value===void 0?Be:p.props.value;me.set(d,Be);const g=d===X;return Be+=1,a.exports.cloneElement(p,O({fullWidth:ue==="fullWidth",indicator:g&&!be&&Ue,selected:g,selectionFollowsFocus:W,onChange:E,textColor:j,value:d},Be===1&&X===!1&&!p.props.tabIndex?{tabIndex:0}:{}))}),Ee=p=>{const d=qe.current,g=Go(d).activeElement;if(g.getAttribute("role")!=="tab")return;let m=$==="horizontal"?"ArrowLeft":"ArrowUp",ee=$==="horizontal"?"ArrowRight":"ArrowDown";switch($==="horizontal"&&f&&(m="ArrowRight",ee="ArrowLeft"),p.key){case m:p.preventDefault(),Pt(d,g,So);break;case ee:p.preventDefault(),Pt(d,g,yo);break;case"Home":p.preventDefault(),Pt(d,null,yo);break;case"End":p.preventDefault(),Pt(d,null,So);break}},he=Ie();return c(pn,O({className:ve(U.root,L),ownerState:Se,ref:n,as:H},y,{children:[he.scrollButtonStart,he.scrollbarSizeListener,c(fn,{className:U.scroller,ownerState:Se,style:{overflow:Fe.overflow,[v?`margin${f?"Left":"Right"}`:"marginBottom"]:le?void 0:-Fe.scrollbarWidth},ref:Ce,onScroll:_e,children:[o(gn,{"aria-label":b,"aria-labelledby":h,"aria-orientation":$==="vertical"?"vertical":null,className:U.flexContainer,ownerState:Se,onKeyDown:Ee,ref:qe,role:"tablist",children:Qe}),be&&Ue]}),he.scrollButtonEnd]}))}),Lo=xn;var Qt={},vn=Gt.exports;Object.defineProperty(Qt,"__esModule",{value:!0});var Zt=Qt.default=void 0,mn=vn(Ut()),Cn=Yt,yn=(0,mn.default)((0,Cn.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");Zt=Qt.default=yn;const Sn=({title:e,openDialog:t,setOpenDialog:n,content:i,maxWidth:s})=>{const f=()=>{n(!1)};let b="md";return s&&(b=s),c(Oo,{open:t,onClose:f,fullWidth:!0,maxWidth:b,children:[o(Mo,{sx:{backgroundColor:"#19BBBB",color:"#FFF",padding:2},children:c(D,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[e!=null&&e.icon?c(D,{direction:"row",children:[o(ke,{icon:e==null?void 0:e.icon,width:25,height:25,sx:{marginRight:"10px"}}),o(C,{variant:"h6",children:e==null?void 0:e.name})]}):o(C,{variant:"h6",children:e!=null&&e.name?e==null?void 0:e.name:""}),o(It,{sx:{color:"#FFF"},onClick:f,children:o(Zt,{})})]})}),o(Po,{sx:{backgroundColor:"#F9FAFB"},children:i||"Testing Content Dialog"})]})},yt=Sn;function wn({member:e,handleSubmitSuccess:t}){var X,ue,le;const{localeData:n}=a.exports.useContext(ot),[i,s]=a.exports.useState(""),[f,b]=a.exports.useState(0),[h,u]=a.exports.useState(dt(new Date,"yyyy MMM d HH:mm:ss")),[P,T]=a.exports.useState(!1),[L,H]=a.exports.useState([]);a.exports.useEffect(()=>{var y;H((y=e==null?void 0:e.companies)==null?void 0:y.map(x=>({value:x.id,label:x.name})))},[]);const[M,q]=a.exports.useState([]),E=(y,x)=>{const v=x.map(B=>B.value);q(v)};function $(){if(!f&&(W==""||K==""))return Oe(n.txtAlertProvider,{variant:"warning"}),!1;if(i=="")return Oe(n.txtDialogMember4,{variant:"warning"}),!1;if(h=="")return Oe(n.txtDialogMember6,{variant:"warning"}),!1;T(!0);const y={member_id:e.members.id,service_code:i,organization_id:f,organization_name:W,address_provider:K,submission_date:Dt(h,"yyyy-MM-dd HH:mm:ss"),corporate_id_partner:M};Ge.post("/request-log",y).then(x=>{x&&x.data&&x.data.meta&&(setTimeout(()=>{window.location.reload()},1500),Oe(x.data.meta.message,{variant:"success"}),t())}).catch(({response:x})=>{x&&x.data&&x.data.meta&&Oe(x.data.meta.message,{variant:"error"})}).then(()=>{T(!1)})}const[V,F]=a.exports.useState(!1),[W,N]=a.exports.useState(""),[K,j]=a.exports.useState("");return c(D,{direction:"column",spacing:2,children:[c(D,{direction:"row",justifyContent:"end",sx:{marginBottom:2},spacing:2,children:[o(C,{variant:"body2",sx:{color:"#757575"},children:n.txtCreateAt}),o(C,{variant:"body2",sx:{fontWeight:"bold"},children:dt(new Date,"d MMM yyyy")})]}),o(D,{direction:"row",spacing:2,children:c(D,{spacing:2,sx:{width:"100%"},children:[c(C,{variant:"subtitle1",children:[n.txtProvider," *"]}),o(Et,{id:"provider",options:[{name:n.txtAddNew,id:0},...(e==null?void 0:e.providers)||[]],getOptionLabel:y=>y.name||"",value:(e==null?void 0:e.providers.find(y=>y.id===f))||null,onChange:(y,x)=>{(x==null?void 0:x.id)===0?(b(0),F(!0)):(b((x==null?void 0:x.id)||0),F(!1))},renderInput:y=>o(Xe,{...y,label:n.txtProvider,fullWidth:!0})}),V&&c(D,{direction:"column",spacing:1,padding:1,children:[c(C,{variant:"body2",children:[n.txtAddNew," *"]}),o(Xe,{required:!0,label:n.txtName,fullWidth:!0,onChange:y=>N(y.target.value)}),o(Xe,{required:!0,label:n.txtAddress,fullWidth:!0,onChange:y=>j(y.target.value)}),o(Et,{id:"corporate_id_partner",options:L,getOptionLabel:y=>y.label,value:L.filter(y=>M.includes(y.value)),onChange:E,multiple:!0,renderInput:y=>o(Xe,{...y,label:n.txtPatner,fullWidth:!0})})]}),o(io,{style:{color:"red"}})]})}),o(D,{direction:"row",spacing:2,children:c(D,{spacing:2,sx:{width:"100%"},children:[c(C,{variant:"subtitle1",children:[n.txtDialogMember1," *"]}),o(Et,{id:"service_type",options:(e==null?void 0:e.services)||[],getOptionLabel:y=>y.name||"",value:(e==null?void 0:e.services.find(y=>y.service_code===i))||null,onChange:(y,x)=>{s((x==null?void 0:x.service_code)||"")},renderInput:y=>o(Xe,{...y,label:n.txtDialogMember1,fullWidth:!0})}),o(io,{style:{color:"red"}})]})}),o(D,{direction:"row",spacing:2,children:c(D,{spacing:2,sx:{width:"100%"},children:[c(C,{variant:"subtitle1",children:[n.txtDialogMember5," *"]}),o(Xt,{dateAdapter:jt,children:o(Jt,{label:n.txtDialogMember5,value:h,onChange:y=>{u(y)},inputFormat:"dd-MM-yyyy HH:mm",renderInput:y=>o(Xe,{sx:{width:"40%"},...y,required:!0})})})]})}),o(tt,{sx:{p:1,background:"#f4f6f8"},children:c(D,{direction:"row",children:[o(Vt,{src:"",alt:(X=e==null?void 0:e.members.name)!=null?X:"",sx:{marginTop:1,width:48,height:48}}),c(D,{sx:{p:1},children:[o(C,{variant:"body2",children:(ue=e==null?void 0:e.members.name)!=null?ue:""}),o(C,{variant:"body2",sx:{color:"#637381"},children:(le=e==null?void 0:e.members.member_id)!=null?le:""})]})]})}),o(Rt,{variant:"contained",sx:{marginTop:2,p:2,backgroundColor:"#19BBBB"},onClick:()=>{$()},loading:P,children:n.txtDialogMember2})]})}var eo={},In=Gt.exports;Object.defineProperty(eo,"__esModule",{value:!0});var Ao=eo.default=void 0,Dn=In(Ut()),$n=Yt,kn=(0,Dn.default)((0,$n.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown");Ao=eo.default=kn;var to={},On=Gt.exports;Object.defineProperty(to,"__esModule",{value:!0});var Bo=to.default=void 0,Pn=On(Ut()),Rn=Yt,_n=(0,Pn.default)((0,Rn.jsx)("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"KeyboardArrowRight");Bo=to.default=_n;function oo(e,t){var T,L,H,M,q,E,$,V,F;const{localeData:n}=a.exports.useContext(ot),[i,s]=a.exports.useState("request");a.exports.useEffect(()=>{s("detail")},[e]);function f(W,N){s(N)}re(na)(({theme:W})=>({height:10,borderRadius:6,[`&.${uo.colorPrimary}`]:{backgroundColor:W.palette.grey[W.palette.mode==="light"?300:800]},[`& .${uo.bar}`]:{borderRadius:6,background:"linear-gradient(270deg, #19BBBB 38.42%, #FF9565 76.21%, #FE7253 104.02%)"}}));function b(W){const{children:N,value:K,index:j,...X}=W;return o("div",{role:"tabpanel",hidden:K!==j,id:`simple-tabpanel-${j}`,"aria-labelledby":`simple-tab-${j}`,...X,children:K===j&&o(rt,{sx:{p:3},children:o("div",{children:N})})})}const[h,u]=a.exports.useState({}),P=W=>{u(N=>({...N,[W]:!N[W]}))};return o("div",{children:c(rt,{sx:{borderBottom:1,borderColor:"divider"},children:[c(Lo,{value:i,onChange:f,"aria-label":"wrapped label tabs example",children:[o(mt,{value:"detail",label:n.txtDialogMember3}),o(mt,{value:"service",label:n.txtDialogMember1}),(e==null?void 0:e.type)!=="view"?o(mt,{value:"request",label:n.txtDialogMember2}):""]}),o(b,{value:i,index:"detail",children:c(D,{direction:"column",spacing:2,children:[c(D,{direction:"row",justifyContent:"space-between",children:[o(C,{sx:{width:"50%"},variant:"body2",children:"Member ID"}),o(C,{sx:{width:"50%",fontWeight:"bold"},variant:"body2",children:(T=e==null?void 0:e.members.member_id)!=null?T:"-"})]}),c(D,{direction:"row",justifyContent:"space-between",children:[o(C,{sx:{width:"50%"},variant:"body2",children:"Policy Number"}),o(C,{sx:{width:"50%",fontWeight:"bold"},variant:"body2",children:(L=e==null?void 0:e.members.policy_id)!=null?L:"-"})]}),c(D,{direction:"row",justifyContent:"space-between",children:[o(C,{sx:{width:"50%"},variant:"body2",children:"NRIC"}),o(C,{sx:{width:"50%",fontWeight:"bold"},variant:"body2",children:(H=e==null?void 0:e.members.nik)!=null?H:"-"})]}),c(D,{direction:"row",justifyContent:"space-between",children:[o(C,{sx:{width:"50%"},variant:"body2",children:"NIK"}),o(C,{sx:{width:"50%",fontWeight:"bold"},variant:"body2",children:(M=e==null?void 0:e.members.nik)!=null?M:"-"})]}),c(D,{direction:"row",justifyContent:"space-between",children:[o(C,{sx:{width:"50%"},variant:"body2",children:"Email"}),o(C,{sx:{width:"50%",fontWeight:"bold"},variant:"body2",children:(q=e==null?void 0:e.members.email)!=null?q:"-"})]}),c(D,{direction:"row",justifyContent:"space-between",children:[o(C,{sx:{width:"50%"},variant:"body2",children:n.txtDateBirth}),o(C,{sx:{width:"50%",fontWeight:"bold"},variant:"body2",children:e!=null&&e.members.birth_date?dt(new Date(e.members.birth_date),"d MMM yyyy"):"-"})]}),c(D,{direction:"row",justifyContent:"space-between",children:[o(C,{sx:{width:"50%"},variant:"body2",children:n.txtGender}),o(C,{sx:{width:"50%",fontWeight:"bold"},variant:"body2",children:(E=e==null?void 0:e.members.gender)!=null?E:"-"})]}),c(D,{direction:"row",justifyContent:"space-between",children:[o(C,{sx:{width:"50%"},variant:"body2",children:n.txtMaritalStatus}),o(C,{sx:{width:"50%",fontWeight:"bold"},variant:"body2",children:($=e==null?void 0:e.members.marital_status)!=null?$:"-"})]}),c(D,{direction:"row",justifyContent:"space-between",children:[o(C,{sx:{width:"50%"},variant:"body2",children:n.txtLanguage}),o(C,{sx:{width:"50%",fontWeight:"bold"},variant:"body2",children:(V=e==null?void 0:e.members.language)!=null?V:"-"})]}),c(D,{direction:"row",justifyContent:"space-between",children:[o(C,{sx:{width:"50%"},variant:"body2",children:"Race"}),o(C,{sx:{width:"50%",fontWeight:"bold"},variant:"body2",children:(F=e==null?void 0:e.members.race)!=null?F:"-"})]}),c(D,{direction:"row",justifyContent:"space-between",children:[o(C,{sx:{width:"50%"},variant:"body2",children:n.txtRelationship}),o(C,{sx:{width:"50%",fontWeight:"bold"},variant:"body2",children:(e==null?void 0:e.members.relation_with_principal)!=""?e==null?void 0:e.members.relation_with_principal:"-"})]})]})}),o(b,{value:i,index:"service",children:o(ra,{component:qt,children:o(la,{"aria-label":"collapsible table",children:e&&e.groupServices&&Object.keys(e.groupServices).map((W,N)=>c(ia,{children:[c(po,{sx:{backgroundColor:"#FFFFFF",borderBottom:h[N]?"":"1px solid #e0e0e0"},children:[o(Ft,{align:"left",sx:{fontWeight:"bold",width:"95%"},children:o(C,{variant:"subtitle1",children:W})}),o(Ft,{align:"left",sx:{width:"5%"},children:h[N]?o(Ao,{sx:{cursor:"pointer"},onClick:()=>P(N)}):o(Bo,{sx:{cursor:"pointer"},onClick:()=>P(N)})})]}),o(po,{sx:{display:h[N]?"":"none",borderBottom:h[N]?"1px solid #e0e0e0":""},children:o(Ft,{colSpan:2,children:o(Yo,{in:h[N],timeout:"auto",unmountOnExit:!0,children:o(vt,{container:!0,spacing:2,children:e.groupServices[W].map((K,j)=>o(vt,{item:!0,sm:6,children:c(tt,{sx:{p:2},children:[o(C,{variant:"body2",sx:{fontWeight:"bold"},children:K.description}),o(C,{variant:"body2",sx:{color:"#919EAB"},children:K.code})]})},j))})})})})]},N))})})}),o(b,{value:i,index:"request",children:o(wn,{member:e,handleSubmitSuccess:t})})]})})}const Tn=re(tt)(({theme:e})=>({boxShadow:"none",padding:"1rem 0.5rem",color:"black",backgroundColor:e.palette.grey[200]}));re(tt)(({theme:e})=>({boxShadow:"none",padding:e.spacing(1),borderRadius:.5,color:"black"}));function Mn(e){const{localeData:t}=a.exports.useContext(ot),{enqueueSnackbar:n}=Xo(),[i,s]=a.exports.useState(""),[f,b]=a.exports.useState(null),[h,u]=a.exports.useState(!1);a.exports.useState(!1);const[P,T]=a.exports.useState(!1);a.exports.useState(!1);const[L,H]=a.exports.useState(null),[M,q]=a.exports.useState("");function E(){u(!0),Ge.post("/search-member",{no_polis:i,birth_date:f?Dt(f,"yyyy-MM-dd"):null}).then($=>{T(!0),H($.data.data),q($.data.data.members.name)}).catch(({response:$})=>{n($.data.errors?$.data.errors[0]:$.data?$.data.meta.message:"Opps, Something went Wrong!",{variant:"error"})}).then(()=>{u(!1)})}return c("div",{children:[c(Tn,{sx:{p:2,height:"auto"},children:[o(D,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{paddingBottom:2,paddingTop:1},children:o(C,{variant:"body2",component:"span",sx:{display:"flex",alignItems:"center"},children:t.txtCardSearchMember1})}),c(D,{spacing:2,direction:"row",justifyContent:"space-between",children:[o(Xe,{variant:"outlined",label:t.txtCardSearchMember4,value:i,onChange:$=>{s($.target.value)},sx:{width:"40%"},required:!0}),o(Xt,{dateAdapter:jt,children:o(Jt,{label:t.txtCardSearchMember3,value:f,onChange:$=>{b($)},inputFormat:"dd-MM-yyyy",renderInput:$=>o(Xe,{sx:{width:"40%"},...$,required:!0})})}),c(Rt,{sx:{backgroundColor:"#19BBBB",p:1,width:"20%",color:"#FFFF"},loading:h,onClick:()=>{E()},children:[o(ke,{icon:"eva:search-fill",marginRight:.75,sx:{width:"24px",height:"24px"}}),t.txtCardSearchMember2]})]})]}),o(yt,{title:{name:M},openDialog:P,setOpenDialog:T,content:oo(L,()=>{T(!1),e()}),maxWidth:"sm"})]})}function Fo({actions:e,disableRipple:t}){const[n,i]=a.exports.useState(null);a.exports.useEffect(()=>{i(null)},[e]);const s=b=>{i(b.currentTarget)},f=()=>{i(null)};return c(Ct,{children:[o(It,{onClick:s,disableRipple:t,children:o(ke,{icon:"eva:more-vertical-fill",width:20,height:20})}),o(jo,{open:Boolean(n),anchorEl:n,onClose:f,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"right"},arrow:"right-top",sx:{mt:-1,width:"auto",minWidth:160,"& .MuiMenuItem-root":{px:1,typography:"body2",borderRadius:.75,"& svg":{mr:2,width:20,height:20}}},children:e}),"\xA0\xA0\xA0\xA0"]})}function Ln({member:e,getData:t,onClose:n,handleSubmitSuccess:i}){var M,q,E;const{localeData:s}=a.exports.useContext(ot),f=a.exports.useRef(null),[b,h]=a.exports.useState([]),u=$=>{$.target.files[0]?h([...b,...$.target.files]):console.log("NO FILE")},P=($,V)=>{h($.filter((F,W)=>W!=V))},[T,L]=a.exports.useState(!1);function H(){L(!0);const $=_o({request_logs_id:e.id,service_code:e.service_code,member_id:e.member_id,additional_files:b});Ge.post("/claim-requests",$).then(V=>{var F;Oe((F=V.data.meta.message)!=null?F:"Berhasil membuat data",{variant:"success"}),i(),n({someData:"example data"},t)}).catch(({response:V})=>{var F;Oe((F=V.data.meta.message)!=null?F:"Something Went Wrong",{variant:"error"})}).then(()=>{L(!1)})}return c(D,{children:[c(D,{direction:"row",justifyContent:"end",sx:{marginBottom:2,marginTop:2},spacing:2,children:[o(C,{variant:"body2",sx:{color:"#757575"},children:s.txtDialogMember5}),o(C,{variant:"body2",sx:{fontWeight:"bold"},children:dt(e!=null&&e.submission_date?new Date(e.submission_date):new Date,"d MMM yyyy")})]}),o(tt,{sx:{p:1,background:"#f4f6f8"},children:c(D,{direction:"row",children:[o(Vt,{src:"",alt:(M=e==null?void 0:e.full_name)!=null?M:"",sx:{marginTop:1,width:48,height:48}}),c(D,{sx:{p:1},children:[o(C,{variant:"body2",children:(q=e==null?void 0:e.full_name)!=null?q:""}),o(C,{variant:"body2",sx:{color:"#637381"},children:(E=e==null?void 0:e.no_polis)!=null?E:""})]})]})}),o(D,{divider:o(st,{orientation:"horizontal",flexItem:!0}),spacing:4,sx:{marginY:2,marginBottom:6},children:c(D,{sx:{marginTop:2},children:[o(C,{variant:"body1",sx:{fontWeight:"bold"},children:s.txtAdditionalDocuments}),o(D,{divider:o(st,{orientation:"horizontal",flexItem:!0}),spacing:1,sx:{marginY:2},children:b&&b.map(($,V)=>c(D,{direction:"row",justifyContent:"space-between",children:[o(C,{sx:{color:"text.secondary"},children:$.name}),o(ke,{icon:"eva:trash-2-outline",color:"darkred",onClick:()=>{P(b,V)}})]},V))}),c(et,{sx:{p:4,border:"2px dashed #F9FAFB",bgcolor:"#919EAB52",borderRadius:"8px",width:"100%",height:"60px"},onClick:()=>{var $;return($=f.current)==null?void 0:$.click()},children:[c(rt,{sx:{display:"flex",placeItems:"center",gap:1,placeContent:"center"},children:[o(ke,{icon:"icon-park-outline:upload-one",fontSize:"3em"}),o(C,{variant:"body1",fontWeight:"bold",children:s.txtAddResult})]}),o("input",{type:"file",id:"file",ref:f,style:{display:"none"},multiple:!0,onChange:u,accept:"application/pdf, image/*"})]})]})}),o(Rt,{variant:"contained",sx:{marginTop:2,p:2,backgroundColor:"#19BBBB"},onClick:()=>{H()},loading:T,children:"Submit Claim"})]})}function An(){Kt();const{localeData:e}=a.exports.useContext(ot),[t,n]=a.exports.useState([]);async function i(S,k,de,_,ie,Ne){return Ge.get(`download-final-log/${S}`,{responseType:"blob"}).then(Le=>{const xe="GL Akhir-"+ie+"-"+s(Ne)+"-"+k+"-"+de+"-"+_+"-LinkSehat.pdf",se=URL.createObjectURL(Le.data),De=document.createElement("a");De.href=se,De.setAttribute("download",xe),document.body.appendChild(De),De.click(),document.body.removeChild(De)}).catch(Le=>{Oe(Le.message,{variant:"error"})})}function s(S){const k=new Date(S.replace(/-/g,"/")),de=String(k.getDate()).padStart(2,"0"),_=String(k.getMonth()+1).padStart(2,"0"),ie=String(k.getFullYear()).substring(2,4);return`${de}${_}${ie}`}const[f,b]=a.exports.useState(!0),h={isLoading:f,setIsLoading:b},[u,P]=$o(),[T,L]=a.exports.useState({}),H={searchParams:u,setSearchParams:P,appliedParams:T,setAppliedParams:L},[M,q]=a.exports.useState("desc"),[E,$]=a.exports.useState("submission_date"),V={order:M,setOrder:q,orderBy:E,setOrderBy:$},[F,W]=a.exports.useState(0),[N,K]=a.exports.useState(10),[j,X]=a.exports.useState({current_page:0,from:0,last_page:0,links:[],path:"",per_page:0,to:0,total:0}),ue={page:F,setPage:W,rowsPerPage:N,setRowsPerPage:K,paginationTable:j,setPaginationTable:X},[le,y]=a.exports.useState(!1),[x,v]=a.exports.useState([]),[B,J]=a.exports.useState(),te=()=>{if(y(!le),le)v([]);else{const S=B==null?void 0:B.data.filter(k=>k.status==="approved"&&!k.check_claim).map(k=>k.id);v(S)}},Pe=S=>{v(k=>k.includes(S)?k.filter(_=>_!==S):[...k,S])},[Me,Se]=a.exports.useState(!1),U=()=>{Se(!1)},[be,je]=a.exports.useState(""),[we,pe]=a.exports.useState(""),ae=S=>{pe(S.target.value)},Ke={useSelected:!0,selectAll:le,handleSelectAll:te,selectedRows:x,handleCheckboxChange:Pe,totRows:9,useDecline:!1,txtDecline:"Decline",useApprove:!0,txtApprove:"Submit Claim",setOpenDialogSubmit:Se,setValDialog:je},Fe=()=>{Ge.post("/submit-claims",{selectedRows:x}).then(S=>{S.data.meta.code===200?(Se(!1),Oe(S.data.meta.message,{variant:"success"})):(Se(!1),Oe(S.data.meta.message,{variant:"error"})),Be(),v([])}).catch(({response:S})=>{Oe(S.data.errors?S.data.errors[0]:S.data?S.data.meta.message:"Opps, Something went Wrong!",{variant:"error"})}).then(()=>{})},[oe,me]=a.exports.useState(""),qe={useSearchs:!0,searchText:oe,setSearchText:me,handleSearchSubmit:async S=>{if(S.preventDefault(),oe===""){u.delete("search");const k=Object.fromEntries([...u.entries()]);L(k)}else{const k=Object.fromEntries([...u.entries(),["search",oe]]);L(k)}}},[fe,Re]=a.exports.useState("all"),[Ve,ge]=a.exports.useState([]),Je={useFilter:!0,config:{label:"Status",statusValue:fe,filterData:Ve,handleStatusChange:S=>{if(Re(S.target.value),S.target.value==="all"){u.delete("status");const k=Object.fromEntries([...u.entries()]);L(k)}else{const k=Object.fromEntries([...u.entries(),["status",S.target.value]]);L(k)}}}};a.exports.useState(""),a.exports.useState("");const Q=[{id:"code",align:"left",label:e.txtRequestCode,isSort:!0},{id:"provider",align:"left",label:e.txtProvider,isSort:!0},{id:"full_name",align:"left",label:e.txtName,isSort:!0},{id:"submission_date",align:"center",label:e.txtSubmissionDate,isSort:!0},{id:"service_type",align:"center",label:e.txtServiceType,isSort:!0},{id:"discharge_date",align:"center",label:e.txtDischargeDate,isSort:!0},{id:"status",align:"center",label:e.txtStatus,isSort:!0},{id:"action",align:"right",label:"",isSort:!1}];function Ae(S,k){Ee(!1),Ge.post("/search-member",{no_polis:S,birth_date:k?Dt(k,"yyyy-MM-dd"):null,type:"view"}).then(de=>{p(!0),g(de.data.data),m(de.data.data.members.name)}).catch(({response:de})=>{Oe(de.data.errors?de.data.errors[0]:de.data?de.data.meta.message:"Opps, Something went Wrong!",{variant:"error"})}).then(()=>{})}const[Ie,We]=a.exports.useState(!1),[ce,_e]=a.exports.useState(null);function Ue(S,k,de,_,ie,Ne){We(!0),_e({member_id:S,service_code:k,id:de,full_name:_,no_polis:ie,submission_date:Ne})}a.exports.useEffect(()=>{Be()},[T,u,M,E,P]);function Be(){(async()=>{b(!0),await new Promise(_=>setTimeout(_,250));const S=Object.keys(T).length!==0?T:Object.fromEntries([...u.entries(),["order",M],["orderBy",E]]),k=await Ge.get("/get-final-log",{params:{...S,search:oe,order:M,orderBy:E,status:fe,type:"final-log"}});if(J(k.data),n(k.data.data.map(_=>({..._,provider:_.provider,full_name:ee(_.full_name),check_status:_.status,check_claim:_.check_claim,status:_.status==="requested"?o(He,{color:"primary",children:"Request"}):_.status==="approved"?o(He,{color:"success",children:"Approval"}):_.status==="declined"?o(He,{color:"error",children:"Decline"}):_.status==="reviewed"?o(He,{color:"info",children:"Review"}):o(He,{color:"primary",children:"Pending"}),submission_date:o(He,{children:_.submission_date?Ht(_.submission_date):""}),discharge_date:_.discharge_date?o(He,{children:_.discharge_date?Ht(_.discharge_date):""}):"",action:o(Fo,{actions:c(Ct,{children:[c(ct,{onClick:()=>Ae(_.no_polis,_.birth_date),children:[o(ke,{icon:"eva:eye-fill"}),"View"]}),_.status==="approved"?c(ct,{onClick:()=>i(_.id,_.service_code,_.no_polis,_.full_name,_.provider,_.approved_final_log_at),children:[o(ke,{icon:"eva:download-fill"}),"Download Final LOG"]}):"",!_.check_claim&&_.status==="approved"?c(ct,{onClick:()=>Ue(_.member_id,_.service_code,_.id,_.full_name,_.no_polis,_.submission_date),children:[o(ke,{icon:"fa:file-text"}),"Submit Claim"]}):""]})})}))),X(k.data),K(k.data.per_page),u.get("page")){const _=parseInt(u.get("page"))-1;j.current_page=_,W(_)}ge([{id:"requested",name:"Request"},{id:"reviewed",name:"Review"},{id:"approved",name:"Approval"},{id:"declined",name:"Decline"}]),b(!1)})()}const[Qe,Ee]=a.exports.useState(!1),[he,p]=a.exports.useState(!1),[d,g]=a.exports.useState(null),[w,m]=a.exports.useState(""),ee=S=>S?S.replace(/\w\S*/g,k=>k.charAt(0).toUpperCase()+k.substr(1).toLowerCase()):"";return c(Ct,{children:[o(Ro,{headCells:Q,rows:t,orders:V,paginations:ue,loadings:h,params:H,searchs:qe,filterStatus:Je,selected:Ke}),o(yt,{title:{name:w},openDialog:he,setOpenDialog:p,content:oo(d,()=>p(!1)),maxWidth:"sm"}),o(yt,{title:{name:ce==null?void 0:ce.full_name},openDialog:Ie,setOpenDialog:We,content:o(Ln,{member:ce,getData:Be,onClose:(S,k)=>{k(),We(!1)},handleSubmitSuccess:()=>{}}),maxWidth:"sm"}),c(Oo,{open:Me,onClose:U,fullWidth:!0,children:[o(Mo,{sx:{backgroundColor:"#19BBBB",color:"#FFF",padding:2},children:c(D,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[o(D,{direction:"row",alignItems:"center",spacing:1,children:o(C,{variant:"h6",children:e.txtConfirmation})}),o(It,{sx:{color:"#FFF"},onClick:U,children:o(Zt,{})})]})}),o(Po,{children:c(D,{spacing:2,padding:2,children:[o(C,{variant:"body1",children:e.txtDialogConfirmation}),be=="decline"?o(D,{direction:"row",spacing:2,marginTop:2,children:o(Xe,{id:"outlined-multiline-static",label:e.txtReason,multiline:!0,rows:4,defaultValue:"",onChange:ae,variant:"outlined",sx:{width:"100%"}})}):""]})}),c(sa,{children:[o(so,{variant:"outlined",sx:{color:"#212B36",borderColor:"#919EAB52"},onClick:U,children:e.txtCancel}),o(so,{sx:{backgroundColor:be==="decline"?"":"#19BBBB",color:be==="decline"?"#FF4842":"",borderColor:"#FF4842"},onClick:Fe,variant:be==="decline"?"outlined":"contained",children:be==="decline"?e.txtDeclaine:"Submit"})]})]})]})}function Bn({member:e,getData:t,onClose:n,handleSubmitSuccess:i}){var le,y,x;const{localeData:s}=a.exports.useContext(ot),[f,b]=a.exports.useState(dt(new Date,"yyyy MMM d HH:mm:ss")),h=a.exports.useRef(null),[u,P]=a.exports.useState([]),T=v=>{v.target.files[0]?P([...u,...v.target.files]):console.log("NO FILE")},L=(v,B)=>{P(v.filter((J,te)=>te!=B))},H=a.exports.useRef(null),[M,q]=a.exports.useState([]),E=v=>{v.target.files[0]?q([...M,...v.target.files]):console.log("NO FILE")},$=(v,B)=>{q(v.filter((J,te)=>te!=B))},V=a.exports.useRef(null),[F,W]=a.exports.useState([]),N=v=>{v.target.files[0]?W([...F,...v.target.files]):console.log("NO FILE")},K=(v,B)=>{W(v.filter((J,te)=>te!=B))},[j,X]=a.exports.useState(!1);function ue(){if(f=="")return Oe(s.txtWarningDischargeDate,{variant:"warning"}),!1;X(!0);const v=_o({request_logs_id:e.id,result_files:F,diagnosa_files:u,kondisi_files:M,discharge_date:Dt(f,"yyyy-MM-dd HH:mm:ss")});Ge.post("/request-final-log",v).then(B=>{var J;Oe((J=B.data.meta.message)!=null?J:"Berhasil membuat data",{variant:"success"}),i(),n({someData:"example data"},t)}).catch(({response:B})=>{var J;Oe((J=B.data.meta.message)!=null?J:"Something Went Wrong",{variant:"error"})}).then(()=>{X(!1)})}return c(D,{children:[c(D,{direction:"row",justifyContent:"end",sx:{marginBottom:2,marginTop:2},spacing:2,children:[o(C,{variant:"body2",sx:{color:"#757575"},children:s.txtDialogMember5}),o(C,{variant:"body2",sx:{fontWeight:"bold"},children:dt(e!=null&&e.submission_date?new Date(e.submission_date):new Date,"d MMM yyyy")})]}),o(tt,{sx:{p:1,background:"#f4f6f8"},children:c(D,{direction:"row",children:[o(Vt,{src:"",alt:(le=e==null?void 0:e.full_name)!=null?le:"",sx:{marginTop:1,width:48,height:48}}),c(D,{sx:{p:1},children:[o(C,{variant:"body2",children:(y=e==null?void 0:e.full_name)!=null?y:""}),o(C,{variant:"body2",sx:{color:"#637381"},children:(x=e==null?void 0:e.no_polis)!=null?x:""})]})]})}),c(D,{divider:o(st,{orientation:"horizontal",flexItem:!0}),spacing:4,sx:{marginY:2,marginBottom:6},children:[c(D,{sx:{marginTop:2},children:[o(C,{variant:"body1",sx:{fontWeight:"bold"},children:s.txtConditionDocument}),o(D,{divider:o(st,{orientation:"horizontal",flexItem:!0}),spacing:1,sx:{marginY:2},children:M&&M.map((v,B)=>c(D,{direction:"row",justifyContent:"space-between",children:[o(C,{sx:{color:"text.secondary"},children:v.name}),o(ke,{icon:"eva:trash-2-outline",color:"darkred",onClick:()=>{$(M,B)}})]},B))}),c(et,{sx:{p:4,border:"2px dashed #F9FAFB",bgcolor:"#919EAB52",borderRadius:"8px",width:"100%",height:"60px"},onClick:()=>{var v;return(v=H.current)==null?void 0:v.click()},children:[c(rt,{sx:{display:"flex",placeItems:"center",gap:1,placeContent:"center"},children:[o(ke,{icon:"icon-park-outline:upload-one",fontSize:"3em"}),o(C,{variant:"body1",fontWeight:"bold",children:s.txtAddResult})]}),o("input",{type:"file",id:"file",ref:H,style:{display:"none"},multiple:!0,onChange:E,accept:"application/pdf,image/*"})]})]}),c(D,{sx:{marginTop:2},children:[o(C,{variant:"body1",sx:{fontWeight:"bold"},children:s.txtDiagnosisDokument}),o(D,{divider:o(st,{orientation:"horizontal",flexItem:!0}),spacing:1,sx:{marginY:2},children:u&&u.map((v,B)=>c(D,{direction:"row",justifyContent:"space-between",children:[o(C,{sx:{color:"text.secondary"},children:v.name}),o(ke,{icon:"eva:trash-2-outline",color:"darkred",onClick:()=>{L(u,B)}})]},B))}),c(et,{sx:{p:4,border:"2px dashed #F9FAFB",bgcolor:"#919EAB52",borderRadius:"8px",width:"100%",height:"60px"},onClick:()=>{var v;return(v=h.current)==null?void 0:v.click()},children:[c(rt,{sx:{display:"flex",placeItems:"center",gap:1,placeContent:"center"},children:[o(ke,{icon:"icon-park-outline:upload-one",fontSize:"3em"}),o(C,{variant:"body1",fontWeight:"bold",children:s.txtAddResult})]}),o("input",{type:"file",id:"file",ref:h,style:{display:"none"},multiple:!0,onChange:T,accept:"application/pdf,image/*"})]})]}),c(D,{sx:{marginTop:2},children:[o(C,{variant:"body1",sx:{fontWeight:"bold"},children:s.txtSupportingResultDocument}),o(D,{divider:o(st,{orientation:"horizontal",flexItem:!0}),spacing:1,sx:{marginY:2},children:F&&F.map((v,B)=>c(D,{direction:"row",justifyContent:"space-between",children:[o(C,{sx:{color:"text.secondary"},children:v.name}),o(ke,{icon:"eva:trash-2-outline",color:"darkred",onClick:()=>{K(F,B)}})]},B))}),c(et,{sx:{p:4,border:"2px dashed #F9FAFB",bgcolor:"#919EAB52",borderRadius:"8px",width:"100%",height:"60px"},onClick:()=>{var v;return(v=V.current)==null?void 0:v.click()},children:[c(rt,{sx:{display:"flex",placeItems:"center",gap:1,placeContent:"center"},children:[o(ke,{icon:"icon-park-outline:upload-one",fontSize:"3em"}),o(C,{variant:"body1",fontWeight:"bold",children:s.txtAddResult})]}),o("input",{type:"file",id:"file",ref:V,style:{display:"none"},multiple:!0,onChange:N,accept:"application/pdf,image/*"})]})]})]}),o(D,{direction:"row",spacing:2,children:c(D,{spacing:2,sx:{width:"100%"},children:[c(C,{variant:"subtitle1",children:[s.txtDischargeDate," *"]}),o(Xt,{dateAdapter:jt,children:o(Jt,{label:s.txtDischargeDate,value:f,onChange:v=>{b(v)},inputFormat:"dd-MM-yyyy HH:mm",renderInput:v=>o(Xe,{sx:{width:"40%"},...v,required:!0})})})]})}),o(Rt,{variant:"contained",sx:{marginTop:2,p:2,backgroundColor:"#19BBBB"},onClick:()=>{ue()},loading:j,children:"Request Final LOG"})]})}function Fn(){Kt();const{localeData:e}=a.exports.useContext(ot),[t,n]=a.exports.useState([]);async function i(d,g,w,m,ee,S){return Ge.get(`download-log/${d}`,{responseType:"blob"}).then(k=>{const de="GL Awal-"+ee+"-"+s(S)+"-"+g+"-"+w+"-"+m+"-LinkSehat.pdf",_=URL.createObjectURL(k.data),ie=document.createElement("a");ie.href=_,ie.setAttribute("download",de),document.body.appendChild(ie),ie.click(),document.body.removeChild(ie)}).catch(k=>{Oe(k.message,{variant:"error"})})}function s(d){const g=new Date(d.replace(/-/g,"/")),w=String(g.getDate()).padStart(2,"0"),m=String(g.getMonth()+1).padStart(2,"0"),ee=String(g.getFullYear()).substring(2,4);return`${w}${m}${ee}`}const[f,b]=a.exports.useState(!0),h={isLoading:f,setIsLoading:b},[u,P]=$o(),[T,L]=a.exports.useState({}),H={searchParams:u,setSearchParams:P,appliedParams:T,setAppliedParams:L},[M,q]=a.exports.useState("desc"),[E,$]=a.exports.useState("submission_date"),V={order:M,setOrder:q,orderBy:E,setOrderBy:$},[F,W]=a.exports.useState(0),[N,K]=a.exports.useState(10),[j,X]=a.exports.useState({current_page:0,from:0,last_page:0,links:[],path:"",per_page:0,to:0,total:0}),ue={page:F,setPage:W,rowsPerPage:N,setRowsPerPage:K,paginationTable:j,setPaginationTable:X},[le,y]=a.exports.useState(!1),[x,v]=a.exports.useState([]),[B,J]=a.exports.useState(),te=()=>{if(y(!le),le)v([]);else{const d=B==null?void 0:B.data.filter(g=>g.status==="approved"&&!g.check_claim).map(g=>g.id);v(d)}},Pe=d=>{v(g=>g.includes(d)?g.filter(m=>m!==d):[...g,d])},[Me,Se]=a.exports.useState(!1),[U,be]=a.exports.useState("");a.exports.useState("");const je={useSelected:!1,selectAll:le,handleSelectAll:te,selectedRows:x,handleCheckboxChange:Pe,totRows:9,useDecline:!1,txtDecline:"Decline",useApprove:!0,txtApprove:"Submit Claim",setOpenDialogSubmit:Se,setValDialog:be},[we,pe]=a.exports.useState(""),Ke={useSearchs:!0,searchText:we,setSearchText:pe,handleSearchSubmit:async d=>{if(d.preventDefault(),we===""){u.delete("search");const g=Object.fromEntries([...u.entries()]);L(g)}else{const g=Object.fromEntries([...u.entries(),["search",we]]);L(g)}}},[Fe,oe]=a.exports.useState("all"),[me,Ce]=a.exports.useState([]),fe={useFilter:!0,config:{label:"Status",statusValue:Fe,filterData:me,handleStatusChange:d=>{if(oe(d.target.value),d.target.value==="all"){u.delete("status");const g=Object.fromEntries([...u.entries()]);L(g)}else{const g=Object.fromEntries([...u.entries(),["status",d.target.value]]);L(g)}}}};a.exports.useState(null),a.exports.useState(null);const Re=[{id:"code",align:"left",label:e.txtRequestCode,isSort:!0},{id:"provider",align:"left",label:e.txtProvider,isSort:!0},{id:"full_name",align:"left",label:e.txtName,isSort:!0},{id:"submission_date",align:"center",label:e.txtSubmissionDate,isSort:!0},{id:"status",align:"center",label:e.txtStatus,isSort:!0},{id:"action",align:"right",label:"",isSort:!1}];function Ve(d,g){Q(!1),Ge.post("/search-member",{no_polis:d,birth_date:g?Dt(g,"yyyy-MM-dd"):null,type:"view"}).then(w=>{Ie(!0),Ue(w.data.data),Qe(w.data.data.members.name)}).catch(({response:w})=>{Oe(w.data.errors?w.data.errors[0]:w.data?w.data.meta.message:"Opps, Something went Wrong!",{variant:"error"})}).then(()=>{})}function ge(d,g,w,m){ce(!0),he({id:d,full_name:g,no_polis:w,submission_date:m})}a.exports.useEffect(()=>{R()},[T,u,M,E,P]);function R(){(async()=>{b(!0),await new Promise(m=>setTimeout(m,250));const d=Object.keys(T).length!==0?T:Object.fromEntries([...u.entries(),["order",M],["orderBy",E]]),g=await Ge.get("/get-request-log",{params:{...d,search:we,order:M,orderBy:E,status:Fe,type:"request-log"}});if(J(g.data),n(g.data.data.map(m=>({...m,provider:m.provider,full_name:p(m.full_name),status:m.status==="requested"?o(He,{color:"primary",children:"Request"}):m.status==="approved"?o(He,{color:"success",children:"Approval"}):m.status==="declined"?o(He,{color:"error",children:"Decline"}):m.status==="reviewed"?o(He,{color:"info",children:"Review"}):o(He,{color:"primary",children:"Pending"}),submission_date:o(He,{children:m.submission_date?Ht(m.submission_date):""}),action:o(Fo,{actions:c(Ct,{children:[c(ct,{onClick:()=>Ve(m.no_polis,m.birth_date),children:[o(ke,{icon:"eva:eye-fill"}),"View"]}),m.status==="approved"?c(ct,{onClick:()=>i(m.id,m.service_code,m.no_polis,m.full_name,m.provider,m.approved_at),children:[o(ke,{icon:"eva:download-fill"}),"Download LOG"]}):"",m.final_log===0&&m.status==="approved"?c(ct,{onClick:()=>ge(m.id,m.full_name,m.no_polis,m.submission_date),children:[o(ke,{icon:"fa:file-text"}),"Request Final LOG"]}):""]})})}))),X(g.data),K(g.data.per_page),u.get("page")){const m=parseInt(u.get("page"))-1;j.current_page=m,W(m)}Ce([{id:"requested",name:"Request"},{id:"reviewed",name:"Review"},{id:"approved",name:"Approval"},{id:"declined",name:"Decline"}]),b(!1)})()}a.exports.useState(!1);const[Je,Q]=a.exports.useState(!1),[Ae,Ie]=a.exports.useState(!1),[We,ce]=a.exports.useState(!1);a.exports.useState(!1);const[_e,Ue]=a.exports.useState(null),[Be,Qe]=a.exports.useState("");a.exports.useState(!1);const[Ee,he]=a.exports.useState(null),p=d=>d?d.replace(/\w\S*/g,g=>g.charAt(0).toUpperCase()+g.substr(1).toLowerCase()):"";return c(Ct,{children:[o(Ro,{headCells:Re,rows:t,orders:V,paginations:ue,loadings:h,params:H,searchs:Ke,filterStatus:fe,selected:je}),o(yt,{title:{name:Be},openDialog:Ae,setOpenDialog:Ie,content:oo(_e,()=>Ie(!1)),maxWidth:"sm"}),o(yt,{title:{name:Ee==null?void 0:Ee.full_name},openDialog:We,setOpenDialog:ce,content:o(Bn,{member:Ee,getData:R,onClose:(d,g)=>{console.log("Data returned:",d),g(),ce(!1)},handleSubmitSuccess:()=>{}}),maxWidth:"sm"})]})}function Wn(){Kt(),a.exports.useContext(ot);const[e,t]=a.exports.useState("request_log");a.exports.useEffect(()=>{t("request_log")},[]);function n(f,b){t(b)}const i=re(tt)(({theme:f})=>({boxShadow:"none",padding:"1rem 0.5rem",color:"black",borderRadius:0,backgroundColor:f.palette.grey[200]}));function s(f){const{children:b,value:h,index:u,...P}=f;return o("div",{role:"tabpanel",hidden:h!==u,id:`simple-tabpanel-${u}`,"aria-labelledby":`simple-tab-${u}`,...P,children:h===u&&o(rt,{sx:{p:3},children:o("div",{children:b})})})}return c(tt,{children:[o(i,{sx:{p:2,height:"auto"},children:c(Lo,{value:e,onChange:n,"aria-label":"wrapped label tabs example",children:[o(mt,{value:"request_log",label:"Request LOG"}),o(mt,{value:"final_log",label:"Final LOG"})]})}),o(s,{value:e,index:"request_log",children:o(Fn,{})}),o(s,{value:e,index:"final_log",children:o(An,{})})]})}const En={myLimit:{balance:0,total:0,percentage:0},lockLimit:{balance:0,percentage:0}};function Un(){const{themeStretch:e}=Jo();a.exports.useState(En);function t(n){let i=[];n.map(function(s){s.status=="approved"&&i.push({info:`LOG Approved for member ${s.member.full_name}`,date:co(s.created_at),time:co(s.created_at)})})}return o(Zo,{title:"Dashboard",children:o(Qo,{maxWidth:e?!1:"xl",children:c(vt,{container:!0,spacing:2,children:[o(vt,{item:!0,xs:12,lg:12,md:12,children:o(Mn,{})}),o(vt,{item:!0,xs:12,lg:12,md:12,children:o(Wn,{dataLoaded:t})})]})})})}export{Un as default};