@gusto/embedded-react-sdk 0.24.1 → 0.26.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 (504) hide show
  1. package/CHANGELOG.md +118 -0
  2. package/dist/assets/icons/icon-file-jpg.svg.js +10 -0
  3. package/dist/assets/icons/icon-file-jpg.svg.js.map +1 -0
  4. package/dist/assets/icons/icon-file-pdf.svg.js +10 -0
  5. package/dist/assets/icons/icon-file-pdf.svg.js.map +1 -0
  6. package/dist/assets/icons/icon-file-png.svg.js +10 -0
  7. package/dist/assets/icons/icon-file-png.svg.js.map +1 -0
  8. package/dist/assets/icons/icon-trashcan.svg.js +10 -0
  9. package/dist/assets/icons/icon-trashcan.svg.js.map +1 -0
  10. package/dist/assets/icons/slash-circle.svg.js +10 -0
  11. package/dist/assets/icons/slash-circle.svg.js.map +1 -0
  12. package/dist/components/Base/Base.d.ts +1 -1
  13. package/dist/components/Base/Base.js +12 -13
  14. package/dist/components/Base/Base.js.map +1 -1
  15. package/dist/components/Common/Fields/FileInputField/FileInputField.d.ts +5 -0
  16. package/dist/components/Common/Fields/FileInputField/FileInputField.js +34 -0
  17. package/dist/components/Common/Fields/FileInputField/FileInputField.js.map +1 -0
  18. package/dist/components/Common/Fields/FileInputField/index.d.ts +2 -0
  19. package/dist/components/Common/PaginationControl/PaginationControl.js +41 -40
  20. package/dist/components/Common/PaginationControl/PaginationControl.js.map +1 -1
  21. package/dist/components/Common/PaginationControl/PaginationControlTypes.d.ts +1 -0
  22. package/dist/components/Common/SignatureForm/SignatureForm.js +2 -3
  23. package/dist/components/Common/SignatureForm/SignatureForm.js.map +1 -1
  24. package/dist/components/Common/SignatureForm/SignatureFormActions.js +3 -4
  25. package/dist/components/Common/SignatureForm/SignatureFormActions.js.map +1 -1
  26. package/dist/components/Common/SignatureForm/SignatureFormFields.js +6 -7
  27. package/dist/components/Common/SignatureForm/SignatureFormFields.js.map +1 -1
  28. package/dist/components/Common/UI/Alert/Alert.js +10 -10
  29. package/dist/components/Common/UI/Alert/Alert.js.map +1 -1
  30. package/dist/components/Common/UI/Alert/Alert.module.scss.js +14 -14
  31. package/dist/components/Common/UI/Badge/Badge.module.scss.js +1 -1
  32. package/dist/components/Common/UI/Banner/Banner.module.scss.js +4 -4
  33. package/dist/components/Common/UI/ComboBox/ComboBox.module.scss.js +6 -6
  34. package/dist/components/Common/UI/FileInput/FileInput.d.ts +2 -0
  35. package/dist/components/Common/UI/FileInput/FileInput.js +150 -0
  36. package/dist/components/Common/UI/FileInput/FileInput.js.map +1 -0
  37. package/dist/components/Common/UI/FileInput/FileInput.module.scss.js +36 -0
  38. package/dist/components/Common/UI/FileInput/FileInput.module.scss.js.map +1 -0
  39. package/dist/components/Common/UI/FileInput/FileInputTypes.d.ts +45 -0
  40. package/dist/components/Common/UI/FileInput/FileInputTypes.js +8 -0
  41. package/dist/components/Common/UI/FileInput/FileInputTypes.js.map +1 -0
  42. package/dist/components/Common/UI/FileInput/index.d.ts +4 -0
  43. package/dist/components/Common/UI/Input/Input.module.scss.js +7 -7
  44. package/dist/components/Common/UI/List/List.module.scss.js +1 -1
  45. package/dist/components/Common/UI/Modal/Modal.js +41 -40
  46. package/dist/components/Common/UI/Modal/Modal.js.map +1 -1
  47. package/dist/components/Common/UI/Modal/Modal.module.scss.js +4 -4
  48. package/dist/components/Common/UI/Select/Select.module.scss.js +6 -6
  49. package/dist/components/Common/UI/TextArea/TextArea.module.scss.js +4 -4
  50. package/dist/components/Common/UI/TextInput/TextInput.js +27 -23
  51. package/dist/components/Common/UI/TextInput/TextInput.js.map +1 -1
  52. package/dist/components/Common/UI/TextInput/TextInputTypes.d.ts +1 -1
  53. package/dist/components/Common/UI/TextInput/TextInputTypes.js.map +1 -1
  54. package/dist/components/Company/AssignSignatory/AssignSignatory.js +2 -3
  55. package/dist/components/Company/AssignSignatory/AssignSignatory.js.map +1 -1
  56. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js +2 -3
  57. package/dist/components/Company/AssignSignatory/AssignSignatorySelection.js.map +1 -1
  58. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js +2 -3
  59. package/dist/components/Company/AssignSignatory/CreateSignatory/Actions.js.map +1 -1
  60. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js +5 -6
  61. package/dist/components/Company/AssignSignatory/CreateSignatory/CreateSignatoryForm.js.map +1 -1
  62. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js +5 -4
  63. package/dist/components/Company/AssignSignatory/CreateSignatory/useCreateSignatory.js.map +1 -1
  64. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js +2 -3
  65. package/dist/components/Company/AssignSignatory/InviteSignatory/Actions.js.map +1 -1
  66. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js +4 -5
  67. package/dist/components/Company/AssignSignatory/InviteSignatory/InviteSignatoryForm.js.map +1 -1
  68. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js +5 -4
  69. package/dist/components/Company/AssignSignatory/InviteSignatory/useInviteSignatory.js.map +1 -1
  70. package/dist/components/Company/AssignSignatory/TitleSelect.js +3 -4
  71. package/dist/components/Company/AssignSignatory/TitleSelect.js.map +1 -1
  72. package/dist/components/Company/AssignSignatory/useAssignSignatory.js +7 -6
  73. package/dist/components/Company/AssignSignatory/useAssignSignatory.js.map +1 -1
  74. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js +8 -9
  75. package/dist/components/Company/BankAccount/BankAccountForm/Actions.js.map +1 -1
  76. package/dist/components/Company/BankAccount/BankAccountForm/Form.js +4 -5
  77. package/dist/components/Company/BankAccount/BankAccountForm/Form.js.map +1 -1
  78. package/dist/components/Company/BankAccount/BankAccountForm/context.js +5 -4
  79. package/dist/components/Company/BankAccount/BankAccountForm/context.js.map +1 -1
  80. package/dist/components/Company/BankAccount/BankAccountList/Actions.js +2 -3
  81. package/dist/components/Company/BankAccount/BankAccountList/Actions.js.map +1 -1
  82. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js +6 -7
  83. package/dist/components/Company/BankAccount/BankAccountVerify/Actions.js.map +1 -1
  84. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js +4 -5
  85. package/dist/components/Company/BankAccount/BankAccountVerify/Form.js.map +1 -1
  86. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js +2 -3
  87. package/dist/components/Company/DocumentSigner/DocumentList/Actions.js.map +1 -1
  88. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js +8 -9
  89. package/dist/components/Company/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  90. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js +5 -4
  91. package/dist/components/Company/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  92. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js +2 -3
  93. package/dist/components/Company/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  94. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js +5 -4
  95. package/dist/components/Company/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  96. package/dist/components/Company/FederalTaxes/Actions.js +6 -7
  97. package/dist/components/Company/FederalTaxes/Actions.js.map +1 -1
  98. package/dist/components/Company/FederalTaxes/FederalTaxes.js +2 -3
  99. package/dist/components/Company/FederalTaxes/FederalTaxes.js.map +1 -1
  100. package/dist/components/Company/FederalTaxes/Form.js +2 -3
  101. package/dist/components/Company/FederalTaxes/Form.js.map +1 -1
  102. package/dist/components/Company/FederalTaxes/useFederalTaxes.js +10 -9
  103. package/dist/components/Company/FederalTaxes/useFederalTaxes.js.map +1 -1
  104. package/dist/components/Company/Industry/Actions.js +7 -8
  105. package/dist/components/Company/Industry/Actions.js.map +1 -1
  106. package/dist/components/Company/Industry/Context.js +8 -7
  107. package/dist/components/Company/Industry/Context.js.map +1 -1
  108. package/dist/components/Company/Industry/Edit.js +2 -3
  109. package/dist/components/Company/Industry/Edit.js.map +1 -1
  110. package/dist/components/Company/Locations/LocationForm/Actions.js +6 -7
  111. package/dist/components/Company/Locations/LocationForm/Actions.js.map +1 -1
  112. package/dist/components/Company/Locations/LocationForm/Form.js +4 -5
  113. package/dist/components/Company/Locations/LocationForm/Form.js.map +1 -1
  114. package/dist/components/Company/Locations/LocationForm/LocationForm.js +2 -3
  115. package/dist/components/Company/Locations/LocationForm/LocationForm.js.map +1 -1
  116. package/dist/components/Company/Locations/LocationForm/useLocationForm.js +5 -4
  117. package/dist/components/Company/Locations/LocationForm/useLocationForm.js.map +1 -1
  118. package/dist/components/Company/Locations/LocationsList/Actions.js +2 -3
  119. package/dist/components/Company/Locations/LocationsList/Actions.js.map +1 -1
  120. package/dist/components/Company/Locations/LocationsList/List.js +31 -30
  121. package/dist/components/Company/Locations/LocationsList/List.js.map +1 -1
  122. package/dist/components/Company/Locations/LocationsList/LocationsList.js +29 -29
  123. package/dist/components/Company/Locations/LocationsList/LocationsList.js.map +1 -1
  124. package/dist/components/Company/Locations/LocationsList/useLocationsList.d.ts +1 -0
  125. package/dist/components/Company/Locations/LocationsList/useLocationsList.js +5 -4
  126. package/dist/components/Company/Locations/LocationsList/useLocationsList.js.map +1 -1
  127. package/dist/components/Company/OnboardingOverview/Completed.js +10 -11
  128. package/dist/components/Company/OnboardingOverview/Completed.js.map +1 -1
  129. package/dist/components/Company/OnboardingOverview/MissingRequirements.js +6 -7
  130. package/dist/components/Company/OnboardingOverview/MissingRequirements.js.map +1 -1
  131. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js +6 -7
  132. package/dist/components/Company/OnboardingOverview/OnboardingOverview.js.map +1 -1
  133. package/dist/components/Company/OnboardingOverview/context.js +5 -4
  134. package/dist/components/Company/OnboardingOverview/context.js.map +1 -1
  135. package/dist/components/Company/PaySchedule/PaySchedule.js +2 -3
  136. package/dist/components/Company/PaySchedule/PaySchedule.js.map +1 -1
  137. package/dist/components/Company/PaySchedule/_parts/Actions.js +2 -3
  138. package/dist/components/Company/PaySchedule/_parts/Actions.js.map +1 -1
  139. package/dist/components/Company/PaySchedule/_parts/Edit.js +9 -10
  140. package/dist/components/Company/PaySchedule/_parts/Edit.js.map +1 -1
  141. package/dist/components/Company/PaySchedule/_parts/Head.js +8 -9
  142. package/dist/components/Company/PaySchedule/_parts/Head.js.map +1 -1
  143. package/dist/components/Company/PaySchedule/_parts/List.js +5 -6
  144. package/dist/components/Company/PaySchedule/_parts/List.js.map +1 -1
  145. package/dist/components/Company/PaySchedule/usePaySchedule.js +7 -6
  146. package/dist/components/Company/PaySchedule/usePaySchedule.js.map +1 -1
  147. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js +2 -3
  148. package/dist/components/Company/StateTaxes/StateTaxesForm/Actions.js.map +1 -1
  149. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js +5 -4
  150. package/dist/components/Company/StateTaxes/StateTaxesForm/context.js.map +1 -1
  151. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js +2 -3
  152. package/dist/components/Company/StateTaxes/StateTaxesList/Actions.js.map +1 -1
  153. package/dist/components/Company/StateTaxes/StateTaxesList/List.js +2 -3
  154. package/dist/components/Company/StateTaxes/StateTaxesList/List.js.map +1 -1
  155. package/dist/components/Company/StateTaxes/StateTaxesList/context.js +5 -4
  156. package/dist/components/Company/StateTaxes/StateTaxesList/context.js.map +1 -1
  157. package/dist/components/Contractor/Address/Address.js +3 -4
  158. package/dist/components/Contractor/Address/Address.js.map +1 -1
  159. package/dist/components/Contractor/Address/Form.js +6 -7
  160. package/dist/components/Contractor/Address/Form.js.map +1 -1
  161. package/dist/components/Contractor/Address/useAddress.js +7 -6
  162. package/dist/components/Contractor/Address/useAddress.js.map +1 -1
  163. package/dist/components/Contractor/ContractorList/index.js +24 -24
  164. package/dist/components/Contractor/ContractorList/index.js.map +1 -1
  165. package/dist/components/Contractor/NewHireReport/NewHireReport.js +13 -14
  166. package/dist/components/Contractor/NewHireReport/NewHireReport.js.map +1 -1
  167. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +10 -11
  168. package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
  169. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js +2 -3
  170. package/dist/components/Contractor/PaymentMethod/PaymentMethod.js.map +1 -1
  171. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js +2 -3
  172. package/dist/components/Contractor/PaymentMethod/PaymentTypeForm.js.map +1 -1
  173. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js +108 -92
  174. package/dist/components/Contractor/Payments/CreatePayment/CreatePayment.js.map +1 -1
  175. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js +33 -32
  176. package/dist/components/Contractor/Payments/CreatePayment/CreatePaymentPresentation.js.map +1 -1
  177. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js +25 -7
  178. package/dist/components/Contractor/Payments/CreatePayment/EditContractorPaymentPresentation.js.map +1 -1
  179. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.d.ts +8 -0
  180. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js +58 -0
  181. package/dist/components/Contractor/Payments/CreatePayment/FastAchSubmissionBlockerBanner.js.map +1 -0
  182. package/dist/components/Contractor/Payments/CreatePayment/GenericBlocker.d.ts +6 -0
  183. package/dist/components/Contractor/Payments/CreatePayment/GenericBlocker.js +18 -0
  184. package/dist/components/Contractor/Payments/CreatePayment/GenericBlocker.js.map +1 -0
  185. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.d.ts +5 -1
  186. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js +84 -52
  187. package/dist/components/Contractor/Payments/CreatePayment/PreviewPresentation.js.map +1 -1
  188. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.d.ts +4 -0
  189. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js +32 -13
  190. package/dist/components/Contractor/Payments/PaymentFlow/PaymentFlowComponents.js.map +1 -1
  191. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.d.ts +2 -0
  192. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js +100 -53
  193. package/dist/components/Contractor/Payments/PaymentFlow/paymentStateMachine.js.map +1 -1
  194. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.d.ts +1 -2
  195. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js +46 -21
  196. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistory.js.map +1 -1
  197. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.d.ts +6 -15
  198. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js +115 -100
  199. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.js.map +1 -1
  200. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.module.scss.js +8 -0
  201. package/dist/components/Contractor/Payments/PaymentHistory/PaymentHistoryPresentation.module.scss.js.map +1 -0
  202. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.d.ts +8 -0
  203. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js +51 -0
  204. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatement.js.map +1 -0
  205. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.d.ts +11 -0
  206. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js +155 -0
  207. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.js.map +1 -0
  208. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js +22 -0
  209. package/dist/components/Contractor/Payments/PaymentStatement/PaymentStatementPresentation.module.scss.js.map +1 -0
  210. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.d.ts +8 -0
  211. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js +45 -0
  212. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummary.js.map +1 -0
  213. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.d.ts +15 -0
  214. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js +125 -0
  215. package/dist/components/Contractor/Payments/PaymentSummary/PaymentSummaryPresentation.js.map +1 -0
  216. package/dist/components/Contractor/Payments/PaymentSummary/index.d.ts +3 -0
  217. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js +37 -28
  218. package/dist/components/Contractor/Payments/PaymentsList/PaymentsList.js.map +1 -1
  219. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.d.ts +5 -1
  220. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js +61 -60
  221. package/dist/components/Contractor/Payments/PaymentsList/PaymentsListPresentation.js.map +1 -1
  222. package/dist/components/Contractor/Profile/useContractorProfile.js +1 -1
  223. package/dist/components/Contractor/Submit/Submit.js +19 -20
  224. package/dist/components/Contractor/Submit/Submit.js.map +1 -1
  225. package/dist/components/Employee/Compensation/Actions.js +12 -13
  226. package/dist/components/Employee/Compensation/Actions.js.map +1 -1
  227. package/dist/components/Employee/Compensation/Edit.js +2 -3
  228. package/dist/components/Employee/Compensation/Edit.js.map +1 -1
  229. package/dist/components/Employee/Compensation/List.js +22 -23
  230. package/dist/components/Employee/Compensation/List.js.map +1 -1
  231. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js +4 -3
  232. package/dist/components/Employee/Deductions/DeductionsForm/ChildSupportForm.js.map +1 -1
  233. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js +4 -3
  234. package/dist/components/Employee/Deductions/DeductionsForm/CustomDeductionForm.js.map +1 -1
  235. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js +4 -3
  236. package/dist/components/Employee/Deductions/DeductionsForm/GarnishmentForm.js.map +1 -1
  237. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js +2 -3
  238. package/dist/components/Employee/Deductions/DeductionsList/DeductionsList.js.map +1 -1
  239. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js +2 -3
  240. package/dist/components/Employee/Deductions/IncludeDeductions/IncludeDeductions.js.map +1 -1
  241. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js +2 -3
  242. package/dist/components/Employee/DocumentSigner/DocumentList/Actions.js.map +1 -1
  243. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js +2 -3
  244. package/dist/components/Employee/DocumentSigner/DocumentList/DocumentList.js.map +1 -1
  245. package/dist/components/Employee/DocumentSigner/DocumentList/List.js +2 -3
  246. package/dist/components/Employee/DocumentSigner/DocumentList/List.js.map +1 -1
  247. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js +5 -4
  248. package/dist/components/Employee/DocumentSigner/DocumentList/useDocumentList.js.map +1 -1
  249. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js +2 -3
  250. package/dist/components/Employee/DocumentSigner/SignatureForm/SignatureForm.js.map +1 -1
  251. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js +5 -4
  252. package/dist/components/Employee/DocumentSigner/SignatureForm/useSignatureForm.js.map +1 -1
  253. package/dist/components/Employee/EmployeeList/Actions.js +6 -7
  254. package/dist/components/Employee/EmployeeList/Actions.js.map +1 -1
  255. package/dist/components/Employee/EmployeeList/EmployeeList.js +55 -54
  256. package/dist/components/Employee/EmployeeList/EmployeeList.js.map +1 -1
  257. package/dist/components/Employee/EmployeeList/Head.js +5 -6
  258. package/dist/components/Employee/EmployeeList/Head.js.map +1 -1
  259. package/dist/components/Employee/EmployeeList/List.js +32 -31
  260. package/dist/components/Employee/EmployeeList/List.js.map +1 -1
  261. package/dist/components/Employee/EmployeeList/useEmployeeList.d.ts +1 -0
  262. package/dist/components/Employee/EmployeeList/useEmployeeList.js +5 -4
  263. package/dist/components/Employee/EmployeeList/useEmployeeList.js.map +1 -1
  264. package/dist/components/Employee/EmploymentEligibility/EmploymentEligibility.d.ts +3 -0
  265. package/dist/components/Employee/EmploymentEligibility/EmploymentEligibilityPresentation.d.ts +37 -0
  266. package/dist/components/Employee/EmploymentEligibility/index.d.ts +4 -0
  267. package/dist/components/Employee/FederalTaxes/Actions.js +5 -6
  268. package/dist/components/Employee/FederalTaxes/Actions.js.map +1 -1
  269. package/dist/components/Employee/FederalTaxes/FederalForm.js +4 -5
  270. package/dist/components/Employee/FederalTaxes/FederalForm.js.map +1 -1
  271. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js +5 -4
  272. package/dist/components/Employee/FederalTaxes/useFederalTaxes.js.map +1 -1
  273. package/dist/components/Employee/Landing/Landing.js +2 -3
  274. package/dist/components/Employee/Landing/Landing.js.map +1 -1
  275. package/dist/components/Employee/PaymentMethod/Actions.js +5 -6
  276. package/dist/components/Employee/PaymentMethod/Actions.js.map +1 -1
  277. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +2 -3
  278. package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
  279. package/dist/components/Employee/PaymentMethod/BankAccountsList.js +2 -3
  280. package/dist/components/Employee/PaymentMethod/BankAccountsList.js.map +1 -1
  281. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js +5 -6
  282. package/dist/components/Employee/PaymentMethod/PaymentTypeForm.js.map +1 -1
  283. package/dist/components/Employee/PaymentMethod/Split.js +2 -3
  284. package/dist/components/Employee/PaymentMethod/Split.js.map +1 -1
  285. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js +7 -6
  286. package/dist/components/Employee/PaymentMethod/usePaymentMethod.js.map +1 -1
  287. package/dist/components/Employee/Profile/Actions.js +5 -6
  288. package/dist/components/Employee/Profile/Actions.js.map +1 -1
  289. package/dist/components/Employee/Profile/AdminPersonalDetails.js +4 -5
  290. package/dist/components/Employee/Profile/AdminPersonalDetails.js.map +1 -1
  291. package/dist/components/Employee/Profile/HomeAddress.js +8 -9
  292. package/dist/components/Employee/Profile/HomeAddress.js.map +1 -1
  293. package/dist/components/Employee/Profile/PersonalDetailsInputs.js +8 -9
  294. package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
  295. package/dist/components/Employee/Profile/useProfile.js +5 -4
  296. package/dist/components/Employee/Profile/useProfile.js.map +1 -1
  297. package/dist/components/Employee/StateTaxes/Actions.js +5 -6
  298. package/dist/components/Employee/StateTaxes/Actions.js.map +1 -1
  299. package/dist/components/Employee/StateTaxes/useStateTaxes.js +5 -4
  300. package/dist/components/Employee/StateTaxes/useStateTaxes.js.map +1 -1
  301. package/dist/components/Employee/Taxes/Actions.js +6 -7
  302. package/dist/components/Employee/Taxes/Actions.js.map +1 -1
  303. package/dist/components/Employee/Taxes/FederalForm.js +6 -7
  304. package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
  305. package/dist/components/Employee/Taxes/useTaxes.js +5 -4
  306. package/dist/components/Employee/Taxes/useTaxes.js.map +1 -1
  307. package/dist/components/Flow/Flow.js +7 -8
  308. package/dist/components/Flow/Flow.js.map +1 -1
  309. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.d.ts +15 -0
  310. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js +162 -0
  311. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.js.map +1 -0
  312. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js +20 -0
  313. package/dist/components/InformationRequests/InformationRequestForm/InformationRequestForm.module.scss.js.map +1 -0
  314. package/dist/components/InformationRequests/InformationRequestForm/index.d.ts +2 -0
  315. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.d.ts +8 -0
  316. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js +96 -0
  317. package/dist/components/InformationRequests/InformationRequestList/InformationRequestList.js.map +1 -0
  318. package/dist/components/InformationRequests/InformationRequestList/index.d.ts +2 -0
  319. package/dist/components/InformationRequests/InformationRequests.d.ts +7 -0
  320. package/dist/components/InformationRequests/InformationRequests.js +68 -0
  321. package/dist/components/InformationRequests/InformationRequests.js.map +1 -0
  322. package/dist/components/InformationRequests/InformationRequestsComponents.d.ts +19 -0
  323. package/dist/components/InformationRequests/InformationRequestsComponents.js +20 -0
  324. package/dist/components/InformationRequests/InformationRequestsComponents.js.map +1 -0
  325. package/dist/components/InformationRequests/index.d.ts +4 -0
  326. package/dist/components/InformationRequests/index.js +9 -0
  327. package/dist/components/InformationRequests/index.js.map +1 -0
  328. package/dist/components/InformationRequests/informationRequestsStateMachine.d.ts +13 -0
  329. package/dist/components/InformationRequests/informationRequestsStateMachine.js +47 -0
  330. package/dist/components/InformationRequests/informationRequestsStateMachine.js.map +1 -0
  331. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js +69 -59
  332. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsBanner/ConfirmWireDetailsBanner.js.map +1 -1
  333. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js +0 -1
  334. package/dist/components/Payroll/ConfirmWireDetails/ConfirmWireDetailsForm/ConfirmWireDetailsForm.js.map +1 -1
  335. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js +61 -52
  336. package/dist/components/Payroll/ConfirmWireDetails/WireInstructions/WireInstructions.js.map +1 -1
  337. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js +17 -18
  338. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerAlerts.js.map +1 -1
  339. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.d.ts +5 -13
  340. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js +102 -27
  341. package/dist/components/Payroll/PayrollBlocker/components/PayrollBlockerList.js.map +1 -1
  342. package/dist/components/Payroll/PayrollBlocker/index.d.ts +0 -1
  343. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js +14 -14
  344. package/dist/components/Payroll/PayrollBlocker/payrollHelpers.js.map +1 -1
  345. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js +116 -130
  346. package/dist/components/Payroll/PayrollConfiguration/PayrollConfiguration.js.map +1 -1
  347. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.d.ts +6 -3
  348. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js +165 -156
  349. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.js.map +1 -1
  350. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js +2 -4
  351. package/dist/components/Payroll/PayrollConfiguration/PayrollConfigurationPresentation.module.scss.js.map +1 -1
  352. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.d.ts +21 -0
  353. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js +105 -0
  354. package/dist/components/Payroll/PayrollConfiguration/usePayrollConfigurationData.js.map +1 -0
  355. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js +41 -37
  356. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployee.js.map +1 -1
  357. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.d.ts +5 -4
  358. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js +151 -146
  359. package/dist/components/Payroll/PayrollEditEmployee/PayrollEditEmployeePresentation.js.map +1 -1
  360. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js +6 -6
  361. package/dist/components/Payroll/PayrollEditEmployee/TimeOffField.js.map +1 -1
  362. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.d.ts +1 -0
  363. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js +45 -38
  364. package/dist/components/Payroll/PayrollFlow/PayrollFlowComponents.js.map +1 -1
  365. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.d.ts +2 -0
  366. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js +179 -97
  367. package/dist/components/Payroll/PayrollFlow/payrollStateMachine.js.map +1 -1
  368. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js +28 -28
  369. package/dist/components/Payroll/PayrollHistory/PayrollHistory.js.map +1 -1
  370. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.d.ts +2 -2
  371. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js +86 -106
  372. package/dist/components/Payroll/PayrollHistory/PayrollHistoryPresentation.js.map +1 -1
  373. package/dist/components/Payroll/PayrollLanding/PayrollLanding.d.ts +2 -1
  374. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js +28 -22
  375. package/dist/components/Payroll/PayrollLanding/PayrollLanding.js.map +1 -1
  376. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.d.ts +4 -0
  377. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js +74 -47
  378. package/dist/components/Payroll/PayrollLanding/PayrollLandingFlowComponents.js.map +1 -1
  379. package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.d.ts +2 -0
  380. package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js +159 -57
  381. package/dist/components/Payroll/PayrollLanding/payrollLandingStateMachine.js.map +1 -1
  382. package/dist/components/Payroll/PayrollList/PayrollList.js +14 -17
  383. package/dist/components/Payroll/PayrollList/PayrollList.js.map +1 -1
  384. package/dist/components/Payroll/PayrollList/PayrollListPresentation.d.ts +1 -2
  385. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js +137 -132
  386. package/dist/components/Payroll/PayrollList/PayrollListPresentation.js.map +1 -1
  387. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js +8 -4
  388. package/dist/components/Payroll/PayrollList/PayrollListPresentation.module.scss.js.map +1 -1
  389. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js +102 -96
  390. package/dist/components/Payroll/PayrollOverview/PayrollOverview.js.map +1 -1
  391. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.d.ts +7 -5
  392. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js +253 -250
  393. package/dist/components/Payroll/PayrollOverview/PayrollOverviewPresentation.js.map +1 -1
  394. package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.d.ts +6 -0
  395. package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.js +5 -0
  396. package/dist/components/Payroll/PayrollOverview/PayrollOverviewTypes.js.map +1 -0
  397. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.d.ts +2 -2
  398. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js +2 -3
  399. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/FastAchSubmissionBlockerBanner.js.map +1 -1
  400. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.d.ts +2 -2
  401. package/dist/components/Payroll/PayrollOverview/SubmissionBlockers/GenericBlocker.js.map +1 -1
  402. package/dist/components/Payroll/RecoveryCases/RecoveryCaseErrorCode.module.scss.js +8 -0
  403. package/dist/components/Payroll/RecoveryCases/RecoveryCaseErrorCode.module.scss.js.map +1 -0
  404. package/dist/components/Payroll/RecoveryCases/RecoveryCases.d.ts +6 -0
  405. package/dist/components/Payroll/RecoveryCases/RecoveryCases.js +55 -0
  406. package/dist/components/Payroll/RecoveryCases/RecoveryCases.js.map +1 -0
  407. package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.d.ts +19 -0
  408. package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.js +19 -0
  409. package/dist/components/Payroll/RecoveryCases/RecoveryCasesComponents.js.map +1 -0
  410. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.d.ts +7 -0
  411. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js +104 -0
  412. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.js.map +1 -0
  413. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.module.scss.js +8 -0
  414. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/RecoveryCasesList.module.scss.js.map +1 -0
  415. package/dist/components/Payroll/RecoveryCases/RecoveryCasesList/index.d.ts +2 -0
  416. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.d.ts +14 -0
  417. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js +69 -0
  418. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/RecoveryCasesResubmit.js.map +1 -0
  419. package/dist/components/Payroll/RecoveryCases/RecoveryCasesResubmit/index.d.ts +2 -0
  420. package/dist/components/Payroll/RecoveryCases/index.d.ts +3 -0
  421. package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.d.ts +13 -0
  422. package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js +47 -0
  423. package/dist/components/Payroll/RecoveryCases/recoveryCasesStateMachine.js.map +1 -0
  424. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.d.ts +7 -0
  425. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js +65 -0
  426. package/dist/components/Payroll/RecoveryCases/useRecoveryCaseErrorCode.js.map +1 -0
  427. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.d.ts +1 -1
  428. package/dist/components/Payroll/UNSTABLE_PayrollHooks/PayrollConfiguration/PayrollConfigurationContext.js.map +1 -1
  429. package/dist/components/Payroll/helpers.d.ts +12 -0
  430. package/dist/components/Payroll/helpers.js +129 -117
  431. package/dist/components/Payroll/helpers.js.map +1 -1
  432. package/dist/components/Payroll/index.d.ts +2 -1
  433. package/dist/components/Payroll/index.js +12 -10
  434. package/dist/components/Payroll/index.js.map +1 -1
  435. package/dist/components/Payroll/usePreparedPayrollData.d.ts +5 -2
  436. package/dist/components/Payroll/usePreparedPayrollData.js +44 -32
  437. package/dist/components/Payroll/usePreparedPayrollData.js.map +1 -1
  438. package/dist/components/index.d.ts +1 -0
  439. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js +27 -25
  440. package/dist/contexts/ComponentAdapter/adapters/defaultComponentAdapter.js.map +1 -1
  441. package/dist/contexts/ComponentAdapter/componentAdapterTypes.d.ts +1 -0
  442. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.d.ts +5 -0
  443. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js +17 -15
  444. package/dist/contexts/ComponentAdapter/createComponentsWithDefaults.js.map +1 -1
  445. package/dist/contexts/ComponentAdapter/useComponentContext.d.ts +2 -0
  446. package/dist/contexts/ComponentAdapter/useComponentContext.js +3 -3
  447. package/dist/contexts/ComponentAdapter/useComponentContext.js.map +1 -1
  448. package/dist/contexts/GustoProvider/GustoProviderCustomUIAdapter.js +1 -1
  449. package/dist/contexts/ThemeProvider/theme.js +5 -5
  450. package/dist/contexts/ThemeProvider/theme.js.map +1 -1
  451. package/dist/helpers/dateFormatting.d.ts +1 -0
  452. package/dist/helpers/dateFormatting.js +1 -0
  453. package/dist/helpers/dateFormatting.js.map +1 -1
  454. package/dist/helpers/formattedStrings.d.ts +1 -0
  455. package/dist/helpers/formattedStrings.js +27 -21
  456. package/dist/helpers/formattedStrings.js.map +1 -1
  457. package/dist/helpers/responsive.js +1 -1
  458. package/dist/helpers/responsive.js.map +1 -1
  459. package/dist/i18n/I18n.js +9 -9
  460. package/dist/i18n/I18n.js.map +1 -1
  461. package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js +44 -36
  462. package/dist/i18n/en/Contractor.Payments.CreatePayment.json.js.map +1 -1
  463. package/dist/i18n/en/Contractor.Payments.PaymentHistory.json.js +11 -11
  464. package/dist/i18n/en/Contractor.Payments.PaymentStatement.json.js +28 -0
  465. package/dist/i18n/en/Contractor.Payments.PaymentStatement.json.js.map +1 -0
  466. package/dist/i18n/en/Contractor.Payments.PaymentSummary.json.js +58 -0
  467. package/dist/i18n/en/Contractor.Payments.PaymentSummary.json.js.map +1 -0
  468. package/dist/i18n/en/Contractor.Payments.PaymentsList.json.js +14 -14
  469. package/dist/i18n/en/Employee.EmploymentEligibility.json.js +28 -0
  470. package/dist/i18n/en/Employee.EmploymentEligibility.json.js.map +1 -0
  471. package/dist/i18n/en/InformationRequests.InformationRequestForm.json.js +20 -0
  472. package/dist/i18n/en/InformationRequests.InformationRequestForm.json.js.map +1 -0
  473. package/dist/i18n/en/InformationRequests.InformationRequestList.json.js +18 -0
  474. package/dist/i18n/en/InformationRequests.InformationRequestList.json.js.map +1 -0
  475. package/dist/i18n/en/Payroll.ConfirmWireDetailsBanner.json.js +1 -1
  476. package/dist/i18n/en/Payroll.PayrollBlocker.json.js +24 -20
  477. package/dist/i18n/en/Payroll.PayrollBlocker.json.js.map +1 -1
  478. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js +27 -21
  479. package/dist/i18n/en/Payroll.PayrollConfiguration.json.js.map +1 -1
  480. package/dist/i18n/en/Payroll.PayrollHistory.json.js +6 -6
  481. package/dist/i18n/en/Payroll.PayrollLanding.json.js +7 -3
  482. package/dist/i18n/en/Payroll.PayrollLanding.json.js.map +1 -1
  483. package/dist/i18n/en/Payroll.PayrollOverview.json.js +32 -28
  484. package/dist/i18n/en/Payroll.PayrollOverview.json.js.map +1 -1
  485. package/dist/i18n/en/Payroll.RecoveryCasesList.json.js +18 -0
  486. package/dist/i18n/en/Payroll.RecoveryCasesList.json.js.map +1 -0
  487. package/dist/i18n/en/Payroll.RecoveryCasesResubmit.json.js +10 -0
  488. package/dist/i18n/en/Payroll.RecoveryCasesResubmit.json.js.map +1 -0
  489. package/dist/i18n/en/Payroll.WireInstructions.json.js +20 -16
  490. package/dist/i18n/en/Payroll.WireInstructions.json.js.map +1 -1
  491. package/dist/i18n/en/common.json.d.ts +5 -0
  492. package/dist/i18n/en/common.json.js +4 -2
  493. package/dist/i18n/en/common.json.js.map +1 -1
  494. package/dist/index.js +10 -8
  495. package/dist/index.js.map +1 -1
  496. package/dist/shared/constants.d.ts +30 -0
  497. package/dist/shared/constants.js +73 -54
  498. package/dist/shared/constants.js.map +1 -1
  499. package/dist/style.css +1 -1
  500. package/dist/types/i18next.d.ts +321 -3
  501. package/package.json +32 -21
  502. package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.d.ts +0 -6
  503. package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.js +0 -32
  504. package/dist/components/Payroll/PayrollBlocker/PayrollBlocker.js.map +0 -1
@@ -0,0 +1,162 @@
1
+ import { jsx as e, jsxs as m } from "react/jsx-runtime";
2
+ import { useTranslation as D } from "react-i18next";
3
+ import { useForm as z, FormProvider as H } from "react-hook-form";
4
+ import { zodResolver as K } from "@hookform/resolvers/zod";
5
+ import { z as f } from "zod";
6
+ import { useIsMutating as V } from "@tanstack/react-query";
7
+ import { useInformationRequestsGetInformationRequestsSuspense as P } from "@gusto/embedded-api/react-query/informationRequestsGetInformationRequests";
8
+ import { useInformationRequestsSubmitMutation as W, mutationKeyInformationRequestsSubmit as Y } from "@gusto/embedded-api/react-query/informationRequestsSubmit";
9
+ import { ResponseType as u } from "@gusto/embedded-api/models/components/informationrequest";
10
+ import { ResponseType as S } from "@gusto/embedded-api/models/operations/submitinformationrequest";
11
+ import r from "./InformationRequestForm.module.scss.js";
12
+ import { BaseComponent as G } from "../../Base/Base.js";
13
+ import { useBase as $ } from "../../Base/useBase.js";
14
+ import { Flex as y } from "../../Common/Flex/Flex.js";
15
+ import { useComponentContext as C } from "../../../contexts/ComponentAdapter/useComponentContext.js";
16
+ import "react";
17
+ import { FileInputField as J } from "../../Common/Fields/FileInputField/FileInputField.js";
18
+ import { Form as X } from "../../Common/Form/Form.js";
19
+ import { useComponentDictionary as Z, useI18n as w } from "../../../i18n/I18n.js";
20
+ import { informationRequestEvents as M } from "../../../shared/constants.js";
21
+ import { useFlow as ee } from "../../Flow/useFlow.js";
22
+ import { TextInputField as ne } from "../../Common/Fields/TextInputField/TextInputField.js";
23
+ const _ = "gusto-sdk-information-request-form", te = ["image/jpeg", "image/png", "application/pdf"], oe = f.record(
24
+ f.string(),
25
+ f.union([f.string().min(1), f.instanceof(File)])
26
+ );
27
+ function se(o) {
28
+ return /* @__PURE__ */ e(G, { ...o, children: /* @__PURE__ */ e(ue, { ...o, children: o.children }) });
29
+ }
30
+ const re = (o) => new Promise((s, i) => {
31
+ const n = new FileReader();
32
+ n.onload = () => {
33
+ s(n.result);
34
+ }, n.onerror = i, n.readAsDataURL(o);
35
+ }), ie = [u.Text, u.Document];
36
+ function A(o) {
37
+ return o.some(
38
+ (s) => s.responseType && !ie.includes(s.responseType)
39
+ );
40
+ }
41
+ function ae(o) {
42
+ return o.some((s) => s.responseType === u.Persona);
43
+ }
44
+ function ue({ companyId: o, requestId: s, dictionary: i }) {
45
+ Z("InformationRequests.InformationRequestForm", i), w("InformationRequests.InformationRequestForm");
46
+ const { t: n } = D("InformationRequests.InformationRequestForm"), { Alert: q, Heading: T, Text: c } = C(), { onEvent: I, baseSubmitHandler: g } = $(), { data: N } = P({
47
+ companyUuid: o
48
+ }), l = N.informationRequestList?.find((t) => t.uuid === s), a = l?.requiredQuestions ?? [], F = l?.blockingPayroll ?? !1, O = A(a), b = ae(a), { mutateAsync: Q } = W(), v = {}, U = [];
49
+ a.forEach((t) => {
50
+ !t.questionUuid || !t.responseType || (t.responseType === u.Text ? (U.push(t.questionUuid), v[t.questionUuid] = "") : t.responseType === u.Document && (U.push(t.questionUuid), v[t.questionUuid] = void 0));
51
+ });
52
+ const E = z({
53
+ resolver: K(oe),
54
+ defaultValues: v
55
+ }), k = async (t) => {
56
+ await g(t, async () => {
57
+ const h = (await Promise.all(
58
+ U.map(async (p) => {
59
+ const d = t[p];
60
+ if (typeof d == "string")
61
+ return {
62
+ questionUuid: p,
63
+ responseType: S.Text,
64
+ textResponse: d
65
+ };
66
+ if (d instanceof File) {
67
+ const B = await re(d);
68
+ return {
69
+ questionUuid: p,
70
+ responseType: S.Document,
71
+ fileResponse: B,
72
+ fileName: d.name
73
+ };
74
+ }
75
+ return null;
76
+ })
77
+ )).filter((p) => p !== null), x = await Q({
78
+ request: {
79
+ informationRequestUuid: s,
80
+ requestBody: {
81
+ requiredQuestions: h
82
+ }
83
+ }
84
+ });
85
+ I(M.INFORMATION_REQUEST_FORM_DONE, x.informationRequest);
86
+ });
87
+ }, L = (t) => {
88
+ if (!t.questionUuid || !t.responseType) return null;
89
+ const R = t.questionUuid, h = t.responseType === u.Document, x = t.responseType === u.Text;
90
+ return /* @__PURE__ */ m("div", { className: r.questionCard, children: [
91
+ /* @__PURE__ */ m("div", { className: r.questionDescription, children: [
92
+ /* @__PURE__ */ e(c, { weight: "medium", children: n(h ? "questionTypes.document" : "questionTypes.answer") }),
93
+ /* @__PURE__ */ e(c, { children: t.questionText })
94
+ ] }),
95
+ /* @__PURE__ */ e("hr", { className: r.divider }),
96
+ x && /* @__PURE__ */ e("div", { className: r.textInputWrapper, children: /* @__PURE__ */ e(
97
+ ne,
98
+ {
99
+ name: R,
100
+ label: n("fields.textAnswer.label"),
101
+ placeholder: n("fields.textAnswer.placeholder"),
102
+ isRequired: !0,
103
+ errorMessage: n("validation.required")
104
+ }
105
+ ) }),
106
+ h && /* @__PURE__ */ e("div", { className: r.fileInputWrapper, children: /* @__PURE__ */ e(
107
+ J,
108
+ {
109
+ name: R,
110
+ label: n("fields.fileUpload.label"),
111
+ accept: te,
112
+ isRequired: !0,
113
+ errorMessage: n("validation.required")
114
+ }
115
+ ) })
116
+ ] }, R);
117
+ }, j = /* @__PURE__ */ m("div", { className: r.questionCard, children: [
118
+ /* @__PURE__ */ m("div", { className: r.questionDescription, children: [
119
+ /* @__PURE__ */ e(c, { weight: "medium", children: n(b ? "unsupported.persona.title" : "unsupported.generic.title") }),
120
+ /* @__PURE__ */ e(c, { children: n(
121
+ b ? "unsupported.persona.description" : "unsupported.generic.description"
122
+ ) })
123
+ ] }),
124
+ /* @__PURE__ */ e("hr", { className: r.divider }),
125
+ /* @__PURE__ */ e("div", { className: r.contactSupport, children: /* @__PURE__ */ e(c, { variant: "supporting", children: n("unsupported.contactSupport") }) })
126
+ ] });
127
+ return /* @__PURE__ */ e("div", { className: r.root, children: /* @__PURE__ */ m(y, { flexDirection: "column", gap: 16, children: [
128
+ /* @__PURE__ */ e(T, { as: "h2", children: n("title") }),
129
+ F && /* @__PURE__ */ e(q, { status: "error", label: n("blockingAlert.title"), disableScrollIntoView: !0, children: n("blockingAlert.description") }),
130
+ O ? j : /* @__PURE__ */ e(H, { ...E, children: /* @__PURE__ */ e(X, { id: _, onSubmit: E.handleSubmit(k), children: /* @__PURE__ */ e(y, { flexDirection: "column", gap: 16, children: a.map(L) }) }) })
131
+ ] }) });
132
+ }
133
+ const ce = ({ onEvent: o }) => {
134
+ w("InformationRequests.InformationRequestForm");
135
+ const { t: s } = D("InformationRequests.InformationRequestForm"), { Button: i } = C(), { companyId: n, selectedRequestId: q } = ee(), { data: T } = P({
136
+ companyUuid: n
137
+ }), I = T.informationRequestList?.find(
138
+ (F) => F.uuid === q
139
+ )?.requiredQuestions ?? [], g = A(I), l = V({
140
+ mutationKey: Y()
141
+ }) > 0, a = () => {
142
+ o(M.INFORMATION_REQUEST_FORM_CANCEL);
143
+ };
144
+ return g ? /* @__PURE__ */ e(y, { justifyContent: "flex-end", gap: 12, children: /* @__PURE__ */ e(i, { variant: "secondary", onClick: a, children: s("cta.close") }) }) : /* @__PURE__ */ m(y, { justifyContent: "flex-end", gap: 12, children: [
145
+ /* @__PURE__ */ e(i, { variant: "secondary", onClick: a, isDisabled: l, children: s("cta.cancel") }),
146
+ /* @__PURE__ */ e(
147
+ i,
148
+ {
149
+ variant: "primary",
150
+ type: "submit",
151
+ form: _,
152
+ isLoading: l,
153
+ children: s("cta.submit")
154
+ }
155
+ )
156
+ ] });
157
+ };
158
+ se.Footer = ce;
159
+ export {
160
+ se as InformationRequestForm
161
+ };
162
+ //# sourceMappingURL=InformationRequestForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InformationRequestForm.js","sources":["../../../../src/components/InformationRequests/InformationRequestForm/InformationRequestForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { FormProvider, useForm } from 'react-hook-form'\nimport { zodResolver } from '@hookform/resolvers/zod'\nimport { z } from 'zod'\nimport { useIsMutating } from '@tanstack/react-query'\nimport { useInformationRequestsGetInformationRequestsSuspense } from '@gusto/embedded-api/react-query/informationRequestsGetInformationRequests'\nimport {\n useInformationRequestsSubmitMutation,\n mutationKeyInformationRequestsSubmit,\n} from '@gusto/embedded-api/react-query/informationRequestsSubmit'\nimport type { RequiredQuestions } from '@gusto/embedded-api/models/components/informationrequest'\nimport { ResponseType } from '@gusto/embedded-api/models/components/informationrequest'\nimport { ResponseType as SubmitResponseType } from '@gusto/embedded-api/models/operations/submitinformationrequest'\nimport type { InformationRequestsContextInterface } from '../InformationRequestsComponents'\nimport styles from './InformationRequestForm.module.scss'\nimport { BaseComponent, useBase, type BaseComponentInterface } from '@/components/Base'\nimport type { OnEventType } from '@/components/Base/useBase'\nimport { Flex, TextInputField } from '@/components/Common'\nimport { FileInputField } from '@/components/Common/Fields/FileInputField'\nimport { Form } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { informationRequestEvents, type EventType } from '@/shared/constants'\nimport { useFlow } from '@/components/Flow/useFlow'\n\nconst INFORMATION_REQUEST_FORM_ID = 'gusto-sdk-information-request-form'\nconst ACCEPTED_FILE_TYPES = ['image/jpeg', 'image/png', 'application/pdf']\n\nconst InformationRequestFormSchema = z.record(\n z.string(),\n z.union([z.string().min(1), z.instanceof(File)]),\n)\n\ntype InformationRequestFormValues = z.infer<typeof InformationRequestFormSchema>\n\ninterface InformationRequestFormProps extends BaseComponentInterface<'InformationRequests.InformationRequestForm'> {\n companyId: string\n requestId: string\n onEvent: OnEventType<EventType, unknown>\n}\n\nexport function InformationRequestForm(props: InformationRequestFormProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\nconst convertFileToDataUrl = (file: File) => {\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = () => {\n resolve(reader.result as string)\n }\n reader.onerror = reject\n reader.readAsDataURL(file)\n })\n}\n\nconst SUPPORTED_RESPONSE_TYPES: ResponseType[] = [ResponseType.Text, ResponseType.Document]\n\nfunction hasUnsupportedQuestionTypes(questions: RequiredQuestions[]) {\n return questions.some(\n question => question.responseType && !SUPPORTED_RESPONSE_TYPES.includes(question.responseType),\n )\n}\n\nfunction hasPersonaQuestionType(questions: RequiredQuestions[]) {\n return questions.some(question => question.responseType === ResponseType.Persona)\n}\n\nfunction Root({ companyId, requestId, dictionary }: InformationRequestFormProps) {\n useComponentDictionary('InformationRequests.InformationRequestForm', dictionary)\n useI18n('InformationRequests.InformationRequestForm')\n const { t } = useTranslation('InformationRequests.InformationRequestForm')\n const { Alert, Heading, Text } = useComponentContext()\n const { onEvent, baseSubmitHandler } = useBase()\n\n const { data } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const informationRequest = data.informationRequestList?.find(req => req.uuid === requestId)\n const requiredQuestions = informationRequest?.requiredQuestions ?? []\n const isBlockingPayroll = informationRequest?.blockingPayroll ?? false\n const hasUnsupportedTypes = hasUnsupportedQuestionTypes(requiredQuestions)\n const hasPersonaType = hasPersonaQuestionType(requiredQuestions)\n\n const { mutateAsync: submitInformationRequest } = useInformationRequestsSubmitMutation()\n\n const defaultValues: Record<string, string | File | undefined> = {}\n const questionUuids: string[] = []\n\n requiredQuestions.forEach(question => {\n if (!question.questionUuid || !question.responseType) return\n\n if (question.responseType === ResponseType.Text) {\n questionUuids.push(question.questionUuid)\n defaultValues[question.questionUuid] = ''\n } else if (question.responseType === ResponseType.Document) {\n questionUuids.push(question.questionUuid)\n defaultValues[question.questionUuid] = undefined\n }\n })\n\n const formMethods = useForm<InformationRequestFormValues>({\n resolver: zodResolver(InformationRequestFormSchema),\n defaultValues,\n })\n\n const onSubmit = async (formData: InformationRequestFormValues) => {\n await baseSubmitHandler(formData, async () => {\n const questionResponses = await Promise.all(\n questionUuids.map(async uuid => {\n const value = formData[uuid]\n\n if (typeof value === 'string') {\n return {\n questionUuid: uuid,\n responseType: SubmitResponseType.Text,\n textResponse: value,\n }\n }\n\n if (value instanceof File) {\n const fileResponse = await convertFileToDataUrl(value)\n return {\n questionUuid: uuid,\n responseType: SubmitResponseType.Document,\n fileResponse,\n fileName: value.name,\n }\n }\n\n return null\n }),\n )\n\n const validResponses = questionResponses.filter(response => response !== null)\n\n const response = await submitInformationRequest({\n request: {\n informationRequestUuid: requestId,\n requestBody: {\n requiredQuestions: validResponses,\n },\n },\n })\n\n onEvent(informationRequestEvents.INFORMATION_REQUEST_FORM_DONE, response.informationRequest)\n })\n }\n\n const renderQuestion = (question: RequiredQuestions) => {\n if (!question.questionUuid || !question.responseType) return null\n\n const fieldName = question.questionUuid\n const isDocumentType = question.responseType === ResponseType.Document\n const isTextType = question.responseType === ResponseType.Text\n\n return (\n <div key={fieldName} className={styles.questionCard}>\n <div className={styles.questionDescription}>\n <Text weight=\"medium\">\n {isDocumentType ? t('questionTypes.document') : t('questionTypes.answer')}\n </Text>\n <Text>{question.questionText}</Text>\n </div>\n\n <hr className={styles.divider} />\n\n {isTextType && (\n <div className={styles.textInputWrapper}>\n <TextInputField\n name={fieldName}\n label={t('fields.textAnswer.label')}\n placeholder={t('fields.textAnswer.placeholder')}\n isRequired\n errorMessage={t('validation.required')}\n />\n </div>\n )}\n\n {isDocumentType && (\n <div className={styles.fileInputWrapper}>\n <FileInputField\n name={fieldName}\n label={t('fields.fileUpload.label')}\n accept={ACCEPTED_FILE_TYPES}\n isRequired\n errorMessage={t('validation.required')}\n />\n </div>\n )}\n </div>\n )\n }\n\n const unsupportedPlaceholder = (\n <div className={styles.questionCard}>\n <div className={styles.questionDescription}>\n <Text weight=\"medium\">\n {t(hasPersonaType ? 'unsupported.persona.title' : 'unsupported.generic.title')}\n </Text>\n <Text>\n {t(\n hasPersonaType ? 'unsupported.persona.description' : 'unsupported.generic.description',\n )}\n </Text>\n </div>\n\n <hr className={styles.divider} />\n\n <div className={styles.contactSupport}>\n <Text variant=\"supporting\">{t('unsupported.contactSupport')}</Text>\n </div>\n </div>\n )\n\n return (\n <div className={styles.root}>\n <Flex flexDirection=\"column\" gap={16}>\n <Heading as=\"h2\">{t('title')}</Heading>\n\n {isBlockingPayroll && (\n <Alert status=\"error\" label={t('blockingAlert.title')} disableScrollIntoView>\n {t('blockingAlert.description')}\n </Alert>\n )}\n\n {hasUnsupportedTypes ? (\n unsupportedPlaceholder\n ) : (\n <FormProvider {...formMethods}>\n <Form id={INFORMATION_REQUEST_FORM_ID} onSubmit={formMethods.handleSubmit(onSubmit)}>\n <Flex flexDirection=\"column\" gap={16}>\n {requiredQuestions.map(renderQuestion)}\n </Flex>\n </Form>\n </FormProvider>\n )}\n </Flex>\n </div>\n )\n}\n\nconst Footer = ({ onEvent }: { onEvent: OnEventType<EventType, unknown> }) => {\n useI18n('InformationRequests.InformationRequestForm')\n const { t } = useTranslation('InformationRequests.InformationRequestForm')\n const { Button } = useComponentContext()\n const { companyId, selectedRequestId } = useFlow<InformationRequestsContextInterface>()\n\n const { data } = useInformationRequestsGetInformationRequestsSuspense({\n companyUuid: companyId,\n })\n\n const informationRequest = data.informationRequestList?.find(\n req => req.uuid === selectedRequestId,\n )\n const requiredQuestions = informationRequest?.requiredQuestions ?? []\n const hasUnsupportedTypes = hasUnsupportedQuestionTypes(requiredQuestions)\n\n const isMutating = useIsMutating({\n mutationKey: mutationKeyInformationRequestsSubmit(),\n })\n const isPending = isMutating > 0\n\n const handleCancel = () => {\n onEvent(informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL)\n }\n\n if (hasUnsupportedTypes) {\n return (\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button variant=\"secondary\" onClick={handleCancel}>\n {t('cta.close')}\n </Button>\n </Flex>\n )\n }\n\n return (\n <Flex justifyContent=\"flex-end\" gap={12}>\n <Button variant=\"secondary\" onClick={handleCancel} isDisabled={isPending}>\n {t('cta.cancel')}\n </Button>\n <Button\n variant=\"primary\"\n type=\"submit\"\n form={INFORMATION_REQUEST_FORM_ID}\n isLoading={isPending}\n >\n {t('cta.submit')}\n </Button>\n </Flex>\n )\n}\n\nInformationRequestForm.Footer = Footer\n"],"names":["INFORMATION_REQUEST_FORM_ID","ACCEPTED_FILE_TYPES","InformationRequestFormSchema","z","InformationRequestForm","props","jsx","BaseComponent","Root","convertFileToDataUrl","file","resolve","reject","reader","SUPPORTED_RESPONSE_TYPES","ResponseType","hasUnsupportedQuestionTypes","questions","question","hasPersonaQuestionType","companyId","requestId","dictionary","useComponentDictionary","useI18n","t","useTranslation","Alert","Heading","Text","useComponentContext","onEvent","baseSubmitHandler","useBase","data","useInformationRequestsGetInformationRequestsSuspense","informationRequest","req","requiredQuestions","isBlockingPayroll","hasUnsupportedTypes","hasPersonaType","submitInformationRequest","useInformationRequestsSubmitMutation","defaultValues","questionUuids","formMethods","useForm","zodResolver","onSubmit","formData","validResponses","uuid","value","SubmitResponseType","fileResponse","response","informationRequestEvents","renderQuestion","fieldName","isDocumentType","isTextType","jsxs","styles","TextInputField","FileInputField","unsupportedPlaceholder","Flex","FormProvider","Form","Footer","Button","selectedRequestId","useFlow","isPending","useIsMutating","mutationKeyInformationRequestsSubmit","handleCancel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAMA,IAA8B,sCAC9BC,KAAsB,CAAC,cAAc,aAAa,iBAAiB,GAEnEC,KAA+BC,EAAE;AAAA,EACrCA,EAAE,OAAA;AAAA,EACFA,EAAE,MAAM,CAACA,EAAE,OAAA,EAAS,IAAI,CAAC,GAAGA,EAAE,WAAW,IAAI,CAAC,CAAC;AACjD;AAUO,SAASC,GAAuBC,GAAoC;AACzE,SACE,gBAAAC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per_u29yw_26", n = "_divider_u29yw_31", u = "_contactSupport_u29yw_38", i = {
2
+ root: t,
3
+ questionCard: o,
4
+ questionDescription: p,
5
+ textInputWrapper: r,
6
+ fileInputWrapper: e,
7
+ divider: n,
8
+ contactSupport: u
9
+ };
10
+ export {
11
+ u as contactSupport,
12
+ i as default,
13
+ n as divider,
14
+ e as fileInputWrapper,
15
+ o as questionCard,
16
+ p as questionDescription,
17
+ t as root,
18
+ r as textInputWrapper
19
+ };
20
+ //# sourceMappingURL=InformationRequestForm.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InformationRequestForm.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -0,0 +1,2 @@
1
+ import "./types/i18next.d.ts"
2
+ export { InformationRequestForm } from './InformationRequestForm';
@@ -0,0 +1,8 @@
1
+ import { BaseComponentInterface } from '../../Base';
2
+ interface InformationRequestListProps extends BaseComponentInterface<'InformationRequests.InformationRequestList'> {
3
+ companyId: string;
4
+ filterByPayrollBlocking?: boolean;
5
+ onEvent: BaseComponentInterface['onEvent'];
6
+ }
7
+ export declare function InformationRequestList(props: InformationRequestListProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,96 @@
1
+ import { jsx as n, jsxs as a } from "react/jsx-runtime";
2
+ import { useTranslation as w } from "react-i18next";
3
+ import { useInformationRequestsGetInformationRequests as x } from "@gusto/embedded-api/react-query/informationRequestsGetInformationRequests";
4
+ import { InformationRequestStatus as r, InformationRequestType as i } from "@gusto/embedded-api/models/components/informationrequest";
5
+ import { BaseComponent as k } from "../../Base/Base.js";
6
+ import "../../Base/useBase.js";
7
+ import { useComponentContext as v } from "../../../contexts/ComponentAdapter/useComponentContext.js";
8
+ import { useComponentDictionary as S, useI18n as C } from "../../../i18n/I18n.js";
9
+ import { DataView as D } from "../../Common/DataView/DataView.js";
10
+ import { useDataView as E } from "../../Common/DataView/useDataView.js";
11
+ import { FlexItem as L, Flex as u } from "../../Common/Flex/Flex.js";
12
+ import "react";
13
+ import { informationRequestEvents as T } from "../../../shared/constants.js";
14
+ function K(s) {
15
+ return /* @__PURE__ */ n(k, { ...s, children: /* @__PURE__ */ n(A, { ...s, children: s.children }) });
16
+ }
17
+ function A({
18
+ companyId: s,
19
+ dictionary: d,
20
+ filterByPayrollBlocking: c = !1,
21
+ onEvent: f
22
+ }) {
23
+ S("InformationRequests.InformationRequestList", d), C("InformationRequests.InformationRequestList");
24
+ const { t } = w("InformationRequests.InformationRequestList"), { Heading: R, Text: l, Button: g, Badge: m } = v(), { data: y, isFetching: h } = x({
25
+ companyUuid: s
26
+ }), I = (y?.informationRequestList ?? []).filter((e) => {
27
+ const o = e.status !== r.Approved;
28
+ return c ? e.blockingPayroll && o : o;
29
+ }), q = (e) => {
30
+ switch (e) {
31
+ case i.CompanyOnboarding:
32
+ return t("types.companyOnboarding");
33
+ case i.AccountProtection:
34
+ return t("types.accountProtection");
35
+ case i.PaymentRequest:
36
+ return t("types.paymentRequest");
37
+ case i.PaymentError:
38
+ return t("types.paymentError");
39
+ default:
40
+ return t("types.unknown");
41
+ }
42
+ }, b = (e) => {
43
+ switch (e) {
44
+ case r.PendingResponse:
45
+ return { label: t("status.incomplete"), badgeStatus: "info" };
46
+ case r.PendingReview:
47
+ return { label: t("status.underReview"), badgeStatus: "warning" };
48
+ default:
49
+ return null;
50
+ }
51
+ }, P = E({
52
+ data: I,
53
+ isFetching: h,
54
+ columns: [
55
+ {
56
+ key: "type",
57
+ title: t("columns.type"),
58
+ render: (e) => /* @__PURE__ */ n(L, { flexGrow: 1, children: /* @__PURE__ */ n(l, { weight: "medium", children: q(e.type) }) })
59
+ },
60
+ {
61
+ key: "status",
62
+ title: t("columns.status"),
63
+ render: (e) => {
64
+ const o = b(e.status), p = !c && e.blockingPayroll;
65
+ return !o && !p ? null : /* @__PURE__ */ a(u, { gap: 8, alignItems: "center", children: [
66
+ o && /* @__PURE__ */ n(m, { status: o.badgeStatus, children: o.label }),
67
+ p && /* @__PURE__ */ n(m, { status: "error", children: t("status.payrollBlocking") })
68
+ ] });
69
+ }
70
+ }
71
+ ],
72
+ itemMenu: (e) => e.status === r.PendingResponse ? /* @__PURE__ */ n(
73
+ g,
74
+ {
75
+ variant: "secondary",
76
+ onClick: () => {
77
+ f(T.INFORMATION_REQUEST_RESPOND, {
78
+ requestId: e.uuid
79
+ });
80
+ },
81
+ children: t("cta.respond")
82
+ }
83
+ ) : null
84
+ });
85
+ return /* @__PURE__ */ a(u, { flexDirection: "column", gap: 20, children: [
86
+ /* @__PURE__ */ a(u, { flexDirection: "column", gap: 2, children: [
87
+ /* @__PURE__ */ n(R, { as: "h2", styledAs: "h4", children: t("title") }),
88
+ /* @__PURE__ */ n(l, { children: t("description") })
89
+ ] }),
90
+ /* @__PURE__ */ n(D, { ...P, label: t("title") })
91
+ ] });
92
+ }
93
+ export {
94
+ K as InformationRequestList
95
+ };
96
+ //# sourceMappingURL=InformationRequestList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InformationRequestList.js","sources":["../../../../src/components/InformationRequests/InformationRequestList/InformationRequestList.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport { useInformationRequestsGetInformationRequests } from '@gusto/embedded-api/react-query/informationRequestsGetInformationRequests'\nimport type { InformationRequest } from '@gusto/embedded-api/models/components/informationrequest'\nimport {\n InformationRequestStatus,\n InformationRequestType,\n} from '@gusto/embedded-api/models/components/informationrequest'\nimport { BaseComponent, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useComponentDictionary, useI18n } from '@/i18n'\nimport { DataView } from '@/components/Common/DataView/DataView'\nimport { useDataView } from '@/components/Common/DataView/useDataView'\nimport { Flex, FlexItem } from '@/components/Common'\nimport { informationRequestEvents } from '@/shared/constants'\nimport type { BadgeProps } from '@/components/Common/UI/Badge/BadgeTypes'\n\ninterface InformationRequestListProps extends BaseComponentInterface<'InformationRequests.InformationRequestList'> {\n companyId: string\n filterByPayrollBlocking?: boolean\n onEvent: BaseComponentInterface['onEvent']\n}\n\nexport function InformationRequestList(props: InformationRequestListProps) {\n return (\n <BaseComponent {...props}>\n <Root {...props}>{props.children}</Root>\n </BaseComponent>\n )\n}\n\ntype StatusMapping = {\n label: string\n badgeStatus: BadgeProps['status']\n} | null\n\nfunction Root({\n companyId,\n dictionary,\n filterByPayrollBlocking = false,\n onEvent,\n}: InformationRequestListProps) {\n useComponentDictionary('InformationRequests.InformationRequestList', dictionary)\n useI18n('InformationRequests.InformationRequestList')\n const { t } = useTranslation('InformationRequests.InformationRequestList')\n const { Heading, Text, Button, Badge } = useComponentContext()\n\n const { data, isFetching } = useInformationRequestsGetInformationRequests({\n companyUuid: companyId,\n })\n\n const informationRequests = data?.informationRequestList ?? []\n\n const visibleRequests = informationRequests.filter(request => {\n const isNotApproved = request.status !== InformationRequestStatus.Approved\n\n if (filterByPayrollBlocking) {\n return request.blockingPayroll && isNotApproved\n }\n\n return isNotApproved\n })\n\n const getTypeLabel = (type: InformationRequest['type']): string => {\n switch (type) {\n case InformationRequestType.CompanyOnboarding:\n return t('types.companyOnboarding')\n case InformationRequestType.AccountProtection:\n return t('types.accountProtection')\n case InformationRequestType.PaymentRequest:\n return t('types.paymentRequest')\n case InformationRequestType.PaymentError:\n return t('types.paymentError')\n default:\n return t('types.unknown')\n }\n }\n\n const getStatusMapping = (status: InformationRequest['status']): StatusMapping => {\n switch (status) {\n case InformationRequestStatus.PendingResponse:\n return { label: t('status.incomplete'), badgeStatus: 'info' }\n case InformationRequestStatus.PendingReview:\n return { label: t('status.underReview'), badgeStatus: 'warning' }\n default:\n return null\n }\n }\n\n const dataViewProps = useDataView({\n data: visibleRequests,\n isFetching,\n columns: [\n {\n key: 'type',\n title: t('columns.type'),\n render: request => (\n <FlexItem flexGrow={1}>\n <Text weight=\"medium\">{getTypeLabel(request.type)}</Text>\n </FlexItem>\n ),\n },\n {\n key: 'status',\n title: t('columns.status'),\n render: request => {\n const statusMapping = getStatusMapping(request.status)\n const showPayrollBlockingBadge = !filterByPayrollBlocking && request.blockingPayroll\n\n if (!statusMapping && !showPayrollBlockingBadge) {\n return null\n }\n\n return (\n <Flex gap={8} alignItems=\"center\">\n {statusMapping && (\n <Badge status={statusMapping.badgeStatus}>{statusMapping.label}</Badge>\n )}\n {showPayrollBlockingBadge && (\n <Badge status=\"error\">{t('status.payrollBlocking')}</Badge>\n )}\n </Flex>\n )\n },\n },\n ],\n itemMenu: request => {\n const isPendingResponse = request.status === InformationRequestStatus.PendingResponse\n if (!isPendingResponse) {\n return null\n }\n return (\n <Button\n variant=\"secondary\"\n onClick={() => {\n onEvent(informationRequestEvents.INFORMATION_REQUEST_RESPOND, {\n requestId: request.uuid,\n })\n }}\n >\n {t('cta.respond')}\n </Button>\n )\n },\n })\n\n return (\n <Flex flexDirection=\"column\" gap={20}>\n <Flex flexDirection=\"column\" gap={2}>\n <Heading as=\"h2\" styledAs=\"h4\">\n {t('title')}\n </Heading>\n <Text>{t('description')}</Text>\n </Flex>\n\n <DataView {...dataViewProps} label={t('title')} />\n </Flex>\n )\n}\n"],"names":["InformationRequestList","props","jsx","BaseComponent","Root","companyId","dictionary","filterByPayrollBlocking","onEvent","useComponentDictionary","useI18n","useTranslation","Heading","Text","Button","Badge","useComponentContext","data","isFetching","useInformationRequestsGetInformationRequests","visibleRequests","request","isNotApproved","InformationRequestStatus","getTypeLabel","type","InformationRequestType","getStatusMapping","status","dataViewProps","useDataView","FlexItem","statusMapping","showPayrollBlockingBadge","jsxs","Flex","informationRequestEvents","DataView"],"mappings":";;;;;;;;;;;;;AAsBO,SAASA,EAAuBC,GAAoC;AACzE,SACE,gBAAAC,EAACC,GAAA,EAAe,GAAGF,GACjB,UAAA,gBAAAC,EAACE,KAAM,GAAGH,GAAQ,UAAAA,EAAM,SAAA,CAAS,EAAA,CACnC;AAEJ;AAOA,SAASG,EAAK;AAAA,EACZ,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,y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AAA,IAAA,GAC1B;AAAA,sBAECwB,GAAA,EAAU,GAAGR,GAAe,OAAO,EAAE,OAAO,EAAA,CAAG;AAAA,EAAA,GAClD;AAEJ;"}
@@ -0,0 +1,2 @@
1
+ import "./types/i18next.d.ts"
2
+ export { InformationRequestList } from './InformationRequestList';
@@ -0,0 +1,7 @@
1
+ import { BaseComponentInterface } from '../Base';
2
+ export interface InformationRequestsFlowProps {
3
+ companyId: string;
4
+ filterByPayrollBlocking?: boolean;
5
+ onEvent?: BaseComponentInterface['onEvent'];
6
+ }
7
+ export declare function InformationRequestsFlow({ companyId, filterByPayrollBlocking, onEvent, }: InformationRequestsFlowProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,68 @@
1
+ import { jsxs as O, jsx as o } from "react/jsx-runtime";
2
+ import { createMachine as C } from "robot3";
3
+ import { useMachine as h } from "react-robot";
4
+ import { useState as v, useMemo as F } from "react";
5
+ import { informationRequestsMachine as N } from "./informationRequestsStateMachine.js";
6
+ import { BaseBoundaries as I } from "../Base/Base.js";
7
+ import "../Base/useBase.js";
8
+ import { useComponentContext as _ } from "../../contexts/ComponentAdapter/useComponentContext.js";
9
+ import { FlowContext as x } from "../Flow/useFlow.js";
10
+ import { informationRequestEvents as i } from "../../shared/constants.js";
11
+ import { InformationRequestList as S } from "./InformationRequestList/InformationRequestList.js";
12
+ function g({
13
+ companyId: t,
14
+ filterByPayrollBlocking: l = !1,
15
+ onEvent: c = () => {
16
+ }
17
+ }) {
18
+ const { Modal: u, LoadingSpinner: p } = _(), [E, r] = v(!1), M = F(
19
+ () => C(
20
+ "list",
21
+ N,
22
+ () => ({
23
+ component: null,
24
+ companyId: t,
25
+ onEvent: e
26
+ })
27
+ ),
28
+ [t]
29
+ ), [m, R] = h(M);
30
+ function e(n, f) {
31
+ R({ type: n, payload: f }), n === i.INFORMATION_REQUEST_RESPOND && r(!0), (n === i.INFORMATION_REQUEST_FORM_CANCEL || n === i.INFORMATION_REQUEST_FORM_DONE) && r(!1), c(n, f);
32
+ }
33
+ const d = () => {
34
+ r(!1);
35
+ }, s = m.context.component, a = s?.Footer || void 0;
36
+ return /* @__PURE__ */ O(
37
+ x.Provider,
38
+ {
39
+ value: {
40
+ ...m.context,
41
+ onEvent: e
42
+ },
43
+ children: [
44
+ /* @__PURE__ */ o(
45
+ S,
46
+ {
47
+ companyId: t,
48
+ filterByPayrollBlocking: l,
49
+ onEvent: e
50
+ }
51
+ ),
52
+ /* @__PURE__ */ o(
53
+ u,
54
+ {
55
+ isOpen: E,
56
+ onClose: d,
57
+ footer: a && /* @__PURE__ */ o(I, { LoaderComponent: () => /* @__PURE__ */ o(p, { size: "sm" }), children: /* @__PURE__ */ o(a, { onEvent: e }) }),
58
+ children: s && /* @__PURE__ */ o(s, {})
59
+ }
60
+ )
61
+ ]
62
+ }
63
+ );
64
+ }
65
+ export {
66
+ g as InformationRequestsFlow
67
+ };
68
+ //# sourceMappingURL=InformationRequests.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InformationRequests.js","sources":["../../../src/components/InformationRequests/InformationRequests.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { useMachine } from 'react-robot'\nimport { useMemo, useState } from 'react'\nimport { InformationRequestList } from './InformationRequestList'\nimport { informationRequestsMachine } from './informationRequestsStateMachine'\nimport { type InformationRequestsContextInterface } from './InformationRequestsComponents'\nimport { BaseBoundaries, type BaseComponentInterface } from '@/components/Base'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { FlowContext } from '@/components/Flow/useFlow'\nimport { informationRequestEvents, type EventType } from '@/shared/constants'\n\nexport interface InformationRequestsFlowProps {\n companyId: string\n filterByPayrollBlocking?: boolean\n onEvent?: BaseComponentInterface['onEvent']\n}\n\nexport function InformationRequestsFlow({\n companyId,\n filterByPayrollBlocking = false,\n onEvent = () => {},\n}: InformationRequestsFlowProps) {\n const { Modal, LoadingSpinner } = useComponentContext()\n const [isModalOpen, setIsModalOpen] = useState(false)\n\n const informationRequestsMachineInstance = useMemo(\n () =>\n createMachine(\n 'list',\n informationRequestsMachine,\n (): InformationRequestsContextInterface => ({\n component: null,\n companyId,\n onEvent: handleEvent,\n }),\n ),\n [companyId],\n )\n const [current, send] = useMachine(informationRequestsMachineInstance)\n\n function handleEvent(type: EventType, data?: unknown) {\n send({ type, payload: data })\n\n if (type === informationRequestEvents.INFORMATION_REQUEST_RESPOND) {\n setIsModalOpen(true)\n }\n\n if (\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL ||\n type === informationRequestEvents.INFORMATION_REQUEST_FORM_DONE\n ) {\n setIsModalOpen(false)\n }\n\n onEvent(type, data)\n }\n\n const handleCloseModal = () => {\n setIsModalOpen(false)\n }\n\n const CurrentComponent = current.context.component\n const Footer = CurrentComponent?.Footer || undefined\n\n return (\n <FlowContext.Provider\n value={{\n ...current.context,\n onEvent: handleEvent,\n }}\n >\n <InformationRequestList\n companyId={companyId}\n filterByPayrollBlocking={filterByPayrollBlocking}\n onEvent={handleEvent}\n />\n <Modal\n isOpen={isModalOpen}\n onClose={handleCloseModal}\n footer={\n Footer && (\n <BaseBoundaries LoaderComponent={() => <LoadingSpinner size=\"sm\" />}>\n <Footer onEvent={handleEvent} />\n </BaseBoundaries>\n )\n }\n >\n {CurrentComponent && <CurrentComponent />}\n </Modal>\n </FlowContext.Provider>\n )\n}\n"],"names":["InformationRequestsFlow","companyId","filterByPayrollBlocking","onEvent","Modal","LoadingSpinner","useComponentContext","isModalOpen","setIsModalOpen","useState","informationRequestsMachineInstance","useMemo","createMachine","informationRequestsMachine","handleEvent","current","send","useMachine","type","data","informationRequestEvents","handleCloseModal","CurrentComponent","Footer","jsxs","FlowContext","jsx","InformationRequestList","BaseBoundaries"],"mappings":";;;;;;;;;;;AAiBO,SAASA,EAAwB;AAAA,EACtC,WAAAC;AAAA,EACA,yBAAAC,IAA0B;AAAA,EAC1B,SAAAC,IAAU,MAAM;AAAA,EAAC;AACnB,GAAiC;AAC/B,QAAM,EAAE,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,CAAiB;AAAA,UAAA;AAAA,QAAA;AAAA,MACzC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -0,0 +1,19 @@
1
+ import { FlowContextInterface } from '../Flow/useFlow';
2
+ import { CommonComponentInterface } from '../Base';
3
+ import { EventType } from '../../types/Helpers';
4
+ import { OnEventType } from '../Base/useBase';
5
+ export interface InformationRequestsContextInterface extends FlowContextInterface {
6
+ companyId: string;
7
+ selectedRequestId?: string;
8
+ component: (React.ComponentType<CommonComponentInterface> & {
9
+ Footer?: React.ComponentType<{
10
+ onEvent: OnEventType<EventType, unknown>;
11
+ }>;
12
+ }) | null;
13
+ }
14
+ export declare function InformationRequestFormContextual(): import("react/jsx-runtime").JSX.Element;
15
+ export declare namespace InformationRequestFormContextual {
16
+ var Footer: ({ onEvent }: {
17
+ onEvent: OnEventType<EventType, unknown>;
18
+ }) => import("react/jsx-runtime").JSX.Element;
19
+ }
@@ -0,0 +1,20 @@
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { useFlow as n } from "../Flow/useFlow.js";
3
+ import { ensureRequired as u } from "../../helpers/ensureRequired.js";
4
+ import { InformationRequestForm as o } from "./InformationRequestForm/InformationRequestForm.js";
5
+ function s() {
6
+ const { companyId: e, selectedRequestId: r, onEvent: t } = n();
7
+ return /* @__PURE__ */ m(
8
+ o,
9
+ {
10
+ companyId: e,
11
+ requestId: u(r),
12
+ onEvent: t
13
+ }
14
+ );
15
+ }
16
+ s.Footer = o.Footer;
17
+ export {
18
+ s as InformationRequestFormContextual
19
+ };
20
+ //# sourceMappingURL=InformationRequestsComponents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InformationRequestsComponents.js","sources":["../../../src/components/InformationRequests/InformationRequestsComponents.tsx"],"sourcesContent":["import { InformationRequestForm } from './InformationRequestForm'\nimport { useFlow } from '@/components/Flow/useFlow'\nimport { ensureRequired } from '@/helpers/ensureRequired'\nimport type { FlowContextInterface } from '@/components/Flow/useFlow'\nimport type { CommonComponentInterface } from '@/components/Base'\nimport type { EventType } from '@/types/Helpers'\nimport type { OnEventType } from '@/components/Base/useBase'\n\nexport interface InformationRequestsContextInterface extends FlowContextInterface {\n companyId: string\n selectedRequestId?: string\n component:\n | (React.ComponentType<CommonComponentInterface> & {\n Footer?: React.ComponentType<{\n onEvent: OnEventType<EventType, unknown>\n }>\n })\n | null\n}\n\nexport function InformationRequestFormContextual() {\n const { companyId, selectedRequestId, onEvent } = useFlow<InformationRequestsContextInterface>()\n\n return (\n <InformationRequestForm\n companyId={companyId}\n requestId={ensureRequired(selectedRequestId)}\n onEvent={onEvent}\n />\n )\n}\n\nInformationRequestFormContextual.Footer = InformationRequestForm.Footer\n"],"names":["InformationRequestFormContextual","companyId","selectedRequestId","onEvent","useFlow","jsx","InformationRequestForm","ensureRequired"],"mappings":";;;;AAoBO,SAASA,IAAmC;AACjD,QAAM,EAAE,WAAAC,GAAW,mBAAAC,GAAmB,SAAAC,EAAA,IAAYC,EAAA;AAElD,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAAL;AAAA,MACA,WAAWM,EAAeL,CAAiB;AAAA,MAC3C,SAAAC;AAAA,IAAA;AAAA,EAAA;AAGN;AAEAH,EAAiC,SAASM,EAAuB;"}
@@ -0,0 +1,4 @@
1
+ import "./types/i18next.d.ts"
2
+ export { InformationRequestsFlow } from './InformationRequests';
3
+ export { InformationRequestList } from './InformationRequestList';
4
+ export { InformationRequestForm } from './InformationRequestForm';
@@ -0,0 +1,9 @@
1
+ import { InformationRequestsFlow as t } from "./InformationRequests.js";
2
+ import { InformationRequestList as m } from "./InformationRequestList/InformationRequestList.js";
3
+ import { InformationRequestForm as n } from "./InformationRequestForm/InformationRequestForm.js";
4
+ export {
5
+ n as InformationRequestForm,
6
+ m as InformationRequestList,
7
+ t as InformationRequestsFlow
8
+ };
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -0,0 +1,13 @@
1
+ import { informationRequestEvents } from '../../shared/constants';
2
+ export type EventPayloads = {
3
+ [informationRequestEvents.INFORMATION_REQUEST_RESPOND]: {
4
+ requestId: string;
5
+ };
6
+ [informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL]: undefined;
7
+ [informationRequestEvents.INFORMATION_REQUEST_FORM_DONE]: undefined;
8
+ };
9
+ export declare const informationRequestsMachine: {
10
+ list: import('robot3').MachineState<any>;
11
+ form: import('robot3').MachineState<any>;
12
+ final: import('robot3').MachineState<any>;
13
+ };
@@ -0,0 +1,47 @@
1
+ import { state as t, transition as o, reduce as n } from "robot3";
2
+ import { InformationRequestFormContextual as r } from "./InformationRequestsComponents.js";
3
+ import { informationRequestEvents as s } from "../../shared/constants.js";
4
+ const d = {
5
+ list: t(
6
+ o(
7
+ s.INFORMATION_REQUEST_RESPOND,
8
+ "form",
9
+ n(
10
+ (e, i) => ({
11
+ ...e,
12
+ component: r,
13
+ selectedRequestId: i.payload.requestId
14
+ })
15
+ )
16
+ )
17
+ ),
18
+ form: t(
19
+ o(
20
+ s.INFORMATION_REQUEST_FORM_DONE,
21
+ "list",
22
+ n(
23
+ (e) => ({
24
+ ...e,
25
+ component: null,
26
+ selectedRequestId: void 0
27
+ })
28
+ )
29
+ ),
30
+ o(
31
+ s.INFORMATION_REQUEST_FORM_CANCEL,
32
+ "list",
33
+ n(
34
+ (e) => ({
35
+ ...e,
36
+ component: null,
37
+ selectedRequestId: void 0
38
+ })
39
+ )
40
+ )
41
+ ),
42
+ final: t()
43
+ };
44
+ export {
45
+ d as informationRequestsMachine
46
+ };
47
+ //# sourceMappingURL=informationRequestsStateMachine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"informationRequestsStateMachine.js","sources":["../../../src/components/InformationRequests/informationRequestsStateMachine.tsx"],"sourcesContent":["import { state, transition, reduce } from 'robot3'\nimport type { InformationRequestsContextInterface } from './InformationRequestsComponents'\nimport { InformationRequestFormContextual } from './InformationRequestsComponents'\nimport { informationRequestEvents } from '@/shared/constants'\nimport type { MachineEventType, MachineTransition } from '@/types/Helpers'\n\nexport type EventPayloads = {\n [informationRequestEvents.INFORMATION_REQUEST_RESPOND]: {\n requestId: string\n }\n [informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL]: undefined\n [informationRequestEvents.INFORMATION_REQUEST_FORM_DONE]: undefined\n}\n\nexport const informationRequestsMachine = {\n list: state<MachineTransition>(\n transition(\n informationRequestEvents.INFORMATION_REQUEST_RESPOND,\n 'form',\n reduce(\n (\n ctx: InformationRequestsContextInterface,\n ev: MachineEventType<\n EventPayloads,\n typeof informationRequestEvents.INFORMATION_REQUEST_RESPOND\n >,\n ): InformationRequestsContextInterface => ({\n ...ctx,\n component: InformationRequestFormContextual,\n selectedRequestId: ev.payload.requestId,\n }),\n ),\n ),\n ),\n form: state<MachineTransition>(\n transition(\n informationRequestEvents.INFORMATION_REQUEST_FORM_DONE,\n 'list',\n reduce(\n (ctx: InformationRequestsContextInterface): InformationRequestsContextInterface => ({\n ...ctx,\n component: null,\n selectedRequestId: undefined,\n }),\n ),\n ),\n transition(\n informationRequestEvents.INFORMATION_REQUEST_FORM_CANCEL,\n 'list',\n reduce(\n (ctx: InformationRequestsContextInterface): InformationRequestsContextInterface => ({\n ...ctx,\n component: null,\n selectedRequestId: undefined,\n }),\n ),\n ),\n ),\n final: state<MachineTransition>(),\n}\n"],"names":["informationRequestsMachine","state","transition","informationRequestEvents","reduce","ctx","ev","InformationRequestFormContextual"],"mappings":";;;AAcO,MAAMA,IAA6B;AAAA,EACxC,MAAMC;AAAA,IACJC;AAAA,MACEC,EAAyB;AAAA,MACzB;AAAA,MACAC;AAAA,QACE,CACEC,GACAC,OAIyC;AAAA,UACzC,GAAGD;AAAA,UACH,WAAWE;AAAA,UACX,mBAAmBD,EAAG,QAAQ;AAAA,QAAA;AAAA,MAChC;AAAA,IACF;AAAA,EACF;AAAA,EAEF,MAAML;AAAA,IACJC;AAAA,MACEC,EAAyB;AAAA,MACzB;AAAA,MACAC;AAAA,QACE,CAACC,OAAmF;AAAA,UAClF,GAAGA;AAAA,UACH,WAAW;AAAA,UACX,mBAAmB;AAAA,QAAA;AAAA,MACrB;AAAA,IACF;AAAA,IAEFH;AAAA,MACEC,EAAyB;AAAA,MACzB;AAAA,MACAC;AAAA,QACE,CAACC,OAAmF;AAAA,UAClF,GAAGA;AAAA,UACH,WAAW;AAAA,UACX,mBAAmB;AAAA,QAAA;AAAA,MACrB;AAAA,IACF;AAAA,EACF;AAAA,EAEF,OAAOJ,EAAA;AACT;"}