@gusto/embedded-react-sdk 0.10.4 → 0.10.6-rc.1

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 (198) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/components/Base/Base.js +46 -45
  3. package/dist/components/Base/Base.js.map +1 -1
  4. package/dist/components/Base/useBase.d.ts +1 -1
  5. package/dist/components/Base/useBase.js.map +1 -1
  6. package/dist/components/Common/OnboardingStatusBadge/index.d.ts +1 -1
  7. package/dist/components/Common/OnboardingStatusBadge/index.js.map +1 -1
  8. package/dist/components/Common/SignatureForm/SignatureForm.js +4 -6
  9. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  10. package/dist/components/Common/SignatureForm/SignatureFormActions.js +10 -12
  11. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  12. package/dist/components/Common/SignatureForm/SignatureFormFields.js +6 -8
  13. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  14. package/dist/components/Common/TaxInputs/TaxInputs.d.ts +1 -0
  15. package/dist/components/Common/TaxInputs/TaxInputs.js +100 -80
  16. package/dist/components/Common/TaxInputs/TaxInputs.js.map +1 -1
  17. package/dist/components/Company/AssignSignatory/AssignSignatory.js +11 -13
  18. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  19. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +6 -7
  20. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  21. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +8 -9
  22. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  23. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +0 -1
  24. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  25. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +2 -3
  26. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  27. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +1 -1
  28. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +6 -7
  29. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  30. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +3 -4
  31. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  32. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +9 -10
  33. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  34. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +1 -1
  35. package/dist/components/Company/AssignSignatory/TitleSelect.js +7 -8
  36. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  37. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +1 -1
  38. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +2 -3
  39. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  40. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +7 -8
  41. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  42. package/dist/components/Company/BankAccount/BankAccountForm/context.js +1 -1
  43. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +6 -7
  44. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  45. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -8
  46. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  47. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -5
  48. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  49. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +5 -6
  50. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  51. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +15 -17
  52. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  53. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +1 -1
  54. package/dist/components/Company/DocumentSigner/DocumentSigner.js +24 -22
  55. package/dist/components/Company/DocumentSigner/DocumentSigner.js.map +1 -1
  56. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +7 -9
  57. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  58. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +1 -1
  59. package/dist/components/Company/FederalTaxes/Actions.js +6 -7
  60. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  61. package/dist/components/Company/FederalTaxes/FederalTaxes.js +15 -17
  62. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  63. package/dist/components/Company/FederalTaxes/Form.js +2 -3
  64. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  65. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +1 -1
  66. package/dist/components/Company/Industry/Actions.js +5 -6
  67. package/dist/components/Company/Industry/Actions.js.map +1 -1
  68. package/dist/components/Company/Industry/Context.js +1 -1
  69. package/dist/components/Company/Industry/Edit.js +10 -11
  70. package/dist/components/Company/Industry/Edit.js.map +1 -1
  71. package/dist/components/Company/Locations/LocationForm/Actions.js +2 -3
  72. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  73. package/dist/components/Company/Locations/LocationForm/Form.js +4 -5
  74. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  75. package/dist/components/Company/Locations/LocationForm/LocationForm.js +7 -9
  76. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  77. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +1 -1
  78. package/dist/components/Company/Locations/Locations.js +25 -21
  79. package/dist/components/Company/Locations/Locations.js.map +1 -1
  80. package/dist/components/Company/Locations/LocationsList/Actions.js +2 -3
  81. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  82. package/dist/components/Company/Locations/LocationsList/List.js +2 -3
  83. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  84. package/dist/components/Company/Locations/LocationsList/LocationsList.js +9 -11
  85. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  86. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +1 -1
  87. package/dist/components/Company/OnboardingOverview/Completed.js +5 -6
  88. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  89. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +2 -3
  90. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  91. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +2 -4
  92. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  93. package/dist/components/Company/OnboardingOverview/context.js +1 -1
  94. package/dist/components/Company/PaySchedule/PaySchedule.js +55 -57
  95. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  96. package/dist/components/Company/PaySchedule/_parts/Actions.js +10 -11
  97. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  98. package/dist/components/Company/PaySchedule/_parts/Edit.js +25 -26
  99. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  100. package/dist/components/Company/PaySchedule/_parts/Head.js +2 -3
  101. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  102. package/dist/components/Company/PaySchedule/_parts/List.js +5 -6
  103. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  104. package/dist/components/Company/PaySchedule/usePaySchedule.js +1 -1
  105. package/dist/components/Company/StateTaxes/StateTaxes.js +22 -18
  106. package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
  107. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +5 -6
  108. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  109. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js +14 -14
  110. package/dist/components/Company/StateTaxes/StateTaxesForm/StateTaxesForm.js.map +1 -1
  111. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +1 -1
  112. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +6 -7
  113. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  114. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +5 -6
  115. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  116. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +1 -1
  117. package/dist/components/Contractor/Address/Address.js +0 -2
  118. package/dist/components/Contractor/Address/Address.js.map +1 -1
  119. package/dist/components/Contractor/Address/Form.js +2 -3
  120. package/dist/components/Contractor/Address/Form.js.map +1 -1
  121. package/dist/components/Contractor/Address/useAddress.js +1 -1
  122. package/dist/components/Contractor/List/index.js +2 -3
  123. package/dist/components/Contractor/List/index.js.map +1 -1
  124. package/dist/components/Contractor/NewHireReport/NewHireReport.js +16 -17
  125. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  126. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +2 -3
  127. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  128. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
  129. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  130. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -3
  131. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  132. package/dist/components/Employee/Compensation/Actions.js +4 -5
  133. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  134. package/dist/components/Employee/Compensation/Edit.js +2 -3
  135. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  136. package/dist/components/Employee/Compensation/List.js +5 -6
  137. package/dist/components/Employee/Compensation/List.js.map +1 -1
  138. package/dist/components/Employee/Deductions/Actions.js +8 -9
  139. package/dist/components/Employee/Deductions/Actions.js.map +1 -1
  140. package/dist/components/Employee/Deductions/DeductionForm.js +2 -3
  141. package/dist/components/Employee/Deductions/DeductionForm.js.map +1 -1
  142. package/dist/components/Employee/Deductions/DeductionsList.js +2 -3
  143. package/dist/components/Employee/Deductions/DeductionsList.js.map +1 -1
  144. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +2 -3
  145. package/dist/components/Employee/Deductions/IncludeDeductionsForm.js.map +1 -1
  146. package/dist/components/Employee/Deductions/useDeductions.js +1 -1
  147. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +4 -5
  148. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  149. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +10 -12
  150. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  151. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
  152. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  153. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +1 -1
  154. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +8 -10
  155. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  156. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +1 -1
  157. package/dist/components/Employee/EmployeeList/Actions.js +4 -5
  158. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  159. package/dist/components/Employee/EmployeeList/EmployeeList.js +9 -11
  160. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  161. package/dist/components/Employee/EmployeeList/Head.js +2 -3
  162. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  163. package/dist/components/Employee/EmployeeList/List.js +2 -3
  164. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  165. package/dist/components/Employee/EmployeeList/useEmployeeList.js +1 -1
  166. package/dist/components/Employee/Landing/Landing.js +6 -7
  167. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  168. package/dist/components/Employee/PaymentMethod/Actions.js +5 -6
  169. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  170. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +2 -3
  171. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  172. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +2 -3
  173. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  174. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +2 -3
  175. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  176. package/dist/components/Employee/PaymentMethod/Split.js +2 -3
  177. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  178. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +1 -1
  179. package/dist/components/Employee/Profile/Actions.js +6 -7
  180. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  181. package/dist/components/Employee/Profile/AdminPersonalDetails.js +9 -10
  182. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  183. package/dist/components/Employee/Profile/HomeAddress.js +4 -5
  184. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  185. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +8 -9
  186. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  187. package/dist/components/Employee/Profile/useProfile.js +1 -1
  188. package/dist/components/Employee/Taxes/Actions.js +7 -8
  189. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  190. package/dist/components/Employee/Taxes/FederalForm.js +4 -5
  191. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  192. package/dist/components/Employee/Taxes/useTaxes.js +1 -1
  193. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +2 -3
  194. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  195. package/dist/shared/constants.js +1 -1
  196. package/dist/shared/constants.js.map +1 -1
  197. package/dist/style.css +1 -1
  198. package/package.json +2 -2
@@ -4,53 +4,51 @@ import { useSignatoriesListSuspense as _ } from "@gusto/embedded-api/react-query
4
4
  import { Head as a } from "./Head.js";
5
5
  import { List as c } from "./List.js";
6
6
  import { ManageSignatories as u } from "./ManageSignatories.js";
7
- import { Actions as p } from "./Actions.js";
7
+ import { Actions as l } from "./Actions.js";
8
8
  import { DocumentListProvider as y } from "./useDocumentList.js";
9
9
  import { useI18n as M } from "../../../../i18n/I18n.js";
10
10
  import { BaseComponent as A } from "../../../Base/Base.js";
11
11
  import { useBase as R } from "../../../Base/useBase.js";
12
12
  import { Flex as D } from "../../../Common/Flex/Flex.js";
13
- import "react-i18next";
14
- import "classnames";
15
13
  import { companyEvents as i } from "../../../../shared/constants.js";
16
14
  function t(n) {
17
15
  return /* @__PURE__ */ o(A, { ...n, children: /* @__PURE__ */ o(E, { ...n, children: n.children }) });
18
16
  }
19
- function E({ companyId: n, signatoryId: s, className: l, children: m }) {
17
+ function E({ companyId: n, signatoryId: s, className: d, children: m }) {
20
18
  M("Company.DocumentList");
21
- const { onEvent: r } = R(), {
22
- data: { formList: d },
23
- error: f
19
+ const { onEvent: e } = R(), {
20
+ data: { formList: f },
21
+ error: p
24
22
  } = O({
25
23
  companyId: n
26
- }), g = d, {
24
+ }), g = f, {
27
25
  data: { signatoryList: h }
28
26
  } = _({
29
27
  companyUuid: n
30
- }), e = h[0], S = !!s && e?.uuid === s;
31
- return /* @__PURE__ */ o("section", { className: l, children: /* @__PURE__ */ o(
28
+ }), r = h[0], S = !!s && r?.uuid === s;
29
+ return /* @__PURE__ */ o("section", { className: d, children: /* @__PURE__ */ o(
32
30
  y,
33
31
  {
34
32
  value: {
35
33
  companyForms: g,
36
- documentListError: f,
34
+ documentListError: p,
37
35
  handleRequestFormToSign: (C) => {
38
- r(i.COMPANY_VIEW_FORM_TO_SIGN, C);
36
+ e(i.COMPANY_VIEW_FORM_TO_SIGN, C);
39
37
  },
40
38
  handleChangeSignatory: () => {
41
- r(i.COMPANY_FORM_EDIT_SIGNATORY, e);
39
+ e(i.COMPANY_FORM_EDIT_SIGNATORY, r);
42
40
  },
43
41
  handleContinue: () => {
44
- r(i.COMPANY_FORMS_DONE);
42
+ e(i.COMPANY_FORMS_DONE);
45
43
  },
46
44
  isSelfSignatory: S,
47
- signatory: e
45
+ signatory: r
48
46
  },
49
47
  children: /* @__PURE__ */ o(D, { flexDirection: "column", gap: 32, children: m || /* @__PURE__ */ F(L, { children: [
50
48
  /* @__PURE__ */ o(a, {}),
51
49
  /* @__PURE__ */ o(u, {}),
52
50
  /* @__PURE__ */ o(c, {}),
53
- /* @__PURE__ */ o(p, {})
51
+ /* @__PURE__ */ o(l, {})
54
52
  ] }) })
55
53
  }
56
54
  ) });
@@ -58,7 +56,7 @@ function E({ companyId: n, signatoryId: s, className: l, children: m }) {
58
56
  t.Head = a;
59
57
  t.ManageSignatories = u;
60
58
  t.List = c;
61
- t.Actions = p;
59
+ t.Actions = l;
62
60
  export {
63
61
  t as DocumentList
64
62
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentList.js","sources":["../../../../../src/components/Company/DocumentSigner/DocumentList/DocumentList.tsx"],"sourcesContent":["import { type Form as FormSchema } from '@gusto/embedded-api/models/components/form'\nimport { useCompanyFormsGetAllSuspense } from '@gusto/embedded-api/react-query/companyFormsGetAll'\nimport { useSignatoriesListSuspense } from '@gusto/embedded-api/react-query/signatoriesList'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { ManageSignatories } from './ManageSignatories'\nimport { Actions } from './Actions'\nimport { DocumentListProvider } from './useDocumentList'\nimport { useI18n } from '@/i18n'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\n\ninterface DocumentListProps extends BaseComponentInterface<'Company.DocumentList'> {\n companyId: string\n signatoryId?: string\n}\n\nexport function DocumentList(props: DocumentListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, signatoryId, className, children }: DocumentListProps) {\n useI18n('Company.DocumentList')\n const { onEvent } = useBase()\n\n const {\n data: { formList },\n error: documentListError,\n } = useCompanyFormsGetAllSuspense({\n companyId,\n })\n const companyForms = formList!\n\n const {\n data: { signatoryList },\n } = useSignatoriesListSuspense({\n companyUuid: companyId,\n })\n const signatories = signatoryList!\n\n // For now, this will only ever have one entry for the current signatory since companies can\n // only have one signatory. If that changes in the future, this UX will need to be revisited.\n const signatory = signatories[0]\n const isSelfSignatory = !!signatoryId && signatory?.uuid === signatoryId\n\n const handleRequestFormToSign = (form: FormSchema) => {\n onEvent(companyEvents.COMPANY_VIEW_FORM_TO_SIGN, form)\n }\n\n const handleChangeSignatory = () => {\n onEvent(companyEvents.COMPANY_FORM_EDIT_SIGNATORY, signatory)\n }\n\n const handleContinue = () => {\n onEvent(companyEvents.COMPANY_FORMS_DONE)\n }\n\n return (\n <section className={className}>\n <DocumentListProvider\n value={{\n companyForms,\n documentListError,\n handleRequestFormToSign,\n handleChangeSignatory,\n handleContinue,\n isSelfSignatory,\n signatory,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <ManageSignatories />\n <List />\n <Actions />\n </>\n )}\n </Flex>\n </DocumentListProvider>\n </section>\n )\n}\n\nDocumentList.Head = Head\nDocumentList.ManageSignatories = ManageSignatories\nDocumentList.List = List\nDocumentList.Actions = Actions\n"],"names":["DocumentList","props","jsx","BaseComponent","Root","companyId","signatoryId","className","children","useI18n","onEvent","useBase","formList","documentListError","useCompanyFormsGetAllSuspense","companyForms","signatoryList","useSignatoriesListSuspense","signatory","isSelfSignatory","DocumentListProvider","form","companyEvents","Flex","jsxs","Fragment","Head","ManageSignatories","List","Actions"],"mappings":";;;;;;;;;;;;;;;AAmBO,SAASA,EAAaC,GAA0B;AAEnD,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,aAAAC,GAAa,WAAAC,GAAW,UAAAC,KAA+B;AAChF,EAAAC,EAAQ,sBAAsB;AACxB,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAQ,GAEtB;AAAA,IACJ,MAAM,EAAE,UAAAC,EAAS;AAAA,IACjB,OAAOC;AAAA,MACLC,EAA8B;AAAA,IAChC,WAAAT;AAAA,EAAA,CACD,GACKU,IAAeH,GAEf;AAAA,IACJ,MAAM,EAAE,eAAAI,EAAc;AAAA,MACpBC,EAA2B;AAAA,IAC7B,aAAaZ;AAAA,EAAA,CACd,GAKKa,IAJcF,EAIU,CAAC,GACzBG,IAAkB,CAAC,CAACb,KAAeY,GAAW,SAASZ;AAe3D,SAAA,gBAAAJ,EAAC,aAAQ,WAAAK,GACP,UAAA,gBAAAL;AAAA,IAACkB;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,cAAAL;AAAA,QACA,mBAAAF;AAAA,QACA,yBAlBwB,CAACQ,MAAqB;AAC5C,UAAAX,EAAAY,EAAc,2BAA2BD,CAAI;AAAA,QACvD;AAAA,QAiBQ,uBAfsB,MAAM;AAC1B,UAAAX,EAAAY,EAAc,6BAA6BJ,CAAS;AAAA,QAC9D;AAAA,QAcQ,gBAZe,MAAM;AAC3B,UAAAR,EAAQY,EAAc,kBAAkB;AAAA,QAC1C;AAAA,QAWQ,iBAAAH;AAAA,QACA,WAAAD;AAAA,MACF;AAAA,MAEA,UAAA,gBAAAhB,EAACqB,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAf,KAIG,gBAAAgB,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAvB,EAACwB,GAAK,EAAA;AAAA,0BACLC,GAAkB,EAAA;AAAA,0BAClBC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,EAAA,CACX,EAEJ,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAEA7B,EAAa,OAAO0B;AACpB1B,EAAa,oBAAoB2B;AACjC3B,EAAa,OAAO4B;AACpB5B,EAAa,UAAU6B;"}
1
+ {"version":3,"file":"DocumentList.js","sources":["../../../../../src/components/Company/DocumentSigner/DocumentList/DocumentList.tsx"],"sourcesContent":["import { type Form as FormSchema } from '@gusto/embedded-api/models/components/form'\nimport { useCompanyFormsGetAllSuspense } from '@gusto/embedded-api/react-query/companyFormsGetAll'\nimport { useSignatoriesListSuspense } from '@gusto/embedded-api/react-query/signatoriesList'\nimport { Head } from './Head'\nimport { List } from './List'\nimport { ManageSignatories } from './ManageSignatories'\nimport { Actions } from './Actions'\nimport { DocumentListProvider } from './useDocumentList'\nimport { useI18n } from '@/i18n'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\n\ninterface DocumentListProps extends BaseComponentInterface<'Company.DocumentList'> {\n companyId: string\n signatoryId?: string\n}\n\nexport function DocumentList(props: DocumentListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, signatoryId, className, children }: DocumentListProps) {\n useI18n('Company.DocumentList')\n const { onEvent } = useBase()\n\n const {\n data: { formList },\n error: documentListError,\n } = useCompanyFormsGetAllSuspense({\n companyId,\n })\n const companyForms = formList!\n\n const {\n data: { signatoryList },\n } = useSignatoriesListSuspense({\n companyUuid: companyId,\n })\n const signatories = signatoryList!\n\n // For now, this will only ever have one entry for the current signatory since companies can\n // only have one signatory. If that changes in the future, this UX will need to be revisited.\n const signatory = signatories[0]\n const isSelfSignatory = !!signatoryId && signatory?.uuid === signatoryId\n\n const handleRequestFormToSign = (form: FormSchema) => {\n onEvent(companyEvents.COMPANY_VIEW_FORM_TO_SIGN, form)\n }\n\n const handleChangeSignatory = () => {\n onEvent(companyEvents.COMPANY_FORM_EDIT_SIGNATORY, signatory)\n }\n\n const handleContinue = () => {\n onEvent(companyEvents.COMPANY_FORMS_DONE)\n }\n\n return (\n <section className={className}>\n <DocumentListProvider\n value={{\n companyForms,\n documentListError,\n handleRequestFormToSign,\n handleChangeSignatory,\n handleContinue,\n isSelfSignatory,\n signatory,\n }}\n >\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <ManageSignatories />\n <List />\n <Actions />\n </>\n )}\n </Flex>\n </DocumentListProvider>\n </section>\n )\n}\n\nDocumentList.Head = Head\nDocumentList.ManageSignatories = ManageSignatories\nDocumentList.List = List\nDocumentList.Actions = Actions\n"],"names":["DocumentList","props","jsx","BaseComponent","Root","companyId","signatoryId","className","children","useI18n","onEvent","useBase","formList","documentListError","useCompanyFormsGetAllSuspense","companyForms","signatoryList","useSignatoriesListSuspense","signatory","isSelfSignatory","DocumentListProvider","form","companyEvents","Flex","jsxs","Fragment","Head","ManageSignatories","List","Actions"],"mappings":";;;;;;;;;;;;;AAmBO,SAASA,EAAaC,GAA0B;AAEnD,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,aAAAC,GAAa,WAAAC,GAAW,UAAAC,KAA+B;AAChF,EAAAC,EAAQ,sBAAsB;AACxB,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAQ,GAEtB;AAAA,IACJ,MAAM,EAAE,UAAAC,EAAS;AAAA,IACjB,OAAOC;AAAA,MACLC,EAA8B;AAAA,IAChC,WAAAT;AAAA,EAAA,CACD,GACKU,IAAeH,GAEf;AAAA,IACJ,MAAM,EAAE,eAAAI,EAAc;AAAA,MACpBC,EAA2B;AAAA,IAC7B,aAAaZ;AAAA,EAAA,CACd,GAKKa,IAJcF,EAIU,CAAC,GACzBG,IAAkB,CAAC,CAACb,KAAeY,GAAW,SAASZ;AAe3D,SAAA,gBAAAJ,EAAC,aAAQ,WAAAK,GACP,UAAA,gBAAAL;AAAA,IAACkB;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,cAAAL;AAAA,QACA,mBAAAF;AAAA,QACA,yBAlBwB,CAACQ,MAAqB;AAC5C,UAAAX,EAAAY,EAAc,2BAA2BD,CAAI;AAAA,QACvD;AAAA,QAiBQ,uBAfsB,MAAM;AAC1B,UAAAX,EAAAY,EAAc,6BAA6BJ,CAAS;AAAA,QAC9D;AAAA,QAcQ,gBAZe,MAAM;AAC3B,UAAAR,EAAQY,EAAc,kBAAkB;AAAA,QAC1C;AAAA,QAWQ,iBAAAH;AAAA,QACA,WAAAD;AAAA,MACF;AAAA,MAEA,UAAA,gBAAAhB,EAACqB,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAAf,KAIG,gBAAAgB,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAvB,EAACwB,GAAK,EAAA;AAAA,0BACLC,GAAkB,EAAA;AAAA,0BAClBC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,EAAA,CACX,EAEJ,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;AAEA7B,EAAa,OAAO0B;AACpB1B,EAAa,oBAAoB2B;AACjC3B,EAAa,OAAO4B;AACpB5B,EAAa,UAAU6B;"}
@@ -8,9 +8,9 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
8
  import "@tanstack/react-query";
9
9
  import "../../../Base/useBase.js";
10
10
  import "../../../../shared/constants.js";
11
- import "classnames";
12
11
  import "dompurify";
13
12
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
13
+ import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
14
14
  import { createCompoundContext as t } from "../../../Base/createCompoundContext.js";
15
15
  const [a, d] = t(
16
16
  "CompanyDocumentListContext"
@@ -1,41 +1,43 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { createMachine as p } from "robot3";
3
- import { useSignatoriesListSuspense as g } from "@gusto/embedded-api/react-query/signatoriesList";
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { createMachine as g } from "robot3";
3
+ import { useSignatoriesListSuspense as p } from "@gusto/embedded-api/react-query/signatoriesList";
4
4
  import { useMemo as f } from "react";
5
- import { DocumentList as r, AssignSignatory as S } from "./documentSignerStateMachine.js";
6
- import { documentSignerMachine as D } from "./stateMachine.js";
7
- import { Flow as L } from "../../Flow/Flow.js";
8
- import { BaseComponent as d } from "../../Base/Base.js";
5
+ import { DocumentList as i, AssignSignatory as S } from "./documentSignerStateMachine.js";
6
+ import { documentSignerMachine as d } from "./stateMachine.js";
7
+ import { Flow as D } from "../../Flow/Flow.js";
8
+ import { BaseComponent as L } from "../../Base/Base.js";
9
9
  import "../../Base/useBase.js";
10
10
  import { useComponentDictionary as h } from "../../../i18n/I18n.js";
11
11
  import { SignatureForm as l } from "./SignatureForm/SignatureForm.js";
12
- function x({ companyId: o, signatoryId: i, onEvent: m, dictionary: s }) {
12
+ function x({ companyId: o, signatoryId: e, onEvent: m, dictionary: s }) {
13
13
  h("Company.DocumentList", s);
14
14
  const {
15
15
  data: { signatoryList: c }
16
- } = g({
16
+ } = p({
17
17
  companyUuid: o
18
- }), t = c.length > 0, u = f(
19
- () => p(
20
- t ? "documentList" : "index",
21
- D,
18
+ }), n = c.length > 0, u = f(
19
+ () => g(
20
+ n ? "documentList" : "index",
21
+ d,
22
22
  (a) => ({
23
23
  ...a,
24
- component: t ? r : S,
24
+ component: n ? i : S,
25
25
  companyId: o,
26
- signatoryId: i
26
+ signatoryId: e
27
27
  })
28
28
  ),
29
- [o, i, t]
29
+ // eslint-disable-next-line react-hooks/exhaustive-deps
30
+ [o]
31
+ // Only companyId - prevents recreation when signatoryId/doesSignatoryExist change
30
32
  );
31
- return /* @__PURE__ */ n(L, { machine: u, onEvent: m });
33
+ return /* @__PURE__ */ t(D, { machine: u, onEvent: m });
32
34
  }
33
- function e(o) {
34
- return /* @__PURE__ */ n(d, { ...o, children: /* @__PURE__ */ n(x, { ...o }) });
35
+ function r(o) {
36
+ return /* @__PURE__ */ t(L, { ...o, children: /* @__PURE__ */ t(x, { ...o }) });
35
37
  }
36
- e.DocumentList = r;
37
- e.SignatureForm = l;
38
+ r.DocumentList = i;
39
+ r.SignatureForm = l;
38
40
  export {
39
- e as DocumentSigner
41
+ r as DocumentSigner
40
42
  };
41
43
  //# sourceMappingURL=DocumentSigner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentSigner.js","sources":["../../../../src/components/Company/DocumentSigner/DocumentSigner.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useSignatoriesListSuspense } from '@gusto/embedded-api/react-query/signatoriesList'\nimport { useMemo } from 'react'\nimport { AssignSignatory, DocumentList } from './documentSignerStateMachine'\nimport { documentSignerMachine } from './stateMachine'\nimport type { DocumentSignerContextInterface } from './useDocumentSigner'\nimport { SignatureForm } from './SignatureForm'\nimport { Flow } from '@/components/Flow/Flow'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport interface DocumentSignerProps extends BaseComponentInterface<'Company.DocumentList'> {\n companyId: string\n signatoryId?: string\n}\n\nfunction DocumentSignerFlow({ companyId, signatoryId, onEvent, dictionary }: DocumentSignerProps) {\n useComponentDictionary('Company.DocumentList', dictionary)\n const {\n data: { signatoryList },\n } = useSignatoriesListSuspense({\n companyUuid: companyId,\n })\n const signatories = signatoryList!\n const doesSignatoryExist = signatories.length > 0\n\n const documentSigner = useMemo(\n () =>\n createMachine(\n doesSignatoryExist ? 'documentList' : 'index',\n documentSignerMachine,\n (initialContext: DocumentSignerContextInterface) => ({\n ...initialContext,\n component: doesSignatoryExist ? DocumentList : AssignSignatory,\n companyId,\n signatoryId,\n }),\n ),\n [companyId, signatoryId, doesSignatoryExist],\n )\n return <Flow machine={documentSigner} onEvent={onEvent} />\n}\n\nexport function DocumentSigner(props: DocumentSignerProps) {\n return (\n <BaseComponent {...props}>\n <DocumentSignerFlow {...props} />\n </BaseComponent>\n )\n}\n\nDocumentSigner.DocumentList = DocumentList\nDocumentSigner.SignatureForm = SignatureForm\n"],"names":["DocumentSignerFlow","companyId","signatoryId","onEvent","dictionary","useComponentDictionary","signatoryList","useSignatoriesListSuspense","doesSignatoryExist","documentSigner","useMemo","createMachine","documentSignerMachine","initialContext","DocumentList","AssignSignatory","jsx","Flow","DocumentSigner","props","BaseComponent","SignatureForm"],"mappings":";;;;;;;;;;;AAgBA,SAASA,EAAmB,EAAE,WAAAC,GAAW,aAAAC,GAAa,SAAAC,GAAS,YAAAC,KAAmC;AAChG,EAAAC,EAAuB,wBAAwBD,CAAU;AACnD,QAAA;AAAA,IACJ,MAAM,EAAE,eAAAE,EAAc;AAAA,MACpBC,EAA2B;AAAA,IAC7B,aAAaN;AAAA,EAAA,CACd,GAEKO,IADcF,EACmB,SAAS,GAE1CG,IAAiBC;AAAA,IACrB,MACEC;AAAA,MACEH,IAAqB,iBAAiB;AAAA,MACtCI;AAAA,MACA,CAACC,OAAoD;AAAA,QACnD,GAAGA;AAAA,QACH,WAAWL,IAAqBM,IAAeC;AAAA,QAC/C,WAAAd;AAAA,QACA,aAAAC;AAAA,MACF;AAAA,IACF;AAAA,IACF,CAACD,GAAWC,GAAaM,CAAkB;AAAA,EAC7C;AACA,SAAQ,gBAAAQ,EAAAC,GAAA,EAAK,SAASR,GAAgB,SAAAN,EAAkB,CAAA;AAC1D;AAEO,SAASe,EAAeC,GAA4B;AAEvD,SAAA,gBAAAH,EAACI,KAAe,GAAGD,GACjB,4BAACnB,GAAoB,EAAA,GAAGmB,GAAO,EACjC,CAAA;AAEJ;AAEAD,EAAe,eAAeJ;AAC9BI,EAAe,gBAAgBG;"}
1
+ {"version":3,"file":"DocumentSigner.js","sources":["../../../../src/components/Company/DocumentSigner/DocumentSigner.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useSignatoriesListSuspense } from '@gusto/embedded-api/react-query/signatoriesList'\nimport { useMemo } from 'react'\nimport { AssignSignatory, DocumentList } from './documentSignerStateMachine'\nimport { documentSignerMachine } from './stateMachine'\nimport type { DocumentSignerContextInterface } from './useDocumentSigner'\nimport { SignatureForm } from './SignatureForm'\nimport { Flow } from '@/components/Flow/Flow'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport interface DocumentSignerProps extends BaseComponentInterface<'Company.DocumentList'> {\n companyId: string\n signatoryId?: string\n}\n\nfunction DocumentSignerFlow({ companyId, signatoryId, onEvent, dictionary }: DocumentSignerProps) {\n useComponentDictionary('Company.DocumentList', dictionary)\n const {\n data: { signatoryList },\n } = useSignatoriesListSuspense({\n companyUuid: companyId,\n })\n const signatories = signatoryList!\n const doesSignatoryExist = signatories.length > 0\n\n const documentSigner = useMemo(\n () =>\n createMachine(\n doesSignatoryExist ? 'documentList' : 'index',\n documentSignerMachine,\n (initialContext: DocumentSignerContextInterface) => ({\n ...initialContext,\n component: doesSignatoryExist ? DocumentList : AssignSignatory,\n companyId,\n signatoryId,\n }),\n ),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [companyId], // Only companyId - prevents recreation when signatoryId/doesSignatoryExist change\n )\n return <Flow machine={documentSigner} onEvent={onEvent} />\n}\n\nexport function DocumentSigner(props: DocumentSignerProps) {\n return (\n <BaseComponent {...props}>\n <DocumentSignerFlow {...props} />\n </BaseComponent>\n )\n}\n\nDocumentSigner.DocumentList = DocumentList\nDocumentSigner.SignatureForm = SignatureForm\n"],"names":["DocumentSignerFlow","companyId","signatoryId","onEvent","dictionary","useComponentDictionary","signatoryList","useSignatoriesListSuspense","doesSignatoryExist","documentSigner","useMemo","createMachine","documentSignerMachine","initialContext","DocumentList","AssignSignatory","jsx","Flow","DocumentSigner","props","BaseComponent","SignatureForm"],"mappings":";;;;;;;;;;;AAgBA,SAASA,EAAmB,EAAE,WAAAC,GAAW,aAAAC,GAAa,SAAAC,GAAS,YAAAC,KAAmC;AAChG,EAAAC,EAAuB,wBAAwBD,CAAU;AACnD,QAAA;AAAA,IACJ,MAAM,EAAE,eAAAE,EAAc;AAAA,MACpBC,EAA2B;AAAA,IAC7B,aAAaN;AAAA,EAAA,CACd,GAEKO,IADcF,EACmB,SAAS,GAE1CG,IAAiBC;AAAA,IACrB,MACEC;AAAA,MACEH,IAAqB,iBAAiB;AAAA,MACtCI;AAAA,MACA,CAACC,OAAoD;AAAA,QACnD,GAAGA;AAAA,QACH,WAAWL,IAAqBM,IAAeC;AAAA,QAC/C,WAAAd;AAAA,QACA,aAAAC;AAAA,MACF;AAAA,IACF;AAAA;AAAA,IAEF,CAACD,CAAS;AAAA;AAAA,EACZ;AACA,SAAQ,gBAAAe,EAAAC,GAAA,EAAK,SAASR,GAAgB,SAAAN,EAAkB,CAAA;AAC1D;AAEO,SAASe,EAAeC,GAA4B;AAEvD,SAAA,gBAAAH,EAACI,KAAe,GAAGD,GACjB,4BAACnB,GAAoB,EAAA,GAAGmB,GAAO,EACjC,CAAA;AAEJ;AAEAD,EAAe,eAAeJ;AAC9BI,EAAe,gBAAgBG;"}
@@ -12,15 +12,13 @@ import { BaseComponent as v } from "../../../Base/Base.js";
12
12
  import { useBase as x } from "../../../Base/useBase.js";
13
13
  import { SignatureForm as G } from "../../../Common/SignatureForm/SignatureForm.js";
14
14
  import { Flex as R } from "../../../Common/Flex/Flex.js";
15
- import "react-i18next";
16
- import "classnames";
17
- import { companyEvents as e } from "../../../../shared/constants.js";
15
+ import { companyEvents as t } from "../../../../shared/constants.js";
18
16
  function n(r) {
19
17
  return /* @__PURE__ */ o(v, { ...r, children: /* @__PURE__ */ o(w, { ...r, children: r.children }) });
20
18
  }
21
- function w({ formId: r, children: m, dictionary: p }) {
22
- O("Company.SignatureForm", p), b("Company.SignatureForm");
23
- const { onEvent: t, baseSubmitHandler: f } = x(), {
19
+ function w({ formId: r, children: m, dictionary: f }) {
20
+ O("Company.SignatureForm", f), b("Company.SignatureForm");
21
+ const { onEvent: e, baseSubmitHandler: p } = x(), {
24
22
  data: { form: d }
25
23
  } = _({
26
24
  formId: r
@@ -37,11 +35,11 @@ function w({ formId: r, children: m, dictionary: p }) {
37
35
  pdfUrl: C,
38
36
  isPending: F,
39
37
  onBack: () => {
40
- t(e.COMPANY_SIGN_FORM_BACK);
38
+ e(t.COMPANY_SIGN_FORM_BACK);
41
39
  }
42
40
  },
43
41
  children: /* @__PURE__ */ o(G, { onSubmit: async (h) => {
44
- await f(h, async (i) => {
42
+ await p(h, async (i) => {
45
43
  const y = await S({
46
44
  request: {
47
45
  formId: r,
@@ -51,7 +49,7 @@ function w({ formId: r, children: m, dictionary: p }) {
51
49
  }
52
50
  }
53
51
  });
54
- t(e.COMPANY_SIGN_FORM, y.form), t(e.COMPANY_SIGN_FORM_DONE);
52
+ e(t.COMPANY_SIGN_FORM, y.form), e(t.COMPANY_SIGN_FORM_DONE);
55
53
  });
56
54
  }, children: /* @__PURE__ */ o(R, { flexDirection: "column", gap: 32, children: m || /* @__PURE__ */ P(N, { children: [
57
55
  /* @__PURE__ */ o(a, {}),
@@ -1 +1 @@
1
- {"version":3,"file":"SignatureForm.js","sources":["../../../../../src/components/Company/DocumentSigner/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { useCompanyFormsGetSuspense } from '@gusto/embedded-api/react-query/companyFormsGet'\nimport { useCompanyFormsSignMutation } from '@gusto/embedded-api/react-query/companyFormsSign'\nimport { useCompanyFormsGetPdfSuspense } from '@gusto/embedded-api/react-query/companyFormsGetPdf'\nimport { Head } from './Head'\nimport { Preview } from './Preview'\nimport { Form } from './Form'\nimport { Actions } from './Actions'\nimport { SignatureFormProvider } from './useSignatureForm'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport {\n SignatureForm as SharedSignatureForm,\n type SignatureFormInputs,\n} from '@/components/Common/SignatureForm'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\n\ninterface SignatureFormProps extends BaseComponentInterface<'Company.SignatureForm'> {\n formId: string\n companyId: string\n}\n\nexport function SignatureForm(props: SignatureFormProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport function Root({ formId, children, dictionary }: SignatureFormProps) {\n useComponentDictionary('Company.SignatureForm', dictionary)\n useI18n('Company.SignatureForm')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const {\n data: { form: formNullable },\n } = useCompanyFormsGetSuspense({\n formId,\n })\n const form = formNullable!\n\n const { isPending, mutateAsync: signForm } = useCompanyFormsSignMutation()\n\n const {\n data: { formPdf },\n } = useCompanyFormsGetPdfSuspense({\n formId,\n })\n const pdfUrl = formPdf!.documentUrl!\n\n const handleSubmit = async (data: SignatureFormInputs) => {\n await baseSubmitHandler(data, async payload => {\n const signFormResponse = await signForm({\n request: {\n formId,\n requestBody: {\n signatureText: payload.signature,\n agree: payload.confirmSignature,\n },\n },\n })\n\n onEvent(companyEvents.COMPANY_SIGN_FORM, signFormResponse.form)\n\n onEvent(companyEvents.COMPANY_SIGN_FORM_DONE)\n })\n }\n\n const handleBack = () => {\n onEvent(companyEvents.COMPANY_SIGN_FORM_BACK)\n }\n\n return (\n <SignatureFormProvider\n value={{\n form,\n pdfUrl,\n isPending,\n onBack: handleBack,\n }}\n >\n <SharedSignatureForm onSubmit={handleSubmit}>\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Preview />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </SharedSignatureForm>\n </SignatureFormProvider>\n )\n}\n\nSignatureForm.Head = Head\nSignatureForm.Preview = Preview\nSignatureForm.Form = Form\nSignatureForm.Actions = Actions\n"],"names":["SignatureForm","props","jsx","BaseComponent","Root","formId","children","dictionary","useComponentDictionary","useI18n","onEvent","baseSubmitHandler","useBase","formNullable","useCompanyFormsGetSuspense","form","isPending","signForm","useCompanyFormsSignMutation","formPdf","useCompanyFormsGetPdfSuspense","pdfUrl","SignatureFormProvider","companyEvents","SharedSignatureForm","data","payload","signFormResponse","Flex","jsxs","Fragment","Head","Preview","Form","Actions"],"mappings":";;;;;;;;;;;;;;;;;AAwBO,SAASA,EAAcC,GAA2B;AAErD,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AAEO,SAASG,EAAK,EAAE,QAAAC,GAAQ,UAAAC,GAAU,YAAAC,KAAkC;AACzE,EAAAC,EAAuB,yBAAyBD,CAAU,GAC1DE,EAAQ,uBAAuB;AAC/B,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GAEzC;AAAA,IACJ,MAAM,EAAE,MAAMC,EAAa;AAAA,MACzBC,EAA2B;AAAA,IAC7B,QAAAT;AAAA,EAAA,CACD,GACKU,IAAOF,GAEP,EAAE,WAAAG,GAAW,aAAaC,EAAA,IAAaC,EAA4B,GAEnE;AAAA,IACJ,MAAM,EAAE,SAAAC,EAAQ;AAAA,MACdC,EAA8B;AAAA,IAChC,QAAAf;AAAA,EAAA,CACD,GACKgB,IAASF,EAAS;AAyBtB,SAAA,gBAAAjB;AAAA,IAACoB;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,MAAAP;AAAA,QACA,QAAAM;AAAA,QACA,WAAAL;AAAA,QACA,QAVa,MAAM;AACvB,UAAAN,EAAQa,EAAc,sBAAsB;AAAA,QAC9C;AAAA,MASI;AAAA,MAEA,UAAC,gBAAArB,EAAAsB,GAAA,EAAoB,UA/BJ,OAAOC,MAA8B;AAClD,cAAAd,EAAkBc,GAAM,OAAMC,MAAW;AACvC,gBAAAC,IAAmB,MAAMV,EAAS;AAAA,YACtC,SAAS;AAAA,cACP,QAAAZ;AAAA,cACA,aAAa;AAAA,gBACX,eAAeqB,EAAQ;AAAA,gBACvB,OAAOA,EAAQ;AAAA,cAAA;AAAA,YACjB;AAAA,UACF,CACD;AAEO,UAAAhB,EAAAa,EAAc,mBAAmBI,EAAiB,IAAI,GAE9DjB,EAAQa,EAAc,sBAAsB;AAAA,QAAA,CAC7C;AAAA,MACH,GAgBM,UAAC,gBAAArB,EAAA0B,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UACCtB,KAGE,gBAAAuB,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAA5B,EAAC6B,GAAK,EAAA;AAAA,0BACLC,GAAQ,EAAA;AAAA,0BACRC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,EACX,CAAA,EAEJ,CAAA,EACF,CAAA;AAAA,IAAA;AAAA,EACF;AAEJ;AAEAlC,EAAc,OAAO+B;AACrB/B,EAAc,UAAUgC;AACxBhC,EAAc,OAAOiC;AACrBjC,EAAc,UAAUkC;"}
1
+ {"version":3,"file":"SignatureForm.js","sources":["../../../../../src/components/Company/DocumentSigner/SignatureForm/SignatureForm.tsx"],"sourcesContent":["import { useCompanyFormsGetSuspense } from '@gusto/embedded-api/react-query/companyFormsGet'\nimport { useCompanyFormsSignMutation } from '@gusto/embedded-api/react-query/companyFormsSign'\nimport { useCompanyFormsGetPdfSuspense } from '@gusto/embedded-api/react-query/companyFormsGetPdf'\nimport { Head } from './Head'\nimport { Preview } from './Preview'\nimport { Form } from './Form'\nimport { Actions } from './Actions'\nimport { SignatureFormProvider } from './useSignatureForm'\nimport { useI18n, useComponentDictionary } from '@/i18n'\nimport type { BaseComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport {\n SignatureForm as SharedSignatureForm,\n type SignatureFormInputs,\n} from '@/components/Common/SignatureForm'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\n\ninterface SignatureFormProps extends BaseComponentInterface<'Company.SignatureForm'> {\n formId: string\n companyId: string\n}\n\nexport function SignatureForm(props: SignatureFormProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nexport function Root({ formId, children, dictionary }: SignatureFormProps) {\n useComponentDictionary('Company.SignatureForm', dictionary)\n useI18n('Company.SignatureForm')\n const { onEvent, baseSubmitHandler } = useBase()\n\n const {\n data: { form: formNullable },\n } = useCompanyFormsGetSuspense({\n formId,\n })\n const form = formNullable!\n\n const { isPending, mutateAsync: signForm } = useCompanyFormsSignMutation()\n\n const {\n data: { formPdf },\n } = useCompanyFormsGetPdfSuspense({\n formId,\n })\n const pdfUrl = formPdf!.documentUrl!\n\n const handleSubmit = async (data: SignatureFormInputs) => {\n await baseSubmitHandler(data, async payload => {\n const signFormResponse = await signForm({\n request: {\n formId,\n requestBody: {\n signatureText: payload.signature,\n agree: payload.confirmSignature,\n },\n },\n })\n\n onEvent(companyEvents.COMPANY_SIGN_FORM, signFormResponse.form)\n\n onEvent(companyEvents.COMPANY_SIGN_FORM_DONE)\n })\n }\n\n const handleBack = () => {\n onEvent(companyEvents.COMPANY_SIGN_FORM_BACK)\n }\n\n return (\n <SignatureFormProvider\n value={{\n form,\n pdfUrl,\n isPending,\n onBack: handleBack,\n }}\n >\n <SharedSignatureForm onSubmit={handleSubmit}>\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Preview />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </SharedSignatureForm>\n </SignatureFormProvider>\n )\n}\n\nSignatureForm.Head = Head\nSignatureForm.Preview = Preview\nSignatureForm.Form = Form\nSignatureForm.Actions = Actions\n"],"names":["SignatureForm","props","jsx","BaseComponent","Root","formId","children","dictionary","useComponentDictionary","useI18n","onEvent","baseSubmitHandler","useBase","formNullable","useCompanyFormsGetSuspense","form","isPending","signForm","useCompanyFormsSignMutation","formPdf","useCompanyFormsGetPdfSuspense","pdfUrl","SignatureFormProvider","companyEvents","SharedSignatureForm","data","payload","signFormResponse","Flex","jsxs","Fragment","Head","Preview","Form","Actions"],"mappings":";;;;;;;;;;;;;;;AAwBO,SAASA,EAAcC,GAA2B;AAErD,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AAEO,SAASG,EAAK,EAAE,QAAAC,GAAQ,UAAAC,GAAU,YAAAC,KAAkC;AACzE,EAAAC,EAAuB,yBAAyBD,CAAU,GAC1DE,EAAQ,uBAAuB;AAC/B,QAAM,EAAE,SAAAC,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GAEzC;AAAA,IACJ,MAAM,EAAE,MAAMC,EAAa;AAAA,MACzBC,EAA2B;AAAA,IAC7B,QAAAT;AAAA,EAAA,CACD,GACKU,IAAOF,GAEP,EAAE,WAAAG,GAAW,aAAaC,EAAA,IAAaC,EAA4B,GAEnE;AAAA,IACJ,MAAM,EAAE,SAAAC,EAAQ;AAAA,MACdC,EAA8B;AAAA,IAChC,QAAAf;AAAA,EAAA,CACD,GACKgB,IAASF,EAAS;AAyBtB,SAAA,gBAAAjB;AAAA,IAACoB;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,MAAAP;AAAA,QACA,QAAAM;AAAA,QACA,WAAAL;AAAA,QACA,QAVa,MAAM;AACvB,UAAAN,EAAQa,EAAc,sBAAsB;AAAA,QAC9C;AAAA,MASI;AAAA,MAEA,UAAC,gBAAArB,EAAAsB,GAAA,EAAoB,UA/BJ,OAAOC,MAA8B;AAClD,cAAAd,EAAkBc,GAAM,OAAMC,MAAW;AACvC,gBAAAC,IAAmB,MAAMV,EAAS;AAAA,YACtC,SAAS;AAAA,cACP,QAAAZ;AAAA,cACA,aAAa;AAAA,gBACX,eAAeqB,EAAQ;AAAA,gBACvB,OAAOA,EAAQ;AAAA,cAAA;AAAA,YACjB;AAAA,UACF,CACD;AAEO,UAAAhB,EAAAa,EAAc,mBAAmBI,EAAiB,IAAI,GAE9DjB,EAAQa,EAAc,sBAAsB;AAAA,QAAA,CAC7C;AAAA,MACH,GAgBM,UAAC,gBAAArB,EAAA0B,GAAA,EAAK,eAAc,UAAS,KAAK,IAC/B,UACCtB,KAGE,gBAAAuB,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAA5B,EAAC6B,GAAK,EAAA;AAAA,0BACLC,GAAQ,EAAA;AAAA,0BACRC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,EACX,CAAA,EAEJ,CAAA,EACF,CAAA;AAAA,IAAA;AAAA,EACF;AAEJ;AAEAlC,EAAc,OAAO+B;AACrB/B,EAAc,UAAUgC;AACxBhC,EAAc,OAAOiC;AACrBjC,EAAc,UAAUkC;"}
@@ -8,9 +8,9 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
8
  import "@tanstack/react-query";
9
9
  import "../../../Base/useBase.js";
10
10
  import "../../../../shared/constants.js";
11
- import "classnames";
12
11
  import "dompurify";
13
12
  import "../../../../contexts/ComponentAdapter/useComponentContext.js";
13
+ import "../../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
14
14
  import { createCompoundContext as o } from "../../../Base/createCompoundContext.js";
15
15
  const [c, d] = o(
16
16
  "CompanySignatureFormContext"
@@ -1,14 +1,13 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
2
  import { useTranslation as r } from "react-i18next";
3
- import { useFederalTaxes as i } from "./useFederalTaxes.js";
4
- import "classnames";
5
- import { ActionsLayout as s } from "../../Common/ActionsLayout/ActionsLayout.js";
3
+ import { useFederalTaxes as s } from "./useFederalTaxes.js";
4
+ import { ActionsLayout as i } from "../../Common/ActionsLayout/ActionsLayout.js";
6
5
  import { useComponentContext as m } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
- const l = () => {
8
- const { t } = r("Company.FederalTaxes"), { isPending: n } = i(), e = m();
9
- return /* @__PURE__ */ o(s, { children: /* @__PURE__ */ o(e.Button, { type: "submit", isLoading: n, children: t("continueCta") }) });
6
+ const f = () => {
7
+ const { t } = r("Company.FederalTaxes"), { isPending: n } = s(), e = m();
8
+ return /* @__PURE__ */ o(i, { children: /* @__PURE__ */ o(e.Button, { type: "submit", isLoading: n, children: t("continueCta") }) });
10
9
  };
11
10
  export {
12
- l as Actions
11
+ f as Actions
13
12
  };
14
13
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../src/components/Company/FederalTaxes/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useFederalTaxes } from './useFederalTaxes'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.FederalTaxes')\n const { isPending } = useFederalTaxes()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","useFederalTaxes","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,EAAA,IAAMC,EAAe,sBAAsB,GAC7C,EAAE,WAAAC,EAAU,IAAIC,EAAgB,GAChCC,IAAaC,EAAoB;AAEvC,SACG,gBAAAC,EAAAC,GAAA,EACC,UAAC,gBAAAD,EAAAF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAE,EAAA,aAAa,EAClB,CAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../src/components/Company/FederalTaxes/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useFederalTaxes } from './useFederalTaxes'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.FederalTaxes')\n const { isPending } = useFederalTaxes()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('continueCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","useTranslation","isPending","useFederalTaxes","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,EAAA,IAAMC,EAAe,sBAAsB,GAC7C,EAAE,WAAAC,EAAU,IAAIC,EAAgB,GAChCC,IAAaC,EAAoB;AAEvC,SACG,gBAAAC,EAAAC,GAAA,EACC,UAAC,gBAAAD,EAAAF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAE,EAAA,aAAa,EAClB,CAAA,GACF;AAEJ;"}
@@ -12,15 +12,13 @@ import { useI18n as R, useComponentDictionary as M } from "../../../i18n/I18n.js
12
12
  import { BaseComponent as B } from "../../Base/Base.js";
13
13
  import { useBase as O } from "../../Base/useBase.js";
14
14
  import { Flex as j } from "../../Common/Flex/Flex.js";
15
- import "react-i18next";
16
- import "classnames";
17
15
  import { companyEvents as l } from "../../../shared/constants.js";
18
- function ee(o) {
19
- return /* @__PURE__ */ e(B, { ...o, children: /* @__PURE__ */ e(q, { ...o, children: o.children }) });
16
+ function Z(a) {
17
+ return /* @__PURE__ */ e(B, { ...a, children: /* @__PURE__ */ e(q, { ...a, children: a.children }) });
20
18
  }
21
- function q({ companyId: o, children: t, className: s, defaultValues: i, dictionary: d }) {
19
+ function q({ companyId: a, children: t, className: s, defaultValues: i, dictionary: d }) {
22
20
  R("Company.FederalTaxes"), M("Company.FederalTaxes", d);
23
- const { onEvent: m, baseSubmitHandler: f } = O(), { data: p } = h({ companyId: o }), r = p.federalTaxDetails, { mutateAsync: c, isPending: F } = D(), n = E({
21
+ const { onEvent: n, baseSubmitHandler: f } = O(), { data: c } = h({ companyId: a }), r = c.federalTaxDetails, { mutateAsync: p, isPending: F } = D(), m = E({
24
22
  resolver: v(A),
25
23
  defaultValues: {
26
24
  federalEin: r.hasEin ? void 0 : "",
@@ -29,23 +27,23 @@ function q({ companyId: o, children: t, className: s, defaultValues: i, dictiona
29
27
  legalName: r.legalName ?? i?.legalName
30
28
  }
31
29
  }), x = async (u) => {
32
- await f(u, async (a) => {
33
- const T = await c({
30
+ await f(u, async (o) => {
31
+ const T = await p({
34
32
  request: {
35
- companyId: o,
33
+ companyId: a,
36
34
  requestBody: {
37
- ein: a.federalEin,
38
- taxPayerType: a.taxPayerType,
39
- filingForm: a.filingForm,
40
- legalName: a.legalName,
35
+ ein: o.federalEin,
36
+ taxPayerType: o.taxPayerType,
37
+ filingForm: o.filingForm,
38
+ legalName: o.legalName,
41
39
  version: r.version
42
40
  }
43
41
  }
44
42
  });
45
- m(
43
+ n(
46
44
  l.COMPANY_FEDERAL_TAXES_UPDATED,
47
45
  T.federalTaxDetails
48
- ), m(l.COMPANY_FEDERAL_TAXES_DONE);
46
+ ), n(l.COMPANY_FEDERAL_TAXES_DONE);
49
47
  });
50
48
  };
51
49
  return /* @__PURE__ */ e("section", { className: s, children: /* @__PURE__ */ e(
@@ -55,7 +53,7 @@ function q({ companyId: o, children: t, className: s, defaultValues: i, dictiona
55
53
  isPending: F,
56
54
  federalTaxDetails: r
57
55
  },
58
- children: /* @__PURE__ */ e(P, { ...n, children: /* @__PURE__ */ e(S, { onSubmit: n.handleSubmit(x), children: /* @__PURE__ */ e(j, { flexDirection: "column", gap: 32, children: t || /* @__PURE__ */ y(g, { children: [
56
+ children: /* @__PURE__ */ e(P, { ...m, children: /* @__PURE__ */ e(S, { onSubmit: m.handleSubmit(x), children: /* @__PURE__ */ e(j, { flexDirection: "column", gap: 32, children: t || /* @__PURE__ */ y(g, { children: [
59
57
  /* @__PURE__ */ e(b, {}),
60
58
  /* @__PURE__ */ e(C, {}),
61
59
  /* @__PURE__ */ e(_, {})
@@ -64,6 +62,6 @@ function q({ companyId: o, children: t, className: s, defaultValues: i, dictiona
64
62
  ) });
65
63
  }
66
64
  export {
67
- ee as FederalTaxes
65
+ Z as FederalTaxes
68
66
  };
69
67
  //# sourceMappingURL=FederalTaxes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FederalTaxes.js","sources":["../../../../src/components/Company/FederalTaxes/FederalTaxes.tsx"],"sourcesContent":["import { useFederalTaxDetailsUpdateMutation } from '@gusto/embedded-api/react-query/federalTaxDetailsUpdate'\nimport { useFederalTaxDetailsGetSuspense } from '@gusto/embedded-api/react-query/federalTaxDetailsGet'\nimport type {\n FilingForm,\n TaxPayerType,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n FederalTaxesProvider,\n type FederalTaxFormInputs,\n FederalTaxFormSchema,\n type FederalTaxesDefaultValues,\n} from './useFederalTaxes'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { Form } from '@/components/Company/FederalTaxes/Form'\nimport { Actions } from '@/components/Company/FederalTaxes/Actions'\nimport { Head } from '@/components/Company/FederalTaxes/Head'\nimport { useI18n } from '@/i18n'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n'\n\ninterface FederalTaxesProps extends CommonComponentInterface<'Company.FederalTaxes'> {\n companyId: string\n defaultValues?: FederalTaxesDefaultValues\n}\n\nexport function FederalTaxes(props: FederalTaxesProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, children, className, defaultValues, dictionary }: FederalTaxesProps) {\n useI18n('Company.FederalTaxes')\n useComponentDictionary('Company.FederalTaxes', dictionary)\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data } = useFederalTaxDetailsGetSuspense({ companyId })\n const federalTaxDetails = data.federalTaxDetails!\n\n const { mutateAsync: updateFederalTaxDetails, isPending } = useFederalTaxDetailsUpdateMutation()\n\n const formMethods = useForm<FederalTaxFormInputs>({\n resolver: zodResolver(FederalTaxFormSchema),\n defaultValues: {\n federalEin: federalTaxDetails.hasEin ? undefined : '',\n taxPayerType: federalTaxDetails.taxPayerType\n ? (federalTaxDetails.taxPayerType as TaxPayerType)\n : defaultValues?.taxPayerType,\n filingForm: federalTaxDetails.filingForm\n ? (federalTaxDetails.filingForm as FilingForm)\n : defaultValues?.filingForm,\n legalName: federalTaxDetails.legalName ?? defaultValues?.legalName,\n },\n })\n\n const handleSubmit = async (data: FederalTaxFormInputs) => {\n await baseSubmitHandler(data, async payload => {\n const updateFederalTaxDetailsResponse = await updateFederalTaxDetails({\n request: {\n companyId: companyId,\n requestBody: {\n ein: payload.federalEin,\n taxPayerType: payload.taxPayerType as TaxPayerType | undefined,\n filingForm: payload.filingForm as FilingForm | undefined,\n legalName: payload.legalName,\n version: federalTaxDetails.version as string,\n },\n },\n })\n\n onEvent(\n companyEvents.COMPANY_FEDERAL_TAXES_UPDATED,\n updateFederalTaxDetailsResponse.federalTaxDetails,\n )\n onEvent(companyEvents.COMPANY_FEDERAL_TAXES_DONE)\n })\n }\n\n return (\n <section className={className}>\n <FederalTaxesProvider\n value={{\n isPending,\n federalTaxDetails,\n }}\n >\n <FormProvider {...formMethods}>\n <HtmlForm onSubmit={formMethods.handleSubmit(handleSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </HtmlForm>\n </FormProvider>\n </FederalTaxesProvider>\n </section>\n )\n}\n"],"names":["FederalTaxes","props","jsx","BaseComponent","Root","companyId","children","className","defaultValues","dictionary","useI18n","useComponentDictionary","onEvent","baseSubmitHandler","useBase","data","useFederalTaxDetailsGetSuspense","federalTaxDetails","updateFederalTaxDetails","isPending","useFederalTaxDetailsUpdateMutation","formMethods","useForm","zodResolver","FederalTaxFormSchema","handleSubmit","payload","updateFederalTaxDetailsResponse","companyEvents","FederalTaxesProvider","FormProvider","HtmlForm","Flex","jsxs","Fragment","Head","Form","Actions"],"mappings":";;;;;;;;;;;;;;;;;AA+BO,SAASA,GAAaC,GAAmD;AAE5E,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,UAAAC,GAAU,WAAAC,GAAW,eAAAC,GAAe,YAAAC,KAAiC;AAC9F,EAAAC,EAAQ,sBAAsB,GAC9BC,EAAuB,wBAAwBF,CAAU;AACzD,QAAM,EAAE,SAAAG,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GAEzC,EAAE,MAAAC,EAAK,IAAIC,EAAgC,EAAE,WAAAX,GAAW,GACxDY,IAAoBF,EAAK,mBAEzB,EAAE,aAAaG,GAAyB,WAAAC,EAAA,IAAcC,EAAmC,GAEzFC,IAAcC,EAA8B;AAAA,IAChD,UAAUC,EAAYC,CAAoB;AAAA,IAC1C,eAAe;AAAA,MACb,YAAYP,EAAkB,SAAS,SAAY;AAAA,MACnD,cAAcA,EAAkB,eAC3BA,EAAkB,eACnBT,GAAe;AAAA,MACnB,YAAYS,EAAkB,aACzBA,EAAkB,aACnBT,GAAe;AAAA,MACnB,WAAWS,EAAkB,aAAaT,GAAe;AAAA,IAAA;AAAA,EAC3D,CACD,GAEKiB,IAAe,OAAOV,MAA+B;AACnD,UAAAF,EAAkBE,GAAM,OAAMW,MAAW;AACvC,YAAAC,IAAkC,MAAMT,EAAwB;AAAA,QACpE,SAAS;AAAA,UACP,WAAAb;AAAA,UACA,aAAa;AAAA,YACX,KAAKqB,EAAQ;AAAA,YACb,cAAcA,EAAQ;AAAA,YACtB,YAAYA,EAAQ;AAAA,YACpB,WAAWA,EAAQ;AAAA,YACnB,SAAST,EAAkB;AAAA,UAAA;AAAA,QAC7B;AAAA,MACF,CACD;AAED,MAAAL;AAAA,QACEgB,EAAc;AAAA,QACdD,EAAgC;AAAA,MAClC,GACAf,EAAQgB,EAAc,0BAA0B;AAAA,IAAA,CACjD;AAAA,EACH;AAGE,SAAA,gBAAA1B,EAAC,aAAQ,WAAAK,GACP,UAAA,gBAAAL;AAAA,IAAC2B;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,WAAAV;AAAA,QACA,mBAAAF;AAAA,MACF;AAAA,MAEA,4BAACa,GAAc,EAAA,GAAGT,GAChB,UAAC,gBAAAnB,EAAA6B,GAAA,EAAS,UAAUV,EAAY,aAAaI,CAAY,GACvD,UAAA,gBAAAvB,EAAC8B,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAA1B,KAIG,gBAAA2B,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAhC,EAACiC,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,GACX,EAAA,CAEJ,GACF,EACF,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"FederalTaxes.js","sources":["../../../../src/components/Company/FederalTaxes/FederalTaxes.tsx"],"sourcesContent":["import { useFederalTaxDetailsUpdateMutation } from '@gusto/embedded-api/react-query/federalTaxDetailsUpdate'\nimport { useFederalTaxDetailsGetSuspense } from '@gusto/embedded-api/react-query/federalTaxDetailsGet'\nimport type {\n FilingForm,\n TaxPayerType,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport {\n FederalTaxesProvider,\n type FederalTaxFormInputs,\n FederalTaxFormSchema,\n type FederalTaxesDefaultValues,\n} from './useFederalTaxes'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { Form } from '@/components/Company/FederalTaxes/Form'\nimport { Actions } from '@/components/Company/FederalTaxes/Actions'\nimport { Head } from '@/components/Company/FederalTaxes/Head'\nimport { useI18n } from '@/i18n'\nimport type { BaseComponentInterface, CommonComponentInterface } from '@/components/Base/Base'\nimport { BaseComponent } from '@/components/Base/Base'\nimport { useBase } from '@/components/Base/useBase'\nimport { Flex } from '@/components/Common'\nimport { companyEvents } from '@/shared/constants'\nimport { useComponentDictionary } from '@/i18n'\n\ninterface FederalTaxesProps extends CommonComponentInterface<'Company.FederalTaxes'> {\n companyId: string\n defaultValues?: FederalTaxesDefaultValues\n}\n\nexport function FederalTaxes(props: FederalTaxesProps & BaseComponentInterface) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nfunction Root({ companyId, children, className, defaultValues, dictionary }: FederalTaxesProps) {\n useI18n('Company.FederalTaxes')\n useComponentDictionary('Company.FederalTaxes', dictionary)\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data } = useFederalTaxDetailsGetSuspense({ companyId })\n const federalTaxDetails = data.federalTaxDetails!\n\n const { mutateAsync: updateFederalTaxDetails, isPending } = useFederalTaxDetailsUpdateMutation()\n\n const formMethods = useForm<FederalTaxFormInputs>({\n resolver: zodResolver(FederalTaxFormSchema),\n defaultValues: {\n federalEin: federalTaxDetails.hasEin ? undefined : '',\n taxPayerType: federalTaxDetails.taxPayerType\n ? (federalTaxDetails.taxPayerType as TaxPayerType)\n : defaultValues?.taxPayerType,\n filingForm: federalTaxDetails.filingForm\n ? (federalTaxDetails.filingForm as FilingForm)\n : defaultValues?.filingForm,\n legalName: federalTaxDetails.legalName ?? defaultValues?.legalName,\n },\n })\n\n const handleSubmit = async (data: FederalTaxFormInputs) => {\n await baseSubmitHandler(data, async payload => {\n const updateFederalTaxDetailsResponse = await updateFederalTaxDetails({\n request: {\n companyId: companyId,\n requestBody: {\n ein: payload.federalEin,\n taxPayerType: payload.taxPayerType as TaxPayerType | undefined,\n filingForm: payload.filingForm as FilingForm | undefined,\n legalName: payload.legalName,\n version: federalTaxDetails.version as string,\n },\n },\n })\n\n onEvent(\n companyEvents.COMPANY_FEDERAL_TAXES_UPDATED,\n updateFederalTaxDetailsResponse.federalTaxDetails,\n )\n onEvent(companyEvents.COMPANY_FEDERAL_TAXES_DONE)\n })\n }\n\n return (\n <section className={className}>\n <FederalTaxesProvider\n value={{\n isPending,\n federalTaxDetails,\n }}\n >\n <FormProvider {...formMethods}>\n <HtmlForm onSubmit={formMethods.handleSubmit(handleSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n {children ? (\n children\n ) : (\n <>\n <Head />\n <Form />\n <Actions />\n </>\n )}\n </Flex>\n </HtmlForm>\n </FormProvider>\n </FederalTaxesProvider>\n </section>\n )\n}\n"],"names":["FederalTaxes","props","jsx","BaseComponent","Root","companyId","children","className","defaultValues","dictionary","useI18n","useComponentDictionary","onEvent","baseSubmitHandler","useBase","data","useFederalTaxDetailsGetSuspense","federalTaxDetails","updateFederalTaxDetails","isPending","useFederalTaxDetailsUpdateMutation","formMethods","useForm","zodResolver","FederalTaxFormSchema","handleSubmit","payload","updateFederalTaxDetailsResponse","companyEvents","FederalTaxesProvider","FormProvider","HtmlForm","Flex","jsxs","Fragment","Head","Form","Actions"],"mappings":";;;;;;;;;;;;;;;AA+BO,SAASA,EAAaC,GAAmD;AAE5E,SAAA,gBAAAC,EAACC,GAAe,EAAA,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAMA,EAAA,SAAA,CAAS,EACnC,CAAA;AAEJ;AAEA,SAASG,EAAK,EAAE,WAAAC,GAAW,UAAAC,GAAU,WAAAC,GAAW,eAAAC,GAAe,YAAAC,KAAiC;AAC9F,EAAAC,EAAQ,sBAAsB,GAC9BC,EAAuB,wBAAwBF,CAAU;AACzD,QAAM,EAAE,SAAAG,GAAS,mBAAAC,EAAkB,IAAIC,EAAQ,GAEzC,EAAE,MAAAC,EAAK,IAAIC,EAAgC,EAAE,WAAAX,GAAW,GACxDY,IAAoBF,EAAK,mBAEzB,EAAE,aAAaG,GAAyB,WAAAC,EAAA,IAAcC,EAAmC,GAEzFC,IAAcC,EAA8B;AAAA,IAChD,UAAUC,EAAYC,CAAoB;AAAA,IAC1C,eAAe;AAAA,MACb,YAAYP,EAAkB,SAAS,SAAY;AAAA,MACnD,cAAcA,EAAkB,eAC3BA,EAAkB,eACnBT,GAAe;AAAA,MACnB,YAAYS,EAAkB,aACzBA,EAAkB,aACnBT,GAAe;AAAA,MACnB,WAAWS,EAAkB,aAAaT,GAAe;AAAA,IAAA;AAAA,EAC3D,CACD,GAEKiB,IAAe,OAAOV,MAA+B;AACnD,UAAAF,EAAkBE,GAAM,OAAMW,MAAW;AACvC,YAAAC,IAAkC,MAAMT,EAAwB;AAAA,QACpE,SAAS;AAAA,UACP,WAAAb;AAAA,UACA,aAAa;AAAA,YACX,KAAKqB,EAAQ;AAAA,YACb,cAAcA,EAAQ;AAAA,YACtB,YAAYA,EAAQ;AAAA,YACpB,WAAWA,EAAQ;AAAA,YACnB,SAAST,EAAkB;AAAA,UAAA;AAAA,QAC7B;AAAA,MACF,CACD;AAED,MAAAL;AAAA,QACEgB,EAAc;AAAA,QACdD,EAAgC;AAAA,MAClC,GACAf,EAAQgB,EAAc,0BAA0B;AAAA,IAAA,CACjD;AAAA,EACH;AAGE,SAAA,gBAAA1B,EAAC,aAAQ,WAAAK,GACP,UAAA,gBAAAL;AAAA,IAAC2B;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,WAAAV;AAAA,QACA,mBAAAF;AAAA,MACF;AAAA,MAEA,4BAACa,GAAc,EAAA,GAAGT,GAChB,UAAC,gBAAAnB,EAAA6B,GAAA,EAAS,UAAUV,EAAY,aAAaI,CAAY,GACvD,UAAA,gBAAAvB,EAAC8B,KAAK,eAAc,UAAS,KAAK,IAC/B,UAAA1B,KAIG,gBAAA2B,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAhC,EAACiC,GAAK,EAAA;AAAA,0BACLC,GAAK,EAAA;AAAA,0BACLC,GAAQ,CAAA,CAAA;AAAA,MAAA,GACX,EAAA,CAEJ,GACF,EACF,CAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -4,12 +4,11 @@ import { useTranslation as c, Trans as t } from "react-i18next";
4
4
  import { TaxPayerType as _, FilingForm as y } from "@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails";
5
5
  import { useFederalTaxes as u } from "./useFederalTaxes.js";
6
6
  import { Flex as b } from "../../Common/Flex/Flex.js";
7
- import "classnames";
8
7
  import { usePlaceholderEin as g, normalizeEin as x } from "../../../helpers/federalEin.js";
9
8
  import { useComponentContext as F } from "../../../contexts/ComponentAdapter/useComponentContext.js";
10
9
  import { TextInputField as l } from "../../Common/Fields/TextInputField/TextInputField.js";
11
10
  import { SelectField as a } from "../../Common/Fields/SelectField/SelectField.js";
12
- function R() {
11
+ function O() {
13
12
  const { t: e } = c("Company.FederalTaxes"), { federalTaxDetails: s } = u(), i = F(), m = g(s?.hasEin), p = n(
14
13
  () => Object.values(_).map((o) => ({
15
14
  value: o,
@@ -100,6 +99,6 @@ function R() {
100
99
  ] });
101
100
  }
102
101
  export {
103
- R as Form
102
+ O as Form
104
103
  };
105
104
  //# sourceMappingURL=Form.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Form.js","sources":["../../../../src/components/Company/FederalTaxes/Form.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation, Trans } from 'react-i18next'\nimport {\n TaxPayerType,\n FilingForm,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { useFederalTaxes } from './useFederalTaxes'\nimport { TextInputField, SelectField, Flex } from '@/components/Common'\nimport { usePlaceholderEin, normalizeEin } from '@/helpers/federalEin'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Form() {\n const { t } = useTranslation('Company.FederalTaxes')\n const { federalTaxDetails } = useFederalTaxes()\n const Components = useComponentContext()\n\n const placeholderEin = usePlaceholderEin(federalTaxDetails?.hasEin)\n\n const taxPayerTypeOptions = useMemo(\n () =>\n Object.values(TaxPayerType).map(value => ({\n value: value,\n label: t(`taxPayerType.${value}`),\n })),\n [t],\n )\n\n const filingFormOptions = useMemo(\n () =>\n Object.values(FilingForm).map(value => ({\n value: value,\n label: t(`filingForm.${value}`),\n })),\n [t],\n )\n\n return (\n <Flex flexDirection=\"column\" gap={28}>\n <TextInputField\n name=\"federalEin\"\n label={t('federal_ein_label')}\n description={\n <Trans\n t={t}\n i18nKey=\"federal_ein_description\"\n components={{\n applyLink: (\n <Components.Link\n href=\"https://www.irs.gov/businesses/employer-identification-number\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n isRequired\n transform={normalizeEin}\n placeholder={placeholderEin}\n />\n <SelectField\n name=\"taxPayerType\"\n label={t('taxpayer_type_label')}\n description={t('taxpayer_type_description')}\n options={taxPayerTypeOptions}\n isRequired\n />\n <SelectField\n name=\"filingForm\"\n label={t('federal_filing_form_label')}\n description={\n <Trans\n t={t}\n i18nKey=\"federal_filing_form_description\"\n components={{\n irsLink: (\n <Components.Link\n href=\"https://www.irs.gov/newsroom/employers-should-you-file-form-944-or-941\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n options={filingFormOptions}\n isRequired\n />\n <TextInputField\n name=\"legalName\"\n label={t('legal_entity_name_label')}\n description={t('legal_entity_name_description')}\n isRequired\n errorMessage={t('legal_entity_name_error')}\n />\n </Flex>\n )\n}\n"],"names":["Form","t","useTranslation","federalTaxDetails","useFederalTaxes","Components","useComponentContext","placeholderEin","usePlaceholderEin","taxPayerTypeOptions","useMemo","TaxPayerType","value","filingFormOptions","FilingForm","jsxs","Flex","jsx","TextInputField","Trans","normalizeEin","SelectField"],"mappings":";;;;;;;;;;;AAWO,SAASA,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,sBAAsB,GAC7C,EAAE,mBAAAC,EAAkB,IAAIC,EAAgB,GACxCC,IAAaC,EAAoB,GAEjCC,IAAiBC,EAAkBL,GAAmB,MAAM,GAE5DM,IAAsBC;AAAA,IAC1B,MACE,OAAO,OAAOC,CAAY,EAAE,IAAI,CAAUC,OAAA;AAAA,MACxC,OAAAA;AAAA,MACA,OAAOX,EAAE,gBAAgBW,CAAK,EAAE;AAAA,IAAA,EAChC;AAAA,IACJ,CAACX,CAAC;AAAA,EACJ,GAEMY,IAAoBH;AAAA,IACxB,MACE,OAAO,OAAOI,CAAU,EAAE,IAAI,CAAUF,OAAA;AAAA,MACtC,OAAAA;AAAA,MACA,OAAOX,EAAE,cAAcW,CAAK,EAAE;AAAA,IAAA,EAC9B;AAAA,IACJ,CAACX,CAAC;AAAA,EACJ;AAEA,SACG,gBAAAc,EAAAC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOjB,EAAE,mBAAmB;AAAA,QAC5B,aACE,gBAAAgB;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,GAAAlB;AAAA,YACA,SAAQ;AAAA,YACR,YAAY;AAAA,cACV,WACE,gBAAAgB;AAAA,gBAACZ,EAAW;AAAA,gBAAX;AAAA,kBACC,MAAK;AAAA,kBACL,QAAO;AAAA,kBACP,KAAI;AAAA,gBAAA;AAAA,cAAA;AAAA,YACN;AAAA,UAEJ;AAAA,QACF;AAAA,QAEF,YAAU;AAAA,QACV,WAAWe;AAAA,QACX,aAAab;AAAA,MAAA;AAAA,IACf;AAAA,IACA,gBAAAU;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOpB,EAAE,qBAAqB;AAAA,QAC9B,aAAaA,EAAE,2BAA2B;AAAA,QAC1C,SAASQ;AAAA,QACT,YAAU;AAAA,MAAA;AAAA,IACZ;AAAA,IACA,gBAAAQ;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOpB,EAAE,2BAA2B;AAAA,QACpC,aACE,gBAAAgB;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,GAAAlB;AAAA,YACA,SAAQ;AAAA,YACR,YAAY;AAAA,cACV,SACE,gBAAAgB;AAAA,gBAACZ,EAAW;AAAA,gBAAX;AAAA,kBACC,MAAK;AAAA,kBACL,QAAO;AAAA,kBACP,KAAI;AAAA,gBAAA;AAAA,cAAA;AAAA,YACN;AAAA,UAEJ;AAAA,QACF;AAAA,QAEF,SAASQ;AAAA,QACT,YAAU;AAAA,MAAA;AAAA,IACZ;AAAA,IACA,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOjB,EAAE,yBAAyB;AAAA,QAClC,aAAaA,EAAE,+BAA+B;AAAA,QAC9C,YAAU;AAAA,QACV,cAAcA,EAAE,yBAAyB;AAAA,MAAA;AAAA,IAAA;AAAA,EAC3C,GACF;AAEJ;"}
1
+ {"version":3,"file":"Form.js","sources":["../../../../src/components/Company/FederalTaxes/Form.tsx"],"sourcesContent":["import { useMemo } from 'react'\nimport { useTranslation, Trans } from 'react-i18next'\nimport {\n TaxPayerType,\n FilingForm,\n} from '@gusto/embedded-api/models/operations/putv1companiescompanyidfederaltaxdetails'\nimport { useFederalTaxes } from './useFederalTaxes'\nimport { TextInputField, SelectField, Flex } from '@/components/Common'\nimport { usePlaceholderEin, normalizeEin } from '@/helpers/federalEin'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Form() {\n const { t } = useTranslation('Company.FederalTaxes')\n const { federalTaxDetails } = useFederalTaxes()\n const Components = useComponentContext()\n\n const placeholderEin = usePlaceholderEin(federalTaxDetails?.hasEin)\n\n const taxPayerTypeOptions = useMemo(\n () =>\n Object.values(TaxPayerType).map(value => ({\n value: value,\n label: t(`taxPayerType.${value}`),\n })),\n [t],\n )\n\n const filingFormOptions = useMemo(\n () =>\n Object.values(FilingForm).map(value => ({\n value: value,\n label: t(`filingForm.${value}`),\n })),\n [t],\n )\n\n return (\n <Flex flexDirection=\"column\" gap={28}>\n <TextInputField\n name=\"federalEin\"\n label={t('federal_ein_label')}\n description={\n <Trans\n t={t}\n i18nKey=\"federal_ein_description\"\n components={{\n applyLink: (\n <Components.Link\n href=\"https://www.irs.gov/businesses/employer-identification-number\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n isRequired\n transform={normalizeEin}\n placeholder={placeholderEin}\n />\n <SelectField\n name=\"taxPayerType\"\n label={t('taxpayer_type_label')}\n description={t('taxpayer_type_description')}\n options={taxPayerTypeOptions}\n isRequired\n />\n <SelectField\n name=\"filingForm\"\n label={t('federal_filing_form_label')}\n description={\n <Trans\n t={t}\n i18nKey=\"federal_filing_form_description\"\n components={{\n irsLink: (\n <Components.Link\n href=\"https://www.irs.gov/newsroom/employers-should-you-file-form-944-or-941\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n options={filingFormOptions}\n isRequired\n />\n <TextInputField\n name=\"legalName\"\n label={t('legal_entity_name_label')}\n description={t('legal_entity_name_description')}\n isRequired\n errorMessage={t('legal_entity_name_error')}\n />\n </Flex>\n )\n}\n"],"names":["Form","t","useTranslation","federalTaxDetails","useFederalTaxes","Components","useComponentContext","placeholderEin","usePlaceholderEin","taxPayerTypeOptions","useMemo","TaxPayerType","value","filingFormOptions","FilingForm","jsxs","Flex","jsx","TextInputField","Trans","normalizeEin","SelectField"],"mappings":";;;;;;;;;;AAWO,SAASA,IAAO;AACrB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,sBAAsB,GAC7C,EAAE,mBAAAC,EAAkB,IAAIC,EAAgB,GACxCC,IAAaC,EAAoB,GAEjCC,IAAiBC,EAAkBL,GAAmB,MAAM,GAE5DM,IAAsBC;AAAA,IAC1B,MACE,OAAO,OAAOC,CAAY,EAAE,IAAI,CAAUC,OAAA;AAAA,MACxC,OAAAA;AAAA,MACA,OAAOX,EAAE,gBAAgBW,CAAK,EAAE;AAAA,IAAA,EAChC;AAAA,IACJ,CAACX,CAAC;AAAA,EACJ,GAEMY,IAAoBH;AAAA,IACxB,MACE,OAAO,OAAOI,CAAU,EAAE,IAAI,CAAUF,OAAA;AAAA,MACtC,OAAAA;AAAA,MACA,OAAOX,EAAE,cAAcW,CAAK,EAAE;AAAA,IAAA,EAC9B;AAAA,IACJ,CAACX,CAAC;AAAA,EACJ;AAEA,SACG,gBAAAc,EAAAC,GAAA,EAAK,eAAc,UAAS,KAAK,IAChC,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOjB,EAAE,mBAAmB;AAAA,QAC5B,aACE,gBAAAgB;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,GAAAlB;AAAA,YACA,SAAQ;AAAA,YACR,YAAY;AAAA,cACV,WACE,gBAAAgB;AAAA,gBAACZ,EAAW;AAAA,gBAAX;AAAA,kBACC,MAAK;AAAA,kBACL,QAAO;AAAA,kBACP,KAAI;AAAA,gBAAA;AAAA,cAAA;AAAA,YACN;AAAA,UAEJ;AAAA,QACF;AAAA,QAEF,YAAU;AAAA,QACV,WAAWe;AAAA,QACX,aAAab;AAAA,MAAA;AAAA,IACf;AAAA,IACA,gBAAAU;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOpB,EAAE,qBAAqB;AAAA,QAC9B,aAAaA,EAAE,2BAA2B;AAAA,QAC1C,SAASQ;AAAA,QACT,YAAU;AAAA,MAAA;AAAA,IACZ;AAAA,IACA,gBAAAQ;AAAA,MAACI;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOpB,EAAE,2BAA2B;AAAA,QACpC,aACE,gBAAAgB;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,GAAAlB;AAAA,YACA,SAAQ;AAAA,YACR,YAAY;AAAA,cACV,SACE,gBAAAgB;AAAA,gBAACZ,EAAW;AAAA,gBAAX;AAAA,kBACC,MAAK;AAAA,kBACL,QAAO;AAAA,kBACP,KAAI;AAAA,gBAAA;AAAA,cAAA;AAAA,YACN;AAAA,UAEJ;AAAA,QACF;AAAA,QAEF,SAASQ;AAAA,QACT,YAAU;AAAA,MAAA;AAAA,IACZ;AAAA,IACA,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOjB,EAAE,yBAAyB;AAAA,QAClC,aAAaA,EAAE,+BAA+B;AAAA,QAC9C,YAAU;AAAA,QACV,cAAcA,EAAE,yBAAyB;AAAA,MAAA;AAAA,IAAA;AAAA,EAC3C,GACF;AAEJ;"}
@@ -10,9 +10,9 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
10
10
  import "@tanstack/react-query";
11
11
  import "../../Base/useBase.js";
12
12
  import "../../../shared/constants.js";
13
- import "classnames";
14
13
  import "dompurify";
15
14
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
15
+ import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
16
16
  import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
17
17
  const C = o.object({
18
18
  federalEin: o.string().optional(),
@@ -1,14 +1,13 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { useTranslation as i } from "react-i18next";
3
- import { useIndustryApiState as s } from "./Context.js";
4
- import "classnames";
2
+ import { useTranslation as s } from "react-i18next";
3
+ import { useIndustryApiState as i } from "./Context.js";
5
4
  import { ActionsLayout as m } from "../../Common/ActionsLayout/ActionsLayout.js";
6
5
  import { useComponentContext as e } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
- const y = () => {
8
- const { t: o } = i("Company.Industry"), { isPending: n } = s(), r = e();
6
+ const f = () => {
7
+ const { t: o } = s("Company.Industry"), { isPending: n } = i(), r = e();
9
8
  return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(r.Button, { type: "submit", isLoading: n, children: o("submitCta") }) });
10
9
  };
11
10
  export {
12
- y as Actions
11
+ f as Actions
13
12
  };
14
13
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../src/components/Company/Industry/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIndustryApiState } from './Context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.Industry')\n const { isPending } = useIndustryApiState()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","isPending","useIndustryApiState","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kBAAkB,GACzC,EAAE,WAAAC,EAAU,IAAIC,EAAoB,GACpCC,IAAaC,EAAoB;AAEvC,SACG,gBAAAC,EAAAC,GAAA,EACC,UAAC,gBAAAD,EAAAF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAEF,EAAA,WAAW,EAChB,CAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../src/components/Company/Industry/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIndustryApiState } from './Context'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.Industry')\n const { isPending } = useIndustryApiState()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button type=\"submit\" isLoading={isPending}>\n {t('submitCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","isPending","useIndustryApiState","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kBAAkB,GACzC,EAAE,WAAAC,EAAU,IAAIC,EAAoB,GACpCC,IAAaC,EAAoB;AAEvC,SACG,gBAAAC,EAAAC,GAAA,EACC,UAAC,gBAAAD,EAAAF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAEF,EAAA,WAAW,EAChB,CAAA,GACF;AAEJ;"}
@@ -8,9 +8,9 @@ import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
8
8
  import "@tanstack/react-query";
9
9
  import "../../Base/useBase.js";
10
10
  import "../../../shared/constants.js";
11
- import "classnames";
12
11
  import "dompurify";
13
12
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
13
+ import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
14
14
  import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
15
15
  const [A, P] = t("IndustryItems", {
16
16
  items: []
@@ -1,15 +1,14 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import { useTranslation as e } from "react-i18next";
3
- import { useIndustryItems as m } from "./Context.js";
4
- import "classnames";
5
- import { ComboBoxField as s } from "../../Common/Fields/ComboBoxField/ComboBoxField.js";
6
- const d = () => {
7
- const { t: o } = e("Company.Industry"), { items: r } = m();
8
- return /* @__PURE__ */ t(
9
- s,
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { useTranslation as t } from "react-i18next";
3
+ import { useIndustryItems as s } from "./Context.js";
4
+ import { ComboBoxField as m } from "../../Common/Fields/ComboBoxField/ComboBoxField.js";
5
+ const p = () => {
6
+ const { t: o } = t("Company.Industry"), { items: e } = s();
7
+ return /* @__PURE__ */ r(
8
+ m,
10
9
  {
11
10
  isRequired: !0,
12
- options: r,
11
+ options: e,
13
12
  label: o("label"),
14
13
  name: "naics_code",
15
14
  placeholder: o("placeholder")
@@ -17,6 +16,6 @@ const d = () => {
17
16
  );
18
17
  };
19
18
  export {
20
- d as Edit
19
+ p as Edit
21
20
  };
22
21
  //# sourceMappingURL=Edit.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Edit.js","sources":["../../../../src/components/Company/Industry/Edit.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIndustryItems } from './Context'\nimport { ComboBoxField } from '@/components/Common'\n\nexport interface IndustryFormFields {\n naics_code: string\n}\n\nexport const Edit = () => {\n const { t } = useTranslation('Company.Industry')\n const { items } = useIndustryItems()\n\n return (\n <ComboBoxField\n isRequired\n options={items}\n label={t('label')}\n name=\"naics_code\"\n placeholder={t('placeholder')}\n />\n )\n}\n"],"names":["Edit","t","useTranslation","items","useIndustryItems","jsx","ComboBoxField"],"mappings":";;;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kBAAkB,GACzC,EAAE,OAAAC,EAAM,IAAIC,EAAiB;AAGjC,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,YAAU;AAAA,MACV,SAASH;AAAA,MACT,OAAOF,EAAE,OAAO;AAAA,MAChB,MAAK;AAAA,MACL,aAAaA,EAAE,aAAa;AAAA,IAAA;AAAA,EAC9B;AAEJ;"}
1
+ {"version":3,"file":"Edit.js","sources":["../../../../src/components/Company/Industry/Edit.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useIndustryItems } from './Context'\nimport { ComboBoxField } from '@/components/Common'\n\nexport interface IndustryFormFields {\n naics_code: string\n}\n\nexport const Edit = () => {\n const { t } = useTranslation('Company.Industry')\n const { items } = useIndustryItems()\n\n return (\n <ComboBoxField\n isRequired\n options={items}\n label={t('label')}\n name=\"naics_code\"\n placeholder={t('placeholder')}\n />\n )\n}\n"],"names":["Edit","t","useTranslation","items","useIndustryItems","jsx","ComboBoxField"],"mappings":";;;;AAQO,MAAMA,IAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,kBAAkB,GACzC,EAAE,OAAAC,EAAM,IAAIC,EAAiB;AAGjC,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,YAAU;AAAA,MACV,SAASH;AAAA,MACT,OAAOF,EAAE,OAAO;AAAA,MAChB,MAAK;AAAA,MACL,aAAaA,EAAE,aAAa;AAAA,IAAA;AAAA,EAC9B;AAEJ;"}
@@ -1,10 +1,9 @@
1
1
  import { jsxs as r, jsx as n } from "react/jsx-runtime";
2
2
  import { useTranslation as a } from "react-i18next";
3
3
  import { useLocationsForm as e } from "./useLocationForm.js";
4
- import "classnames";
5
4
  import { ActionsLayout as c } from "../../../Common/ActionsLayout/ActionsLayout.js";
6
5
  import { useComponentContext as m } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
7
- const h = () => {
6
+ const f = () => {
8
7
  const { t: o } = a("Company.Locations"), { handleCancel: i, isPending: s } = e(), t = m();
9
8
  return /* @__PURE__ */ r(c, { children: [
10
9
  /* @__PURE__ */ n(t.Button, { variant: "secondary", onClick: i, children: o("cancelCta") }),
@@ -12,6 +11,6 @@ const h = () => {
12
11
  ] });
13
12
  };
14
13
  export {
15
- h as Actions
14
+ f as Actions
16
15
  };
17
16
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsForm } from './useLocationForm'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.Locations')\n const { handleCancel, isPending } = useLocationsForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={isPending} data-testid=\"location-submit\">\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","handleCancel","isPending","useLocationsForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,cAAAC,GAAc,WAAAC,EAAU,IAAIC,EAAiB,GAC/CC,IAAaC,EAAoB;AAEvC,2BACGC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAEF,EAAA,WAAW,EAChB,CAAA;AAAA,IACC,gBAAAQ,EAAAH,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GAAW,eAAY,mBAChE,UAAEH,EAAA,SAAS,EACd,CAAA;AAAA,EAAA,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../../src/components/Company/Locations/LocationForm/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useLocationsForm } from './useLocationForm'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Company.Locations')\n const { handleCancel, isPending } = useLocationsForm()\n const Components = useComponentContext()\n\n return (\n <ActionsLayout>\n <Components.Button variant=\"secondary\" onClick={handleCancel}>\n {t('cancelCta')}\n </Components.Button>\n <Components.Button type=\"submit\" isLoading={isPending} data-testid=\"location-submit\">\n {t('saveCta')}\n </Components.Button>\n </ActionsLayout>\n )\n}\n"],"names":["Actions","t","useTranslation","handleCancel","isPending","useLocationsForm","Components","useComponentContext","ActionsLayout","jsx"],"mappings":";;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,mBAAmB,GAC1C,EAAE,cAAAC,GAAc,WAAAC,EAAU,IAAIC,EAAiB,GAC/CC,IAAaC,EAAoB;AAEvC,2BACGC,GACC,EAAA,UAAA;AAAA,IAAC,gBAAAC,EAAAH,EAAW,QAAX,EAAkB,SAAQ,aAAY,SAASH,GAC7C,UAAEF,EAAA,WAAW,EAChB,CAAA;AAAA,IACC,gBAAAQ,EAAAH,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GAAW,eAAY,mBAChE,UAAEH,EAAA,SAAS,EACd,CAAA;AAAA,EAAA,GACF;AAEJ;"}