@gusto/embedded-react-sdk 0.56.5 → 0.56.6

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.
Files changed (79) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +3 -5
  3. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  4. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +3 -5
  5. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  6. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +5 -7
  7. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  8. package/dist/components/Company/BankAccount/BankAccountForm/context.js +3 -5
  9. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  10. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +3 -5
  11. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  12. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +8 -10
  13. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  14. package/dist/components/Company/Industry/Context.js +6 -8
  15. package/dist/components/Company/Industry/Context.js.map +1 -1
  16. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +3 -5
  17. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  18. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +3 -5
  19. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  20. package/dist/components/Company/OnboardingOverview/context.js +3 -5
  21. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  22. package/dist/components/Company/PaySchedule/management/AutoPilotDialog/AutoPilotDialog.js +39 -0
  23. package/dist/components/Company/PaySchedule/management/AutoPilotDialog/AutoPilotDialog.js.map +1 -0
  24. package/dist/components/Company/PaySchedule/management/AutoPilotDialog/AutoPilotDialogPresentation.js +54 -0
  25. package/dist/components/Company/PaySchedule/management/AutoPilotDialog/AutoPilotDialogPresentation.js.map +1 -0
  26. package/dist/components/Company/PaySchedule/management/AutoPilotDialog/useAutoPilotDialog.js +56 -0
  27. package/dist/components/Company/PaySchedule/management/AutoPilotDialog/useAutoPilotDialog.js.map +1 -0
  28. package/dist/components/Company/PaySchedule/management/PaySchedule.js +54 -39
  29. package/dist/components/Company/PaySchedule/management/PaySchedule.js.map +1 -1
  30. package/dist/components/Company/PaySchedule/management/PayScheduleManagementComponents.js +48 -32
  31. package/dist/components/Company/PaySchedule/management/PayScheduleManagementComponents.js.map +1 -1
  32. package/dist/components/Company/PaySchedule/management/PayScheduleOverview.js +8 -8
  33. package/dist/components/Company/PaySchedule/management/PayScheduleOverview.js.map +1 -1
  34. package/dist/components/Company/PaySchedule/management/payScheduleManagementStateMachine.js +74 -32
  35. package/dist/components/Company/PaySchedule/management/payScheduleManagementStateMachine.js.map +1 -1
  36. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +3 -5
  37. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  38. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +3 -5
  39. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  40. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js +3 -5
  41. package/dist/components/Company/StateTaxes/TaxRateManagement/context.js.map +1 -1
  42. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +17 -14
  43. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
  44. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js +3 -5
  45. package/dist/components/Employee/Documents/onboarding/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  46. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js +27 -16
  47. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js.map +1 -1
  48. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js +25 -17
  49. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js.map +1 -1
  50. package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js +6 -5
  51. package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js.map +1 -1
  52. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js +55 -57
  53. package/dist/components/Payroll/PayrollExecutionFlow/payrollExecutionMachine.js.map +1 -1
  54. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +25 -18
  55. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
  56. package/dist/components/Payroll/usePreparedPayrollData.js +7 -9
  57. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  58. package/dist/i18n/I18n.js +1 -0
  59. package/dist/i18n/I18n.js.map +1 -1
  60. package/dist/i18n/en/Company.Management.AutoPilotDialog.json.js +22 -0
  61. package/dist/i18n/en/Company.Management.AutoPilotDialog.json.js.map +1 -0
  62. package/dist/package.json.js +1 -1
  63. package/dist/shared/constants.js +18 -15
  64. package/dist/shared/constants.js.map +1 -1
  65. package/dist/src/components/Company/PaySchedule/management/AutoPilotDialog/AutoPilotDialog.d.ts +11 -0
  66. package/dist/src/components/Company/PaySchedule/management/AutoPilotDialog/AutoPilotDialogPresentation.d.ts +17 -0
  67. package/dist/src/components/Company/PaySchedule/management/AutoPilotDialog/index.d.ts +1 -0
  68. package/dist/src/components/Company/PaySchedule/management/AutoPilotDialog/useAutoPilotDialog.d.ts +22 -0
  69. package/dist/src/components/Company/PaySchedule/management/PaySchedule.d.ts +17 -1
  70. package/dist/src/components/Company/PaySchedule/management/PayScheduleManagementComponents.d.ts +2 -0
  71. package/dist/src/components/Company/PaySchedule/management/index.d.ts +1 -1
  72. package/dist/src/components/Company/exports/companyManagement.d.ts +1 -1
  73. package/dist/src/components/Employee/EmployeeListFlow/EmployeeListFlow.d.ts +1 -1
  74. package/dist/src/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.d.ts +6 -0
  75. package/dist/src/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.test.d.ts +1 -0
  76. package/dist/src/i18n/types.d.ts +81 -0
  77. package/dist/src/shared/constants.d.ts +6 -0
  78. package/docs/guides/endpoint-inventory.json +12 -1
  79. package/package.json +1 -1
@@ -1,60 +1,75 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { createMachine as p } from "robot3";
3
- import { useState as h, useMemo as S } from "react";
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { createMachine as S } from "robot3";
3
+ import { useState as y, useMemo as f } from "react";
4
4
  import { usePaySchedulesGetAllSuspense as d } from "@gusto/embedded-api/react-query/paySchedulesGetAll";
5
- import { payScheduleManagementStateMachine as f } from "./payScheduleManagementStateMachine.js";
6
- import { PayScheduleOverviewContextual as y, PayScheduleEditFormContextual as C } from "./PayScheduleManagementComponents.js";
7
- import { BaseComponent as P } from "../../../Base/Base.js";
8
- import { useBase as g } from "../../../Base/useBase.js";
9
- import { useI18n as u, useComponentDictionary as v } from "../../../../i18n/I18n.js";
10
- import { Flow as w } from "../../../Flow/Flow.js";
11
- import { useUnstableFeature as M } from "../../../../contexts/UnstableFeaturesProvider/useUnstableFeature.js";
12
- const k = ({
5
+ import { payScheduleManagementStateMachine as g } from "./payScheduleManagementStateMachine.js";
6
+ import { PayScheduleOverviewContextual as C, PayScheduleEditFormContextual as P } from "./PayScheduleManagementComponents.js";
7
+ import { BaseComponent as M } from "../../../Base/Base.js";
8
+ import { useBase as v } from "../../../Base/useBase.js";
9
+ import { useI18n as i, useComponentDictionary as l } from "../../../../i18n/I18n.js";
10
+ import { Flow as D } from "../../../Flow/Flow.js";
11
+ import { useUnstableFeature as w } from "../../../../contexts/UnstableFeaturesProvider/useUnstableFeature.js";
12
+ function p(e, o) {
13
+ if (!e) return;
14
+ const t = {};
15
+ for (const n in e) {
16
+ const a = n, m = e[a]?.[o];
17
+ m && (t[a] = m);
18
+ }
19
+ return Object.keys(t).length > 0 ? t : void 0;
20
+ }
21
+ const N = ({
13
22
  companyId: e,
14
- enableAutoPilot: t,
15
- enableMultipleSchedules: o,
16
- dictionary: a,
17
- ...r
18
- }) => (M("managePaySchedules", { throwIfDisabled: !0 }), /* @__PURE__ */ m(P, { ...r, children: /* @__PURE__ */ m(
23
+ enableAutoPilot: o,
24
+ enableMultipleSchedules: t,
25
+ dictionary: n,
26
+ ...a
27
+ }) => (w("managePaySchedules", { throwIfDisabled: !0 }), /* @__PURE__ */ s(M, { ...a, children: /* @__PURE__ */ s(
19
28
  x,
20
29
  {
21
30
  companyId: e,
22
- enableAutoPilot: t,
23
- enableMultipleSchedules: o,
24
- dictionary: a
31
+ enableAutoPilot: o,
32
+ enableMultipleSchedules: t,
33
+ dictionary: n
25
34
  }
26
35
  ) }));
27
36
  function x({
28
37
  companyId: e,
29
- enableAutoPilot: t,
30
- enableMultipleSchedules: o,
31
- dictionary: a
38
+ enableAutoPilot: o,
39
+ enableMultipleSchedules: t,
40
+ dictionary: n
32
41
  }) {
33
- u("Company.Management.PaySchedule"), v("Company.Management.PaySchedule", a), u("Company.PaySchedule");
34
- const { onEvent: r } = g(), { data: c } = d({ companyId: e }), [{ initialState: i, initialComponent: s }] = h(() => {
35
- const n = (c.payScheduleShowResponse?.length ?? 0) > 0;
42
+ i("Company.Management.PaySchedule"), l(
43
+ "Company.Management.PaySchedule",
44
+ p(n, "Company.Management.PaySchedule")
45
+ ), i("Company.Management.AutoPilotDialog"), l(
46
+ "Company.Management.AutoPilotDialog",
47
+ p(n, "Company.Management.AutoPilotDialog")
48
+ ), i("Company.PaySchedule");
49
+ const { onEvent: a } = v(), { data: m } = d({ companyId: e }), [{ initialState: u, initialComponent: c }] = y(() => {
50
+ const r = (m.payScheduleShowResponse?.length ?? 0) > 0;
36
51
  return {
37
- initialState: n ? "overview" : "createSchedule",
38
- initialComponent: n ? y : C
52
+ initialState: r ? "overview" : "createSchedule",
53
+ initialComponent: r ? C : P
39
54
  };
40
- }), l = S(
41
- () => p(
42
- i,
43
- f,
44
- (n) => ({
45
- ...n,
46
- component: s,
55
+ }), h = f(
56
+ () => S(
57
+ u,
58
+ g,
59
+ (r) => ({
60
+ ...r,
61
+ component: c,
47
62
  companyId: e,
48
- enableAutoPilot: t,
49
- enableMultipleSchedules: o,
63
+ enableAutoPilot: o,
64
+ enableMultipleSchedules: t,
50
65
  successAlert: null
51
66
  })
52
67
  ),
53
- [e, t, o, i, s]
68
+ [e, o, t, u, c]
54
69
  );
55
- return /* @__PURE__ */ m(w, { machine: l, onEvent: r });
70
+ return /* @__PURE__ */ s(D, { machine: h, onEvent: a });
56
71
  }
57
72
  export {
58
- k as PaySchedule
73
+ N as PaySchedule
59
74
  };
60
75
  //# sourceMappingURL=PaySchedule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PaySchedule.js","sources":["../../../../../src/components/Company/PaySchedule/management/PaySchedule.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo, useState } from 'react'\nimport { usePaySchedulesGetAllSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetAll'\nimport { payScheduleManagementStateMachine } from './payScheduleManagementStateMachine'\nimport type { PayScheduleManagementContextInterface } from './PayScheduleManagementComponents'\nimport {\n PayScheduleOverviewContextual,\n PayScheduleEditFormContextual,\n} from './PayScheduleManagementComponents'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport type { BaseComponentKeys } from '@/components/Base/Base'\nimport { useI18n } from '@/i18n'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { Flow } from '@/components/Flow/Flow'\nimport { useUnstableFeature } from '@/contexts/UnstableFeaturesProvider/useUnstableFeature'\n\n/**\n * Props for {@link PaySchedule}.\n *\n * @alpha\n */\nexport interface PayScheduleProps extends BaseComponentInterface<'Company.Management.PaySchedule'> {\n /** Company whose pay schedule is managed. */\n companyId: string\n /** Shows the AutoPilot row and its Edit action. */\n enableAutoPilot?: boolean\n /** Shows the Manage action. */\n enableMultipleSchedules?: boolean\n}\n\n/**\n * Manages a company's pay schedule after onboarding.\n *\n * @remarks\n * Renders the overview when the company already has a pay schedule, or the create form\n * directly when it doesn't.\n *\n * @alpha\n */\nexport const PaySchedule = ({\n companyId,\n enableAutoPilot,\n enableMultipleSchedules,\n dictionary,\n ...props\n}: PayScheduleProps) => {\n useUnstableFeature('managePaySchedules', { throwIfDisabled: true })\n\n return (\n <BaseComponent {...props}>\n <Root\n companyId={companyId}\n enableAutoPilot={enableAutoPilot}\n enableMultipleSchedules={enableMultipleSchedules}\n dictionary={dictionary}\n />\n </BaseComponent>\n )\n}\n\nfunction Root({\n companyId,\n enableAutoPilot,\n enableMultipleSchedules,\n dictionary,\n}: Omit<PayScheduleProps, BaseComponentKeys>) {\n useI18n('Company.Management.PaySchedule')\n useComponentDictionary('Company.Management.PaySchedule', dictionary)\n // PayScheduleEditFormContextual reuses the onboarding PayScheduleForm, whose translations\n // live under its own namespace and are otherwise never loaded from this flow.\n useI18n('Company.PaySchedule')\n const { onEvent } = useBase()\n const { data: paySchedules } = usePaySchedulesGetAllSuspense({ companyId })\n\n /**\n * Freeze the initial routing decision. Recomputing it after a later refetch (e.g. once the\n * first schedule is created) would re-seat the machine and orphan its interpreter.\n */\n const [{ initialState, initialComponent }] = useState<{\n initialState: keyof typeof payScheduleManagementStateMachine\n initialComponent: typeof PayScheduleOverviewContextual | typeof PayScheduleEditFormContextual\n }>(() => {\n const hasSchedules = (paySchedules.payScheduleShowResponse?.length ?? 0) > 0\n return {\n initialState: hasSchedules ? 'overview' : 'createSchedule',\n initialComponent: hasSchedules\n ? PayScheduleOverviewContextual\n : PayScheduleEditFormContextual,\n }\n })\n\n const machine = useMemo(\n () =>\n createMachine(\n initialState,\n payScheduleManagementStateMachine,\n (initialContext: PayScheduleManagementContextInterface) => ({\n ...initialContext,\n component: initialComponent,\n companyId,\n enableAutoPilot,\n enableMultipleSchedules,\n successAlert: null,\n }),\n ),\n [companyId, enableAutoPilot, enableMultipleSchedules, initialState, initialComponent],\n )\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n"],"names":["PaySchedule","companyId","enableAutoPilot","enableMultipleSchedules","dictionary","props","useUnstableFeature","jsx","BaseComponent","Root","useI18n","useComponentDictionary","onEvent","useBase","paySchedules","usePaySchedulesGetAllSuspense","initialState","initialComponent","useState","hasSchedules","PayScheduleOverviewContextual","PayScheduleEditFormContextual","machine","useMemo","createMachine","payScheduleManagementStateMachine","initialContext","Flow"],"mappings":";;;;;;;;;;;AAwCO,MAAMA,IAAc,CAAC;AAAA,EAC1B,WAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,yBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,GAAGC;AACL,OACEC,EAAmB,sBAAsB,EAAE,iBAAiB,GAAA,CAAM,GAGhE,gBAAAC,EAACC,GAAA,EAAe,GAAGH,GACjB,UAAA,gBAAAE;AAAA,EAACE;AAAA,EAAA;AAAA,IACC,WAAAR;AAAA,IACA,iBAAAC;AAAA,IACA,yBAAAC;AAAA,IACA,YAAAC;AAAA,EAAA;AAAA,GAEJ;AAIJ,SAASK,EAAK;AAAA,EACZ,WAAAR;AAAA,EACA,iBAAAC;AAAA,EACA,yBAAAC;AAAA,EACA,YAAAC;AACF,GAA8C;AAC5C,EAAAM,EAAQ,gCAAgC,GACxCC,EAAuB,kCAAkCP,CAAU,GAGnEM,EAAQ,qBAAqB;AAC7B,QAAM,EAAE,SAAAE,EAAA,IAAYC,EAAA,GACd,EAAE,MAAMC,EAAA,IAAiBC,EAA8B,EAAE,WAAAd,GAAW,GAMpE,CAAC,EAAE,cAAAe,GAAc,kBAAAC,GAAkB,IAAIC,EAG1C,MAAM;AACP,UAAMC,KAAgBL,EAAa,yBAAyB,UAAU,KAAK;AAC3E,WAAO;AAAA,MACL,cAAcK,IAAe,aAAa;AAAA,MAC1C,kBAAkBA,IACdC,IACAC;AAAA,IAAA;AAAA,EAER,CAAC,GAEKC,IAAUC;AAAA,IACd,MACEC;AAAA,MACER;AAAA,MACAS;AAAA,MACA,CAACC,OAA2D;AAAA,QAC1D,GAAGA;AAAA,QACH,WAAWT;AAAA,QACX,WAAAhB;AAAA,QACA,iBAAAC;AAAA,QACA,yBAAAC;AAAA,QACA,cAAc;AAAA,MAAA;AAAA,IAChB;AAAA,IAEJ,CAACF,GAAWC,GAAiBC,GAAyBa,GAAcC,CAAgB;AAAA,EAAA;AAGtF,SAAO,gBAAAV,EAACoB,GAAA,EAAK,SAAAL,GAAkB,SAAAV,EAAA,CAAkB;AACnD;"}
1
+ {"version":3,"file":"PaySchedule.js","sources":["../../../../../src/components/Company/PaySchedule/management/PaySchedule.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMemo, useState } from 'react'\nimport { usePaySchedulesGetAllSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetAll'\nimport { payScheduleManagementStateMachine } from './payScheduleManagementStateMachine'\nimport type { PayScheduleManagementContextInterface } from './PayScheduleManagementComponents'\nimport {\n PayScheduleOverviewContextual,\n PayScheduleEditFormContextual,\n} from './PayScheduleManagementComponents'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { BaseComponent, useBase } from '@/components/Base'\nimport type { BaseComponentKeys } from '@/components/Base/Base'\nimport { useI18n } from '@/i18n'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { Flow } from '@/components/Flow/Flow'\nimport { useUnstableFeature } from '@/contexts/UnstableFeaturesProvider/useUnstableFeature'\nimport type {\n DeepPartial,\n ResourceDictionary,\n Resources,\n SupportedLanguages,\n} from '@/types/Helpers'\n\n/**\n * Translation overrides for {@link PaySchedule}, covering both its own namespace and\n * `Company.Management.AutoPilotDialog` — the AutoPilot dialog is an internal spoke of this\n * flow with no standalone `dictionary` prop of its own.\n *\n * @alpha\n */\nexport type PayScheduleDictionary = {\n [Lang in SupportedLanguages]?: {\n 'Company.Management.PaySchedule'?: DeepPartial<Resources['Company.Management.PaySchedule']>\n 'Company.Management.AutoPilotDialog'?: DeepPartial<\n Resources['Company.Management.AutoPilotDialog']\n >\n }\n}\n\nfunction pickNamespaceDictionary<K extends keyof Resources>(\n dictionary: PayScheduleDictionary | undefined,\n ns: K,\n): ResourceDictionary<K> | undefined {\n if (!dictionary) return undefined\n\n const picked = {} as Record<SupportedLanguages, DeepPartial<Resources[K]>>\n for (const lang in dictionary) {\n const langKey = lang as SupportedLanguages\n const nsValue = (\n dictionary[langKey] as Partial<Record<K, DeepPartial<Resources[K]>>> | undefined\n )?.[ns]\n if (nsValue) {\n picked[langKey] = nsValue\n }\n }\n return Object.keys(picked).length > 0 ? (picked as ResourceDictionary<K>) : undefined\n}\n\n/**\n * Props for {@link PaySchedule}.\n *\n * @alpha\n */\nexport interface PayScheduleProps extends Omit<\n BaseComponentInterface<'Company.Management.PaySchedule'>,\n 'dictionary'\n> {\n /** Company whose pay schedule is managed. */\n companyId: string\n /** Shows the AutoPilot row and its Edit action. */\n enableAutoPilot?: boolean\n /** Shows the Manage action. */\n enableMultipleSchedules?: boolean\n /** Overrides for this flow's i18n strings, including the AutoPilot dialog's. */\n dictionary?: PayScheduleDictionary\n}\n\n/**\n * Manages a company's pay schedule after onboarding.\n *\n * @remarks\n * Renders the overview when the company already has a pay schedule, or the create form\n * directly when it doesn't.\n *\n * @alpha\n */\nexport const PaySchedule = ({\n companyId,\n enableAutoPilot,\n enableMultipleSchedules,\n dictionary,\n ...props\n}: PayScheduleProps) => {\n useUnstableFeature('managePaySchedules', { throwIfDisabled: true })\n\n return (\n <BaseComponent {...props}>\n <Root\n companyId={companyId}\n enableAutoPilot={enableAutoPilot}\n enableMultipleSchedules={enableMultipleSchedules}\n dictionary={dictionary}\n />\n </BaseComponent>\n )\n}\n\nfunction Root({\n companyId,\n enableAutoPilot,\n enableMultipleSchedules,\n dictionary,\n}: Omit<PayScheduleProps, BaseComponentKeys>) {\n useI18n('Company.Management.PaySchedule')\n useComponentDictionary(\n 'Company.Management.PaySchedule',\n pickNamespaceDictionary(dictionary, 'Company.Management.PaySchedule'),\n )\n // AutoPilotDialog is an internal spoke off PayScheduleOverviewContextual, not standalone-\n // mountable, so PaySchedule's own dictionary covers this namespace too.\n useI18n('Company.Management.AutoPilotDialog')\n useComponentDictionary(\n 'Company.Management.AutoPilotDialog',\n pickNamespaceDictionary(dictionary, 'Company.Management.AutoPilotDialog'),\n )\n // PayScheduleEditFormContextual reuses the onboarding PayScheduleForm, whose translations\n // live under its own namespace and are otherwise never loaded from this flow.\n useI18n('Company.PaySchedule')\n const { onEvent } = useBase()\n const { data: paySchedules } = usePaySchedulesGetAllSuspense({ companyId })\n\n /**\n * Freeze the initial routing decision. Recomputing it after a later refetch (e.g. once the\n * first schedule is created) would re-seat the machine and orphan its interpreter.\n */\n const [{ initialState, initialComponent }] = useState<{\n initialState: keyof typeof payScheduleManagementStateMachine\n initialComponent: typeof PayScheduleOverviewContextual | typeof PayScheduleEditFormContextual\n }>(() => {\n const hasSchedules = (paySchedules.payScheduleShowResponse?.length ?? 0) > 0\n return {\n initialState: hasSchedules ? 'overview' : 'createSchedule',\n initialComponent: hasSchedules\n ? PayScheduleOverviewContextual\n : PayScheduleEditFormContextual,\n }\n })\n\n const machine = useMemo(\n () =>\n createMachine(\n initialState,\n payScheduleManagementStateMachine,\n (initialContext: PayScheduleManagementContextInterface) => ({\n ...initialContext,\n component: initialComponent,\n companyId,\n enableAutoPilot,\n enableMultipleSchedules,\n successAlert: null,\n }),\n ),\n [companyId, enableAutoPilot, enableMultipleSchedules, initialState, initialComponent],\n )\n\n return <Flow machine={machine} onEvent={onEvent} />\n}\n"],"names":["pickNamespaceDictionary","dictionary","ns","picked","lang","langKey","nsValue","PaySchedule","companyId","enableAutoPilot","enableMultipleSchedules","props","useUnstableFeature","jsx","BaseComponent","Root","useI18n","useComponentDictionary","onEvent","useBase","paySchedules","usePaySchedulesGetAllSuspense","initialState","initialComponent","useState","hasSchedules","PayScheduleOverviewContextual","PayScheduleEditFormContextual","machine","useMemo","createMachine","payScheduleManagementStateMachine","initialContext","Flow"],"mappings":";;;;;;;;;;;AAuCA,SAASA,EACPC,GACAC,GACmC;AACnC,MAAI,CAACD,EAAY;AAEjB,QAAME,IAAS,CAAA;AACf,aAAWC,KAAQH,GAAY;AAC7B,UAAMI,IAAUD,GACVE,IACJL,EAAWI,CAAO,IAChBH,CAAE;AACN,IAAII,MACFH,EAAOE,CAAO,IAAIC;AAAA,EAEtB;AACA,SAAO,OAAO,KAAKH,CAAM,EAAE,SAAS,IAAKA,IAAmC;AAC9E;AA8BO,MAAMI,IAAc,CAAC;AAAA,EAC1B,WAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,yBAAAC;AAAA,EACA,YAAAT;AAAA,EACA,GAAGU;AACL,OACEC,EAAmB,sBAAsB,EAAE,iBAAiB,GAAA,CAAM,GAGhE,gBAAAC,EAACC,GAAA,EAAe,GAAGH,GACjB,UAAA,gBAAAE;AAAA,EAACE;AAAA,EAAA;AAAA,IACC,WAAAP;AAAA,IACA,iBAAAC;AAAA,IACA,yBAAAC;AAAA,IACA,YAAAT;AAAA,EAAA;AAAA,GAEJ;AAIJ,SAASc,EAAK;AAAA,EACZ,WAAAP;AAAA,EACA,iBAAAC;AAAA,EACA,yBAAAC;AAAA,EACA,YAAAT;AACF,GAA8C;AAC5C,EAAAe,EAAQ,gCAAgC,GACxCC;AAAA,IACE;AAAA,IACAjB,EAAwBC,GAAY,gCAAgC;AAAA,EAAA,GAItEe,EAAQ,oCAAoC,GAC5CC;AAAA,IACE;AAAA,IACAjB,EAAwBC,GAAY,oCAAoC;AAAA,EAAA,GAI1Ee,EAAQ,qBAAqB;AAC7B,QAAM,EAAE,SAAAE,EAAA,IAAYC,EAAA,GACd,EAAE,MAAMC,EAAA,IAAiBC,EAA8B,EAAE,WAAAb,GAAW,GAMpE,CAAC,EAAE,cAAAc,GAAc,kBAAAC,GAAkB,IAAIC,EAG1C,MAAM;AACP,UAAMC,KAAgBL,EAAa,yBAAyB,UAAU,KAAK;AAC3E,WAAO;AAAA,MACL,cAAcK,IAAe,aAAa;AAAA,MAC1C,kBAAkBA,IACdC,IACAC;AAAA,IAAA;AAAA,EAER,CAAC,GAEKC,IAAUC;AAAA,IACd,MACEC;AAAA,MACER;AAAA,MACAS;AAAA,MACA,CAACC,OAA2D;AAAA,QAC1D,GAAGA;AAAA,QACH,WAAWT;AAAA,QACX,WAAAf;AAAA,QACA,iBAAAC;AAAA,QACA,yBAAAC;AAAA,QACA,cAAc;AAAA,MAAA;AAAA,IAChB;AAAA,IAEJ,CAACF,GAAWC,GAAiBC,GAAyBY,GAAcC,CAAgB;AAAA,EAAA;AAGtF,SAAO,gBAAAV,EAACoB,GAAA,EAAK,SAAAL,GAAkB,SAAAV,EAAA,CAAkB;AACnD;"}
@@ -1,56 +1,72 @@
1
- import { jsxs as a, jsx as n } from "react/jsx-runtime";
2
- import { useTranslation as i } from "react-i18next";
3
- import { PayScheduleForm as p } from "../PayScheduleForm.js";
4
- import { PayScheduleOverview as d } from "./PayScheduleOverview.js";
5
- import { useComponentContext as f } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
1
+ import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
+ import { useTranslation as p } from "react-i18next";
3
+ import { PayScheduleForm as d } from "../PayScheduleForm.js";
4
+ import { PayScheduleOverview as f } from "./PayScheduleOverview.js";
5
+ import { useComponentContext as y } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
6
6
  import { useFlow as m } from "../../../Flow/useFlow.js";
7
- import { ensureRequired as l } from "../../../../helpers/ensureRequired.js";
8
- import { componentEvents as y } from "../../../../shared/constants.js";
9
- import { Flex as S } from "../../../Common/Flex/Flex.js";
10
- import { PayScheduleAssignment as E } from "./PayScheduleAssignment/PayScheduleAssignment.js";
11
- function F() {
12
- const { companyId: o, onEvent: e, enableAutoPilot: t, enableMultipleSchedules: r, successAlert: s } = m(), { t: u } = i("Company.Management.PaySchedule"), c = f();
13
- return /* @__PURE__ */ a(S, { flexDirection: "column", gap: 16, children: [
14
- s ? /* @__PURE__ */ n(
15
- c.Alert,
7
+ import { ensureRequired as n } from "../../../../helpers/ensureRequired.js";
8
+ import { componentEvents as S } from "../../../../shared/constants.js";
9
+ import { Flex as h } from "../../../Common/Flex/Flex.js";
10
+ import { AutoPilotDialog as E } from "./AutoPilotDialog/AutoPilotDialog.js";
11
+ import { PayScheduleAssignment as P } from "./PayScheduleAssignment/PayScheduleAssignment.js";
12
+ function w() {
13
+ const {
14
+ companyId: o,
15
+ onEvent: e,
16
+ enableAutoPilot: l,
17
+ enableMultipleSchedules: r,
18
+ successAlert: u,
19
+ autoPilotSchedule: c
20
+ } = m(), { t: s } = p("Company.Management.PaySchedule"), a = y();
21
+ return /* @__PURE__ */ i(h, { flexDirection: "column", gap: 16, children: [
22
+ u ? /* @__PURE__ */ t(
23
+ a.Alert,
16
24
  {
17
25
  status: "success",
18
- label: u(`alerts.${s}`),
26
+ label: s(`alerts.${u}`),
19
27
  onDismiss: () => {
20
- e(y.PAY_SCHEDULE_MANAGEMENT_ALERT_DISMISSED, null);
28
+ e(S.PAY_SCHEDULE_MANAGEMENT_ALERT_DISMISSED, null);
21
29
  }
22
30
  }
23
31
  ) : null,
24
- /* @__PURE__ */ n(
25
- d,
32
+ /* @__PURE__ */ t(
33
+ f,
26
34
  {
27
- companyId: l(o),
35
+ companyId: n(o),
28
36
  onEvent: e,
29
- enableAutoPilot: t,
37
+ enableAutoPilot: l,
30
38
  enableMultipleSchedules: r
31
39
  }
32
- )
40
+ ),
41
+ c ? /* @__PURE__ */ t(
42
+ E,
43
+ {
44
+ companyId: n(o),
45
+ schedule: c,
46
+ onEvent: e
47
+ }
48
+ ) : null
33
49
  ] });
34
50
  }
35
- function _() {
51
+ function T() {
36
52
  const { companyId: o, onEvent: e } = m();
37
- return /* @__PURE__ */ n(E, { companyId: l(o), onEvent: e });
53
+ return /* @__PURE__ */ t(P, { companyId: n(o), onEvent: e });
38
54
  }
39
- function b() {
40
- const { companyId: o, payScheduleId: e, defaultValues: t, onEvent: r } = m();
41
- return /* @__PURE__ */ n(
42
- p,
55
+ function j() {
56
+ const { companyId: o, payScheduleId: e, defaultValues: l, onEvent: r } = m();
57
+ return /* @__PURE__ */ t(
58
+ d,
43
59
  {
44
- companyId: l(o),
60
+ companyId: n(o),
45
61
  payScheduleId: e,
46
- defaultValues: t,
62
+ defaultValues: l,
47
63
  onEvent: r
48
64
  }
49
65
  );
50
66
  }
51
67
  export {
52
- _ as PayScheduleAssignmentContextual,
53
- b as PayScheduleEditFormContextual,
54
- F as PayScheduleOverviewContextual
68
+ T as PayScheduleAssignmentContextual,
69
+ j as PayScheduleEditFormContextual,
70
+ w as PayScheduleOverviewContextual
55
71
  };
56
72
  //# sourceMappingURL=PayScheduleManagementComponents.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PayScheduleManagementComponents.js","sources":["../../../../../src/components/Company/PaySchedule/management/PayScheduleManagementComponents.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { PayScheduleForm } from '../PayScheduleForm'\nimport type { PayScheduleDefaultValues } from '../PaySchedule'\nimport { PayScheduleOverview } from './PayScheduleOverview'\nimport { PayScheduleAssignment } from './PayScheduleAssignment'\nimport { Flex } from '@/components/Common/Flex'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { componentEvents } from '@/shared/constants'\n\n/** @internal */\nexport type PayScheduleManagementSuccessAlertCode = 'assignmentUpdated'\n\n/** @internal */\nexport interface PayScheduleManagementContextInterface extends FlowContextInterface {\n companyId: string\n payScheduleId?: string\n defaultValues?: PayScheduleDefaultValues\n enableAutoPilot?: boolean\n enableMultipleSchedules?: boolean\n successAlert?: PayScheduleManagementSuccessAlertCode | null\n component: React.ComponentType | null\n}\n\n/** @internal */\nexport function PayScheduleOverviewContextual() {\n const { companyId, onEvent, enableAutoPilot, enableMultipleSchedules, successAlert } =\n useFlow<PayScheduleManagementContextInterface>()\n const { t } = useTranslation('Company.Management.PaySchedule')\n const Components = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {successAlert ? (\n <Components.Alert\n status=\"success\"\n label={t(`alerts.${successAlert}`)}\n onDismiss={() => {\n onEvent(componentEvents.PAY_SCHEDULE_MANAGEMENT_ALERT_DISMISSED, null)\n }}\n />\n ) : null}\n <PayScheduleOverview\n companyId={ensureRequired(companyId)}\n onEvent={onEvent}\n enableAutoPilot={enableAutoPilot}\n enableMultipleSchedules={enableMultipleSchedules}\n />\n </Flex>\n )\n}\n\n/** @internal */\nexport function PayScheduleAssignmentContextual() {\n const { companyId, onEvent } = useFlow<PayScheduleManagementContextInterface>()\n\n return <PayScheduleAssignment companyId={ensureRequired(companyId)} onEvent={onEvent} />\n}\n\n/** @internal */\nexport function PayScheduleEditFormContextual() {\n const { companyId, payScheduleId, defaultValues, onEvent } =\n useFlow<PayScheduleManagementContextInterface>()\n\n return (\n <PayScheduleForm\n companyId={ensureRequired(companyId)}\n payScheduleId={payScheduleId}\n defaultValues={defaultValues}\n onEvent={onEvent}\n />\n )\n}\n"],"names":["PayScheduleOverviewContextual","companyId","onEvent","enableAutoPilot","enableMultipleSchedules","successAlert","useFlow","t","useTranslation","Components","useComponentContext","jsxs","Flex","jsx","componentEvents","PayScheduleOverview","ensureRequired","PayScheduleAssignmentContextual","PayScheduleAssignment","PayScheduleEditFormContextual","payScheduleId","defaultValues","PayScheduleForm"],"mappings":";;;;;;;;;;AA0BO,SAASA,IAAgC;AAC9C,QAAM,EAAE,WAAAC,GAAW,SAAAC,GAAS,iBAAAC,GAAiB,yBAAAC,GAAyB,cAAAC,EAAA,IACpEC,EAAA,GACI,EAAE,GAAAC,EAAA,IAAMC,EAAe,gCAAgC,GACvDC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAA;AAAA,IAAAP,IACC,gBAAAQ;AAAA,MAACJ,EAAW;AAAA,MAAX;AAAA,QACC,QAAO;AAAA,QACP,OAAOF,EAAE,UAAUF,CAAY,EAAE;AAAA,QACjC,WAAW,MAAM;AACf,UAAAH,EAAQY,EAAgB,yCAAyC,IAAI;AAAA,QACvE;AAAA,MAAA;AAAA,IAAA,IAEA;AAAA,IACJ,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,WAAWC,EAAef,CAAS;AAAA,QACnC,SAAAC;AAAA,QACA,iBAAAC;AAAA,QACA,yBAAAC;AAAA,MAAA;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;AAGO,SAASa,IAAkC;AAChD,QAAM,EAAE,WAAAhB,GAAW,SAAAC,EAAA,IAAYI,EAAA;AAE/B,2BAAQY,GAAA,EAAsB,WAAWF,EAAef,CAAS,GAAG,SAAAC,GAAkB;AACxF;AAGO,SAASiB,IAAgC;AAC9C,QAAM,EAAE,WAAAlB,GAAW,eAAAmB,GAAe,eAAAC,GAAe,SAAAnB,EAAA,IAC/CI,EAAA;AAEF,SACE,gBAAAO;AAAA,IAACS;AAAA,IAAA;AAAA,MACC,WAAWN,EAAef,CAAS;AAAA,MACnC,eAAAmB;AAAA,MACA,eAAAC;AAAA,MACA,SAAAnB;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"PayScheduleManagementComponents.js","sources":["../../../../../src/components/Company/PaySchedule/management/PayScheduleManagementComponents.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { PayScheduleShow } from '@gusto/embedded-api/models/components/payscheduleshow'\nimport { PayScheduleForm } from '../PayScheduleForm'\nimport type { PayScheduleDefaultValues } from '../PaySchedule'\nimport { PayScheduleOverview } from './PayScheduleOverview'\nimport { PayScheduleAssignment } from './PayScheduleAssignment'\nimport { AutoPilotDialog } from './AutoPilotDialog'\nimport { Flex } from '@/components/Common/Flex'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport { componentEvents } from '@/shared/constants'\n\n/** @internal */\nexport type PayScheduleManagementSuccessAlertCode = 'assignmentUpdated'\n\n/** @internal */\nexport interface PayScheduleManagementContextInterface extends FlowContextInterface {\n companyId: string\n payScheduleId?: string\n defaultValues?: PayScheduleDefaultValues\n enableAutoPilot?: boolean\n enableMultipleSchedules?: boolean\n successAlert?: PayScheduleManagementSuccessAlertCode | null\n autoPilotSchedule?: PayScheduleShow\n component: React.ComponentType | null\n}\n\n/** @internal */\nexport function PayScheduleOverviewContextual() {\n const {\n companyId,\n onEvent,\n enableAutoPilot,\n enableMultipleSchedules,\n successAlert,\n autoPilotSchedule,\n } = useFlow<PayScheduleManagementContextInterface>()\n const { t } = useTranslation('Company.Management.PaySchedule')\n const Components = useComponentContext()\n\n return (\n <Flex flexDirection=\"column\" gap={16}>\n {successAlert ? (\n <Components.Alert\n status=\"success\"\n label={t(`alerts.${successAlert}`)}\n onDismiss={() => {\n onEvent(componentEvents.PAY_SCHEDULE_MANAGEMENT_ALERT_DISMISSED, null)\n }}\n />\n ) : null}\n <PayScheduleOverview\n companyId={ensureRequired(companyId)}\n onEvent={onEvent}\n enableAutoPilot={enableAutoPilot}\n enableMultipleSchedules={enableMultipleSchedules}\n />\n {autoPilotSchedule ? (\n <AutoPilotDialog\n companyId={ensureRequired(companyId)}\n schedule={autoPilotSchedule}\n onEvent={onEvent}\n />\n ) : null}\n </Flex>\n )\n}\n\n/** @internal */\nexport function PayScheduleAssignmentContextual() {\n const { companyId, onEvent } = useFlow<PayScheduleManagementContextInterface>()\n\n return <PayScheduleAssignment companyId={ensureRequired(companyId)} onEvent={onEvent} />\n}\n\n/** @internal */\nexport function PayScheduleEditFormContextual() {\n const { companyId, payScheduleId, defaultValues, onEvent } =\n useFlow<PayScheduleManagementContextInterface>()\n\n return (\n <PayScheduleForm\n companyId={ensureRequired(companyId)}\n payScheduleId={payScheduleId}\n defaultValues={defaultValues}\n onEvent={onEvent}\n />\n )\n}\n"],"names":["PayScheduleOverviewContextual","companyId","onEvent","enableAutoPilot","enableMultipleSchedules","successAlert","autoPilotSchedule","useFlow","t","useTranslation","Components","useComponentContext","jsxs","Flex","jsx","componentEvents","PayScheduleOverview","ensureRequired","AutoPilotDialog","PayScheduleAssignmentContextual","PayScheduleAssignment","PayScheduleEditFormContextual","payScheduleId","defaultValues","PayScheduleForm"],"mappings":";;;;;;;;;;;AA6BO,SAASA,IAAgC;AAC9C,QAAM;AAAA,IACJ,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,yBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,mBAAAC;AAAA,EAAA,IACEC,EAAA,GACE,EAAE,GAAAC,EAAA,IAAMC,EAAe,gCAAgC,GACvDC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UAAA;AAAA,IAAAR,IACC,gBAAAS;AAAA,MAACJ,EAAW;AAAA,MAAX;AAAA,QACC,QAAO;AAAA,QACP,OAAOF,EAAE,UAAUH,CAAY,EAAE;AAAA,QACjC,WAAW,MAAM;AACf,UAAAH,EAAQa,EAAgB,yCAAyC,IAAI;AAAA,QACvE;AAAA,MAAA;AAAA,IAAA,IAEA;AAAA,IACJ,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,WAAWC,EAAehB,CAAS;AAAA,QACnC,SAAAC;AAAA,QACA,iBAAAC;AAAA,QACA,yBAAAC;AAAA,MAAA;AAAA,IAAA;AAAA,IAEDE,IACC,gBAAAQ;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,WAAWD,EAAehB,CAAS;AAAA,QACnC,UAAUK;AAAA,QACV,SAAAJ;AAAA,MAAA;AAAA,IAAA,IAEA;AAAA,EAAA,GACN;AAEJ;AAGO,SAASiB,IAAkC;AAChD,QAAM,EAAE,WAAAlB,GAAW,SAAAC,EAAA,IAAYK,EAAA;AAE/B,2BAAQa,GAAA,EAAsB,WAAWH,EAAehB,CAAS,GAAG,SAAAC,GAAkB;AACxF;AAGO,SAASmB,IAAgC;AAC9C,QAAM,EAAE,WAAApB,GAAW,eAAAqB,GAAe,eAAAC,GAAe,SAAArB,EAAA,IAC/CK,EAAA;AAEF,SACE,gBAAAO;AAAA,IAACU;AAAA,IAAA;AAAA,MACC,WAAWP,EAAehB,CAAS;AAAA,MACnC,eAAAqB;AAAA,MACA,eAAAC;AAAA,MACA,SAAArB;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,29 +1,29 @@
1
1
  import { jsx as c } from "react/jsx-runtime";
2
2
  import { usePaySchedulesGetAllSuspense as S } from "@gusto/embedded-api/react-query/paySchedulesGetAll";
3
3
  import { PayScheduleOverviewPresentation as m } from "./PayScheduleOverviewPresentation.js";
4
- import { componentEvents as u } from "../../../../shared/constants.js";
4
+ import { componentEvents as t } from "../../../../shared/constants.js";
5
5
  import { ensureRequired as a } from "../../../../helpers/ensureRequired.js";
6
6
  function h({
7
- companyId: i,
7
+ companyId: u,
8
8
  onEvent: e,
9
- enableAutoPilot: s,
9
+ enableAutoPilot: i,
10
10
  enableMultipleSchedules: r
11
11
  }) {
12
- const { data: d } = S({ companyId: i }), t = d.payScheduleShowResponse ?? [], o = a(t.find((n) => n.active) ?? t[0]);
12
+ const { data: n } = S({ companyId: u }), s = n.payScheduleShowResponse ?? [], o = a(s.find((d) => d.active) ?? s[0]);
13
13
  return /* @__PURE__ */ c(
14
14
  m,
15
15
  {
16
16
  schedule: o,
17
- enableAutoPilot: s,
17
+ enableAutoPilot: i,
18
18
  enableMultipleSchedules: r,
19
19
  onEditSchedule: () => {
20
- e(u.PAY_SCHEDULE_UPDATE, { uuid: o.uuid });
20
+ e(t.PAY_SCHEDULE_UPDATE, { uuid: o.uuid });
21
21
  },
22
22
  onManageAssignment: () => {
23
- e(u.PAY_SCHEDULE_MANAGE_ASSIGNMENT);
23
+ e(t.PAY_SCHEDULE_MANAGE_ASSIGNMENT);
24
24
  },
25
25
  onEditAutoPilot: () => {
26
- e(u.PAY_SCHEDULE_AUTO_PILOT_EDIT, { uuid: o.uuid });
26
+ e(t.PAY_SCHEDULE_AUTO_PILOT_EDIT, { schedule: o });
27
27
  }
28
28
  }
29
29
  );
@@ -1 +1 @@
1
- {"version":3,"file":"PayScheduleOverview.js","sources":["../../../../../src/components/Company/PaySchedule/management/PayScheduleOverview.tsx"],"sourcesContent":["import { usePaySchedulesGetAllSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetAll'\nimport { PayScheduleOverviewPresentation } from './PayScheduleOverviewPresentation'\nimport { componentEvents, type EventType } from '@/shared/constants'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\n/** @internal */\nexport interface PayScheduleOverviewProps {\n companyId: string\n onEvent: OnEventType<EventType, unknown>\n enableAutoPilot?: boolean\n enableMultipleSchedules?: boolean\n}\n\n/** @internal */\nexport function PayScheduleOverview({\n companyId,\n onEvent,\n enableAutoPilot,\n enableMultipleSchedules,\n}: PayScheduleOverviewProps) {\n const { data: paySchedules } = usePaySchedulesGetAllSuspense({ companyId })\n const schedules = paySchedules.payScheduleShowResponse ?? []\n /**\n * Prefer the schedule with employees assigned to it over an unassigned leftover — relevant\n * if enableMultipleSchedules was previously on and is now off, leaving more than one schedule\n * behind. PaySchedule.tsx only routes here once it's confirmed at least one schedule exists.\n */\n const schedule = ensureRequired(schedules.find(s => s.active) ?? schedules[0])\n\n return (\n <PayScheduleOverviewPresentation\n schedule={schedule}\n enableAutoPilot={enableAutoPilot}\n enableMultipleSchedules={enableMultipleSchedules}\n onEditSchedule={() => {\n onEvent(componentEvents.PAY_SCHEDULE_UPDATE, { uuid: schedule.uuid })\n }}\n onManageAssignment={() => {\n onEvent(componentEvents.PAY_SCHEDULE_MANAGE_ASSIGNMENT)\n }}\n onEditAutoPilot={() => {\n onEvent(componentEvents.PAY_SCHEDULE_AUTO_PILOT_EDIT, { uuid: schedule.uuid })\n }}\n />\n )\n}\n"],"names":["PayScheduleOverview","companyId","onEvent","enableAutoPilot","enableMultipleSchedules","paySchedules","usePaySchedulesGetAllSuspense","schedules","schedule","ensureRequired","s","jsx","PayScheduleOverviewPresentation","componentEvents"],"mappings":";;;;;AAeO,SAASA,EAAoB;AAAA,EAClC,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,yBAAAC;AACF,GAA6B;AAC3B,QAAM,EAAE,MAAMC,EAAA,IAAiBC,EAA8B,EAAE,WAAAL,GAAW,GACpEM,IAAYF,EAAa,2BAA2B,CAAA,GAMpDG,IAAWC,EAAeF,EAAU,KAAK,CAAAG,MAAKA,EAAE,MAAM,KAAKH,EAAU,CAAC,CAAC;AAE7E,SACE,gBAAAI;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,UAAAJ;AAAA,MACA,iBAAAL;AAAA,MACA,yBAAAC;AAAA,MACA,gBAAgB,MAAM;AACpB,QAAAF,EAAQW,EAAgB,qBAAqB,EAAE,MAAML,EAAS,MAAM;AAAA,MACtE;AAAA,MACA,oBAAoB,MAAM;AACxB,QAAAN,EAAQW,EAAgB,8BAA8B;AAAA,MACxD;AAAA,MACA,iBAAiB,MAAM;AACrB,QAAAX,EAAQW,EAAgB,8BAA8B,EAAE,MAAML,EAAS,MAAM;AAAA,MAC/E;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"PayScheduleOverview.js","sources":["../../../../../src/components/Company/PaySchedule/management/PayScheduleOverview.tsx"],"sourcesContent":["import { usePaySchedulesGetAllSuspense } from '@gusto/embedded-api/react-query/paySchedulesGetAll'\nimport { PayScheduleOverviewPresentation } from './PayScheduleOverviewPresentation'\nimport { componentEvents, type EventType } from '@/shared/constants'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\n/** @internal */\nexport interface PayScheduleOverviewProps {\n companyId: string\n onEvent: OnEventType<EventType, unknown>\n enableAutoPilot?: boolean\n enableMultipleSchedules?: boolean\n}\n\n/** @internal */\nexport function PayScheduleOverview({\n companyId,\n onEvent,\n enableAutoPilot,\n enableMultipleSchedules,\n}: PayScheduleOverviewProps) {\n const { data: paySchedules } = usePaySchedulesGetAllSuspense({ companyId })\n const schedules = paySchedules.payScheduleShowResponse ?? []\n /**\n * Prefer the schedule with employees assigned to it over an unassigned leftover — relevant\n * if enableMultipleSchedules was previously on and is now off, leaving more than one schedule\n * behind. PaySchedule.tsx only routes here once it's confirmed at least one schedule exists.\n */\n const schedule = ensureRequired(schedules.find(s => s.active) ?? schedules[0])\n\n return (\n <PayScheduleOverviewPresentation\n schedule={schedule}\n enableAutoPilot={enableAutoPilot}\n enableMultipleSchedules={enableMultipleSchedules}\n onEditSchedule={() => {\n onEvent(componentEvents.PAY_SCHEDULE_UPDATE, { uuid: schedule.uuid })\n }}\n onManageAssignment={() => {\n onEvent(componentEvents.PAY_SCHEDULE_MANAGE_ASSIGNMENT)\n }}\n onEditAutoPilot={() => {\n onEvent(componentEvents.PAY_SCHEDULE_AUTO_PILOT_EDIT, { schedule })\n }}\n />\n )\n}\n"],"names":["PayScheduleOverview","companyId","onEvent","enableAutoPilot","enableMultipleSchedules","paySchedules","usePaySchedulesGetAllSuspense","schedules","schedule","ensureRequired","s","jsx","PayScheduleOverviewPresentation","componentEvents"],"mappings":";;;;;AAeO,SAASA,EAAoB;AAAA,EAClC,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,yBAAAC;AACF,GAA6B;AAC3B,QAAM,EAAE,MAAMC,EAAA,IAAiBC,EAA8B,EAAE,WAAAL,GAAW,GACpEM,IAAYF,EAAa,2BAA2B,CAAA,GAMpDG,IAAWC,EAAeF,EAAU,KAAK,CAAAG,MAAKA,EAAE,MAAM,KAAKH,EAAU,CAAC,CAAC;AAE7E,SACE,gBAAAI;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,UAAAJ;AAAA,MACA,iBAAAL;AAAA,MACA,yBAAAC;AAAA,MACA,gBAAgB,MAAM;AACpB,QAAAF,EAAQW,EAAgB,qBAAqB,EAAE,MAAML,EAAS,MAAM;AAAA,MACtE;AAAA,MACA,oBAAoB,MAAM;AACxB,QAAAN,EAAQW,EAAgB,8BAA8B;AAAA,MACxD;AAAA,MACA,iBAAiB,MAAM;AACrB,QAAAX,EAAQW,EAAgB,8BAA8B,EAAE,UAAAL,EAAA,CAAU;AAAA,MACpE;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,66 +1,108 @@
1
- import { state as E, transition as e, reduce as c } from "robot3";
2
- import { PayScheduleEditFormContextual as S, PayScheduleAssignmentContextual as a, PayScheduleOverviewContextual as A } from "./PayScheduleManagementComponents.js";
1
+ import { state as A, transition as o, reduce as E } from "robot3";
2
+ import { PayScheduleEditFormContextual as l, PayScheduleAssignmentContextual as v, PayScheduleOverviewContextual as d } from "./PayScheduleManagementComponents.js";
3
3
  import { componentEvents as t } from "../../../../shared/constants.js";
4
- const n = c(
5
- (o) => ({
6
- ...o,
7
- component: A,
4
+ const S = E(
5
+ (e) => ({
6
+ ...e,
7
+ component: d,
8
8
  payScheduleId: void 0,
9
+ autoPilotSchedule: void 0,
9
10
  successAlert: null
10
11
  })
11
- ), r = (o) => c((i) => ({
12
+ ), c = (e) => E((i) => ({
12
13
  ...i,
13
- component: A,
14
+ component: d,
14
15
  payScheduleId: void 0,
15
- successAlert: o
16
- })), l = {
17
- overview: E(
18
- e(
16
+ autoPilotSchedule: void 0,
17
+ successAlert: e
18
+ })), a = {
19
+ overview: A(
20
+ o(
19
21
  t.PAY_SCHEDULE_UPDATE,
20
22
  "editSchedule",
21
- c(
22
- (o, i) => ({
23
- ...o,
24
- component: S,
23
+ E(
24
+ (e, i) => ({
25
+ ...e,
26
+ component: l,
25
27
  payScheduleId: i.payload.uuid
26
28
  })
27
29
  )
28
30
  ),
29
- e(
31
+ o(
30
32
  t.PAY_SCHEDULE_MANAGE_ASSIGNMENT,
31
33
  "manageAssignment",
32
- c(
33
- (o) => ({
34
- ...o,
35
- component: a,
34
+ E(
35
+ (e) => ({
36
+ ...e,
37
+ component: v,
36
38
  successAlert: null
37
39
  })
38
40
  )
39
41
  ),
40
- e(t.PAY_SCHEDULE_MANAGEMENT_ALERT_DISMISSED, "overview", n)
42
+ o(t.PAY_SCHEDULE_MANAGEMENT_ALERT_DISMISSED, "overview", S),
43
+ o(
44
+ t.PAY_SCHEDULE_AUTO_PILOT_EDIT,
45
+ "overview",
46
+ E(
47
+ (e, i) => ({
48
+ ...e,
49
+ autoPilotSchedule: i.payload.schedule
50
+ })
51
+ )
52
+ ),
53
+ o(
54
+ t.PAY_SCHEDULE_AUTO_PILOT_ENABLED,
55
+ "overview",
56
+ E(
57
+ (e) => ({
58
+ ...e,
59
+ autoPilotSchedule: void 0
60
+ })
61
+ )
62
+ ),
63
+ o(
64
+ t.PAY_SCHEDULE_AUTO_PILOT_DISABLED,
65
+ "overview",
66
+ E(
67
+ (e) => ({
68
+ ...e,
69
+ autoPilotSchedule: void 0
70
+ })
71
+ )
72
+ ),
73
+ o(
74
+ t.PAY_SCHEDULE_AUTO_PILOT_DISMISSED,
75
+ "overview",
76
+ E(
77
+ (e) => ({
78
+ ...e,
79
+ autoPilotSchedule: void 0
80
+ })
81
+ )
82
+ )
41
83
  ),
42
- editSchedule: E(
43
- e(t.PAY_SCHEDULE_UPDATED, "overview", n),
44
- e(t.CANCEL, "overview", n)
84
+ editSchedule: A(
85
+ o(t.PAY_SCHEDULE_UPDATED, "overview", S),
86
+ o(t.CANCEL, "overview", S)
45
87
  ),
46
88
  /**
47
89
  * Entered directly from PaySchedule.tsx's initial routing when the company has no pay
48
90
  * schedules yet — there's no overview to fall back to, so CANCEL isn't handled here; it
49
91
  * still bubbles to the host via Flow's onEvent re-emit.
50
92
  */
51
- createSchedule: E(
52
- e(t.PAY_SCHEDULE_CREATED, "overview", n)
93
+ createSchedule: A(
94
+ o(t.PAY_SCHEDULE_CREATED, "overview", S)
53
95
  ),
54
- manageAssignment: E(
55
- e(t.PAY_SCHEDULE_ASSIGNMENT_CANCEL, "overview", n),
56
- e(
96
+ manageAssignment: A(
97
+ o(t.PAY_SCHEDULE_ASSIGNMENT_CANCEL, "overview", S),
98
+ o(
57
99
  t.PAY_SCHEDULE_ASSIGNED,
58
100
  "overview",
59
- r("assignmentUpdated")
101
+ c("assignmentUpdated")
60
102
  )
61
103
  )
62
104
  };
63
105
  export {
64
- l as payScheduleManagementStateMachine
106
+ a as payScheduleManagementStateMachine
65
107
  };
66
108
  //# sourceMappingURL=payScheduleManagementStateMachine.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"payScheduleManagementStateMachine.js","sources":["../../../../../src/components/Company/PaySchedule/management/payScheduleManagementStateMachine.ts"],"sourcesContent":["import { reduce, state, transition } from 'robot3'\nimport type { ComponentType } from 'react'\nimport type { PayScheduleManagementContextInterface } from './PayScheduleManagementComponents'\nimport {\n PayScheduleOverviewContextual,\n PayScheduleEditFormContextual,\n PayScheduleAssignmentContextual,\n} from './PayScheduleManagementComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\n\ntype EventPayloads = {\n [componentEvents.PAY_SCHEDULE_UPDATE]: { uuid: string }\n [componentEvents.PAY_SCHEDULE_CREATED]: undefined\n}\n\nconst toOverview = reduce(\n (ctx: PayScheduleManagementContextInterface): PayScheduleManagementContextInterface => ({\n ...ctx,\n component: PayScheduleOverviewContextual as ComponentType,\n payScheduleId: undefined,\n successAlert: null,\n }),\n)\n\nconst toOverviewWithAlert = (alert: PayScheduleManagementContextInterface['successAlert']) =>\n reduce((ctx: PayScheduleManagementContextInterface): PayScheduleManagementContextInterface => ({\n ...ctx,\n component: PayScheduleOverviewContextual as ComponentType,\n payScheduleId: undefined,\n successAlert: alert,\n }))\n\n/** @internal */\nexport const payScheduleManagementStateMachine = {\n overview: state<MachineTransition>(\n transition(\n componentEvents.PAY_SCHEDULE_UPDATE,\n 'editSchedule',\n reduce(\n (\n ctx: PayScheduleManagementContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.PAY_SCHEDULE_UPDATE>,\n ): PayScheduleManagementContextInterface => ({\n ...ctx,\n component: PayScheduleEditFormContextual as ComponentType,\n payScheduleId: ev.payload.uuid,\n }),\n ),\n ),\n transition(\n componentEvents.PAY_SCHEDULE_MANAGE_ASSIGNMENT,\n 'manageAssignment',\n reduce(\n (ctx: PayScheduleManagementContextInterface): PayScheduleManagementContextInterface => ({\n ...ctx,\n component: PayScheduleAssignmentContextual as ComponentType,\n successAlert: null,\n }),\n ),\n ),\n transition(componentEvents.PAY_SCHEDULE_MANAGEMENT_ALERT_DISMISSED, 'overview', toOverview),\n ),\n editSchedule: state<MachineTransition>(\n transition(componentEvents.PAY_SCHEDULE_UPDATED, 'overview', toOverview),\n transition(componentEvents.CANCEL, 'overview', toOverview),\n ),\n /**\n * Entered directly from PaySchedule.tsx's initial routing when the company has no pay\n * schedules yet — there's no overview to fall back to, so CANCEL isn't handled here; it\n * still bubbles to the host via Flow's onEvent re-emit.\n */\n createSchedule: state<MachineTransition>(\n transition(componentEvents.PAY_SCHEDULE_CREATED, 'overview', toOverview),\n ),\n manageAssignment: state<MachineTransition>(\n transition(componentEvents.PAY_SCHEDULE_ASSIGNMENT_CANCEL, 'overview', toOverview),\n transition(\n componentEvents.PAY_SCHEDULE_ASSIGNED,\n 'overview',\n toOverviewWithAlert('assignmentUpdated'),\n ),\n ),\n}\n"],"names":["toOverview","reduce","ctx","PayScheduleOverviewContextual","toOverviewWithAlert","alert","payScheduleManagementStateMachine","state","transition","componentEvents","ev","PayScheduleEditFormContextual","PayScheduleAssignmentContextual"],"mappings":";;;AAgBA,MAAMA,IAAaC;AAAA,EACjB,CAACC,OAAuF;AAAA,IACtF,GAAGA;AAAA,IACH,WAAWC;AAAA,IACX,eAAe;AAAA,IACf,cAAc;AAAA,EAAA;AAElB,GAEMC,IAAsB,CAACC,MAC3BJ,EAAO,CAACC,OAAuF;AAAA,EAC7F,GAAGA;AAAA,EACH,WAAWC;AAAA,EACX,eAAe;AAAA,EACf,cAAcE;AAChB,EAAE,GAGSC,IAAoC;AAAA,EAC/C,UAAUC;AAAA,IACRC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAR;AAAA,QACE,CACEC,GACAQ,OAC2C;AAAA,UAC3C,GAAGR;AAAA,UACH,WAAWS;AAAA,UACX,eAAeD,EAAG,QAAQ;AAAA,QAAA;AAAA,MAC5B;AAAA,IACF;AAAA,IAEFF;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAR;AAAA,QACE,CAACC,OAAuF;AAAA,UACtF,GAAGA;AAAA,UACH,WAAWU;AAAA,UACX,cAAc;AAAA,QAAA;AAAA,MAChB;AAAA,IACF;AAAA,IAEFJ,EAAWC,EAAgB,yCAAyC,YAAYT,CAAU;AAAA,EAAA;AAAA,EAE5F,cAAcO;AAAA,IACZC,EAAWC,EAAgB,sBAAsB,YAAYT,CAAU;AAAA,IACvEQ,EAAWC,EAAgB,QAAQ,YAAYT,CAAU;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO3D,gBAAgBO;AAAA,IACdC,EAAWC,EAAgB,sBAAsB,YAAYT,CAAU;AAAA,EAAA;AAAA,EAEzE,kBAAkBO;AAAA,IAChBC,EAAWC,EAAgB,gCAAgC,YAAYT,CAAU;AAAA,IACjFQ;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAL,EAAoB,mBAAmB;AAAA,IAAA;AAAA,EACzC;AAEJ;"}
1
+ {"version":3,"file":"payScheduleManagementStateMachine.js","sources":["../../../../../src/components/Company/PaySchedule/management/payScheduleManagementStateMachine.ts"],"sourcesContent":["import { reduce, state, transition } from 'robot3'\nimport type { ComponentType } from 'react'\nimport type { PayScheduleShow } from '@gusto/embedded-api/models/components/payscheduleshow'\nimport type { PayScheduleManagementContextInterface } from './PayScheduleManagementComponents'\nimport {\n PayScheduleOverviewContextual,\n PayScheduleEditFormContextual,\n PayScheduleAssignmentContextual,\n} from './PayScheduleManagementComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\n\ntype EventPayloads = {\n [componentEvents.PAY_SCHEDULE_UPDATE]: { uuid: string }\n [componentEvents.PAY_SCHEDULE_CREATED]: undefined\n [componentEvents.PAY_SCHEDULE_AUTO_PILOT_EDIT]: { schedule: PayScheduleShow }\n}\n\nconst toOverview = reduce(\n (ctx: PayScheduleManagementContextInterface): PayScheduleManagementContextInterface => ({\n ...ctx,\n component: PayScheduleOverviewContextual as ComponentType,\n payScheduleId: undefined,\n autoPilotSchedule: undefined,\n successAlert: null,\n }),\n)\n\nconst toOverviewWithAlert = (alert: PayScheduleManagementContextInterface['successAlert']) =>\n reduce((ctx: PayScheduleManagementContextInterface): PayScheduleManagementContextInterface => ({\n ...ctx,\n component: PayScheduleOverviewContextual as ComponentType,\n payScheduleId: undefined,\n autoPilotSchedule: undefined,\n successAlert: alert,\n }))\n\n/** @internal */\nexport const payScheduleManagementStateMachine = {\n overview: state<MachineTransition>(\n transition(\n componentEvents.PAY_SCHEDULE_UPDATE,\n 'editSchedule',\n reduce(\n (\n ctx: PayScheduleManagementContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.PAY_SCHEDULE_UPDATE>,\n ): PayScheduleManagementContextInterface => ({\n ...ctx,\n component: PayScheduleEditFormContextual as ComponentType,\n payScheduleId: ev.payload.uuid,\n }),\n ),\n ),\n transition(\n componentEvents.PAY_SCHEDULE_MANAGE_ASSIGNMENT,\n 'manageAssignment',\n reduce(\n (ctx: PayScheduleManagementContextInterface): PayScheduleManagementContextInterface => ({\n ...ctx,\n component: PayScheduleAssignmentContextual as ComponentType,\n successAlert: null,\n }),\n ),\n ),\n transition(componentEvents.PAY_SCHEDULE_MANAGEMENT_ALERT_DISMISSED, 'overview', toOverview),\n transition(\n componentEvents.PAY_SCHEDULE_AUTO_PILOT_EDIT,\n 'overview',\n reduce(\n (\n ctx: PayScheduleManagementContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.PAY_SCHEDULE_AUTO_PILOT_EDIT>,\n ): PayScheduleManagementContextInterface => ({\n ...ctx,\n autoPilotSchedule: ev.payload.schedule,\n }),\n ),\n ),\n transition(\n componentEvents.PAY_SCHEDULE_AUTO_PILOT_ENABLED,\n 'overview',\n reduce(\n (ctx: PayScheduleManagementContextInterface): PayScheduleManagementContextInterface => ({\n ...ctx,\n autoPilotSchedule: undefined,\n }),\n ),\n ),\n transition(\n componentEvents.PAY_SCHEDULE_AUTO_PILOT_DISABLED,\n 'overview',\n reduce(\n (ctx: PayScheduleManagementContextInterface): PayScheduleManagementContextInterface => ({\n ...ctx,\n autoPilotSchedule: undefined,\n }),\n ),\n ),\n transition(\n componentEvents.PAY_SCHEDULE_AUTO_PILOT_DISMISSED,\n 'overview',\n reduce(\n (ctx: PayScheduleManagementContextInterface): PayScheduleManagementContextInterface => ({\n ...ctx,\n autoPilotSchedule: undefined,\n }),\n ),\n ),\n ),\n editSchedule: state<MachineTransition>(\n transition(componentEvents.PAY_SCHEDULE_UPDATED, 'overview', toOverview),\n transition(componentEvents.CANCEL, 'overview', toOverview),\n ),\n /**\n * Entered directly from PaySchedule.tsx's initial routing when the company has no pay\n * schedules yet — there's no overview to fall back to, so CANCEL isn't handled here; it\n * still bubbles to the host via Flow's onEvent re-emit.\n */\n createSchedule: state<MachineTransition>(\n transition(componentEvents.PAY_SCHEDULE_CREATED, 'overview', toOverview),\n ),\n manageAssignment: state<MachineTransition>(\n transition(componentEvents.PAY_SCHEDULE_ASSIGNMENT_CANCEL, 'overview', toOverview),\n transition(\n componentEvents.PAY_SCHEDULE_ASSIGNED,\n 'overview',\n toOverviewWithAlert('assignmentUpdated'),\n ),\n ),\n}\n"],"names":["toOverview","reduce","ctx","PayScheduleOverviewContextual","toOverviewWithAlert","alert","payScheduleManagementStateMachine","state","transition","componentEvents","ev","PayScheduleEditFormContextual","PayScheduleAssignmentContextual"],"mappings":";;;AAkBA,MAAMA,IAAaC;AAAA,EACjB,CAACC,OAAuF;AAAA,IACtF,GAAGA;AAAA,IACH,WAAWC;AAAA,IACX,eAAe;AAAA,IACf,mBAAmB;AAAA,IACnB,cAAc;AAAA,EAAA;AAElB,GAEMC,IAAsB,CAACC,MAC3BJ,EAAO,CAACC,OAAuF;AAAA,EAC7F,GAAGA;AAAA,EACH,WAAWC;AAAA,EACX,eAAe;AAAA,EACf,mBAAmB;AAAA,EACnB,cAAcE;AAChB,EAAE,GAGSC,IAAoC;AAAA,EAC/C,UAAUC;AAAA,IACRC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAR;AAAA,QACE,CACEC,GACAQ,OAC2C;AAAA,UAC3C,GAAGR;AAAA,UACH,WAAWS;AAAA,UACX,eAAeD,EAAG,QAAQ;AAAA,QAAA;AAAA,MAC5B;AAAA,IACF;AAAA,IAEFF;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAR;AAAA,QACE,CAACC,OAAuF;AAAA,UACtF,GAAGA;AAAA,UACH,WAAWU;AAAA,UACX,cAAc;AAAA,QAAA;AAAA,MAChB;AAAA,IACF;AAAA,IAEFJ,EAAWC,EAAgB,yCAAyC,YAAYT,CAAU;AAAA,IAC1FQ;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAR;AAAA,QACE,CACEC,GACAQ,OAC2C;AAAA,UAC3C,GAAGR;AAAA,UACH,mBAAmBQ,EAAG,QAAQ;AAAA,QAAA;AAAA,MAChC;AAAA,IACF;AAAA,IAEFF;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAR;AAAA,QACE,CAACC,OAAuF;AAAA,UACtF,GAAGA;AAAA,UACH,mBAAmB;AAAA,QAAA;AAAA,MACrB;AAAA,IACF;AAAA,IAEFM;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAR;AAAA,QACE,CAACC,OAAuF;AAAA,UACtF,GAAGA;AAAA,UACH,mBAAmB;AAAA,QAAA;AAAA,MACrB;AAAA,IACF;AAAA,IAEFM;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAR;AAAA,QACE,CAACC,OAAuF;AAAA,UACtF,GAAGA;AAAA,UACH,mBAAmB;AAAA,QAAA;AAAA,MACrB;AAAA,IACF;AAAA,EACF;AAAA,EAEF,cAAcK;AAAA,IACZC,EAAWC,EAAgB,sBAAsB,YAAYT,CAAU;AAAA,IACvEQ,EAAWC,EAAgB,QAAQ,YAAYT,CAAU;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO3D,gBAAgBO;AAAA,IACdC,EAAWC,EAAgB,sBAAsB,YAAYT,CAAU;AAAA,EAAA;AAAA,EAEzE,kBAAkBO;AAAA,IAChBC,EAAWC,EAAgB,gCAAgC,YAAYT,CAAU;AAAA,IACjFQ;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAL,EAAoB,mBAAmB;AAAA,IAAA;AAAA,EACzC;AAEJ;"}
@@ -9,15 +9,13 @@ import "@gusto/embedded-api/models/errors/gustoembeddederror";
9
9
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
10
10
  import "@gusto/embedded-api/models/errors/unprocessableentityerror";
11
11
  import "@gusto/embedded-api/models/errors/httpclienterrors";
12
- import "dompurify";
13
- import "../../../../contexts/LocaleProvider/useLocale.js";
14
12
  import "../../../../shared/constants.js";
15
13
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
16
14
  import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
17
15
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
18
- const [f, v] = t("StateTaxesFormContext");
16
+ const [d, u] = t("StateTaxesFormContext");
19
17
  export {
20
- v as StateTaxesFormProvider,
21
- f as useStateTaxesForm
18
+ u as StateTaxesFormProvider,
19
+ d as useStateTaxesForm
22
20
  };
23
21
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/context.ts"],"sourcesContent":["import type { TaxRequirementsState } from '@gusto/embedded-api/models/components/taxrequirementsstate'\nimport { createCompoundContext } from '@/components/Base'\n\ninterface StateTaxFormContext {\n isPending: boolean\n state: string\n stateTaxRequirements: TaxRequirementsState\n handleCancel: () => void\n}\n\nconst [useStateTaxesForm, StateTaxesFormProvider] =\n createCompoundContext<StateTaxFormContext>('StateTaxesFormContext')\n\nexport { useStateTaxesForm, StateTaxesFormProvider }\n"],"names":["useStateTaxesForm","StateTaxesFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAA2C,uBAAuB;"}
1
+ {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesForm/context.ts"],"sourcesContent":["import type { TaxRequirementsState } from '@gusto/embedded-api/models/components/taxrequirementsstate'\nimport { createCompoundContext } from '@/components/Base'\n\ninterface StateTaxFormContext {\n isPending: boolean\n state: string\n stateTaxRequirements: TaxRequirementsState\n handleCancel: () => void\n}\n\nconst [useStateTaxesForm, StateTaxesFormProvider] =\n createCompoundContext<StateTaxFormContext>('StateTaxesFormContext')\n\nexport { useStateTaxesForm, StateTaxesFormProvider }\n"],"names":["useStateTaxesForm","StateTaxesFormProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAUA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAA2C,uBAAuB;"}
@@ -9,15 +9,13 @@ import "@gusto/embedded-api/models/errors/gustoembeddederror";
9
9
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
10
10
  import "@gusto/embedded-api/models/errors/unprocessableentityerror";
11
11
  import "@gusto/embedded-api/models/errors/httpclienterrors";
12
- import "dompurify";
13
- import "../../../../contexts/LocaleProvider/useLocale.js";
14
12
  import "../../../../shared/constants.js";
15
13
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
16
14
  import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
17
15
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
18
- const [f, v] = t("StateTaxesListContext");
16
+ const [d, u] = t("StateTaxesListContext");
19
17
  export {
20
- v as StateTaxesListProvider,
21
- f as useStateTaxesList
18
+ u as StateTaxesListProvider,
19
+ d as useStateTaxesList
22
20
  };
23
21
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/context.ts"],"sourcesContent":["import type { TaxRequirementStatesList } from '@gusto/embedded-api/models/components/taxrequirementstateslist'\nimport { createCompoundContext } from '@/components/Base'\n\ntype StateTaxesListContextType = {\n isPending: boolean\n stateTaxRequirements: TaxRequirementStatesList[]\n handleContinue: () => void\n handleChange: (state: string) => void\n handleManageRates: (state: string) => void\n}\n\nconst [useStateTaxesList, StateTaxesListProvider] =\n createCompoundContext<StateTaxesListContextType>('StateTaxesListContext')\n\nexport { useStateTaxesList, StateTaxesListProvider }\n"],"names":["useStateTaxesList","StateTaxesListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;;AAWA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAAiD,uBAAuB;"}
1
+ {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/StateTaxesList/context.ts"],"sourcesContent":["import type { TaxRequirementStatesList } from '@gusto/embedded-api/models/components/taxrequirementstateslist'\nimport { createCompoundContext } from '@/components/Base'\n\ntype StateTaxesListContextType = {\n isPending: boolean\n stateTaxRequirements: TaxRequirementStatesList[]\n handleContinue: () => void\n handleChange: (state: string) => void\n handleManageRates: (state: string) => void\n}\n\nconst [useStateTaxesList, StateTaxesListProvider] =\n createCompoundContext<StateTaxesListContextType>('StateTaxesListContext')\n\nexport { useStateTaxesList, StateTaxesListProvider }\n"],"names":["useStateTaxesList","StateTaxesListProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAWA,MAAM,CAACA,GAAmBC,CAAsB,IAC9CC,EAAiD,uBAAuB;"}
@@ -9,15 +9,13 @@ import "@gusto/embedded-api/models/errors/gustoembeddederror";
9
9
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
10
10
  import "@gusto/embedded-api/models/errors/unprocessableentityerror";
11
11
  import "@gusto/embedded-api/models/errors/httpclienterrors";
12
- import "dompurify";
13
- import "../../../../contexts/LocaleProvider/useLocale.js";
14
12
  import "../../../../shared/constants.js";
15
13
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
16
14
  import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
17
15
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
18
- const [u, f] = t("TaxRateManagementContext");
16
+ const [d, s] = t("TaxRateManagementContext");
19
17
  export {
20
- f as TaxRateManagementProvider,
21
- u as useTaxRateManagement
18
+ s as TaxRateManagementProvider,
19
+ d as useTaxRateManagement
22
20
  };
23
21
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/TaxRateManagement/context.ts"],"sourcesContent":["import type { TaxRequirementSet } from '@gusto/embedded-api/models/components/taxrequirementset'\nimport { createCompoundContext } from '@/components/Base'\n\n/**\n * A state's effective-dated requirement sets for a single key, grouped for history display,\n * plus any future-dated candidate sets available to schedule against.\n *\n * @internal\n */\nexport interface TaxRateKeyGroup {\n key: string\n label?: string\n sets: TaxRequirementSet[]\n candidateSets: TaxRequirementSet[]\n}\n\ninterface TaxRateManagementContextType {\n state: string\n groups: TaxRateKeyGroup[]\n isPendingUpdate: boolean\n handleCancel: () => void\n handleAddRate: (\n key: string,\n effectiveFrom: string,\n requirements: { key: string; value: string }[],\n ) => Promise<boolean>\n}\n\nconst [useTaxRateManagement, TaxRateManagementProvider] =\n createCompoundContext<TaxRateManagementContextType>('TaxRateManagementContext')\n\nexport { useTaxRateManagement, TaxRateManagementProvider }\n"],"names":["useTaxRateManagement","TaxRateManagementProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;;AA4BA,MAAM,CAACA,GAAsBC,CAAyB,IACpDC,EAAoD,0BAA0B;"}
1
+ {"version":3,"file":"context.js","sources":["../../../../../src/components/Company/StateTaxes/TaxRateManagement/context.ts"],"sourcesContent":["import type { TaxRequirementSet } from '@gusto/embedded-api/models/components/taxrequirementset'\nimport { createCompoundContext } from '@/components/Base'\n\n/**\n * A state's effective-dated requirement sets for a single key, grouped for history display,\n * plus any future-dated candidate sets available to schedule against.\n *\n * @internal\n */\nexport interface TaxRateKeyGroup {\n key: string\n label?: string\n sets: TaxRequirementSet[]\n candidateSets: TaxRequirementSet[]\n}\n\ninterface TaxRateManagementContextType {\n state: string\n groups: TaxRateKeyGroup[]\n isPendingUpdate: boolean\n handleCancel: () => void\n handleAddRate: (\n key: string,\n effectiveFrom: string,\n requirements: { key: string; value: string }[],\n ) => Promise<boolean>\n}\n\nconst [useTaxRateManagement, TaxRateManagementProvider] =\n createCompoundContext<TaxRateManagementContextType>('TaxRateManagementContext')\n\nexport { useTaxRateManagement, TaxRateManagementProvider }\n"],"names":["useTaxRateManagement","TaxRateManagementProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AA4BA,MAAM,CAACA,GAAsBC,CAAyB,IACpDC,EAAoD,0BAA0B;"}