1"use strict";(self.webpackChunkmyklopos=self.webpackChunkmyklopos||[]).push([[14710],{90759(e,t,a){a.d(t,{A:()=>s});var o=a(96540),l=a(67953),r=a(32389);function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var o in a)({}).hasOwnProperty.call(a,o)&&(e[o]=a[o])}return e},n.apply(null,arguments)}const i=({placeholder:e,...t})=>{const{t:a}=(0,r.Bd)();return o.createElement(l.A,n({replaceLabel:a("majooUI.upload.replaceLabel","Ganti File"),uploadingLabel:a("majooUI.upload.uploadingLabel","Sedang mengupload..."),cancelLabel:a("majooUI.upload.cancelLabel","Batal"),saveLabel:a("majooUI.upload.saveLabel","Simpan"),cropperTitle:a("majooUI.upload.cropperTitle","Potong Gambar"),placeholder:e||a("majooUI.upload.placeholder","Pilih atau letakkan berkas di sini")},t))};i.displayName="Upload";const s=i},90496(e,t,a){a.d(t,{A:()=>d});var o=a(96540),l=a(5556),r=a.n(l),n=a(32823),i=a(33989);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var o in a)({}).hasOwnProperty.call(a,o)&&(e[o]=a[o])}return e},s.apply(null,arguments)}const c=({alt:e,...t})=>o.createElement(n._,s({src:i.vQ.features.images.emptyDataDoodleImage,alt:e},t));c.propTypes={alt:r().string},c.defaultProps={alt:"Empty data doodle"};const d=c},11033(e,t,a){a.d(t,{AX:()=>O,Fb:()=>E,UI:()=>A,bl:()=>w,_s:()=>g,eM:()=>y,hH:()=>b,e7:()=>L,MR:()=>u,vg:()=>v,Jk:()=>R,nZ:()=>x,RO:()=>f,hq:()=>h,sv:()=>S});var o=a(955);const l="api/v1/setting",r="api/v1/salary/account",n="0_0_14/employee/list_pay",i=e=>"0_0_14/employee/salary_component"+(e?`/${e}`:""),s="api/v1/payment/transaction/reconcile",c="api/v1/employee/dashboard",d="api/v1/auditrail",p="0_0_14/employee/export_employees",m="api/v1/employee/salary_component/import",u=(e,t)=>((e,t)=>(0,o.Z)(`${l}/${e}`,t,"get",{serviceDomainType:"payroll",authType:"bearer"}))(e,t),h=(e,t)=>((e,t)=>(0,o.Z)(`${l}/${e}`,t,"put",{serviceDomainType:"payroll",authType:"bearer"}))(e,t),g=e=>(e=>(0,o.Z)(n,e,"get"))(e),y=e=>(e=>(0,o.Z)(i(e),{},"get"))(e),f=(e,t)=>((e,t)=>(0,o.Z)(i(e),t,"post"))(e,t),b=e=>(e=>(0,o.Z)(r,e,"get",{serviceDomainType:"payroll",authType:"bearer"}))(e),E=e=>(e=>(0,o.Z)(r,{},"get",{serviceDomainType:"payroll",authType:"bearer",slashId:e}))(e),x=(e,t)=>((e,t)=>(0,o.Z)(r,t,"post",{serviceDomainType:"payroll",authType:"bearer",slashId:e}))(e,t),v=e=>(e=>(0,o.Z)(s,e,"get",{serviceDomainType:"payroll",authType:"bearer"}))(e),A=e=>(e=>(0,o.Z)(`${s}/${e}`,{},"get",{serviceDomainType:"payroll",authType:"bearer"}))(e),S=(e,t)=>((e,t)=>(0,o.Z)(`${s}/${e}`,t,"put",{serviceDomainType:"payroll",authType:"bearer"}))(e,t),w=e=>(e=>(0,o.Z)(c,e,"get",{serviceDomainType:"user-management",authType:"bearer"}))(e),L=e=>(e=>(0,o.Z)(d,e,"get",{serviceDomainType:"payroll",authType:"bearer"}))(e),O=(e,t)=>((e,t)=>(0,o.Z)(p,{},"get",{slashId:e,returnBlob:!0,...t?{queryString:{search:t}}:{}}))(e,t),R=(e,t)=>((e,t)=>(0,o.Z)(`${m}/${e}`,void 0,"post",{serviceDomainType:"user-management",authType:"bearer",customBody:t}))(e,t)},48284(e,t,a){a.d(t,{R:()=>o});const o={GLOBAL:"translation",SALARYSTRUCTURE:"Karyawan/Payroll/salaryStructure"}},14710(e,t,a){a.r(t),a.d(t,{default:()=>be});var o=a(96540),l=a(87111),r=a(52893),n=a(71075),i=a(2339),s=a(28051),c=a(90721),d=a(9621),p=a(73587),m=a(79933),u=a(2923),h=a(27703),g=a(69733),y=a(33156),f=a(38221),b=a.n(f),E=a(83244),x=a(54156),v=a(46663),A=a(87498),S=a(48284);const{t:w}=x.Ay,L=(e,t)=>[{Header:w("table.name","NAMA KARYAWAN",{ns:S.R.SALARYSTRUCTURE}),accessor:"name",isMobileHeader:!0},{Header:w("table.nip","NIP",{ns:S.R.SALARYSTRUCTURE}),accessor:"nik"},{Header:"Outlet",accessor:"outlet_name"},{Header:w("table.role","POSISI",{ns:S.R.SALARYSTRUCTURE}),accessor:"job_title"},{Header:w("table.basicSalary","GAJI POKOK",{ns:S.R.SALARYSTRUCTURE}),accessor:"wage",Cell:e=>e&&!e.value?"-":(0,A.A)(e)},(0,v.A)([{title:w("table.rowAction.edit",{ns:S.R.SALARYSTRUCTURE}),onClick:({row:{original:t}})=>e(t.id)},{title:w("table.rowAction.log",{ns:S.R.SALARYSTRUCTURE}),onClick:({row:{original:e}})=>t(e.id,e.outlet_id)}])];var O=a(5556),R=a.n(O),C=a(32389),T=a(18570),M=a(17857);const k=e=>Object.fromEntries(Object.entries(e).filter(([e,t])=>!["",null,void 0].includes(t)));var D=a(11033),_=a(83109),I=a(82046);const $={NOT_FOUND:"Not Found"},F={parentProps:{},query:{search:"",outlet_id:"",page:1,limit:10,sort:"ASC",order:"name"},localOutletId:"",tableProps:{},modal:{export:!1,import:!1},refetch:!1,processedFlow:{show:!1,pending:!1,success:!1,callback:()=>{}},setQuery:()=>{},setRefetch:()=>{},setTableProps:()=>e=>{},setModal:()=>e=>{},setOutletId:()=>e=>{},setLocalOutletId:()=>e=>{},setProcessedFlow:()=>{},isMobile:!1},P=(0,o.createContext)(F),j=({children:e,parentProps:t})=>
1{const a=o.useContext(T.A),[l,r]=(0,o.useState)(F.query),[n,i]=(0,o.useState)(F.tableProps),[s,c]=(0,o.useState)(F.modal),[d,p]=(0,o.useState)(F.localOutletId),[m,u]=(0,o.useState)(F.refetch),[h,g]=(0,o.useState)(F.processedFlow),y=(0,I.U)("(max-width: 767px)"),{t:f,i18n:{language:b}}=(0,C.Bd)([S.R.SALARYSTRUCTURE,S.R.GLOBAL]),E=()=>e=>{r(t=>({...t,outlet_id:e}))};return(0,M.A)(()=>{E()(d)},[d]),o.createElement(P.Provider,{value:{isMobile:y,setQuery:r,query:l,parentProps:t,modal:s,toast:a,tableProps:n,refetch:m,setRefetch:u,setTableProps:()=>e=>i(e),setOutletId:E,setLocalOutletId:()=>e=>p(e),localOutletId:d,setModal:e=>c(t=>({...t,...e})),processedFlow:h,setProcessedFlow:g,t:f,language:b}},e)},B=()=>o.useContext(P),U=()=>{const{query:e,toast:t,tableProps:a,setTableProps:l,parentProps:r,refetch:n,t:i}=B(),[s,c]=(0,o.useState)({loading:!1,data:[],total:10}),d=(0,o.useMemo)(()=>e,[e,a]),p=Object.keys(a).length>0;return(0,o.useEffect)(()=>{(async()=>{r.showProgress(),c(e=>({...e,loading:!0}));const e={};try{p&&Object.assign(e,{page:a.pageIndex<1?1:a.pageIndex+1,limit:a.pageSize,sort:a.sortDirection,order:a.sortAccessor});const t=await(0,D._s)({...k(d),...k(p?e:d)});c(e=>({...e,data:t.data,total:t.meta.total}))}catch(e){if(e.message===$.NOT_FOUND)return c(e=>({...e,data:[],total:0}));t.addToast({title:i("toast.error",{ns:S.R.GLOBAL}),description:(0,_.WL)(e),variant:"failed",position:"top-right",dismissAfter:3e3})}finally{c(e=>({...e,loading:!1})),r.hideProgress()}})()},[JSON.stringify(e),JSON.stringify(a),n]),{loading:s.loading,data:s.data,helpers:{...d,total:s.total,setTableProps:l},query:e}};j.propTypes={children:R().node.isRequired,parentProps:R().shape({})},j.defaultProps={parentProps:{}};var G=a(93223),W=a(11163),z=a(90496),N=a(95093),H=a.n(N);const Y=e=>{const t=window.getComputedStyle(e);return["margin-top","margin-right","margin-bottom","margin-left"].reduce((e,a)=>`${e} ${t.getPropertyValue(a)||t[a]||"0px"}`,"").trim()},Z=e=>{const t=(0,o.useRef)();return t.current=e,t},V=({children:e,hasMore:t=!0,reverse:a=!1,threshold:l=.7,onLoadMore:r=()=>{},style:n={},className:i=""})=>{const s=(0,o.useRef)(),c=(0,o.useRef)(),d=Z(t),p=Z(r),m=async([e],t)=>{e.isIntersecting&&d.current&&p.current(e,t)};return(0,o.useEffect)(()=>{const e=s.current,t=c.current,a={root:e,rootMargin:Y(e),threshold:l},o=new IntersectionObserver(m,a);return o.observe(t),()=>o.unobserve(t)},[l,d,p]),o.createElement("div",{ref:s,style:{overflow:"auto",...a&&{display:"flex",flexDirection:"column-reverse"},...n},className:i},e,o.createElement("span",{ref:c}))};V.propTypes={children:R().node,onLoadMore:R().func,hasMore:R().bool,reverse:R().bool,threshold:R().number,style:R().object,className:R().string};const q=V;var K=a(64563);const J=e=>{const{loadMore:t,logList:a,language:l}=e,n=(0,o.useRef)({}),[i,s]=(0,o.useState)(0);return(0,o.useEffect)(()=>{if(a){const e=n.current?Object.values(n.current).reduce((e,t)=>e+t.clientHeight,0):0;s(e)}},[JSON.stringify(a)]),o.createElement(q,{hasMore:!0,onLoadMore:t,className:"timeline",style:{height:"400px","--borderHeight":a.length>0?i-18+"px":"0px"}},a.map((e,t)=>o.createElement(m.A,{key:`${t}_${e.reference_id}`,className:"timeline-container timeline-right",ref:e=>n.current[t]=e},o.createElement(r.A,{gap:2,direction:"column",align:"start"},o.createElement(K.A,{color:"primary",dangerouslySetInnerHTML:{__html:e.activity}}),o.createElement(u.A,{variant:"caption",css:{color:"$textSecondary"}},H()(e.created_at).locale(l).utcOffset("+07:00").format("DD MMM YYYY | HH:mm")," ","WIB"),o.createElement(p.w,{css:{mt:"3px",mb:"12px"}})))))},Q=({visible:e,onCloseHandler:t,isLoading:a,logList:l,loadMore:n})=>{const{t:i,language:s}=B();return o.createElement(G.Ay,{modal:!0,open:e,onOpenChange:t},o.createElement(G.K2,null,i("modal.activityLogModal.title")),o.createElement(G.Vn,null,a?o.createElement(r.A,{css:{my:"$spacing-08"}},o.createElement(W.A,{show:a,interval:5,css:{width:"$full"}})):o.createElement(o.Fragment,null,l&&l.length?o.createElement(J,{loadMore:n,logList:l,language:s}):o.createElement(r.A,{gap:3,align:"center",justify:"center",direction:"column",css:{padding:"$spacing-06 $spacing-08",textAlign:"center"}},o.createElement(z.A,{objectFit:"contain",alt:"Empty Data"}),o.createElement(u.A,{color:"primary",css:{lineHeight:"20px",fontWeight:"600",fontSize:"14px"}},i("modal.activityLogModal.emptyDisplay.title")),o.createElement(u.A,{color:"secondary",align:"center"},i("modal.activityLogModal.emptyDisplay.description"))))))},X=(e,t)=>{const a=document.createElement("a");a.href=e,a.download=t,document.body.appendChild(a),a.click(),a.remove()},ee=()=>{const{modal:e,setModal:t,toast:a,query:{search:l},localOutletId:r,t:n,isMobile:i}=B(),[s,c]=(0,o.useState)(!1);return o.createElement(G.Ay,{onOpenChange:()=>t({export:!1}),disabledCloseButton:s,modal:!0,open:e.export},o.createElement(G.K2,null,n("label.exportData",{ns:S.R.GLOBAL})),o.createElement(G.Vn,null,o.createElement(u.A,{color:"primary"},o.createElement(C.x6,{t:n,i18nKey:"modal.exportConfirmModal.description"},o.createElement("b",null,"Data Payroll Karyawan")," ","akan diekspor dan disimpan di perangkat yang digunakan. Lanjutkan?"))),o.createElement(G.B4,{css:{display:"flex",gap:"$compact",width:"100%"}},o.createElement(d.$n,{css:{width:i?"50%":"auto"},disabled:s,buttonType:"ghost",onClick:()=>t({export:!1})},n("label.cancel",{ns:S.R.GLOBAL})),o.createElement(d.$n,{css:{width:i?"50%":"auto"},disabled:s,onClick:()=>(async(e,l)=>{c(!0);try{const t=await(0,D.AX)(e,l),r=window.URL.createObjectURL(t);X(r,"Data Struktur Gaji.xlsx"),a.addToast({title:n("toast.success",{ns:S.R.GLOBAL}),description:o.createElement(C.x6,{t:n,i18nKey:"exportSuccess"},o.createElement("b",null,"Data Payroll Karyawan")," ","berhasil diekspor"),variant:"success",position:"top-right",dismissAfter:3e3})}catch(e){a.addToast({title:n("toast.error",{ns:S.R.GLOBAL}),description:(0,_.WL)(e),variant:"failed",position:"top-right",dismissAfter:3e3})}finally{c(!1),t({export:!1})}})(r,l),variant:"green"},n("label.continue",{ns:S.R.GLOBAL}))))};var te=a(49891),ae=a(10674),oe=a(15159),le=a(97286),re=a(20627),ne=a(87027),ie=a(90759);function se(){return se=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var o in a)({}).hasOwnProperty.call(a,o)&&(e[o]=a[o])}return e},se.apply(null,arguments)}const ce=e=>{const{t,isMobile:a}=B(),{watch:l,setValue:n,clearErrors:i,fileError:c}=e;return o.createElement(m.A,{css:{mt:a?"20px":"0"}},o.createElement(u.A,{css:{fontWeight:"600",fontSize:"18px"},color:"primary"},t("modal.importModal.importSection.title")),o.createElement(m.A,{css:{mt:"16px"}},o.createElement(u.A,{css:{fontWeight:"400",fontSize:"14px"},color:"secondary"},t("modal.importModal.importSection.note"))),o.createElement(r.A,{direction:a?"column":"row",css:{width:"100%",mt:"32px"}},o.createElement(m.A,{css:{width:a?"100%":"25%"}},o.createElement(u.A,{css:{fontWeight:600,fontSize:"14px"},color:"primary"},"Outlet")),o.createElement(s.$k,{readOnly:!0,textSelector:"name",valueSelector:"value",value:{name:l("outlet_name"),value:l("outlet_id")},option:[{name:l("outlet_name"),value:l("outlet_id")}],css:{width:a?"100%":"75%",mt:a?"8px":"0",'& div[role="combobox"]':{button:{p:{color:"$primary !important"}},height:"40px"}}})),o.createElement(r.A,{direction:a?"column":"row",css:{width:"100%",mt:"32px"}},o.createElement(m.A,{css:{width:a?"100%":"25%"}},o.createElement(u.A,{css:{fontWeight:600,fontSize:"14px"},color:"primary"},t("modal.importModal.importSection.uploadData"),o.createElement("span",{style:{color:"red"}},"*"))),o.createElement(r.A,{css:{div:{flexDirection:"column"}}},o.createElement(ie.A,se({},{multiple:!1,listType:"file",max:1,accept:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",disabled:!1},{fileList:l("file").length>0?l("file"):[],onChange:({file:e})=>{i("file");return["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/wps-office.xlsx","application/vnd.ms-excel"].includes(e.type)?(n("file",[e]),n("invalidFormat",""),Promise.resolve()):(Promise.reject(new Error(t("error.formatUnsupported",{ns:S.R.GLOBAL}))),n("invalidFormat",t("error.formatUnsupported",{ns:S.R.GLOBAL})))},onRemove:e=>{const t=l("file"),a=t.indexOf(e),o=t.slice();o.splice(a,1),n("file",o)},errorMessage:Object.keys(c||{}).length>0?c.message:l("invalidFormat")||"",css:{mt:a?"8px":"0","& div > div > p":{color:"$green500"}}})))))};var de=a(49362),pe=a(9439);const me=(0,g.Ng)(e=>({branchData:e.branch}))(({branchData:e,setValue:t,watch:a})=>{const{toast:l,t:n,isMobile:i}=B(),c=e.listOption.map(e=>({name:e[1],value:e[0]})),[h,g]=(0,o.useState)(!1),f=!a("outlet_id");return o.createElement(m.A,{css:{mt:i?"20px":"0"}},o.createElement(u.A,{css:{fontWeight:"600",fontSize:"18px"},color:"primary"},n("modal.importModal.exportSection.title")),o.createElement(r.A,{css:{width:"100%",mt:"32px"},direction:i?"column":"row"},o.createElement(r.A,{direction:"column",css:{width:i?"100%":"25%"}},o.createElement(u.A,{css:{fontWeight:600,fontSize:"14px"},color:"primary"},n("modal.importModal.exportSection.outletList"),o.createElement("span",{style:{color:"red"}},"*")),o.createElement(m.A,{css:{maxWidth:i?"100%":"181px"}},o.createElement(u.A,{color:"secondary",css:{fontSize:"12px",fontWeight:"400",lineHeight:"16px"}},n("modal.importModal.exportSection.outletNote")))),o.createElement(s.$k,{id:"outlet_id",placeholder:n("placeholder.select",{ns:S.R.GLOBAL}),textSelector:"name",valueSelector:"value",option:c,value:c.find(e=>+e.value===a("outlet_id")),onChange:e=>{t("outlet_id",+e.value),t("outlet_name",e.name)},css:{width:i?"100%":"75%",mt:i?"8px":"0",'& div[role="combobox"]':{height:"40px"}}})),o.createElement(p.w,{css:{my:"27px"}}),o.createElement(r.A,{css:{width:"100%"},direction:i?"column":"row"},o.createElement(r.A,{direction:"column",css:{width:i?"100%":"25%"}},o.createElement(u.A,{css:{fontWeight:600,fontSize:"14px"},color:"primary"},n("modal.importModal.exportSection.salaryStruct"),o.createElement("span",{style:{color:"red"}},"*")),o.createElement(m.A,{css:{maxWidth:i?"100%":"181px"}},o.createElement(u.A,{color:"secondary",css:{fontSize:"12px",fontWeight:"400",lineHeight:"16px"}},n("modal.importModal.exportSection.salaryStructNote")))),o.createElement(r.A,{css:{width:i?"100%":"75%"}},o.createElement(de.Z,{onValueChange:e=>t("have_data",e),css:{width:"100%"},value:a("have_data"),direction:"column",disabled:f},o.createElement(m.A,{css:{border:"1px solid "+("1"===a("have_data")?"$primary400":"#C0C4C4"),padding:"12px",mt:i?"8px":"0",borderRadius:"8px",backgroundColor:f?"#F4F5F5":"#fff"}}
1,o.createElement(pe.U6,{value:"1",css:{cursor:f?"not-allowed":"pointer"},label:n("modal.importModal.exportSection.dontHaveSalaryStruct"),disabled:f}),o.createElement(u.A,{css:{color:f?"$textDisable":"$primary",fontSize:"12px",fontWeight:400}},n("modal.importModal.exportSection.dontHaveSalaryStructNote")),o.createElement(d.$n,{disabled:!a("outlet_id")||null===a("have_data")||"2"===a("have_data")||h,onClick:async()=>{g(!0);try{const e=await(0,D.AX)(a("outlet_id")),t=window.URL.createObjectURL(e);X(t,"Data Struktur Gaji.xlsx")}catch(e){l.addToast({title:n("toast.error",{ns:S.R.GLOBAL}),description:(0,_.WL)(e),variant:"failed",position:"top-right",dismissAfter:3e3})}finally{g(!1)}},css:{mt:"7px",width:"$full"},leftIcon:o.createElement(y.DownloadOutline,{color:"currentColor"})},n("label.exportData",{ns:S.R.GLOBAL}))),o.createElement(m.A,{css:{border:"1px solid "+("2"===a("have_data")?"$primary400":"#C0C4C4"),padding:"12px",borderRadius:"8px",mt:"16px",backgroundColor:f?"#F4F5F5":"#fff"}},o.createElement(pe.U6,{disabled:f,value:"2",css:{cursor:f?"not-allowed":"pointer"},label:n("modal.importModal.exportSection.haveSalaryStruct")}),o.createElement(u.A,{css:{color:f?"$textDisable":"$primary",fontSize:"12px",fontWeight:400}},n("modal.importModal.exportSection.haveSalaryStructNote")))))),o.createElement(p.w,{css:{my:"27px"}}),o.createElement(u.A,{color:"primary",css:{fontWeight:600,fontSize:"20px"}},n("modal.importModal.exportSection.attention")),o.createElement(r.A,{direction:"column",css:{backgroundColor:"#FAFAFA",borderRadius:"4px",width:"$full",padding:"16px",mt:"16px",gap:"8px"}},[n("modal.importModal.exportSection.attention1"),n("modal.importModal.exportSection.attention2"),n("modal.importModal.exportSection.attention3"),n("modal.importModal.exportSection.attention4")].map(e=>o.createElement(r.A,{align:"center",key:e,gap:4},o.createElement(m.A,{css:{width:"8px",height:"8px",minWidth:"8px",minHeight:"8px",borderRadius:"50%",backgroundColor:"$bgBrand"}}),o.createElement(u.A,{css:{fontSize:"14px",color:"$textSecondary",fontWeight:"400"}},e)))))}),ue=({onSubmit:e})=>{const{processedFlow:t,t:a,isMobile:l}=B(),[r,n]=(0,o.useState)(!1);return(0,o.useEffect)(()=>t.show&&n(!0),[t.show]),o.createElement(oe.Lt,{isMobile:l,hideCloseButton:!0,onCancel:()=>n(!1),onConfirm:()=>{e()},open:r&&t.show,singleButton:!0,title:a("modal.importModal.title"),description:a("modal.importModal.processedModal")})},he=()=>{const{modal:e,setModal:t,setRefetch:a,toast:n,setProcessedFlow:i,t:s,isMobile:c}=B(),[p,m]=(0,o.useState)({}),[u,h]=(0,o.useState)({}),[g,y]=(0,o.useState)(1),[f,b]=(0,o.useState)(),{setValue:E,watch:x,getValues:v,reset:A,formState:{errors:{file:w}},handleSubmit:L,setError:O,clearErrors:R}=(0,le.mN)({resolver:(0,ne.t)(re.Ik().shape({file:re.YO().min(1,s("modal.importModal.error.notUploadYet")).required(s("modal.importModal.error.notUploadYet"))})),mode:"all",defaultValues:{outlet_id:"",outlet_name:"",have_data:null,file:[],invalidFormat:!1}}),C=({children:e})=>o.createElement(l.tu,{responsive:!0},e),T=()=>{b(void 0),t({import:!1}),y(1),i({show:!1,success:!1,pending:!0,callback:T}),A({outlet_id:"",outlet_name:"",have_data:null,file:[],invalidFormat:!1}),h({})},M=L(async e=>await(async(e,t)=>{T();try{const o=new FormData;o.append("file",t),await(0,D.Jk)(e,o),a(e=>!e),i({show:!1,success:!1,pending:!1,callback:T}),R("file")}catch(e){if([400,403].includes(e.code))return O("file",{message:e.message||s("modal.importModal.error.invalidTemplate")});n.addToast({title:s("toast.error",{ns:S.R.GLOBAL}),description:(0,_.WL)(e),variant:"failed",position:"top-right",dismissAfter:3e3}),i({show:!1,success:!1,pending:!1,callback:T})}})(e.outlet_id,e.file[0])),k={title:s("modal.importModal.cancelModal.title"),onConfirm:()=>{b(void 0),t({import:!1}),y(1),i({show:!1,success:!1,pending:!1,callback:()=>{}}),A({outlet_id:"",outlet_name:"",have_data:null,file:[],invalidFormat:!1}),h({})},description:s("modal.importModal.cancelModal.description"),dialogType:"negative"};return o.createElement(o.Fragment,null,o.createElement(te.yx,{open:e.import,onOpenChange:()=>b(k)},o.createElement(te.yx.Title,null,s("modal.importModal.title")),o.createElement(te.yx.Content,{css:{overflowY:"auto","& div.stepperInstance":{"& > div:first-child > div":{top:0}}},wrapperSize:"lg"},o.createElement(ae.I,{completedSteps:u,isMobile:c,setSw:m,navContents:[{title:s("modal.importModal.exportSection.title")},{title:s("modal.importModal.importSection.title")}],onStepChange:e=>y(e.activeStep),initialStep:1},o.createElement(C,null,o.createElement(me,{setValue:E,watch:x,getValues:v})),o.createElement(C,null,o.createElement(ce,{setValue:E,watch:x,clearErrors:R,fileError:w})))),o.createElement(te.yx.Footer,{css:{display:"flex",gap:"$compact",justifyContent:c?"flex-end":"center",padding:"12px 24px"}},o.createElement(r.A,{css:{"@sm":{justifyContent:"space-between",gap:16,width:"100%"},"@md":{width:"100%",maxWidth:1320,paddingLeft:335,justifyContent:"space-between"}}},!c&&o.createElement(r.A,null),o.createElement(r.A,{css:{width:c?"100%":"auto"},gap:5},o.createElement(d.$n,{css:{width:c?"50%":"auto"},onClick:()=>1===g?b(k):p.previousStep(),buttonType:"ghost"},s(1===g?"label.cancel":"label.back",{ns:S.R.GLOBAL})),o.createElement(d.$n,{css:{width:c?"50%":"auto"},disabled:1===g?!x("outlet_id")||null===x("have_data"):Object.keys(w||{}).length>0||x("invalidFormat"),onClick:async()=>
1{if(2!==g)return p.nextStep(),h(e=>({...e,[g-1]:!0}));h(e=>({...e,[g-1]:!0})),i({show:!0,success:!1,pending:!0,callback:T})}},s(2===g?"label.process":"label.nextThen",{ns:S.R.GLOBAL})))))),f&&o.createElement(oe.Lt,{onCancel:()=>b(void 0),onConfirm:f.onConfirm,open:f,title:f.title,description:f.description,isMobile:c,dialogType:f.dialogType}),o.createElement(ue,{onSubmit:M}))};var ge=a(29678),ye=a(22680);const fe=({branchData:e})=>{const{isMobile:t,setOutletId:a,setQuery:g,setModal:f,parentProps:E,toast:x,processedFlow:v,setLocalOutletId:A,localOutletId:w,setProcessedFlow:O,t:R}=B(),{loading:C,helpers:T,data:M,query:k}=U(),I=[{name:R("label.allOutlets","Semua Outlet",{ns:"translation"}),value:""},...e.listOption.map(e=>({name:e[1],value:e[0]}))],[$,F]=(0,o.useState)(!1),[P,j]=(0,o.useState)(!1),[G,W]=(0,o.useState)(!0),[z,N]=(0,o.useState)([]),[H,Y]=(0,o.useState)(1),[Z,V]=(0,o.useState)(null),q=async(e,t)=>{Z||V({userId:e,outletId:t});const a={page:H,limit:"10",feature:"struktur_gaji",reference_id:e,outlet_id:t};try{const e=await(0,D.e7)(a);e.status&&(e.data&&e.data.length?N([...z].concat(e.data)):W(!1))}catch(e){x.addToast({title:R("toast.error",{ns:S.R.GLOBAL}),description:(0,_.WL)(e),variant:"failed",position:"top-right",dismissAfter:3e3})}finally{F(!1)}},K=e=>E.router.push(`/gaji/struktur-gaji/detail/${e}`);(0,o.useEffect)(()=>{H>1&&q(Z.userId,Z.outletId)},[H]),(0,o.useEffect)(()=>a()(E.filterBranch),[E.filterBranch]);const J=b()(e=>g(t=>({...t,search:e})),500);return o.createElement(l.tu,{responsive:!0,css:{mb:"20px"}},o.createElement(r.A,{direction:t?"column":"row",justify:"between",align:t?"stretch":"center"},o.createElement(ge.OA,null,o.createElement(n.A,{as:"h4",heading:"pageTitle",color:"primary"},R("title","Struktur Gaji")),o.createElement(ge.I4,null)),o.createElement(r.A,{direction:t?"column":"row",css:{mt:t?"16px":"0"},gap:4},t?o.createElement(o.Fragment,null,o.createElement(i.A,{onChange:J}),o.createElement(s.$k,{placeholder:R("placeholder.select","Pilih",{ns:S.R.GLOBAL}),textSelector:"name",valueSelector:"value",option:I,value:I.find(e=>+e.value===w)||I[0],onChange:({value:e})=>A()(+e),size:"sm"}),o.createElement(c.rI,{side:"bottom",align:"start"},o.createElement(c.ty,{asChild:!0},o.createElement(c.YV,{size:"sm",buttonType:"secondary",rightIcon:o.createElement(y.CaretDownOutline,{color:ye.Tj.iconBrand,size:"20"})},R("label.importData","Impor Data",{ns:S.R.GLOBAL}).split(" ")[0],"/",R("label.exportData","Ekspor Data",{ns:S.R.GLOBAL}))),o.createElement(c.SQ,{css:{width:"320px"},sideOffset:5},o.createElement(c._2,{disabled:v.pending,onClick:()=>{f({import:!0}),v.show&&O({show:!1,callback:()=>{}})}},R("label.importData","Impor Data",{ns:S.R.GLOBAL})),o.createElement(c.mB,null),o.createElement(c._2,{onClick:()=>f({export:!0}),disabled:!w},R("label.exportData","Ekspor Data",{ns:S.R.GLOBAL}))))):o.createElement(o.Fragment,null,o.createElement(d.$n,{leftIcon:o.createElement(y.UploadOutline,{color:"currentColor"}),buttonType:"secondary",disabled:v.pending,onClick:()=>{f({import:!0}),O({show:!1,pending:!1,success:!1,callback:()=>{}})},size:"sm"},R("label.importData","Impor Data",{ns:S.R.GLOBAL})),o.createElement(d.$n,{leftIcon:o.createElement(y.DownloadOutline,{color:"currentColor"}),buttonType:"primary",onClick:()=>f({export:!0}),size:"sm",disabled:!w},R("label.exportData","Ekspor Data",{ns:S.R.GLOBAL}))))),o.createElement(ge.cr,{css:{mb:0}}),o.createElement(p.w,{css:{mt:"30px",mb:"20px"},desktopOnly:!0}),v.pending&&o.createElement(o.Fragment,null,o.createElement(m.A,{css:{padding:"8px 16px",boxShadow:"0px 1px 1px rgba(0, 0, 0, 0.07), 0px 2px 4px rgba(0, 0, 0, 0.05), 0px 4px 10px rgba(0, 0, 0, 0.05)",border:"1px solid #FE7F2D",backgroundColor:"#FEFCE8",borderRadius:"8px",width:"100%"}},o.createElement(r.A,{align:"start",css:{gap:"10px"}},o.createElement(m.A,null,o.createElement(y.CircleInfoFilled,{color:"#404545"})),o.createElement(r.A,{direction:"column",css:{gap:"4px"}},o.createElement(u.A,{color:"primary",css:{fontWeight:"600",fontSize:"16px"}},R("pendingTitle","Impor Data Gaji Karyawan Sedang Diproses")),o.createElement(u.A,{color:"secondary",css:{fontWeight:"400",fontSize:"14px"}},R("pendingDescription",'Tombol "Impor Data" akan dinonaktifkan sementara hingga proses impor data gaji karyawan selesai'))))),o.createElement(p.w,{css:{mt:"30px",mb:"20px"}})),!t&&o.createElement(r.A,{css:{mt:t?"16px":"",gap:"16px"},direction:t?"column":"row"},o.createElement(m.A,{css:{"@sm":{width:"100%"},"@md":{width:"240px"}}},o.createElement(i.A,{onChange:J})),o.createElement(m.A,{css:{"@sm":{width:"100%"},"@md":{width:"240px"}}},o.createElement(s.$k,{placeholder:R("placeholder.select","Pilih",{ns:S.R.GLOBAL}),textSelector:"name",valueSelector:"value",option:I,value:I.find(e=>+e.value===w)||I[0],onChange:({value:e})=>A()(+e),size:"sm"}))),o.createElement(m.A,{css:{padding:t?"0 13px":""}},o.createElement(p.w,{css:{mb:t?"0":"20px",mt:"20px"}})),o.createElement(h.XI,{columns:L(e=>K(e),(e,t)=>{j(!0),F(!0),q(e,t)}),data:M,totalData:T.total,fetchData:e=>T.setTableProps()(e),isLoading:C,pageIndex:T.page-1,onRowClick:e=>K(e.id),searchQuery:k.search,css:{alignSelf:"stretch","& > table > tbody[role=rowgroup] > tr[role=row] > td > div > div > p:last-child":{textAlign:"left"},"& > table > tbody[role=rowgroup] > tr > td > div > div > p:last-child":{textAlign:"right"}}}),o.createElement(Q,{visible:P,isLoading:$,onCloseHandler:()=>{j(!1),F(!1),W(!0),V(null),N([]),Y(1)},logList:z,hasMore:G,loadMore:()=>Y(e=>e+1)}))},be=(0,E.A)((0,g.Ng)(e=>({branchData:e.branch}))(e=>o.createElement(j,{parentProps:e},o.createElement(fe,{branchData:e.branchData}),o.createElement(ee,null),o.createElement(he,null))))}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.