@gusto/embedded-react-sdk 0.31.1 → 0.32.0

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 (415) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/dist/assets/icons/icon-arrow-right.svg.js +10 -0
  3. package/dist/assets/icons/icon-arrow-right.svg.js.map +1 -0
  4. package/dist/components/Base/Base.js +46 -45
  5. package/dist/components/Base/Base.js.map +1 -1
  6. package/dist/components/Base/useBase.d.ts +2 -3
  7. package/dist/components/Base/useBase.js.map +1 -1
  8. package/dist/components/Base/useBaseSubmit.js +32 -19
  9. package/dist/components/Base/useBaseSubmit.js.map +1 -1
  10. package/dist/components/Common/DataView/DataView.js +1 -1
  11. package/dist/components/Common/DocumentList/DocumentList.js +1 -1
  12. package/dist/components/Common/DocumentViewer/DocumentViewer.js +1 -1
  13. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js +1 -1
  14. package/dist/components/Common/RequirementsList/RequirementsList.js +1 -1
  15. package/dist/components/Common/RequirementsList/RequirementsList.js.map +1 -1
  16. package/dist/components/Common/RequirementsList/RequirementsList.module.scss.js +1 -1
  17. package/dist/components/Common/SignatureForm/SignatureForm.js +12 -10
  18. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  19. package/dist/components/Common/SignatureForm/SignatureFormActions.js +3 -2
  20. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  21. package/dist/components/Common/SignatureForm/SignatureFormFields.js +7 -6
  22. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  23. package/dist/components/Common/UI/Box/Box.d.ts +2 -0
  24. package/dist/components/Common/UI/Box/Box.js +13 -0
  25. package/dist/components/Common/UI/Box/Box.js.map +1 -0
  26. package/dist/components/Common/UI/Box/Box.module.scss.js +12 -0
  27. package/dist/components/Common/UI/Box/Box.module.scss.js.map +1 -0
  28. package/dist/components/Common/UI/Box/BoxTypes.d.ts +15 -0
  29. package/dist/components/Common/UI/Box/index.d.ts +2 -0
  30. package/dist/components/Common/UI/Dialog/Dialog.js +1 -1
  31. package/dist/components/Common/UI/Input/InputTypes.d.ts +1 -1
  32. package/dist/components/Common/UI/Input/InputTypes.js.map +1 -1
  33. package/dist/components/Common/UI/List/List.module.scss.js +1 -1
  34. package/dist/components/Common/UI/Modal/Modal.js +1 -1
  35. package/dist/components/Common/UI/Tabs/Tabs.js +1 -1
  36. package/dist/components/Common/UI/TextInput/TextInput.js +30 -28
  37. package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
  38. package/dist/components/Common/UI/TextInput/TextInputTypes.d.ts +1 -1
  39. package/dist/components/Common/UI/TextInput/TextInputTypes.js.map +1 -1
  40. package/dist/components/Company/AssignSignatory/AssignSignatory.js +3 -2
  41. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  42. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +4 -3
  43. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  44. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +3 -2
  45. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  46. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +1 -1
  47. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +12 -12
  48. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -4
  49. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  50. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +3 -2
  51. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  52. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +1 -1
  53. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +1 -1
  54. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -4
  55. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  56. package/dist/components/Company/AssignSignatory/TitleSelect.js +5 -5
  57. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  58. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -6
  59. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  60. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +9 -8
  61. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  62. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +7 -5
  63. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  64. package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -4
  65. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  66. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +3 -2
  67. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  68. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +7 -6
  69. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  70. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +7 -5
  71. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  72. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +3 -2
  73. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  74. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +9 -8
  75. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  76. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -4
  77. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  78. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +4 -3
  79. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  80. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +5 -4
  81. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  82. package/dist/components/Company/FederalTaxes/Actions.js +7 -6
  83. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  84. package/dist/components/Company/FederalTaxes/FederalTaxes.js +4 -3
  85. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  86. package/dist/components/Company/FederalTaxes/Form.js +5 -3
  87. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  88. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +7 -6
  89. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  90. package/dist/components/Company/Industry/Actions.js +8 -7
  91. package/dist/components/Company/Industry/Actions.js.map +1 -1
  92. package/dist/components/Company/Industry/Context.js +8 -7
  93. package/dist/components/Company/Industry/Context.js.map +1 -1
  94. package/dist/components/Company/Industry/Edit.js +3 -2
  95. package/dist/components/Company/Industry/Edit.js.map +1 -1
  96. package/dist/components/Company/Locations/LocationForm/Actions.js +7 -6
  97. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  98. package/dist/components/Company/Locations/LocationForm/Form.js +1 -1
  99. package/dist/components/Company/Locations/LocationForm/LocationForm.js +4 -3
  100. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  101. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -4
  102. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  103. package/dist/components/Company/Locations/LocationsList/Actions.js +3 -2
  104. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  105. package/dist/components/Company/Locations/LocationsList/List.js +7 -6
  106. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  107. package/dist/components/Company/Locations/LocationsList/LocationsList.js +4 -3
  108. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  109. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -4
  110. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  111. package/dist/components/Company/OnboardingOverview/Completed.js +12 -10
  112. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  113. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +39 -26
  114. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  115. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +8 -7
  116. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  117. package/dist/components/Company/OnboardingOverview/context.js +5 -4
  118. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  119. package/dist/components/Company/PaySchedule/PaySchedule.js +25 -22
  120. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  121. package/dist/components/Company/PaySchedule/_parts/Actions.js +3 -2
  122. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  123. package/dist/components/Company/PaySchedule/_parts/Edit.js +15 -15
  124. package/dist/components/Company/PaySchedule/_parts/Head.js +13 -11
  125. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  126. package/dist/components/Company/PaySchedule/_parts/List.js +15 -13
  127. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  128. package/dist/components/Company/PaySchedule/usePaySchedule.js +7 -6
  129. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  130. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +3 -2
  131. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  132. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -4
  133. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  134. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +3 -2
  135. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  136. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +3 -2
  137. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  138. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -4
  139. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  140. package/dist/components/Company/index.js +20 -20
  141. package/dist/components/Contractor/Address/Address.js +7 -7
  142. package/dist/components/Contractor/Address/Address.js.map +1 -1
  143. package/dist/components/Contractor/Address/Form.js +1 -1
  144. package/dist/components/Contractor/Address/useAddress.js +7 -6
  145. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  146. package/dist/components/Contractor/ContractorList/index.js +32 -31
  147. package/dist/components/Contractor/ContractorList/index.js.map +1 -1
  148. package/dist/components/Contractor/NewHireReport/NewHireReport.js +14 -13
  149. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  150. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +12 -11
  151. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  152. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +3 -2
  153. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  154. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +4 -3
  155. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  156. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +135 -108
  157. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
  158. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +4 -2
  159. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  160. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.d.ts +84 -0
  161. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.js +23 -0
  162. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentFormSchema.js.map +1 -0
  163. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.d.ts +3 -31
  164. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +63 -69
  165. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
  166. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.d.ts +2 -1
  167. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +29 -29
  168. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -1
  169. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +2 -1
  170. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +32 -29
  171. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
  172. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +0 -1
  173. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
  174. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +4 -2
  175. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
  176. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +8 -6
  177. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -1
  178. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +4 -2
  179. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -1
  180. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +28 -27
  181. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  182. package/dist/components/Contractor/Profile/ContractorProfileForm.js +15 -15
  183. package/dist/components/Contractor/Profile/useContractorProfile.js +4 -3
  184. package/dist/components/Contractor/Profile/useContractorProfile.js.map +1 -1
  185. package/dist/components/Contractor/Submit/Submit.js +21 -20
  186. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  187. package/dist/components/Employee/Compensation/Actions.js +13 -12
  188. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  189. package/dist/components/Employee/Compensation/Edit.js +17 -16
  190. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  191. package/dist/components/Employee/Compensation/List.js +23 -22
  192. package/dist/components/Employee/Compensation/List.js.map +1 -1
  193. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +12 -11
  194. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  195. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +13 -12
  196. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  197. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +13 -12
  198. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  199. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +8 -7
  200. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
  201. package/dist/components/Employee/Deductions/stateMachine.js +1 -1
  202. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +9 -8
  203. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  204. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +24 -22
  205. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  206. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +4 -2
  207. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  208. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.d.ts +1 -0
  209. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +5 -4
  210. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  211. package/dist/components/Employee/DocumentSigner/DocumentSigner.js +9 -9
  212. package/dist/components/Employee/DocumentSigner/DocumentSigner.js.map +1 -1
  213. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js +49 -43
  214. package/dist/components/Employee/DocumentSigner/EmploymentEligibility/EmploymentEligibilityPresentation.js.map +1 -1
  215. package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js +150 -111
  216. package/dist/components/Employee/DocumentSigner/I9SignatureForm/I9SignatureForm.js.map +1 -1
  217. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +3 -2
  218. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  219. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +5 -4
  220. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  221. package/dist/components/Employee/DocumentSigner/documentSignerStateMachine.d.ts +1 -0
  222. package/dist/components/Employee/DocumentSigner/documentSignerStateMachine.js.map +1 -1
  223. package/dist/components/Employee/DocumentSigner/stateMachine.js +34 -22
  224. package/dist/components/Employee/DocumentSigner/stateMachine.js.map +1 -1
  225. package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js +4 -2
  226. package/dist/components/Employee/EmployeeDocuments/EmployeeDocumentsPresentation.js.map +1 -1
  227. package/dist/components/Employee/EmployeeList/Actions.js +7 -6
  228. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  229. package/dist/components/Employee/EmployeeList/EmployeeList.js +4 -3
  230. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  231. package/dist/components/Employee/EmployeeList/Head.js +7 -5
  232. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  233. package/dist/components/Employee/EmployeeList/List.js +3 -2
  234. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  235. package/dist/components/Employee/EmployeeList/useEmployeeList.js +5 -4
  236. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  237. package/dist/components/Employee/FederalTaxes/Actions.js +6 -5
  238. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  239. package/dist/components/Employee/FederalTaxes/FederalForm.js +12 -11
  240. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  241. package/dist/components/Employee/FederalTaxes/FederalTaxes.js +16 -15
  242. package/dist/components/Employee/FederalTaxes/FederalTaxes.js.map +1 -1
  243. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +5 -4
  244. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  245. package/dist/components/Employee/Landing/Landing.js +50 -44
  246. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  247. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  248. package/dist/components/Employee/PaymentMethod/Actions.js +6 -5
  249. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  250. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +5 -4
  251. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  252. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +3 -2
  253. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  254. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +7 -6
  255. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  256. package/dist/components/Employee/PaymentMethod/Split.js +11 -10
  257. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  258. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +7 -6
  259. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  260. package/dist/components/Employee/Profile/Actions.js +6 -5
  261. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  262. package/dist/components/Employee/Profile/AdminPersonalDetails.js +9 -8
  263. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  264. package/dist/components/Employee/Profile/HomeAddress.js +1 -1
  265. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +2 -2
  266. package/dist/components/Employee/Profile/useProfile.js +5 -4
  267. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  268. package/dist/components/Employee/StateTaxes/Actions.js +6 -5
  269. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  270. package/dist/components/Employee/StateTaxes/StateTaxes.js +29 -29
  271. package/dist/components/Employee/StateTaxes/StateTaxes.js.map +1 -1
  272. package/dist/components/Employee/StateTaxes/useStateTaxes.js +5 -4
  273. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  274. package/dist/components/Employee/Taxes/Actions.js +7 -6
  275. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  276. package/dist/components/Employee/Taxes/FederalForm.js +14 -13
  277. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  278. package/dist/components/Employee/Taxes/Taxes.js +19 -19
  279. package/dist/components/Employee/Taxes/Taxes.js.map +1 -1
  280. package/dist/components/Employee/Taxes/useTaxes.js +5 -4
  281. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  282. package/dist/components/Employee/index.js +22 -22
  283. package/dist/components/Flow/Flow.js +9 -7
  284. package/dist/components/Flow/Flow.js.map +1 -1
  285. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +17 -16
  286. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -1
  287. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.d.ts +0 -1
  288. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +32 -37
  289. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -1
  290. package/dist/components/InformationRequests/InformationRequests.d.ts +1 -2
  291. package/dist/components/InformationRequests/InformationRequests.js +36 -43
  292. package/dist/components/InformationRequests/InformationRequests.js.map +1 -1
  293. package/dist/components/InformationRequests/index.js +4 -4
  294. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +10 -9
  295. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
  296. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js +23 -21
  297. package/dist/components/Payroll/OffCycle/OffCycleFlowComponents.js.map +1 -1
  298. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.d.ts +2 -0
  299. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js +79 -0
  300. package/dist/components/Payroll/OffCycleCreation/OffCycleCreation.js.map +1 -0
  301. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.d.ts +2 -0
  302. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js +47 -0
  303. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationPresentation.js.map +1 -0
  304. package/dist/components/Payroll/OffCycleCreation/OffCycleCreationTypes.d.ts +14 -0
  305. package/dist/components/Payroll/OffCycleCreation/index.d.ts +3 -0
  306. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.d.ts +2 -0
  307. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js +44 -0
  308. package/dist/components/Payroll/OffCycleDeductionsSetting/OffCycleDeductionsSetting.js.map +1 -0
  309. package/dist/components/Payroll/OffCycleDeductionsSetting/index.d.ts +3 -0
  310. package/dist/components/Payroll/OffCycleDeductionsSetting/types.d.ts +10 -0
  311. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.d.ts +1 -2
  312. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js +37 -0
  313. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.js.map +1 -0
  314. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.module.scss.js +12 -0
  315. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormPresentation.module.scss.js.map +1 -0
  316. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.d.ts +0 -4
  317. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js +48 -0
  318. package/dist/components/Payroll/OffCyclePayPeriodDateForm/OffCyclePayPeriodDateFormTypes.js.map +1 -0
  319. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js +18 -0
  320. package/dist/components/Payroll/OffCyclePayPeriodDateForm/useOffCyclePayPeriodDateValidation.js.map +1 -0
  321. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js +26 -27
  322. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelection.js.map +1 -1
  323. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.d.ts +3 -3
  324. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js +17 -16
  325. package/dist/components/Payroll/OffCycleReasonSelection/OffCycleReasonSelectionPresentation.js.map +1 -1
  326. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModal.d.ts +2 -0
  327. package/dist/components/Payroll/OffCycleTaxWithholdingModal/OffCycleTaxWithholdingModalTypes.d.ts +8 -0
  328. package/dist/components/Payroll/OffCycleTaxWithholdingModal/index.d.ts +3 -0
  329. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTable.d.ts +2 -0
  330. package/dist/components/Payroll/OffCycleTaxWithholdingTable/OffCycleTaxWithholdingTableTypes.d.ts +17 -0
  331. package/dist/components/Payroll/OffCycleTaxWithholdingTable/index.d.ts +3 -0
  332. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.d.ts +3 -8
  333. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +38 -35
  334. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  335. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +25 -33
  336. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  337. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.d.ts +2 -0
  338. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +21 -19
  339. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
  340. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +26 -26
  341. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  342. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +36 -36
  343. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +21 -19
  344. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  345. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +17 -15
  346. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  347. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +32 -32
  348. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  349. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +20 -18
  350. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  351. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +70 -67
  352. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  353. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +2 -1
  354. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +38 -36
  355. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  356. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.d.ts +2 -1
  357. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +20 -20
  358. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
  359. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +4 -3
  360. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  361. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +4 -3
  362. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -1
  363. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +12 -11
  364. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -1
  365. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +5 -3
  366. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -1
  367. package/dist/components/Payroll/index.d.ts +4 -0
  368. package/dist/components/Payroll/index.js +22 -18
  369. package/dist/components/Payroll/index.js.map +1 -1
  370. package/dist/components/Payroll/usePreparedPayrollData.js +4 -3
  371. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  372. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +48 -46
  373. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  374. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
  375. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  376. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  377. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +3 -2
  378. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  379. package/dist/contexts/ThemeProvider/theme.d.ts +1 -0
  380. package/dist/contexts/ThemeProvider/theme.js +1 -0
  381. package/dist/contexts/ThemeProvider/theme.js.map +1 -1
  382. package/dist/helpers/apiErrorToList.js +14 -8
  383. package/dist/helpers/apiErrorToList.js.map +1 -1
  384. package/dist/helpers/dateFormatting.js +61 -45
  385. package/dist/helpers/dateFormatting.js.map +1 -1
  386. package/dist/helpers/formattedStrings.d.ts +1 -0
  387. package/dist/helpers/formattedStrings.js +21 -20
  388. package/dist/helpers/formattedStrings.js.map +1 -1
  389. package/dist/hooks/useOverflowDetection/useOverflowDetection.js +5 -6
  390. package/dist/i18n/I18n.js +7 -7
  391. package/dist/i18n/I18n.js.map +1 -1
  392. package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +12 -12
  393. package/dist/i18n/en/Employee.EmployeeDocuments.json.js +1 -1
  394. package/dist/i18n/en/Employee.I9SignatureForm.json.js +83 -65
  395. package/dist/i18n/en/Employee.I9SignatureForm.json.js.map +1 -1
  396. package/dist/i18n/en/Employee.Landing.json.js +7 -9
  397. package/dist/i18n/en/Employee.Landing.json.js.map +1 -1
  398. package/dist/i18n/en/Payroll.OffCycleCreation.json.js +14 -0
  399. package/dist/i18n/en/Payroll.OffCycleCreation.json.js.map +1 -0
  400. package/dist/i18n/en/Payroll.OffCycleDeductionsSetting.json.js +12 -0
  401. package/dist/i18n/en/Payroll.OffCycleDeductionsSetting.json.js.map +1 -0
  402. package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js +18 -0
  403. package/dist/i18n/en/Payroll.OffCycleTaxWithholding.json.js.map +1 -0
  404. package/dist/i18n/en/Payroll.PayrollBlocker.json.js +21 -19
  405. package/dist/i18n/en/Payroll.PayrollBlocker.json.js.map +1 -1
  406. package/dist/i18n/en/Payroll.PayrollOverview.json.js +1 -1
  407. package/dist/shared/constants.d.ts +4 -0
  408. package/dist/shared/constants.js +6 -4
  409. package/dist/shared/constants.js.map +1 -1
  410. package/dist/style.css +1 -1
  411. package/dist/types/i18next.d.ts +76 -2
  412. package/docs/reference/endpoint-inventory.json +1706 -0
  413. package/package.json +27 -11
  414. package/dist/components/Employee/Landing/Landing.module.scss.js +0 -8
  415. package/dist/components/Employee/Landing/Landing.module.scss.js.map +0 -1
@@ -6,12 +6,13 @@ import y from "dompurify";
6
6
  import { useMemo as j, useEffect as D } from "react";
7
7
  import { usePaymentMethod as N } from "./usePaymentMethod.js";
8
8
  import { SPLIT_BY as h } from "../../../shared/constants.js";
9
- import { useComponentContext as q } from "../../../contexts/ComponentAdapter/useComponentContext.js";
10
- import { useLocale as w } from "../../../contexts/LocaleProvider/useLocale.js";
11
- import { ReorderableList as I } from "../../Common/ReorderableList/ReorderableList.js";
12
- import { RadioGroupField as W } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
9
+ import "classnames";
10
+ import { RadioGroupField as q } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
13
11
  import { NumberInputField as F } from "../../Common/Fields/NumberInputField/NumberInputField.js";
14
- function oe() {
12
+ import { useComponentContext as w } from "../../../contexts/ComponentAdapter/useComponentContext.js";
13
+ import { useLocale as I } from "../../../contexts/LocaleProvider/useLocale.js";
14
+ import { ReorderableList as W } from "../../Common/ReorderableList/ReorderableList.js";
15
+ function ie() {
15
16
  const { paymentMethod: r, bankAccounts: m, mode: c } = N(), {
16
17
  control: s,
17
18
  setValue: o,
@@ -21,7 +22,7 @@ function oe() {
21
22
  } = B(), { t: u } = g("Employee.PaymentMethod"), d = A("splitBy"), L = A("priority"), a = j(() => r.splits ?? [], [r.splits]), l = Object.entries(L).reduce(
22
23
  (e, [t, i]) => !e || (L[e] ?? 0) < i ? t : e,
23
24
  ""
24
- ), { currency: $ } = w();
25
+ ), { currency: $ } = I();
25
26
  D(() => {
26
27
  if (a.length)
27
28
  if (d === h.amount) {
@@ -32,7 +33,7 @@ function oe() {
32
33
  o("splitAmount", e);
33
34
  }
34
35
  }, [d, a, l, o]);
35
- const f = q();
36
+ const f = w();
36
37
  if (c !== "SPLIT" || m.length < 2 || r.splits === null) return null;
37
38
  o("isSplit", !0);
38
39
  const b = (e, t) => {
@@ -49,7 +50,7 @@ function oe() {
49
50
  const p = a[i];
50
51
  p && (o("priority", t), l && l !== p.uuid && (S(`splitAmount.${l}`), b(l, 0)), b(p.uuid, null));
51
52
  }, R = () => d === h.amount ? /* @__PURE__ */ n(
52
- I,
53
+ W,
53
54
  {
54
55
  label: u("draggableListLabel"),
55
56
  items: a.map((e) => ({
@@ -105,7 +106,7 @@ function oe() {
105
106
  /* @__PURE__ */ n(f.Heading, { as: "h2", children: u("title") }),
106
107
  /* @__PURE__ */ n(V, { t: u, i18nKey: "splitDescription", components: { p: /* @__PURE__ */ n(f.Text, {}) } }),
107
108
  /* @__PURE__ */ n(
108
- W,
109
+ q,
109
110
  {
110
111
  name: "splitBy",
111
112
  label: u("splitByLabel"),
@@ -168,6 +169,6 @@ function G({
168
169
  ) }, r.uuid);
169
170
  }
170
171
  export {
171
- oe as Split
172
+ ie as Split
172
173
  };
173
174
  //# sourceMappingURL=Split.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Split.js","sources":["../../../../src/components/Employee/PaymentMethod/Split.tsx"],"sourcesContent":["import type { Control } from 'react-hook-form'\nimport { useFormContext } from 'react-hook-form'\nimport { Trans, useTranslation } from 'react-i18next'\nimport { type EmployeePaymentMethod } from '@gusto/embedded-api/models/components/employeepaymentmethod'\nimport { ErrorMessage } from '@hookform/error-message'\nimport { Fragment } from 'react/jsx-runtime'\nimport DOMPurify from 'dompurify'\nimport { useEffect, useMemo } from 'react'\nimport { usePaymentMethod, type CombinedSchemaInputs } from './usePaymentMethod'\nimport { NumberInputField, RadioGroupField } from '@/components/Common'\nimport { useLocale } from '@/contexts/LocaleProvider'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { ReorderableList } from '@/components/Common/ReorderableList'\nimport { SPLIT_BY } from '@/shared/constants'\n\ntype Split = NonNullable<EmployeePaymentMethod['splits']>[number]\n\nexport function Split() {\n const { paymentMethod, bankAccounts, mode } = usePaymentMethod()\n const {\n control,\n setValue,\n resetField,\n watch,\n formState: { errors },\n } = useFormContext<CombinedSchemaInputs>()\n const { t } = useTranslation('Employee.PaymentMethod')\n const splitBy = watch('splitBy')\n const priorities = watch('priority')\n\n const splits = useMemo(() => paymentMethod.splits ?? [], [paymentMethod.splits])\n\n const remainderId = Object.entries(priorities).reduce(\n (maxId, [uuid, priority]) => (!maxId || (priorities[maxId] ?? 0) < priority ? uuid : maxId),\n '',\n )\n\n const { currency } = useLocale()\n\n // Handle splitBy value changes\n useEffect(() => {\n // Only run cleanup if splits exist\n if (!splits.length) return\n\n // Clean up when switching modes\n if (splitBy === SPLIT_BY.amount) {\n // When switching to amount mode, set the last item as remainder (null) and others to 0\n const newAmountValues = splits.reduce<Record<string, number | null>>((acc, curr) => {\n acc[curr.uuid] = curr.uuid === remainderId ? null : 0\n return acc\n }, {})\n setValue('splitAmount', newAmountValues)\n } else {\n // When switching to percentage mode, set the first item to 100% and others to 0\n const newPercentageValues = splits.reduce<Record<string, number>>((acc, curr, index) => {\n acc[curr.uuid] = index === 0 ? 100 : 0\n return acc\n }, {})\n setValue('splitAmount', newPercentageValues)\n }\n }, [splitBy, splits, remainderId, setValue])\n\n const Components = useComponentContext()\n\n if (mode !== 'SPLIT' || bankAccounts.length < 2 || paymentMethod.splits === null) return null\n //Used by form schema to determine variant\n setValue('isSplit', true)\n\n const updateSplitAmount = (uuid: string, value: number | null) => {\n setValue(`splitAmount.${uuid}`, value)\n }\n\n const handleReorder = (newOrder: number[]) => {\n // Calculate new priorities based on new order\n const newPriorities = newOrder.reduce(\n (acc: Record<string, number>, curr: number, currIndex: number) => {\n const split = splits[curr]\n return split ? { ...acc, [split.uuid]: currIndex + 1 } : acc\n },\n {},\n )\n\n // Get the last split in the new order\n const lastSplitIndex = newOrder[newOrder.length - 1]\n if (lastSplitIndex === undefined) return\n\n const lastSplit = splits[lastSplitIndex]\n if (!lastSplit) return\n\n // Update priorities\n setValue('priority', newPriorities)\n\n // Clear the previous remainder if different from the new one\n if (remainderId && remainderId !== lastSplit.uuid) {\n resetField(`splitAmount.${remainderId}`)\n updateSplitAmount(remainderId, 0)\n }\n\n // Set the new last item to null (remainder)\n updateSplitAmount(lastSplit.uuid, null)\n }\n\n const renderFieldsList = () => {\n if (splitBy === SPLIT_BY.amount) {\n return (\n <ReorderableList\n key={`reorderable-amount-list-${splitBy}`}\n label={t('draggableListLabel')}\n items={splits.map(split => ({\n label: split.name as string,\n content: (\n <AmountField\n key={`amount-${split.uuid}`}\n split={split}\n onChange={value => {\n updateSplitAmount(split.uuid, value)\n }}\n remainderId={remainderId}\n />\n ),\n }))}\n onReorder={handleReorder}\n />\n )\n }\n\n return splits.map(split => (\n <PercentageField\n key={`percentage-${split.uuid}`}\n split={split}\n control={control}\n onChange={value => {\n updateSplitAmount(split.uuid, value)\n }}\n currency={currency}\n />\n ))\n }\n\n return (\n <>\n <ErrorMessage\n errors={errors}\n name=\"splitAmount.root\"\n render={({ message }) => {\n // Handle enhanced error messages with current total\n if (message && message.startsWith('percentage_split_total_error:')) {\n const total = message.split(':')[1] || '0'\n return (\n <Components.Alert\n status=\"error\"\n label={t('validations.percentageErrorWithTotal', { total })}\n />\n )\n }\n // Fallback to original error message\n return <Components.Alert status=\"error\" label={t('validations.percentageError')} />\n }}\n />\n <Components.Heading as=\"h2\">{t('title')}</Components.Heading>\n <Trans t={t} i18nKey=\"splitDescription\" components={{ p: <Components.Text /> }} />\n <RadioGroupField\n name=\"splitBy\"\n label={t('splitByLabel')}\n options={[\n { value: SPLIT_BY.percentage, label: t('percentageLabel') },\n { value: SPLIT_BY.amount, label: t('amountLabel') },\n ]}\n />\n {paymentMethod.splits && renderFieldsList()}\n </>\n )\n}\n\nfunction AmountField({\n split,\n remainderId,\n onChange,\n}: {\n split: Split\n remainderId: string\n onChange: (value: number | null) => void\n}) {\n const { t } = useTranslation('Employee.PaymentMethod')\n return (\n <NumberInputField\n name={`splitAmount.${split.uuid}`}\n label={t('splitAmountLabel', {\n name: DOMPurify.sanitize(split.name ?? ''),\n account_number: DOMPurify.sanitize(split.hiddenAccountNumber ?? ''),\n interpolation: { escapeValue: false },\n })}\n format=\"currency\"\n min={0}\n isRequired\n errorMessage={t('validations.amountError')}\n placeholder={remainderId === split.uuid ? t('remainderLabel') : ''}\n isDisabled={remainderId === split.uuid}\n onChange={onChange}\n />\n )\n}\n\nfunction PercentageField({\n split,\n control,\n onChange,\n currency,\n}: {\n split: Split\n control: Control<CombinedSchemaInputs>\n onChange: (value: number) => void\n currency?: string\n}) {\n const { t } = useTranslation('Employee.PaymentMethod')\n return (\n <Fragment key={split.uuid}>\n <NumberInputField\n name={`splitAmount.${split.uuid}`}\n label={t('splitAmountLabel', {\n name: DOMPurify.sanitize(split.name ?? ''),\n account_number: DOMPurify.sanitize(split.hiddenAccountNumber ?? ''),\n interpolation: { escapeValue: false },\n })}\n format=\"percent\"\n min={0}\n isRequired\n errorMessage={t('validations.amountError')}\n onChange={onChange}\n />\n </Fragment>\n )\n}\n"],"names":["Split","paymentMethod","bankAccounts","mode","usePaymentMethod","control","setValue","resetField","watch","errors","useFormContext","t","useTranslation","splitBy","priorities","splits","useMemo","remainderId","maxId","uuid","priority","currency","useLocale","useEffect","SPLIT_BY","newAmountValues","acc","curr","newPercentageValues","index","Components","useComponentContext","updateSplitAmount","value","handleReorder","newOrder","newPriorities","currIndex","split","lastSplitIndex","lastSplit","renderFieldsList","jsx","ReorderableList","AmountField","PercentageField","jsxs","Fragment","ErrorMessage","message","total","Trans","RadioGroupField","onChange","NumberInputField","DOMPurify"],"mappings":";;;;;;;;;;;;;AAiBO,SAASA,KAAQ;AACtB,QAAM,EAAE,eAAAC,GAAe,cAAAC,GAAc,MAAAC,EAAA,IAASC,EAAA,GACxC;AAAA,IACJ,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,WAAW,EAAE,QAAAC,EAAA;AAAA,EAAO,IAClBC,EAAA,GACE,EAAE,GAAAC,EAAA,IAAMC,EAAe,wBAAwB,GAC/CC,IAAUL,EAAM,SAAS,GACzBM,IAAaN,EAAM,UAAU,GAE7BO,IAASC,EAAQ,MAAMf,EAAc,UAAU,IAAI,CAACA,EAAc,MAAM,CAAC,GAEzEgB,IAAc,OAAO,QAAQH,CAAU,EAAE;AAAA,IAC7C,CAACI,GAAO,CAACC,GAAMC,CAAQ,MAAO,CAACF,MAAUJ,EAAWI,CAAK,KAAK,KA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;AAAA,MACP,KAAK;AAAA,MACL,YAAU;AAAA,MACV,cAAc3B,EAAE,yBAAyB;AAAA,MACzC,aAAaM,MAAgBqB,EAAM,OAAO3B,EAAE,gBAAgB,IAAI;AAAA,MAChE,YAAYM,MAAgBqB,EAAM;AAAA,MAClC,UAAAe;AAAA,IAAA;AAAA,EAAA;AAGN;AAEA,SAASR,EAAgB;AAAA,EACvB,OAAAP;AAAA,EACA,SAAAjC;AAAA,EACA,UAAAgD;AAAA,EACA,UAAAhC;AACF,GAKG;AACD,QAAM,EAAE,GAAAV,EAAA,IAAMC,EAAe,wBAAwB;AACrD,SACE,gBAAA8B,EAACK,GAAA,EACC,UAAA,gBAAAL;AAAA,IAACY;AAAA,IAAA;AAAA,MACC,MAAM,eAAehB,EAAM,IAAI;AAAA,MAC/B,OAAO3B,EAAE,oBAAoB;AAAA,QAC3B,MAAM4C,EAAU,SAASjB,EAAM,QAAQ,EAAE;AAAA,QACzC,gBAAgBiB,EAAU,SAASjB,EAAM,uBAAuB,EAAE;AAAA,QAClE,eAAe,EAAE,aAAa,GAAA;AAAA,MAAM,CACrC;AAAA,MACD,QAAO;AAAA,MACP,KAAK;AAAA,MACL,YAAU;AAAA,MACV,cAAc3B,EAAE,yBAAyB;AAAA,MACzC,UAAA0C;AAAA,IAAA;AAAA,EAAA,EACF,GAbaf,EAAM,IAcrB;AAEJ;"}
1
+ {"version":3,"file":"Split.js","sources":["../../../../src/components/Employee/PaymentMethod/Split.tsx"],"sourcesContent":["import type { Control } from 'react-hook-form'\nimport { useFormContext } from 'react-hook-form'\nimport { Trans, useTranslation } from 'react-i18next'\nimport { type EmployeePaymentMethod } from '@gusto/embedded-api/models/components/employeepaymentmethod'\nimport { ErrorMessage } from '@hookform/error-message'\nimport { Fragment } from 'react/jsx-runtime'\nimport DOMPurify from 'dompurify'\nimport { useEffect, useMemo } from 'react'\nimport { usePaymentMethod, type CombinedSchemaInputs } from './usePaymentMethod'\nimport { NumberInputField, RadioGroupField } from '@/components/Common'\nimport { useLocale } from '@/contexts/LocaleProvider'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { ReorderableList } from '@/components/Common/ReorderableList'\nimport { SPLIT_BY } from '@/shared/constants'\n\ntype Split = NonNullable<EmployeePaymentMethod['splits']>[number]\n\nexport function Split() {\n const { paymentMethod, bankAccounts, mode } = usePaymentMethod()\n const {\n control,\n setValue,\n resetField,\n watch,\n formState: { errors },\n } = useFormContext<CombinedSchemaInputs>()\n const { t } = useTranslation('Employee.PaymentMethod')\n const splitBy = watch('splitBy')\n const priorities = watch('priority')\n\n const splits = useMemo(() => paymentMethod.splits ?? [], [paymentMethod.splits])\n\n const remainderId = Object.entries(priorities).reduce(\n (maxId, [uuid, priority]) => (!maxId || (priorities[maxId] ?? 0) < priority ? uuid : maxId),\n '',\n )\n\n const { currency } = useLocale()\n\n // Handle splitBy value changes\n useEffect(() => {\n // Only run cleanup if splits exist\n if (!splits.length) return\n\n // Clean up when switching modes\n if (splitBy === SPLIT_BY.amount) {\n // When switching to amount mode, set the last item as remainder (null) and others to 0\n const newAmountValues = splits.reduce<Record<string, number | null>>((acc, curr) => {\n acc[curr.uuid] = curr.uuid === remainderId ? null : 0\n return acc\n }, {})\n setValue('splitAmount', newAmountValues)\n } else {\n // When switching to percentage mode, set the first item to 100% and others to 0\n const newPercentageValues = splits.reduce<Record<string, number>>((acc, curr, index) => {\n acc[curr.uuid] = index === 0 ? 100 : 0\n return acc\n }, {})\n setValue('splitAmount', newPercentageValues)\n }\n }, [splitBy, splits, remainderId, setValue])\n\n const Components = useComponentContext()\n\n if (mode !== 'SPLIT' || bankAccounts.length < 2 || paymentMethod.splits === null) return null\n //Used by form schema to determine variant\n setValue('isSplit', true)\n\n const updateSplitAmount = (uuid: string, value: number | null) => {\n setValue(`splitAmount.${uuid}`, value)\n }\n\n const handleReorder = (newOrder: number[]) => {\n // Calculate new priorities based on new order\n const newPriorities = newOrder.reduce(\n (acc: Record<string, number>, curr: number, currIndex: number) => {\n const split = splits[curr]\n return split ? { ...acc, [split.uuid]: currIndex + 1 } : acc\n },\n {},\n )\n\n // Get the last split in the new order\n const lastSplitIndex = newOrder[newOrder.length - 1]\n if (lastSplitIndex === undefined) return\n\n const lastSplit = splits[lastSplitIndex]\n if (!lastSplit) return\n\n // Update priorities\n setValue('priority', newPriorities)\n\n // Clear the previous remainder if different from the new one\n if (remainderId && remainderId !== lastSplit.uuid) {\n resetField(`splitAmount.${remainderId}`)\n updateSplitAmount(remainderId, 0)\n }\n\n // Set the new last item to null (remainder)\n updateSplitAmount(lastSplit.uuid, null)\n }\n\n const renderFieldsList = () => {\n if (splitBy === SPLIT_BY.amount) {\n return (\n <ReorderableList\n key={`reorderable-amount-list-${splitBy}`}\n label={t('draggableListLabel')}\n items={splits.map(split => ({\n label: split.name as string,\n content: (\n <AmountField\n key={`amount-${split.uuid}`}\n split={split}\n onChange={value => {\n updateSplitAmount(split.uuid, value)\n }}\n remainderId={remainderId}\n />\n ),\n }))}\n onReorder={handleReorder}\n />\n )\n }\n\n return splits.map(split => (\n <PercentageField\n key={`percentage-${split.uuid}`}\n split={split}\n control={control}\n onChange={value => {\n updateSplitAmount(split.uuid, value)\n }}\n currency={currency}\n />\n ))\n }\n\n return (\n <>\n <ErrorMessage\n errors={errors}\n name=\"splitAmount.root\"\n render={({ message }) => {\n // Handle enhanced error messages with current total\n if (message && message.startsWith('percentage_split_total_error:')) {\n const total = message.split(':')[1] || '0'\n return (\n <Components.Alert\n status=\"error\"\n label={t('validations.percentageErrorWithTotal', { total })}\n />\n )\n }\n // Fallback to original error message\n return <Components.Alert status=\"error\" label={t('validations.percentageError')} />\n }}\n />\n <Components.Heading as=\"h2\">{t('title')}</Components.Heading>\n <Trans t={t} i18nKey=\"splitDescription\" components={{ p: <Components.Text /> }} />\n <RadioGroupField\n name=\"splitBy\"\n label={t('splitByLabel')}\n options={[\n { value: SPLIT_BY.percentage, label: t('percentageLabel') },\n { value: SPLIT_BY.amount, label: t('amountLabel') },\n ]}\n />\n {paymentMethod.splits && renderFieldsList()}\n </>\n )\n}\n\nfunction AmountField({\n split,\n remainderId,\n onChange,\n}: {\n split: Split\n remainderId: string\n onChange: (value: number | null) => void\n}) {\n const { t } = useTranslation('Employee.PaymentMethod')\n return (\n <NumberInputField\n name={`splitAmount.${split.uuid}`}\n label={t('splitAmountLabel', {\n name: DOMPurify.sanitize(split.name ?? ''),\n account_number: DOMPurify.sanitize(split.hiddenAccountNumber ?? ''),\n interpolation: { escapeValue: false },\n })}\n format=\"currency\"\n min={0}\n isRequired\n errorMessage={t('validations.amountError')}\n placeholder={remainderId === split.uuid ? t('remainderLabel') : ''}\n isDisabled={remainderId === split.uuid}\n onChange={onChange}\n />\n )\n}\n\nfunction PercentageField({\n split,\n control,\n onChange,\n currency,\n}: {\n split: Split\n control: Control<CombinedSchemaInputs>\n onChange: (value: number) => void\n currency?: string\n}) {\n const { t } = useTranslation('Employee.PaymentMethod')\n return (\n <Fragment key={split.uuid}>\n <NumberInputField\n name={`splitAmount.${split.uuid}`}\n label={t('splitAmountLabel', {\n name: DOMPurify.sanitize(split.name ?? ''),\n account_number: DOMPurify.sanitize(split.hiddenAccountNumber ?? ''),\n interpolation: { escapeValue: false },\n })}\n format=\"percent\"\n min={0}\n isRequired\n errorMessage={t('validations.amountError')}\n onChange={onChange}\n />\n </Fragment>\n )\n}\n"],"names":["Split","paymentMethod","bankAccounts","mode","usePaymentMethod","control","setValue","resetField","watch","errors","useFormContext","t","useTranslation","splitBy","priorities","splits","useMemo","remainderId","maxId","uuid","priority","currency","useLocale","useEffect","SPLIT_BY","newAmountValues","acc","curr","newPercentageValues","index","Components","useComponentContext","updateSplitAmount","value","handleReorder","newOrder","newPriorities","currIndex","split","lastSplitIndex","lastSplit","renderFieldsList","jsx","ReorderableList","AmountField","PercentageField","jsxs","Fragment","ErrorMessage","message","total","Trans","RadioGroupField","onChange","NumberInputField","DOMPurify"],"mappings":";;;;;;;;;;;;;;AAiBO,SAASA,KAAQ;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AAAA,MACL,YAAU;AAAA,MACV,cAAc3B,EAAE,yBAAyB;AAAA,MACzC,UAAA0C;AAAA,IAAA;AAAA,EAAA,EACF,GAbaf,EAAM,IAcrB;AAEJ;"}
@@ -4,17 +4,18 @@ import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "react-error-boundary";
6
6
  import "react-i18next";
7
- import "@gusto/embedded-api/models/errors/apierror";
7
+ import "@gusto/embedded-api/models/errors/gustoembeddederror";
8
8
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
9
9
  import "@tanstack/react-query";
10
10
  import "../../Base/useBase.js";
11
11
  import "../../../shared/constants.js";
12
+ import "classnames";
12
13
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
13
14
  import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
14
15
  import "dompurify";
15
16
  import "../../../contexts/LocaleProvider/useLocale.js";
16
17
  import { createCompoundContext as a } from "../../Base/createCompoundContext.js";
17
- const x = t.union([
18
+ const S = t.union([
18
19
  l.extend({
19
20
  type: t.literal("Direct Deposit"),
20
21
  isSplit: t.literal(!1)
@@ -54,10 +55,10 @@ const x = t.union([
54
55
  remainder: t.string()
55
56
  })
56
57
  ])
57
- ]), [S, k] = a("PaymentMethodContext");
58
+ ]), [k, C] = a("PaymentMethodContext");
58
59
  export {
59
- x as CombinedSchema,
60
- k as PaymentMethodProvider,
61
- S as usePaymentMethod
60
+ S as CombinedSchema,
61
+ C as PaymentMethodProvider,
62
+ k as usePaymentMethod
62
63
  };
63
64
  //# sourceMappingURL=usePaymentMethod.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePaymentMethod.js","sources":["../../../../src/components/Employee/PaymentMethod/usePaymentMethod.ts"],"sourcesContent":["import type { EmployeeBankAccount } from '@gusto/embedded-api/models/components/employeebankaccount'\nimport type { EmployeePaymentMethod } from '@gusto/embedded-api/models/components/employeepaymentmethod'\nimport { z } from 'zod'\nimport { BankAccountSchema } from './BankAccount'\nimport { createCompoundContext } from '@/components/Base'\n\nexport const CombinedSchema = z.union([\n BankAccountSchema.extend({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(false),\n }),\n z.object({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(false),\n hasBankPayload: z.literal(false),\n }),\n z.object({\n type: z.literal('Check'),\n }),\n z.discriminatedUnion('splitBy', [\n z.object({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(true),\n hasBankPayload: z.literal(false),\n splitBy: z.literal('Percentage'),\n splitAmount: z.record(z.string(), z.number().max(100).min(0)).refine(\n input => Object.values(input).reduce((acc, curr) => acc + curr, 0) === 100,\n input => {\n const total = Object.values(input).reduce((acc, curr) => acc + curr, 0)\n return {\n message: `percentage_split_total_error:${total}`,\n }\n },\n ),\n priority: z.record(z.string(), z.number()),\n }),\n z.object({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(true),\n hasBankPayload: z.literal(false),\n splitBy: z.literal('Amount'),\n priority: z.record(z.string(), z.number()).refine(input => {\n const arr = Object.values(input)\n return arr.filter((item, index) => arr.indexOf(item) !== index).length === 0\n }),\n splitAmount: z.record(z.string(), z.number().min(0).nullable()),\n remainder: z.string(),\n }),\n ]),\n])\n\nexport type CombinedSchemaInputs = z.input<typeof CombinedSchema>\nexport type CombinedSchemaOutputs = z.output<typeof CombinedSchema>\n\ntype PaymentMethodContextType = {\n bankAccounts: EmployeeBankAccount[]\n isPending: boolean\n watchedType?: string\n mode: MODE\n paymentMethod: EmployeePaymentMethod\n handleAdd: () => void\n handleSplit: () => void\n handleCancel: () => void\n handleDelete: (uuid: string) => void\n isAdmin: boolean\n}\n\nexport type MODE = 'ADD' | 'LIST' | 'SPLIT' | 'INITIAL'\n\nconst [usePaymentMethod, PaymentMethodProvider] =\n createCompoundContext<PaymentMethodContextType>('PaymentMethodContext')\nexport { usePaymentMethod, PaymentMethodProvider }\n"],"names":["CombinedSchema","z","BankAccountSchema","input","acc","curr","arr","item","index","usePaymentMethod","PaymentMethodProvider","createCompoundContext"],"mapp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EAAE,QAAQ,QAAQ;AAAA,MAC3B,UAAUA,EAAE,OAAOA,EAAE,OAAA,GAAUA,EAAE,OAAA,CAAQ,EAAE,OAAO,CAAAE,MAAS;AACzD,cAAMG,IAAM,OAAO,OAAOH,CAAK;AAC/B,eAAOG,EAAI,OAAO,CAACC,GAAMC,MAAUF,EAAI,QAAQC,CAAI,MAAMC,CAAK,EAAE,WAAW;AAAA,MAC7E,CAAC;AAAA,MACD,aAAaP,EAAE,OAAOA,EAAE,OAAA,GAAUA,EAAE,OAAA,EAAS,IAAI,CAAC,EAAE,UAAU;AAAA,MAC9D,WAAWA,EAAE,OAAA;AAAA,IAAO,CACrB;AAAA,EAAA,CACF;AACH,CAAC,GAoBK,CAACQ,GAAkBC,CAAqB,IAC5CC,EAAgD,sBAAsB;"}
1
+ {"version":3,"file":"usePaymentMethod.js","sources":["../../../../src/components/Employee/PaymentMethod/usePaymentMethod.ts"],"sourcesContent":["import type { EmployeeBankAccount } from '@gusto/embedded-api/models/components/employeebankaccount'\nimport type { EmployeePaymentMethod } from '@gusto/embedded-api/models/components/employeepaymentmethod'\nimport { z } from 'zod'\nimport { BankAccountSchema } from './BankAccount'\nimport { createCompoundContext } from '@/components/Base'\n\nexport const CombinedSchema = z.union([\n BankAccountSchema.extend({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(false),\n }),\n z.object({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(false),\n hasBankPayload: z.literal(false),\n }),\n z.object({\n type: z.literal('Check'),\n }),\n z.discriminatedUnion('splitBy', [\n z.object({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(true),\n hasBankPayload: z.literal(false),\n splitBy: z.literal('Percentage'),\n splitAmount: z.record(z.string(), z.number().max(100).min(0)).refine(\n input => Object.values(input).reduce((acc, curr) => acc + curr, 0) === 100,\n input => {\n const total = Object.values(input).reduce((acc, curr) => acc + curr, 0)\n return {\n message: `percentage_split_total_error:${total}`,\n }\n },\n ),\n priority: z.record(z.string(), z.number()),\n }),\n z.object({\n type: z.literal('Direct Deposit'),\n isSplit: z.literal(true),\n hasBankPayload: z.literal(false),\n splitBy: z.literal('Amount'),\n priority: z.record(z.string(), z.number()).refine(input => {\n const arr = Object.values(input)\n return arr.filter((item, index) => arr.indexOf(item) !== index).length === 0\n }),\n splitAmount: z.record(z.string(), z.number().min(0).nullable()),\n remainder: z.string(),\n }),\n ]),\n])\n\nexport type CombinedSchemaInputs = z.input<typeof CombinedSchema>\nexport type CombinedSchemaOutputs = z.output<typeof CombinedSchema>\n\ntype PaymentMethodContextType = {\n bankAccounts: EmployeeBankAccount[]\n isPending: boolean\n watchedType?: string\n mode: MODE\n paymentMethod: EmployeePaymentMethod\n handleAdd: () => void\n handleSplit: () => void\n handleCancel: () => void\n handleDelete: (uuid: string) => void\n isAdmin: boolean\n}\n\nexport type MODE = 'ADD' | 'LIST' | 'SPLIT' | 'INITIAL'\n\nconst [usePaymentMethod, PaymentMethodProvider] =\n createCompoundContext<PaymentMethodContextType>('PaymentMethodContext')\nexport { usePaymentMethod, PaymentMethodProvider }\n"],"names":["CombinedSchema","z","BankAccountSchema","input","acc","curr","arr","item","index","usePaymentMethod","PaymentMethodProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;;;AAMO,MAAMA,IAAiBC,EAAE,MAAM;AAAA,EACpCC,EAAkB,OAAO;AAAA,IACvB,MAAMD,EAAE,QAAQ,gBAAgB;AAAA,IAChC,SAASA,EAAE,QAAQ,EAAK;AAAA,EAAA,CACzB;AAAA,EACDA,EAAE,OAAO;AAAA,IACP,MAAMA,EAAE,QAAQ,gBAAgB;AAAA,IAChC,SAASA,EAAE,QAAQ,EAAK;AAAA,IACxB,gBAAgBA,EAAE,QAAQ,EAAK;AAAA,EAAA,CAChC;AAAA,EACDA,EAAE,OAAO;AAAA,IACP,MAAMA,EAAE,QAAQ,OAAO;AAAA,EAAA,CACxB;AAAA,EACDA,EAAE,mBAAmB,WAAW;AAAA,IAC9BA,EAAE,OAAO;AAAA,M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sBAAsB;"}
@@ -1,15 +1,16 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { useTranslation as r } from "react-i18next";
2
+ import { useTranslation as n } from "react-i18next";
3
3
  import { useProfile as m } from "./useProfile.js";
4
4
  import "../../../shared/constants.js";
5
+ import "classnames";
5
6
  import { ActionsLayout as e } from "../../Common/ActionsLayout/ActionsLayout.js";
6
7
  import { useComponentContext as s } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
8
  import "react";
8
- const C = () => {
9
- const { t } = r("Employee.Profile"), { isPending: i } = m(), n = s();
10
- return /* @__PURE__ */ o(e, { children: /* @__PURE__ */ o(n.Button, { type: "submit", isLoading: i, children: t("submitCta") }) });
9
+ const x = () => {
10
+ const { t } = n("Employee.Profile"), { isPending: i } = m(), r = s();
11
+ return /* @__PURE__ */ o(e, { children: /* @__PURE__ */ o(r.Button, { type: "submit", isLoading: i, children: t("submitCta") }) });
11
12
  };
12
13
  export {
13
- C as Actions
14
+ x as Actions
14
15
  };
15
16
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/Profile/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useProfile } from './useProfile'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Employee.Profile')\n const { isPending } = useProfile()\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","useTranslation","isPending","useProfile","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,EAAA,IAAMC,EAAe,kBAAkB,GACzC,EAAE,WAAAC,EAAA,IAAcC,EAAA,GAChBC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAA,EAAE,WAAW,GAChB,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/Profile/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useProfile } from './useProfile'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport const Actions = () => {\n const { t } = useTranslation('Employee.Profile')\n const { isPending } = useProfile()\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","useTranslation","isPending","useProfile","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;;;AAKO,MAAMA,IAAU,MAAM;AAC3B,QAAM,EAAE,EAAA,IAAMC,EAAe,kBAAkB,GACzC,EAAE,WAAAC,EAAA,IAAcC,EAAA,GAChBC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAA,EAAE,WAAW,GAChB,GACF;AAEJ;"}
@@ -3,24 +3,25 @@ import { useEffect as h } from "react";
3
3
  import { useFormContext as g } from "react-hook-form";
4
4
  import { useTranslation as O } from "react-i18next";
5
5
  import { z as n } from "zod";
6
- import { AdminInputsSchema as y, SocialSecurityNumberSchema as D, DateOfBirthSchema as c, NameInputsSchema as x, NameInputs as A, AdminInputs as I, SocialSecurityNumberInput as F, DateOfBirthInput as N } from "./PersonalDetailsInputs.js";
6
+ import { SocialSecurityNumberSchema as y, DateOfBirthSchema as c, AdminInputsSchema as D, NameInputsSchema as x, NameInputs as A, AdminInputs as I, SocialSecurityNumberInput as F, DateOfBirthInput as N } from "./PersonalDetailsInputs.js";
7
7
  import P from "./AdminPersonalDetails.module.scss.js";
8
8
  import { useProfile as C } from "./useProfile.js";
9
9
  import "../../../shared/constants.js";
10
- import "../../../contexts/ComponentAdapter/useComponentContext.js";
10
+ import "classnames";
11
11
  import { SwitchField as w } from "../../Common/Fields/SwitchField/SwitchField.js";
12
- const d = y.merge(
12
+ import "../../../contexts/ComponentAdapter/useComponentContext.js";
13
+ const d = D.merge(
13
14
  x
14
15
  ).extend({
15
16
  selfOnboarding: n.boolean()
16
- }), G = n.discriminatedUnion("enableSsn", [
17
- d.merge(D).merge(c).extend({
17
+ }), H = n.discriminatedUnion("enableSsn", [
18
+ d.merge(y).merge(c).extend({
18
19
  enableSsn: n.literal(!0)
19
20
  }),
20
21
  d.merge(c).extend({
21
22
  enableSsn: n.literal(!1)
22
23
  })
23
- ]), H = () => {
24
+ ]), J = () => {
24
25
  const {
25
26
  companyLocations: f,
26
27
  employee: i,
@@ -48,8 +49,8 @@ const d = y.merge(
48
49
  ] }) : null;
49
50
  };
50
51
  export {
51
- H as AdminPersonalDetails,
52
- G as AdminPersonalDetailsSchema,
52
+ J as AdminPersonalDetails,
53
+ H as AdminPersonalDetailsSchema,
53
54
  d as AdminSelfOnboardingPersonalDetailsSchema
54
55
  };
55
56
  //# sourceMappingURL=AdminPersonalDetails.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AdminPersonalDetails.js","sources":["../../../../src/components/Employee/Profile/AdminPersonalDetails.tsx"],"sourcesContent":["import { useEffect } from 'react'\nimport { useFormContext } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport {\n AdminInputs,\n AdminInputsSchema,\n NameInputs,\n NameInputsSchema,\n SocialSecurityNumberInput,\n SocialSecurityNumberSchema,\n DateOfBirthInput,\n DateOfBirthSchema,\n type PersonalDetailsInputs,\n} from './PersonalDetailsInputs'\nimport styles from './AdminPersonalDetails.module.scss'\nimport { useProfile } from './useProfile'\nimport { SwitchField } from '@/components/Common'\n\nexport const AdminSelfOnboardingPersonalDetailsSchema = AdminInputsSchema.merge(\n NameInputsSchema,\n).extend({\n selfOnboarding: z.boolean(),\n})\n\nexport const AdminPersonalDetailsSchema = z.discriminatedUnion('enableSsn', [\n AdminSelfOnboardingPersonalDetailsSchema.merge(SocialSecurityNumberSchema)\n .merge(DateOfBirthSchema)\n .extend({\n enableSsn: z.literal(true),\n }),\n AdminSelfOnboardingPersonalDetailsSchema.merge(DateOfBirthSchema).extend({\n enableSsn: z.literal(false),\n }),\n])\n\nexport const AdminPersonalDetails = () => {\n const {\n companyLocations,\n employee,\n isAdmin,\n isSelfOnboardingEnabled,\n hasCompletedSelfOnboarding,\n } = useProfile()\n const { t } = useTranslation('Employee.Profile')\n const { watch, setValue, getFieldState } = useFormContext<PersonalDetailsInputs>()\n const isSelfOnboardingChecked = watch('selfOnboarding')\n const { isDirty: isSsnDirty } = getFieldState('ssn')\n\n useEffect(() => {\n if (isSelfOnboardingChecked) {\n setValue('enableSsn', false)\n } else {\n setValue('enableSsn', isSsnDirty ? true : !employee?.hasSsn)\n }\n }, [isSelfOnboardingChecked, employee?.hasSsn, isSsnDirty, setValue])\n\n if (!isAdmin) {\n return null\n }\n\n return (\n <>\n {isSelfOnboardingEnabled && !hasCompletedSelfOnboarding && (\n <div className={styles.switchFieldContainer}>\n <SwitchField\n name=\"selfOnboarding\"\n description={t('selfOnboardingDescription')}\n label={t('selfOnboardingLabel')}\n />\n </div>\n )}\n\n <NameInputs />\n <AdminInputs companyLocations={companyLocations} />\n\n {(!isSelfOnboardingChecked || hasCompletedSelfOnboarding) && (\n <>\n <SocialSecurityNumberInput employee={employee} />\n <DateOfBirthInput />\n </>\n )}\n </>\n )\n}\n"],"names":["AdminSelfOnboardingPersonalDetailsSchema","AdminInputsSchema","NameInputsSchema","z","AdminPersonalDetailsSchema","SocialSecurityNumberSchema","DateOfBirthSchema","AdminPersonalDetails","companyLocations","employee","isAdmin","isSelfOnboardingEnabled","hasCompletedSelfOnboarding","useProfile","t","useTranslation","watch","setValue","getFieldState","useFormContext","isSelfOnboardingChecked","isSsnDirty","useEffect","jsxs","Fragment","jsx","styles","SwitchField","NameInputs","AdminInputs","SocialSecurityNumberInput","DateOfBirthInput"],"mappings":";;;;;;;;;;;AAmBO,MAAMA,IAA2CC,EAAkB;AAAA,EACxEC;AACF,EAAE,OAAO;AAAA,EACP,gBAAgBC,EAAE,QAAA;AACpB,CAAC,GAEYC,IAA6BD,EAAE,mBAAmB,aAAa;AAAA,EAC1EH,EAAyC,MAAMK,CAA0B,EACtE,MAAMC,CAAiB,EACvB,OAAO;AAAA,IACN,WAAWH,EAAE,QAAQ,EAAI;AAAA,EAAA,CAC1B;AAAA,EACHH,EAAyC,MAAMM,CAAiB,EAAE,OAAO;AAAA,IACvE,WAAWH,EAAE,QAAQ,EAAK;AAAA,EAAA,CAC3B;AACH,CAAC,GAEYI,IAAuB,MAAM;AACxC,QAAM;AAAA,IACJ,kBAAAC;AAAA,IACA,UAAAC;AAAA,IACA,SAAAC;AAAA,IACA,yBAAAC;AAAA,IACA,4BAAAC;AAAA,EAAA,IACEC,EAAA,GACE,EAAE,GAAAC,EAAA,IAAMC,EAAe,kBAAkB,GACzC,EAAE,OAAAC,GAAO,UAAAC,GAAU,eAAAC,EAAA,IAAkBC,EAAA,GACrCC,IAA0BJ,EAAM,gBAAgB,GAChD,EAAE,SAASK,MAAeH,EAAc,KAAK;AAUnD,SARAI,EAAU,MAAM;AACd,IAAIF,IACFH,EAAS,aAAa,EAAK,IAE3BA,EAAS,aAAaI,IAAa,KAAO,CAACZ,GAAU,MAAM;AAAA,EAE/D,GAAG,CAACW,GAAyBX,GAAU,QAAQY,GAAYJ,CAAQ,CAAC,GAE/DP,IAKH,gBAAAa,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAb,KAA2B,CAACC,KAC3B,gBAAAa,EAAC,OAAA,EAAI,WAAWC,EAAO,sBACrB,UAAA,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,aAAab,EAAE,2BAA2B;AAAA,QAC1C,OAAOA,EAAE,qBAAqB;AAAA,MAAA;AAAA,IAAA,GAElC;AAAA,sBAGDc,GAAA,EAAW;AAAA,IACZ,gBAAAH,EAACI,KAAY,kBAAArB,GAAoC;AAAA,KAE/C,CAACY,KAA2BR,MAC5B,gBAAAW,EAAAC,GAAA,EACE,UAAA;AAAA,MAAA,gBAAAC,EAACK,KAA0B,UAAArB,GAAoB;AAAA,wBAC9CsB,GAAA,CAAA,CAAiB;AAAA,IAAA,EAAA,CACpB;AAAA,EAAA,GAEJ,IAxBO;AA0BX;"}
1
+ {"version":3,"file":"AdminPersonalDetails.js","sources":["../../../../src/components/Employee/Profile/AdminPersonalDetails.tsx"],"sourcesContent":["import { useEffect } from 'react'\nimport { useFormContext } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport { z } from 'zod'\nimport {\n AdminInputs,\n AdminInputsSchema,\n NameInputs,\n NameInputsSchema,\n SocialSecurityNumberInput,\n SocialSecurityNumberSchema,\n DateOfBirthInput,\n DateOfBirthSchema,\n type PersonalDetailsInputs,\n} from './PersonalDetailsInputs'\nimport styles from './AdminPersonalDetails.module.scss'\nimport { useProfile } from './useProfile'\nimport { SwitchField } from '@/components/Common'\n\nexport const AdminSelfOnboardingPersonalDetailsSchema = AdminInputsSchema.merge(\n NameInputsSchema,\n).extend({\n selfOnboarding: z.boolean(),\n})\n\nexport const AdminPersonalDetailsSchema = z.discriminatedUnion('enableSsn', [\n AdminSelfOnboardingPersonalDetailsSchema.merge(SocialSecurityNumberSchema)\n .merge(DateOfBirthSchema)\n .extend({\n enableSsn: z.literal(true),\n }),\n AdminSelfOnboardingPersonalDetailsSchema.merge(DateOfBirthSchema).extend({\n enableSsn: z.literal(false),\n }),\n])\n\nexport const AdminPersonalDetails = () => {\n const {\n companyLocations,\n employee,\n isAdmin,\n isSelfOnboardingEnabled,\n hasCompletedSelfOnboarding,\n } = useProfile()\n const { t } = useTranslation('Employee.Profile')\n const { watch, setValue, getFieldState } = useFormContext<PersonalDetailsInputs>()\n const isSelfOnboardingChecked = watch('selfOnboarding')\n const { isDirty: isSsnDirty } = getFieldState('ssn')\n\n useEffect(() => {\n if (isSelfOnboardingChecked) {\n setValue('enableSsn', false)\n } else {\n setValue('enableSsn', isSsnDirty ? true : !employee?.hasSsn)\n }\n }, [isSelfOnboardingChecked, employee?.hasSsn, isSsnDirty, setValue])\n\n if (!isAdmin) {\n return null\n }\n\n return (\n <>\n {isSelfOnboardingEnabled && !hasCompletedSelfOnboarding && (\n <div className={styles.switchFieldContainer}>\n <SwitchField\n name=\"selfOnboarding\"\n description={t('selfOnboardingDescription')}\n label={t('selfOnboardingLabel')}\n />\n </div>\n )}\n\n <NameInputs />\n <AdminInputs companyLocations={companyLocations} />\n\n {(!isSelfOnboardingChecked || hasCompletedSelfOnboarding) && (\n <>\n <SocialSecurityNumberInput employee={employee} />\n <DateOfBirthInput />\n </>\n )}\n </>\n )\n}\n"],"names":["AdminSelfOnboardingPersonalDetailsSchema","AdminInputsSchema","NameInputsSchema","z","AdminPersonalDetailsSchema","SocialSecurityNumberSchema","DateOfBirthSchema","AdminPersonalDetails","companyLocations","employee","isAdmin","isSelfOnboardingEnabled","hasCompletedSelfOnboarding","useProfile","t","useTranslation","watch","setValue","getFieldState","useFormContext","isSelfOnboardingChecked","isSsnDirty","useEffect","jsxs","Fragment","jsx","styles","SwitchField","NameInputs","AdminInputs","SocialSecurityNumberInput","DateOfBirthInput"],"mappings":";;;;;;;;;;;;AAmBO,MAAMA,IAA2CC,EAAkB;AAAA,EACxEC;AACF,EAAE,OAAO;AAAA,EACP,gBAAgBC,EAAE,QAAA;AACpB,CAAC,GAEYC,IAA6BD,EAAE,mBAAmB,aAAa;AAAA,EAC1EH,EAAyC,MAAMK,CAA0B,EACtE,MAAMC,CAAiB,EACvB,OAAO;AAAA,IACN,WAAWH,EAAE,QAAQ,EAAI;AAAA,EAAA,CAC1B;AAAA,EACHH,EAAyC,MAA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.js";
6
6
  import { STATES_ABBR as y } from "../../../shared/constants.js";
7
7
  import { Grid as x } from "../../Common/Grid/Grid.js";
8
+ import { TextInputField as o } from "../../Common/Fields/TextInputField/TextInputField.js";
8
9
  import { useComponentContext as C } from "../../../contexts/ComponentAdapter/useComponentContext.js";
9
10
  import "react";
10
- import { TextInputField as o } from "../../Common/Fields/TextInputField/TextInputField.js";
11
11
  import { SelectField as T } from "../../Common/Fields/SelectField/SelectField.js";
12
12
  import { CheckboxField as A } from "../../Common/Fields/CheckboxField/CheckboxField.js";
13
13
  const s = t.object({
@@ -4,14 +4,14 @@ import { useFormContext as c } from "react-hook-form";
4
4
  import { useTranslation as s } from "react-i18next";
5
5
  import "../../../shared/constants.js";
6
6
  import { Grid as b } from "../../Common/Grid/Grid.js";
7
+ import { TextInputField as o } from "../../Common/Fields/TextInputField/TextInputField.js";
8
+ import { DatePickerField as p } from "../../Common/Fields/DatePickerField/DatePickerField.js";
7
9
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
8
10
  import "react";
9
11
  import { removeNonDigits as S, addressInline as g } from "../../../helpers/formattedStrings.js";
10
12
  import { usePlaceholderSSN as h, normalizeSSN as N } from "../../../helpers/ssn.js";
11
13
  import { SSN_REGEX as D, nameValidation as m } from "../../../helpers/validations.js";
12
- import { TextInputField as o } from "../../Common/Fields/TextInputField/TextInputField.js";
13
14
  import { SelectField as I } from "../../Common/Fields/SelectField/SelectField.js";
14
- import { DatePickerField as p } from "../../Common/Fields/DatePickerField/DatePickerField.js";
15
15
  const v = t.object({
16
16
  firstName: m,
17
17
  middleInitial: t.string().optional(),
@@ -2,19 +2,20 @@ import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "react-error-boundary";
4
4
  import "react-i18next";
5
- import "@gusto/embedded-api/models/errors/apierror";
5
+ import "@gusto/embedded-api/models/errors/gustoembeddederror";
6
6
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
7
  import "@tanstack/react-query";
8
8
  import "../../Base/useBase.js";
9
9
  import "../../../shared/constants.js";
10
+ import "classnames";
10
11
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
11
12
  import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
12
13
  import "dompurify";
13
14
  import "../../../contexts/LocaleProvider/useLocale.js";
14
15
  import { createCompoundContext as o } from "../../Base/createCompoundContext.js";
15
- const [s, u] = o("ProfileContext");
16
+ const [u, a] = o("ProfileContext");
16
17
  export {
17
- u as ProfileProvider,
18
- s as useProfile
18
+ a as ProfileProvider,
19
+ u as useProfile
19
20
  };
20
21
  //# sourceMappingURL=useProfile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useProfile.js","sources":["../../../../src/components/Employee/Profile/useProfile.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\n\n//Interface for context passed down to component slots\ntype ProfileContextType = {\n companyLocations: Location[]\n workAddresses?: EmployeeWorkAddress[]\n employee?: Employee\n isSelfOnboardingIntended?: boolean\n isPending: boolean\n isAdmin: boolean\n handleCancel: () => void\n isSelfOnboardingEnabled: boolean\n hasCompletedSelfOnboarding: boolean\n}\n\nconst [useProfile, ProfileProvider] = createCompoundContext<ProfileContextType>('ProfileContext')\nexport { useProfile, ProfileProvider }\n"],"names":["useProfile","ProfileProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAM,CAACA,GAAYC,CAAe,IAAIC,EAA0C,gBAAgB;"}
1
+ {"version":3,"file":"useProfile.js","sources":["../../../../src/components/Employee/Profile/useProfile.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { EmployeeWorkAddress } from '@gusto/embedded-api/models/components/employeeworkaddress'\nimport { type Location } from '@gusto/embedded-api/models/components/location'\nimport { createCompoundContext } from '@/components/Base'\n\n//Interface for context passed down to component slots\ntype ProfileContextType = {\n companyLocations: Location[]\n workAddresses?: EmployeeWorkAddress[]\n employee?: Employee\n isSelfOnboardingIntended?: boolean\n isPending: boolean\n isAdmin: boolean\n handleCancel: () => void\n isSelfOnboardingEnabled: boolean\n hasCompletedSelfOnboarding: boolean\n}\n\nconst [useProfile, ProfileProvider] = createCompoundContext<ProfileContextType>('ProfileContext')\nexport { useProfile, ProfileProvider }\n"],"names":["useProfile","ProfileProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AAkBA,MAAM,CAACA,GAAYC,CAAe,IAAIC,EAA0C,gBAAgB;"}
@@ -1,15 +1,16 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { useTranslation as e } from "react-i18next";
3
- import { useStateTaxes as r } from "./useStateTaxes.js";
2
+ import { useTranslation as r } from "react-i18next";
3
+ import { useStateTaxes as e } from "./useStateTaxes.js";
4
4
  import "../../../shared/constants.js";
5
+ import "classnames";
5
6
  import { ActionsLayout as m } from "../../Common/ActionsLayout/ActionsLayout.js";
6
7
  import { useComponentContext as s } from "../../../contexts/ComponentAdapter/useComponentContext.js";
7
8
  import "react";
8
- function l() {
9
- const { t: o } = e("Employee.StateTaxes"), { isPending: n } = r(), i = s();
9
+ function C() {
10
+ const { t: o } = r("Employee.StateTaxes"), { isPending: n } = e(), i = s();
10
11
  return /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(i.Button, { type: "submit", isLoading: n, children: o("submitCta") }) });
11
12
  }
12
13
  export {
13
- l as Actions
14
+ C as Actions
14
15
  };
15
16
  //# sourceMappingURL=Actions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/StateTaxes/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxes } from './useStateTaxes'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Employee.StateTaxes')\n const { isPending } = useStateTaxes()\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","useStateTaxes","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,WAAAC,EAAA,IAAcC,EAAA,GAChBC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAAF,EAAE,WAAW,GAChB,GACF;AAEJ;"}
1
+ {"version":3,"file":"Actions.js","sources":["../../../../src/components/Employee/StateTaxes/Actions.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useStateTaxes } from './useStateTaxes'\nimport { ActionsLayout } from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\n\nexport function Actions() {\n const { t } = useTranslation('Employee.StateTaxes')\n const { isPending } = useStateTaxes()\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","useStateTaxes","Components","useComponentContext","jsx","ActionsLayout"],"mappings":";;;;;;;;AAKO,SAASA,IAAU;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qBAAqB,GAC5C,EAAE,WAAAC,EAAA,IAAcC,EAAA,GAChBC,IAAaC,EAAA;AAEnB,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACF,EAAW,QAAX,EAAkB,MAAK,UAAS,WAAWF,GACzC,UAAAF,EAAE,WAAW,GAChB,GACF;AAEJ;"}
@@ -7,36 +7,36 @@ import { useEmployeeTaxSetupUpdateStateTaxesMutation as M } from "@gusto/embedde
7
7
  import { StateFormSchema as O, StateForm as I } from "./StateForm.js";
8
8
  import { Actions as V } from "./Actions.js";
9
9
  import { StateTaxesProvider as X } from "./useStateTaxes.js";
10
- import { BaseComponent as B } from "../../Base/Base.js";
11
- import { useBase as H } from "../../Base/useBase.js";
12
- import { useI18n as Y, useComponentDictionary as j } from "../../../i18n/I18n.js";
13
- import { componentEvents as v } from "../../../shared/constants.js";
14
- import { Form as q } from "../../Common/Form/Form.js";
15
- import { snakeCaseToCamelCase as x } from "../../../helpers/formattedStrings.js";
16
- const z = "2010-01-01";
17
- function ue(i) {
18
- return /* @__PURE__ */ o(B, { ...i, children: /* @__PURE__ */ o(G, { ...i }) });
10
+ import { BaseComponent as z } from "../../Base/Base.js";
11
+ import { useBase as B } from "../../Base/useBase.js";
12
+ import { useI18n as H, useComponentDictionary as K } from "../../../i18n/I18n.js";
13
+ import { componentEvents as x } from "../../../shared/constants.js";
14
+ import { Form as Y } from "../../Common/Form/Form.js";
15
+ import { snakeCaseToCamelCase as v, normalizeErrorKeyForForm as j } from "../../../helpers/formattedStrings.js";
16
+ const q = "2010-01-01";
17
+ function pe(i) {
18
+ return /* @__PURE__ */ o(z, { ...i, children: /* @__PURE__ */ o(G, { ...i }) });
19
19
  }
20
20
  const G = (i) => {
21
- const { employeeId: f, className: h, children: d, isAdmin: y = !1, dictionary: A } = i, { onEvent: S, fieldErrors: l, baseSubmitHandler: F } = H();
22
- Y("Employee.StateTaxes"), j("Employee.StateTaxes", A);
21
+ const { employeeId: c, className: h, children: d, isAdmin: y = !1, dictionary: F } = i, { onEvent: E, fieldErrors: l, baseSubmitHandler: A } = B();
22
+ H("Employee.StateTaxes"), K("Employee.StateTaxes", F);
23
23
  const { data: _ } = L({
24
- employeeUuid: f
24
+ employeeUuid: c
25
25
  }), p = _.employeeStateTaxesList, { mutateAsync: k, isPending: w } = M(), U = {
26
26
  states: p.reduce((t, s) => (s.state && (t[s.state] = s.questions?.reduce((e, n) => {
27
- const m = n.answers[0]?.value, r = x(n.key);
27
+ const m = n.answers[0]?.value, r = v(n.key);
28
28
  return r === "fileNewHireReport" ? e[r] = typeof m > "u" ? !0 : m : e[r] = m, e;
29
29
  }, {})), t), {})
30
- }, T = N({
30
+ }, S = N({
31
31
  resolver: g(O),
32
32
  defaultValues: U
33
- }), { handleSubmit: D, setError: E } = T;
33
+ }), { handleSubmit: D, setError: T } = S;
34
34
  return C(() => {
35
35
  l && l.length > 0 && l.forEach((t) => {
36
- const s = t.errorKey.replace(".value", ""), e = typeof t.message == "string" ? t.message : "Unknown error";
37
- E(s, { type: "custom", message: e });
36
+ const s = j(t.errorKey), e = typeof t.message == "string" ? t.message : "Unknown error";
37
+ T(s, { type: "custom", message: e });
38
38
  });
39
- }, [l, E]), /* @__PURE__ */ o("section", { className: h, children: /* @__PURE__ */ o(
39
+ }, [l, T]), /* @__PURE__ */ o("section", { className: h, children: /* @__PURE__ */ o(
40
40
  X,
41
41
  {
42
42
  value: {
@@ -44,24 +44,24 @@ const G = (i) => {
44
44
  isAdmin: y,
45
45
  isPending: w
46
46
  },
47
- children: /* @__PURE__ */ o(R, { ...T, children: /* @__PURE__ */ o(q, { onSubmit: D(async (t) => {
48
- await F(t, async (s) => {
47
+ children: /* @__PURE__ */ o(R, { ...S, children: /* @__PURE__ */ o(Y, { onSubmit: D(async (t) => {
48
+ await A(t, async (s) => {
49
49
  const { states: e } = s;
50
50
  if (e && Object.keys(e).length > 0) {
51
51
  const n = [];
52
52
  for (const r of p) {
53
- const c = r.state;
54
- c && r.questions !== void 0 && n.push({
55
- state: c,
53
+ const f = r.state;
54
+ f && r.questions !== void 0 && n.push({
55
+ state: f,
56
56
  questions: r.questions.map((a) => {
57
57
  if (a.isQuestionForAdminOnly && !y)
58
58
  return null;
59
- const u = e[c]?.[x(a.key)];
59
+ const u = e[f]?.[v(a.key)];
60
60
  return {
61
61
  key: a.key,
62
62
  answers: [
63
63
  {
64
- validFrom: a.answers[0]?.validFrom ?? z,
64
+ validFrom: a.answers[0]?.validFrom ?? q,
65
65
  validUpTo: a.answers[0]?.validUpTo ?? null,
66
66
  value: u == null || typeof u == "number" && isNaN(u) ? "" : u
67
67
  }
@@ -71,11 +71,11 @@ const G = (i) => {
71
71
  });
72
72
  }
73
73
  const m = await k({
74
- request: { employeeUuid: f, employeeStateTaxesRequest: { states: n } }
74
+ request: { employeeUuid: c, employeeStateTaxesRequest: { states: n } }
75
75
  });
76
- S(v.EMPLOYEE_STATE_TAXES_UPDATED, m);
76
+ E(x.EMPLOYEE_STATE_TAXES_UPDATED, m);
77
77
  }
78
- S(v.EMPLOYEE_STATE_TAXES_DONE);
78
+ E(x.EMPLOYEE_STATE_TAXES_DONE);
79
79
  });
80
80
  }), children: d || /* @__PURE__ */ P(b, { children: [
81
81
  /* @__PURE__ */ o(I, {}),
@@ -85,6 +85,6 @@ const G = (i) => {
85
85
  ) });
86
86
  };
87
87
  export {
88
- ue as StateTaxes
88
+ pe as StateTaxes
89
89
  };
90
90
  //# sourceMappingURL=StateTaxes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StateTaxes.js","sources":["../../../../src/components/Employee/StateTaxes/StateTaxes.tsx"],"sourcesContent":["import { zodResolver } from '@hookform/resolvers/zod'\nimport { FormProvider, useForm, type SubmitHandler } from 'react-hook-form'\nimport { useEffect } from 'react'\nimport { useEmployeeTaxSetupGetStateTaxesSuspense } from '@gusto/embedded-api/react-query/employeeTaxSetupGetStateTaxes'\nimport { useEmployeeTaxSetupUpdateStateTaxesMutation } from '@gusto/embedded-api/react-query/employeeTaxSetupUpdateStateTaxes'\nimport { StateForm } from './StateForm'\nimport { StateFormSchema, type StateFormPayload } from './StateForm'\nimport { Actions } from './Actions'\nimport { StateTaxesProvider } from './useStateTaxes'\nimport {\n useBase,\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { snakeCaseToCamelCase } from '@/helpers/formattedStrings'\n\nconst DEFAULT_TAX_VALID_FROM = '2010-01-01'\n\ninterface StateTaxesProps extends CommonComponentInterface<'Employee.StateTaxes'> {\n employeeId: string\n isAdmin?: boolean\n}\n\nexport function StateTaxes(props: StateTaxesProps & BaseComponentInterface) {\n return (\n <BaseComponent<'Employee.StateTaxes'> {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nconst Root = (props: StateTaxesProps) => {\n const { employeeId, className, children, isAdmin = false, dictionary } = props\n const { onEvent, fieldErrors, baseSubmitHandler } = useBase()\n useI18n('Employee.StateTaxes')\n useComponentDictionary('Employee.StateTaxes', dictionary)\n\n const { data: stateData } = useEmployeeTaxSetupGetStateTaxesSuspense({\n employeeUuid: employeeId,\n })\n const employeeStateTaxes = stateData.employeeStateTaxesList!\n const { mutateAsync: updateStateTaxes, isPending } = useEmployeeTaxSetupUpdateStateTaxesMutation()\n\n const defaultValues = {\n states: employeeStateTaxes.reduce((acc: Record<string, unknown>, state) => {\n if (state.state) {\n acc[state.state] = state.questions?.reduce((acc: Record<string, unknown>, question) => {\n const value = question.answers[0]?.value\n const key = snakeCaseToCamelCase(question.key)\n // Default new hire report to true if not specified\n if (key === 'fileNewHireReport') {\n acc[key] = typeof value === 'undefined' ? true : value\n } else {\n acc[key] = value\n }\n return acc\n }, {})\n }\n return acc\n }, {}),\n }\n\n const formMethods = useForm<Record<string, unknown>, unknown, StateFormPayload>({\n resolver: zodResolver(StateFormSchema),\n defaultValues,\n })\n const { handleSubmit, setError: _setError } = formMethods\n\n useEffect(() => {\n if (fieldErrors && fieldErrors.length > 0) {\n fieldErrors.forEach(msgObject => {\n const key = msgObject.errorKey.replace('.value', '')\n const message = typeof msgObject.message === 'string' ? msgObject.message : 'Unknown error'\n _setError(key, { type: 'custom', message })\n })\n }\n }, [fieldErrors, _setError])\n\n const onSubmit: SubmitHandler<StateFormPayload> = async data => {\n await baseSubmitHandler(data, async payload => {\n const { states: statesPayload } = payload\n\n if (statesPayload && Object.keys(statesPayload).length > 0) {\n const states = []\n\n for (const state of employeeStateTaxes) {\n const stateName = state.state\n\n if (stateName && state.questions !== undefined) {\n states.push({\n state: stateName,\n questions: state.questions\n .map(question => {\n if (question.isQuestionForAdminOnly && !isAdmin) {\n return null\n }\n const formValue = statesPayload[stateName]?.[snakeCaseToCamelCase(question.key)]\n return {\n key: question.key,\n answers: [\n {\n validFrom: question.answers[0]?.validFrom ?? DEFAULT_TAX_VALID_FROM,\n validUpTo: question.answers[0]?.validUpTo ?? null,\n value:\n formValue == null || (typeof formValue === 'number' && isNaN(formValue))\n ? ''\n : (formValue as string | number | boolean),\n },\n ],\n }\n })\n .filter(q => q !== null),\n })\n }\n }\n\n const stateTaxesResponse = await updateStateTaxes({\n request: { employeeUuid: employeeId, employeeStateTaxesRequest: { states } },\n })\n onEvent(componentEvents.EMPLOYEE_STATE_TAXES_UPDATED, stateTaxesResponse)\n }\n\n onEvent(componentEvents.EMPLOYEE_STATE_TAXES_DONE)\n })\n }\n\n return (\n <section className={className}>\n <StateTaxesProvider\n value={{\n employeeStateTaxes,\n isAdmin: isAdmin,\n isPending,\n }}\n >\n <FormProvider {...formMethods}>\n <Form onSubmit={handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <>\n <StateForm />\n <Actions />\n </>\n )}\n </Form>\n </FormProvider>\n </StateTaxesProvider>\n </section>\n )\n}\n"],"names":["DEFAULT_TAX_VALID_FROM","StateTaxes","props","jsx","BaseComponent","Root","employeeId","className","children","isAdmin","dictionary","onEvent","fieldErrors","baseSubmitHandler","useBase","useI18n","useComponentDictionary","stateData","useEmployeeTaxSetupGetStateTaxesSuspense","employeeStateTaxes","updateStateTaxes","isPending","useEmployeeTaxSetupUpdateStateTaxesMutation","defaultValues","acc","state","question","value","key","snakeCaseToCamelCase","formMethods","useForm","zodResolver","StateFormSchema","handleSubmit","_setError","useEffect","msgObject","message","StateTaxesProvider","FormProvider","Form","data","payload","statesPayload","states","stateName","formValue","q","stateTaxesResponse","componentEvents","jsxs","Fragment","StateForm","Actions"],"mappings":";;;;;;;;;;;;;;;AAqBA,MAAMA,IAAyB;AAOxB,SAASC,GAAWC,GAAiD;AAC1E,SACE,gBAAAC,EAACC,KAAsC,GAAGF,GACxC,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,MAAMG,IAAO,CAACH,MAA2B;AACvC,QAAM,EAAE,YAAAI,GAAY,WAAAC,GAAW,UAAAC,GAAU,SAAAC,IAAU,IAAO,YAAAC,MAAeR,GACnE,EAAE,SAAAS,GAAS,aAAAC,GAAa,mBAAAC,EAAA,IAAsBC,EAAA;AACpD,EAAAC,EAAQ,qBAAqB,GAC7BC,EAAuB,uBAAuBN,CAAU;AAExD,QAAM,EAAE,MAAMO,EAAA,IAAcC,EAAyC;AAAA,IACnE,cAAcZ;AAAA,EAAA,CACf,GACKa,IAAqBF,EAAU,wBAC/B,EAAE,aAAaG,GAAkB,WAAAC,EAAA,IAAcC,EAAA,GAE/CC,IAAgB;AAAA,IACpB,QAAQJ,EAAmB,OAAO,CAACK,GAA8BC,OAC3DA,EAAM,UACRD,EAAIC,EAAM,KAAK,IAAIA,EAAM,WAAW,OAAO,CAACD,GAA8BE,MAAa;AACrF,YAAMC,IAAQD,EAAS,QAAQ,CAAC,GAAG,OAC7BE,IAAMC,EAAqBH,EAAS,GAAG;AAE7C,aAAIE,MAAQ,sBACVJ,EAAII,CAAG,IAAI,OAAOD,IAAU,MAAc,KAAOA,IAEjDH,EAAII,CAAG,IAAID,GAENH;AAAAA,IACT,GAAG,CAAA,CAAE,IAEAA,IACN,CAAA,CAAE;AAAA,EAAA,GAGDM,IAAcC,EAA4D;AAAA,IAC9E,UAAUC,EAAYC,CAAe;AAAA,IACrC,eAAAV;AAAA,EAAA,CACD,GACK,EAAE,cAAAW,GAAc,UAAUC,EAAA,IAAcL;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W0B,EAAS,QAAQ,CAAC,GAAG,aAAa;AAAA,wBAC7C,OACEqB,KAAa,QAAS,OAAOA,KAAc,YAAY,MAAMA,CAAS,IAClE,KACCA;AAAA,sBAAA;AAAA,oBACT;AAAA,kBACF;AAAA,gBAEJ,CAAC,EACA,OAAO,CAAAC,MAAKA,MAAM,IAAI;AAAA,cAAA,CAC1B;AAAA,YAEL;AAEA,kBAAMC,IAAqB,MAAM7B,EAAiB;AAAA,cAChD,SAAS,EAAE,cAAcd,GAAY,2BAA2B,EAAE,QAAAuC,IAAO;AAAA,YAAE,CAC5E;AACD,YAAAlC,EAAQuC,EAAgB,8BAA8BD,CAAkB;AAAA,UAC1E;AAEA,UAAAtC,EAAQuC,EAAgB,yBAAyB;AAAA,QACnD,CAAC;AAAA,MACH,CAY6C,GAClC,UAAA1C,KAGC,gBAAA2C,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAjD,EAACkD,GAAA,EAAU;AAAA,0BACVC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,GAEJ,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"StateTaxes.js","sources":["../../../../src/components/Employee/StateTaxes/StateTaxes.tsx"],"sourcesContent":["import { zodResolver } from '@hookform/resolvers/zod'\nimport { FormProvider, useForm, type SubmitHandler } from 'react-hook-form'\nimport { useEffect } from 'react'\nimport { useEmployeeTaxSetupGetStateTaxesSuspense } from '@gusto/embedded-api/react-query/employeeTaxSetupGetStateTaxes'\nimport { useEmployeeTaxSetupUpdateStateTaxesMutation } from '@gusto/embedded-api/react-query/employeeTaxSetupUpdateStateTaxes'\nimport { StateForm } from './StateForm'\nimport { StateFormSchema, type StateFormPayload } from './StateForm'\nimport { Actions } from './Actions'\nimport { StateTaxesProvider } from './useStateTaxes'\nimport {\n useBase,\n BaseComponent,\n type BaseComponentInterface,\n type CommonComponentInterface,\n} from '@/components/Base'\nimport { useI18n } from '@/i18n'\nimport { componentEvents } from '@/shared/constants'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentDictionary } from '@/i18n/I18n'\nimport { snakeCaseToCamelCase, normalizeErrorKeyForForm } from '@/helpers/formattedStrings'\n\nconst DEFAULT_TAX_VALID_FROM = '2010-01-01'\n\ninterface StateTaxesProps extends CommonComponentInterface<'Employee.StateTaxes'> {\n employeeId: string\n isAdmin?: boolean\n}\n\nexport function StateTaxes(props: StateTaxesProps & BaseComponentInterface) {\n return (\n <BaseComponent<'Employee.StateTaxes'> {...props}>\n <Root {...props} />\n </BaseComponent>\n )\n}\n\nconst Root = (props: StateTaxesProps) => {\n const { employeeId, className, children, isAdmin = false, dictionary } = props\n const { onEvent, fieldErrors, baseSubmitHandler } = useBase()\n useI18n('Employee.StateTaxes')\n useComponentDictionary('Employee.StateTaxes', dictionary)\n\n const { data: stateData } = useEmployeeTaxSetupGetStateTaxesSuspense({\n employeeUuid: employeeId,\n })\n const employeeStateTaxes = stateData.employeeStateTaxesList!\n const { mutateAsync: updateStateTaxes, isPending } = useEmployeeTaxSetupUpdateStateTaxesMutation()\n\n const defaultValues = {\n states: employeeStateTaxes.reduce((acc: Record<string, unknown>, state) => {\n if (state.state) {\n acc[state.state] = state.questions?.reduce((acc: Record<string, unknown>, question) => {\n const value = question.answers[0]?.value\n const key = snakeCaseToCamelCase(question.key)\n // Default new hire report to true if not specified\n if (key === 'fileNewHireReport') {\n acc[key] = typeof value === 'undefined' ? true : value\n } else {\n acc[key] = value\n }\n return acc\n }, {})\n }\n return acc\n }, {}),\n }\n\n const formMethods = useForm<Record<string, unknown>, unknown, StateFormPayload>({\n resolver: zodResolver(StateFormSchema),\n defaultValues,\n })\n const { handleSubmit, setError: _setError } = formMethods\n\n useEffect(() => {\n if (fieldErrors && fieldErrors.length > 0) {\n fieldErrors.forEach(msgObject => {\n const key = normalizeErrorKeyForForm(msgObject.errorKey)\n const message = typeof msgObject.message === 'string' ? msgObject.message : 'Unknown error'\n _setError(key, { type: 'custom', message })\n })\n }\n }, [fieldErrors, _setError])\n\n const onSubmit: SubmitHandler<StateFormPayload> = async data => {\n await baseSubmitHandler(data, async payload => {\n const { states: statesPayload } = payload\n\n if (statesPayload && Object.keys(statesPayload).length > 0) {\n const states = []\n\n for (const state of employeeStateTaxes) {\n const stateName = state.state\n\n if (stateName && state.questions !== undefined) {\n states.push({\n state: stateName,\n questions: state.questions\n .map(question => {\n if (question.isQuestionForAdminOnly && !isAdmin) {\n return null\n }\n const formValue = statesPayload[stateName]?.[snakeCaseToCamelCase(question.key)]\n return {\n key: question.key,\n answers: [\n {\n validFrom: question.answers[0]?.validFrom ?? DEFAULT_TAX_VALID_FROM,\n validUpTo: question.answers[0]?.validUpTo ?? null,\n value:\n formValue == null || (typeof formValue === 'number' && isNaN(formValue))\n ? ''\n : (formValue as string | number | boolean),\n },\n ],\n }\n })\n .filter(q => q !== null),\n })\n }\n }\n\n const stateTaxesResponse = await updateStateTaxes({\n request: { employeeUuid: employeeId, employeeStateTaxesRequest: { states } },\n })\n onEvent(componentEvents.EMPLOYEE_STATE_TAXES_UPDATED, stateTaxesResponse)\n }\n\n onEvent(componentEvents.EMPLOYEE_STATE_TAXES_DONE)\n })\n }\n\n return (\n <section className={className}>\n <StateTaxesProvider\n value={{\n employeeStateTaxes,\n isAdmin: isAdmin,\n isPending,\n }}\n >\n <FormProvider {...formMethods}>\n <Form onSubmit={handleSubmit(onSubmit)}>\n {children ? (\n children\n ) : (\n <>\n <StateForm />\n <Actions />\n </>\n )}\n </Form>\n </FormProvider>\n </StateTaxesProvider>\n </section>\n )\n}\n"],"names":["DEFAULT_TAX_VALID_FROM","StateTaxes","props","jsx","BaseComponent","Root","employeeId","className","children","isAdmin","dictionary","onEvent","fieldErrors","baseSubmitHandler","useBase","useI18n","useComponentDictionary","stateData","useEmployeeTaxSetupGetStateTaxesSuspense","employeeStateTaxes","updateStateTaxes","isPending","useEmployeeTaxSetupUpdateStateTaxesMutation","defaultValues","acc","state","question","value","key","snakeCaseToCamelCase","formMethods","useForm","zodResolver","StateFormSchema","handleSubmit","_setError","useEffect","msgObject","normalizeErrorKeyForForm","message","StateTaxesProvider","FormProvider","Form","data","payload","statesPayload","states","stateName","formValue","q","stateTaxesResponse","componentEvents","jsxs","Fragment","StateForm","Actions"],"mappings":";;;;;;;;;;;;;;;AAqBA,MAAMA,IAAyB;AAOxB,SAASC,GAAWC,GAAiD;AAC1E,SACE,gBAAAC,EAACC,KAAsC,GAAGF,GACxC,4BAACG,GAAA,EAAM,GAAGH,GAAO,EAAA,CACnB;AAEJ;AAEA,MAAMG,IAAO,CAACH,MAA2B;AACvC,QAAM,EAAE,YAAAI,GAAY,WAAAC,GAAW,UAAAC,GAAU,SAAAC,IAAU,IAAO,YAAAC,MAAeR,GACnE,EAAE,SAAAS,GAAS,aAAAC,GAAa,mBAAAC,EAAA,IAAsBC,EAAA;AACpD,EAAAC,EAAQ,qBAAqB,GAC7BC,EAAuB,uBAAuBN,CAAU;AAExD,QAAM,EAAE,MAAMO,EAAA,IAAcC,EAAyC;AAAA,IACnE,cAAcZ;AAAA,EAAA,CACf,GACKa,IAAqBF,EAAU,wBAC/B,EAAE,aAAaG,GAAkB,WAAAC,EAAA,IAAcC,EAAA,GAE/CC,IAAgB;AAAA,IACpB,QAAQJ,EAAmB,OAAO,CAACK,GAA8BC,OAC3DA,EAAM,UACRD,EAAIC,EAAM,KAAK,IAAIA,EAAM,WAAW,OAAO,CAACD,GAA8BE,MAAa;AACrF,YAAMC,IAAQD,EAAS,QAAQ,CAAC,GAAG,OAC7BE,IAAMC,EAAqBH,EAAS,GAAG;AAE7C,aAAIE,MAAQ,sBACVJ,EAAII,CAAG,IAAI,OAAOD,IAAU,MAAc,KAAOA,IAEjDH,EAAII,CAAG,IAAID,GAENH;AAAAA,IACT,GAAG,CAAA,CAAE,IAEAA,IACN,CAAA,CAAE;AAAA,EAAA,GAGDM,IAAcC,EAA4D;AAAA,IAC9E,UAAUC,EAAYC,CAAe;AAAA,IACrC,eAAA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EAAS,QAAQ,CAAC,GAAG,aAAa1B;AAAA,wBAC7C,WAAW0B,EAAS,QAAQ,CAAC,GAAG,aAAa;AAAA,wBAC7C,OACEsB,KAAa,QAAS,OAAOA,KAAc,YAAY,MAAMA,CAAS,IAClE,KACCA;AAAA,sBAAA;AAAA,oBACT;AAAA,kBACF;AAAA,gBAEJ,CAAC,EACA,OAAO,CAAAC,MAAKA,MAAM,IAAI;AAAA,cAAA,CAC1B;AAAA,YAEL;AAEA,kBAAMC,IAAqB,MAAM9B,EAAiB;AAAA,cAChD,SAAS,EAAE,cAAcd,GAAY,2BAA2B,EAAE,QAAAwC,IAAO;AAAA,YAAE,CAC5E;AACD,YAAAnC,EAAQwC,EAAgB,8BAA8BD,CAAkB;AAAA,UAC1E;AAEA,UAAAvC,EAAQwC,EAAgB,yBAAyB;AAAA,QACnD,CAAC;AAAA,MACH,CAY6C,GAClC,UAAA3C,KAGC,gBAAA4C,EAAAC,GAAA,EACE,UAAA;AAAA,QAAA,gBAAAlD,EAACmD,GAAA,EAAU;AAAA,0BACVC,GAAA,CAAA,CAAQ;AAAA,MAAA,EAAA,CACX,GAEJ,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
@@ -2,19 +2,20 @@ import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "react-error-boundary";
4
4
  import "react-i18next";
5
- import "@gusto/embedded-api/models/errors/apierror";
5
+ import "@gusto/embedded-api/models/errors/gustoembeddederror";
6
6
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
7
7
  import "@tanstack/react-query";
8
8
  import "../../Base/useBase.js";
9
9
  import "../../../shared/constants.js";
10
+ import "classnames";
10
11
  import "../../../contexts/ComponentAdapter/useComponentContext.js";
11
12
  import "../../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
12
13
  import "dompurify";
13
14
  import "../../../contexts/LocaleProvider/useLocale.js";
14
15
  import { createCompoundContext as t } from "../../Base/createCompoundContext.js";
15
- const [d, u] = t("StateTaxesContext");
16
+ const [u, f] = t("StateTaxesContext");
16
17
  export {
17
- u as StateTaxesProvider,
18
- d as useStateTaxes
18
+ f as StateTaxesProvider,
19
+ u as useStateTaxes
19
20
  };
20
21
  //# sourceMappingURL=useStateTaxes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useStateTaxes.js","sources":["../../../../src/components/Employee/StateTaxes/useStateTaxes.ts"],"sourcesContent":["import type { EmployeeStateTaxesList } from '@gusto/embedded-api/models/components/employeestatetaxeslist'\nimport { createCompoundContext } from '@/components/Base'\n\ntype StateTaxesContextType = {\n employeeStateTaxes: EmployeeStateTaxesList[]\n isPending: boolean\n isAdmin: boolean\n}\n\nconst [useStateTaxes, StateTaxesProvider] =\n createCompoundContext<StateTaxesContextType>('StateTaxesContext')\nexport { useStateTaxes, StateTaxesProvider }\n"],"names":["useStateTaxes","StateTaxesProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;AASA,MAAM,CAACA,GAAeC,CAAkB,IACtCC,EAA6C,mBAAmB;"}
1
+ {"version":3,"file":"useStateTaxes.js","sources":["../../../../src/components/Employee/StateTaxes/useStateTaxes.ts"],"sourcesContent":["import type { EmployeeStateTaxesList } from '@gusto/embedded-api/models/components/employeestatetaxeslist'\nimport { createCompoundContext } from '@/components/Base'\n\ntype StateTaxesContextType = {\n employeeStateTaxes: EmployeeStateTaxesList[]\n isPending: boolean\n isAdmin: boolean\n}\n\nconst [useStateTaxes, StateTaxesProvider] =\n createCompoundContext<StateTaxesContextType>('StateTaxesContext')\nexport { useStateTaxes, StateTaxesProvider }\n"],"names":["useStateTaxes","StateTaxesProvider","createCompoundContext"],"mappings":";;;;;;;;;;;;;;;AASA,MAAM,CAACA,GAAeC,CAAkB,IACtCC,EAA6C,mBAAmB;"}