PageSourceSearch

https://app.timesheet.global/static/js/58.61100a1f.chunk.js

js timesheet.global collected 2026-10-02 01:04:43 UTC 26,310 bytes, 1 lines download raw bytes

1(this["webpackJsonptimesheet-app"]=this["webpackJsonptimesheet-app"]||[]).push([[58],{1083:function(e,t,a){e.exports={CreateTimesheet:"styles_CreateTimesheet__QmUxa",CreateTimesheet_layout:"styles_CreateTimesheet_layout__1q_kt",CreateTimesheet_main:"styles_CreateTimesheet_main__3yzvk",CreateTimesheet_sidebar:"styles_CreateTimesheet_sidebar__3-kJX",CreateTimesheet_card:"styles_CreateTimesheet_card__3ZLN6",CreateTimesheet_section:"styles_CreateTimesheet_section__2KfLE",CreateTimesheet_sectionHeader:"styles_CreateTimesheet_sectionHeader__1fPG-",CreateTimesheet_divider:"styles_CreateTimesheet_divider__uDb7v",CreateTimesheet_grid:"styles_CreateTimesheet_grid__KX4Ng",CreateTimesheet_fullWidth:"styles_CreateTimesheet_fullWidth__37KC_",CreateTimesheet_withMargin:"styles_CreateTimesheet_withMargin__14rof",CreateTimesheet_withMarginDrop:"styles_CreateTimesheet_withMarginDrop__YefKL",CreateTimesheet_timeInputs:"styles_CreateTimesheet_timeInputs__1OXtx",CreateTimesheet_notesContainer:"styles_CreateTimesheet_notesContainer__3YAGA",CreateTimesheet_fieldHelper:"styles_CreateTimesheet_fieldHelper__1YguJ",CreateTimesheet_hoursDisplay:"styles_CreateTimesheet_hoursDisplay__QA412",CreateTimesheet_hoursDisplay_label:"styles_CreateTimesheet_hoursDisplay_label__1SKL4",CreateTimesheet_hoursDisplay_value:"styles_CreateTimesheet_hoursDisplay_value__1lxPC",CreateTimesheet_withCosts:"styles_CreateTimesheet_withCosts__ISyLF",CreateTimesheet_withCostItem:"styles_CreateTimesheet_withCostItem__37Q1I",CreateTimesheet_addNew:"styles_CreateTimesheet_addNew__14C-y",CreateTimesheet_withCostDetail:"styles_CreateTimesheet_withCostDetail__33Lma",CreateTimesheet_emptyCosts:"styles_CreateTimesheet_emptyCosts__1kpFN",CreateTimesheet_delete:"styles_CreateTimesheet_delete__225r2",CreateTimesheet_summaryCard:"styles_CreateTimesheet_summaryCard__1wzFu",CreateTimesheet_summaryTitle:"styles_CreateTimesheet_summaryTitle__1_bdH",CreateTimesheet_summaryStats:"styles_CreateTimesheet_summaryStats__1TzJ-",CreateTimesheet_summaryItem:"styles_CreateTimesheet_summaryItem__3IXmo",CreateTimesheet_summaryLabel:"styles_CreateTimesheet_summaryLabel__3l-9E",CreateTimesheet_summaryValue:"styles_CreateTimesheet_summaryValue__2lgv7",CreateTimesheet_summaryValue___green:"styles_CreateTimesheet_summaryValue___green__3UN_D",CreateTimesheet_buttonGroup:"styles_CreateTimesheet_buttonGroup__RfcID",CreateTimesheet_buttonGroup_button:"styles_CreateTimesheet_buttonGroup_button__1dzti",CreateTimesheet_buttonGroup_spinner:"styles_CreateTimesheet_buttonGroup_spinner__2iVC3",CreateTimesheet_helperText:"styles_CreateTimesheet_helperText__13eL9",CreateTimesheet_readOnly:"styles_CreateTimesheet_readOnly__FuqVg",CreateTimesheet_withTooltip:"styles_CreateTimesheet_withTooltip__f9YE-",CreateTimesheet_withTooltip_tooltipIcon:"styles_CreateTimesheet_withTooltip_tooltipIcon__1fJuK",CreateTimesheet_noEmployees:"styles_CreateTimesheet_noEmployees__2kc3-",CreateTimesheet_noEmployees_image:"styles_CreateTimesheet_noEmployees_image__2TF5h",CreateTimesheet_noEmployees_link:"styles_CreateTimesheet_noEmployees_link__UVQSl"}},1084:function(e,t,a){e.exports={Preloader:"styles_Preloader__2S12r",Preloader_shine:"styles_Preloader_shine__7tAVq"}},1154:function(e,t,a){"use strict";a.r(t);var i=a(0),l=a(80),s=a(31),r=a(36),o=a(848),n=a(38),c=a.n(n),m=a(41),d=a.n(m),u=a(1083),h=a.n(u),v=a(8),_=a.n(v),T=a(902),j=a.n(T),p=a(1084),b=a.n(p),y=a(4),C=a(1);var O=()=>Object(C.jsx)(y.g,{className:b.a.Preloader,children:Object(C.jsx)(y.y,{className:b.a.Preloader_shine})}),N=(a(263),a(366)),x=a(3),D=a(26),g=a(47),f=a(9),I=a(35),B=a(139),k=a(117),L=a(73),w=a.n(L),H=a(435),S=a(1189),E=a(831),M=a.n(E),A=a(16),P=a.n(A),Y=a(51);const U=e=>{if("boolean"===typeof e)return e;if("string"===typeof e){const t=e.trim().toLowerCase();if("true"===t||"yes"===t)return!0;if("false"===t||"no"===t)return!1}},W=e=>{const t=U(null===e||void 0===e?void 0:e.isTravelCharge);if(void 0!==t)return t;const a=U(null===e||void 0===e?void 0:e.travelCharge);return void 0!==a&&a};t.default=e=>{var t,a;let{pageTitle:n,pages:m}=e;const u=Object(l.i)(),v=u.clientId,T=u.projectId,p="".concat(Y.a.API_URL,"/timesheets"),b=new URLSearchParams(window.location.search),L=b.get("timesheet"),E=Object(s.b)(),{user:A}=Object(i.useContext)(D.c),{clientLabel:U,projectLabel:X}=Object(k.a)(),{isLoading:G,employee:V}=Object(B.a)({emailAddress:"Employee"==A.userType?null===(t=A.employerDetails)||void 0===t?void 0:t.employerEmailAddress:A.emailAddress}),q=Object(i.useMemo)((()=>V||A.employerDetails||{}),[V,A.employerDetails]),[F,z]=Object(i.useState)([]),[K,J]=Object(i.useState)(!0),[R,Q]=Object(i.useState)(!1),[$,Z]=Object(i.useState)(null),[ee,te]=Object(i.useState)(0),[ae,ie]=Object(i.useState)([]),[le,se]=Object(i.useState)(""),[re,oe]=Object(i.useState)(""),[ne,ce]=Object(i.useState)(v||""),[me,de]=Object(i.useState)(""),[ue,he]=Object(i.useState)(""),[ve,_e]=Object(i.useState)(T||""),{clients:Te,isLoading:je}=Object(g.g)({userId:null===A||void 0===A||null===(a=A.employerDetails)||void 0===a?void 0:a.employerId}),{projects:pe,isLoading:be}=Object(g.w)({clientId:ne,isFromCreateTimeSheet:!0}),{isCreating:ye,createTimesheet:Ce}=Object(g.k)(),{isUpdating:Oe,updateTimesheet:Ne}=Object(g.F)(),xe="true"===b.get("isDuplicate"),[De]=Object(i.useState)(new Date),[ge,fe]=Object(i.useState)(null);Object(i.useEffect)((()=>{L&&P.a.post("".concat(p,"/timesheet-by-id"),{timesheet_id:L}).then((e=>{if(e.data.success){var t,a;fe(e.data.data),e.data.data.clientId&&(ce(e.data.data.clientId),de(e.data.data.clientName)),e.data.data.projectId&&(_e(e.data.data.projectId),he(e.data.data.projectName));const i=e.data.data,l=W(i),s=Object(f.D)(Object(f.C)(i.date)),r=null===(t=i.startTimeDetails)||void 0===t?void 0:t.startTime,o=null===(a=i.endTimeDetails)||void 0===a?void 0:a.endTime;te(Object(I.f)(Object(f.c)(s,Object(f.f)(r)),Object(f.c)(s,Object(f.f)(o)),!1!==A.employerDetails.isLunchBreakEnabled&&i.isLunchBreak,!1!==A.employerDetails.isLunchBreakEnabled?
1i.lunchBreakDuration:"00:00",l,!1!==A.employerDetails.isLeaveTypeEnabled?i.leaveType:x.m.NONE,i.publicHolidayMultiplier))}}))}),[]);const{isLoading:Ie,vehicles:Be}=Object(g.K)({employerId:A.employerDetails.employerId}),ke=function(e,t,a){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"00:00",s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"None",o=arguments.length>7?arguments[7]:void 0,n=arguments.length>8?arguments[8]:void 0;if(t=Object(f.e)(Object(f.z)(t)),a=Object(f.e)(Object(f.z)(a)),r===x.m.ANNUAL||r===x.m.WITHOUT_PAY)return n("startTime",void 0),n("endTime",void 0),n("isLunchBreak",A.employerDetails.isLunchBreakByDefault?{label:"Yes",value:!0}:{label:"No",value:!1}),n("isTravelCharge",A.employerDetails.isTravelChargeByDefault?{label:"Yes",value:!0}:{label:"No",value:!1}),void te(Object(I.f)(null,null,!1,"00:00",!1,r));e&&Object(f.b)(t)&&Object(f.b)(a)?te(Object(I.f)(Object(f.c)(e,Object(f.f)(t)),Object(f.c)(e,Object(f.f)(a)),i,l,s,r,o)):r===x.m.PUBLIC_HOLIDAY||r===x.m.SICK?te(Object(I.f)(null,null,!1,"00:00",!1,r)):te(0)};Object(i.useEffect)((()=>{if(!Ie){const e=[{label:"N/A",value:null}];Be.forEach((t=>{let{id:a,name:i}=t;const l={label:i,value:a};e.push(l)})),z(e),J(!1)}}),[Ie]);const Le=!!L&&!xe,we=Object(i.useMemo)((()=>{var e,t,a,i,l,s,r,o,n,c;return{date:L&&ge?Object(f.D)(Object(f.C)(ge.date)):De,startTime:null!==ge&&void 0!==ge&&null!==(e=ge.startTimeDetails)&&void 0!==e&&e.startTime?w()(null===ge||void 0===ge||null===(t=ge.startTimeDetails)||void 0===t?void 0:t.startTime,null!==(a=A.employerDetails)&&void 0!==a&&a.is24Hour?"HH:mm a":"hh:mm a").format():void 0,endTime:null!==ge&&void 0!==ge&&null!==(i=ge.endTimeDetails)&&void 0!==i&&i.endTime?w()(null===ge||void 0===ge||null===(l=ge.endTimeDetails)||void 0===l?void 0:l.endTime,null!==(s=A.employerDetails)&&void 0!==s&&s.is24Hour?"HH:mm a":"hh:mm a").format():void 0,isLunchBreak:ge?{label:ge.isLunchBreak?"Yes":"No",value:!!ge.isLunchBreak}:A.employerDetails.isLunchBreakByDefault&&!1!==A.employerDetails.isLunchBreakEnabled?{label:"Yes",value:!0}:{label:"No",value:!1},lunchBreakDuration:null!==ge&&void 0!==ge&&ge.isLunchBreak?null===ge||void 0===ge?void 0:ge.lunchBreakDuration:A.employerDetails.isLunchBreakByDefault&&!1!==A.employerDetails.isLunchBreakEnabled?Object(I.g)(A,{fromEmployerDetails:!0}):void 0,isTravelCharge:ge?{label:W(ge)?"Yes":"No",value:W(ge)}:A.employerDetails.isTravelChargeByDefault?{label:"Yes",value:!0}:{label:"No",value:!1},leaveType:{label:(null===ge||void 0===ge?void 0:ge.leaveType)||x.m.NONE,value:(null===ge||void 0===ge?void 0:ge.leaveType)||x.m.NONE},vehicle:{label:"N/A",value:null},notes:null!==ge&&void 0!==ge&&ge.notes?null===ge||void 0===ge?void 0:ge.notes:void 0,performedNotes:null!==ge&&void 0!==ge&&ge.performedNotes?null===ge||void 0===ge?void 0:ge.performedNotes:void 0,isBillable:{label:null!==ge&&void 0!==ge&&ge.isBillable?"Yes":"No",value:!(null===ge||void 0===ge||!ge.isBillable)},costs:(null===ge||void 0===ge?void 0:ge.costs)||[],client:null!==ge&&void 0!==ge&&ge.clientId?{value:ge.clientId,label:ge.clientName}:v?{value:null===(r=Te.find((e=>e.id==v)))||void 0===r?void 0:r.id,label:null===(o=Te.find((e=>e.id==v)))||void 0===o?void 0:o.name}:void 0,project:null!==ge&&void 0!==ge&&ge.projectId?{value:ge.projectId,label:ge.projectName}:T?{value:null===(n=pe.find((e=>e.id==T)))||void 0===n?void 0:n.id,label:null===(c=pe.find((e=>e.id==T)))||void 0===c?void 0:c.name}:void 0}}),[L,ge,A,Te,pe,v,T,De]);return Object(C.jsx)("div",{className:h.a.CreateTimesheet,children:K||je||v&&be&&!Te.find((e=>e.id===v))||G&&!A.employerDetails||L&&be?Object(C.jsx)(O,{}):Object(C.jsx)(r.b,{enableReinitialize:!0,initialValues:we,onSubmit:async(e,t)=>{var a,i;let{setErrors:l,setFieldValue:s,resetForm:r}=t;const o=((e,t,a,i)=>{var l,s;const r={};e.date||(r.date="This field is required."),e.leaveType.value===x.m.NONE&&(e.startTime?Object(f.b)(Object(f.e)(Object(f.z)(e.startTime)))||(r.startTime="Invalid time format."):r.startTime="This field is required.",e.endTime?Object(f.b)(Object(f.e)(Object(f.z)(e.endTime)))||
1(r.endTime="Invalid time format."):r.endTime="This field is required.",e.isLunchBreak.value&&!e.lunchBreakDuration&&(r.lunchBreakDuration="This field is required."),e.isLunchBreak&&e.lunchBreakDuration&&(Object(f.b)(Object(f.e)(e.lunchBreakDuration))||(r.lunchBreakDuration="Invalid time format.")));const o=(null===t||void 0===t?void 0:t.isProjectClient)||!1,n=(null===(l=e.client)||void 0===l?void 0:l.value)||e.clientId,c=(null===(s=e.project)||void 0===s?void 0:s.value)||e.projectId;return!o||n&&c||(r.client="".concat(a," and ").concat(i," are required."),r.project="".concat(a," and ").concat(i," are required.")),r})(e,q,U,X);if(!d()(o))return void l(o);const n=async t=>{var a,i,l,s,r,o;const n={userId:(null===ge||void 0===ge?void 0:ge.userId)||A.id,employerId:A.employerDetails.employerId,date:c()(e.date,"yyyy-mm-dd"),leaveType:e.leaveType.value,publicHolidayMultiplier:A.employerDetails.publicHolidayMultiplier,notes:e.notes,performedNotes:e.performedNotes,clientId:(null===(a=e.client)||void 0===a?void 0:a.value)||void 0,clientName:(null===(i=e.client)||void 0===i?void 0:i.label)||void 0,projectId:(null===(l=e.project)||void 0===l?void 0:l.value)||void 0,projectName:(null===(s=e.project)||void 0===s?void 0:s.label)||void 0,isBillable:null!==(r=e.project)&&void 0!==r&&r.value?e.isBillable.value:void 0,vehicleReviewId:t||void 0,wage:(null===ge||void 0===ge?void 0:ge.wage)||(null===(o=A.employerDetails)||void 0===o?void 0:o.wage)||0,costs:ae||[]};e.leaveType.value!==x.m.NONE&&e.leaveType.value!==x.m.PUBLIC_HOLIDAY&&e.leaveType.value!==x.m.SICK||(n.startTimeDetails={startTime:Object(f.e)(Object(f.z)(e.startTime))},n.endTimeDetails={endTime:Object(f.e)(Object(f.z)(e.endTime))},n.isLunchBreak=e.isLunchBreak.value,n.lunchBreakDuration=e.lunchBreakDuration,n.isTravelCharge=e.isTravelCharge.value,n.travelCharge=e.isTravelCharge.value);const d=Object(f.e)(Object(f.z)(e.startTime)),u=Object(f.e)(Object(f.z)(e.endTime)),h=w.a.utc(u,"HH:mm a").diff(w.a.utc(d,"HH:mm a"),"minutes"),v=e.lunchBreakDuration,_=60*w.a.utc(v,"hh:mm a").get("hour")+w.a.utc(v,"hh:mm a").get("minute");if(d!==u||e.leaveType.value!==x.m.NONE&&e.leaveType.value!==x.m.PUBLIC_HOLIDAY&&e.leaveType.value!==x.m.SICK)if(Math.abs(h)<15&&(e.leaveType.value===x.m.NONE||e.leaveType.value===x.m.PUBLIC_HOLIDAY||e.leaveType.value===x.m.SICK))E.error("Oops, please record a timesheet for at least 15 minutes");else if(!(h>0&&Math.abs(h)<=_||_>600||0===_)||e.leaveType.value!==x.m.NONE&&e.leaveType.value!==x.m.PUBLIC_HOLIDAY&&e.leaveType.value!==x.m.SICK){if(null!==q&&void 0!==q&&q.isNoteNeeded){if(null!==q&&void 0!==q&&q.isWorkPerformed&&(void 0===n.notes||void 0===n.performedNotes))return void j()({title:"Notes needed",text:"You must have to add a notes",icon:"warning"});if((null===q||void 0===q||!q.isWorkPerformed)&&void 0===n.notes)return void j()({title:"Notes needed",text:"You must have to add a notes",icon:"warning"})}null===q||void 0===q||!q.isProjectClient||n.clientId&&n.projectId?await m(n):j()({title:"Missing fields",text:"".concat(U," and ").concat(X," are required."),icon:"warning"})}else E.error("Oops, please select a valid lunch time");else E.error("Oops, start and end time cannot be the same")},m=async e=>{if(Le){e.timesheetId=L;const{message:t}=await Ne(e);"timesheet_updated"===t?E.success("Timesheet updated!"):E.error(Object(I.i)(t))}else{const{responseCode:t,message:a}=await Ce(e);200===t?(E.success("Timesheet created!"),xe||(s("client",Te[0]),s("project",pe[0]),s("startTime",void 0),s("endTime",void 0),s("isLunchBreak",A.employerDetails.isLunchBreakByDefault?{label:"Yes",value:!0}:{label:"No",value:!1}),s("lunchBreakDuration",void 0),s("isTravelCharge",A.employerDetails.isTravelChargeByDefault?{label:"Yes",value:!0}:{label:"No",value:!1}),s("leaveType",{label:x.m.NONE,value:x.m.NONE}),s("vehicle",F[0]),s("notes",void 0),s("performedNotes",void 0),s("itemName",""),s("price",""),te(0),ie([]))):E.error(Object(I.i)(a))}};null!==A&&void 0!==A&&null!==(a=A.employerDetails)&&void 0!==a&&a.showVehiclesTab&&null!==e&&void 0!==e&&null!==(i=e.vehicle)&&void 0!==i&&i.value?(Q(!0),Z((()=>n))):n()},children:e=>{var t,a,i,l,s,r,c,m;let{errors:d,values:u,handleSubmit:v,setFieldValue:T}=e;return Object(C.jsxs)("form",{onSubmit:v,className:h.a.CreateTimesheet_layout,children:[Object(C.jsx)("div",{className:h.a.CreateTimesheet_main,children:Object(C.jsxs)("div",{className:h.a.CreateTimesheet_card,children:[Object(C.jsxs)("div",{className:h.a.CreateTimesheet_section,children:[Object(C.jsxs)("div",{className:h.a.CreateTimesheet_sectionHeader,children:[Object(C.jsx)(y.B,{type:x.x.HEADING.XXXS,children:"Time & Date"}),Object(C.jsx)("div",{className:h.a.CreateTimesheet_divider})]}),Object(C.jsxs)("div",{className:h.a.CreateTimesheet_grid,children:[Object(C.jsxs)("div",{className:h.a.CreateTimesheet_withMargin,children:[Object(C.jsx)(y.u,{text:"Date *"}),Object(C.jsx)(y.l,{type:x.l.SLIM,dateFormat:"dd/MM/yyyy",selected:u.date,placeholder:"Select Date",name:"date",icon:"today",onChange:e=>{T("date",e),ke(e,u.startTime,u.endTime,u.isLunchBreak.value,u.lunchBreakDuration,u.isTravelCharge.value,u.leaveType.value,A.employerDetails.publicHolidayMultiplier,T)}})]}),Object(C.jsxs)("div",{className:h.a.CreateTimesheet_withMargin,children:[Object(C.jsx)(y.u,{text:U}),Object(C.jsx)(y.j,{options:Te.map((e=>({value:e.id,label:e.name}))),type:x.q.SLIM,name:"client",placeholder:"Select ".concat(U),value:u.client,error:d.client,onChange:e=>{T("client",e),ce(e.value.toString()),de(e.label),T("project",""),_e(""),he("")}})]}),Object(C.jsxs)("div",{className:h.a.CreateTimesheet_withMargin,children:[Object(C.jsx)(y.u,{text:X}),Object(C.jsx)(y.j,{options:pe.map((e=>({value:e.id,label:e.name}))),type:x.q.SLIM,name:"project",placeholder:"Select ".concat(X),value:u.project,error:d.project,onChange:e=>{T("project",e),_e(e.value),he(e.label)}})]})]})]}),Object(C.jsxs)("div",{className:h.a.CreateTimesheet_section,children:[Object(C.jsxs)("div",{className:h.a.CreateTimesheet_sectionHeader,children:[Object(C.jsx)(y.B,{type:x.x.HEADING.XXXS,children:"Work Hours"}
1),Object(C.jsx)("div",{className:h.a.CreateTimesheet_divider})]}),Object(C.jsxs)("div",{className:h.a.CreateTimesheet_grid,children:[Object(C.jsxs)("div",{className:h.a.CreateTimesheet_withMargin,children:[Object(C.jsx)(y.u,{text:"Start Time *"}),Object(C.jsx)(y.t,{time:null===u||void 0===u?void 0:u.startTime,onChange:e=>{T("startTime",e),ke(u.date,e,u.endTime,u.isLunchBreak.value,u.lunchBreakDuration,u.isTravelCharge.value,u.leaveType.value,A.employerDetails.publicHolidayMultiplier,T)},ampm:null===q||void 0===q||!q.is24Hour,mask:null!==q&&void 0!==q&&q.is24Hour?"__:__":"__:__ _M",error:d.startTime,clearable:!0,disabled:u.leaveType.value===x.m.ANNUAL||u.leaveType.value===x.m.WITHOUT_PAY})]}),Object(C.jsxs)("div",{className:h.a.CreateTimesheet_withMargin,children:[Object(C.jsx)(y.u,{text:"End Time *"}),Object(C.jsx)(y.t,{time:null===u||void 0===u?void 0:u.endTime,onChange:e=>{T("endTime",e),ke(u.date,u.startTime,e,u.isLunchBreak.value,u.lunchBreakDuration,u.isTravelCharge.value,u.leaveType.value,A.employerDetails.publicHolidayMultiplier,T)},ampm:null===q||void 0===q||!q.is24Hour,mask:null!==q&&void 0!==q&&q.is24Hour?"__:__":"__:__ _M",error:d.endTime,clearable:!0,disabled:u.leaveType.value===x.m.ANNUAL||u.leaveType.value===x.m.WITHOUT_PAY})]}),!1!==A.employerDetails.isLunchBreakEnabled&&Object(C.jsxs)("div",{className:h.a.CreateTimesheet_withMargin,children:[Object(C.jsx)(y.u,{text:"Lunch Break *"}),Object(C.jsx)(y.j,{options:[{label:"Yes",value:!0},{label:"No",value:!1}],type:x.q.SLIM,name:"isLunchBreak",placeholder:"Select",value:u.isLunchBreak,error:d.isLunchBreak,onChange:e=>{T("isLunchBreak",e),T("lunchBreakDuration",e.value?u.lunchBreakDuration||Object(I.g)(A,{fromEmployerDetails:!0}):void 0),ke(u.date,u.startTime,u.endTime,e.value,u.lunchBreakDuration,u.isTravelCharge.value,u.leaveType.value,A.employerDetails.publicHolidayMultiplier,T)},disabled:u.leaveType.value===x.m.ANNUAL||u.leaveType.value===x.m.WITHOUT_PAY})]}),!1!==A.employerDetails.isLunchBreakEnabled&&(u.isLunchBreak.value?Object(C.jsxs)("div",{className:h.a.CreateTimesheet_withMargin,children:[Object(C.jsx)(y.u,{text:"Lunch Break Duration"}),Object(C.jsx)(H.a,{dateAdapter:S.a,children:Object(C.jsx)(y.o,{ampm:!1,format:"HH:mm",minTime:M()().set("hour",0).set("minutes",0),maxTime:M()().set("hour",10).set("minutes",0),time:u.lunchBreakDuration?M()(u.lunchBreakDuration,"HH:mm"):null,onChange:e=>{const t=w()(new Date(e).getTime()).format("HH:mm");T("lunchBreakDuration",t),ke(u.date,u.startTime,u.endTime,u.isLunchBreak.value,t,u.isTravelCharge.value,u.leaveType.value,A.employerDetails.publicHolidayMultiplier,T)},error:d.lunchBreakDuration,clearable:!0,disabled:u.leaveType.value===x.m.ANNUAL||u.leaveType.value===x.m.WITHOUT_PAY})})]}):Object(C.jsx)("div",{className:h.a.CreateTimesheet_withMargin})),((null===(t=A.employerDetails)||void 0===t?void 0:t.showTravelTime)||(null===(a=A.employerDetails)||void 0===a?void 0:a.isTravelChargeByDefault))&&Object(C.jsxs)("div",{className:h.a.CreateTimesheet_withMargin,children:[Object(C.jsx)(y.u,{text:"Travel Time *"}),Object(C.jsx)(y.j,{options:[{label:"Yes",value:!0},{label:"No",value:!1}],type:x.q.SLIM,name:"isTravelCharge",placeholder:"Select",value:u.isTravelCharge,error:d.isTravelCharge,onChange:e=>{T("isTravelCharge",e),ke(u.date,u.startTime,u.endTime,u.isLunchBreak.value,u.lunchBreakDuration,e.value,u.leaveType.value,A.employerDetails.publicHolidayMultiplier,T)},disabled:u.leaveType.value===x.m.ANNUAL||u.leaveType.value===x.m.WITHOUT_PAY})]}),!1!==A.employerDetails.isLeaveTypeEnabled&&Object(C.jsxs)("div",{className:h.a.CreateTimesheet_withMargin,children:[Object(C.jsx)(y.u,{text:"Leave Type *"}),Object(C.jsx)(y.j,{options:Object.values(x.m).map((e=>({label:e,value:e}))),type:x.q.SLIM,name:"leaveType",placeholder:"Select",value:u.leaveType,error:d.leaveType,onChange:e=>{T("leaveType",e),ke(u.date,u.startTime,u.endTime,u.isLunchBreak.value,u.lunchBreakDuration,u.isTravelCharge.value,e.value,A.employerDetails.publicHolidayMultiplier,T)}})]}),(null===A||void 0===A||null===(i=A.employerDetails)||void 0===i?void 0:i.showVehiclesTab)&&Object(C.jsxs)("div",{className:h.a.CreateTimesheet_withMargin,children:[Object(C.jsx)(y.u,{text:"Vehicle/Plant Used *"}),Object(C.jsx)(y.j,{options:F,type:x.q.SLIM,name:"vehicle",placeholder:"Select Vehicle",value:u.vehicle,error:d.vehicle,onChange:e=>{T("vehicle",e)}})]}),Object(C.jsx)("div",{className:h.a.CreateTimesheet_fullWidth,children:Object(C.jsxs)("div",{className:h.a.CreateTimesheet_hoursDisplay,children:[Object(C.jsx)("span",{className:h.a.CreateTimesheet_hoursDisplay_label,children:"Calculated Hours"}
1),Object(C.jsxs)("span",{className:h.a.CreateTimesheet_hoursDisplay_value,children:[null!==q&&void 0!==q&&q.hoursAndMinutesFormat?Object(f.x)(ee):Number(ee).toFixed(2)," hrs"]})]})})]})]})]})}),Object(C.jsx)("div",{className:h.a.CreateTimesheet_sidebar,children:Object(C.jsxs)("div",{className:h.a.CreateTimesheet_card,children:[Object(C.jsxs)("div",{className:h.a.CreateTimesheet_section,children:[Object(C.jsxs)("div",{className:h.a.CreateTimesheet_sectionHeader,children:[Object(C.jsx)(y.B,{type:x.x.HEADING.XXXS,children:"Work Details"}),Object(C.jsx)("div",{className:h.a.CreateTimesheet_divider})]}),(null===q||void 0===q?void 0:q.isWorkPerformed)&&Object(C.jsx)(y.k,{className:h.a.CreateTimesheet_notesContainer,name:"performedNotes",placeholder:"Performed For:",icon:"description",value:u.performedNotes,error:d.performedNotes,onChange:e=>T("performedNotes",e.target.value)}),Object(C.jsx)(y.k,{className:h.a.CreateTimesheet_notesContainer,name:"notes",placeholder:"Work Performed: (issue/resolution)",icon:"description",value:u.notes,error:d.notes,onChange:e=>T("notes",e.target.value)}),Object(C.jsx)("span",{className:h.a.CreateTimesheet_fieldHelper,children:"This is what the office sees when reviewing timesheets"})]}),Object(C.jsxs)("div",{className:h.a.CreateTimesheet_section,children:[Object(C.jsxs)("div",{className:h.a.CreateTimesheet_sectionHeader,children:[Object(C.jsx)(y.B,{type:x.x.HEADING.XXXS,children:"Costs"}),Object(C.jsx)("div",{className:h.a.CreateTimesheet_divider})]}),Object(C.jsxs)("div",{className:h.a.CreateTimesheet_withCosts,children:[Object(C.jsxs)("div",{className:h.a.CreateTimesheet_withCostItem,children:[Object(C.jsx)(y.i,{name:"itemName",placeholder:"Item name",value:u.itemName,error:d.itemName,onChange:e=>{T("itemName",e.target.value),se(e.target.value)}}),Object(C.jsx)(y.i,{name:"price",placeholder:"Price ($)",value:u.price,error:d.price,onChange:e=>{T("price",e.target.value),oe(e.target.value)}}),Object(C.jsx)(y.q,{icon:"add",className:h.a.CreateTimesheet_addNew,onClick:()=>{""!=le&&ie(ae.concat({itemName:le,price:re||0})),T("itemName",""),T("price",""),se(""),oe("")}})]}),Object(C.jsx)("div",{className:h.a.CreateTimesheet_costsList,children:ae.length>0?ae.map(((e,t)=>Object(C.jsxs)("div",{className:h.a.CreateTimesheet_withCostDetail,children:[Object(C.jsx)("p",{children:e.itemName}),Object(C.jsxs)(y.B,{type:x.x.BODY.MD,colorClass:x.d.GREEN[400],children:["$",e.price]}),Object(C.jsx)(y.q,{icon:"delete",className:h.a.CreateTimesheet_delete,onClick:()=>(e=>{const t=ae.filter(((t,a)=>a!==e));ie(t)})(t)})]},t))):Object(C.jsx)("div",{className:h.a.CreateTimesheet_emptyCosts,children:"No costs added yet"})})]})]}),!(null!==q&&void 0!==q&&q.hideWage)&&Object(C.jsxs)("div",{className:h.a.CreateTimesheet_section,children:[Object(C.jsxs)("div",{className:h.a.CreateTimesheet_withTooltip,children:[Object(C.jsx)(y.B,{type:x.x.HEADING.XXXS,children:"Hourly Wage"}),Object(C.jsx)("a",{"data-tip":!0,"data-for":"hourlyWageTooltip",children:Object(C.jsx)(y.p,{icon:"help",className:h.a.CreateTimesheet_withTooltip_tooltipIcon})}),Object(C.jsx)(o.a,{id:"hourlyWageTooltip",type:"info",effect:"solid",className:h.a.CreateTimesheet_withTooltip_tooltip,children:Object(C.jsx)("span",{children:"This is your hourly wage used to compute total income for this entry."})})]}),Object(C.jsx)(y.i,{name:"hourlyWage",placeholder:"Hourly Wage",value:"".concat(null===(l=A.employerDetails)||void 0===l?void 0:l.wage),disabled:!0})]}),Object(C.jsxs)("div",{className:_()(h.a.CreateTimesheet_card,h.a.CreateTimesheet_summaryCard),children:[Object(C.jsx)(y.B,{type:x.x.HEADING.XXS,className:h.a.CreateTimesheet_summaryTitle,children:"Summary"}),Object(C.jsxs)("div",{className:h.a.CreateTimesheet_summaryStats,children:[Object(C.jsxs)("div",{className:h.a.CreateTimesheet_summaryItem,children:[Object(C.jsx)("span",{className:h.a.CreateTimesheet_summaryLabel,children:"Hours"}),Object(C.jsx)("span",{className:h.a.CreateTimesheet_summaryValue,children:null!==q&&void 0!==q&&q.hoursAndMinutesFormat?Object(f.x)(ee):Number(ee).toFixed(2)})]}),!(null!==q&&void 0!==q&&q.hideWage)&&Object(C.jsxs)("div",{className:h.a.CreateTimesheet_summaryItem,children:[Object(C.jsx)("span",{className:h.a.CreateTimesheet_summaryLabel,children:"Total Income"}),Object(C.jsxs)("span",{className:_()(h.a.CreateTimesheet_summaryValue,h.a.CreateTimesheet_summaryValue___green),children:["$",Number.isNaN(ee*(null===(s=A.employerDetails)||void 0===s?void 0:s.wage))?"0.00":(ee*(null===(r=A.employerDetails)||void 0===r?void 0:r.wage)).toFixed(2)]})]})]})]}),Object(C.jsxs)("div",{className:h.a.CreateTimesheet_buttonGroup,children:[Object(C.jsx)(y.d,{className:h.a.CreateTimesheet_buttonGroup_button,kind:x.b.SUBMIT,icon:Le?"check":xe?"content_copy":"add",disabled:ye||Oe,children:Object(C.jsxs)("span",{className:h.a.CreateTimesheet_buttonGroup_buttonText,children:[Le?"Update Timesheet":xe?"Duplicate Timesheet":n,(ye||Oe)&&Object(C.jsx)(y.z,{size:x.s.XS,colorName:x.f.WHITE,className:h.a.CreateTimesheet_buttonGroup_spinner})]})}),Object(C.jsx)("span",{className:h.a.CreateTimesheet_helperText,children:"You can always edit this later"})]})]})}),(null===A||void 0===A||null===(c=A.employerDetails)||void 0===c?void 0:c.showVehiclesTab)&&Object(C.jsx)(N.c,{isOpen:R,handleClose:()=>Q(!1),vehicleId:null===u||void 0===u||null===(m=u.vehicle)||void 0===m?void 0:m.value,createNewTimesheetFunc:$})]})}})})}}}]);

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.