@gusto/embedded-react-sdk 0.20.0 → 0.21.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 (390) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/UNSTABLE_Hooks.d.ts +1 -0
  3. package/dist/UNSTABLE_Hooks.js +9 -0
  4. package/dist/UNSTABLE_Hooks.js.map +1 -0
  5. package/dist/assets/icons/coins-hand.svg.js +10 -0
  6. package/dist/assets/icons/coins-hand.svg.js.map +1 -0
  7. package/dist/components/Base/Base.d.ts +19 -4
  8. package/dist/components/Base/Base.js +67 -61
  9. package/dist/components/Base/Base.js.map +1 -1
  10. package/dist/components/Base/useBase.d.ts +1 -1
  11. package/dist/components/Base/useBase.js.map +1 -1
  12. package/dist/components/Base/useBaseSubmit.d.ts +10 -0
  13. package/dist/components/Base/useBaseSubmit.js +33 -0
  14. package/dist/components/Base/useBaseSubmit.js.map +1 -0
  15. package/dist/components/Common/Fields/TextAreaField/TextAreaField.d.ts +5 -0
  16. package/dist/components/Common/Fields/TextAreaField/TextAreaField.js +34 -0
  17. package/dist/components/Common/Fields/TextAreaField/TextAreaField.js.map +1 -0
  18. package/dist/components/Common/Fields/TextAreaField/index.d.ts +3 -0
  19. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js +10 -10
  20. package/dist/components/Common/FlowBreadcrumbs/FlowBreadcrumbs.js.map +1 -1
  21. package/dist/components/Common/SignatureForm/SignatureForm.js +14 -11
  22. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  23. package/dist/components/Common/SignatureForm/SignatureFormActions.js +9 -7
  24. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  25. package/dist/components/Common/SignatureForm/SignatureFormFields.js +15 -12
  26. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  27. package/dist/components/Common/UI/Alert/Alert.js +23 -22
  28. package/dist/components/Common/UI/Alert/Alert.js.map +1 -1
  29. package/dist/components/Common/UI/Alert/AlertTypes.d.ts +4 -0
  30. package/dist/components/Common/UI/Alert/AlertTypes.js.map +1 -1
  31. package/dist/components/Common/UI/DatePicker/DatePicker.d.ts +1 -1
  32. package/dist/components/Common/UI/DatePicker/DatePicker.js +38 -37
  33. package/dist/components/Common/UI/DatePicker/DatePicker.js.map +1 -1
  34. package/dist/components/Common/UI/DatePicker/DatePickerTypes.d.ts +4 -0
  35. package/dist/components/Common/UI/Modal/Modal.module.scss.js +17 -17
  36. package/dist/components/Common/UI/Select/Select.d.ts +1 -1
  37. package/dist/components/Common/UI/Select/Select.js +27 -26
  38. package/dist/components/Common/UI/Select/Select.js.map +1 -1
  39. package/dist/components/Common/UI/Select/SelectTypes.d.ts +4 -0
  40. package/dist/components/Common/UI/TextArea/TextArea.d.ts +2 -0
  41. package/dist/components/Common/UI/TextArea/TextArea.js +79 -0
  42. package/dist/components/Common/UI/TextArea/TextArea.js.map +1 -0
  43. package/dist/components/Common/UI/TextArea/TextArea.module.scss.js +12 -0
  44. package/dist/components/Common/UI/TextArea/TextArea.module.scss.js.map +1 -0
  45. package/dist/components/Common/UI/TextArea/TextAreaTypes.d.ts +37 -0
  46. package/dist/components/Common/UI/TextArea/TextAreaTypes.js +9 -0
  47. package/dist/components/Common/UI/TextArea/TextAreaTypes.js.map +1 -0
  48. package/dist/components/Common/UI/TextArea/index.d.ts +4 -0
  49. package/dist/components/Company/AssignSignatory/AssignSignatory.js +8 -6
  50. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  51. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +5 -2
  52. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  53. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +4 -2
  54. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  55. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js +9 -7
  56. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatory.js.map +1 -1
  57. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +12 -12
  58. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -4
  59. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  60. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +4 -2
  61. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  62. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js +12 -10
  63. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatory.js.map +1 -1
  64. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +6 -6
  65. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -4
  66. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  67. package/dist/components/Company/AssignSignatory/TitleSelect.js +6 -4
  68. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  69. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -6
  70. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  71. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +10 -9
  72. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  73. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +11 -8
  74. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  75. package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -4
  76. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  77. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +10 -8
  78. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  79. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +10 -8
  80. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  81. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +7 -4
  82. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  83. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +4 -2
  84. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  85. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +11 -9
  86. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  87. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -4
  88. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  89. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +10 -8
  90. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  91. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +5 -4
  92. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  93. package/dist/components/Company/FederalTaxes/Actions.js +9 -7
  94. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  95. package/dist/components/Company/FederalTaxes/FederalTaxes.js +5 -3
  96. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  97. package/dist/components/Company/FederalTaxes/Form.js +7 -6
  98. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  99. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +7 -6
  100. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  101. package/dist/components/Company/Industry/Actions.js +9 -7
  102. package/dist/components/Company/Industry/Actions.js.map +1 -1
  103. package/dist/components/Company/Industry/Context.js +8 -7
  104. package/dist/components/Company/Industry/Context.js.map +1 -1
  105. package/dist/components/Company/Industry/Edit.js +7 -4
  106. package/dist/components/Company/Industry/Edit.js.map +1 -1
  107. package/dist/components/Company/Locations/LocationForm/Actions.js +10 -8
  108. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  109. package/dist/components/Company/Locations/LocationForm/Form.js +7 -6
  110. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  111. package/dist/components/Company/Locations/LocationForm/LocationForm.js +12 -10
  112. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  113. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -4
  114. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  115. package/dist/components/Company/Locations/LocationsList/Actions.js +8 -6
  116. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  117. package/dist/components/Company/Locations/LocationsList/List.js +16 -15
  118. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  119. package/dist/components/Company/Locations/LocationsList/LocationsList.js +4 -3
  120. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  121. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -4
  122. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  123. package/dist/components/Company/OnboardingOverview/Completed.js +12 -10
  124. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  125. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +11 -9
  126. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  127. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +9 -7
  128. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  129. package/dist/components/Company/OnboardingOverview/context.js +5 -4
  130. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  131. package/dist/components/Company/PaySchedule/PaySchedule.js +5 -4
  132. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  133. package/dist/components/Company/PaySchedule/_parts/Actions.js +11 -9
  134. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  135. package/dist/components/Company/PaySchedule/_parts/Edit.js +23 -24
  136. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  137. package/dist/components/Company/PaySchedule/_parts/Head.js +13 -11
  138. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  139. package/dist/components/Company/PaySchedule/_parts/List.js +18 -17
  140. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  141. package/dist/components/Company/PaySchedule/usePaySchedule.js +7 -6
  142. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  143. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +4 -2
  144. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  145. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -4
  146. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  147. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +4 -2
  148. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  149. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +4 -2
  150. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  151. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -4
  152. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  153. package/dist/components/Contractor/Address/Address.js +7 -5
  154. package/dist/components/Contractor/Address/Address.js.map +1 -1
  155. package/dist/components/Contractor/Address/Form.js +8 -7
  156. package/dist/components/Contractor/Address/Form.js.map +1 -1
  157. package/dist/components/Contractor/Address/useAddress.js +7 -6
  158. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  159. package/dist/components/Contractor/ContractorList/index.js +15 -15
  160. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +13 -10
  161. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  162. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +5 -3
  163. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  164. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.d.ts +15 -0
  165. package/dist/components/Contractor/Payments/Detail/DetailPresentation.d.ts +19 -0
  166. package/dist/components/Contractor/Payments/Overview/OverviewPresentation.d.ts +18 -0
  167. package/dist/components/Contractor/Payments/PaymentEdit/PaymentEditPresentation.d.ts +6 -0
  168. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.d.ts +18 -0
  169. package/dist/components/Contractor/Payments/types.d.ts +4 -0
  170. package/dist/components/Contractor/Profile/ContractorProfileForm.js +13 -13
  171. package/dist/components/Contractor/Profile/useContractorProfile.js +1 -1
  172. package/dist/components/Contractor/Submit/Submit.js +21 -20
  173. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  174. package/dist/components/Employee/Compensation/Actions.js +14 -13
  175. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  176. package/dist/components/Employee/Compensation/Edit.js +14 -14
  177. package/dist/components/Employee/Compensation/List.js +23 -22
  178. package/dist/components/Employee/Compensation/List.js.map +1 -1
  179. package/dist/components/Employee/Deductions/Deductions.d.ts +1 -1
  180. package/dist/components/Employee/Deductions/Deductions.js +10 -10
  181. package/dist/components/Employee/Deductions/Deductions.js.map +1 -1
  182. package/dist/components/Employee/Deductions/DeductionsComponents.d.ts +2 -0
  183. package/dist/components/Employee/Deductions/DeductionsComponents.js +6 -6
  184. package/dist/components/Employee/Deductions/DeductionsComponents.js.map +1 -1
  185. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +222 -0
  186. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -0
  187. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js +8 -0
  188. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.module.scss.js.map +1 -0
  189. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.d.ts +2 -2
  190. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +165 -0
  191. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -0
  192. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.d.ts +0 -34
  193. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js +90 -127
  194. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.js.map +1 -1
  195. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js +14 -0
  196. package/dist/components/Employee/Deductions/DeductionsForm/DeductionsForm.module.scss.js.map +1 -0
  197. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +55 -55
  198. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
  199. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.d.ts +6 -0
  200. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +53 -0
  201. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -0
  202. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js +14 -0
  203. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.module.scss.js.map +1 -0
  204. package/dist/components/Employee/Deductions/stateMachine.js +49 -29
  205. package/dist/components/Employee/Deductions/stateMachine.js.map +1 -1
  206. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +8 -6
  207. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  208. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +5 -3
  209. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  210. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +5 -2
  211. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  212. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +5 -4
  213. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  214. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +5 -3
  215. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  216. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +5 -4
  217. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  218. package/dist/components/Employee/EmployeeList/Actions.js +8 -6
  219. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  220. package/dist/components/Employee/EmployeeList/EmployeeList.js +6 -3
  221. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  222. package/dist/components/Employee/EmployeeList/Head.js +7 -5
  223. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  224. package/dist/components/Employee/EmployeeList/List.js +14 -14
  225. package/dist/components/Employee/EmployeeList/useEmployeeList.js +5 -4
  226. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  227. package/dist/components/Employee/FederalTaxes/Actions.js +9 -7
  228. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  229. package/dist/components/Employee/FederalTaxes/FederalForm.js +13 -11
  230. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  231. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +5 -4
  232. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  233. package/dist/components/Employee/Landing/Landing.js +11 -10
  234. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  235. package/dist/components/Employee/OnboardingSummary/OnboardingSummary.js +7 -7
  236. package/dist/components/Employee/PaymentMethod/Actions.js +8 -6
  237. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  238. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +6 -4
  239. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  240. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +12 -11
  241. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  242. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +8 -6
  243. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  244. package/dist/components/Employee/PaymentMethod/Split.js +8 -8
  245. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +7 -6
  246. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  247. package/dist/components/Employee/Profile/Actions.js +9 -7
  248. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  249. package/dist/components/Employee/Profile/AdminPersonalDetails.js +10 -8
  250. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  251. package/dist/components/Employee/Profile/HomeAddress.js +2 -2
  252. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +26 -24
  253. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  254. package/dist/components/Employee/Profile/useProfile.js +5 -4
  255. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  256. package/dist/components/Employee/StateTaxes/Actions.js +10 -8
  257. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  258. package/dist/components/Employee/StateTaxes/useStateTaxes.js +5 -4
  259. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  260. package/dist/components/Employee/Taxes/Actions.js +10 -8
  261. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  262. package/dist/components/Employee/Taxes/FederalForm.js +14 -12
  263. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  264. package/dist/components/Employee/Taxes/useTaxes.js +5 -4
  265. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  266. package/dist/components/Flow/Flow.js +23 -21
  267. package/dist/components/Flow/Flow.js.map +1 -1
  268. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.d.ts +1 -1
  269. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js +58 -36
  270. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetails.js.map +1 -1
  271. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.d.ts +2 -0
  272. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js +71 -54
  273. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
  274. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.d.ts +23 -0
  275. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.js +27 -15
  276. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsComponents.js.map +1 -1
  277. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.d.ts +25 -2
  278. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +153 -23
  279. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
  280. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.module.scss.js +10 -0
  281. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.module.scss.js.map +1 -0
  282. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.d.ts +9 -1
  283. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js +195 -22
  284. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js.map +1 -1
  285. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.module.scss.js +18 -0
  286. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.module.scss.js.map +1 -0
  287. package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.d.ts +10 -2
  288. package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js +39 -25
  289. package/dist/components/Payroll/ConfirmWireDetails/confirmWireDetailsStateMachine.js.map +1 -1
  290. package/dist/components/Payroll/ConfirmWireDetails/index.d.ts +1 -0
  291. package/dist/components/Payroll/ConfirmWireDetails/types.d.ts +5 -0
  292. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +8 -6
  293. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  294. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +8 -6
  295. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  296. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +27 -28
  297. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  298. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +56 -57
  299. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  300. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +9 -8
  301. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  302. package/dist/components/Payroll/PayrollHistory/PayrollHistory.d.ts +0 -12
  303. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +44 -52
  304. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  305. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +9 -6
  306. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +96 -93
  307. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  308. package/dist/components/Payroll/PayrollList/PayrollList.js +58 -59
  309. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  310. package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +4 -6
  311. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +81 -72
  312. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  313. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +8 -8
  314. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.js +4 -2
  315. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchThresholdExceeded.js.map +1 -1
  316. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js +3 -2
  317. package/dist/components/Payroll/PayrollReceipts/PayrollReceiptsPresentation.js.map +1 -1
  318. package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.d.ts +7 -0
  319. package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.js +19 -0
  320. package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.js.map +1 -0
  321. package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.module.scss.js +10 -0
  322. package/dist/components/Payroll/PayrollStatusBadges/PayrollStatusBadges.module.scss.js.map +1 -0
  323. package/dist/components/Payroll/PayrollStatusBadges/index.d.ts +4 -0
  324. package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.d.ts +33 -0
  325. package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js +161 -0
  326. package/dist/components/Payroll/PayrollStatusBadges/payrollStatusConfig.js.map +1 -0
  327. package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.d.ts +3 -0
  328. package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.js +17 -0
  329. package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.js.map +1 -0
  330. package/dist/components/Payroll/PayrollStatusBadges/usePayrollStatusBadges.test.d.ts +1 -0
  331. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.d.ts +6 -0
  332. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js +70 -0
  333. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfiguration.js.map +1 -0
  334. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.d.ts +7 -0
  335. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js +6 -0
  336. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js.map +1 -0
  337. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.d.ts +9 -0
  338. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js +40 -0
  339. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationProvider.js.map +1 -0
  340. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/index.d.ts +5 -0
  341. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.d.ts +2 -0
  342. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js +12 -0
  343. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/usePayrollConfiguration.js.map +1 -0
  344. package/dist/components/Payroll/UNSTABLE_PayrollHooks/index.d.ts +2 -0
  345. package/dist/components/Payroll/helpers.d.ts +0 -5
  346. package/dist/components/Payroll/helpers.js +106 -112
  347. package/dist/components/Payroll/helpers.js.map +1 -1
  348. package/dist/components/Payroll/usePreparedPayrollData.js +8 -7
  349. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  350. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +48 -46
  351. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  352. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  353. package/dist/contexts/ComponentAdapter/useComponentContext.js +3 -3
  354. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  355. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +8 -5
  356. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js.map +1 -1
  357. package/dist/helpers/dateFormatting.d.ts +9 -0
  358. package/dist/helpers/dateFormatting.js +65 -52
  359. package/dist/helpers/dateFormatting.js.map +1 -1
  360. package/dist/helpers/formattedStrings.js +12 -11
  361. package/dist/helpers/formattedStrings.js.map +1 -1
  362. package/dist/i18n/I18n.js +10 -10
  363. package/dist/i18n/I18n.js.map +1 -1
  364. package/dist/i18n/en/ContractorPayment.ContractorPaymentCreatePayment.json.js +32 -0
  365. package/dist/i18n/en/ContractorPayment.ContractorPaymentCreatePayment.json.js.map +1 -0
  366. package/dist/i18n/en/ContractorPayment.ContractorPaymentDetail.json.js +24 -0
  367. package/dist/i18n/en/ContractorPayment.ContractorPaymentDetail.json.js.map +1 -0
  368. package/dist/i18n/en/ContractorPayment.ContractorPaymentOverview.json.js +32 -0
  369. package/dist/i18n/en/ContractorPayment.ContractorPaymentOverview.json.js.map +1 -0
  370. package/dist/i18n/en/ContractorPayment.ContractorPaymentPaymentHistory.json.js +32 -0
  371. package/dist/i18n/en/ContractorPayment.ContractorPaymentPaymentHistory.json.js.map +1 -0
  372. package/dist/i18n/en/Payroll.Common.json.js +8 -0
  373. package/dist/i18n/en/Payroll.Common.json.js.map +1 -0
  374. package/dist/i18n/en/Payroll.ConfirmWireDetailsForm.json.js +25 -5
  375. package/dist/i18n/en/Payroll.ConfirmWireDetailsForm.json.js.map +1 -1
  376. package/dist/i18n/en/Payroll.PayrollList.json.js +14 -16
  377. package/dist/i18n/en/Payroll.PayrollList.json.js.map +1 -1
  378. package/dist/i18n/en/Payroll.WireInstructions.json.js +22 -6
  379. package/dist/i18n/en/Payroll.WireInstructions.json.js.map +1 -1
  380. package/dist/shared/constants.d.ts +6 -0
  381. package/dist/shared/constants.js +15 -12
  382. package/dist/shared/constants.js.map +1 -1
  383. package/dist/style.css +1 -1
  384. package/dist/types/i18next.d.ts +183 -8
  385. package/package.json +11 -7
  386. package/dist/components/Employee/Deductions/DeductionsForm/UNSTABLE_DeductionsForm.d.ts +0 -7
  387. package/dist/components/Employee/Deductions/EmptyState/EmptyState.d.ts +0 -6
  388. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.d.ts +0 -15
  389. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js +0 -49
  390. package/dist/components/Employee/Deductions/IncludeDeductionsForm/IncludeDeductionsForm.js.map +0 -1
@@ -1,9 +1,9 @@
1
- import { useCallback as T } from "react";
2
- import { useTranslation as F } from "react-i18next";
1
+ import { useCallback as F } from "react";
2
+ import { useTranslation as D } from "react-i18next";
3
3
  import { formatPayRate as E } from "../../helpers/formattedStrings.js";
4
4
  import { useLocale as v } from "../../contexts/LocaleProvider/useLocale.js";
5
5
  import { FlsaStatus as M, COMPENSATION_NAME_REIMBURSEMENT as g } from "../../shared/constants.js";
6
- const x = "regular hours", y = (e) => e.jobs?.find((t) => t.primary) || e.jobs?.[0] || null, S = (e) => Math.round(e * 1e6) / 1e6, C = (e) => Math.round(e * 100) / 100, H = (e) => e.toLowerCase() === x, j = {
6
+ const x = "regular hours", y = (t) => t.jobs?.find((e) => e.primary) || t.jobs?.[0] || null, S = (t) => Math.round(t * 1e6) / 1e6, C = (t) => Math.round(t * 100) / 100, H = (t) => t.toLowerCase() === x, j = {
7
7
  Daily: 8,
8
8
  "Every week": 40,
9
9
  "Every other week": 80,
@@ -13,154 +13,154 @@ const x = "regular hours", y = (e) => e.jobs?.find((t) => t.primary) || e.jobs?.
13
13
  Semiannually: 1040,
14
14
  Annually: 2080
15
15
  }, N = ({
16
- employee: e,
17
- t,
16
+ employee: t,
17
+ t: e,
18
18
  locale: r = "en-US"
19
19
  }) => {
20
- if (!e?.jobs)
20
+ if (!t?.jobs)
21
21
  return null;
22
- const n = y(e);
22
+ const n = y(t);
23
23
  if (!n?.compensations)
24
24
  return null;
25
25
  const o = n.compensations[0];
26
26
  if (!o || !o.rate || parseFloat(o.rate) === 0)
27
27
  return null;
28
28
  const s = parseFloat(o.rate), u = o.paymentUnit || "Hour";
29
- return E({ rate: s, paymentUnit: u, t, locale: r });
29
+ return E({ rate: s, paymentUnit: u, t: e, locale: r });
30
30
  }, V = () => {
31
- const { t: e } = F("common"), { locale: t } = v();
32
- return T(
33
- (r) => N({ employee: r, t: e, locale: t }),
34
- [e, t]
31
+ const { t } = D("common"), { locale: e } = v();
32
+ return F(
33
+ (r) => N({ employee: r, t, locale: e }),
34
+ [t, e]
35
35
  );
36
- }, X = (e) => e.hourlyCompensations ? e.hourlyCompensations.filter((t) => t.name?.toLowerCase() === "regular hours").reduce((t, r) => t + parseFloat(r.hours || "0"), 0) : 0;
37
- function Z(e) {
38
- return !e.hourlyCompensations || e.excluded ? 0 : e.hourlyCompensations.filter((t) => Number(t.compensationMultiplier) > 1).reduce((t, r) => t + parseFloat(r.hours || "0"), 0);
36
+ }, X = (t) => t.hourlyCompensations ? t.hourlyCompensations.filter((e) => e.name?.toLowerCase() === "regular hours").reduce((e, r) => e + parseFloat(r.hours || "0"), 0) : 0;
37
+ function Z(t) {
38
+ return !t.hourlyCompensations || t.excluded ? 0 : t.hourlyCompensations.filter((e) => Number(e.compensationMultiplier) > 1).reduce((e, r) => e + parseFloat(r.hours || "0"), 0);
39
39
  }
40
- const L = (e) => e.paidTimeOff ? e.paidTimeOff.reduce((t, r) => t + parseFloat(r.hours || "0"), 0) : 0, O = (e) => e.fixedCompensations ? e.fixedCompensations.filter((t) => {
41
- const r = t.name?.toLowerCase() || "", n = parseFloat(t.amount || "0");
40
+ const L = (t) => t.paidTimeOff ? t.paidTimeOff.reduce((e, r) => e + parseFloat(r.hours || "0"), 0) : 0, O = (t) => t.fixedCompensations ? t.fixedCompensations.filter((e) => {
41
+ const r = e.name?.toLowerCase() || "", n = parseFloat(e.amount || "0");
42
42
  return r !== "reimbursement" && r !== "minimum wage adjustment" && n > 0;
43
- }).reduce((t, r) => t + parseFloat(r.amount || "0"), 0) : 0, ee = (e) => {
44
- if (!e.fixedCompensations)
43
+ }).reduce((e, r) => e + parseFloat(r.amount || "0"), 0) : 0, tt = (t) => {
44
+ if (!t.fixedCompensations)
45
45
  return 0;
46
- const t = e.fixedCompensations.find(
46
+ const e = t.fixedCompensations.find(
47
47
  (r) => r.name?.toLowerCase() === "reimbursement"
48
48
  );
49
- return t ? parseFloat(t.amount || "0") : 0;
50
- }, te = (e) => {
51
- const t = C(e);
52
- return t % 1 === 0 ? `${t}.0` : t.toString();
53
- }, U = (e) => e.frequency && j[e.frequency] || 0, h = (e, t) => {
54
- if (!e.length) return null;
55
- const r = [...e].sort(
49
+ return e ? parseFloat(e.amount || "0") : 0;
50
+ }, et = (t) => {
51
+ const e = C(t);
52
+ return e % 1 === 0 ? `${e}.0` : e.toString();
53
+ }, U = (t) => t.frequency && j[t.frequency] || 0, h = (t, e) => {
54
+ if (!t.length) return null;
55
+ const r = [...t].sort(
56
56
  (n, o) => (n.effectiveDate ? new Date(n.effectiveDate).getTime() : 0) - (o.effectiveDate ? new Date(o.effectiveDate).getTime() : 0)
57
57
  );
58
58
  for (let n = r.length - 1; n >= 0; n--) {
59
59
  const o = r[n]?.effectiveDate, s = o ? new Date(o) : null;
60
- if (s && s <= t)
60
+ if (s && s <= e)
61
61
  return r[n] || null;
62
62
  }
63
63
  return r[0] || null;
64
- }, k = (e, t) => {
65
- if (!e.length) return null;
66
- const r = [...e].sort(
64
+ }, A = (t, e) => {
65
+ if (!t.length) return null;
66
+ const r = [...t].sort(
67
67
  (n, o) => (n.effectiveDate ? new Date(n.effectiveDate).getTime() : 0) - (o.effectiveDate ? new Date(o.effectiveDate).getTime() : 0)
68
68
  );
69
69
  for (let n = r.length - 1; n >= 0; n--) {
70
70
  const o = r[n]?.effectiveDate, s = o ? new Date(o) : null;
71
- if (s && s <= t)
71
+ if (s && s <= e)
72
72
  return r[n] || null;
73
73
  }
74
74
  return r[0] || null;
75
- }, A = (e) => e.flsaStatus === "Exempt" || e.flsaStatus === "Salaried Nonexempt", W = (e) => e.length ? e.filter((t) => {
76
- const r = t.name?.toLowerCase(), n = parseFloat(t.amount || "0");
75
+ }, W = (t) => t.flsaStatus === "Exempt" || t.flsaStatus === "Salaried Nonexempt", I = (t) => t.length ? t.filter((e) => {
76
+ const r = e.name?.toLowerCase(), n = parseFloat(e.amount || "0");
77
77
  return (r === "paycheck tips" || r === "cash tips") && n > 0;
78
- }).reduce((t, r) => t + parseFloat(r.amount || "0"), 0) : 0, P = (e) => {
79
- const t = parseFloat(e.rate || "0");
80
- switch (e.paymentUnit || "Hour") {
78
+ }).reduce((e, r) => e + parseFloat(r.amount || "0"), 0) : 0, P = (t) => {
79
+ const e = parseFloat(t.rate || "0");
80
+ switch (t.paymentUnit || "Hour") {
81
81
  case "Hour":
82
- return t;
82
+ return e;
83
83
  case "Year":
84
- return t / 2080;
84
+ return e / 2080;
85
85
  // 52 weeks * 40 hours
86
86
  case "Month":
87
- return t / 173.333333;
87
+ return e / 173.333333;
88
88
  case "Week":
89
- return t / 40;
89
+ return e / 40;
90
90
  case "Paycheck":
91
91
  return 0;
92
92
  // Paycheck rate is 0 for hourly calculation
93
93
  default:
94
- return t;
94
+ return e;
95
95
  }
96
- }, I = (e, t, r) => {
97
- const n = e.jobs?.find((s) => s.uuid === t);
96
+ }, _ = (t, e, r) => {
97
+ const n = t.jobs?.find((s) => s.uuid === e);
98
98
  if (!n?.compensations)
99
99
  return 0;
100
100
  const o = h(n.compensations, r);
101
101
  return o ? P(o) : 0;
102
- }, w = (e, t) => {
103
- const r = y(e);
102
+ }, R = (t, e) => {
103
+ const r = y(t);
104
104
  if (!r?.compensations)
105
105
  return 0;
106
- const n = h(r.compensations, t);
106
+ const n = h(r.compensations, e);
107
107
  return n ? P(n) : 0;
108
- }, _ = (e) => e.paidTimeOff ? e.paidTimeOff.reduce(
109
- (t, r) => t + parseFloat(r.finalPayoutUnusedHoursInput || "0"),
108
+ }, k = (t) => t.paidTimeOff ? t.paidTimeOff.reduce(
109
+ (e, r) => e + parseFloat(r.finalPayoutUnusedHoursInput || "0"),
110
110
  0
111
- ) : 0, D = (e, t, r, n) => {
112
- const o = L(e);
111
+ ) : 0, w = (t, e, r, n) => {
112
+ const o = L(t);
113
113
  if (n) {
114
- const s = _(e);
114
+ const s = k(t);
115
115
  return o + s;
116
116
  }
117
- return t ? Math.min(r, o) : o;
118
- }, G = (e, t, r) => {
119
- if (!e.adjustForMinimumWage) return 0;
120
- const n = k(
121
- e.minimumWages || [],
117
+ return e ? Math.min(r, o) : o;
118
+ }, G = (t, e, r) => {
119
+ if (!t.adjustForMinimumWage) return 0;
120
+ const n = A(
121
+ t.minimumWages || [],
122
122
  r
123
123
  );
124
124
  if (!n)
125
125
  return 0;
126
- const o = t.hourlyCompensations?.reduce(
126
+ const o = e.hourlyCompensations?.reduce(
127
127
  (m, i) => m + parseFloat(i.hours || "0"),
128
128
  0
129
- ) || 0, s = P(e), u = (parseFloat(n.wage || "0") - s) * o, a = W(t.fixedCompensations || []);
129
+ ) || 0, s = P(t), u = (parseFloat(n.wage || "0") - s) * o, a = I(e.fixedCompensations || []);
130
130
  return Math.max(0, u - a);
131
- }, J = (e, t, r, n, o, s, u) => {
131
+ }, J = (t, e, r, n, o, s, u) => {
132
132
  if (!u && n)
133
- return w(t, r) * (o - s);
134
- if (!e.hourlyCompensations || !t.jobs)
133
+ return R(e, r) * (o - s);
134
+ if (!t.hourlyCompensations || !e.jobs)
135
135
  return 0;
136
- const a = e.hourlyCompensations.reduce((l, c) => {
137
- const d = parseFloat(c.hours || "0"), p = I(t, c.jobUuid || "", r);
138
- return l + d * p;
139
- }, 0), m = e.hourlyCompensations.reduce((l, c) => l + parseFloat(c.hours || "0"), 0);
136
+ const a = t.hourlyCompensations.reduce((l, c) => {
137
+ const p = parseFloat(c.hours || "0"), d = _(e, c.jobUuid || "", r);
138
+ return l + p * d;
139
+ }, 0), m = t.hourlyCompensations.reduce((l, c) => l + parseFloat(c.hours || "0"), 0);
140
140
  if (m === 0) return a;
141
- const i = S(a / m), f = e.hourlyCompensations.filter((l) => !H(l.name || "")).reduce((l, c) => {
142
- const d = parseFloat(c.hours || "0"), p = c.compensationMultiplier || 1;
143
- return l + d * i * (p - 1);
141
+ const i = S(a / m), f = t.hourlyCompensations.filter((l) => !H(l.name || "")).reduce((l, c) => {
142
+ const p = parseFloat(c.hours || "0"), d = c.compensationMultiplier || 1;
143
+ return l + p * i * (d - 1);
144
144
  }, 0);
145
145
  return a + f;
146
- }, q = (e, t, r, n, o, s) => {
147
- const u = D(
148
- e,
146
+ }, q = (t, e, r, n, o, s) => {
147
+ const u = w(
148
+ t,
149
149
  n,
150
150
  o,
151
151
  s
152
- ), a = w(t, r);
152
+ ), a = R(e, r);
153
153
  return u * a;
154
- }, B = (e, t, r) => {
155
- if (!t) return !1;
156
- const n = e.hourlyCompensations?.find(
154
+ }, B = (t, e, r) => {
155
+ if (!e) return !1;
156
+ const n = t.hourlyCompensations?.find(
157
157
  (s) => H(s.name || "")
158
158
  );
159
159
  return n ? parseFloat(n.hours || "0") === r : !1;
160
- }, re = (e, t, r, n, o = !1) => {
161
- if (e.excluded)
160
+ }, rt = (t, e, r, n, o = !1) => {
161
+ if (t.excluded)
162
162
  return 0;
163
- const s = r ? new Date(r) : /* @__PURE__ */ new Date(), u = y(t);
163
+ const s = r ? new Date(r) : /* @__PURE__ */ new Date(), u = y(e);
164
164
  if (!u?.compensations)
165
165
  return 0;
166
166
  const a = h(
@@ -169,50 +169,45 @@ const L = (e) => e.paidTimeOff ? e.paidTimeOff.reduce((t, r) => t + parseFloat(r
169
169
  );
170
170
  if (!a)
171
171
  return 0;
172
- const m = A(a), i = n ? U(n) : 0, f = B(
173
- e,
172
+ const m = W(a), i = n ? U(n) : 0, f = B(
173
+ t,
174
174
  m,
175
175
  i
176
- ), l = D(
177
- e,
176
+ ), l = w(
177
+ t,
178
178
  f,
179
179
  i,
180
180
  o
181
181
  ), c = J(
182
- e,
183
182
  t,
183
+ e,
184
184
  s,
185
185
  f,
186
186
  i,
187
187
  l,
188
188
  o
189
- ), d = O(e), p = q(
190
- e,
189
+ ), p = O(t), d = q(
191
190
  t,
191
+ e,
192
192
  s,
193
193
  f,
194
194
  i,
195
195
  o
196
- ), R = G(
196
+ ), b = G(
197
197
  a,
198
- e,
198
+ t,
199
199
  s
200
- ), b = c + d + p + R;
201
- return C(b);
202
- }, ne = (e) => e.external ? "External" : e.offCycle ? "Off-Cycle" : "Regular", oe = (e) => {
203
- if (!e.processed)
204
- return "Unprocessed";
205
- const t = /* @__PURE__ */ new Date(), r = e.checkDate ? new Date(e.checkDate) : null;
206
- return r && r <= t ? "Paid" : "Pending";
207
- }, se = ({
208
- flsaStatus: e,
209
- existingFixedCompensations: t = [],
200
+ ), T = c + p + d + b;
201
+ return C(T);
202
+ }, nt = (t) => t.external ? "External" : t.offCycle ? "Off-Cycle" : "Regular", ot = ({
203
+ flsaStatus: t,
204
+ existingFixedCompensations: e = [],
210
205
  primaryJobUuid: r,
211
206
  fixedCompensationTypes: n = [],
212
207
  excludedTypes: o = []
213
208
  }) => {
214
- const s = [...t];
215
- return e !== M.OWNER && r && n.length > 0 && n.map((a) => a.name).filter(Boolean).forEach((a) => {
209
+ const s = [...e];
210
+ return t !== M.OWNER && r && n.length > 0 && n.map((a) => a.name).filter(Boolean).forEach((a) => {
216
211
  s.some(
217
212
  (i) => i.name?.toLowerCase() === a.toLowerCase()
218
213
  ) || s.push({
@@ -221,32 +216,31 @@ const L = (e) => e.paidTimeOff ? e.paidTimeOff.reduce((t, r) => t + parseFloat(r
221
216
  jobUuid: r
222
217
  });
223
218
  }), s.filter((u) => u.name && !o.includes(u.name)).sort((u, a) => (u.name || "").localeCompare(a.name || ""));
224
- }, ae = (e, t, r) => {
225
- const n = e.find(
219
+ }, st = (t, e, r) => {
220
+ const n = t.find(
226
221
  (o) => o.name?.toLowerCase() === g.toLowerCase()
227
222
  );
228
- return n || (r && t.some(
223
+ return n || (r && e.some(
229
224
  (o) => o.name?.toLowerCase() === g.toLowerCase()
230
225
  ) ? {
231
226
  name: g,
232
227
  amount: "0.00",
233
228
  jobUuid: r
234
229
  } : null);
235
- }, ue = (e) => e.totals ? Number(e.totals.grossPay ?? 0) + Number(e.totals.employerTaxes ?? 0) + Number(e.totals.reimbursements ?? 0) + Number(e.totals.benefits ?? 0) : 0;
230
+ }, at = (t) => t.totals ? Number(t.totals.grossPay ?? 0) + Number(t.totals.employerTaxes ?? 0) + Number(t.totals.reimbursements ?? 0) + Number(t.totals.benefits ?? 0) : 0;
236
231
  export {
237
- re as calculateGrossPay,
238
- ue as calculateTotalPayroll,
232
+ rt as calculateGrossPay,
233
+ at as calculateTotalPayroll,
239
234
  N as formatEmployeePayRate,
240
- te as formatHoursDisplay,
235
+ et as formatHoursDisplay,
241
236
  O as getAdditionalEarnings,
242
- se as getAdditionalEarningsCompensations,
237
+ ot as getAdditionalEarningsCompensations,
243
238
  Z as getOvertimeHours,
244
- oe as getPayrollStatus,
245
- ne as getPayrollType,
239
+ nt as getPayrollType,
246
240
  y as getPrimaryJob,
247
241
  X as getRegularHours,
248
- ae as getReimbursementCompensation,
249
- ee as getReimbursements,
242
+ st as getReimbursementCompensation,
243
+ tt as getReimbursements,
250
244
  L as getTotalPtoHours,
251
245
  V as useFormatEmployeePayRate
252
246
  };
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sources":["../../../src/components/Payroll/helpers.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { PayrollShowFixedCompensations } from '@gusto/embedded-api/models/components/payrollshow'\nimport type { FixedCompensations } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollFixedCompensationTypesType } from '@gusto/embedded-api/models/components/payrollfixedcompensationtypestype'\nimport { useCallback } from 'react'\nimport type { TFunction } from 'i18next'\nimport { useTranslation } from 'react-i18next'\nimport type { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { Compensation, MinimumWages } from '@gusto/embedded-api/models/components/compensation'\nimport type { PayrollEmployeeCompensationsType } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { Payroll } from '@gusto/embedded-api/models/components/payroll'\nimport type { PayrollType } from './PayrollList/types'\nimport type { PayrollHistoryStatus } from './PayrollHistory/PayrollHistory'\nimport { formatPayRate } from '@/helpers/formattedStrings'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\nimport { COMPENSATION_NAME_REIMBURSEMENT, FlsaStatus } from '@/shared/constants'\n\nconst REGULAR_HOURS_NAME = 'regular hours'\n\n// Utility to get the primary job from an employee\nexport const getPrimaryJob = (employee: Employee) => {\n return employee.jobs?.find(job => job.primary) || employee.jobs?.[0] || null\n}\n\nconst roundToSixDecimals = (value: number): number => {\n return Math.round(value * 1_000_000) / 1_000_000\n}\n\nconst roundToTwoDecimals = (value: number): number => {\n return Math.round(value * 100) / 100\n}\n\nconst isRegularHours = (compensationName: string): boolean => {\n return compensationName.toLowerCase() === REGULAR_HOURS_NAME\n}\n\nconst PAY_PERIOD_HOURS_MAPPINGS: Record<string, number> = {\n Daily: 8.0,\n 'Every week': 40.0,\n 'Every other week': 80.0,\n 'Twice per month': 86.666667,\n Monthly: 173.333333,\n Quarterly: 520.0,\n Semiannually: 1040.0,\n Annually: 2080.0,\n}\n\nexport const formatEmployeePayRate = ({\n employee,\n t,\n locale = 'en-US',\n}: {\n employee?: Employee\n t: TFunction\n locale?: string\n}) => {\n if (!employee?.jobs) {\n return null\n }\n\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return null\n }\n\n const jobCompensation = primaryJob.compensations[0]\n if (!jobCompensation) {\n return null\n }\n if (!jobCompensation.rate || parseFloat(jobCompensation.rate) === 0) {\n return null\n }\n\n const rate = parseFloat(jobCompensation.rate)\n const paymentUnit = jobCompensation.paymentUnit || 'Hour'\n\n return formatPayRate({ rate, paymentUnit, t, locale })\n}\n\nexport const useFormatEmployeePayRate = () => {\n const { t } = useTranslation('common')\n const { locale } = useLocale()\n\n return useCallback(\n (employee?: Employee) => {\n return formatEmployeePayRate({ employee, t, locale })\n },\n [t, locale],\n )\n}\n\nexport const getEmployeePayRateInfo = (employee: Employee | undefined) => {\n if (!employee?.jobs) {\n return null\n }\n\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return null\n }\n\n const jobCompensation = primaryJob.compensations[0]\n if (!jobCompensation) {\n return null\n }\n if (!jobCompensation.rate || parseFloat(jobCompensation.rate) === 0) {\n return null\n }\n\n const rate = parseFloat(jobCompensation.rate)\n const paymentUnit = jobCompensation.paymentUnit || 'Hour'\n\n return { rate, paymentUnit }\n}\n\nexport const getRegularHours = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.hourlyCompensations) return 0\n\n return compensation.hourlyCompensations\n .filter(hourlyCompensation => hourlyCompensation.name?.toLowerCase() === 'regular hours')\n .reduce((sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'), 0)\n}\n\nexport function getOvertimeHours(compensation: PayrollEmployeeCompensationsType) {\n if (!compensation.hourlyCompensations || compensation.excluded) {\n return 0\n }\n\n return compensation.hourlyCompensations\n .filter(hourlyCompensation => Number(hourlyCompensation.compensationMultiplier) > 1)\n .reduce((sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'), 0)\n}\n\nexport const getTotalPtoHours = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.paidTimeOff) {\n return 0\n }\n return compensation.paidTimeOff.reduce((sum, pto) => sum + parseFloat(pto.hours || '0'), 0)\n}\n\nexport const getAdditionalEarnings = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.fixedCompensations) {\n return 0\n }\n\n return compensation.fixedCompensations\n .filter(fixedCompensation => {\n const name = fixedCompensation.name?.toLowerCase() || ''\n const amount = parseFloat(fixedCompensation.amount || '0')\n return name !== 'reimbursement' && name !== 'minimum wage adjustment' && amount > 0\n })\n .reduce((sum, fixedCompensation) => sum + parseFloat(fixedCompensation.amount || '0'), 0)\n}\n\nexport const getReimbursements = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.fixedCompensations) {\n return 0\n }\n\n const reimbursementComp = compensation.fixedCompensations.find(\n fixedCompensation => fixedCompensation.name?.toLowerCase() === 'reimbursement',\n )\n return reimbursementComp ? parseFloat(reimbursementComp.amount || '0') : 0\n}\n\nexport const formatHoursDisplay = (hours: number): string => {\n const rounded = roundToTwoDecimals(hours)\n\n if (rounded % 1 === 0) {\n return `${rounded}.0`\n }\n\n return rounded.toString()\n}\n\nconst getHoursInPayPeriod = (paySchedule: PayScheduleObject): number => {\n if (!paySchedule.frequency) {\n return 0\n }\n\n return PAY_PERIOD_HOURS_MAPPINGS[paySchedule.frequency] || 0\n}\n\nconst getEffectiveCompensation = (\n compensations: Compensation[],\n effectiveDate: Date,\n): Compensation | null => {\n if (!compensations.length) return null\n\n const sorted = [...compensations].sort(\n (a, b) =>\n (a.effectiveDate ? new Date(a.effectiveDate).getTime() : 0) -\n (b.effectiveDate ? new Date(b.effectiveDate).getTime() : 0),\n )\n\n for (let i = sorted.length - 1; i >= 0; i--) {\n const currentDateString = sorted[i]?.effectiveDate\n const currentDate = currentDateString ? new Date(currentDateString) : null\n if (currentDate && currentDate <= effectiveDate) {\n return sorted[i] || null\n }\n }\n\n return sorted[0] || null\n}\n\nconst getEffectiveMinimumWage = (\n minimumWages: MinimumWages[],\n effectiveDate: Date,\n): MinimumWages | null => {\n if (!minimumWages.length) return null\n\n const sorted = [...minimumWages].sort(\n (a, b) =>\n (a.effectiveDate ? new Date(a.effectiveDate).getTime() : 0) -\n (b.effectiveDate ? new Date(b.effectiveDate).getTime() : 0),\n )\n\n for (let i = sorted.length - 1; i >= 0; i--) {\n const currentDateString = sorted[i]?.effectiveDate\n const currentDate = currentDateString ? new Date(currentDateString) : null\n if (currentDate && currentDate <= effectiveDate) {\n return sorted[i] || null\n }\n }\n\n return sorted[0] || null\n}\n\nconst isSalaried = (compensation: Compensation): boolean => {\n return compensation.flsaStatus === 'Exempt' || compensation.flsaStatus === 'Salaried Nonexempt'\n}\n\nconst getTotalTipCompensations = (fixedCompensations: PayrollShowFixedCompensations[]): number => {\n if (!fixedCompensations.length) return 0\n\n return fixedCompensations\n .filter(fixedCompensation => {\n const name = fixedCompensation.name?.toLowerCase()\n const amount = parseFloat(fixedCompensation.amount || '0')\n return (name === 'paycheck tips' || name === 'cash tips') && amount > 0\n })\n .reduce((sum, fixedCompensation) => sum + parseFloat(fixedCompensation.amount || '0'), 0)\n}\n\nconst calculateHourlyRate = (compensation: Compensation): number => {\n const rate = parseFloat(compensation.rate || '0')\n const paymentUnit = compensation.paymentUnit || 'Hour'\n\n switch (paymentUnit) {\n case 'Hour':\n return rate\n case 'Year':\n return rate / 2080 // 52 weeks * 40 hours\n case 'Month':\n return rate / 173.333333\n case 'Week':\n return rate / 40\n case 'Paycheck':\n return 0 // Paycheck rate is 0 for hourly calculation\n default:\n return rate\n }\n}\n\nconst getHourlyRateForJob = (employee: Employee, jobUuid: string, effectiveDate: Date): number => {\n const job = employee.jobs?.find(j => j.uuid === jobUuid)\n if (!job?.compensations) {\n return 0\n }\n\n const compensation = getEffectiveCompensation(job.compensations, effectiveDate)\n return compensation ? calculateHourlyRate(compensation) : 0\n}\n\nconst getPrimaryHourlyRate = (employee: Employee, effectiveDate: Date): number => {\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return 0\n }\n\n const compensation = getEffectiveCompensation(primaryJob.compensations, effectiveDate)\n return compensation ? calculateHourlyRate(compensation) : 0\n}\n\nconst getTotalOutstandingPtoHours = (compensation: PayrollEmployeeCompensationsType): number => {\n if (!compensation.paidTimeOff) {\n return 0\n }\n\n return compensation.paidTimeOff.reduce(\n (sum, paidTimeOff) => sum + parseFloat(paidTimeOff.finalPayoutUnusedHoursInput || '0'),\n 0,\n )\n}\n\nconst getPtoHours = (\n compensation: PayrollEmployeeCompensationsType,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n offCycle: boolean,\n): number => {\n const regularPtoHours = getTotalPtoHours(compensation)\n\n if (offCycle) {\n const outstandingPtoHours = getTotalOutstandingPtoHours(compensation)\n return regularPtoHours + outstandingPtoHours\n }\n\n if (isSalariedWithExpectedHours) {\n return Math.min(hoursInPayPeriod, regularPtoHours)\n }\n\n return regularPtoHours\n}\n\nconst calculateMinimumWageAdjustment = (\n primaryCompensation: Compensation,\n compensation: PayrollEmployeeCompensationsType,\n effectiveDate: Date,\n): number => {\n if (!primaryCompensation.adjustForMinimumWage) return 0\n\n const effectiveMinWage = getEffectiveMinimumWage(\n primaryCompensation.minimumWages || [],\n effectiveDate,\n )\n if (!effectiveMinWage) {\n return 0\n }\n\n const totalHours =\n compensation.hourlyCompensations?.reduce(\n (sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'),\n 0,\n ) || 0\n\n const hourlyRate = calculateHourlyRate(primaryCompensation)\n\n const totalTipCredit = (parseFloat(effectiveMinWage.wage || '0') - hourlyRate) * totalHours\n const totalTips = getTotalTipCompensations(compensation.fixedCompensations || [])\n\n return Math.max(0, totalTipCredit - totalTips)\n}\n\nconst calculateRegularPlusOvertimePay = (\n compensation: PayrollEmployeeCompensationsType,\n employee: Employee,\n effectiveDate: Date,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n ptoHours: number,\n isOffCycle: boolean,\n): number => {\n if (!isOffCycle && isSalariedWithExpectedHours) {\n const primaryHourlyRate = getPrimaryHourlyRate(employee, effectiveDate)\n return primaryHourlyRate * (hoursInPayPeriod - ptoHours)\n }\n\n if (!compensation.hourlyCompensations || !employee.jobs) {\n return 0\n }\n\n const regularRatePay = compensation.hourlyCompensations.reduce((sum, hc) => {\n const hours = parseFloat(hc.hours || '0')\n const hourlyRate = getHourlyRateForJob(employee, hc.jobUuid || '', effectiveDate)\n return sum + hours * hourlyRate\n }, 0)\n\n const totalHours = compensation.hourlyCompensations.reduce((sum, hc) => {\n return sum + parseFloat(hc.hours || '0')\n }, 0)\n\n if (totalHours === 0) return regularRatePay\n\n const overtimeWeightedRate = roundToSixDecimals(regularRatePay / totalHours)\n\n // Calculate overtime pay for non-regular hours\n const overtimePay = compensation.hourlyCompensations\n .filter(hc => !isRegularHours(hc.name || ''))\n .reduce((sum, hc) => {\n const hours = parseFloat(hc.hours || '0')\n const multiplier = hc.compensationMultiplier || 1\n return sum + hours * overtimeWeightedRate * (multiplier - 1)\n }, 0)\n\n return regularRatePay + overtimePay\n}\n\nconst calculatePtoPay = (\n compensation: PayrollEmployeeCompensationsType,\n employee: Employee,\n effectiveDate: Date,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n offCycle: boolean,\n): number => {\n const ptoHours = getPtoHours(\n compensation,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n offCycle,\n )\n const primaryHourlyRate = getPrimaryHourlyRate(employee, effectiveDate)\n return ptoHours * primaryHourlyRate\n}\n\nconst isSalariedWithPayPeriodExpectedHours = (\n compensation: PayrollEmployeeCompensationsType,\n isSalaried: boolean,\n hoursInPayPeriod: number,\n): boolean => {\n if (!isSalaried) return false\n\n const regularHourlyCompensation = compensation.hourlyCompensations?.find(hourlyCompensation =>\n isRegularHours(hourlyCompensation.name || ''),\n )\n\n if (!regularHourlyCompensation) return false\n\n const regularHours = parseFloat(regularHourlyCompensation.hours || '0')\n return regularHours === hoursInPayPeriod\n}\n\nexport const calculateGrossPay = (\n compensation: PayrollEmployeeCompensationsType,\n employee: Employee,\n compensationEffectiveDateString?: string,\n paySchedule?: PayScheduleObject,\n isOffCycle: boolean = false,\n): number => {\n if (compensation.excluded) {\n return 0\n }\n\n const compensationEffectiveDate = compensationEffectiveDateString\n ? new Date(compensationEffectiveDateString)\n : new Date()\n\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return 0\n }\n\n const primaryCompensation = getEffectiveCompensation(\n primaryJob.compensations,\n compensationEffectiveDate,\n )\n\n if (!primaryCompensation) {\n return 0\n }\n\n const salaried = isSalaried(primaryCompensation)\n const hoursInPayPeriod = paySchedule ? getHoursInPayPeriod(paySchedule) : 0\n\n const isSalariedWithExpectedHours = isSalariedWithPayPeriodExpectedHours(\n compensation,\n salaried,\n hoursInPayPeriod,\n )\n\n const ptoHours = getPtoHours(\n compensation,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n isOffCycle,\n )\n\n const regularPlusOvertimePay = calculateRegularPlusOvertimePay(\n compensation,\n employee,\n compensationEffectiveDate,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n ptoHours,\n isOffCycle,\n )\n\n const fixedPay = getAdditionalEarnings(compensation)\n const ptoPay = calculatePtoPay(\n compensation,\n employee,\n compensationEffectiveDate,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n isOffCycle,\n )\n const minimumWageAdjustment = calculateMinimumWageAdjustment(\n primaryCompensation,\n compensation,\n compensationEffectiveDate,\n )\n\n const total = regularPlusOvertimePay + fixedPay + ptoPay + minimumWageAdjustment\n return roundToTwoDecimals(total)\n}\n\n// Payroll type and status utilities\nexport const getPayrollType = (payroll: {\n external?: boolean\n offCycle?: boolean\n}): PayrollType => {\n if (payroll.external) return 'External'\n if (payroll.offCycle) return 'Off-Cycle'\n return 'Regular'\n}\n\nexport const getPayrollStatus = (payroll: {\n processed?: boolean\n checkDate?: string | null\n}): PayrollHistoryStatus => {\n if (!payroll.processed) {\n return 'Unprocessed'\n }\n\n // For processed payrolls, determine more specific status\n const now = new Date()\n const checkDate = payroll.checkDate ? new Date(payroll.checkDate) : null\n const isCheckDatePassed = checkDate && checkDate <= now\n\n // If check date has passed, consider it paid/complete\n if (isCheckDatePassed) {\n return 'Paid'\n }\n\n // If processed but check date hasn't arrived yet, it's pending\n return 'Pending'\n}\n\nexport const getAdditionalEarningsCompensations = ({\n flsaStatus,\n existingFixedCompensations = [],\n primaryJobUuid,\n fixedCompensationTypes = [],\n excludedTypes = [],\n}: {\n flsaStatus: string | undefined\n existingFixedCompensations?: FixedCompensations[]\n primaryJobUuid?: string\n fixedCompensationTypes?: PayrollFixedCompensationTypesType[]\n excludedTypes?: string[]\n}): FixedCompensations[] => {\n const allFixedCompensations = [...existingFixedCompensations]\n\n if (flsaStatus !== FlsaStatus.OWNER && primaryJobUuid && fixedCompensationTypes.length > 0) {\n const compensationTypeNames = fixedCompensationTypes\n .map(type => type.name)\n .filter(Boolean) as string[]\n\n compensationTypeNames.forEach(compensationName => {\n const exists = allFixedCompensations.some(\n comp => comp.name?.toLowerCase() === compensationName.toLowerCase(),\n )\n\n if (!exists) {\n allFixedCompensations.push({\n name: compensationName,\n amount: '0.00',\n jobUuid: primaryJobUuid,\n })\n }\n })\n }\n\n // Filter and sort additional earnings (exclude specified types)\n return allFixedCompensations\n .filter(comp => comp.name && !excludedTypes.includes(comp.name))\n .sort((a, b) => (a.name || '').localeCompare(b.name || ''))\n}\n\nexport const getReimbursementCompensation = (\n fixedCompensations: FixedCompensations[],\n fixedCompensationTypes: PayrollFixedCompensationTypesType[],\n primaryJobUuid?: string,\n) => {\n const reimbursementCompensation = fixedCompensations.find(\n comp => comp.name?.toLowerCase() === COMPENSATION_NAME_REIMBURSEMENT.toLowerCase(),\n )\n\n if (reimbursementCompensation) {\n return reimbursementCompensation\n }\n\n if (\n primaryJobUuid &&\n fixedCompensationTypes.some(\n type => type.name?.toLowerCase() === COMPENSATION_NAME_REIMBURSEMENT.toLowerCase(),\n )\n ) {\n return {\n name: COMPENSATION_NAME_REIMBURSEMENT,\n amount: '0.00',\n jobUuid: primaryJobUuid,\n }\n }\n\n return null\n}\n\n// Total Payroll = Gross Pay + Employer Taxes + Reimbursements + Benefits\nexport const calculateTotalPayroll = (payrollData: Payroll) => {\n const totalPayroll = payrollData.totals\n ? Number(payrollData.totals.grossPay ?? 0) +\n Number(payrollData.totals.employerTaxes ?? 0) +\n Number(payrollData.totals.reimbursements ?? 0) +\n Number(payrollData.totals.benefits ?? 0)\n : 0\n\n return totalPayroll\n}\n"],"names":["REGULAR_HOURS_NAME","getPrimaryJob","employee","job","roundToSixDecimals","value","roundToTwoDecimals","isRegularHours","compensationName","PAY_PERIOD_HOURS_MAPPINGS","formatEmployeePayRate","locale","primaryJob","jobCompensation","rate","paymentUnit","formatPayRate","useFormatEmployeePayRate","t","useTranslation","useLocale","useCallback","getRegularHours","compensation","hourlyCompensation","sum","getOvertimeHours","getTotalPtoHours","pto","getAdditionalEarnings","fixedCompensation","name","amount","getReimbursements","reimbursementComp","formatHoursDisplay","hours","rounded","getHoursInPayPeriod","paySchedule","getEffectiveCompensation","compensations","effectiveDate","sorted","a","b","i","currentDateString","currentDate","getEffectiveMinimumWage","minimumWages","isSalaried","getTotalTipCompensations","fixedCompensations","calculateHourlyRate","getHourlyRateForJob","jobUuid","j","getPrimaryHourlyRate","getTotalOutstandingPtoHours","paidTimeOff","getPtoHours","isSalariedWithExpectedHours","hoursInPayPeriod","offCycle","regularPtoHours","outstandingPtoHours","calculateMinimumWageAdjustment","primaryCompensation","effectiveMinWage","totalHours","hourlyRate","totalTipCredit","totalTips","calculateRegularPlusOvertimePay","ptoHours","isOffCycle","regularRatePay","hc","overtimeWeightedRate","overtimePay","multiplier","calculatePtoPay","primaryHourlyRate","isSalariedWithPayPeriodExpectedHours","regularHourlyCompensation","calculateGrossPay","compensationEffectiveDateString","compensationEffectiveDate","salaried","regularPlusOvertimePay","fixedPay","ptoPay","minimumWageAdjustment","total","getPayrollType","payroll","getPayrollStatus","now","checkDate","getAdditionalEarningsCompensations","flsaStatus","existingFixedCompensations","primaryJobUuid","fixedCompensationTypes","excludedTypes","allFixedCompensations","FlsaStatus","type","comp","getReimbursementCompensation","reimbursementCompensation","COMPENSATION_NAME_REIMBURSEMENT","calculateTotalPayroll","payrollData"],"mappings":";;;;;AAiBA,MAAMA,IAAqB,iBAGdC,IAAgB,CAACC,MACrBA,EAAS,MAAM,KAAK,CAAAC,MAAOA,EAAI,OAAO,KAAKD,EAAS,OAAO,CAAC,KAAK,MAGpEE,IAAqB,CAACC,MACnB,KAAK,MAAMA,IAAQ,GAAS,IAAI,KAGnCC,IAAqB,CAACD,MACnB,KAAK,MAAMA,IAAQ,GAAG,IAAI,KAG7BE,IAAiB,CAACC,MACfA,EAAiB,kBAAkBR,GAGtCS,IAAoD;AAAA,EACxD,OAAO;AAAA,EACP,cAAc;AAAA,E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AAE,QAAQ,EAAE,CAAC;AAC9D,GAEaiE,KAA+B,CAC1CzD,GACAmD,GACAD,MACG;AACH,QAAMQ,IAA4B1D,EAAmB;AAAA,IACnD,OAAQwD,EAAK,MAAM,YAAA,MAAkBG,EAAgC,YAAA;AAAA,EAAY;AAGnF,SAAID,MAKFR,KACAC,EAAuB;AAAA,IACrB,OAAQI,EAAK,MAAM,YAAA,MAAkBI,EAAgC,YAAA;AAAA,EAAY,IAG5E;AAAA,IACL,MAAMA;AAAA,IACN,QAAQ;AAAA,IACR,SAAST;AAAA,EAAA,IAIN;AACT,GAGaU,KAAwB,CAACC,MACfA,EAAY,SAC7B,OAAOA,EAAY,OAAO,YAAY,CAAC,IACvC,OAAOA,EAAY,OAAO,iBAAiB,CAAC,IAC5C,OAAOA,EAAY,OAAO,kBAAkB,CAAC,IAC7C,OAAOA,EAAY,OAAO,YAAY,CAAC,IACvC;"}
1
+ {"version":3,"file":"helpers.js","sources":["../../../src/components/Payroll/helpers.ts"],"sourcesContent":["import type { Employee } from '@gusto/embedded-api/models/components/employee'\nimport type { PayrollShowFixedCompensations } from '@gusto/embedded-api/models/components/payrollshow'\nimport type { FixedCompensations } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { PayrollFixedCompensationTypesType } from '@gusto/embedded-api/models/components/payrollfixedcompensationtypestype'\nimport { useCallback } from 'react'\nimport type { TFunction } from 'i18next'\nimport { useTranslation } from 'react-i18next'\nimport type { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { Compensation, MinimumWages } from '@gusto/embedded-api/models/components/compensation'\nimport type { PayrollEmployeeCompensationsType } from '@gusto/embedded-api/models/components/payrollemployeecompensationstype'\nimport type { Payroll } from '@gusto/embedded-api/models/components/payroll'\nimport type { PayrollType } from './PayrollList/types'\nimport { formatPayRate } from '@/helpers/formattedStrings'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\nimport { COMPENSATION_NAME_REIMBURSEMENT, FlsaStatus } from '@/shared/constants'\n\nconst REGULAR_HOURS_NAME = 'regular hours'\n\n// Utility to get the primary job from an employee\nexport const getPrimaryJob = (employee: Employee) => {\n return employee.jobs?.find(job => job.primary) || employee.jobs?.[0] || null\n}\n\nconst roundToSixDecimals = (value: number): number => {\n return Math.round(value * 1_000_000) / 1_000_000\n}\n\nconst roundToTwoDecimals = (value: number): number => {\n return Math.round(value * 100) / 100\n}\n\nconst isRegularHours = (compensationName: string): boolean => {\n return compensationName.toLowerCase() === REGULAR_HOURS_NAME\n}\n\nconst PAY_PERIOD_HOURS_MAPPINGS: Record<string, number> = {\n Daily: 8.0,\n 'Every week': 40.0,\n 'Every other week': 80.0,\n 'Twice per month': 86.666667,\n Monthly: 173.333333,\n Quarterly: 520.0,\n Semiannually: 1040.0,\n Annually: 2080.0,\n}\n\nexport const formatEmployeePayRate = ({\n employee,\n t,\n locale = 'en-US',\n}: {\n employee?: Employee\n t: TFunction\n locale?: string\n}) => {\n if (!employee?.jobs) {\n return null\n }\n\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return null\n }\n\n const jobCompensation = primaryJob.compensations[0]\n if (!jobCompensation) {\n return null\n }\n if (!jobCompensation.rate || parseFloat(jobCompensation.rate) === 0) {\n return null\n }\n\n const rate = parseFloat(jobCompensation.rate)\n const paymentUnit = jobCompensation.paymentUnit || 'Hour'\n\n return formatPayRate({ rate, paymentUnit, t, locale })\n}\n\nexport const useFormatEmployeePayRate = () => {\n const { t } = useTranslation('common')\n const { locale } = useLocale()\n\n return useCallback(\n (employee?: Employee) => {\n return formatEmployeePayRate({ employee, t, locale })\n },\n [t, locale],\n )\n}\n\nexport const getEmployeePayRateInfo = (employee: Employee | undefined) => {\n if (!employee?.jobs) {\n return null\n }\n\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return null\n }\n\n const jobCompensation = primaryJob.compensations[0]\n if (!jobCompensation) {\n return null\n }\n if (!jobCompensation.rate || parseFloat(jobCompensation.rate) === 0) {\n return null\n }\n\n const rate = parseFloat(jobCompensation.rate)\n const paymentUnit = jobCompensation.paymentUnit || 'Hour'\n\n return { rate, paymentUnit }\n}\n\nexport const getRegularHours = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.hourlyCompensations) return 0\n\n return compensation.hourlyCompensations\n .filter(hourlyCompensation => hourlyCompensation.name?.toLowerCase() === 'regular hours')\n .reduce((sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'), 0)\n}\n\nexport function getOvertimeHours(compensation: PayrollEmployeeCompensationsType) {\n if (!compensation.hourlyCompensations || compensation.excluded) {\n return 0\n }\n\n return compensation.hourlyCompensations\n .filter(hourlyCompensation => Number(hourlyCompensation.compensationMultiplier) > 1)\n .reduce((sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'), 0)\n}\n\nexport const getTotalPtoHours = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.paidTimeOff) {\n return 0\n }\n return compensation.paidTimeOff.reduce((sum, pto) => sum + parseFloat(pto.hours || '0'), 0)\n}\n\nexport const getAdditionalEarnings = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.fixedCompensations) {\n return 0\n }\n\n return compensation.fixedCompensations\n .filter(fixedCompensation => {\n const name = fixedCompensation.name?.toLowerCase() || ''\n const amount = parseFloat(fixedCompensation.amount || '0')\n return name !== 'reimbursement' && name !== 'minimum wage adjustment' && amount > 0\n })\n .reduce((sum, fixedCompensation) => sum + parseFloat(fixedCompensation.amount || '0'), 0)\n}\n\nexport const getReimbursements = (compensation: PayrollEmployeeCompensationsType) => {\n if (!compensation.fixedCompensations) {\n return 0\n }\n\n const reimbursementComp = compensation.fixedCompensations.find(\n fixedCompensation => fixedCompensation.name?.toLowerCase() === 'reimbursement',\n )\n return reimbursementComp ? parseFloat(reimbursementComp.amount || '0') : 0\n}\n\nexport const formatHoursDisplay = (hours: number): string => {\n const rounded = roundToTwoDecimals(hours)\n\n if (rounded % 1 === 0) {\n return `${rounded}.0`\n }\n\n return rounded.toString()\n}\n\nconst getHoursInPayPeriod = (paySchedule: PayScheduleObject): number => {\n if (!paySchedule.frequency) {\n return 0\n }\n\n return PAY_PERIOD_HOURS_MAPPINGS[paySchedule.frequency] || 0\n}\n\nconst getEffectiveCompensation = (\n compensations: Compensation[],\n effectiveDate: Date,\n): Compensation | null => {\n if (!compensations.length) return null\n\n const sorted = [...compensations].sort(\n (a, b) =>\n (a.effectiveDate ? new Date(a.effectiveDate).getTime() : 0) -\n (b.effectiveDate ? new Date(b.effectiveDate).getTime() : 0),\n )\n\n for (let i = sorted.length - 1; i >= 0; i--) {\n const currentDateString = sorted[i]?.effectiveDate\n const currentDate = currentDateString ? new Date(currentDateString) : null\n if (currentDate && currentDate <= effectiveDate) {\n return sorted[i] || null\n }\n }\n\n return sorted[0] || null\n}\n\nconst getEffectiveMinimumWage = (\n minimumWages: MinimumWages[],\n effectiveDate: Date,\n): MinimumWages | null => {\n if (!minimumWages.length) return null\n\n const sorted = [...minimumWages].sort(\n (a, b) =>\n (a.effectiveDate ? new Date(a.effectiveDate).getTime() : 0) -\n (b.effectiveDate ? new Date(b.effectiveDate).getTime() : 0),\n )\n\n for (let i = sorted.length - 1; i >= 0; i--) {\n const currentDateString = sorted[i]?.effectiveDate\n const currentDate = currentDateString ? new Date(currentDateString) : null\n if (currentDate && currentDate <= effectiveDate) {\n return sorted[i] || null\n }\n }\n\n return sorted[0] || null\n}\n\nconst isSalaried = (compensation: Compensation): boolean => {\n return compensation.flsaStatus === 'Exempt' || compensation.flsaStatus === 'Salaried Nonexempt'\n}\n\nconst getTotalTipCompensations = (fixedCompensations: PayrollShowFixedCompensations[]): number => {\n if (!fixedCompensations.length) return 0\n\n return fixedCompensations\n .filter(fixedCompensation => {\n const name = fixedCompensation.name?.toLowerCase()\n const amount = parseFloat(fixedCompensation.amount || '0')\n return (name === 'paycheck tips' || name === 'cash tips') && amount > 0\n })\n .reduce((sum, fixedCompensation) => sum + parseFloat(fixedCompensation.amount || '0'), 0)\n}\n\nconst calculateHourlyRate = (compensation: Compensation): number => {\n const rate = parseFloat(compensation.rate || '0')\n const paymentUnit = compensation.paymentUnit || 'Hour'\n\n switch (paymentUnit) {\n case 'Hour':\n return rate\n case 'Year':\n return rate / 2080 // 52 weeks * 40 hours\n case 'Month':\n return rate / 173.333333\n case 'Week':\n return rate / 40\n case 'Paycheck':\n return 0 // Paycheck rate is 0 for hourly calculation\n default:\n return rate\n }\n}\n\nconst getHourlyRateForJob = (employee: Employee, jobUuid: string, effectiveDate: Date): number => {\n const job = employee.jobs?.find(j => j.uuid === jobUuid)\n if (!job?.compensations) {\n return 0\n }\n\n const compensation = getEffectiveCompensation(job.compensations, effectiveDate)\n return compensation ? calculateHourlyRate(compensation) : 0\n}\n\nconst getPrimaryHourlyRate = (employee: Employee, effectiveDate: Date): number => {\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return 0\n }\n\n const compensation = getEffectiveCompensation(primaryJob.compensations, effectiveDate)\n return compensation ? calculateHourlyRate(compensation) : 0\n}\n\nconst getTotalOutstandingPtoHours = (compensation: PayrollEmployeeCompensationsType): number => {\n if (!compensation.paidTimeOff) {\n return 0\n }\n\n return compensation.paidTimeOff.reduce(\n (sum, paidTimeOff) => sum + parseFloat(paidTimeOff.finalPayoutUnusedHoursInput || '0'),\n 0,\n )\n}\n\nconst getPtoHours = (\n compensation: PayrollEmployeeCompensationsType,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n offCycle: boolean,\n): number => {\n const regularPtoHours = getTotalPtoHours(compensation)\n\n if (offCycle) {\n const outstandingPtoHours = getTotalOutstandingPtoHours(compensation)\n return regularPtoHours + outstandingPtoHours\n }\n\n if (isSalariedWithExpectedHours) {\n return Math.min(hoursInPayPeriod, regularPtoHours)\n }\n\n return regularPtoHours\n}\n\nconst calculateMinimumWageAdjustment = (\n primaryCompensation: Compensation,\n compensation: PayrollEmployeeCompensationsType,\n effectiveDate: Date,\n): number => {\n if (!primaryCompensation.adjustForMinimumWage) return 0\n\n const effectiveMinWage = getEffectiveMinimumWage(\n primaryCompensation.minimumWages || [],\n effectiveDate,\n )\n if (!effectiveMinWage) {\n return 0\n }\n\n const totalHours =\n compensation.hourlyCompensations?.reduce(\n (sum, hourlyCompensation) => sum + parseFloat(hourlyCompensation.hours || '0'),\n 0,\n ) || 0\n\n const hourlyRate = calculateHourlyRate(primaryCompensation)\n\n const totalTipCredit = (parseFloat(effectiveMinWage.wage || '0') - hourlyRate) * totalHours\n const totalTips = getTotalTipCompensations(compensation.fixedCompensations || [])\n\n return Math.max(0, totalTipCredit - totalTips)\n}\n\nconst calculateRegularPlusOvertimePay = (\n compensation: PayrollEmployeeCompensationsType,\n employee: Employee,\n effectiveDate: Date,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n ptoHours: number,\n isOffCycle: boolean,\n): number => {\n if (!isOffCycle && isSalariedWithExpectedHours) {\n const primaryHourlyRate = getPrimaryHourlyRate(employee, effectiveDate)\n return primaryHourlyRate * (hoursInPayPeriod - ptoHours)\n }\n\n if (!compensation.hourlyCompensations || !employee.jobs) {\n return 0\n }\n\n const regularRatePay = compensation.hourlyCompensations.reduce((sum, hc) => {\n const hours = parseFloat(hc.hours || '0')\n const hourlyRate = getHourlyRateForJob(employee, hc.jobUuid || '', effectiveDate)\n return sum + hours * hourlyRate\n }, 0)\n\n const totalHours = compensation.hourlyCompensations.reduce((sum, hc) => {\n return sum + parseFloat(hc.hours || '0')\n }, 0)\n\n if (totalHours === 0) return regularRatePay\n\n const overtimeWeightedRate = roundToSixDecimals(regularRatePay / totalHours)\n\n // Calculate overtime pay for non-regular hours\n const overtimePay = compensation.hourlyCompensations\n .filter(hc => !isRegularHours(hc.name || ''))\n .reduce((sum, hc) => {\n const hours = parseFloat(hc.hours || '0')\n const multiplier = hc.compensationMultiplier || 1\n return sum + hours * overtimeWeightedRate * (multiplier - 1)\n }, 0)\n\n return regularRatePay + overtimePay\n}\n\nconst calculatePtoPay = (\n compensation: PayrollEmployeeCompensationsType,\n employee: Employee,\n effectiveDate: Date,\n isSalariedWithExpectedHours: boolean,\n hoursInPayPeriod: number,\n offCycle: boolean,\n): number => {\n const ptoHours = getPtoHours(\n compensation,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n offCycle,\n )\n const primaryHourlyRate = getPrimaryHourlyRate(employee, effectiveDate)\n return ptoHours * primaryHourlyRate\n}\n\nconst isSalariedWithPayPeriodExpectedHours = (\n compensation: PayrollEmployeeCompensationsType,\n isSalaried: boolean,\n hoursInPayPeriod: number,\n): boolean => {\n if (!isSalaried) return false\n\n const regularHourlyCompensation = compensation.hourlyCompensations?.find(hourlyCompensation =>\n isRegularHours(hourlyCompensation.name || ''),\n )\n\n if (!regularHourlyCompensation) return false\n\n const regularHours = parseFloat(regularHourlyCompensation.hours || '0')\n return regularHours === hoursInPayPeriod\n}\n\nexport const calculateGrossPay = (\n compensation: PayrollEmployeeCompensationsType,\n employee: Employee,\n compensationEffectiveDateString?: string,\n paySchedule?: PayScheduleObject,\n isOffCycle: boolean = false,\n): number => {\n if (compensation.excluded) {\n return 0\n }\n\n const compensationEffectiveDate = compensationEffectiveDateString\n ? new Date(compensationEffectiveDateString)\n : new Date()\n\n const primaryJob = getPrimaryJob(employee)\n if (!primaryJob?.compensations) {\n return 0\n }\n\n const primaryCompensation = getEffectiveCompensation(\n primaryJob.compensations,\n compensationEffectiveDate,\n )\n\n if (!primaryCompensation) {\n return 0\n }\n\n const salaried = isSalaried(primaryCompensation)\n const hoursInPayPeriod = paySchedule ? getHoursInPayPeriod(paySchedule) : 0\n\n const isSalariedWithExpectedHours = isSalariedWithPayPeriodExpectedHours(\n compensation,\n salaried,\n hoursInPayPeriod,\n )\n\n const ptoHours = getPtoHours(\n compensation,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n isOffCycle,\n )\n\n const regularPlusOvertimePay = calculateRegularPlusOvertimePay(\n compensation,\n employee,\n compensationEffectiveDate,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n ptoHours,\n isOffCycle,\n )\n\n const fixedPay = getAdditionalEarnings(compensation)\n const ptoPay = calculatePtoPay(\n compensation,\n employee,\n compensationEffectiveDate,\n isSalariedWithExpectedHours,\n hoursInPayPeriod,\n isOffCycle,\n )\n const minimumWageAdjustment = calculateMinimumWageAdjustment(\n primaryCompensation,\n compensation,\n compensationEffectiveDate,\n )\n\n const total = regularPlusOvertimePay + fixedPay + ptoPay + minimumWageAdjustment\n return roundToTwoDecimals(total)\n}\n\n// Payroll type and status utilities\nexport const getPayrollType = (payroll: {\n external?: boolean\n offCycle?: boolean\n}): PayrollType => {\n if (payroll.external) return 'External'\n if (payroll.offCycle) return 'Off-Cycle'\n return 'Regular'\n}\n\nexport const getAdditionalEarningsCompensations = ({\n flsaStatus,\n existingFixedCompensations = [],\n primaryJobUuid,\n fixedCompensationTypes = [],\n excludedTypes = [],\n}: {\n flsaStatus: string | undefined\n existingFixedCompensations?: FixedCompensations[]\n primaryJobUuid?: string\n fixedCompensationTypes?: PayrollFixedCompensationTypesType[]\n excludedTypes?: string[]\n}): FixedCompensations[] => {\n const allFixedCompensations = [...existingFixedCompensations]\n\n if (flsaStatus !== FlsaStatus.OWNER && primaryJobUuid && fixedCompensationTypes.length > 0) {\n const compensationTypeNames = fixedCompensationTypes\n .map(type => type.name)\n .filter(Boolean) as string[]\n\n compensationTypeNames.forEach(compensationName => {\n const exists = allFixedCompensations.some(\n comp => comp.name?.toLowerCase() === compensationName.toLowerCase(),\n )\n\n if (!exists) {\n allFixedCompensations.push({\n name: compensationName,\n amount: '0.00',\n jobUuid: primaryJobUuid,\n })\n }\n })\n }\n\n // Filter and sort additional earnings (exclude specified types)\n return allFixedCompensations\n .filter(comp => comp.name && !excludedTypes.includes(comp.name))\n .sort((a, b) => (a.name || '').localeCompare(b.name || ''))\n}\n\nexport const getReimbursementCompensation = (\n fixedCompensations: FixedCompensations[],\n fixedCompensationTypes: PayrollFixedCompensationTypesType[],\n primaryJobUuid?: string,\n) => {\n const reimbursementCompensation = fixedCompensations.find(\n comp => comp.name?.toLowerCase() === COMPENSATION_NAME_REIMBURSEMENT.toLowerCase(),\n )\n\n if (reimbursementCompensation) {\n return reimbursementCompensation\n }\n\n if (\n primaryJobUuid &&\n fixedCompensationTypes.some(\n type => type.name?.toLowerCase() === COMPENSATION_NAME_REIMBURSEMENT.toLowerCase(),\n )\n ) {\n return {\n name: COMPENSATION_NAME_REIMBURSEMENT,\n amount: '0.00',\n jobUuid: primaryJobUuid,\n }\n }\n\n return null\n}\n\n// Total Payroll = Gross Pay + Employer Taxes + Reimbursements + Benefits\nexport const calculateTotalPayroll = (payrollData: Payroll) => {\n const totalPayroll = payrollData.totals\n ? Number(payrollData.totals.grossPay ?? 0) +\n Number(payrollData.totals.employerTaxes ?? 0) +\n Number(payrollData.totals.reimbursements ?? 0) +\n Number(payrollData.totals.benefits ?? 0)\n : 0\n\n return totalPayroll\n}\n"],"names":["REGULAR_HOURS_NAME","getPrimaryJob","employee","job","roundToSixDecimals","value","roundToTwoDecimals","isRegularHours","compensationName","PAY_PERIOD_HOURS_MAPPINGS","formatEmployeePayRate","t","locale","primaryJob","jobCompensation","rate","paymentUnit","formatPayRate","useFormatEmployeePayRate","useTranslation","useLocale","useCallback","getRegularHours","compensation","hourlyCompensation","sum","getOvertimeHours","getTotalPtoHours","pto","getAdditionalEarnings","fixedCompensation","name","amount","getReimbursements","reimbursementComp","formatHoursDisplay","hours","rounded","getHoursInPayPeriod","paySchedule","getEffectiveCompensation","compensations","effectiveDate","sorted","a","b","i","currentDateString","currentDate","getEffectiveMinimumWage","minimumWages","isSalaried","getTotalTipCompensations","fixedCompensations","calculateHourlyRate","getHourlyRateForJob","jobUuid","j","getPrimaryHourlyRate","getTotalOutstandingPtoHours","paidTimeOff","getPtoHours","isSalariedWithExpectedHours","hoursInPayPeriod","offCycle","regularPtoHours","outstandingPtoHours","calculateMinimumWageAdjustment","primaryCompensation","effectiveMinWage","totalHours","hourlyRate","totalTipCredit","totalTips","calculateRegularPlusOvertimePay","ptoHours","isOffCycle","regularRatePay","hc","overtimeWeightedRate","overtimePay","multiplier","calculatePtoPay","primaryHourlyRate","isSalariedWithPayPeriodExpectedHours","regularHourlyCompensation","calculateGrossPay","compensationEffectiveDateString","compensationEffectiveDate","salaried","regularPlusOvertimePay","fixedPay","ptoPay","minimumWageAdjustment","total","getPayrollType","payroll","getAdditionalEarningsCompensations","flsaStatus","existingFixedCompensations","primaryJobUuid","fixedCompensationTypes","excludedTypes","allFixedCompensations","FlsaStatus","type","comp","getReimbursementCompensation","reimbursementCompensation","COMPENSATION_NAME_REIMBURSEMENT","calculateTotalPayroll","payrollData"],"mappings":";;;;;AAgBA,MAAMA,IAAqB,iBAGdC,IAAgB,CAACC,MACrBA,EAAS,MAAM,KAAK,CAAAC,MAAOA,EAAI,OAAO,KAAKD,EAAS,OAAO,CAAC,KAAK,MAGpEE,IAAqB,CAACC,MACnB,KAAK,MAAMA,IAAQ,GAAS,IAAI,KAGnCC,IAAqB,CAACD,MACnB,KAAK,MAAMA,IAAQ,GAAG,IAAI,KAG7BE,IAAiB,CAACC,MACfA,EAAiB,kBAAkBR,GAGtCS,IAAoD;AAAA,EACxD,OAAO;AAAA,EACP,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,mBAAmB;AAAA,EACnB,SAAS;AAAA,EACT,WAAW;AAAA,EACX,cAAc;AAAA,EACd,UAAU;AACZ,GAEaC,IAAwB,CAAC;AAAA,EACpC,UAAAR;AAAA,EACA,GAAAS;AAAA,EACA,QAAAC,IAAS;AACX,MAIM;AACJ,MAAI,CAACV,GAAU;AACb,WAAO;AAGT,QAAMW,IAAaZ,EAAcC,CAAQ;AACzC,MAAI,CAACW,GAAY;AACf,WAAO;AAGT,QAAMC,IAAkBD,EAAW,cAAc,CAAC;AAIlD,MAHI,CAACC,KAGD,CAACA,EAAgB,QAAQ,WAAWA,EAAgB,IAAI,MAAM;AAChE,WAAO;AAGT,QAAMC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, useCallback as y, useEffect as S } from "react";
2
2
  import { usePayrollsPrepareMutation as h } from "@gusto/embedded-api/react-query/payrollsPrepare";
3
3
  import { usePaySchedulesGet as f } from "@gusto/embedded-api/react-query/paySchedulesGet";
4
4
  import "react/jsx-runtime";
@@ -6,20 +6,21 @@ import "react-error-boundary";
6
6
  import "react-i18next";
7
7
  import "@gusto/embedded-api/models/errors/apierror";
8
8
  import "@gusto/embedded-api/models/errors/sdkvalidationerror";
9
- import "@gusto/embedded-api/models/errors/unprocessableentityerrorobject";
10
9
  import "@tanstack/react-query";
11
10
  import { useBase as b } from "../Base/useBase.js";
12
11
  import "../../shared/constants.js";
13
12
  import "classnames";
14
13
  import "../../contexts/ComponentAdapter/useComponentContext.js";
14
+ import "../../contexts/LoadingIndicatorProvider/useLoadingIndicator.js";
15
15
  import "dompurify";
16
- const M = ({
16
+ import "../../contexts/LocaleProvider/useLocale.js";
17
+ const O = ({
17
18
  companyId: e,
18
19
  payrollId: t,
19
20
  employeeUuids: o,
20
21
  sortBy: s
21
22
  }) => {
22
- const { mutateAsync: i, isPending: l } = h(), [r, d] = m(), { baseSubmitHandler: p } = b(), { data: u, isLoading: n } = f(
23
+ const { mutateAsync: i, isPending: l } = h(), [r, d] = P(), { baseSubmitHandler: p } = b(), { data: u, isLoading: n } = f(
23
24
  {
24
25
  companyId: e,
25
26
  payScheduleId: r?.payPeriod?.payScheduleUuid || ""
@@ -29,7 +30,7 @@ const M = ({
29
30
  }
30
31
  ), a = y(async () => {
31
32
  await p(null, async () => {
32
- const P = await i({
33
+ const m = await i({
33
34
  request: {
34
35
  companyId: e,
35
36
  payrollId: t,
@@ -39,7 +40,7 @@ const M = ({
39
40
  }
40
41
  }
41
42
  });
42
- d(P.payrollPrepared);
43
+ d(m.payrollPrepared);
43
44
  });
44
45
  }, [e, t, i, o, p]);
45
46
  S(() => {
@@ -54,6 +55,6 @@ const M = ({
54
55
  };
55
56
  };
56
57
  export {
57
- M as usePreparedPayrollData
58
+ O as usePreparedPayrollData
58
59
  };
59
60
  //# sourceMappingURL=usePreparedPayrollData.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePreparedPayrollData.js","sources":["../../../src/components/Payroll/usePreparedPayrollData.ts"],"sourcesContent":["import { useState, useEffect, useCallback } from 'react'\nimport { usePayrollsPrepareMutation } from '@gusto/embedded-api/react-query/payrollsPrepare'\nimport { usePaySchedulesGet } from '@gusto/embedded-api/react-query/paySchedulesGet'\nimport type { PayrollPrepared } from '@gusto/embedded-api/models/components/payrollprepared'\nimport type { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { PayrollPrepareSortBy } from '@gusto/embedded-api/models/components/payrollpreparesortby'\nimport { useBase } from '../Base'\n\ninterface UsePreparedPayrollDataParams {\n companyId: string\n payrollId: string\n employeeUuids?: string[]\n sortBy?: PayrollPrepareSortBy\n}\n\ninterface UsePreparedPayrollDataReturn {\n handlePreparePayroll: () => Promise<void>\n preparedPayroll: PayrollPrepared | undefined\n paySchedule: PayScheduleObject | undefined\n isLoading: boolean\n}\n\nexport const usePreparedPayrollData = ({\n companyId,\n payrollId,\n employeeUuids,\n sortBy,\n}: UsePreparedPayrollDataParams): UsePreparedPayrollDataReturn => {\n const { mutateAsync: preparePayroll, isPending: isPreparePayrollPending } =\n usePayrollsPrepareMutation()\n const [preparedPayroll, setPreparedPayroll] = useState<PayrollPrepared | undefined>()\n const { baseSubmitHandler } = useBase()\n\n const { data: payScheduleData, isLoading: isPayScheduleLoading } = usePaySchedulesGet(\n {\n companyId,\n payScheduleId: preparedPayroll?.payPeriod?.payScheduleUuid || '',\n },\n {\n enabled: !!preparedPayroll?.payPeriod?.payScheduleUuid,\n },\n )\n\n const handlePreparePayroll = useCallback(async () => {\n await baseSubmitHandler(null, async () => {\n const result = await preparePayroll({\n request: {\n companyId,\n payrollId,\n sortBy,\n requestBody: {\n employeeUuids,\n },\n },\n })\n setPreparedPayroll(result.payrollPrepared)\n })\n }, [companyId, payrollId, preparePayroll, employeeUuids, baseSubmitHandler])\n\n useEffect(() => {\n void handlePreparePayroll()\n }, [handlePreparePayroll])\n\n const isLoading = isPreparePayrollPending || isPayScheduleLoading\n\n return {\n handlePreparePayroll,\n preparedPayroll,\n paySchedule: payScheduleData?.payScheduleObject,\n isLoading,\n }\n}\n"],"names":["usePreparedPayrollData","companyId","payrollId","employeeUuids","sortBy","preparePayroll","isPreparePayrollPending","usePayrollsPrepareMutation","preparedPayroll","setPreparedPayroll","useState","baseSubmitHandler","useBase","payScheduleData","isPayScheduleLoading","usePaySchedulesGet","handlePreparePayroll","useCallback","result","useEffect","isLoading"],"mappings":";;;;;;;;;;;;;;;AAsBO,MAAMA,IAAyB,CAAC;AAAA,EACrC,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,QAAAC;AACF,MAAkE;AAChE,QAAM,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAC9CC,EAAA,GACI,CAACC,GAAiBC,CAAkB,IAAIC,EAAA,GACxC,EAAE,mBAAAC,EAAA,IAAsBC,EAAA,GAExB,EAAE,MAAMC,GAAiB,WAAWC,MAAyBC;AAAA,IACjE;AAAA,MACE,WAAAd;AAAA,MACA,eAAeO,GAAiB,WAAW,mBAAmB;AAAA,IAAA;AAAA,IAEhE;AAAA,MACE,SAAS,CAAC,CAACA,GAAiB,WAAW;AAAA,IAAA;AAAA,EACzC,GAGIQ,IAAuBC,EAAY,YAAY;AACnD,UAAMN,EAAkB,MAAM,YAAY;AACxC,YAAMO,IAAS,MAAMb,EAAe;AAAA,QAClC,SAAS;AAAA,UACP,WAAAJ;AAAA,UACA,WAAAC;AAAA,UACA,QAAAE;AAAA,UACA,aAAa;AAAA,YACX,eAAAD;AAAA,UAAA;AAAA,QACF;AAAA,MACF,CACD;AACD,MAAAM,EAAmBS,EAAO,eAAe;AAAA,IAC3C,CAAC;AAAA,EACH,GAAG,CAACjB,GAAWC,GAAWG,GAAgBF,GAAeQ,CAAiB,CAAC;AAE3E,EAAAQ,EAAU,MAAM;AACd,IAAKH,EAAA;AAAA,EACP,GAAG,CAACA,CAAoB,CAAC;AAEzB,QAAMI,IAAYd,KAA2BQ;AAE7C,SAAO;AAAA,IACL,sBAAAE;AAAA,IACA,iBAAAR;AAAA,IACA,aAAaK,GAAiB;AAAA,IAC9B,WAAAO;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"usePreparedPayrollData.js","sources":["../../../src/components/Payroll/usePreparedPayrollData.ts"],"sourcesContent":["import { useState, useEffect, useCallback } from 'react'\nimport { usePayrollsPrepareMutation } from '@gusto/embedded-api/react-query/payrollsPrepare'\nimport { usePaySchedulesGet } from '@gusto/embedded-api/react-query/paySchedulesGet'\nimport type { PayrollPrepared } from '@gusto/embedded-api/models/components/payrollprepared'\nimport type { PayScheduleObject } from '@gusto/embedded-api/models/components/payscheduleobject'\nimport type { PayrollPrepareSortBy } from '@gusto/embedded-api/models/components/payrollpreparesortby'\nimport { useBase } from '../Base'\n\ninterface UsePreparedPayrollDataParams {\n companyId: string\n payrollId: string\n employeeUuids?: string[]\n sortBy?: PayrollPrepareSortBy\n}\n\ninterface UsePreparedPayrollDataReturn {\n handlePreparePayroll: () => Promise<void>\n preparedPayroll: PayrollPrepared | undefined\n paySchedule: PayScheduleObject | undefined\n isLoading: boolean\n}\n\nexport const usePreparedPayrollData = ({\n companyId,\n payrollId,\n employeeUuids,\n sortBy,\n}: UsePreparedPayrollDataParams): UsePreparedPayrollDataReturn => {\n const { mutateAsync: preparePayroll, isPending: isPreparePayrollPending } =\n usePayrollsPrepareMutation()\n const [preparedPayroll, setPreparedPayroll] = useState<PayrollPrepared | undefined>()\n const { baseSubmitHandler } = useBase()\n\n const { data: payScheduleData, isLoading: isPayScheduleLoading } = usePaySchedulesGet(\n {\n companyId,\n payScheduleId: preparedPayroll?.payPeriod?.payScheduleUuid || '',\n },\n {\n enabled: !!preparedPayroll?.payPeriod?.payScheduleUuid,\n },\n )\n\n const handlePreparePayroll = useCallback(async () => {\n await baseSubmitHandler(null, async () => {\n const result = await preparePayroll({\n request: {\n companyId,\n payrollId,\n sortBy,\n requestBody: {\n employeeUuids,\n },\n },\n })\n setPreparedPayroll(result.payrollPrepared)\n })\n }, [companyId, payrollId, preparePayroll, employeeUuids, baseSubmitHandler])\n\n useEffect(() => {\n void handlePreparePayroll()\n }, [handlePreparePayroll])\n\n const isLoading = isPreparePayrollPending || isPayScheduleLoading\n\n return {\n handlePreparePayroll,\n preparedPayroll,\n paySchedule: payScheduleData?.payScheduleObject,\n isLoading,\n }\n}\n"],"names":["usePreparedPayrollData","companyId","payrollId","employeeUuids","sortBy","preparePayroll","isPreparePayrollPending","usePayrollsPrepareMutation","preparedPayroll","setPreparedPayroll","useState","baseSubmitHandler","useBase","payScheduleData","isPayScheduleLoading","usePaySchedulesGet","handlePreparePayroll","useCallback","result","useEffect","isLoading"],"mappings":";;;;;;;;;;;;;;;;AAsBO,MAAMA,IAAyB,CAAC;AAAA,EACrC,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAAC;AAAA,EACA,QAAAC;AACF,MAAkE;AAChE,QAAM,EAAE,aAAaC,GAAgB,WAAWC,EAAA,IAC9CC,EAAA,GACI,CAACC,GAAiBC,CAAkB,IAAIC,EAAA,GACxC,EAAE,mBAAAC,EAAA,IAAsBC,EAAA,GAExB,EAAE,MAAMC,GAAiB,WAAWC,MAAyBC;AAAA,IACjE;AAAA,MACE,WAAAd;AAAA,MACA,eAAeO,GAAiB,WAAW,mBAAmB;AAAA,IAAA;AAAA,IAEhE;AAAA,MACE,SAAS,CAAC,CAACA,GAAiB,WAAW;AAAA,IAAA;AAAA,EACzC,GAGIQ,IAAuBC,EAAY,YAAY;AACnD,UAAMN,EAAkB,MAAM,YAAY;AACxC,YAAMO,IAAS,MAAMb,EAAe;AAAA,QAClC,SAAS;AAAA,UACP,WAAAJ;AAAA,UACA,WAAAC;AAAA,UACA,QAAAE;AAAA,UACA,aAAa;AAAA,YACX,eAAAD;AAAA,UAAA;AAAA,QACF;AAAA,MACF,CACD;AACD,MAAAM,EAAmBS,EAAO,eAAe;AAAA,IAC3C,CAAC;AAAA,EACH,GAAG,CAACjB,GAAWC,GAAWG,GAAgBF,GAAeQ,CAAiB,CAAC;AAE3E,EAAAQ,EAAU,MAAM;AACd,IAAKH,EAAA;AAAA,EACP,GAAG,CAACA,CAAoB,CAAC;AAEzB,QAAMI,IAAYd,KAA2BQ;AAE7C,SAAO;AAAA,IACL,sBAAAE;AAAA,IACA,iBAAAR;AAAA,IACA,aAAaK,GAAiB;AAAA,IAC9B,WAAAO;AAAA,EAAA;AAEJ;"}