@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,21 +1,21 @@
|
|
|
1
|
-
import { state as
|
|
2
|
-
import {
|
|
3
|
-
import { componentEvents as
|
|
4
|
-
import { updateBreadcrumbs as
|
|
1
|
+
import { state as n, transition as t, reduce as i } from "robot3";
|
|
2
|
+
import { PayrollConfigurationContextual as d, PayrollReceiptsContextual as c, PayrollOverviewContextual as p, PayrollEditEmployeeContextual as m, PayrollBlockerContextual as y } from "../PayrollFlow/PayrollFlowComponents.js";
|
|
3
|
+
import { componentEvents as l } from "../../../shared/constants.js";
|
|
4
|
+
import { updateBreadcrumbs as r } from "../../../helpers/breadcrumbHelpers.js";
|
|
5
5
|
import { createBreadcrumbNavigateTransition as u } from "../../Common/FlowBreadcrumbs/breadcrumbTransitionHelpers.js";
|
|
6
|
-
const
|
|
6
|
+
const s = u(), w = (e = !1) => ({
|
|
7
7
|
configuration: {
|
|
8
8
|
parent: null,
|
|
9
9
|
item: {
|
|
10
10
|
id: "configuration",
|
|
11
|
-
label: "breadcrumbLabel",
|
|
11
|
+
label: e ? "breadcrumbLabelDismissal" : "breadcrumbLabel",
|
|
12
12
|
namespace: "Payroll.PayrollConfiguration",
|
|
13
|
-
onNavigate: ((
|
|
14
|
-
...
|
|
15
|
-
startDate:
|
|
16
|
-
endDate:
|
|
13
|
+
onNavigate: ((o) => ({
|
|
14
|
+
...r("configuration", o, {
|
|
15
|
+
startDate: o.payPeriod?.startDate ?? "",
|
|
16
|
+
endDate: o.payPeriod?.endDate ?? ""
|
|
17
17
|
}),
|
|
18
|
-
component:
|
|
18
|
+
component: d,
|
|
19
19
|
alerts: void 0
|
|
20
20
|
}))
|
|
21
21
|
}
|
|
@@ -26,12 +26,12 @@ const n = u(), w = {
|
|
|
26
26
|
id: "overview",
|
|
27
27
|
label: "breadcrumbLabel",
|
|
28
28
|
namespace: "Payroll.PayrollOverview",
|
|
29
|
-
onNavigate: ((
|
|
30
|
-
...
|
|
31
|
-
startDate:
|
|
32
|
-
endDate:
|
|
29
|
+
onNavigate: ((o) => ({
|
|
30
|
+
...r("overview", o, {
|
|
31
|
+
startDate: o.payPeriod?.startDate ?? "",
|
|
32
|
+
endDate: o.payPeriod?.endDate ?? ""
|
|
33
33
|
}),
|
|
34
|
-
component:
|
|
34
|
+
component: p,
|
|
35
35
|
alerts: void 0
|
|
36
36
|
}))
|
|
37
37
|
}
|
|
@@ -60,19 +60,19 @@ const n = u(), w = {
|
|
|
60
60
|
namespace: "Payroll.PayrollBlocker"
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
}, P =
|
|
64
|
-
|
|
63
|
+
}), P = t(
|
|
64
|
+
l.RUN_PAYROLL_CALCULATED,
|
|
65
65
|
"overview",
|
|
66
|
-
|
|
66
|
+
i(
|
|
67
67
|
(e, a) => ({
|
|
68
|
-
...
|
|
68
|
+
...r("overview", e, {
|
|
69
69
|
startDate: a.payload.payPeriod?.startDate ?? "",
|
|
70
70
|
endDate: a.payload.payPeriod?.endDate ?? ""
|
|
71
71
|
}),
|
|
72
|
-
component:
|
|
72
|
+
component: p,
|
|
73
73
|
payPeriod: a.payload.payPeriod ?? e.payPeriod,
|
|
74
74
|
alerts: a.payload.alert ? [
|
|
75
|
-
...(e.alerts ?? []).filter((
|
|
75
|
+
...(e.alerts ?? []).filter((o) => o.alertKey !== "progressSaved"),
|
|
76
76
|
{ ...a.payload.alert, alertKey: "progressSaved" }
|
|
77
77
|
] : e.alerts,
|
|
78
78
|
ctaConfig: {
|
|
@@ -81,53 +81,53 @@ const n = u(), w = {
|
|
|
81
81
|
}
|
|
82
82
|
})
|
|
83
83
|
)
|
|
84
|
-
), b =
|
|
85
|
-
|
|
84
|
+
), b = t(
|
|
85
|
+
l.RUN_PAYROLL_EMPLOYEE_EDIT,
|
|
86
86
|
"editEmployee",
|
|
87
|
-
|
|
87
|
+
i(
|
|
88
88
|
(e, a) => ({
|
|
89
|
-
...
|
|
89
|
+
...r("editEmployee", e, {
|
|
90
90
|
firstName: a.payload.firstName,
|
|
91
91
|
lastName: a.payload.lastName,
|
|
92
92
|
startDate: e.payPeriod?.startDate ?? "",
|
|
93
93
|
endDate: e.payPeriod?.endDate ?? ""
|
|
94
94
|
}),
|
|
95
95
|
progressBarType: "breadcrumbs",
|
|
96
|
-
component:
|
|
96
|
+
component: m,
|
|
97
97
|
employeeId: a.payload.employeeId,
|
|
98
98
|
firstName: a.payload.firstName,
|
|
99
99
|
lastName: a.payload.lastName,
|
|
100
100
|
ctaConfig: null
|
|
101
101
|
})
|
|
102
102
|
)
|
|
103
|
-
), f =
|
|
104
|
-
|
|
103
|
+
), f = t(
|
|
104
|
+
l.RUN_PAYROLL_BLOCKERS_VIEW_ALL,
|
|
105
105
|
"blockers",
|
|
106
|
-
|
|
107
|
-
...
|
|
108
|
-
component:
|
|
106
|
+
i((e) => ({
|
|
107
|
+
...r("blockers", e),
|
|
108
|
+
component: y
|
|
109
109
|
}))
|
|
110
|
-
), g =
|
|
111
|
-
|
|
110
|
+
), g = t(
|
|
111
|
+
l.RUN_PAYROLL_EDIT,
|
|
112
112
|
"configuration",
|
|
113
|
-
|
|
114
|
-
...
|
|
113
|
+
i((e) => ({
|
|
114
|
+
...r("configuration", e, {
|
|
115
115
|
startDate: e.payPeriod?.startDate ?? "",
|
|
116
116
|
endDate: e.payPeriod?.endDate ?? ""
|
|
117
117
|
}),
|
|
118
|
-
component:
|
|
118
|
+
component: d,
|
|
119
119
|
alerts: void 0,
|
|
120
120
|
ctaConfig: {
|
|
121
121
|
labelKey: "exitFlowCta",
|
|
122
122
|
namespace: "Payroll.PayrollConfiguration"
|
|
123
123
|
}
|
|
124
124
|
}))
|
|
125
|
-
), E =
|
|
126
|
-
|
|
125
|
+
), E = t(
|
|
126
|
+
l.RUN_PAYROLL_RECEIPT_GET,
|
|
127
127
|
"receipts",
|
|
128
|
-
|
|
128
|
+
i(
|
|
129
129
|
(e) => ({
|
|
130
|
-
...
|
|
130
|
+
...r("receipts", e, {
|
|
131
131
|
startDate: e.payPeriod?.startDate ?? "",
|
|
132
132
|
endDate: e.payPeriod?.endDate ?? ""
|
|
133
133
|
}),
|
|
@@ -140,14 +140,14 @@ const n = u(), w = {
|
|
|
140
140
|
}
|
|
141
141
|
})
|
|
142
142
|
)
|
|
143
|
-
),
|
|
144
|
-
|
|
143
|
+
), L = t(
|
|
144
|
+
l.RUN_PAYROLL_EMPLOYEE_SAVED,
|
|
145
145
|
"configuration",
|
|
146
|
-
|
|
146
|
+
i(
|
|
147
147
|
(e) => ({
|
|
148
148
|
...e,
|
|
149
149
|
currentBreadcrumbId: "configuration",
|
|
150
|
-
component:
|
|
150
|
+
component: d,
|
|
151
151
|
employeeId: void 0,
|
|
152
152
|
firstName: void 0,
|
|
153
153
|
lastName: void 0,
|
|
@@ -157,14 +157,14 @@ const n = u(), w = {
|
|
|
157
157
|
}
|
|
158
158
|
})
|
|
159
159
|
)
|
|
160
|
-
),
|
|
161
|
-
|
|
160
|
+
), v = t(
|
|
161
|
+
l.RUN_PAYROLL_EMPLOYEE_CANCELLED,
|
|
162
162
|
"configuration",
|
|
163
|
-
|
|
163
|
+
i(
|
|
164
164
|
(e) => ({
|
|
165
165
|
...e,
|
|
166
166
|
currentBreadcrumbId: "configuration",
|
|
167
|
-
component:
|
|
167
|
+
component: d,
|
|
168
168
|
employeeId: void 0,
|
|
169
169
|
firstName: void 0,
|
|
170
170
|
lastName: void 0,
|
|
@@ -175,27 +175,27 @@ const n = u(), w = {
|
|
|
175
175
|
})
|
|
176
176
|
)
|
|
177
177
|
), T = {
|
|
178
|
-
configuration:
|
|
179
|
-
|
|
178
|
+
configuration: n(
|
|
179
|
+
s("configuration"),
|
|
180
180
|
P,
|
|
181
181
|
b,
|
|
182
182
|
f
|
|
183
183
|
),
|
|
184
|
-
overview:
|
|
185
|
-
|
|
184
|
+
overview: n(
|
|
185
|
+
s("configuration"),
|
|
186
186
|
g,
|
|
187
187
|
E
|
|
188
188
|
),
|
|
189
|
-
editEmployee:
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
189
|
+
editEmployee: n(
|
|
190
|
+
s("configuration"),
|
|
191
|
+
L,
|
|
192
|
+
v
|
|
193
193
|
),
|
|
194
|
-
receipts:
|
|
195
|
-
blockers:
|
|
194
|
+
receipts: n(s("configuration")),
|
|
195
|
+
blockers: n(s("configuration"))
|
|
196
196
|
};
|
|
197
197
|
export {
|
|
198
|
-
w as
|
|
198
|
+
w as getPayrollExecutionBreadcrumbsNodes,
|
|
199
199
|
T as payrollExecutionMachine
|
|
200
200
|
};
|
|
201
201
|
//# sourceMappingURL=payrollExecutionMachine.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payrollExecutionMachine.js","sources":["../../../../src/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.ts"],"sourcesContent":["import { transition, reduce, state } from 'robot3'\nimport type { PayrollPayPeriodType } from '@gusto/embedded-api/models/components/payrollpayperiodtype'\nimport type { PayrollFlowAlert } from '../PayrollFlow/PayrollFlowComponents'\nimport {\n PayrollConfigurationContextual,\n PayrollOverviewContextual,\n PayrollEditEmployeeContextual,\n PayrollReceiptsContextual,\n PayrollBlockerContextual,\n type PayrollFlowContextInterface,\n} from '../PayrollFlow/PayrollFlowComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\nimport { updateBreadcrumbs } from '@/helpers/breadcrumbHelpers'\nimport type {\n BreadcrumbNode,\n BreadcrumbNodes,\n} from '@/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes'\nimport { createBreadcrumbNavigateTransition } from '@/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers'\n\ntype PayrollEventPayloads = {\n [componentEvents.RUN_PAYROLL_EMPLOYEE_EDIT]: {\n employeeId: string\n firstName: string\n lastName: string\n }\n [componentEvents.RUN_PAYROLL_CALCULATED]: {\n payrollUuid: string\n alert?: PayrollFlowAlert\n payPeriod?: PayrollPayPeriodType\n }\n [componentEvents.BREADCRUMB_NAVIGATE]: {\n key: string\n onNavigate: (ctx: PayrollFlowContextInterface) => PayrollFlowContextInterface\n }\n [componentEvents.RUN_PAYROLL_BLOCKERS_VIEW_ALL]: undefined\n [componentEvents.RUN_PAYROLL_EDIT]: undefined\n}\n\nconst breadcrumbNavigateTransition =\n createBreadcrumbNavigateTransition<PayrollFlowContextInterface>()\n\ntype BreadcrumbNodeKeys = 'configuration' | 'overview' | 'editEmployee' | 'receipts' | 'blockers'\n\nexport const payrollExecutionBreadcrumbsNodes: BreadcrumbNodes = {\n configuration: {\n parent: null,\n item: {\n id: 'configuration',\n label: 'breadcrumbLabel',\n namespace: 'Payroll.PayrollConfiguration',\n onNavigate: ((ctx: PayrollFlowContextInterface) => ({\n ...updateBreadcrumbs('configuration', ctx, {\n startDate: ctx.payPeriod?.startDate ?? '',\n endDate: ctx.payPeriod?.endDate ?? '',\n }),\n component: PayrollConfigurationContextual,\n alerts: undefined,\n })) as (context: unknown) => unknown,\n },\n },\n overview: {\n parent: 'configuration',\n item: {\n id: 'overview',\n label: 'breadcrumbLabel',\n namespace: 'Payroll.PayrollOverview',\n onNavigate: ((ctx: PayrollFlowContextInterface) => ({\n ...updateBreadcrumbs('overview', ctx, {\n startDate: ctx.payPeriod?.startDate ?? '',\n endDate: ctx.payPeriod?.endDate ?? '',\n }),\n component: PayrollOverviewContextual,\n alerts: undefined,\n })) as (context: unknown) => unknown,\n },\n },\n editEmployee: {\n parent: 'configuration',\n item: {\n id: 'editEmployee',\n label: 'breadcrumbLabel',\n namespace: 'Payroll.PayrollEditEmployee',\n },\n },\n receipts: {\n parent: 'overview',\n item: {\n id: 'receipts',\n label: 'breadcrumbLabel',\n namespace: 'Payroll.PayrollReceipts',\n },\n },\n blockers: {\n parent: 'configuration',\n item: {\n id: 'blockers',\n label: 'breadcrumbLabel',\n namespace: 'Payroll.PayrollBlocker',\n },\n },\n} satisfies Record<BreadcrumbNodeKeys, BreadcrumbNode>\n\nconst calculatedTransition = transition(\n componentEvents.RUN_PAYROLL_CALCULATED,\n 'overview',\n reduce(\n (\n ctx: PayrollFlowContextInterface,\n ev: MachineEventType<PayrollEventPayloads, typeof componentEvents.RUN_PAYROLL_CALCULATED>,\n ): PayrollFlowContextInterface => {\n return {\n ...updateBreadcrumbs('overview', ctx, {\n startDate: ev.payload.payPeriod?.startDate ?? '',\n endDate: ev.payload.payPeriod?.endDate ?? '',\n }),\n component: PayrollOverviewContextual,\n payPeriod: ev.payload.payPeriod ?? ctx.payPeriod,\n alerts: ev.payload.alert\n ? [\n ...(ctx.alerts ?? []).filter(a => a.alertKey !== 'progressSaved'),\n { ...ev.payload.alert, alertKey: 'progressSaved' as const },\n ]\n : ctx.alerts,\n ctaConfig: {\n labelKey: 'exitFlowCta',\n namespace: 'Payroll.PayrollOverview',\n },\n }\n },\n ),\n)\n\nconst employeeEditTransition = transition(\n componentEvents.RUN_PAYROLL_EMPLOYEE_EDIT,\n 'editEmployee',\n reduce(\n (\n ctx: PayrollFlowContextInterface,\n ev: MachineEventType<PayrollEventPayloads, typeof componentEvents.RUN_PAYROLL_EMPLOYEE_EDIT>,\n ): PayrollFlowContextInterface => {\n return {\n ...updateBreadcrumbs('editEmployee', ctx, {\n firstName: ev.payload.firstName,\n lastName: ev.payload.lastName,\n startDate: ctx.payPeriod?.startDate ?? '',\n endDate: ctx.payPeriod?.endDate ?? '',\n }),\n progressBarType: 'breadcrumbs',\n component: PayrollEditEmployeeContextual,\n employeeId: ev.payload.employeeId,\n firstName: ev.payload.firstName,\n lastName: ev.payload.lastName,\n ctaConfig: null,\n }\n },\n ),\n)\n\nconst blockersViewAllTransition = transition(\n componentEvents.RUN_PAYROLL_BLOCKERS_VIEW_ALL,\n 'blockers',\n reduce((ctx: PayrollFlowContextInterface): PayrollFlowContextInterface => {\n return {\n ...updateBreadcrumbs('blockers', ctx),\n component: PayrollBlockerContextual,\n }\n }),\n)\n\nconst editPayrollTransition = transition(\n componentEvents.RUN_PAYROLL_EDIT,\n 'configuration',\n reduce((ctx: PayrollFlowContextInterface): PayrollFlowContextInterface => {\n return {\n ...updateBreadcrumbs('configuration', ctx, {\n startDate: ctx.payPeriod?.startDate ?? '',\n endDate: ctx.payPeriod?.endDate ?? '',\n }),\n component: PayrollConfigurationContextual,\n alerts: undefined,\n ctaConfig: {\n labelKey: 'exitFlowCta',\n namespace: 'Payroll.PayrollConfiguration',\n },\n }\n }),\n)\n\nconst receiptGetTransition = transition(\n componentEvents.RUN_PAYROLL_RECEIPT_GET,\n 'receipts',\n reduce(\n (ctx: PayrollFlowContextInterface): PayrollFlowContextInterface => ({\n ...updateBreadcrumbs('receipts', ctx, {\n startDate: ctx.payPeriod?.startDate ?? '',\n endDate: ctx.payPeriod?.endDate ?? '',\n }),\n component: PayrollReceiptsContextual,\n progressBarType: 'breadcrumbs',\n alerts: undefined,\n ctaConfig: {\n labelKey: 'exitFlowCta',\n namespace: 'Payroll.PayrollReceipts',\n },\n }),\n ),\n)\n\nconst employeeSavedTransition = transition(\n componentEvents.RUN_PAYROLL_EMPLOYEE_SAVED,\n 'configuration',\n reduce(\n (ctx: PayrollFlowContextInterface): PayrollFlowContextInterface => ({\n ...ctx,\n currentBreadcrumbId: 'configuration',\n component: PayrollConfigurationContextual,\n employeeId: undefined,\n firstName: undefined,\n lastName: undefined,\n ctaConfig: {\n labelKey: 'exitFlowCta',\n namespace: 'Payroll.PayrollConfiguration',\n },\n }),\n ),\n)\n\nconst employeeCancelledTransition = transition(\n componentEvents.RUN_PAYROLL_EMPLOYEE_CANCELLED,\n 'configuration',\n reduce(\n (ctx: PayrollFlowContextInterface): PayrollFlowContextInterface => ({\n ...ctx,\n currentBreadcrumbId: 'configuration',\n component: PayrollConfigurationContextual,\n employeeId: undefined,\n firstName: undefined,\n lastName: undefined,\n ctaConfig: {\n labelKey: 'exitFlowCta',\n namespace: 'Payroll.PayrollConfiguration',\n },\n }),\n ),\n)\n\nexport const payrollExecutionMachine = {\n configuration: state<MachineTransition>(\n breadcrumbNavigateTransition('configuration'),\n calculatedTransition,\n employeeEditTransition,\n blockersViewAllTransition,\n ),\n overview: state<MachineTransition>(\n breadcrumbNavigateTransition('configuration'),\n editPayrollTransition,\n receiptGetTransition,\n ),\n editEmployee: state<MachineTransition>(\n breadcrumbNavigateTransition('configuration'),\n employeeSavedTransition,\n employeeCancelledTransition,\n ),\n receipts: state<MachineTransition>(breadcrumbNavigateTransition('configuration')),\n blockers: state<MachineTransition>(breadcrumbNavigateTransition('configuration')),\n}\n"],"names":["breadcrumbNavigateTransition","createBreadcrumbNavigateTransition","payrollExecutionBreadcrumbsNodes","ctx","updateBreadcrumbs","PayrollConfigurationContextual","PayrollOverviewContextual","calculatedTransition","transition","componentEvents","reduce","ev","a","employeeEditTransition","PayrollEditEmployeeContextual","blockersViewAllTransition","PayrollBlockerContextual","editPayrollTransition","receiptGetTransition","PayrollReceiptsContextual","employeeSavedTransition","employeeCancelledTransition","payrollExecutionMachine","state"],"mappings":";;;;;AAuCA,MAAMA,IACJC,EAAA,GAIWC,IAAoD;AAAA,EAC/D,eAAe;AAAA,IACb,QAAQ;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,WAAW;AAAA,MACX,aAAa,CAACC,OAAsC;AAAA,QAClD,GAAGC,EAAkB,iBAAiBD,GAAK;AAAA,UACzC,WAAWA,EAAI,WAAW,aAAa;AAAA,UACvC,SAASA,EAAI,WAAW,WAAW;AAAA,QAAA,CACpC;AAAA,QACD,WAAWE;AAAA,QACX,QAAQ;AAAA,MAAA;AAAA,IACV;AAAA,EACF;AAAA,EAEF,UAAU;AAAA,IACR,QAAQ;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,WAAW;AAAA,MACX,aAAa,CAACF,OAAsC;AAAA,QAClD,GAAGC,EAAkB,YAAYD,GAAK;AAAA,UACpC,WAAWA,EAAI,WAAW,aAAa;AAAA,UACvC,SAASA,EAAI,WAAW,WAAW;AAAA,QAAA,CACpC;AAAA,QACD,WAAWG;AAAA,QACX,QAAQ;AAAA,MAAA;AAAA,IACV;AAAA,EACF;AAAA,EAEF,cAAc;AAAA,IACZ,QAAQ;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,WAAW;AAAA,IAAA;AAAA,EACb;AAAA,EAEF,UAAU;AAAA,IACR,QAAQ;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,WAAW;AAAA,IAAA;AAAA,EACb;AAAA,EAEF,UAAU;AAAA,IACR,QAAQ;AAAA,IAC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AAA,MACZ,WAAW;AAAA,MACX,UAAU;AAAA,MACV,WAAW;AAAA,QACT,UAAU;AAAA,QACV,WAAW;AAAA,MAAA;AAAA,IACb;AAAA,EACF;AAEJ,GAEaiB,IAA0B;AAAA,EACrC,eAAeC;AAAA,IACbvB,EAA6B,eAAe;AAAA,IAC5CO;AAAA,IACAM;AAAA,IACAE;AAAA,EAAA;AAAA,EAEF,UAAUQ;AAAA,IACRvB,EAA6B,eAAe;AAAA,IAC5CiB;AAAA,IACAC;AAAA,EAAA;AAAA,EAEF,cAAcK;AAAA,IACZvB,EAA6B,eAAe;AAAA,IAC5CoB;AAAA,IACAC;AAAA,EAAA;AAAA,EAEF,UAAUE,EAAyBvB,EAA6B,eAAe,CAAC;AAAA,EAChF,UAAUuB,EAAyBvB,EAA6B,eAAe,CAAC;AAClF;"}
|
|
1
|
+
{"version":3,"file":"payrollExecutionMachine.js","sources":["../../../../src/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.ts"],"sourcesContent":["import { transition, reduce, state } from 'robot3'\nimport type { PayrollPayPeriodType } from '@gusto/embedded-api/models/components/payrollpayperiodtype'\nimport type { PayrollFlowAlert } from '../PayrollFlow/PayrollFlowComponents'\nimport {\n PayrollConfigurationContextual,\n PayrollOverviewContextual,\n PayrollEditEmployeeContextual,\n PayrollReceiptsContextual,\n PayrollBlockerContextual,\n type PayrollFlowContextInterface,\n} from '../PayrollFlow/PayrollFlowComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\nimport { updateBreadcrumbs } from '@/helpers/breadcrumbHelpers'\nimport type {\n BreadcrumbNode,\n BreadcrumbNodes,\n} from '@/components/Common/FlowBreadcrumbs/FlowBreadcrumbsTypes'\nimport { createBreadcrumbNavigateTransition } from '@/components/Common/FlowBreadcrumbs/breadcrumbTransitionHelpers'\n\ntype PayrollEventPayloads = {\n [componentEvents.RUN_PAYROLL_EMPLOYEE_EDIT]: {\n employeeId: string\n firstName: string\n lastName: string\n }\n [componentEvents.RUN_PAYROLL_CALCULATED]: {\n payrollUuid: string\n alert?: PayrollFlowAlert\n payPeriod?: PayrollPayPeriodType\n }\n [componentEvents.BREADCRUMB_NAVIGATE]: {\n key: string\n onNavigate: (ctx: PayrollFlowContextInterface) => PayrollFlowContextInterface\n }\n [componentEvents.RUN_PAYROLL_BLOCKERS_VIEW_ALL]: undefined\n [componentEvents.RUN_PAYROLL_EDIT]: undefined\n}\n\nconst breadcrumbNavigateTransition =\n createBreadcrumbNavigateTransition<PayrollFlowContextInterface>()\n\ntype BreadcrumbNodeKeys = 'configuration' | 'overview' | 'editEmployee' | 'receipts' | 'blockers'\n\nexport const getPayrollExecutionBreadcrumbsNodes = (\n isDismissal: boolean = false,\n): BreadcrumbNodes => {\n const configLabel = isDismissal ? 'breadcrumbLabelDismissal' : 'breadcrumbLabel'\n\n return {\n configuration: {\n parent: null,\n item: {\n id: 'configuration',\n label: configLabel,\n namespace: 'Payroll.PayrollConfiguration',\n onNavigate: ((ctx: PayrollFlowContextInterface) => ({\n ...updateBreadcrumbs('configuration', ctx, {\n startDate: ctx.payPeriod?.startDate ?? '',\n endDate: ctx.payPeriod?.endDate ?? '',\n }),\n component: PayrollConfigurationContextual,\n alerts: undefined,\n })) as (context: unknown) => unknown,\n },\n },\n overview: {\n parent: 'configuration',\n item: {\n id: 'overview',\n label: 'breadcrumbLabel',\n namespace: 'Payroll.PayrollOverview',\n onNavigate: ((ctx: PayrollFlowContextInterface) => ({\n ...updateBreadcrumbs('overview', ctx, {\n startDate: ctx.payPeriod?.startDate ?? '',\n endDate: ctx.payPeriod?.endDate ?? '',\n }),\n component: PayrollOverviewContextual,\n alerts: undefined,\n })) as (context: unknown) => unknown,\n },\n },\n editEmployee: {\n parent: 'configuration',\n item: {\n id: 'editEmployee',\n label: 'breadcrumbLabel',\n namespace: 'Payroll.PayrollEditEmployee',\n },\n },\n receipts: {\n parent: 'overview',\n item: {\n id: 'receipts',\n label: 'breadcrumbLabel',\n namespace: 'Payroll.PayrollReceipts',\n },\n },\n blockers: {\n parent: 'configuration',\n item: {\n id: 'blockers',\n label: 'breadcrumbLabel',\n namespace: 'Payroll.PayrollBlocker',\n },\n },\n } satisfies Record<BreadcrumbNodeKeys, BreadcrumbNode>\n}\n\nconst calculatedTransition = transition(\n componentEvents.RUN_PAYROLL_CALCULATED,\n 'overview',\n reduce(\n (\n ctx: PayrollFlowContextInterface,\n ev: MachineEventType<PayrollEventPayloads, typeof componentEvents.RUN_PAYROLL_CALCULATED>,\n ): PayrollFlowContextInterface => {\n return {\n ...updateBreadcrumbs('overview', ctx, {\n startDate: ev.payload.payPeriod?.startDate ?? '',\n endDate: ev.payload.payPeriod?.endDate ?? '',\n }),\n component: PayrollOverviewContextual,\n payPeriod: ev.payload.payPeriod ?? ctx.payPeriod,\n alerts: ev.payload.alert\n ? [\n ...(ctx.alerts ?? []).filter(a => a.alertKey !== 'progressSaved'),\n { ...ev.payload.alert, alertKey: 'progressSaved' as const },\n ]\n : ctx.alerts,\n ctaConfig: {\n labelKey: 'exitFlowCta',\n namespace: 'Payroll.PayrollOverview',\n },\n }\n },\n ),\n)\n\nconst employeeEditTransition = transition(\n componentEvents.RUN_PAYROLL_EMPLOYEE_EDIT,\n 'editEmployee',\n reduce(\n (\n ctx: PayrollFlowContextInterface,\n ev: MachineEventType<PayrollEventPayloads, typeof componentEvents.RUN_PAYROLL_EMPLOYEE_EDIT>,\n ): PayrollFlowContextInterface => {\n return {\n ...updateBreadcrumbs('editEmployee', ctx, {\n firstName: ev.payload.firstName,\n lastName: ev.payload.lastName,\n startDate: ctx.payPeriod?.startDate ?? '',\n endDate: ctx.payPeriod?.endDate ?? '',\n }),\n progressBarType: 'breadcrumbs',\n component: PayrollEditEmployeeContextual,\n employeeId: ev.payload.employeeId,\n firstName: ev.payload.firstName,\n lastName: ev.payload.lastName,\n ctaConfig: null,\n }\n },\n ),\n)\n\nconst blockersViewAllTransition = transition(\n componentEvents.RUN_PAYROLL_BLOCKERS_VIEW_ALL,\n 'blockers',\n reduce((ctx: PayrollFlowContextInterface): PayrollFlowContextInterface => {\n return {\n ...updateBreadcrumbs('blockers', ctx),\n component: PayrollBlockerContextual,\n }\n }),\n)\n\nconst editPayrollTransition = transition(\n componentEvents.RUN_PAYROLL_EDIT,\n 'configuration',\n reduce((ctx: PayrollFlowContextInterface): PayrollFlowContextInterface => {\n return {\n ...updateBreadcrumbs('configuration', ctx, {\n startDate: ctx.payPeriod?.startDate ?? '',\n endDate: ctx.payPeriod?.endDate ?? '',\n }),\n component: PayrollConfigurationContextual,\n alerts: undefined,\n ctaConfig: {\n labelKey: 'exitFlowCta',\n namespace: 'Payroll.PayrollConfiguration',\n },\n }\n }),\n)\n\nconst receiptGetTransition = transition(\n componentEvents.RUN_PAYROLL_RECEIPT_GET,\n 'receipts',\n reduce(\n (ctx: PayrollFlowContextInterface): PayrollFlowContextInterface => ({\n ...updateBreadcrumbs('receipts', ctx, {\n startDate: ctx.payPeriod?.startDate ?? '',\n endDate: ctx.payPeriod?.endDate ?? '',\n }),\n component: PayrollReceiptsContextual,\n progressBarType: 'breadcrumbs',\n alerts: undefined,\n ctaConfig: {\n labelKey: 'exitFlowCta',\n namespace: 'Payroll.PayrollReceipts',\n },\n }),\n ),\n)\n\nconst employeeSavedTransition = transition(\n componentEvents.RUN_PAYROLL_EMPLOYEE_SAVED,\n 'configuration',\n reduce(\n (ctx: PayrollFlowContextInterface): PayrollFlowContextInterface => ({\n ...ctx,\n currentBreadcrumbId: 'configuration',\n component: PayrollConfigurationContextual,\n employeeId: undefined,\n firstName: undefined,\n lastName: undefined,\n ctaConfig: {\n labelKey: 'exitFlowCta',\n namespace: 'Payroll.PayrollConfiguration',\n },\n }),\n ),\n)\n\nconst employeeCancelledTransition = transition(\n componentEvents.RUN_PAYROLL_EMPLOYEE_CANCELLED,\n 'configuration',\n reduce(\n (ctx: PayrollFlowContextInterface): PayrollFlowContextInterface => ({\n ...ctx,\n currentBreadcrumbId: 'configuration',\n component: PayrollConfigurationContextual,\n employeeId: undefined,\n firstName: undefined,\n lastName: undefined,\n ctaConfig: {\n labelKey: 'exitFlowCta',\n namespace: 'Payroll.PayrollConfiguration',\n },\n }),\n ),\n)\n\nexport const payrollExecutionMachine = {\n configuration: state<MachineTransition>(\n breadcrumbNavigateTransition('configuration'),\n calculatedTransition,\n employeeEditTransition,\n blockersViewAllTransition,\n ),\n overview: state<MachineTransition>(\n breadcrumbNavigateTransition('configuration'),\n editPayrollTransition,\n receiptGetTransition,\n ),\n editEmployee: state<MachineTransition>(\n breadcrumbNavigateTransition('configuration'),\n employeeSavedTransition,\n employeeCancelledTransition,\n ),\n receipts: state<MachineTransition>(breadcrumbNavigateTransition('configuration')),\n blockers: state<MachineTransition>(breadcrumbNavigateTransition('configuration')),\n}\n"],"names":["breadcrumbNavigateTransition","createBreadcrumbNavigateTransition","getPayrollExecutionBreadcrumbsNodes","isDismissal","ctx","updateBreadcrumbs","PayrollConfigurationContextual","PayrollOverviewContextual","calculatedTransition","transition","componentEvents","reduce","ev","a","employeeEditTransition","PayrollEditEmployeeContextual","blockersViewAllTransition","PayrollBlockerContextual","editPayrollTransition","receiptGetTransition","PayrollReceiptsContextual","employeeSavedTransition","employeeCancelledTransition","payrollExecutionMachine","state"],"mappings":";;;;;AAuCA,MAAMA,IACJC,EAAA,GAIWC,IAAsC,CACjDC,IAAuB,QAIhB;AAAA,EACL,eAAe;AAAA,IACb,QAAQ;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,OAPcA,IAAc,6BAA6B;AAAA,MAQzD,WAAW;AAAA,MACX,aAAa,CAACC,OAAsC;AAAA,QAClD,GAAGC,EAAkB,iBAAiBD,GAAK;AAAA,UACzC,WAAWA,EAAI,WAAW,aAAa;AAAA,UACvC,SAASA,EAAI,WAAW,WAAW;AAAA,QAAA,CACpC;AAAA,QACD,WAAWE;AAAA,QACX,QAAQ;AAAA,MAAA;AAAA,IACV;AAAA,EACF;AAAA,EAEF,UAAU;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jsx-runtime";
|
|
2
|
+
import { Suspense as d } from "react";
|
|
3
3
|
import { usePayrollsGetSuspense as y } from "@gusto/embedded-api/react-query/payrollsGet";
|
|
4
4
|
import { PayrollExecutionFlow as f } from "../PayrollExecutionFlow/PayrollExecutionFlow.js";
|
|
5
|
+
import { isDismissalPayroll as P } from "../helpers.js";
|
|
5
6
|
import { useFlow as x } from "../../Flow/useFlow.js";
|
|
6
7
|
import { ensureRequired as a } from "../../../helpers/ensureRequired.js";
|
|
7
|
-
function
|
|
8
|
+
function F() {
|
|
8
9
|
const {
|
|
9
10
|
companyId: o,
|
|
10
11
|
payrollUuid: r,
|
|
11
|
-
onEvent:
|
|
12
|
-
withReimbursements:
|
|
13
|
-
ConfirmWireDetailsComponent:
|
|
12
|
+
onEvent: i,
|
|
13
|
+
withReimbursements: e,
|
|
14
|
+
ConfirmWireDetailsComponent: t,
|
|
14
15
|
executionInitialState: s,
|
|
15
16
|
breadcrumbs: m
|
|
16
|
-
} = x(), l = m?.landing?.[0], u = l ? [l] : void 0, c = a(o),
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
|
|
17
|
+
} = x(), l = m?.landing?.[0], u = l ? [l] : void 0, c = a(o), p = a(r);
|
|
18
|
+
return /* @__PURE__ */ n(d, { children: /* @__PURE__ */ n(
|
|
19
|
+
w,
|
|
19
20
|
{
|
|
20
21
|
companyId: c,
|
|
21
|
-
payrollId:
|
|
22
|
-
onEvent:
|
|
23
|
-
withReimbursements:
|
|
24
|
-
ConfirmWireDetailsComponent:
|
|
22
|
+
payrollId: p,
|
|
23
|
+
onEvent: i,
|
|
24
|
+
withReimbursements: e,
|
|
25
|
+
ConfirmWireDetailsComponent: t,
|
|
25
26
|
initialState: s,
|
|
26
27
|
prefixBreadcrumbs: u
|
|
27
28
|
}
|
|
28
29
|
) });
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
+
function w({
|
|
31
32
|
companyId: o,
|
|
32
33
|
payrollId: r,
|
|
33
|
-
...
|
|
34
|
+
...i
|
|
34
35
|
}) {
|
|
35
|
-
const { data:
|
|
36
|
-
return /* @__PURE__ */
|
|
36
|
+
const { data: e } = y({ companyId: o, payrollId: r }), t = e.payrollShow?.payPeriod;
|
|
37
|
+
return /* @__PURE__ */ n(
|
|
37
38
|
f,
|
|
38
39
|
{
|
|
39
40
|
companyId: o,
|
|
40
41
|
payrollId: r,
|
|
41
|
-
initialPayPeriod:
|
|
42
|
-
|
|
42
|
+
initialPayPeriod: t,
|
|
43
|
+
isDismissalPayroll: P(e.payrollShow?.offCycleReason),
|
|
44
|
+
...i
|
|
43
45
|
}
|
|
44
46
|
);
|
|
45
47
|
}
|
|
46
48
|
export {
|
|
47
|
-
|
|
49
|
+
F as PayrollExecutionFlowContextual
|
|
48
50
|
};
|
|
49
51
|
//# sourceMappingURL=PayrollExecutionFlowContextual.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayrollExecutionFlowContextual.js","sources":["../../../../src/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.tsx"],"sourcesContent":["import { Suspense } from 'react'\nimport { usePayrollsGetSuspense } from '@gusto/embedded-api/react-query/payrollsGet'\nimport { PayrollExecutionFlow } from '../PayrollExecutionFlow/PayrollExecutionFlow'\nimport type { PayrollFlowContextInterface } from './PayrollFlowComponents'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\nexport function PayrollExecutionFlowContextual() {\n const {\n companyId,\n payrollUuid,\n onEvent,\n withReimbursements,\n ConfirmWireDetailsComponent,\n executionInitialState,\n breadcrumbs,\n } = useFlow<PayrollFlowContextInterface>()\n\n const landingBreadcrumb = breadcrumbs?.['landing']?.[0]\n const prefixBreadcrumbs = landingBreadcrumb ? [landingBreadcrumb] : undefined\n\n const resolvedCompanyId = ensureRequired(companyId)\n const resolvedPayrollId = ensureRequired(payrollUuid)\n\n return (\n <Suspense>\n <PayrollExecutionFlowWithData\n companyId={resolvedCompanyId}\n payrollId={resolvedPayrollId}\n onEvent={onEvent}\n withReimbursements={withReimbursements}\n ConfirmWireDetailsComponent={ConfirmWireDetailsComponent}\n initialState={executionInitialState}\n prefixBreadcrumbs={prefixBreadcrumbs}\n />\n </Suspense>\n )\n}\n\ntype PayrollExecutionFlowWithDataProps = React.ComponentProps<typeof PayrollExecutionFlow>\n\nfunction PayrollExecutionFlowWithData({\n companyId,\n payrollId,\n ...rest\n}: PayrollExecutionFlowWithDataProps) {\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":["PayrollExecutionFlowContextual","companyId","payrollUuid","onEvent","withReimbursements","ConfirmWireDetailsComponent","executionInitialState","breadcrumbs","useFlow","landingBreadcrumb","prefixBreadcrumbs","resolvedCompanyId","ensureRequired","resolvedPayrollId","Suspense","jsx","PayrollExecutionFlowWithData","payrollId","rest","data","usePayrollsGetSuspense","initialPayPeriod","PayrollExecutionFlow"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PayrollExecutionFlowContextual.js","sources":["../../../../src/components/Payroll/PayrollFlow/PayrollExecutionFlowContextual.tsx"],"sourcesContent":["import { Suspense } from 'react'\nimport { usePayrollsGetSuspense } from '@gusto/embedded-api/react-query/payrollsGet'\nimport { PayrollExecutionFlow } from '../PayrollExecutionFlow/PayrollExecutionFlow'\nimport { isDismissalPayroll } from '../helpers'\nimport type { PayrollFlowContextInterface } from './PayrollFlowComponents'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\nexport function PayrollExecutionFlowContextual() {\n const {\n companyId,\n payrollUuid,\n onEvent,\n withReimbursements,\n ConfirmWireDetailsComponent,\n executionInitialState,\n breadcrumbs,\n } = useFlow<PayrollFlowContextInterface>()\n\n const landingBreadcrumb = breadcrumbs?.['landing']?.[0]\n const prefixBreadcrumbs = landingBreadcrumb ? [landingBreadcrumb] : undefined\n\n const resolvedCompanyId = ensureRequired(companyId)\n const resolvedPayrollId = ensureRequired(payrollUuid)\n\n return (\n <Suspense>\n <PayrollExecutionFlowWithData\n companyId={resolvedCompanyId}\n payrollId={resolvedPayrollId}\n onEvent={onEvent}\n withReimbursements={withReimbursements}\n ConfirmWireDetailsComponent={ConfirmWireDetailsComponent}\n initialState={executionInitialState}\n prefixBreadcrumbs={prefixBreadcrumbs}\n />\n </Suspense>\n )\n}\n\ntype PayrollExecutionFlowWithDataProps = React.ComponentProps<typeof PayrollExecutionFlow>\n\nfunction PayrollExecutionFlowWithData({\n companyId,\n payrollId,\n ...rest\n}: PayrollExecutionFlowWithDataProps) {\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":["PayrollExecutionFlowContextual","companyId","payrollUuid","onEvent","withReimbursements","ConfirmWireDetailsComponent","executionInitialState","breadcrumbs","useFlow","landingBreadcrumb","prefixBreadcrumbs","resolvedCompanyId","ensureRequired","resolvedPayrollId","Suspense","jsx","PayrollExecutionFlowWithData","payrollId","rest","data","usePayrollsGetSuspense","initialPayPeriod","PayrollExecutionFlow","isDismissalPayroll"],"mappings":";;;;;;;AAQO,SAASA,IAAiC;AAC/C,QAAM;AAAA,IACJ,WAAAC;AAAA,IACA,aAAAC;AAAA,IACA,SAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,6BAAAC;AAAA,IACA,uBAAAC;AAAA,IACA,aAAAC;AAAA,EAAA,IACEC,EAAA,GAEEC,IAAoBF,GAAc,UAAa,CAAC,GAChDG,IAAoBD,IAAoB,CAACA,CAAiB,IAAI,QAE9DE,IAAoBC,EAAeX,CAAS,GAC5CY,IAAoBD,EAAeV,CAAW;AAEpD,2BACGY,GAAA,EACC,UAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWL;AAAA,MACX,WAAWE;AAAA,MACX,SAAAV;AAAA,MACA,oBAAAC;AAAA,MACA,6BAAAC;AAAA,MACA,cAAcC;AAAA,MACd,mBAAAI;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAIA,SAASM,EAA6B;AAAA,EACpC,WAAAf;AAAA,EACA,WAAAgB;AAAA,EACA,GAAGC;AACL,GAAsC;AACpC,QAAM,EAAE,MAAAC,EAAA,IAASC,EAAuB,EAAE,WAAAnB,GAAW,WAAAgB,GAAW,GAC1DI,IAAmBF,EAAK,aAAa;AAE3C,SACE,gBAAAJ;AAAA,IAACO;AAAA,IAAA;AAAA,MACC,WAAArB;AAAA,MACA,WAAAgB;AAAA,MACA,kBAAAI;AAAA,MACA,oBAAoBE,EAAmBJ,EAAK,aAAa,cAAc;AAAA,MACtE,GAAGD;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|