@gusto/embedded-react-sdk 0.37.0-rc.2 → 0.37.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +11 -11
- package/dist/components/Company/PaySchedule/_parts/Edit.js +6 -6
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
- package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +16 -16
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +1 -1
- package/dist/components/Employee/Terminations/TerminateEmployee/TerminateEmployeePresentation.js +10 -10
- package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +10 -10
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js +44 -46
- package/dist/components/Payroll/Dismissal/DismissalPayPeriodSelection/DismissalPayPeriodSelection.js.map +1 -1
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +25 -23
- package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
- package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +105 -106
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +54 -54
- package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.d.ts +2 -1
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js +29 -27
- package/dist/components/Payroll/PayrollExecutionFlow/PayrollExecutionFlow.js.map +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/index.d.ts +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.d.ts +1 -1
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +60 -60
- package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
- package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.js +22 -20
- package/dist/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.js.map +1 -1
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +143 -143
- package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
- package/dist/components/Payroll/TransitionCreation/TransitionCreationPresentation.js +10 -10
- package/dist/components/Payroll/helpers.d.ts +1 -0
- package/dist/components/Payroll/helpers.js +71 -69
- package/dist/components/Payroll/helpers.js.map +1 -1
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.d.ts +4 -4
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js +86 -89
- package/dist/components/UNSTABLE_Hooks/hooks/useCompensationForm/compensationSchema.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +38 -34
- package/dist/i18n/en/Payroll.PayrollConfiguration.json.js.map +1 -1
- package/dist/i18n/en/Payroll.PayrollOverview.json.js +62 -58
- package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
- package/dist/types/i18next.d.ts +4 -0
- package/package.json +4 -4
|
@@ -1,51 +1,53 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { usePayrollsGetSuspense as
|
|
3
|
-
import { PayrollExecutionFlow as
|
|
2
|
+
import { usePayrollsGetSuspense as m } from "@gusto/embedded-api/react-query/payrollsGet";
|
|
3
|
+
import { PayrollExecutionFlow as c } from "../PayrollExecutionFlow/PayrollExecutionFlow.js";
|
|
4
|
+
import { isDismissalPayroll as f } from "../helpers.js";
|
|
4
5
|
import { useFlow as a } from "../../Flow/useFlow.js";
|
|
5
6
|
import { ensureRequired as l } from "../../../helpers/ensureRequired.js";
|
|
6
|
-
import { BaseComponent as
|
|
7
|
-
import { OffCycleCreation as
|
|
8
|
-
function
|
|
9
|
-
const { companyId: o, payrollType:
|
|
7
|
+
import { BaseComponent as p } from "../../Base/Base.js";
|
|
8
|
+
import { OffCycleCreation as y } from "../OffCycleCreation/OffCycleCreation.js";
|
|
9
|
+
function v() {
|
|
10
|
+
const { companyId: o, payrollType: r, onEvent: e } = a();
|
|
10
11
|
return /* @__PURE__ */ n(
|
|
11
|
-
|
|
12
|
+
y,
|
|
12
13
|
{
|
|
13
14
|
companyId: l(o),
|
|
14
|
-
payrollType:
|
|
15
|
-
onEvent:
|
|
15
|
+
payrollType: r,
|
|
16
|
+
onEvent: e
|
|
16
17
|
}
|
|
17
18
|
);
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
-
const { companyId: o, payrollUuid:
|
|
21
|
-
return /* @__PURE__ */ n(
|
|
20
|
+
function O() {
|
|
21
|
+
const { companyId: o, payrollUuid: r, onEvent: e, withReimbursements: t } = a(), i = l(o), s = l(r);
|
|
22
|
+
return /* @__PURE__ */ n(p, { onEvent: e, children: /* @__PURE__ */ n(
|
|
22
23
|
u,
|
|
23
24
|
{
|
|
24
25
|
companyId: i,
|
|
25
|
-
payrollId:
|
|
26
|
-
onEvent:
|
|
27
|
-
withReimbursements:
|
|
26
|
+
payrollId: s,
|
|
27
|
+
onEvent: e,
|
|
28
|
+
withReimbursements: t
|
|
28
29
|
}
|
|
29
30
|
) });
|
|
30
31
|
}
|
|
31
32
|
function u({
|
|
32
33
|
companyId: o,
|
|
33
|
-
payrollId:
|
|
34
|
-
...
|
|
34
|
+
payrollId: r,
|
|
35
|
+
...e
|
|
35
36
|
}) {
|
|
36
|
-
const { data:
|
|
37
|
+
const { data: t } = m({ companyId: o, payrollId: r }), i = t.payrollShow?.payPeriod;
|
|
37
38
|
return /* @__PURE__ */ n(
|
|
38
|
-
|
|
39
|
+
c,
|
|
39
40
|
{
|
|
40
41
|
companyId: o,
|
|
41
|
-
payrollId:
|
|
42
|
+
payrollId: r,
|
|
42
43
|
initialPayPeriod: i,
|
|
43
|
-
|
|
44
|
+
isDismissalPayroll: f(t.payrollShow?.offCycleReason),
|
|
45
|
+
...e
|
|
44
46
|
}
|
|
45
47
|
);
|
|
46
48
|
}
|
|
47
49
|
export {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
v as OffCycleCreationContextual,
|
|
51
|
+
O as OffCycleExecutionContextual
|
|
50
52
|
};
|
|
51
53
|
//# sourceMappingURL=OffCycleFlowComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OffCycleFlowComponents.js","sources":["../../../../src/components/Payroll/OffCycle/OffCycleFlowComponents.tsx"],"sourcesContent":["import { usePayrollsGetSuspense } from '@gusto/embedded-api/react-query/payrollsGet'\nimport { OffCycleCreation } from '../OffCycleCreation'\nimport {\n PayrollExecutionFlow,\n type PayrollExecutionFlowProps,\n} from '../PayrollExecutionFlow/PayrollExecutionFlow'\nimport type { OffCycleReason } from '../OffCycleReasonSelection'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport type { EventType } from '@/shared/constants'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { BaseComponent } from '@/components/Base/Base'\n\nexport interface OffCycleFlowContextInterface extends FlowContextInterface {\n companyId: string\n payrollUuid?: string\n payrollType?: OffCycleReason\n withReimbursements?: boolean\n}\n\nexport interface OffCycleFlowProps {\n companyId: string\n payrollType?: OffCycleReason\n onEvent: OnEventType<EventType, unknown>\n withReimbursements?: boolean\n}\n\nexport function OffCycleCreationContextual() {\n const { companyId, payrollType, onEvent } = useFlow<OffCycleFlowContextInterface>()\n return (\n <OffCycleCreation\n companyId={ensureRequired(companyId)}\n payrollType={payrollType}\n onEvent={onEvent}\n />\n )\n}\n\nexport function OffCycleExecutionContextual() {\n const { companyId, payrollUuid, onEvent, withReimbursements } =\n useFlow<OffCycleFlowContextInterface>()\n\n const resolvedCompanyId = ensureRequired(companyId)\n const resolvedPayrollId = ensureRequired(payrollUuid)\n\n return (\n <BaseComponent onEvent={onEvent}>\n <OffCycleExecutionWithData\n companyId={resolvedCompanyId}\n payrollId={resolvedPayrollId}\n onEvent={onEvent}\n withReimbursements={withReimbursements}\n />\n </BaseComponent>\n )\n}\n\ntype OffCycleExecutionWithDataProps = Pick<\n PayrollExecutionFlowProps,\n 'companyId' | 'payrollId' | 'onEvent' | 'prefixBreadcrumbs' | 'withReimbursements'\n>\n\nfunction OffCycleExecutionWithData({\n companyId,\n payrollId,\n ...rest\n}: OffCycleExecutionWithDataProps) {\n const { data } = usePayrollsGetSuspense({ companyId, payrollId })\n const initialPayPeriod = data.payrollShow?.payPeriod\n\n return (\n <PayrollExecutionFlow\n companyId={companyId}\n payrollId={payrollId}\n initialPayPeriod={initialPayPeriod}\n {...rest}\n />\n )\n}\n"],"names":["OffCycleCreationContextual","companyId","payrollType","onEvent","useFlow","jsx","OffCycleCreation","ensureRequired","OffCycleExecutionContextual","payrollUuid","withReimbursements","resolvedCompanyId","resolvedPayrollId","BaseComponent","OffCycleExecutionWithData","payrollId","rest","data","usePayrollsGetSuspense","initialPayPeriod","PayrollExecutionFlow"],"mappings":"
|
|
1
|
+
{"version":3,"file":"OffCycleFlowComponents.js","sources":["../../../../src/components/Payroll/OffCycle/OffCycleFlowComponents.tsx"],"sourcesContent":["import { usePayrollsGetSuspense } from '@gusto/embedded-api/react-query/payrollsGet'\nimport { OffCycleCreation } from '../OffCycleCreation'\nimport {\n PayrollExecutionFlow,\n type PayrollExecutionFlowProps,\n} from '../PayrollExecutionFlow/PayrollExecutionFlow'\nimport type { OffCycleReason } from '../OffCycleReasonSelection'\nimport { isDismissalPayroll } from '../helpers'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport type { EventType } from '@/shared/constants'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { BaseComponent } from '@/components/Base/Base'\n\nexport interface OffCycleFlowContextInterface extends FlowContextInterface {\n companyId: string\n payrollUuid?: string\n payrollType?: OffCycleReason\n withReimbursements?: boolean\n}\n\nexport interface OffCycleFlowProps {\n companyId: string\n payrollType?: OffCycleReason\n onEvent: OnEventType<EventType, unknown>\n withReimbursements?: boolean\n}\n\nexport function OffCycleCreationContextual() {\n const { companyId, payrollType, onEvent } = useFlow<OffCycleFlowContextInterface>()\n return (\n <OffCycleCreation\n companyId={ensureRequired(companyId)}\n payrollType={payrollType}\n onEvent={onEvent}\n />\n )\n}\n\nexport function OffCycleExecutionContextual() {\n const { companyId, payrollUuid, onEvent, withReimbursements } =\n useFlow<OffCycleFlowContextInterface>()\n\n const resolvedCompanyId = ensureRequired(companyId)\n const resolvedPayrollId = ensureRequired(payrollUuid)\n\n return (\n <BaseComponent onEvent={onEvent}>\n <OffCycleExecutionWithData\n companyId={resolvedCompanyId}\n payrollId={resolvedPayrollId}\n onEvent={onEvent}\n withReimbursements={withReimbursements}\n />\n </BaseComponent>\n )\n}\n\ntype OffCycleExecutionWithDataProps = Pick<\n PayrollExecutionFlowProps,\n 'companyId' | 'payrollId' | 'onEvent' | 'prefixBreadcrumbs' | 'withReimbursements'\n>\n\nfunction OffCycleExecutionWithData({\n companyId,\n payrollId,\n ...rest\n}: OffCycleExecutionWithDataProps) {\n const { data } = usePayrollsGetSuspense({ companyId, payrollId })\n const initialPayPeriod = data.payrollShow?.payPeriod\n\n return (\n <PayrollExecutionFlow\n companyId={companyId}\n payrollId={payrollId}\n initialPayPeriod={initialPayPeriod}\n isDismissalPayroll={isDismissalPayroll(data.payrollShow?.offCycleReason)}\n {...rest}\n />\n )\n}\n"],"names":["OffCycleCreationContextual","companyId","payrollType","onEvent","useFlow","jsx","OffCycleCreation","ensureRequired","OffCycleExecutionContextual","payrollUuid","withReimbursements","resolvedCompanyId","resolvedPayrollId","BaseComponent","OffCycleExecutionWithData","payrollId","rest","data","usePayrollsGetSuspense","initialPayPeriod","PayrollExecutionFlow","isDismissalPayroll"],"mappings":";;;;;;;;AA4BO,SAASA,IAA6B;AAC3C,QAAM,EAAE,WAAAC,GAAW,aAAAC,GAAa,SAAAC,EAAA,IAAYC,EAAA;AAC5C,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAeN,CAAS;AAAA,MACnC,aAAAC;AAAA,MACA,SAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;AAEO,SAASK,IAA8B;AAC5C,QAAM,EAAE,WAAAP,GAAW,aAAAQ,GAAa,SAAAN,GAAS,oBAAAO,EAAA,IACvCN,EAAA,GAEIO,IAAoBJ,EAAeN,CAAS,GAC5CW,IAAoBL,EAAeE,CAAW;AAEpD,SACE,gBAAAJ,EAACQ,KAAc,SAAAV,GACb,UAAA,gBAAAE;AAAA,IAACS;AAAA,IAAA;AAAA,MACC,WAAWH;AAAA,MACX,WAAWC;AAAA,MACX,SAAAT;AAAA,MACA,oBAAAO;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAOA,SAASI,EAA0B;AAAA,EACjC,WAAAb;AAAA,EACA,WAAAc;AAAA,EACA,GAAGC;AACL,GAAmC;AACjC,QAAM,EAAE,MAAAC,EAAA,IAASC,EAAuB,EAAE,WAAAjB,GAAW,WAAAc,GAAW,GAC1DI,IAAmBF,EAAK,aAAa;AAE3C,SACE,gBAAAZ;AAAA,IAACe;AAAA,IAAA;AAAA,MACC,WAAAnB;AAAA,MACA,WAAAc;AAAA,MACA,kBAAAI;AAAA,MACA,oBAAoBE,EAAmBJ,EAAK,aAAa,cAAc;AAAA,MACtE,GAAGD;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js
CHANGED
|
@@ -2,8 +2,8 @@ import { jsxs as i, jsx as a } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTranslation as l } from "react-i18next";
|
|
3
3
|
import r from "./OffCyclePayPeriodDateFormPresentation.module.scss.js";
|
|
4
4
|
import { useI18n as o } from "../../../i18n/I18n.js";
|
|
5
|
-
import { CheckboxField as c } from "../../Common/Fields/CheckboxField/CheckboxField.js";
|
|
6
5
|
import { DatePickerField as t } from "../../Common/Fields/DatePickerField/DatePickerField.js";
|
|
6
|
+
import { CheckboxField as c } from "../../Common/Fields/CheckboxField/CheckboxField.js";
|
|
7
7
|
function D() {
|
|
8
8
|
o("Payroll.OffCyclePayPeriodDateForm");
|
|
9
9
|
const { t: e } = l("Payroll.OffCyclePayPeriodDateForm");
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import { jsx as S, jsxs as
|
|
2
|
-
import { useState as d, useEffect as G } from "react";
|
|
3
|
-
import { usePayrollsGetSuspense as
|
|
4
|
-
import { payrollsCalculate as
|
|
5
|
-
import { useGustoEmbeddedContext as
|
|
6
|
-
import { PayrollProcessingRequestStatus as
|
|
7
|
-
import { useTranslation as
|
|
8
|
-
import { usePayrollsUpdateMutation as
|
|
9
|
-
import { usePayrollsCalculateGrossUpMutation as
|
|
10
|
-
import { usePayrollsGetBlockersSuspense as
|
|
11
|
-
import { payrollSubmitHandler as
|
|
12
|
-
import { PayrollConfigurationPresentation as
|
|
13
|
-
import { usePayrollConfigurationData as
|
|
14
|
-
import { isGrossUpEligible as
|
|
15
|
-
import { BaseComponent as
|
|
1
|
+
import { jsx as S, jsxs as ne, Fragment as pe } from "react/jsx-runtime";
|
|
2
|
+
import { useState as d, useRef as ue, useEffect as G } from "react";
|
|
3
|
+
import { usePayrollsGetSuspense as ce } from "@gusto/embedded-api/react-query/payrollsGet";
|
|
4
|
+
import { payrollsCalculate as me } from "@gusto/embedded-api/funcs/payrollsCalculate";
|
|
5
|
+
import { useGustoEmbeddedContext as ye } from "@gusto/embedded-api/react-query/_context";
|
|
6
|
+
import { PayrollProcessingRequestStatus as w } from "@gusto/embedded-api/models/components/payrollprocessingrequest";
|
|
7
|
+
import { useTranslation as de } from "react-i18next";
|
|
8
|
+
import { usePayrollsUpdateMutation as fe } from "@gusto/embedded-api/react-query/payrollsUpdate";
|
|
9
|
+
import { usePayrollsCalculateGrossUpMutation as Ce } from "@gusto/embedded-api/react-query/payrollsCalculateGrossUp";
|
|
10
|
+
import { usePayrollsGetBlockersSuspense as Se } from "@gusto/embedded-api/react-query/payrollsGetBlockers";
|
|
11
|
+
import { payrollSubmitHandler as Pe } from "../PayrollBlocker/payrollHelpers.js";
|
|
12
|
+
import { PayrollConfigurationPresentation as Ue } from "./PayrollConfigurationPresentation.js";
|
|
13
|
+
import { usePayrollConfigurationData as ge } from "./usePayrollConfigurationData.js";
|
|
14
|
+
import { isGrossUpEligible as he, getGrossUpTargetCompensationName as Le } from "./grossUpHelpers.js";
|
|
15
|
+
import { BaseComponent as we } from "../../Base/Base.js";
|
|
16
16
|
import { componentEvents as r } from "../../../shared/constants.js";
|
|
17
|
-
import { useComponentDictionary as
|
|
18
|
-
import { useBase as
|
|
19
|
-
import { useDateFormatter as
|
|
20
|
-
import { SDKInternalError as
|
|
21
|
-
import { GrossUpModal as
|
|
22
|
-
const
|
|
23
|
-
function
|
|
24
|
-
return /* @__PURE__ */ S(
|
|
17
|
+
import { useComponentDictionary as _e, useI18n as Re } from "../../../i18n/I18n.js";
|
|
18
|
+
import { useBase as Ae } from "../../Base/useBase.js";
|
|
19
|
+
import { useDateFormatter as De } from "../../../hooks/useDateFormatter.js";
|
|
20
|
+
import { SDKInternalError as x } from "../../../types/sdkError.js";
|
|
21
|
+
import { GrossUpModal as Ee } from "../GrossUpModal/GrossUpModal.js";
|
|
22
|
+
const Oe = (o) => o?.status === w.Calculating, be = (o, n) => n != null && (o?.status === w.CalculateSuccess || o == null);
|
|
23
|
+
function et(o) {
|
|
24
|
+
return /* @__PURE__ */ S(we, { ...o, children: /* @__PURE__ */ S(Te, { ...o, children: o.children }) });
|
|
25
25
|
}
|
|
26
|
-
const
|
|
26
|
+
const Te = ({
|
|
27
27
|
onEvent: o,
|
|
28
28
|
companyId: n,
|
|
29
29
|
payrollId: p,
|
|
30
|
-
dictionary:
|
|
31
|
-
alerts:
|
|
32
|
-
withReimbursements:
|
|
30
|
+
dictionary: N,
|
|
31
|
+
alerts: M,
|
|
32
|
+
withReimbursements: Y = !0
|
|
33
33
|
}) => {
|
|
34
|
-
|
|
35
|
-
const { t: u } =
|
|
36
|
-
employeeDetails:
|
|
37
|
-
employeeCompensations:
|
|
38
|
-
paySchedule:
|
|
39
|
-
payPeriod:
|
|
40
|
-
payrollCategory:
|
|
41
|
-
pagination:
|
|
42
|
-
isLoading:
|
|
43
|
-
refetch:
|
|
44
|
-
} =
|
|
34
|
+
_e("Payroll.PayrollConfiguration", N), Re("Payroll.PayrollConfiguration");
|
|
35
|
+
const { t: u } = de("Payroll.PayrollConfiguration"), { baseSubmitHandler: f } = Ae(), c = De(), [l, m] = d(!1), [P, _] = d(!1), U = ue(null), B = ye(), {
|
|
36
|
+
employeeDetails: j,
|
|
37
|
+
employeeCompensations: R,
|
|
38
|
+
paySchedule: F,
|
|
39
|
+
payPeriod: W,
|
|
40
|
+
payrollCategory: g,
|
|
41
|
+
pagination: q,
|
|
42
|
+
isLoading: I,
|
|
43
|
+
refetch: A
|
|
44
|
+
} = ge({
|
|
45
45
|
companyId: n,
|
|
46
46
|
payrollId: p,
|
|
47
47
|
isCalculating: l || P
|
|
48
|
-
}), { data: a } =
|
|
48
|
+
}), { data: a } = ce(
|
|
49
49
|
{
|
|
50
50
|
companyId: n,
|
|
51
51
|
payrollId: p,
|
|
52
52
|
include: ["taxes", "benefits", "deductions", "payroll_status_meta"]
|
|
53
53
|
},
|
|
54
54
|
{ refetchInterval: l ? 5e3 : !1 }
|
|
55
|
-
), { mutateAsync: D, isPending:
|
|
56
|
-
|
|
57
|
-
},
|
|
55
|
+
), { mutateAsync: D, isPending: H } = fe(), { mutateAsync: K } = Ce(), [y, E] = d(null), [V, h] = d(!1), O = he(g), C = Le(g), J = (e) => {
|
|
56
|
+
E(e), h(!0), o(r.RUN_PAYROLL_GROSS_UP_SELECTED, { employeeUuid: e });
|
|
57
|
+
}, z = async (e) => {
|
|
58
58
|
if (!y) return null;
|
|
59
59
|
let t = null;
|
|
60
60
|
return await f(null, async () => {
|
|
61
|
-
t = (await
|
|
61
|
+
t = (await K({
|
|
62
62
|
request: {
|
|
63
63
|
payrollUuid: p,
|
|
64
64
|
payrollGrossUpRequest: {
|
|
@@ -72,22 +72,22 @@ const Oe = ({
|
|
|
72
72
|
employeeUuid: y
|
|
73
73
|
});
|
|
74
74
|
}), t;
|
|
75
|
-
},
|
|
75
|
+
}, Q = async (e) => {
|
|
76
76
|
if (!y || !C)
|
|
77
|
-
throw new
|
|
77
|
+
throw new x(
|
|
78
78
|
"Unable to apply gross-up: missing employee or target compensation."
|
|
79
79
|
);
|
|
80
|
-
const t =
|
|
80
|
+
const t = R.find((s) => s.employeeUuid === y);
|
|
81
81
|
if (!t)
|
|
82
|
-
throw new
|
|
83
|
-
const i = t.fixedCompensations ?? [],
|
|
82
|
+
throw new x("Unable to apply gross-up: employee compensation not found.");
|
|
83
|
+
const i = t.fixedCompensations ?? [], se = i.some(
|
|
84
84
|
(s) => s.name?.toLowerCase() === C.toLowerCase()
|
|
85
85
|
), k = i.map((s) => ({
|
|
86
86
|
name: s.name,
|
|
87
87
|
jobUuid: s.jobUuid,
|
|
88
88
|
amount: s.name?.toLowerCase() === C.toLowerCase() ? e : "0"
|
|
89
89
|
}));
|
|
90
|
-
if (!
|
|
90
|
+
if (!se) {
|
|
91
91
|
const s = t.hourlyCompensations?.[0]?.jobUuid ?? i[0]?.jobUuid ?? "";
|
|
92
92
|
k.push({
|
|
93
93
|
name: C,
|
|
@@ -95,18 +95,18 @@ const Oe = ({
|
|
|
95
95
|
amount: e
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
-
const
|
|
98
|
+
const le = (t.hourlyCompensations ?? []).map((s) => ({
|
|
99
99
|
name: s.name,
|
|
100
100
|
jobUuid: s.jobUuid,
|
|
101
101
|
hours: "0"
|
|
102
|
-
})),
|
|
102
|
+
})), re = (t.paidTimeOff ?? []).map((s) => ({
|
|
103
103
|
name: s.name,
|
|
104
104
|
hours: "0"
|
|
105
|
-
})),
|
|
105
|
+
})), ie = T({
|
|
106
106
|
...t,
|
|
107
107
|
fixedCompensations: k,
|
|
108
|
-
hourlyCompensations:
|
|
109
|
-
paidTimeOff:
|
|
108
|
+
hourlyCompensations: le,
|
|
109
|
+
paidTimeOff: re
|
|
110
110
|
});
|
|
111
111
|
await f({}, async () => {
|
|
112
112
|
const s = await D({
|
|
@@ -114,30 +114,30 @@ const Oe = ({
|
|
|
114
114
|
companyId: n,
|
|
115
115
|
payrollId: p,
|
|
116
116
|
payrollUpdate: {
|
|
117
|
-
employeeCompensations: [{ ...
|
|
117
|
+
employeeCompensations: [{ ...ie, excluded: !1 }]
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
});
|
|
121
121
|
o(r.RUN_PAYROLL_EMPLOYEE_SAVED, {
|
|
122
122
|
payrollPrepared: s.payrollPrepared
|
|
123
|
-
}), await
|
|
124
|
-
}),
|
|
125
|
-
},
|
|
123
|
+
}), await A();
|
|
124
|
+
}), E(null), h(!1);
|
|
125
|
+
}, X = async (e) => {
|
|
126
126
|
try {
|
|
127
|
-
await
|
|
127
|
+
await Q(e);
|
|
128
128
|
} catch {
|
|
129
129
|
}
|
|
130
|
-
}, { data:
|
|
130
|
+
}, { data: Z } = Se({
|
|
131
131
|
companyUuid: n
|
|
132
|
-
}),
|
|
132
|
+
}), b = (Z.payrollBlockers ?? []).map((e) => ({
|
|
133
133
|
key: e.key,
|
|
134
134
|
message: e.message
|
|
135
|
-
})), [
|
|
136
|
-
|
|
137
|
-
const e = await
|
|
138
|
-
|
|
135
|
+
})), [$, L] = d(b), v = async () => {
|
|
136
|
+
L([]), U.current = a.payrollShow?.calculatedAt?.getTime() ?? null, await f({}, async () => {
|
|
137
|
+
const e = await Pe(async () => {
|
|
138
|
+
_(!0);
|
|
139
139
|
try {
|
|
140
|
-
const t = await
|
|
140
|
+
const t = await me(B, {
|
|
141
141
|
companyId: n,
|
|
142
142
|
payrollId: p
|
|
143
143
|
});
|
|
@@ -145,18 +145,18 @@ const Oe = ({
|
|
|
145
145
|
throw t.error;
|
|
146
146
|
m(!0);
|
|
147
147
|
} finally {
|
|
148
|
-
|
|
148
|
+
_(!1);
|
|
149
149
|
}
|
|
150
150
|
});
|
|
151
|
-
!e.success && e.blockers.length > 0 &&
|
|
151
|
+
!e.success && e.blockers.length > 0 && L(e.blockers);
|
|
152
152
|
});
|
|
153
|
-
},
|
|
153
|
+
}, ee = (e) => {
|
|
154
154
|
o(r.RUN_PAYROLL_EMPLOYEE_EDIT, {
|
|
155
155
|
employeeId: e.uuid,
|
|
156
156
|
firstName: e.firstName,
|
|
157
157
|
lastName: e.lastName
|
|
158
158
|
});
|
|
159
|
-
},
|
|
159
|
+
}, T = ({
|
|
160
160
|
paymentMethod: e,
|
|
161
161
|
reimbursements: t,
|
|
162
162
|
...i
|
|
@@ -164,11 +164,11 @@ const Oe = ({
|
|
|
164
164
|
...i,
|
|
165
165
|
...e && e !== "Historical" ? { paymentMethod: e } : {},
|
|
166
166
|
memo: i.memo || void 0
|
|
167
|
-
}),
|
|
167
|
+
}), te = async (e) => {
|
|
168
168
|
o(r.RUN_PAYROLL_EMPLOYEE_SKIP, {
|
|
169
169
|
employeeId: e.employeeUuid
|
|
170
170
|
}), await f({}, async () => {
|
|
171
|
-
const t =
|
|
171
|
+
const t = T(e), i = await D({
|
|
172
172
|
request: {
|
|
173
173
|
companyId: n,
|
|
174
174
|
payrollId: p,
|
|
@@ -181,16 +181,15 @@ const Oe = ({
|
|
|
181
181
|
});
|
|
182
182
|
o(r.RUN_PAYROLL_EMPLOYEE_SAVED, {
|
|
183
183
|
payrollPrepared: i.payrollPrepared
|
|
184
|
-
}), await
|
|
184
|
+
}), await A();
|
|
185
185
|
});
|
|
186
186
|
}, oe = () => {
|
|
187
187
|
o(r.RUN_PAYROLL_BLOCKERS_VIEW_ALL);
|
|
188
188
|
};
|
|
189
189
|
G(() => {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
) && (o(r.RUN_PAYROLL_CALCULATED, {
|
|
190
|
+
Oe(a.payrollShow?.processingRequest) && !l && (U.current = a.payrollShow?.calculatedAt?.getTime() ?? null, m(!0));
|
|
191
|
+
const e = a.payrollShow?.calculatedAt, t = e?.getTime() !== U.current;
|
|
192
|
+
l && t && be(a.payrollShow?.processingRequest, e) && (o(r.RUN_PAYROLL_CALCULATED, {
|
|
194
193
|
payrollId: p,
|
|
195
194
|
alert: {
|
|
196
195
|
type: "success",
|
|
@@ -198,7 +197,7 @@ const Oe = ({
|
|
|
198
197
|
alertKey: "progressSaved"
|
|
199
198
|
},
|
|
200
199
|
payPeriod: a.payrollShow?.payPeriod
|
|
201
|
-
}),
|
|
200
|
+
}), L([]), m(!1)), l && a.payrollShow?.processingRequest?.status === w.ProcessingFailed && (o(r.RUN_PAYROLL_PROCESSING_FAILED), m(!1));
|
|
202
201
|
}, [
|
|
203
202
|
a.payrollShow?.processingRequest?.status,
|
|
204
203
|
a.payrollShow?.calculatedAt,
|
|
@@ -215,7 +214,7 @@ const Oe = ({
|
|
|
215
214
|
clearTimeout(t);
|
|
216
215
|
};
|
|
217
216
|
}, [l, o]);
|
|
218
|
-
const
|
|
217
|
+
const ae = a.payrollShow?.payrollStatusMeta?.payrollLate && a.payrollShow.payrollStatusMeta.initialCheckDate && a.payrollShow.payrollStatusMeta.expectedDebitTime && a.payrollShow.payrollStatusMeta.expectedCheckDate ? {
|
|
219
218
|
label: u("alerts.payrollLate", {
|
|
220
219
|
initialCheckDate: c.formatShortWithWeekday(
|
|
221
220
|
a.payrollShow.payrollStatusMeta.initialCheckDate
|
|
@@ -238,46 +237,46 @@ const Oe = ({
|
|
|
238
237
|
content: u("alerts.directDepositDeadlineText"),
|
|
239
238
|
variant: "info"
|
|
240
239
|
} : void 0;
|
|
241
|
-
return /* @__PURE__ */
|
|
240
|
+
return /* @__PURE__ */ ne(pe, { children: [
|
|
242
241
|
/* @__PURE__ */ S(
|
|
243
|
-
|
|
242
|
+
Ue,
|
|
244
243
|
{
|
|
245
|
-
onCalculatePayroll:
|
|
246
|
-
isCalculateDisabled:
|
|
247
|
-
onEdit:
|
|
248
|
-
onToggleExclude:
|
|
244
|
+
onCalculatePayroll: v,
|
|
245
|
+
isCalculateDisabled: b.length > 0,
|
|
246
|
+
onEdit: ee,
|
|
247
|
+
onToggleExclude: te,
|
|
249
248
|
onViewBlockers: oe,
|
|
250
|
-
employeeCompensations:
|
|
251
|
-
employeeDetails:
|
|
252
|
-
payPeriod:
|
|
253
|
-
paySchedule:
|
|
254
|
-
payrollCategory:
|
|
255
|
-
alerts:
|
|
256
|
-
payrollAlert:
|
|
257
|
-
isPending: l ||
|
|
249
|
+
employeeCompensations: R,
|
|
250
|
+
employeeDetails: j,
|
|
251
|
+
payPeriod: W,
|
|
252
|
+
paySchedule: F,
|
|
253
|
+
payrollCategory: g,
|
|
254
|
+
alerts: M,
|
|
255
|
+
payrollAlert: ae,
|
|
256
|
+
isPending: l || I || H || P,
|
|
258
257
|
isCalculating: P || l,
|
|
259
|
-
payrollBlockers:
|
|
260
|
-
pagination:
|
|
261
|
-
withReimbursements:
|
|
262
|
-
grossUpEnabled:
|
|
263
|
-
onGrossUpSelect:
|
|
258
|
+
payrollBlockers: $,
|
|
259
|
+
pagination: q,
|
|
260
|
+
withReimbursements: Y,
|
|
261
|
+
grossUpEnabled: O,
|
|
262
|
+
onGrossUpSelect: J
|
|
264
263
|
}
|
|
265
264
|
),
|
|
266
|
-
|
|
267
|
-
|
|
265
|
+
O && /* @__PURE__ */ S(
|
|
266
|
+
Ee,
|
|
268
267
|
{
|
|
269
|
-
isOpen:
|
|
270
|
-
onCalculateGrossUp:
|
|
271
|
-
onApply:
|
|
268
|
+
isOpen: V,
|
|
269
|
+
onCalculateGrossUp: z,
|
|
270
|
+
onApply: X,
|
|
272
271
|
onCancel: () => {
|
|
273
|
-
|
|
272
|
+
h(!1);
|
|
274
273
|
}
|
|
275
274
|
}
|
|
276
275
|
)
|
|
277
276
|
] });
|
|
278
277
|
};
|
|
279
278
|
export {
|
|
280
|
-
|
|
281
|
-
|
|
279
|
+
et as PayrollConfiguration,
|
|
280
|
+
Te as Root
|
|
282
281
|
};
|
|
283
282
|
//# sourceMappingURL=PayrollConfiguration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayrollConfiguration.js","sources":["../../../../src/components/Payroll/PayrollConfiguration/PayrollConfiguration.tsx"],"sourcesContent":["import { useEffect, useState, type ReactNode } from 'react'\nimport { usePayrollsGetSuspense } from '@gusto/embedded-api/react-query/payrollsGet'\nimport { payrollsCalculate } from '@gusto/embedded-api/funcs/payrollsCalculate'\nimport { useGustoEmbeddedContext } from '@gusto/embedded-api/react-query/_context'\nimport type { PayrollProcessingRequest } from '@gusto/embedded-api/models/components/payrollprocessingrequest'\nimport { PayrollProcessingRequestStatus } from '@gusto/embedded-api/models/components/payrollprocessingrequest'\nimport type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport { useTranslation } from 'react-i18next'\nimport { usePayrollsUpdateMutation } from '@gusto/embedded-api/react-query/payrollsUpdate'\nimport { usePayrollsCalculateGrossUpMutation } from '@gusto/embedded-api/react-query/payrollsCalculateGrossUp'\nimport type { PayrollEmployeeCompensationsType } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollUpdateEmployeeCompensations } from '@gusto/embedded-api/models/components/payrollupdate'\nimport { usePayrollsGetBlockersSuspense } from '@gusto/embedded-api/react-query/payrollsGetBlockers'\nimport { payrollSubmitHandler, type ApiPayrollBlocker } from '../PayrollBlocker/payrollHelpers'\nimport { GrossUpModal } from '../GrossUpModal'\nimport { PayrollConfigurationPresentation } from './PayrollConfigurationPresentation'\nimport { usePayrollConfigurationData } from './usePayrollConfigurationData'\nimport { getGrossUpTargetCompensationName, isGrossUpEligible } from './grossUpHelpers'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { useBase } from '@/components/Base'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport { SDKInternalError } from '@/types/sdkError'\n\nconst isCalculatingStatus = (processingRequest?: PayrollProcessingRequest | null) =>\n processingRequest?.status === PayrollProcessingRequestStatus.Calculating\n\nconst isCalculatedStatus = (\n processingRequest?: PayrollProcessingRequest | null,\n calculatedAt?: Date | null,\n) =>\n calculatedAt != null &&\n (processingRequest?.status === PayrollProcessingRequestStatus.CalculateSuccess ||\n processingRequest == null)\n\ninterface PayrollConfigurationProps extends BaseComponentInterface<'Payroll.PayrollConfiguration'> {\n companyId: string\n payrollId: string\n alerts?: ReactNode\n withReimbursements?: boolean\n}\n\nexport function PayrollConfiguration(props: PayrollConfigurationProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport const Root = ({\n onEvent,\n companyId,\n payrollId,\n dictionary,\n alerts,\n withReimbursements = true,\n}: PayrollConfigurationProps) => {\n useComponentDictionary('Payroll.PayrollConfiguration', dictionary)\n useI18n('Payroll.PayrollConfiguration')\n const { t } = useTranslation('Payroll.PayrollConfiguration')\n const { baseSubmitHandler } = useBase()\n const dateFormatter = useDateFormatter()\n\n const [isPolling, setIsPolling] = useState(false)\n const [isCalculatingPayroll, setIsCalculatingPayroll] = useState(false)\n const gustoClient = useGustoEmbeddedContext()\n\n const {\n employeeDetails,\n employeeCompensations,\n paySchedule,\n payPeriod,\n payrollCategory,\n pagination,\n isLoading,\n refetch,\n } = usePayrollConfigurationData({\n companyId,\n payrollId,\n isCalculating: isPolling || isCalculatingPayroll,\n })\n\n const { data: payrollData } = usePayrollsGetSuspense(\n {\n companyId,\n payrollId,\n include: ['taxes', 'benefits', 'deductions', 'payroll_status_meta'],\n },\n { refetchInterval: isPolling ? 5_000 : false },\n )\n\n const { mutateAsync: updatePayroll, isPending: isUpdatingPayroll } = usePayrollsUpdateMutation()\n\n const { mutateAsync: calculateGrossUpMutation } = usePayrollsCalculateGrossUpMutation()\n\n const [grossUpEmployeeUuid, setGrossUpEmployeeUuid] = useState<string | null>(null)\n const [isGrossUpModalOpen, setIsGrossUpModalOpen] = useState(false)\n\n const grossUpEnabled = isGrossUpEligible(payrollCategory)\n const grossUpTargetCompensation = getGrossUpTargetCompensationName(payrollCategory)\n\n const onGrossUpSelect = (employeeUuid: string) => {\n setGrossUpEmployeeUuid(employeeUuid)\n setIsGrossUpModalOpen(true)\n onEvent(componentEvents.RUN_PAYROLL_GROSS_UP_SELECTED, { employeeUuid })\n }\n\n const onCalculateGrossUp = async (netPay: number): Promise<string | null> => {\n if (!grossUpEmployeeUuid) return null\n let grossUp: string | null = null\n\n await baseSubmitHandler(null, async () => {\n const result = await calculateGrossUpMutation({\n request: {\n payrollUuid: payrollId,\n payrollGrossUpRequest: {\n employeeUuid: grossUpEmployeeUuid,\n netPay: netPay.toString(),\n },\n },\n })\n\n grossUp = result.payrollGrossUpResponse?.grossUp ?? null\n\n if (grossUp) {\n onEvent(componentEvents.RUN_PAYROLL_GROSS_UP_CALCULATED, {\n grossUp,\n netPay,\n employeeUuid: grossUpEmployeeUuid,\n })\n }\n })\n\n return grossUp\n }\n\n const onGrossUpApply = async (grossAmount: string) => {\n if (!grossUpEmployeeUuid || !grossUpTargetCompensation) {\n throw new SDKInternalError(\n 'Unable to apply gross-up: missing employee or target compensation.',\n )\n }\n\n const employeeComp = employeeCompensations.find(ec => ec.employeeUuid === grossUpEmployeeUuid)\n if (!employeeComp) {\n throw new SDKInternalError('Unable to apply gross-up: employee compensation not found.')\n }\n\n const existingFixed = employeeComp.fixedCompensations ?? []\n const hasTargetCompensation = existingFixed.some(\n fc => fc.name?.toLowerCase() === grossUpTargetCompensation.toLowerCase(),\n )\n\n const updatedFixedCompensations = existingFixed.map(fc => ({\n name: fc.name,\n jobUuid: fc.jobUuid,\n amount:\n fc.name?.toLowerCase() === grossUpTargetCompensation.toLowerCase() ? grossAmount : '0',\n }))\n\n if (!hasTargetCompensation) {\n const primaryJobUuid =\n employeeComp.hourlyCompensations?.[0]?.jobUuid ?? existingFixed[0]?.jobUuid ?? ''\n updatedFixedCompensations.push({\n name: grossUpTargetCompensation,\n jobUuid: primaryJobUuid,\n amount: grossAmount,\n })\n }\n\n const updatedHourlyCompensations = (employeeComp.hourlyCompensations ?? []).map(hc => ({\n name: hc.name,\n jobUuid: hc.jobUuid,\n hours: '0',\n }))\n\n const updatedPaidTimeOff = (employeeComp.paidTimeOff ?? []).map(pto => ({\n name: pto.name,\n hours: '0',\n }))\n\n const transformedCompensation = transformEmployeeCompensation({\n ...employeeComp,\n fixedCompensations: updatedFixedCompensations,\n hourlyCompensations: updatedHourlyCompensations,\n paidTimeOff: updatedPaidTimeOff,\n })\n\n await baseSubmitHandler({}, async () => {\n const result = await updatePayroll({\n request: {\n companyId,\n payrollId,\n payrollUpdate: {\n employeeCompensations: [{ ...transformedCompensation, excluded: false }],\n },\n },\n })\n onEvent(componentEvents.RUN_PAYROLL_EMPLOYEE_SAVED, {\n payrollPrepared: result.payrollPrepared,\n })\n await refetch()\n })\n\n setGrossUpEmployeeUuid(null)\n setIsGrossUpModalOpen(false)\n }\n\n const handleGrossUpApply = async (grossAmount: string) => {\n try {\n await onGrossUpApply(grossAmount)\n } catch {\n // Modal stays open; error is surfaced by baseSubmitHandler\n }\n }\n\n const { data: blockersData } = usePayrollsGetBlockersSuspense({\n companyUuid: companyId,\n })\n\n const payrollBlockerList = blockersData.payrollBlockers ?? []\n\n const blockersFromApi: ApiPayrollBlocker[] = payrollBlockerList.map(blocker => ({\n key: blocker.key,\n message: blocker.message,\n }))\n\n const [payrollBlockers, setPayrollBlockers] = useState(blockersFromApi)\n\n const onCalculatePayroll = async () => {\n setPayrollBlockers([])\n\n await baseSubmitHandler({}, async () => {\n const result = await payrollSubmitHandler(async () => {\n setIsCalculatingPayroll(true)\n try {\n const calcResult = await payrollsCalculate(gustoClient, {\n companyId,\n payrollId,\n })\n if (!calcResult.ok) {\n throw calcResult.error\n }\n setIsPolling(true)\n } finally {\n setIsCalculatingPayroll(false)\n }\n })\n\n if (!result.success && result.blockers.length > 0) {\n setPayrollBlockers(result.blockers)\n }\n })\n }\n\n const onEdit = (employee: Employee) => {\n onEvent(componentEvents.RUN_PAYROLL_EMPLOYEE_EDIT, {\n employeeId: employee.uuid,\n firstName: employee.firstName,\n lastName: employee.lastName,\n })\n }\n\n const transformEmployeeCompensation = ({\n paymentMethod,\n reimbursements,\n ...compensation\n }: PayrollEmployeeCompensationsType): PayrollUpdateEmployeeCompensations => {\n return {\n ...compensation,\n ...(paymentMethod && paymentMethod !== 'Historical' ? { paymentMethod } : {}),\n memo: compensation.memo || undefined,\n }\n }\n\n const onToggleExclude = async (employeeCompensation: PayrollEmployeeCompensationsType) => {\n onEvent(componentEvents.RUN_PAYROLL_EMPLOYEE_SKIP, {\n employeeId: employeeCompensation.employeeUuid,\n })\n await baseSubmitHandler({}, async () => {\n const transformedCompensation = transformEmployeeCompensation(employeeCompensation)\n const result = await updatePayroll({\n request: {\n companyId,\n payrollId,\n payrollUpdate: {\n employeeCompensations: [\n { ...transformedCompensation, excluded: !transformedCompensation.excluded },\n ],\n },\n },\n })\n onEvent(componentEvents.RUN_PAYROLL_EMPLOYEE_SAVED, {\n payrollPrepared: result.payrollPrepared,\n })\n await refetch()\n })\n }\n\n const onViewBlockers = () => {\n onEvent(componentEvents.RUN_PAYROLL_BLOCKERS_VIEW_ALL)\n }\n\n useEffect(() => {\n if (isCalculatingStatus(payrollData.payrollShow?.processingRequest) && !isPolling) {\n setIsPolling(true)\n }\n if (\n isPolling &&\n isCalculatedStatus(\n payrollData.payrollShow?.processingRequest,\n payrollData.payrollShow?.calculatedAt,\n )\n ) {\n onEvent(componentEvents.RUN_PAYROLL_CALCULATED, {\n payrollId,\n alert: {\n type: 'success',\n title: t('alerts.progressSaved'),\n alertKey: 'progressSaved',\n },\n payPeriod: payrollData.payrollShow?.payPeriod,\n })\n setPayrollBlockers([])\n setIsPolling(false)\n }\n if (\n isPolling &&\n payrollData.payrollShow?.processingRequest?.status ===\n PayrollProcessingRequestStatus.ProcessingFailed\n ) {\n onEvent(componentEvents.RUN_PAYROLL_PROCESSING_FAILED)\n setIsPolling(false)\n }\n }, [\n payrollData.payrollShow?.processingRequest?.status,\n payrollData.payrollShow?.calculatedAt,\n isPolling,\n onEvent,\n t,\n payrollId,\n ])\n\n useEffect(() => {\n if (!isPolling) return\n\n const POLLING_TIMEOUT_MS = 3 * 60 * 1000\n const timeoutId = setTimeout(() => {\n onEvent(componentEvents.RUN_PAYROLL_PROCESSING_FAILED)\n setIsPolling(false)\n }, POLLING_TIMEOUT_MS)\n\n return () => {\n clearTimeout(timeoutId)\n }\n }, [isPolling, onEvent])\n\n const payrollAlert =\n payrollData.payrollShow?.payrollStatusMeta?.payrollLate &&\n payrollData.payrollShow.payrollStatusMeta.initialCheckDate &&\n payrollData.payrollShow.payrollStatusMeta.expectedDebitTime &&\n payrollData.payrollShow.payrollStatusMeta.expectedCheckDate\n ? {\n label: t('alerts.payrollLate', {\n initialCheckDate: dateFormatter.formatShortWithWeekday(\n payrollData.payrollShow.payrollStatusMeta.initialCheckDate,\n ),\n }),\n content: t('alerts.payrollLateText', {\n ...dateFormatter.formatWithTime(\n payrollData.payrollShow.payrollStatusMeta.expectedDebitTime,\n ),\n newCheckDate: dateFormatter.formatShortWithWeekday(\n payrollData.payrollShow.payrollStatusMeta.expectedCheckDate,\n ),\n }),\n variant: 'warning' as const,\n }\n : payrollData.payrollShow\n ? {\n label: t('alerts.directDepositDeadline', {\n payDate: dateFormatter.formatShortWithWeekday(payrollData.payrollShow.checkDate),\n ...dateFormatter.formatWithTime(payrollData.payrollShow.payrollDeadline),\n }),\n content: t('alerts.directDepositDeadlineText'),\n variant: 'info' as const,\n }\n : undefined\n\n return (\n <>\n <PayrollConfigurationPresentation\n onCalculatePayroll={onCalculatePayroll}\n isCalculateDisabled={blockersFromApi.length > 0}\n onEdit={onEdit}\n onToggleExclude={onToggleExclude}\n onViewBlockers={onViewBlockers}\n employeeCompensations={employeeCompensations}\n employeeDetails={employeeDetails}\n payPeriod={payPeriod}\n paySchedule={paySchedule}\n payrollCategory={payrollCategory}\n alerts={alerts}\n payrollAlert={payrollAlert}\n isPending={isPolling || isLoading || isUpdatingPayroll || isCalculatingPayroll}\n isCalculating={isCalculatingPayroll || isPolling}\n payrollBlockers={payrollBlockers}\n pagination={pagination}\n withReimbursements={withReimbursements}\n grossUpEnabled={grossUpEnabled}\n onGrossUpSelect={onGrossUpSelect}\n />\n {grossUpEnabled && (\n <GrossUpModal\n isOpen={isGrossUpModalOpen}\n onCalculateGrossUp={onCalculateGrossUp}\n onApply={handleGrossUpApply}\n onCancel={() => {\n setIsGrossUpModalOpen(false)\n }}\n />\n )}\n </>\n )\n}\n"],"names":["isCalculatingStatus","processingRequest","PayrollProcessingRequestStatus","isCalculatedStatus","calculatedAt","PayrollConfiguration","props","jsx","BaseComponent","Root","onEvent","companyId","payrollId","dictionary","alerts","withReimbursements","useComponentDictionary","useI18n","t","useTranslation","baseSubmitHandler","useBase","dateFormatter","useDateFormatter","isPolling","setIsPolling","useState","isCalculatingPayroll","setIsCalculatingPayroll","gustoClient","useGustoEmbeddedContext","employeeDetails","employeeCompensations","paySchedule","payPeriod","payrollCategory","pagination","isLoading","refetch","usePayrollConfigurationData","payrollData","usePayrollsGetSuspense","updatePayroll","isUpdatingPayroll","usePayrollsUpdateMutation","calculateGrossUpMutation","usePayrollsCalculateGrossUpMutation","grossUpEmployeeUuid","setGrossUpEmployeeUuid","isGrossUpModalOpen","setIsGrossUpModalOpen","grossUpEnabled","isGrossUpEligible","grossUpTargetCompensation","getGrossUpTargetCompensationName","onGrossUpSelect","employeeUuid","componentEvents","onCalculateGrossUp","netPay","grossUp","onGrossUpApply","grossAmount","SDKInternalError","employeeComp","ec","existingFixed","hasTargetCompensation","fc","updatedFixedCompensations","primaryJobUuid","updatedHourlyCompensations","hc","updatedPaidTimeOff","pto","transformedCompensation","transformEmployeeCompensation","result","handleGrossUpApply","blockersData","usePayrollsGetBlockersSuspense","blockersFromApi","blocker","payrollBlockers","setPayrollBlockers","onCalculatePayroll","payrollSubmitHandler","calcResult","payrollsCalculate","onEdit","employee","paymentMethod","reimbursements","compensation","onToggleExclude","employeeCompensation","onViewBlockers","useEffect","POLLING_TIMEOUT_MS","timeoutId","payrollAlert","jsxs","Fragment","PayrollConfigurationPresentation","GrossUpModal"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0BA,MAAMA,KAAsB,CAACC,MAC3BA,GAAmB,WAAWC,EAA+B,aAEzDC,KAAqB,CACzBF,GACAG,MAEAA,KAAgB,SACfH,GAAmB,WAAWC,EAA+B,oBAC5DD,KAAqB;AASlB,SAASI,GAAqBC,GAA2D;AAC9F,SACE,gBAAAC,EAACC,IAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,MAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEO,MAAMG,KAAO,CAAC;AAAA,EACnB,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,QAAAC;AAAA,EACA,oBAAAC,IAAqB;AACvB,MAAiC;AAC/B,EAAAC,GAAuB,gCAAgCH,CAAU,GACjEI,GAAQ,8BAA8B;AACtC,QAAM,EAAE,GAAAC,EAAA,IAAMC,GAAe,8BAA8B,GACrD,EAAE,mBAAAC,EAAA,IAAsBC,GAAA,GACxBC,IAAgBC,GAAA,GAEhB,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1C,CAACC,GAAsBC,CAAuB,IAAIF,EAAS,EAAK,GAChEG,IAAcC,GAAA,GAEd;AAA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ollConfiguration/PayrollConfiguration.tsx"],"sourcesContent":["import { useEffect, useRef, useState, type ReactNode } from 'react'\nimport { usePayrollsGetSuspense } from '@gusto/embedded-api/react-query/payrollsGet'\nimport { payrollsCalculate } from '@gusto/embedded-api/funcs/payrollsCalculate'\nimport { useGustoEmbeddedContext } from '@gusto/embedded-api/react-query/_context'\nimport type { PayrollProcessingRequest } from '@gusto/embedded-api/models/components/payrollprocessingrequest'\nimport { PayrollProcessingRequestStatus } from '@gusto/embedded-api/models/components/payrollprocessingrequest'\nimport type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport { useTranslation } from 'react-i18next'\nimport { usePayrollsUpdateMutation } from '@gusto/embedded-api/react-query/payrollsUpdate'\nimport { usePayrollsCalculateGrossUpMutation } from '@gusto/embedded-api/react-query/payrollsCalculateGrossUp'\nimport type { PayrollEmployeeCompensationsType } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollUpdateEmployeeCompensations } from '@gusto/embedded-api/models/components/payrollupdate'\nimport { usePayrollsGetBlockersSuspense } from '@gusto/embedded-api/react-query/payrollsGetBlockers'\nimport { payrollSubmitHandler, type ApiPayrollBlocker } from '../PayrollBlocker/payrollHelpers'\nimport { GrossUpModal } from '../GrossUpModal'\nimport { PayrollConfigurationPresentation } from './PayrollConfigurationPresentation'\nimport { usePayrollConfigurationData } from './usePayrollConfigurationData'\nimport { getGrossUpTargetCompensationName, isGrossUpEligible } from './grossUpHelpers'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { componentEvents } from '@/shared/constants'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { useBase } from '@/components/Base'\nimport { useDateFormatter } from '@/hooks/useDateFormatter'\nimport { SDKInternalError } from '@/types/sdkError'\n\nconst isCalculatingStatus = (processingRequest?: PayrollProcessingRequest | null) =>\n processingRequest?.status === PayrollProcessingRequestStatus.Calculating\n\nconst isCalculatedStatus = (\n processingRequest?: PayrollProcessingRequest | null,\n calculatedAt?: Date | null,\n) =>\n calculatedAt != null &&\n (processingRequest?.status === PayrollProcessingRequestStatus.CalculateSuccess ||\n processingRequest == null)\n\ninterface PayrollConfigurationProps extends BaseComponentInterface<'Payroll.PayrollConfiguration'> {\n companyId: string\n payrollId: string\n alerts?: ReactNode\n withReimbursements?: boolean\n}\n\nexport function PayrollConfiguration(props: PayrollConfigurationProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport const Root = ({\n onEvent,\n companyId,\n payrollId,\n dictionary,\n alerts,\n withReimbursements = true,\n}: PayrollConfigurationProps) => {\n useComponentDictionary('Payroll.PayrollConfiguration', dictionary)\n useI18n('Payroll.PayrollConfiguration')\n const { t } = useTranslation('Payroll.PayrollConfiguration')\n const { baseSubmitHandler } = useBase()\n const dateFormatter = useDateFormatter()\n\n const [isPolling, setIsPolling] = useState(false)\n const [isCalculatingPayroll, setIsCalculatingPayroll] = useState(false)\n const previousCalculatedAtRef = useRef<number | null>(null)\n const gustoClient = useGustoEmbeddedContext()\n\n const {\n employeeDetails,\n employeeCompensations,\n paySchedule,\n payPeriod,\n payrollCategory,\n pagination,\n isLoading,\n refetch,\n } = usePayrollConfigurationData({\n companyId,\n payrollId,\n isCalculating: isPolling || isCalculatingPayroll,\n })\n\n const { data: payrollData } = usePayrollsGetSuspense(\n {\n companyId,\n payrollId,\n include: ['taxes', 'benefits', 'deductions', 'payroll_status_meta'],\n },\n { refetchInterval: isPolling ? 5_000 : false },\n )\n\n const { mutateAsync: updatePayroll, isPending: isUpdatingPayroll } = usePayrollsUpdateMutation()\n\n const { mutateAsync: calculateGrossUpMutation } = usePayrollsCalculateGrossUpMutation()\n\n const [grossUpEmployeeUuid, setGrossUpEmployeeUuid] = useState<string | null>(null)\n const [isGrossUpModalOpen, setIsGrossUpModalOpen] = useState(false)\n\n const grossUpEnabled = isGrossUpEligible(payrollCategory)\n const grossUpTargetCompensation = getGrossUpTargetCompensationName(payrollCategory)\n\n const onGrossUpSelect = (employeeUuid: string) => {\n setGrossUpEmployeeUuid(employeeUuid)\n setIsGrossUpModalOpen(true)\n onEvent(componentEvents.RUN_PAYROLL_GROSS_UP_SELECTED, { employeeUuid })\n }\n\n const onCalculateGrossUp = async (netPay: number): Promise<string | null> => {\n if (!grossUpEmployeeUuid) return null\n let grossUp: string | null = null\n\n await baseSubmitHandler(null, async () => {\n const result = await calculateGrossUpMutation({\n request: {\n payrollUuid: payrollId,\n payrollGrossUpRequest: {\n employeeUuid: grossUpEmployeeUuid,\n netPay: netPay.toString(),\n },\n },\n })\n\n grossUp = result.payrollGrossUpResponse?.grossUp ?? null\n\n if (grossUp) {\n onEvent(componentEvents.RUN_PAYROLL_GROSS_UP_CALCULATED, {\n grossUp,\n netPay,\n employeeUuid: grossUpEmployeeUuid,\n })\n }\n })\n\n return grossUp\n }\n\n const onGrossUpApply = async (grossAmount: string) => {\n if (!grossUpEmployeeUuid || !grossUpTargetCompensation) {\n throw new SDKInternalError(\n 'Unable to apply gross-up: missing employee or target compensation.',\n )\n }\n\n const employeeComp = employeeCompensations.find(ec => ec.employeeUuid === grossUpEmployeeUuid)\n if (!employeeComp) {\n throw new SDKInternalError('Unable to apply gross-up: employee compensation not found.')\n }\n\n const existingFixed = employeeComp.fixedCompensations ?? []\n const hasTargetCompensation = existingFixed.some(\n fc => fc.name?.toLowerCase() === grossUpTargetCompensation.toLowerCase(),\n )\n\n const updatedFixedCompensations = existingFixed.map(fc => ({\n name: fc.name,\n jobUuid: fc.jobUuid,\n amount:\n fc.name?.toLowerCase() === grossUpTargetCompensation.toLowerCase() ? grossAmount : '0',\n }))\n\n if (!hasTargetCompensation) {\n const primaryJobUuid =\n employeeComp.hourlyCompensations?.[0]?.jobUuid ?? existingFixed[0]?.jobUuid ?? ''\n updatedFixedCompensations.push({\n name: grossUpTargetCompensation,\n jobUuid: primaryJobUuid,\n amount: grossAmount,\n })\n }\n\n const updatedHourlyCompensations = (employeeComp.hourlyCompensations ?? []).map(hc => ({\n name: hc.name,\n jobUuid: hc.jobUuid,\n hours: '0',\n }))\n\n const updatedPaidTimeOff = (employeeComp.paidTimeOff ?? []).map(pto => ({\n name: pto.name,\n hours: '0',\n }))\n\n const transformedCompensation = transformEmployeeCompensation({\n ...employeeComp,\n fixedCompensations: updatedFixedCompensations,\n hourlyCompensations: updatedHourlyCompensations,\n paidTimeOff: updatedPaidTimeOff,\n })\n\n await baseSubmitHandler({}, async () => {\n const result = await updatePayroll({\n request: {\n companyId,\n payrollId,\n payrollUpdate: {\n employeeCompensations: [{ ...transformedCompensation, excluded: false }],\n },\n },\n })\n onEvent(componentEvents.RUN_PAYROLL_EMPLOYEE_SAVED, {\n payrollPrepared: result.payrollPrepared,\n })\n await refetch()\n })\n\n setGrossUpEmployeeUuid(null)\n setIsGrossUpModalOpen(false)\n }\n\n const handleGrossUpApply = async (grossAmount: string) => {\n try {\n await onGrossUpApply(grossAmount)\n } catch {\n // Modal stays open; error is surfaced by baseSubmitHandler\n }\n }\n\n const { data: blockersData } = usePayrollsGetBlockersSuspense({\n companyUuid: companyId,\n })\n\n const payrollBlockerList = blockersData.payrollBlockers ?? []\n\n const blockersFromApi: ApiPayrollBlocker[] = payrollBlockerList.map(blocker => ({\n key: blocker.key,\n message: blocker.message,\n }))\n\n const [payrollBlockers, setPayrollBlockers] = useState(blockersFromApi)\n\n const onCalculatePayroll = async () => {\n setPayrollBlockers([])\n previousCalculatedAtRef.current = payrollData.payrollShow?.calculatedAt?.getTime() ?? null\n\n await baseSubmitHandler({}, async () => {\n const result = await payrollSubmitHandler(async () => {\n setIsCalculatingPayroll(true)\n try {\n const calcResult = await payrollsCalculate(gustoClient, {\n companyId,\n payrollId,\n })\n if (!calcResult.ok) {\n throw calcResult.error\n }\n setIsPolling(true)\n } finally {\n setIsCalculatingPayroll(false)\n }\n })\n\n if (!result.success && result.blockers.length > 0) {\n setPayrollBlockers(result.blockers)\n }\n })\n }\n\n const onEdit = (employee: Employee) => {\n onEvent(componentEvents.RUN_PAYROLL_EMPLOYEE_EDIT, {\n employeeId: employee.uuid,\n firstName: employee.firstName,\n lastName: employee.lastName,\n })\n }\n\n const transformEmployeeCompensation = ({\n paymentMethod,\n reimbursements,\n ...compensation\n }: PayrollEmployeeCompensationsType): PayrollUpdateEmployeeCompensations => {\n return {\n ...compensation,\n ...(paymentMethod && paymentMethod !== 'Historical' ? { paymentMethod } : {}),\n memo: compensation.memo || undefined,\n }\n }\n\n const onToggleExclude = async (employeeCompensation: PayrollEmployeeCompensationsType) => {\n onEvent(componentEvents.RUN_PAYROLL_EMPLOYEE_SKIP, {\n employeeId: employeeCompensation.employeeUuid,\n })\n await baseSubmitHandler({}, async () => {\n const transformedCompensation = transformEmployeeCompensation(employeeCompensation)\n const result = await updatePayroll({\n request: {\n companyId,\n payrollId,\n payrollUpdate: {\n employeeCompensations: [\n { ...transformedCompensation, excluded: !transformedCompensation.excluded },\n ],\n },\n },\n })\n onEvent(componentEvents.RUN_PAYROLL_EMPLOYEE_SAVED, {\n payrollPrepared: result.payrollPrepared,\n })\n await refetch()\n })\n }\n\n const onViewBlockers = () => {\n onEvent(componentEvents.RUN_PAYROLL_BLOCKERS_VIEW_ALL)\n }\n\n useEffect(() => {\n if (isCalculatingStatus(payrollData.payrollShow?.processingRequest) && !isPolling) {\n previousCalculatedAtRef.current = payrollData.payrollShow?.calculatedAt?.getTime() ?? null\n setIsPolling(true)\n }\n const currentCalculatedAt = payrollData.payrollShow?.calculatedAt\n const isNewCalculation = currentCalculatedAt?.getTime() !== previousCalculatedAtRef.current\n if (\n isPolling &&\n isNewCalculation &&\n isCalculatedStatus(payrollData.payrollShow?.processingRequest, currentCalculatedAt)\n ) {\n onEvent(componentEvents.RUN_PAYROLL_CALCULATED, {\n payrollId,\n alert: {\n type: 'success',\n title: t('alerts.progressSaved'),\n alertKey: 'progressSaved',\n },\n payPeriod: payrollData.payrollShow?.payPeriod,\n })\n setPayrollBlockers([])\n setIsPolling(false)\n }\n if (\n isPolling &&\n payrollData.payrollShow?.processingRequest?.status ===\n PayrollProcessingRequestStatus.ProcessingFailed\n ) {\n onEvent(componentEvents.RUN_PAYROLL_PROCESSING_FAILED)\n setIsPolling(false)\n }\n }, [\n payrollData.payrollShow?.processingRequest?.status,\n payrollData.payrollShow?.calculatedAt,\n isPolling,\n onEvent,\n t,\n payrollId,\n ])\n\n useEffect(() => {\n if (!isPolling) return\n\n const POLLING_TIMEOUT_MS = 3 * 60 * 1000\n const timeoutId = setTimeout(() => {\n onEvent(componentEvents.RUN_PAYROLL_PROCESSING_FAILED)\n setIsPolling(false)\n }, POLLING_TIMEOUT_MS)\n\n return () => {\n clearTimeout(timeoutId)\n }\n }, [isPolling, onEvent])\n\n const payrollAlert =\n payrollData.payrollShow?.payrollStatusMeta?.payrollLate &&\n payrollData.payrollShow.payrollStatusMeta.initialCheckDate &&\n payrollData.payrollShow.payrollStatusMeta.expectedDebitTime &&\n payrollData.payrollShow.payrollStatusMeta.expectedCheckDate\n ? {\n label: t('alerts.payrollLate', {\n initialCheckDate: dateFormatter.formatShortWithWeekday(\n payrollData.payrollShow.payrollStatusMeta.initialCheckDate,\n ),\n }),\n content: t('alerts.payrollLateText', {\n ...dateFormatter.formatWithTime(\n payrollData.payrollShow.payrollStatusMeta.expectedDebitTime,\n ),\n newCheckDate: dateFormatter.formatShortWithWeekday(\n payrollData.payrollShow.payrollStatusMeta.expectedCheckDate,\n ),\n }),\n variant: 'warning' as const,\n }\n : payrollData.payrollShow\n ? {\n label: t('alerts.directDepositDeadline', {\n payDate: dateFormatter.formatShortWithWeekday(payrollData.payrollShow.checkDate),\n ...dateFormatter.formatWithTime(payrollData.payrollShow.payrollDeadline),\n }),\n content: t('alerts.directDepositDeadlineText'),\n variant: 'info' as const,\n }\n : undefined\n\n return (\n <>\n <PayrollConfigurationPresentation\n onCalculatePayroll={onCalculatePayroll}\n isCalculateDisabled={blockersFromApi.length > 0}\n onEdit={onEdit}\n onToggleExclude={onToggleExclude}\n onViewBlockers={onViewBlockers}\n employeeCompensations={employeeCompensations}\n employeeDetails={employeeDetails}\n payPeriod={payPeriod}\n paySchedule={paySchedule}\n payrollCategory={payrollCategory}\n alerts={alerts}\n payrollAlert={payrollAlert}\n isPending={isPolling || isLoading || isUpdatingPayroll || isCalculatingPayroll}\n isCalculating={isCalculatingPayroll || isPolling}\n payrollBlockers={payrollBlockers}\n pagination={pagination}\n withReimbursements={withReimbursements}\n grossUpEnabled={grossUpEnabled}\n onGrossUpSelect={onGrossUpSelect}\n />\n {grossUpEnabled && (\n <GrossUpModal\n isOpen={isGrossUpModalOpen}\n onCalculateGrossUp={onCalculateGrossUp}\n onApply={handleGrossUpApply}\n onCancel={() => {\n setIsGrossUpModalOpen(false)\n }}\n />\n )}\n </>\n )\n}\n"],"names":["isCalculatingStatus","processingRequest","PayrollProcessingRequestStatus","isCalculatedStatus","calculatedAt","PayrollConfiguration","props","jsx","BaseComponent","Root","onEvent","companyId","payrollId","dictionary","alerts","withReimbursements","useComponentDictionary","useI18n","t","useTranslation","baseSubmitHandler","useBase","dateFormatter","useDateFormatter","isPolling","setIsPolling","useState","isCalculatingPayroll","setIsCalculatingPayroll","previousCalculatedAtRef","useRef","gustoClient","useGustoEmbeddedContext","employeeDetails","employeeCompensations","paySchedule","payPeriod","payrollCategory","pagination","isLoading","refetch","usePayrollConfigurationData","payrollData","usePayrollsGetSuspense","updatePayroll","isUpdatingPayroll","usePayrollsUpdateMutation","calculateGrossUpMutation","usePayrollsCalculateGrossUpMutation","grossUpEmployeeUuid","setGrossUpEmployeeUuid","isGrossUpModalOpen","setIsGrossUpModalOpen","grossUpEnabled","isGrossUpEligible","grossUpTargetCompensation","getGrossUpTargetCompensationName","onGrossUpSelect","employeeUuid","componentEvents","onCalculateGrossUp","netPay","grossUp","onGrossUpApply","grossAmount","SDKInternalError","employeeComp","ec","existingFixed","hasTargetCompensation","fc","updatedFixedCompensations","primaryJobUuid","updatedHourlyCompensations","hc","updatedPaidTimeOff","pto","transformedCompensation","transformEmployeeCompensation","result","handleGrossUpApply","blockersData","usePayrollsGetBlockersSuspense","blockersFromApi","blocker","payrollBlockers","setPayrollBlockers","onCalculatePayroll","payrollSubmitHandler","calcResult","payrollsCalculate","onEdit","employee","paymentMethod","reimbursements","compensation","onToggleExclude","employeeCompensation","onViewBlockers","useEffect","currentCalculatedAt","isNewCalculation","POLLING_TIMEOUT_MS","timeoutId","payrollAlert","jsxs","Fragment","PayrollConfigurationPresentation","GrossUpModal"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA0BA,MAAMA,KAAsB,CAACC,MAC3BA,GAAmB,WAAWC,EAA+B,aAEzDC,KAAqB,CACzBF,GACAG,MAEAA,KAAgB,SACfH,GAAmB,WAAWC,EAA+B,oBAC5DD,KAAqB;AASlB,SAASI,GAAqBC,GAA2D;AAC9F,SACE,gBAAAC,EAACC,IAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,MAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAEO,MAAMG,KAAO,CAAC;AAAA,EACnB,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,QAAAC;AAAA,EACA,oBAAAC,IAAqB;AACvB,MAAiC;AAC/B,EAAAC,GAAuB,gCAAgCH,CAAU,GACjEI,GAAQ,8BAA8B;AACtC,QAAM,EAAE,GAAAC,EAAA,IAAMC,GAAe,8BAA8B,GACrD,EAAE,mBAAAC,EAAA,IAAsBC,GAAA,GACxBC,IAAgBC,GAAA,GAEhB,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1C,CAACC,GAAsBC,CAAuB,IAAIF,EAAS,EAAK,GAChEG,IAA0BC,GAAsB,IAAI,GACpDC,IAAcC,GAAA,GAEd;AAAA,IACJ,iBAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,iBAA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