@remoteoss/remote-flows 1.50.0 → 1.52.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 (661) hide show
  1. package/dist/CheckboxFieldDefault-23VE43PP.js +2 -0
  2. package/dist/CountryFieldDefault-FVAAL55P.js +2 -0
  3. package/dist/DatePickerFieldDefault-KXEMGK5B.js +2 -0
  4. package/dist/EmailFieldDefault-OFHDLOOT.js +2 -0
  5. package/dist/FileUploadFieldDefault-GX22C22E.js +2 -0
  6. package/dist/ForcedValueFieldDefault-ESITCZWK.js +2 -0
  7. package/dist/MultiSelectFieldDefault-DAUBH5JV.js +2 -0
  8. package/dist/NumberFieldDefault-MXZD7YVE.js +2 -0
  9. package/dist/PDFPreviewDefault-T6YPWXGY.js +2 -0
  10. package/dist/RadioGroupFieldDefault-QFUUJGSR.js +2 -0
  11. package/dist/SelectFieldDefault-3QTJE222.js +2 -0
  12. package/dist/TelFieldDefault-5U5X37LI.js +2 -0
  13. package/dist/TextAreaFieldDefault-JX2MVJVY.js +2 -0
  14. package/dist/TextFieldDefault-WCUD6XYS.js +2 -0
  15. package/dist/TimeFieldDefault-UNF7PKLT.js +2 -0
  16. package/dist/WorkScheduleFieldDefault-2A2RCDXV.js +2 -0
  17. package/dist/{chunk-SLRPDXK6.js → chunk-235XZBTZ.js} +2 -2
  18. package/dist/chunk-2EXX7BNU.js +2 -0
  19. package/dist/{chunk-PUK2TIQX.js.map → chunk-2EXX7BNU.js.map} +1 -1
  20. package/dist/chunk-2L6AB46E.js +2 -0
  21. package/dist/{chunk-A7U3KJIP.js.map → chunk-2L6AB46E.js.map} +1 -1
  22. package/dist/{chunk-GE74QKS6.js → chunk-335N2CVQ.js} +2 -2
  23. package/dist/chunk-36DZMQHH.js +2 -0
  24. package/dist/{chunk-DDMXUBCN.js.map → chunk-36DZMQHH.js.map} +1 -1
  25. package/dist/{chunk-N7HCQXUM.js → chunk-3B7FASV7.js} +2 -2
  26. package/dist/{chunk-STHZZZRL.js → chunk-3BDWVNHX.js} +2 -2
  27. package/dist/chunk-3CGFAN3F.js +2 -0
  28. package/dist/{chunk-DP6L72YF.js.map → chunk-3CGFAN3F.js.map} +1 -1
  29. package/dist/{chunk-ZREW7KZA.js → chunk-3DOSHTJS.js} +2 -2
  30. package/dist/{chunk-SZI67IXU.js → chunk-3HMBTPH7.js} +2 -2
  31. package/dist/{chunk-NTPHMYYC.js → chunk-3NC2JJM3.js} +2 -2
  32. package/dist/{chunk-ED35NFA6.js → chunk-3OHORFIX.js} +2 -2
  33. package/dist/{chunk-WGO25FWG.js → chunk-3WRO57UF.js} +2 -2
  34. package/dist/chunk-463G2HDA.js +2 -0
  35. package/dist/{chunk-CONMRDRL.js.map → chunk-463G2HDA.js.map} +1 -1
  36. package/dist/{chunk-4CNDASPA.js → chunk-4AQMMGXK.js} +2 -2
  37. package/dist/{chunk-G6EKGJBB.js → chunk-4BFGSBOK.js} +2 -2
  38. package/dist/{chunk-VVZTXCX2.js → chunk-4KIOOLOG.js} +2 -2
  39. package/dist/{chunk-SUYI33NX.js → chunk-4UN7DBEV.js} +2 -2
  40. package/dist/{chunk-RZL44CPH.js → chunk-57Y5XQ3D.js} +2 -2
  41. package/dist/{chunk-P6FFLJDP.js → chunk-5DPOL3DT.js} +2 -2
  42. package/dist/{chunk-FV6NNYDP.js → chunk-5FST4WDH.js} +2 -2
  43. package/dist/chunk-5NN5RWBG.js +2 -0
  44. package/dist/chunk-5NN5RWBG.js.map +1 -0
  45. package/dist/{chunk-46BOEYFO.js → chunk-6OLV37C2.js} +2 -2
  46. package/dist/{chunk-YHZZHQP5.js → chunk-6RPIMHYS.js} +2 -2
  47. package/dist/{chunk-MXAFJYLQ.js → chunk-6TLBBS6E.js} +2 -2
  48. package/dist/{chunk-EVUTX6TJ.js → chunk-77LDJPXF.js} +2 -2
  49. package/dist/chunk-7PEZVTSQ.js +2 -0
  50. package/dist/chunk-7PEZVTSQ.js.map +1 -0
  51. package/dist/{chunk-BTCC6PNG.js → chunk-7TELDH6M.js} +2 -2
  52. package/dist/{chunk-OWOIDZHI.js → chunk-7Y4NHODP.js} +2 -2
  53. package/dist/{chunk-GBVBMT3H.js → chunk-ADL2ZH54.js} +2 -2
  54. package/dist/{chunk-UZFEJMO6.js → chunk-AFTFDGSD.js} +2 -2
  55. package/dist/chunk-ANPNVWCB.js +2 -0
  56. package/dist/{chunk-E5ATCB4A.js → chunk-AOE6FXVP.js} +2 -2
  57. package/dist/{chunk-E5ATCB4A.js.map → chunk-AOE6FXVP.js.map} +1 -1
  58. package/dist/{chunk-L2YOD4GP.js → chunk-APSKAXM2.js} +2 -2
  59. package/dist/{chunk-5HDMU73I.js → chunk-B2WE3PSY.js} +2 -2
  60. package/dist/{chunk-FSCAWXCB.js → chunk-B677Q3B3.js} +2 -2
  61. package/dist/chunk-BQGTMOIQ.js +2 -0
  62. package/dist/{chunk-53QBSOMG.js.map → chunk-BQGTMOIQ.js.map} +1 -1
  63. package/dist/{chunk-WKWL57L6.js → chunk-BYD4TSDD.js} +2 -2
  64. package/dist/chunk-C7KVPEVX.js +2 -0
  65. package/dist/chunk-C7KVPEVX.js.map +1 -0
  66. package/dist/chunk-COQVI5OD.js +2 -0
  67. package/dist/chunk-COQVI5OD.js.map +1 -0
  68. package/dist/{chunk-5JXLXWTD.js → chunk-CR5J5KK6.js} +2 -2
  69. package/dist/chunk-D7F3QKN5.js +2 -0
  70. package/dist/chunk-D7F3QKN5.js.map +1 -0
  71. package/dist/chunk-DAUDKN32.js +8 -0
  72. package/dist/{chunk-QQV5REGG.js.map → chunk-DAUDKN32.js.map} +1 -1
  73. package/dist/{chunk-LXGL7HF5.js → chunk-DIPYFRXX.js} +2 -2
  74. package/dist/chunk-DSJXT5ZP.js +2 -0
  75. package/dist/chunk-DSJXT5ZP.js.map +1 -0
  76. package/dist/{chunk-ZOTKZZ67.js → chunk-DTNFGOBK.js} +2 -2
  77. package/dist/{chunk-JLZFNUBH.js → chunk-E7Y3YBZH.js} +2 -2
  78. package/dist/chunk-EP3BNRH3.js +2 -0
  79. package/dist/chunk-EP3BNRH3.js.map +1 -0
  80. package/dist/{chunk-GTS7KFEM.js → chunk-EQOOVJ7K.js} +2 -2
  81. package/dist/chunk-EUQLCVA5.js +2 -0
  82. package/dist/chunk-EUQLCVA5.js.map +1 -0
  83. package/dist/{chunk-R4ZUOFYN.js → chunk-FF5OB2GF.js} +2 -2
  84. package/dist/{chunk-H47XUL2L.js → chunk-FFRROEPQ.js} +2 -2
  85. package/dist/chunk-FIJSNO57.js +2 -0
  86. package/dist/chunk-FIJSNO57.js.map +1 -0
  87. package/dist/{chunk-UGQNOBQH.js → chunk-GF4MSLVP.js} +2 -2
  88. package/dist/{chunk-P2WUHKEU.js → chunk-GIBD2ZCJ.js} +2 -2
  89. package/dist/{chunk-XDLVDPQ7.js → chunk-GNVGW65D.js} +2 -2
  90. package/dist/{chunk-4IGLIHGF.js → chunk-GRLZH65T.js} +2 -2
  91. package/dist/chunk-GSUGHAHA.js +2 -0
  92. package/dist/{chunk-4BHEQMZV.js.map → chunk-GSUGHAHA.js.map} +1 -1
  93. package/dist/{chunk-CCGAAOXN.js → chunk-H4NJGAN4.js} +2 -2
  94. package/dist/chunk-HDFAFTHC.js +2 -0
  95. package/dist/chunk-HDFAFTHC.js.map +1 -0
  96. package/dist/{chunk-7FKNXW2I.js → chunk-HDTQOERP.js} +2 -2
  97. package/dist/{chunk-MEYX4D5K.js → chunk-I53YCEOC.js} +2 -2
  98. package/dist/{chunk-V3AVEPNA.js → chunk-I5NW7AQZ.js} +2 -2
  99. package/dist/{chunk-YME2HZZJ.js → chunk-I65OXH33.js} +2 -2
  100. package/dist/{chunk-ICYCECFS.js → chunk-IBQVGZMF.js} +2 -2
  101. package/dist/{chunk-ICYCECFS.js.map → chunk-IBQVGZMF.js.map} +1 -1
  102. package/dist/{chunk-TX6RWQUR.js → chunk-IJS67A57.js} +2 -2
  103. package/dist/chunk-IK2LTVOV.js +2 -0
  104. package/dist/chunk-IK2LTVOV.js.map +1 -0
  105. package/dist/{chunk-RYZ7TJVS.js → chunk-ISPN7HQ5.js} +2 -2
  106. package/dist/chunk-IYWSUSS2.js +2 -0
  107. package/dist/chunk-IYWSUSS2.js.map +1 -0
  108. package/dist/{chunk-FQBOMXMX.js → chunk-J244N33S.js} +2 -2
  109. package/dist/chunk-JKNE2D47.js +2 -0
  110. package/dist/{chunk-VRPZ4GHN.js.map → chunk-JKNE2D47.js.map} +1 -1
  111. package/dist/chunk-JO5D2522.js +2 -0
  112. package/dist/chunk-JO5D2522.js.map +1 -0
  113. package/dist/{chunk-ILMRP364.js → chunk-JUSQGITN.js} +2 -2
  114. package/dist/{chunk-GMSYO53D.js → chunk-KD7UBTZG.js} +2 -2
  115. package/dist/chunk-KF52YXGI.js +2 -0
  116. package/dist/chunk-KF52YXGI.js.map +1 -0
  117. package/dist/{chunk-VYTUM3RI.js → chunk-KFIUXU6I.js} +2 -2
  118. package/dist/chunk-KSSQR2CS.js +2 -0
  119. package/dist/chunk-KSSQR2CS.js.map +1 -0
  120. package/dist/{chunk-G75LPZV5.js → chunk-L7FN3XPX.js} +2 -2
  121. package/dist/{chunk-WVE2IOLY.js → chunk-LIZMNUQI.js} +2 -2
  122. package/dist/{chunk-KGNLBYM5.js → chunk-LJ32QPJF.js} +2 -2
  123. package/dist/chunk-LXABE3VR.js +2 -0
  124. package/dist/chunk-LXABE3VR.js.map +1 -0
  125. package/dist/chunk-LY5PCHQ2.js +2 -0
  126. package/dist/{chunk-B4O5YUYL.js.map → chunk-LY5PCHQ2.js.map} +1 -1
  127. package/dist/{chunk-BB3M25A3.js → chunk-MGCW2SS4.js} +2 -2
  128. package/dist/chunk-MNHXHKTE.js +2 -0
  129. package/dist/{chunk-EMMFAZZC.js.map → chunk-MNHXHKTE.js.map} +1 -1
  130. package/dist/{chunk-CUO7OGD5.js → chunk-MOOSPB2G.js} +2 -2
  131. package/dist/{chunk-ITCWBZDM.js → chunk-MZFT4MWM.js} +2 -2
  132. package/dist/chunk-NGBNHXAA.js +2 -0
  133. package/dist/{chunk-NYR6FVCU.js.map → chunk-NGBNHXAA.js.map} +1 -1
  134. package/dist/chunk-NQSJBVFL.js +2 -0
  135. package/dist/chunk-NQSJBVFL.js.map +1 -0
  136. package/dist/{chunk-V6PPOGPT.js → chunk-NVOUXFGX.js} +2 -2
  137. package/dist/{chunk-D6PMXNBM.js → chunk-OAX6TPIP.js} +2 -2
  138. package/dist/{chunk-4WSYC3Q5.js → chunk-OJ4TXF6G.js} +2 -2
  139. package/dist/{chunk-C7MVEDVY.js → chunk-OT5JE2SM.js} +2 -2
  140. package/dist/{chunk-QFTBKRUI.js → chunk-PJAHLEOR.js} +2 -2
  141. package/dist/{chunk-BLKWR77C.js → chunk-PJDHQ4ZQ.js} +2 -2
  142. package/dist/{chunk-AAXPKULB.js → chunk-PKORRCMX.js} +2 -2
  143. package/dist/{chunk-3G4HOZCM.js → chunk-POIDXI3T.js} +2 -2
  144. package/dist/chunk-QATHYZUV.js +2 -0
  145. package/dist/chunk-QATHYZUV.js.map +1 -0
  146. package/dist/{chunk-VKUGCD5J.js → chunk-QIY6K2FB.js} +2 -2
  147. package/dist/chunk-QMMNXGQF.js +2 -0
  148. package/dist/chunk-QMMNXGQF.js.map +1 -0
  149. package/dist/{chunk-ILEO7LN4.js → chunk-QRSMCORC.js} +2 -2
  150. package/dist/{chunk-TJZ5BJV3.js → chunk-QUJBIRNY.js} +2 -2
  151. package/dist/{chunk-OKBPMWVB.js → chunk-R23HFBV4.js} +2 -2
  152. package/dist/chunk-R4E37FVX.js +2 -0
  153. package/dist/{chunk-R5ADEPLC.js.map → chunk-R4E37FVX.js.map} +1 -1
  154. package/dist/chunk-RJXFAG4D.js +2 -0
  155. package/dist/chunk-RJXFAG4D.js.map +1 -0
  156. package/dist/{chunk-XEVHXHHC.js → chunk-ROVMQ5NT.js} +2 -2
  157. package/dist/{chunk-6CBC5OAQ.js → chunk-SDPYDCS7.js} +2 -2
  158. package/dist/{chunk-25MUO3XP.js → chunk-SMCLTRJW.js} +2 -2
  159. package/dist/chunk-SRLBVFNQ.js +2 -0
  160. package/dist/chunk-SRLBVFNQ.js.map +1 -0
  161. package/dist/{chunk-NFWKD7UR.js → chunk-SUGZPBET.js} +2 -2
  162. package/dist/{chunk-Z7XLK4JL.js → chunk-SV35IBBH.js} +2 -2
  163. package/dist/{chunk-7B3ATY3M.js → chunk-SYZIGZ2F.js} +2 -2
  164. package/dist/{chunk-7B3ATY3M.js.map → chunk-SYZIGZ2F.js.map} +1 -1
  165. package/dist/chunk-TUIEY7ZM.js +2 -0
  166. package/dist/chunk-TUIEY7ZM.js.map +1 -0
  167. package/dist/{chunk-ERBEPQJP.js → chunk-UBWNTSWS.js} +2 -2
  168. package/dist/chunk-UETBVQT5.js +2 -0
  169. package/dist/chunk-UETBVQT5.js.map +1 -0
  170. package/dist/{chunk-RFMYNPR7.js → chunk-URNFXEOZ.js} +2 -2
  171. package/dist/{chunk-5PUW4YCY.js → chunk-UTWBY65S.js} +2 -2
  172. package/dist/{chunk-XMVV6S77.js → chunk-UWIUECXU.js} +2 -2
  173. package/dist/{chunk-JVZ5LUV4.js → chunk-VEQWK7QQ.js} +2 -2
  174. package/dist/{chunk-JVZ5LUV4.js.map → chunk-VEQWK7QQ.js.map} +1 -1
  175. package/dist/{chunk-LADLAP2S.js → chunk-VRZJWJGM.js} +2 -2
  176. package/dist/chunk-VSK4KV55.js +2 -0
  177. package/dist/chunk-VSK4KV55.js.map +1 -0
  178. package/dist/chunk-WC7TWLA7.js +2 -0
  179. package/dist/chunk-WC7TWLA7.js.map +1 -0
  180. package/dist/{chunk-JI3PAIMV.js → chunk-WHY2WNWH.js} +2 -2
  181. package/dist/{chunk-77AA65OH.js → chunk-WNOQNNRR.js} +2 -2
  182. package/dist/{chunk-77AA65OH.js.map → chunk-WNOQNNRR.js.map} +1 -1
  183. package/dist/{chunk-JVXI4RZU.js → chunk-WU66SHVJ.js} +2 -2
  184. package/dist/{chunk-PKJZ2N4C.js → chunk-XLHTMWJ3.js} +2 -2
  185. package/dist/{chunk-ZODT3MJM.js → chunk-XPLWBO73.js} +2 -2
  186. package/dist/{chunk-DOPQK5RP.js → chunk-YANQP45B.js} +2 -2
  187. package/dist/{chunk-PKQG25GH.js → chunk-YE6NRJ2L.js} +2 -2
  188. package/dist/{chunk-PKQG25GH.js.map → chunk-YE6NRJ2L.js.map} +1 -1
  189. package/dist/{chunk-CD6H4MBI.js → chunk-YRRX7EOU.js} +2 -2
  190. package/dist/{chunk-XMIVJW5E.js → chunk-YWLAZIIO.js} +2 -2
  191. package/dist/{chunk-2UH6Y56R.js → chunk-ZJ55AKB6.js} +2 -2
  192. package/dist/{chunk-GHZABLDV.js → chunk-ZULOHKU6.js} +2 -2
  193. package/dist/default-components.d.ts +2 -2
  194. package/dist/default-components.js +1 -1
  195. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
  196. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.js +1 -1
  197. package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +3 -3
  198. package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
  199. package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
  200. package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
  201. package/dist/flows/ContractAmendment/context.d.ts +3 -3
  202. package/dist/flows/ContractAmendment/hooks.d.ts +3 -3
  203. package/dist/flows/ContractAmendment/hooks.js +1 -1
  204. package/dist/flows/ContractAmendment/index.d.ts +3 -3
  205. package/dist/flows/ContractAmendment/index.js +1 -1
  206. package/dist/flows/ContractAmendment/types.d.ts +3 -3
  207. package/dist/flows/ContractAmendment/utils.d.ts +2 -2
  208. package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +7 -5
  209. package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
  210. package/dist/flows/ContractorOnboarding/api.d.ts +311 -14
  211. package/dist/flows/ContractorOnboarding/api.js +1 -1
  212. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +4 -4
  213. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
  214. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +7 -5
  215. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
  216. package/dist/flows/ContractorOnboarding/components/ContractOriginStep.d.ts +3 -3
  217. package/dist/flows/ContractorOnboarding/components/ContractOriginStep.js +1 -1
  218. package/dist/flows/ContractorOnboarding/components/ContractPreviewHeader.d.ts +2 -2
  219. package/dist/flows/ContractorOnboarding/components/ContractPreviewStatement.d.ts +2 -2
  220. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +7 -5
  221. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
  222. package/dist/flows/ContractorOnboarding/components/ContractReviewButton.js +1 -1
  223. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +7 -5
  224. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
  225. package/dist/flows/ContractorOnboarding/components/CreateInvoiceScheduleStep.d.ts +3 -3
  226. package/dist/flows/ContractorOnboarding/components/CreateInvoiceScheduleStep.js +1 -1
  227. package/dist/flows/ContractorOnboarding/components/EligibilityQuestionnaireStep.d.ts +7 -5
  228. package/dist/flows/ContractorOnboarding/components/EligibilityQuestionnaireStep.js +1 -1
  229. package/dist/flows/ContractorOnboarding/components/InvoiceScheduleStep.d.ts +7 -5
  230. package/dist/flows/ContractorOnboarding/components/InvoiceScheduleStep.js +1 -1
  231. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.d.ts +3 -3
  232. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.js +1 -1
  233. package/dist/flows/ContractorOnboarding/components/PreviewInvoiceButton.d.ts +29 -27
  234. package/dist/flows/ContractorOnboarding/components/PreviewInvoiceButton.js +1 -1
  235. package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +7 -5
  236. package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
  237. package/dist/flows/ContractorOnboarding/components/SaveDraftButton.d.ts +3 -3
  238. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +4 -4
  239. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
  240. package/dist/flows/ContractorOnboarding/components/SkipInvoiceScheduleButton.d.ts +3 -3
  241. package/dist/flows/ContractorOnboarding/context.d.ts +7 -5
  242. package/dist/flows/ContractorOnboarding/hooks.d.ts +7 -5
  243. package/dist/flows/ContractorOnboarding/hooks.js +1 -1
  244. package/dist/flows/ContractorOnboarding/index.d.ts +7 -5
  245. package/dist/flows/ContractorOnboarding/index.js +1 -1
  246. package/dist/flows/ContractorOnboarding/jsfModify.d.ts +7 -5
  247. package/dist/flows/ContractorOnboarding/jsfModify.js +1 -1
  248. package/dist/flows/ContractorOnboarding/json-schemas/createInvoiceSchedule.d.ts +177 -1
  249. package/dist/flows/ContractorOnboarding/json-schemas/createInvoiceSchedule.js +1 -1
  250. package/dist/flows/ContractorOnboarding/types.d.ts +7 -5
  251. package/dist/flows/ContractorOnboarding/utils.d.ts +4 -4
  252. package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +3 -3
  253. package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
  254. package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +3 -3
  255. package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
  256. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.d.ts +3 -3
  257. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +1 -1
  258. package/dist/flows/CostCalculator/SummaryResults/SummaryResults.d.ts +3 -3
  259. package/dist/flows/CostCalculator/api.d.ts +3 -3
  260. package/dist/flows/CostCalculator/api.js +1 -1
  261. package/dist/flows/CostCalculator/components/SalaryField.d.ts +2 -2
  262. package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
  263. package/dist/flows/CostCalculator/context.d.ts +3 -3
  264. package/dist/flows/CostCalculator/hooks.d.ts +3 -3
  265. package/dist/flows/CostCalculator/hooks.js +1 -1
  266. package/dist/flows/CostCalculator/index.d.ts +3 -3
  267. package/dist/flows/CostCalculator/index.js +1 -1
  268. package/dist/flows/CostCalculator/jsonSchema.d.ts +3 -0
  269. package/dist/flows/CostCalculator/jsonSchema.js +1 -1
  270. package/dist/flows/CostCalculator/types.d.ts +3 -3
  271. package/dist/flows/CostCalculator/utils.d.ts +3 -3
  272. package/dist/flows/CostCalculator/utils.js +1 -1
  273. package/dist/flows/CreateCompany/CreateCompany.d.ts +4 -4
  274. package/dist/flows/CreateCompany/CreateCompany.js +1 -1
  275. package/dist/flows/CreateCompany/api.d.ts +3 -3
  276. package/dist/flows/CreateCompany/api.js +1 -1
  277. package/dist/flows/CreateCompany/components/AddressDetailsStep.d.ts +4 -4
  278. package/dist/flows/CreateCompany/components/AddressDetailsStep.js +1 -1
  279. package/dist/flows/CreateCompany/components/CompanyBasicInformationStep.d.ts +4 -4
  280. package/dist/flows/CreateCompany/components/CompanyBasicInformationStep.js +1 -1
  281. package/dist/flows/CreateCompany/components/CreateCompanyForm.d.ts +2 -2
  282. package/dist/flows/CreateCompany/components/CreateCompanyForm.js +1 -1
  283. package/dist/flows/CreateCompany/context.d.ts +4 -4
  284. package/dist/flows/CreateCompany/hooks.d.ts +4 -4
  285. package/dist/flows/CreateCompany/hooks.js +1 -1
  286. package/dist/flows/CreateCompany/index.d.ts +4 -4
  287. package/dist/flows/CreateCompany/index.js +1 -1
  288. package/dist/flows/CreateCompany/types.d.ts +4 -4
  289. package/dist/flows/InvoiceSchedule/InvoiceScheduleFlow.d.ts +8 -16
  290. package/dist/flows/InvoiceSchedule/InvoiceScheduleFlow.js +1 -1
  291. package/dist/flows/InvoiceSchedule/InvoiceScheduleForm.d.ts +3 -7
  292. package/dist/flows/InvoiceSchedule/InvoiceScheduleForm.js +1 -1
  293. package/dist/flows/InvoiceSchedule/InvoiceSchedulePreviewButton.d.ts +33 -0
  294. package/dist/flows/InvoiceSchedule/InvoiceSchedulePreviewButton.js +2 -0
  295. package/dist/flows/InvoiceSchedule/InvoiceScheduleSubmitButton.js +1 -1
  296. package/dist/flows/InvoiceSchedule/context.d.ts +10 -20
  297. package/dist/flows/InvoiceSchedule/hooks.d.ts +33 -41
  298. package/dist/flows/InvoiceSchedule/hooks.js +1 -1
  299. package/dist/flows/InvoiceSchedule/index.d.ts +6 -8
  300. package/dist/flows/InvoiceSchedule/index.js +1 -1
  301. package/dist/flows/InvoiceSchedule/types.d.ts +8 -35
  302. package/dist/flows/JsonSchemaPlayground/JsonSchemaPlaygroundFlow.d.ts +3 -3
  303. package/dist/flows/JsonSchemaPlayground/JsonSchemaPlaygroundFlow.js +1 -1
  304. package/dist/flows/JsonSchemaPlayground/JsonSchemaPlaygroundForm.d.ts +3 -3
  305. package/dist/flows/JsonSchemaPlayground/JsonSchemaPlaygroundForm.js +1 -1
  306. package/dist/flows/JsonSchemaPlayground/context.d.ts +3 -3
  307. package/dist/flows/JsonSchemaPlayground/hooks.d.ts +3 -3
  308. package/dist/flows/JsonSchemaPlayground/hooks.js +1 -1
  309. package/dist/flows/JsonSchemaPlayground/index.d.ts +3 -3
  310. package/dist/flows/JsonSchemaPlayground/index.js +1 -1
  311. package/dist/flows/JsonSchemaPlayground/types.d.ts +3 -3
  312. package/dist/flows/Onboarding/OnboardingFlow.d.ts +4 -4
  313. package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
  314. package/dist/flows/Onboarding/api.d.ts +4 -4
  315. package/dist/flows/Onboarding/api.js +1 -1
  316. package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +2 -2
  317. package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
  318. package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +4 -4
  319. package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
  320. package/dist/flows/Onboarding/components/BenefitsStep.d.ts +4 -4
  321. package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
  322. package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +4 -4
  323. package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
  324. package/dist/flows/Onboarding/components/DailySchedule/DailySchedule.d.ts +11 -0
  325. package/dist/flows/Onboarding/components/DailySchedule/DailySchedule.js +2 -0
  326. package/dist/flows/Onboarding/components/DailySchedule/DailyScheduleContainer.d.ts +16 -0
  327. package/dist/flows/Onboarding/components/DailySchedule/DailyScheduleContainer.js +2 -0
  328. package/dist/flows/Onboarding/components/DailySchedule/DailyScheduleContainer.js.map +1 -0
  329. package/dist/flows/Onboarding/components/DailySchedule/DailyScheduleHoursErrorBanner.d.ts +12 -0
  330. package/dist/flows/Onboarding/components/DailySchedule/DailyScheduleHoursErrorBanner.js +2 -0
  331. package/dist/flows/Onboarding/components/DailySchedule/DailyScheduleHoursErrorBanner.js.map +1 -0
  332. package/dist/flows/Onboarding/components/DailySchedule/DailyScheduleSummaryBody.d.ts +13 -0
  333. package/dist/flows/Onboarding/components/DailySchedule/DailyScheduleSummaryBody.js +2 -0
  334. package/dist/flows/Onboarding/components/DailySchedule/DailyScheduleSummaryBody.js.map +1 -0
  335. package/dist/flows/Onboarding/components/DailySchedule/types.d.ts +91 -0
  336. package/dist/flows/Onboarding/components/DailySchedule/types.js +1 -0
  337. package/dist/flows/Onboarding/components/DailySchedule/types.js.map +1 -0
  338. package/dist/flows/Onboarding/components/DailySchedule/utils.d.ts +57 -0
  339. package/dist/flows/Onboarding/components/DailySchedule/utils.js +2 -0
  340. package/dist/flows/Onboarding/components/DailySchedule/utils.js.map +1 -0
  341. package/dist/flows/Onboarding/components/EmploymentAgreementInfoContent.js +1 -1
  342. package/dist/flows/Onboarding/components/EngagementAgreementDetailsStep.d.ts +4 -4
  343. package/dist/flows/Onboarding/components/EngagementAgreementDetailsStep.js +1 -1
  344. package/dist/flows/Onboarding/components/OnboardingForm.d.ts +4 -4
  345. package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
  346. package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +3 -3
  347. package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
  348. package/dist/flows/Onboarding/components/PreOnboardingRequirements.d.ts +4 -4
  349. package/dist/flows/Onboarding/components/PreOnboardingRequirements.js +1 -1
  350. package/dist/flows/Onboarding/components/PreviewEmploymentAgreementStep.js +1 -1
  351. package/dist/flows/Onboarding/components/ReviewStep.d.ts +4 -4
  352. package/dist/flows/Onboarding/components/SaveDraftButton.d.ts +3 -3
  353. package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +4 -4
  354. package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
  355. package/dist/flows/Onboarding/context.d.ts +5 -5
  356. package/dist/flows/Onboarding/hooks.d.ts +4 -4
  357. package/dist/flows/Onboarding/hooks.js +1 -1
  358. package/dist/flows/Onboarding/index.d.ts +4 -4
  359. package/dist/flows/Onboarding/index.js +1 -1
  360. package/dist/flows/Onboarding/json-schemas/selectCountryStep.d.ts +3 -0
  361. package/dist/flows/Onboarding/json-schemas/selectCountryStep.js +1 -1
  362. package/dist/flows/Onboarding/types.d.ts +4 -4
  363. package/dist/flows/Onboarding/utils.d.ts +4 -4
  364. package/dist/flows/PayrollAdminOnboarding/PayrollAdminOnboardingFlow.d.ts +5 -5
  365. package/dist/flows/PayrollAdminOnboarding/PayrollAdminOnboardingFlow.js +1 -1
  366. package/dist/flows/PayrollAdminOnboarding/api.d.ts +2 -2
  367. package/dist/flows/PayrollAdminOnboarding/api.js +1 -1
  368. package/dist/flows/PayrollAdminOnboarding/components/AdministrativeDetailsStep.d.ts +3 -3
  369. package/dist/flows/PayrollAdminOnboarding/components/AdministrativeDetailsStep.js +1 -1
  370. package/dist/flows/PayrollAdminOnboarding/components/ContractDetailsStep.d.ts +3 -3
  371. package/dist/flows/PayrollAdminOnboarding/components/ContractDetailsStep.js +1 -1
  372. package/dist/flows/PayrollAdminOnboarding/components/InvitationStep.d.ts +3 -3
  373. package/dist/flows/PayrollAdminOnboarding/components/InvitationStep.js +1 -1
  374. package/dist/flows/PayrollAdminOnboarding/components/PayrollAdminForm.d.ts +2 -2
  375. package/dist/flows/PayrollAdminOnboarding/components/PayrollAdminForm.js +1 -1
  376. package/dist/flows/PayrollAdminOnboarding/components/SelectCountryStep.d.ts +3 -3
  377. package/dist/flows/PayrollAdminOnboarding/components/SelectCountryStep.js +1 -1
  378. package/dist/flows/PayrollAdminOnboarding/components/useStepSubmitHandler.d.ts +3 -3
  379. package/dist/flows/PayrollAdminOnboarding/context.d.ts +5 -5
  380. package/dist/flows/PayrollAdminOnboarding/hooks.d.ts +5 -5
  381. package/dist/flows/PayrollAdminOnboarding/hooks.js +1 -1
  382. package/dist/flows/PayrollAdminOnboarding/index.d.ts +5 -5
  383. package/dist/flows/PayrollAdminOnboarding/index.js +1 -1
  384. package/dist/flows/PayrollAdminOnboarding/json-schemas/selectCountryStep.d.ts +3 -0
  385. package/dist/flows/PayrollAdminOnboarding/json-schemas/selectCountryStep.js +1 -1
  386. package/dist/flows/PayrollAdminOnboarding/types.d.ts +5 -5
  387. package/dist/flows/PayrollEmployeeOnboarding/PayrollEmployeeOnboardingFlow.d.ts +5 -5
  388. package/dist/flows/PayrollEmployeeOnboarding/PayrollEmployeeOnboardingFlow.js +1 -1
  389. package/dist/flows/PayrollEmployeeOnboarding/api.d.ts +3 -3
  390. package/dist/flows/PayrollEmployeeOnboarding/api.js +1 -1
  391. package/dist/flows/PayrollEmployeeOnboarding/components/BankAccountStep.d.ts +3 -3
  392. package/dist/flows/PayrollEmployeeOnboarding/components/BankAccountStep.js +1 -1
  393. package/dist/flows/PayrollEmployeeOnboarding/components/FederalTaxesStep.d.ts +3 -3
  394. package/dist/flows/PayrollEmployeeOnboarding/components/FederalTaxesStep.js +1 -1
  395. package/dist/flows/PayrollEmployeeOnboarding/components/HomeAddressStep.d.ts +3 -3
  396. package/dist/flows/PayrollEmployeeOnboarding/components/HomeAddressStep.js +1 -1
  397. package/dist/flows/PayrollEmployeeOnboarding/components/PayrollEmployeeForm.d.ts +2 -2
  398. package/dist/flows/PayrollEmployeeOnboarding/components/PayrollEmployeeForm.js +1 -1
  399. package/dist/flows/PayrollEmployeeOnboarding/components/PersonalDetailsStep.d.ts +3 -3
  400. package/dist/flows/PayrollEmployeeOnboarding/components/PersonalDetailsStep.js +1 -1
  401. package/dist/flows/PayrollEmployeeOnboarding/components/StateTaxesStep.d.ts +3 -3
  402. package/dist/flows/PayrollEmployeeOnboarding/components/StateTaxesStep.js +1 -1
  403. package/dist/flows/PayrollEmployeeOnboarding/components/useEmployeeStepSubmitHandler.d.ts +3 -3
  404. package/dist/flows/PayrollEmployeeOnboarding/context.d.ts +5 -5
  405. package/dist/flows/PayrollEmployeeOnboarding/hooks.d.ts +5 -5
  406. package/dist/flows/PayrollEmployeeOnboarding/hooks.js +1 -1
  407. package/dist/flows/PayrollEmployeeOnboarding/index.d.ts +5 -5
  408. package/dist/flows/PayrollEmployeeOnboarding/index.js +1 -1
  409. package/dist/flows/PayrollEmployeeOnboarding/types.d.ts +5 -5
  410. package/dist/flows/Termination/AdditionalDetailsForm.d.ts +4 -4
  411. package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
  412. package/dist/flows/Termination/EmployeeComunicationForm.d.ts +4 -4
  413. package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
  414. package/dist/flows/Termination/PaidTimeOffForm.d.ts +4 -4
  415. package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
  416. package/dist/flows/Termination/TerminationDetailsForm.d.ts +4 -4
  417. package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
  418. package/dist/flows/Termination/TerminationFlow.d.ts +4 -4
  419. package/dist/flows/Termination/TerminationFlow.js +1 -1
  420. package/dist/flows/Termination/TerminationForm.d.ts +4 -4
  421. package/dist/flows/Termination/TerminationForm.js +1 -1
  422. package/dist/flows/Termination/api.d.ts +5 -5
  423. package/dist/flows/Termination/api.js +1 -1
  424. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.js +1 -1
  425. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.d.ts +6 -6
  426. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.d.ts +6 -6
  427. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.js +1 -1
  428. package/dist/flows/Termination/components/PaidTimeOff/types.d.ts +6 -6
  429. package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js +1 -1
  430. package/dist/flows/Termination/context.d.ts +4 -4
  431. package/dist/flows/Termination/hooks.d.ts +4 -4
  432. package/dist/flows/Termination/hooks.js +1 -1
  433. package/dist/flows/Termination/index.d.ts +6 -6
  434. package/dist/flows/Termination/index.js +1 -1
  435. package/dist/flows/Termination/json-schemas/additionalInformation.d.ts +1 -1
  436. package/dist/flows/Termination/json-schemas/additionalInformation.js +1 -1
  437. package/dist/flows/Termination/json-schemas/defaultSchema.d.ts +1 -1
  438. package/dist/flows/Termination/json-schemas/defaultSchema.js +1 -1
  439. package/dist/flows/Termination/json-schemas/employeeComunication.d.ts +1 -1
  440. package/dist/flows/Termination/json-schemas/employeeComunication.js +1 -1
  441. package/dist/flows/Termination/json-schemas/jsonSchema.d.ts +1 -1
  442. package/dist/flows/Termination/json-schemas/jsonSchema.js +1 -1
  443. package/dist/flows/Termination/json-schemas/paidTimeOff.d.ts +1 -1
  444. package/dist/flows/Termination/json-schemas/paidTimeOff.js +1 -1
  445. package/dist/flows/Termination/json-schemas/schema.d.ts +4 -4
  446. package/dist/flows/Termination/json-schemas/schema.js +1 -1
  447. package/dist/flows/Termination/json-schemas/terminationDetails.d.ts +1 -1
  448. package/dist/flows/Termination/json-schemas/terminationDetails.js +1 -1
  449. package/dist/flows/Termination/types.d.ts +4 -4
  450. package/dist/flows/Termination/utils.d.ts +4 -4
  451. package/dist/flows/types.d.ts +3 -3
  452. package/dist/flows/utils.d.ts +2 -2
  453. package/dist/index.css +1 -1
  454. package/dist/index.css.map +1 -1
  455. package/dist/index.d.ts +18 -17
  456. package/dist/index.js +2 -2
  457. package/dist/index.js.map +1 -1
  458. package/dist/internals.d.ts +4 -4
  459. package/dist/internals.js +1 -1
  460. package/dist/{mutations-Dg60ZjS0.d.ts → mutations-DU9Ens-k.d.ts} +1 -1
  461. package/dist/{remoteFlows-7WBvzlJt.d.ts → remoteFlows-BlMarq2K.d.ts} +1 -1
  462. package/dist/styles.css +1 -1
  463. package/dist/styles.css.map +1 -1
  464. package/dist/{types-CgNwKzZf.d.ts → types-B2hGbfw_.d.ts} +3 -3
  465. package/dist/{types-CJHW5xRl.d.ts → types-BFSFdXKe.d.ts} +1 -1
  466. package/dist/{types-DmvLgred.d.ts → types-BGoAzP0c.d.ts} +1 -1
  467. package/dist/{types-CT7w2kHS.d.ts → types-C3sJ1GdL.d.ts} +2 -2
  468. package/dist/{types-1IycaCkN.d.ts → types-CTIVW_BN.d.ts} +5 -5
  469. package/dist/{types--IwjF9ei.d.ts → types-Ce5Sou3Z.d.ts} +7 -37
  470. package/dist/{types-CI8Tx4se.d.ts → types-DKfzko2j.d.ts} +3 -3
  471. package/dist/types-DvsjrBmu.d.ts +15 -0
  472. package/dist/{types-DPlWZa2M.d.ts → types-p2MsBnGq.d.ts} +3 -3
  473. package/dist/{types.gen-TcbORUL-.d.ts → types.gen-CMDAS1NL.d.ts} +1 -1
  474. package/dist/{utils-DSHROBN2.d.ts → utils-DpJmWzrf.d.ts} +1 -1
  475. package/package.json +4 -3
  476. package/dist/CheckboxFieldDefault-JOUZXB4Y.js +0 -2
  477. package/dist/CountryFieldDefault-IZQOFNX5.js +0 -2
  478. package/dist/DatePickerFieldDefault-AWV7LUPI.js +0 -2
  479. package/dist/EmailFieldDefault-QVKXB67I.js +0 -2
  480. package/dist/FileUploadFieldDefault-NZ33IMPU.js +0 -2
  481. package/dist/ForcedValueFieldDefault-RY5AN7O6.js +0 -2
  482. package/dist/MultiSelectFieldDefault-DOZQUBEE.js +0 -2
  483. package/dist/NumberFieldDefault-O7OKTFG4.js +0 -2
  484. package/dist/PDFPreviewDefault-HSSMYKV5.js +0 -2
  485. package/dist/RadioGroupFieldDefault-GFDO56LK.js +0 -2
  486. package/dist/SelectFieldDefault-E4KFZBJ7.js +0 -2
  487. package/dist/TelFieldDefault-2EPAKDTW.js +0 -2
  488. package/dist/TextAreaFieldDefault-WZIVM4RZ.js +0 -2
  489. package/dist/TextFieldDefault-YVXZO4AN.js +0 -2
  490. package/dist/TimeFieldDefault-JN4MDIO6.js +0 -2
  491. package/dist/WorkScheduleFieldDefault-23WY3SVD.js +0 -2
  492. package/dist/chunk-3OKB5OHA.js +0 -2
  493. package/dist/chunk-3OKB5OHA.js.map +0 -1
  494. package/dist/chunk-4BHEQMZV.js +0 -2
  495. package/dist/chunk-53QBSOMG.js +0 -2
  496. package/dist/chunk-5YI7MY5T.js +0 -2
  497. package/dist/chunk-5YI7MY5T.js.map +0 -1
  498. package/dist/chunk-A7U3KJIP.js +0 -2
  499. package/dist/chunk-AUPAAQUT.js +0 -2
  500. package/dist/chunk-AUPAAQUT.js.map +0 -1
  501. package/dist/chunk-B4O5YUYL.js +0 -2
  502. package/dist/chunk-CONMRDRL.js +0 -2
  503. package/dist/chunk-DDMXUBCN.js +0 -2
  504. package/dist/chunk-DP6L72YF.js +0 -2
  505. package/dist/chunk-DYIMRD6T.js +0 -2
  506. package/dist/chunk-DYIMRD6T.js.map +0 -1
  507. package/dist/chunk-EMMFAZZC.js +0 -2
  508. package/dist/chunk-GIZQZBHB.js +0 -2
  509. package/dist/chunk-GIZQZBHB.js.map +0 -1
  510. package/dist/chunk-HMJ4PIDI.js +0 -2
  511. package/dist/chunk-HMJ4PIDI.js.map +0 -1
  512. package/dist/chunk-I4DU34BA.js +0 -2
  513. package/dist/chunk-I4DU34BA.js.map +0 -1
  514. package/dist/chunk-IHGCXP2X.js +0 -2
  515. package/dist/chunk-IHGCXP2X.js.map +0 -1
  516. package/dist/chunk-LSUBNZ64.js +0 -2
  517. package/dist/chunk-LSUBNZ64.js.map +0 -1
  518. package/dist/chunk-NAFECQWK.js +0 -2
  519. package/dist/chunk-NYR6FVCU.js +0 -2
  520. package/dist/chunk-PUK2TIQX.js +0 -2
  521. package/dist/chunk-QQPF2DUF.js +0 -2
  522. package/dist/chunk-QQPF2DUF.js.map +0 -1
  523. package/dist/chunk-QQV5REGG.js +0 -8
  524. package/dist/chunk-R5ADEPLC.js +0 -2
  525. package/dist/chunk-ROO2IFBF.js +0 -2
  526. package/dist/chunk-ROO2IFBF.js.map +0 -1
  527. package/dist/chunk-SVU7GWUR.js +0 -2
  528. package/dist/chunk-SVU7GWUR.js.map +0 -1
  529. package/dist/chunk-SVVZOMLQ.js +0 -2
  530. package/dist/chunk-SVVZOMLQ.js.map +0 -1
  531. package/dist/chunk-T5H35HYL.js +0 -2
  532. package/dist/chunk-T5H35HYL.js.map +0 -1
  533. package/dist/chunk-TRDNTXE7.js +0 -2
  534. package/dist/chunk-TRDNTXE7.js.map +0 -1
  535. package/dist/chunk-U4H7URYB.js +0 -2
  536. package/dist/chunk-U4H7URYB.js.map +0 -1
  537. package/dist/chunk-UWHJF45X.js +0 -2
  538. package/dist/chunk-UWHJF45X.js.map +0 -1
  539. package/dist/chunk-VFRHMNLJ.js +0 -2
  540. package/dist/chunk-VFRHMNLJ.js.map +0 -1
  541. package/dist/chunk-VRPZ4GHN.js +0 -2
  542. package/dist/chunk-WRTUY6K3.js +0 -2
  543. package/dist/chunk-WRTUY6K3.js.map +0 -1
  544. package/dist/chunk-WVJDCDGZ.js +0 -2
  545. package/dist/chunk-WVJDCDGZ.js.map +0 -1
  546. package/dist/chunk-XFVXRCMH.js +0 -2
  547. package/dist/chunk-XFVXRCMH.js.map +0 -1
  548. package/dist/chunk-ZD4H63AL.js +0 -2
  549. package/dist/chunk-ZD4H63AL.js.map +0 -1
  550. package/dist/createInvoiceSchedule-BweQB6DI.d.ts +0 -195
  551. package/dist/flows/InvoiceSchedule/api.d.ts +0 -47
  552. package/dist/flows/InvoiceSchedule/api.js +0 -2
  553. package/dist/flows/InvoiceSchedule/components/ContractorSelectField.d.ts +0 -20
  554. package/dist/flows/InvoiceSchedule/components/ContractorSelectField.js +0 -2
  555. package/dist/types.gen-Dtb8ECVb.d.ts +0 -308
  556. /package/dist/{CheckboxFieldDefault-JOUZXB4Y.js.map → CheckboxFieldDefault-23VE43PP.js.map} +0 -0
  557. /package/dist/{CountryFieldDefault-IZQOFNX5.js.map → CountryFieldDefault-FVAAL55P.js.map} +0 -0
  558. /package/dist/{DatePickerFieldDefault-AWV7LUPI.js.map → DatePickerFieldDefault-KXEMGK5B.js.map} +0 -0
  559. /package/dist/{EmailFieldDefault-QVKXB67I.js.map → EmailFieldDefault-OFHDLOOT.js.map} +0 -0
  560. /package/dist/{FileUploadFieldDefault-NZ33IMPU.js.map → FileUploadFieldDefault-GX22C22E.js.map} +0 -0
  561. /package/dist/{ForcedValueFieldDefault-RY5AN7O6.js.map → ForcedValueFieldDefault-ESITCZWK.js.map} +0 -0
  562. /package/dist/{MultiSelectFieldDefault-DOZQUBEE.js.map → MultiSelectFieldDefault-DAUBH5JV.js.map} +0 -0
  563. /package/dist/{NumberFieldDefault-O7OKTFG4.js.map → NumberFieldDefault-MXZD7YVE.js.map} +0 -0
  564. /package/dist/{PDFPreviewDefault-HSSMYKV5.js.map → PDFPreviewDefault-T6YPWXGY.js.map} +0 -0
  565. /package/dist/{RadioGroupFieldDefault-GFDO56LK.js.map → RadioGroupFieldDefault-QFUUJGSR.js.map} +0 -0
  566. /package/dist/{SelectFieldDefault-E4KFZBJ7.js.map → SelectFieldDefault-3QTJE222.js.map} +0 -0
  567. /package/dist/{TelFieldDefault-2EPAKDTW.js.map → TelFieldDefault-5U5X37LI.js.map} +0 -0
  568. /package/dist/{TextAreaFieldDefault-WZIVM4RZ.js.map → TextAreaFieldDefault-JX2MVJVY.js.map} +0 -0
  569. /package/dist/{TextFieldDefault-YVXZO4AN.js.map → TextFieldDefault-WCUD6XYS.js.map} +0 -0
  570. /package/dist/{TimeFieldDefault-JN4MDIO6.js.map → TimeFieldDefault-UNF7PKLT.js.map} +0 -0
  571. /package/dist/{WorkScheduleFieldDefault-23WY3SVD.js.map → WorkScheduleFieldDefault-2A2RCDXV.js.map} +0 -0
  572. /package/dist/{chunk-SLRPDXK6.js.map → chunk-235XZBTZ.js.map} +0 -0
  573. /package/dist/{chunk-GE74QKS6.js.map → chunk-335N2CVQ.js.map} +0 -0
  574. /package/dist/{chunk-N7HCQXUM.js.map → chunk-3B7FASV7.js.map} +0 -0
  575. /package/dist/{chunk-STHZZZRL.js.map → chunk-3BDWVNHX.js.map} +0 -0
  576. /package/dist/{chunk-ZREW7KZA.js.map → chunk-3DOSHTJS.js.map} +0 -0
  577. /package/dist/{chunk-SZI67IXU.js.map → chunk-3HMBTPH7.js.map} +0 -0
  578. /package/dist/{chunk-NTPHMYYC.js.map → chunk-3NC2JJM3.js.map} +0 -0
  579. /package/dist/{chunk-ED35NFA6.js.map → chunk-3OHORFIX.js.map} +0 -0
  580. /package/dist/{chunk-WGO25FWG.js.map → chunk-3WRO57UF.js.map} +0 -0
  581. /package/dist/{chunk-4CNDASPA.js.map → chunk-4AQMMGXK.js.map} +0 -0
  582. /package/dist/{chunk-G6EKGJBB.js.map → chunk-4BFGSBOK.js.map} +0 -0
  583. /package/dist/{chunk-VVZTXCX2.js.map → chunk-4KIOOLOG.js.map} +0 -0
  584. /package/dist/{chunk-SUYI33NX.js.map → chunk-4UN7DBEV.js.map} +0 -0
  585. /package/dist/{chunk-RZL44CPH.js.map → chunk-57Y5XQ3D.js.map} +0 -0
  586. /package/dist/{chunk-P6FFLJDP.js.map → chunk-5DPOL3DT.js.map} +0 -0
  587. /package/dist/{chunk-FV6NNYDP.js.map → chunk-5FST4WDH.js.map} +0 -0
  588. /package/dist/{chunk-46BOEYFO.js.map → chunk-6OLV37C2.js.map} +0 -0
  589. /package/dist/{chunk-YHZZHQP5.js.map → chunk-6RPIMHYS.js.map} +0 -0
  590. /package/dist/{chunk-MXAFJYLQ.js.map → chunk-6TLBBS6E.js.map} +0 -0
  591. /package/dist/{chunk-EVUTX6TJ.js.map → chunk-77LDJPXF.js.map} +0 -0
  592. /package/dist/{chunk-BTCC6PNG.js.map → chunk-7TELDH6M.js.map} +0 -0
  593. /package/dist/{chunk-OWOIDZHI.js.map → chunk-7Y4NHODP.js.map} +0 -0
  594. /package/dist/{chunk-GBVBMT3H.js.map → chunk-ADL2ZH54.js.map} +0 -0
  595. /package/dist/{chunk-UZFEJMO6.js.map → chunk-AFTFDGSD.js.map} +0 -0
  596. /package/dist/{chunk-NAFECQWK.js.map → chunk-ANPNVWCB.js.map} +0 -0
  597. /package/dist/{chunk-L2YOD4GP.js.map → chunk-APSKAXM2.js.map} +0 -0
  598. /package/dist/{chunk-5HDMU73I.js.map → chunk-B2WE3PSY.js.map} +0 -0
  599. /package/dist/{chunk-FSCAWXCB.js.map → chunk-B677Q3B3.js.map} +0 -0
  600. /package/dist/{chunk-WKWL57L6.js.map → chunk-BYD4TSDD.js.map} +0 -0
  601. /package/dist/{chunk-5JXLXWTD.js.map → chunk-CR5J5KK6.js.map} +0 -0
  602. /package/dist/{chunk-LXGL7HF5.js.map → chunk-DIPYFRXX.js.map} +0 -0
  603. /package/dist/{chunk-ZOTKZZ67.js.map → chunk-DTNFGOBK.js.map} +0 -0
  604. /package/dist/{chunk-JLZFNUBH.js.map → chunk-E7Y3YBZH.js.map} +0 -0
  605. /package/dist/{chunk-GTS7KFEM.js.map → chunk-EQOOVJ7K.js.map} +0 -0
  606. /package/dist/{chunk-R4ZUOFYN.js.map → chunk-FF5OB2GF.js.map} +0 -0
  607. /package/dist/{chunk-H47XUL2L.js.map → chunk-FFRROEPQ.js.map} +0 -0
  608. /package/dist/{chunk-UGQNOBQH.js.map → chunk-GF4MSLVP.js.map} +0 -0
  609. /package/dist/{chunk-P2WUHKEU.js.map → chunk-GIBD2ZCJ.js.map} +0 -0
  610. /package/dist/{chunk-XDLVDPQ7.js.map → chunk-GNVGW65D.js.map} +0 -0
  611. /package/dist/{chunk-4IGLIHGF.js.map → chunk-GRLZH65T.js.map} +0 -0
  612. /package/dist/{chunk-CCGAAOXN.js.map → chunk-H4NJGAN4.js.map} +0 -0
  613. /package/dist/{chunk-7FKNXW2I.js.map → chunk-HDTQOERP.js.map} +0 -0
  614. /package/dist/{chunk-MEYX4D5K.js.map → chunk-I53YCEOC.js.map} +0 -0
  615. /package/dist/{chunk-V3AVEPNA.js.map → chunk-I5NW7AQZ.js.map} +0 -0
  616. /package/dist/{chunk-YME2HZZJ.js.map → chunk-I65OXH33.js.map} +0 -0
  617. /package/dist/{chunk-TX6RWQUR.js.map → chunk-IJS67A57.js.map} +0 -0
  618. /package/dist/{chunk-RYZ7TJVS.js.map → chunk-ISPN7HQ5.js.map} +0 -0
  619. /package/dist/{chunk-FQBOMXMX.js.map → chunk-J244N33S.js.map} +0 -0
  620. /package/dist/{chunk-ILMRP364.js.map → chunk-JUSQGITN.js.map} +0 -0
  621. /package/dist/{chunk-GMSYO53D.js.map → chunk-KD7UBTZG.js.map} +0 -0
  622. /package/dist/{chunk-VYTUM3RI.js.map → chunk-KFIUXU6I.js.map} +0 -0
  623. /package/dist/{chunk-G75LPZV5.js.map → chunk-L7FN3XPX.js.map} +0 -0
  624. /package/dist/{chunk-WVE2IOLY.js.map → chunk-LIZMNUQI.js.map} +0 -0
  625. /package/dist/{chunk-KGNLBYM5.js.map → chunk-LJ32QPJF.js.map} +0 -0
  626. /package/dist/{chunk-BB3M25A3.js.map → chunk-MGCW2SS4.js.map} +0 -0
  627. /package/dist/{chunk-CUO7OGD5.js.map → chunk-MOOSPB2G.js.map} +0 -0
  628. /package/dist/{chunk-ITCWBZDM.js.map → chunk-MZFT4MWM.js.map} +0 -0
  629. /package/dist/{chunk-V6PPOGPT.js.map → chunk-NVOUXFGX.js.map} +0 -0
  630. /package/dist/{chunk-D6PMXNBM.js.map → chunk-OAX6TPIP.js.map} +0 -0
  631. /package/dist/{chunk-4WSYC3Q5.js.map → chunk-OJ4TXF6G.js.map} +0 -0
  632. /package/dist/{chunk-C7MVEDVY.js.map → chunk-OT5JE2SM.js.map} +0 -0
  633. /package/dist/{chunk-QFTBKRUI.js.map → chunk-PJAHLEOR.js.map} +0 -0
  634. /package/dist/{chunk-BLKWR77C.js.map → chunk-PJDHQ4ZQ.js.map} +0 -0
  635. /package/dist/{chunk-AAXPKULB.js.map → chunk-PKORRCMX.js.map} +0 -0
  636. /package/dist/{chunk-3G4HOZCM.js.map → chunk-POIDXI3T.js.map} +0 -0
  637. /package/dist/{chunk-VKUGCD5J.js.map → chunk-QIY6K2FB.js.map} +0 -0
  638. /package/dist/{chunk-ILEO7LN4.js.map → chunk-QRSMCORC.js.map} +0 -0
  639. /package/dist/{chunk-TJZ5BJV3.js.map → chunk-QUJBIRNY.js.map} +0 -0
  640. /package/dist/{chunk-OKBPMWVB.js.map → chunk-R23HFBV4.js.map} +0 -0
  641. /package/dist/{chunk-XEVHXHHC.js.map → chunk-ROVMQ5NT.js.map} +0 -0
  642. /package/dist/{chunk-6CBC5OAQ.js.map → chunk-SDPYDCS7.js.map} +0 -0
  643. /package/dist/{chunk-25MUO3XP.js.map → chunk-SMCLTRJW.js.map} +0 -0
  644. /package/dist/{chunk-NFWKD7UR.js.map → chunk-SUGZPBET.js.map} +0 -0
  645. /package/dist/{chunk-Z7XLK4JL.js.map → chunk-SV35IBBH.js.map} +0 -0
  646. /package/dist/{chunk-ERBEPQJP.js.map → chunk-UBWNTSWS.js.map} +0 -0
  647. /package/dist/{chunk-RFMYNPR7.js.map → chunk-URNFXEOZ.js.map} +0 -0
  648. /package/dist/{chunk-5PUW4YCY.js.map → chunk-UTWBY65S.js.map} +0 -0
  649. /package/dist/{chunk-XMVV6S77.js.map → chunk-UWIUECXU.js.map} +0 -0
  650. /package/dist/{chunk-LADLAP2S.js.map → chunk-VRZJWJGM.js.map} +0 -0
  651. /package/dist/{chunk-JI3PAIMV.js.map → chunk-WHY2WNWH.js.map} +0 -0
  652. /package/dist/{chunk-JVXI4RZU.js.map → chunk-WU66SHVJ.js.map} +0 -0
  653. /package/dist/{chunk-PKJZ2N4C.js.map → chunk-XLHTMWJ3.js.map} +0 -0
  654. /package/dist/{chunk-ZODT3MJM.js.map → chunk-XPLWBO73.js.map} +0 -0
  655. /package/dist/{chunk-DOPQK5RP.js.map → chunk-YANQP45B.js.map} +0 -0
  656. /package/dist/{chunk-CD6H4MBI.js.map → chunk-YRRX7EOU.js.map} +0 -0
  657. /package/dist/{chunk-XMIVJW5E.js.map → chunk-YWLAZIIO.js.map} +0 -0
  658. /package/dist/{chunk-2UH6Y56R.js.map → chunk-ZJ55AKB6.js.map} +0 -0
  659. /package/dist/{chunk-GHZABLDV.js.map → chunk-ZULOHKU6.js.map} +0 -0
  660. /package/dist/flows/InvoiceSchedule/{api.js.map → InvoiceSchedulePreviewButton.js.map} +0 -0
  661. /package/dist/flows/{InvoiceSchedule/components/ContractorSelectField.js.map → Onboarding/components/DailySchedule/DailySchedule.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/Onboarding/components/DailySchedule/utils.ts"],"sourcesContent":["// Code comes from our platform codebase, go there to see the original source\n\nimport groupBy from 'lodash.groupby';\n\nimport {\n DailyScheduleDefaultDay,\n DailyScheduleDefaults,\n DailyScheduleHoursError,\n DailyScheduleMetadata,\n DailyScheduleSummaryDay,\n DailyScheduleSummaryLine,\n DailyScheduleSummarySegment,\n DailyScheduleValue,\n Weekday,\n WorkHoursBoundsInput,\n WorkHoursPerWeekConfig,\n WorkHoursRange,\n} from '@/src/flows/Onboarding/components/DailySchedule/types';\nimport { getSingularPluralUnit } from '@/src/lib/i18n';\n\nexport const DAYS_OF_THE_WEEK: Weekday[] = [\n 'monday',\n 'tuesday',\n 'wednesday',\n 'thursday',\n 'friday',\n 'saturday',\n 'sunday',\n];\n\n/**\n * Normalizes the raw `daily_schedule['x-jsf-presentation'].metadata` block\n * into the camelCase shape the container/render-prop payload uses.\n */\nexport function getDefaultsFromSchema(\n metadata: DailyScheduleMetadata,\n): DailyScheduleDefaults {\n const {\n subtract_breaks_in_work_hours: subtractBreaksFromWorkHours,\n country_name: countryName,\n default_start_time: defaultStartTime,\n default_end_time: defaultEndTime,\n default_break_duration_minutes: defaultBreakDurationMinutes,\n default_schedule: defaultSchedule,\n work_hours_per_week: workHoursPerWeekConfig,\n work_days: availableWorkDays = DAYS_OF_THE_WEEK,\n } = metadata;\n\n return {\n subtractBreaksFromWorkHours,\n countryName,\n defaultStartTime,\n defaultEndTime,\n defaultBreakDurationMinutes,\n defaultSchedule,\n workHoursPerWeekConfig,\n availableWorkDays,\n };\n}\n\nconst SCHEDULE_TYPE_BUSINESS_HOURS = 'core_business_hours';\nconst WORK_SCHEDULE_FULL_TIME = 'full_time';\nconst WORK_SCHEDULE_PART_TIME = 'part_time';\n\n/**\n * Resolves the allowed weekly-hours range for the current `schedule_type`/\n * `work_schedule` selection. For core business hours, the minimum drops to 1\n * because the real validation lives on the `work_hours_per_week` field itself.\n */\nexport function getWorkHoursBounds(\n workHoursPerWeekConfig: WorkHoursPerWeekConfig,\n { scheduleType, workSchedule }: WorkHoursBoundsInput,\n): WorkHoursRange {\n const minimumOverride =\n scheduleType === SCHEDULE_TYPE_BUSINESS_HOURS ? 1 : undefined;\n\n if (workSchedule === WORK_SCHEDULE_FULL_TIME) {\n return {\n minimum: minimumOverride ?? workHoursPerWeekConfig.full_time.minimum,\n maximum: workHoursPerWeekConfig.full_time.maximum,\n };\n }\n\n if (workSchedule === WORK_SCHEDULE_PART_TIME) {\n return {\n minimum: minimumOverride ?? workHoursPerWeekConfig.part_time.minimum,\n maximum: workHoursPerWeekConfig.part_time.maximum,\n };\n }\n\n return {\n minimum: minimumOverride ?? workHoursPerWeekConfig.baseline.minimum,\n maximum: workHoursPerWeekConfig.baseline.maximum,\n };\n}\n\nconst MINUTES_IN_HOUR = 60;\n\nexport function convertTimeStringToMinutes(time: string): number {\n const [hours, minutes] = time.split(':').map((part) => parseInt(part, 10));\n\n return hours * MINUTES_IN_HOUR + minutes;\n}\n\nexport function convertMinutesToHours(timeInMinutes: number): number {\n const totalHours = timeInMinutes / MINUTES_IN_HOUR;\n const decimals = totalHours.toString().split('.')[1];\n\n if (!decimals || decimals.length <= 2) {\n return totalHours;\n }\n\n // Aligns with json-schema-form's own rounding behavior (2 decimal places max).\n return Math.floor(totalHours * 100) / 100;\n}\n\n/** Total working hours for a day, given its start/end time and break duration. */\nexport function calculateWorkingHours(\n startTime: string | undefined,\n endTime: string | undefined,\n breakDurationMinutes?: number | null,\n): number {\n if (!startTime || !endTime) {\n return 0;\n }\n\n const startTimeInMinutes = convertTimeStringToMinutes(startTime);\n const endTimeInMinutes = convertTimeStringToMinutes(endTime);\n const totalTimeInMinutes =\n endTimeInMinutes - startTimeInMinutes - (breakDurationMinutes || 0);\n\n if (totalTimeInMinutes < 0) {\n return 0;\n }\n\n return convertMinutesToHours(totalTimeInMinutes);\n}\n\nfunction findLastConsecutiveDay(\n startDay: Weekday,\n days: Weekday[],\n): Weekday | null {\n let index = days.indexOf(startDay);\n let lastConsecutiveDay: Weekday | null = null;\n\n while (index < days.length && !lastConsecutiveDay) {\n const currentDay = days[index];\n const nextDay = days[index + 1];\n if (nextDay === undefined) {\n lastConsecutiveDay = currentDay;\n break;\n }\n const nextDayInWeek =\n DAYS_OF_THE_WEEK[DAYS_OF_THE_WEEK.indexOf(currentDay) + 1];\n\n if (nextDayInWeek !== nextDay) {\n lastConsecutiveDay = currentDay;\n }\n\n index += 1;\n }\n\n return lastConsecutiveDay;\n}\n\nfunction formatTimeLabel(time: string): string {\n return time.replace(':', 'h');\n}\n\nfunction capitalizeDay(day: Weekday): string {\n return day.charAt(0).toUpperCase() + day.slice(1);\n}\n\nfunction boldDayListSegments(days: Weekday[]): DailyScheduleSummarySegment[] {\n return days.flatMap((day, index) => {\n const dayLabel: DailyScheduleSummarySegment = {\n text: capitalizeDay(day),\n bold: true,\n };\n\n if (index === 0) {\n return [dayLabel];\n }\n\n const joiner = index === days.length - 1 ? ' and ' : ', ';\n return [{ text: joiner }, dayLabel];\n });\n}\n\nfunction buildWorkHoursLine(\n timeKey: string,\n daysInGroup: DailyScheduleSummaryDay[],\n): DailyScheduleSummaryLine {\n const [startTime, endTime] = timeKey.split('|');\n const dayNames = daysInGroup.map((day) => day.day);\n const startDay = dayNames[0];\n const lastConsecutiveDay = findLastConsecutiveDay(startDay, dayNames);\n const allDaysAreConsecutive =\n lastConsecutiveDay !== null &&\n dayNames.indexOf(lastConsecutiveDay) === dayNames.length - 1;\n\n const timeSegments: DailyScheduleSummarySegment[] = [\n { text: 'from ' },\n { text: formatTimeLabel(startTime), bold: true },\n { text: ' to ' },\n { text: formatTimeLabel(endTime), bold: true },\n ];\n\n if (dayNames.length === 1) {\n return {\n key: timeKey,\n segments: [\n { text: capitalizeDay(startDay), bold: true },\n { text: ', ' },\n ...timeSegments,\n ],\n };\n }\n\n if (allDaysAreConsecutive) {\n return {\n key: timeKey,\n segments: [\n { text: capitalizeDay(startDay), bold: true },\n { text: ' to ' },\n { text: capitalizeDay(lastConsecutiveDay), bold: true },\n { text: ', ' },\n ...timeSegments,\n ],\n };\n }\n\n return {\n key: timeKey,\n segments: [\n ...boldDayListSegments(dayNames),\n { text: ', ' },\n ...timeSegments,\n ],\n };\n}\n\n/** \"Monday\" / \"Monday and Tuesday\" / \"Monday, Tuesday and Wednesday\" (plain text). */\nfunction formatDayListText(days: Weekday[]): string {\n const names = days.map(capitalizeDay);\n\n if (names.length === 1) {\n return names[0];\n }\n\n if (names.length === 2) {\n return `${names[0]} and ${names[1]}`;\n }\n\n return `${names.slice(0, -1).join(', ')} and ${names[names.length - 1]}`;\n}\n\nfunction formatBreakDurationLabel(minutes: number): string {\n if (minutes < MINUTES_IN_HOUR) {\n return `${minutes}m`;\n }\n\n const hours = Math.floor(minutes / MINUTES_IN_HOUR);\n const remainingMinutes = minutes % MINUTES_IN_HOUR;\n\n return remainingMinutes > 0 ? `${hours}h${remainingMinutes}m` : `${hours}h`;\n}\n\nfunction buildBreakLine(\n breakDurationMinutes: string,\n daysInGroup: DailyScheduleSummaryDay[],\n isOnlyGroup: boolean,\n): DailyScheduleSummaryLine {\n const breakLabel = formatBreakDurationLabel(Number(breakDurationMinutes));\n\n if (isOnlyGroup) {\n return {\n key: breakDurationMinutes,\n segments: [\n { text: 'With ' },\n { text: `${breakLabel} daily breaks`, bold: true },\n ],\n };\n }\n\n const dayListText = formatDayListText(daysInGroup.map((day) => day.day));\n\n return {\n key: breakDurationMinutes,\n segments: [\n { text: 'With ' },\n { text: breakLabel, bold: true },\n { text: ` break on ${dayListText}.` },\n ],\n };\n}\n\ntype DailyScheduleSummary = {\n workHoursLines: DailyScheduleSummaryLine[];\n breakLines: DailyScheduleSummaryLine[];\n totalWeeklyHours: number;\n};\n\n/**\n * Groups a schedule's selected days into Dragon-style summary lines: runs of\n * consecutive days sharing the same start/end time collapse into one line\n * (e.g. \"Monday to Friday, from 09h00 to 18h00\"), and likewise for shared\n * break durations (e.g. \"With 1h daily breaks\").\n */\nexport function buildDailyScheduleSummary(\n days: DailyScheduleSummaryDay[],\n subtractBreaksFromWorkHours: boolean,\n): DailyScheduleSummary {\n const orderedDays = [...days].sort(\n (a, b) => DAYS_OF_THE_WEEK.indexOf(a.day) - DAYS_OF_THE_WEEK.indexOf(b.day),\n );\n\n const totalWeeklyHours = orderedDays.reduce(\n (total, day) =>\n total +\n calculateWorkingHours(\n day.start_time,\n day.end_time,\n subtractBreaksFromWorkHours ? day.break_duration_minutes : 0,\n ),\n 0,\n );\n\n const groupedByTime = groupBy(\n orderedDays,\n (day) => `${day.start_time}|${day.end_time}`,\n );\n const workHoursLines = Object.entries(groupedByTime).map(\n ([timeKey, daysInGroup]) => buildWorkHoursLine(timeKey, daysInGroup),\n );\n\n const daysWithBreaks = orderedDays.filter(\n (day) => day.break_duration_minutes > 0,\n );\n const groupedByBreak = groupBy(daysWithBreaks, (day) =>\n String(day.break_duration_minutes),\n );\n // Object.entries would reorder purely-numeric keys (\"30\", \"60\", ...)\n // ascending numerically regardless of insertion order, so walk the\n // group keys in the order their first day appears instead.\n const breakDurationKeysInOrder = [\n ...new Set(daysWithBreaks.map((day) => String(day.break_duration_minutes))),\n ];\n\n const breakLines = breakDurationKeysInOrder.map((breakDurationMinutes) =>\n buildBreakLine(\n breakDurationMinutes,\n groupedByBreak[breakDurationMinutes],\n breakDurationKeysInOrder.length === 1,\n ),\n );\n\n return { workHoursLines, breakLines, totalWeeklyHours };\n}\n\n/**\n * The schedule to display/edit: the field's saved `value` when present,\n * otherwise a schedule built from the metadata's `default_schedule` — so the\n * summary and the edit modal show sensible defaults before the employer has\n * saved anything (create flow), not just after (edit flow).\n */\nfunction resolveDailyScheduleValue({\n value,\n defaultSchedule,\n}: {\n value: DailyScheduleValue | undefined;\n defaultSchedule: DailyScheduleDefaultDay[];\n}): DailyScheduleValue {\n if (value !== undefined) {\n return value;\n }\n\n return {\n selected_days: defaultSchedule.map((day) => day.day),\n schedule: defaultSchedule.reduce(\n (acc, day) => ({\n ...acc,\n [day.day]: {\n start_time: day.start_time,\n end_time: day.end_time,\n break_duration_minutes: day.break_duration_minutes,\n },\n }),\n {},\n ),\n };\n}\n\n/**\n * Returns the days of the week that are selected in the daily schedule, and the start/end time and break duration for each day.\n * If the daily schedule is not set, it returns the default schedule.\n * @param value - The daily schedule value.\n * @param defaultSchedule - The default schedule.\n * @returns The days of the week that are selected in the daily schedule, and the start/end time and break duration for each day.\n */\nexport function getDailyScheduleSummaryDays(\n value: DailyScheduleValue | undefined,\n defaultSchedule: DailyScheduleDefaultDay[],\n): DailyScheduleSummaryDay[] {\n const { selected_days: selectedDays, schedule } = resolveDailyScheduleValue({\n value,\n defaultSchedule,\n });\n const summaryDays: DailyScheduleSummaryDay[] = selectedDays.map((day) => {\n const daySchedule = schedule[day];\n return {\n day,\n start_time: daySchedule?.start_time ?? '',\n end_time: daySchedule?.end_time ?? '',\n break_duration_minutes: daySchedule?.break_duration_minutes ?? 0,\n };\n });\n\n return summaryDays;\n}\n\nfunction workScheduleCopy(workSchedule: string | undefined): string {\n if (workSchedule === WORK_SCHEDULE_FULL_TIME) {\n return 'a full-time employee';\n }\n\n if (workSchedule === WORK_SCHEDULE_PART_TIME) {\n return 'a part-time employee';\n }\n\n return 'an employee';\n}\n\n/**\n * Ported from Platform's `DailyScheduleError.jsx`: flags a schedule whose total\n * weekly hours fall outside the country/work-schedule's allowed range, e.g.\n * \"Work hours outside of weekly range - The work week for a full-time\n * employee in Germany is between 31 and 48 hours.\"\n */\nexport function getDailyScheduleHoursError({\n totalWeeklyHours,\n workHoursBounds,\n countryName,\n workSchedule,\n}: {\n totalWeeklyHours: number;\n workHoursBounds: WorkHoursRange;\n countryName: string;\n workSchedule: string | undefined;\n}): DailyScheduleHoursError | null {\n if (totalWeeklyHours === 0) {\n return null;\n }\n\n const { minimum, maximum } = workHoursBounds;\n\n if (totalWeeklyHours >= minimum && totalWeeklyHours <= maximum) {\n return null;\n }\n\n const maxHoursCopy = getSingularPluralUnit({\n number: maximum,\n singular: 'hour',\n plural: 'hours',\n followCopyGuidelines: false,\n });\n const rangeCopy =\n minimum === maximum\n ? maxHoursCopy\n : `between ${minimum} and ${maxHoursCopy}`;\n\n return {\n header: 'Work hours outside of weekly range',\n message: `The work week for ${workScheduleCopy(workSchedule)} in ${countryName} is ${rangeCopy}.`,\n };\n}\n"],"mappings":"gFAEA,OAAOA,MAAa,iBAkBb,IAAMC,EAA8B,CACzC,SACA,UACA,YACA,WACA,SACA,WACA,QACF,EAMO,SAASC,EACdC,EACuB,CACvB,GAAM,CACJ,8BAA+BC,EAC/B,aAAcC,EACd,mBAAoBC,EACpB,iBAAkBC,EAClB,+BAAgCC,EAChC,iBAAkBC,EAClB,oBAAqBC,EACrB,UAAWC,EAAoBV,CACjC,EAAIE,EAEJ,MAAO,CACL,4BAAAC,EACA,YAAAC,EACA,iBAAAC,EACA,eAAAC,EACA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ACzC,OAAQF,EACR,SAAU,OACV,OAAQ,QACR,qBAAsB,EACxB,CAAC,EACKG,EACJJ,IAAYC,EACRC,EACA,WAAWF,CAAO,QAAQE,CAAY,GAE5C,MAAO,CACL,OAAQ,qCACR,QAAS,qBAAqBL,EAAiBhE,CAAY,CAAC,OAAOb,CAAW,OAAOoF,CAAS,GAChG,CACF,CApCgB7E,EAAAuE,EAAA","names":["groupBy","DAYS_OF_THE_WEEK","getDefaultsFromSchema","metadata","subtractBreaksFromWorkHours","countryName","defaultStartTime","defaultEndTime","defaultBreakDurationMinutes","defaultSchedule","workHoursPerWeekConfig","availableWorkDays","__name","SCHEDULE_TYPE_BUSINESS_HOURS","WORK_SCHEDULE_FULL_TIME","WORK_SCHEDULE_PART_TIME","getWorkHoursBounds","scheduleType","workSchedule","minimumOverride","MINUTES_IN_HOUR","convertTimeStringToMinutes","time","hours","minutes","part","convertMinutesToHours","timeInMinutes","totalHours","decimals","calculateWorkingHours","startTime","endTime","breakDurationMinutes","startTimeInMinutes","totalTimeInMinutes","findLastConsecutiveDay","startDay","days","index","lastConsecutiveDay","currentDay","nextDay","formatTimeLabel","capitalizeDay","day","boldDayListSegments","dayLabel","buildWorkHoursLine","timeKey","daysInGroup","dayNames","allDaysAreConsecutive","timeSegments","formatDayListText","names","formatBreakDurationLabel","remainingMinutes","buildBreakLine","isOnlyGroup","breakLabel","dayListText","buildDailyScheduleSummary","orderedDays","a","b","totalWeeklyHours","total","groupedByTime","groupBy","workHoursLines","daysWithBreaks","groupedByBreak","breakDurationKeysInOrder","breakLines","resolveDailyScheduleValue","value","acc","getDailyScheduleSummaryDays","selectedDays","schedule","daySchedule","workScheduleCopy","getDailyScheduleHoursError","workHoursBounds","minimum","maximum","maxHoursCopy","getSingularPluralUnit","rangeCopy"]}
@@ -1,2 +1,2 @@
1
- import{a as _}from"./chunk-JLZFNUBH.js";import{a as c}from"./chunk-2QVO3BVI.js";import{j as i,k as p,l as a,n as s,o as F}from"./chunk-AUPAAQUT.js";import{a as n}from"./chunk-P37U34EQ.js";import{jsx as e,jsxs as d}from"react/jsx-runtime";function w({field:o,fieldState:C,fieldData:m}){let{name:t,label:r,description:l}=m;return d(i,{"data-field":t,className:`RemoteFlows__TimeField__Item__${t}`,children:[r&&e(p,{className:"RemoteFlows__TimeField__Label",children:r}),e(a,{children:e(c,{...o,type:"time",value:o.value??"",onChange:T=>{o.onChange(T)},className:"RemoteFlows__TimeField__Input",placeholder:r})}),(l||m.meta?.helpCenter)&&e(s,{className:"RemoteFlows__TimeField__Description",helpCenter:e(_,{helpCenter:m.meta?.helpCenter}),children:l}),C.error&&e(F,{className:"RemoteFlows__TimeField__Error"})]})}n(w,"TimeFieldDefault");export{w as a};
2
- //# sourceMappingURL=chunk-V6PPOGPT.js.map
1
+ import{a as _}from"./chunk-E7Y3YBZH.js";import{a as c}from"./chunk-2QVO3BVI.js";import{e as i,f as p,g as a,i as s,j as F}from"./chunk-C7KVPEVX.js";import{a as n}from"./chunk-P37U34EQ.js";import{jsx as e,jsxs as d}from"react/jsx-runtime";function w({field:o,fieldState:C,fieldData:m}){let{name:t,label:r,description:l}=m;return d(i,{"data-field":t,className:`RemoteFlows__TimeField__Item__${t}`,children:[r&&e(p,{className:"RemoteFlows__TimeField__Label",children:r}),e(a,{children:e(c,{...o,type:"time",value:o.value??"",onChange:T=>{o.onChange(T)},className:"RemoteFlows__TimeField__Input",placeholder:r})}),(l||m.meta?.helpCenter)&&e(s,{className:"RemoteFlows__TimeField__Description",helpCenter:e(_,{helpCenter:m.meta?.helpCenter}),children:l}),C.error&&e(F,{className:"RemoteFlows__TimeField__Error"})]})}n(w,"TimeFieldDefault");export{w as a};
2
+ //# sourceMappingURL=chunk-NVOUXFGX.js.map
@@ -1,2 +1,2 @@
1
- import{b as y}from"./chunk-Q3ALCPJN.js";import{d as p,e as v}from"./chunk-ERBEPQJP.js";import{b as n,w as u}from"./chunk-C4HFMTSB.js";import{b as l}from"./chunk-H2O4CVKF.js";import{a as r}from"./chunk-P37U34EQ.js";import O from"lodash.omit";import{jsx as C}from"react/jsx-runtime";function T({onSubmit:f,onSuccess:i,onError:s,render:w,...o}){let{components:E}=l(),{contractorOnboardingBag:e}=y(),a=p(),m=v(),{mutateAsyncOrThrow:g}=n(a),{mutateAsyncOrThrow:I}=n(m),c=e.employment?.contractor_type==="cor"&&!e.isEmploymentReadOnly,R=r(async()=>{try{if(await f?.(),c&&e.employmentId){let t=await I({employment_slug:e.employmentId});if(t?.data){await i?.({data:t,employmentStatus:"created_awaiting_reserve"}),e.refetchEmployment();return}}else if(e.employmentId){let t=await g({employment_id:e.employmentId});t&&(await i?.({data:t,employmentStatus:"invited"}),e.refetchEmployment())}}catch(t){u(t)?s?.(O(t,"response")):s?.({error:t,rawError:t,fieldErrors:[]})}},"handleSubmit"),d=E?.button;if(!d)throw new Error("Button component not found");let b=a.isPending||m.isPending||!e.canInvite||o.disabled;return C(d,{...o,disabled:b,onClick:t=>{R(),o.onClick?.(t)},children:w({status:c?"create_reserve":"invite"})})}r(T,"OnboardingInvite");export{T as a};
2
- //# sourceMappingURL=chunk-D6PMXNBM.js.map
1
+ import{b as y}from"./chunk-Q3ALCPJN.js";import{d as p,e as v}from"./chunk-UBWNTSWS.js";import{b as n,w as u}from"./chunk-C4HFMTSB.js";import{b as l}from"./chunk-H2O4CVKF.js";import{a as r}from"./chunk-P37U34EQ.js";import O from"lodash.omit";import{jsx as C}from"react/jsx-runtime";function T({onSubmit:f,onSuccess:i,onError:s,render:w,...o}){let{components:E}=l(),{contractorOnboardingBag:e}=y(),a=p(),m=v(),{mutateAsyncOrThrow:g}=n(a),{mutateAsyncOrThrow:I}=n(m),c=e.employment?.contractor_type==="cor"&&!e.isEmploymentReadOnly,R=r(async()=>{try{if(await f?.(),c&&e.employmentId){let t=await I({employment_slug:e.employmentId});if(t?.data){await i?.({data:t,employmentStatus:"created_awaiting_reserve"}),e.refetchEmployment();return}}else if(e.employmentId){let t=await g({employment_id:e.employmentId});t&&(await i?.({data:t,employmentStatus:"invited"}),e.refetchEmployment())}}catch(t){u(t)?s?.(O(t,"response")):s?.({error:t,rawError:t,fieldErrors:[]})}},"handleSubmit"),d=E?.button;if(!d)throw new Error("Button component not found");let b=a.isPending||m.isPending||!e.canInvite||o.disabled;return C(d,{...o,disabled:b,onClick:t=>{R(),o.onClick?.(t)},children:w({status:c?"create_reserve":"invite"})})}r(T,"OnboardingInvite");export{T as a};
2
+ //# sourceMappingURL=chunk-OAX6TPIP.js.map
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-H47XUL2L.js";import{b as e}from"./chunk-Q3ALCPJN.js";import{x as n}from"./chunk-C4HFMTSB.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as u}from"react/jsx-runtime";function b({onSubmit:m,onSuccess:d,onError:c}){let{contractorOnboardingBag:o}=e(),p=t(async(i,f)=>{try{let a=await o.parseFormValues(i);await m?.(a);let r=await o.onSubmit(i);if(r?.data){await d?.(r?.data),o?.next();return}}catch(a){let r=n(a,o.meta?.fields?.basic_information,f);c?.(r)}},"handleSubmit"),l=o.stepState.values?.basic_information||o.initialValues.basic_information;return u(s,{defaultValues:l,onSubmit:p})}t(b,"BasicInformationStep");export{b as a};
2
- //# sourceMappingURL=chunk-4WSYC3Q5.js.map
1
+ import{a as s}from"./chunk-FFRROEPQ.js";import{b as e}from"./chunk-Q3ALCPJN.js";import{x as n}from"./chunk-C4HFMTSB.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as u}from"react/jsx-runtime";function b({onSubmit:m,onSuccess:d,onError:c}){let{contractorOnboardingBag:o}=e(),p=t(async(i,f)=>{try{let a=await o.parseFormValues(i);await m?.(a);let r=await o.onSubmit(i);if(r?.data){await d?.(r?.data),o?.next();return}}catch(a){let r=n(a,o.meta?.fields?.basic_information,f);c?.(r)}},"handleSubmit"),l=o.stepState.values?.basic_information||o.initialValues.basic_information;return u(s,{defaultValues:l,onSubmit:p})}t(b,"BasicInformationStep");export{b as a};
2
+ //# sourceMappingURL=chunk-OJ4TXF6G.js.map
@@ -1,2 +1,2 @@
1
- import{b as p}from"./chunk-KSHK3ZPX.js";import{a as F}from"./chunk-I4DU34BA.js";import{h as C}from"./chunk-AUPAAQUT.js";import{c as f,u as E}from"./chunk-C4HFMTSB.js";import{a as m}from"./chunk-P37U34EQ.js";import{useEffect as R}from"react";import{jsx as n}from"react/jsx-runtime";function T({onSubmit:S,onError:w,onSuccess:y,onErrorWithFields:u,shouldResetForm:c,resetFields:a}){let{form:e,formId:V,costCalculatorBag:o}=p(),{formState:{isSubmitSuccessful:s}}=e;R(()=>{if(s&&c){o?.resetForm(),e.reset();return}if(s&&a){let t={...e.getValues()};a.forEach(r=>{t[r]=""}),o?.resetForm(),e.reset(t)}},[s,e,c,o,a]);let b=m(async d=>{try{let t=await o?.parseFormValues(d);o?.meta?.fields&&(o.meta.fields=E(t,o.fields),o.meta.fields.employer_currency_slug=o.meta.fields.currency);let r=await o?.onSubmit(t);if(await S?.(t),r?.data&&!r.error){let i={data:{...r.data.data,employments:r.data.data.employments?.map(l=>({...l,title:t.estimation_title}))}};await y?.(i)}else throw{data:null,error:r?.error,fieldErrors:r?.fieldErrors,rawError:r?.rawError}}catch(t){let r=t,i=r.fieldErrors;if(u){let l=o?.meta?.fields,h=f(i,l);u({error:r.error,rawError:r.rawError,fieldErrors:h})}else w?.(r.error)}},"handleSubmit");return n(C,{...e,children:n("form",{id:V,onSubmit:e.handleSubmit(b),className:"space-y-4 RemoteFlows__CostCalculatorForm",children:n(F,{fields:o?.fields??[]})})})}m(T,"CostCalculatorForm");export{T as a};
2
- //# sourceMappingURL=chunk-C7MVEDVY.js.map
1
+ import{b as p}from"./chunk-KSHK3ZPX.js";import{a as F}from"./chunk-5NN5RWBG.js";import{b as C}from"./chunk-C7KVPEVX.js";import{c as f,u as E}from"./chunk-C4HFMTSB.js";import{a as m}from"./chunk-P37U34EQ.js";import{useEffect as R}from"react";import{jsx as n}from"react/jsx-runtime";function T({onSubmit:S,onError:w,onSuccess:y,onErrorWithFields:u,shouldResetForm:c,resetFields:a}){let{form:e,formId:V,costCalculatorBag:o}=p(),{formState:{isSubmitSuccessful:s}}=e;R(()=>{if(s&&c){o?.resetForm(),e.reset();return}if(s&&a){let t={...e.getValues()};a.forEach(r=>{t[r]=""}),o?.resetForm(),e.reset(t)}},[s,e,c,o,a]);let b=m(async d=>{try{let t=await o?.parseFormValues(d);o?.meta?.fields&&(o.meta.fields=E(t,o.fields),o.meta.fields.employer_currency_slug=o.meta.fields.currency);let r=await o?.onSubmit(t);if(await S?.(t),r?.data&&!r.error){let i={data:{...r.data.data,employments:r.data.data.employments?.map(l=>({...l,title:t.estimation_title}))}};await y?.(i)}else throw{data:null,error:r?.error,fieldErrors:r?.fieldErrors,rawError:r?.rawError}}catch(t){let r=t,i=r.fieldErrors;if(u){let l=o?.meta?.fields,h=f(i,l);u({error:r.error,rawError:r.rawError,fieldErrors:h})}else w?.(r.error)}},"handleSubmit");return n(C,{...e,children:n("form",{id:V,onSubmit:e.handleSubmit(b),className:"space-y-4 RemoteFlows__CostCalculatorForm",children:n(F,{fields:o?.fields??[]})})})}m(T,"CostCalculatorForm");export{T as a};
2
+ //# sourceMappingURL=chunk-OT5JE2SM.js.map
@@ -1,2 +1,2 @@
1
- import{a as r}from"./chunk-JVXI4RZU.js";import{a as s}from"./chunk-YPBPOUGX.js";import{b as t}from"./chunk-SS2SYDCB.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as n}from"react/jsx-runtime";function d(l){let{employeeBag:e}=t(),a=s(l);return n(r,{onSubmit:a,defaultValues:{...e.initialValues?.home_address,...e.stepState.values?.home_address}})}o(d,"HomeAddressStep");export{d as a};
2
- //# sourceMappingURL=chunk-QFTBKRUI.js.map
1
+ import{a as s}from"./chunk-YPBPOUGX.js";import{a as r}from"./chunk-WU66SHVJ.js";import{b as t}from"./chunk-SS2SYDCB.js";import{a as o}from"./chunk-P37U34EQ.js";import{jsx as n}from"react/jsx-runtime";function d(l){let{employeeBag:e}=t(),a=s(l);return n(r,{onSubmit:a,defaultValues:{...e.initialValues?.home_address,...e.stepState.values?.home_address}})}o(d,"HomeAddressStep");export{d as a};
2
+ //# sourceMappingURL=chunk-PJAHLEOR.js.map
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-L2YOD4GP.js";import{a as d}from"./chunk-KGSH67IW.js";import{a}from"./chunk-MEYX4D5K.js";import{a as p}from"./chunk-JK4CPPN4.js";import{a as m}from"./chunk-CCGAAOXN.js";import{a as l}from"./chunk-UGQNOBQH.js";import{a as t}from"./chunk-ILEO7LN4.js";import{a as n}from"./chunk-WCJZAOZR.js";import{a as r}from"./chunk-P37U34EQ.js";import{useId as c}from"react";import{jsx as u}from"react/jsx-runtime";var D=r(({companyId:e,legalEntityId:s,countryCode:f,employmentId:P,initialValues:y,options:b,render:g})=>{let A=c(),o=t({companyId:e,legalEntityId:s,countryCode:f,employmentId:P,initialValues:y,options:b});return u(n.Provider,{value:{formId:A,adminBag:o},children:g({adminBag:o,components:{SelectCountryStep:i,ContractDetailsStep:m,AdministrativeDetailsStep:a,InvitationStep:l,SubmitButton:d,BackButton:p}})})},"PayrollAdminOnboardingFlow");export{D as a};
2
- //# sourceMappingURL=chunk-BLKWR77C.js.map
1
+ import{a as d}from"./chunk-KGSH67IW.js";import{a}from"./chunk-I53YCEOC.js";import{a as p}from"./chunk-JK4CPPN4.js";import{a as m}from"./chunk-H4NJGAN4.js";import{a as l}from"./chunk-GF4MSLVP.js";import{a as i}from"./chunk-APSKAXM2.js";import{a as t}from"./chunk-QRSMCORC.js";import{a as n}from"./chunk-WCJZAOZR.js";import{a as r}from"./chunk-P37U34EQ.js";import{useId as c}from"react";import{jsx as u}from"react/jsx-runtime";var D=r(({companyId:e,legalEntityId:s,countryCode:f,employmentId:P,initialValues:y,options:b,render:g})=>{let A=c(),o=t({companyId:e,legalEntityId:s,countryCode:f,employmentId:P,initialValues:y,options:b});return u(n.Provider,{value:{formId:A,adminBag:o},children:g({adminBag:o,components:{SelectCountryStep:i,ContractDetailsStep:m,AdministrativeDetailsStep:a,InvitationStep:l,SubmitButton:d,BackButton:p}})})},"PayrollAdminOnboardingFlow");export{D as a};
2
+ //# sourceMappingURL=chunk-PJDHQ4ZQ.js.map
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-XDLVDPQ7.js";import{b as a}from"./chunk-MRYRNB7Y.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as s}from"react/jsx-runtime";function p({onSubmit:t}){let{terminationBag:o}=a(),n=i(async r=>{let m=await o?.parseFormValues(r);await t?.(m),o?.next()},"handleSubmit");return s(e,{defaultValues:o.fieldValues,onSubmit:n})}i(p,"TerminationDetailsForm");export{p as a};
2
- //# sourceMappingURL=chunk-AAXPKULB.js.map
1
+ import{a as e}from"./chunk-GNVGW65D.js";import{b as a}from"./chunk-MRYRNB7Y.js";import{a as i}from"./chunk-P37U34EQ.js";import{jsx as s}from"react/jsx-runtime";function p({onSubmit:t}){let{terminationBag:o}=a(),n=i(async r=>{let m=await o?.parseFormValues(r);await t?.(m),o?.next()},"handleSubmit");return s(e,{defaultValues:o.fieldValues,onSubmit:n})}i(p,"TerminationDetailsForm");export{p as a};
2
+ //# sourceMappingURL=chunk-PKORRCMX.js.map
@@ -1,2 +1,2 @@
1
- import{b as w}from"./chunk-PGWKJ6FK.js";import{d as y,e as f}from"./chunk-ERBEPQJP.js";import{d as v}from"./chunk-U7JAGEOV.js";import{b as i}from"./chunk-C4HFMTSB.js";import{b as p}from"./chunk-H2O4CVKF.js";import{a as s}from"./chunk-P37U34EQ.js";import{jsx as B}from"react/jsx-runtime";function H({onSubmit:E,onSuccess:a,onError:t,render:R,...o}){let{components:g}=p(),{onboardingBag:r,setCreditScore:d}=w(),m=y(),u=f(),{mutateAsync:I}=i(m),{mutateAsync:S}=i(u),c=!!((r.creditRiskStatus==="deposit_required"||r.onboardingReservesStatus==="deposit_required")&&r.employment?.status&&!v.includes(r.employment.status)),b=!!(c&&r.canInvite),_=s(async()=>{try{if(await E?.(),b&&r.employmentId){let e=await S({employment_slug:r.employmentId});if(e.data){await a?.({data:e.data,employmentStatus:"created_awaiting_reserve"}),d?.(n=>({...n,showReserveInvoice:!0})),r.refetchEmployment();return}e.error&&t?.({error:e.error,rawError:e.rawError,fieldErrors:[]})}else if(r.employmentId){let e=await I({employment_id:r.employmentId});if(e.data){await a?.({data:e.data,employmentStatus:"invited"}),d?.(n=>({...n,showInviteSuccessful:!0})),r.refetchEmployment();return}e.error&&t?.({error:e.error,rawError:e.rawError,fieldErrors:[]})}}catch(e){t?.({error:e,rawError:e,fieldErrors:[]})}},"handleSubmit"),l=g?.button;if(!l)throw new Error("Button component not found");let h=!r.canInvite||m.isPending||u.isPending||o.disabled;return B(l,{...o,disabled:h,onClick:e=>{_(),o.onClick?.(e)},children:R({employmentStatus:c?"created_awaiting_reserve":"invited"})})}s(H,"OnboardingInvite");export{H as a};
2
- //# sourceMappingURL=chunk-3G4HOZCM.js.map
1
+ import{b as w}from"./chunk-PGWKJ6FK.js";import{d as y,e as f}from"./chunk-UBWNTSWS.js";import{d as v}from"./chunk-U7JAGEOV.js";import{b as i}from"./chunk-C4HFMTSB.js";import{b as p}from"./chunk-H2O4CVKF.js";import{a as s}from"./chunk-P37U34EQ.js";import{jsx as B}from"react/jsx-runtime";function H({onSubmit:E,onSuccess:a,onError:t,render:R,...o}){let{components:g}=p(),{onboardingBag:r,setCreditScore:d}=w(),m=y(),u=f(),{mutateAsync:I}=i(m),{mutateAsync:S}=i(u),c=!!((r.creditRiskStatus==="deposit_required"||r.onboardingReservesStatus==="deposit_required")&&r.employment?.status&&!v.includes(r.employment.status)),b=!!(c&&r.canInvite),_=s(async()=>{try{if(await E?.(),b&&r.employmentId){let e=await S({employment_slug:r.employmentId});if(e.data){await a?.({data:e.data,employmentStatus:"created_awaiting_reserve"}),d?.(n=>({...n,showReserveInvoice:!0})),r.refetchEmployment();return}e.error&&t?.({error:e.error,rawError:e.rawError,fieldErrors:[]})}else if(r.employmentId){let e=await I({employment_id:r.employmentId});if(e.data){await a?.({data:e.data,employmentStatus:"invited"}),d?.(n=>({...n,showInviteSuccessful:!0})),r.refetchEmployment();return}e.error&&t?.({error:e.error,rawError:e.rawError,fieldErrors:[]})}}catch(e){t?.({error:e,rawError:e,fieldErrors:[]})}},"handleSubmit"),l=g?.button;if(!l)throw new Error("Button component not found");let h=!r.canInvite||m.isPending||u.isPending||o.disabled;return B(l,{...o,disabled:h,onClick:e=>{_(),o.onClick?.(e)},children:R({employmentStatus:c?"created_awaiting_reserve":"invited"})})}s(H,"OnboardingInvite");export{H as a};
2
+ //# sourceMappingURL=chunk-POIDXI3T.js.map
@@ -0,0 +1,2 @@
1
+ var e={data:{version:7,schema:{"x-rmt-meta":{jsfOldVersion:!0},additionalProperties:!1,properties:{country:{title:"Country",description:"",type:"string",oneOf:[],"x-jsf-presentation":{inputType:"select"}},region:{title:"Region",description:"",type:"string",oneOf:[],"x-jsf-presentation":{inputType:"select"}},currency:{title:"Currency",description:"",type:"string",oneOf:[],"x-jsf-presentation":{inputType:"select"}},currency_statement:{type:"null",title:"Company statement","x-jsf-presentation":{inputType:"hidden",hidden:!0,statement:{title:"<TITLE_PLACEHOLDER>",description:"<DESCRIPTION_PLACEHOLDER>",inputType:"statement",severity:"warning"},meta:{ignoreValue:!0}}},hiring_budget:{title:"How would you like to estimate the cost of hiring?",enum:["employee_annual_salary","my_hiring_budget"],type:"string",oneOf:[{title:"With the employee's annual salary",const:"employee_annual_salary"},{title:"With my hiring budget for this role",const:"my_hiring_budget"}],"x-jsf-presentation":{inputType:"radio"}},salary:{description:"",title:"Salary",type:"integer","x-jsf-presentation":{inputType:"money"}},estimation_title:{title:"Estimation title",description:'Employee title. e.g; "Software Engineer".',type:"string","x-jsf-presentation":{inputType:"text",hidden:!0}},salary_conversion:{description:"",title:"Salary",type:"integer","x-jsf-presentation":{inputType:"money",hidden:!0}},salary_converted:{description:"Whether the salary is expressed in regional or employer currency",title:"Salary in employer currency",type:"string","x-jsf-presentation":{inputType:"hidden",hidden:!0}},management:{title:"Management fee",type:"object",properties:{management_fee:{title:"Desired monthly management fee",type:"integer","x-jsf-presentation":{inputType:"money"}},_expanded:{type:"boolean",default:!1,"x-jsf-presentation":{inputType:"hidden",hidden:!0}}},"x-jsf-presentation":{inputType:"fieldset",hidden:!0}}},required:["country","currency","salary","salary_conversion","salary_converted"],type:"object","x-jsf-order":["country","region","currency","currency_statement","salary","estimation_title","management"]}}};export{e as a};
2
+ //# sourceMappingURL=chunk-QATHYZUV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/CostCalculator/jsonSchema.ts"],"sourcesContent":["export const jsonSchema = {\n data: {\n version: 7,\n schema: {\n 'x-rmt-meta': { jsfOldVersion: true },\n additionalProperties: false,\n properties: {\n country: {\n title: 'Country',\n description: '',\n type: 'string',\n oneOf: [],\n 'x-jsf-presentation': {\n inputType: 'select',\n },\n },\n region: {\n title: 'Region',\n description: '',\n type: 'string',\n oneOf: [],\n 'x-jsf-presentation': {\n inputType: 'select',\n },\n },\n currency: {\n title: 'Currency',\n description: '',\n type: 'string',\n oneOf: [],\n 'x-jsf-presentation': {\n inputType: 'select',\n },\n },\n currency_statement: {\n type: 'null',\n title: 'Company statement',\n 'x-jsf-presentation': {\n inputType: 'hidden',\n hidden: true,\n statement: {\n title: '<TITLE_PLACEHOLDER>',\n description: '<DESCRIPTION_PLACEHOLDER>',\n inputType: 'statement',\n severity: 'warning',\n },\n meta: {\n ignoreValue: true,\n },\n },\n },\n hiring_budget: {\n title: 'How would you like to estimate the cost of hiring?',\n enum: ['employee_annual_salary', 'my_hiring_budget'],\n type: 'string',\n oneOf: [\n {\n title: \"With the employee's annual salary\",\n const: 'employee_annual_salary',\n },\n {\n title: 'With my hiring budget for this role',\n const: 'my_hiring_budget',\n },\n ],\n 'x-jsf-presentation': {\n inputType: 'radio',\n },\n },\n salary: {\n description: '',\n title: 'Salary',\n type: 'integer',\n 'x-jsf-presentation': {\n inputType: 'money',\n },\n },\n estimation_title: {\n title: 'Estimation title',\n description: 'Employee title. e.g; \"Software Engineer\".',\n type: 'string',\n 'x-jsf-presentation': {\n inputType: 'text',\n hidden: true,\n },\n },\n salary_conversion: {\n description: '',\n title: 'Salary',\n type: 'integer',\n 'x-jsf-presentation': {\n inputType: 'money',\n hidden: true,\n },\n },\n salary_converted: {\n description:\n 'Whether the salary is expressed in regional or employer currency',\n title: 'Salary in employer currency',\n type: 'string',\n 'x-jsf-presentation': {\n inputType: 'hidden',\n hidden: true,\n },\n },\n management: {\n title: 'Management fee',\n type: 'object',\n properties: {\n management_fee: {\n title: 'Desired monthly management fee',\n type: 'integer',\n 'x-jsf-presentation': {\n inputType: 'money',\n },\n },\n _expanded: {\n type: 'boolean',\n default: false,\n 'x-jsf-presentation': {\n inputType: 'hidden',\n hidden: true,\n },\n },\n },\n 'x-jsf-presentation': {\n inputType: 'fieldset',\n hidden: true,\n },\n },\n },\n required: [\n 'country',\n 'currency',\n 'salary',\n 'salary_conversion',\n 'salary_converted',\n ],\n type: 'object',\n 'x-jsf-order': [\n 'country',\n 'region',\n 'currency',\n 'currency_statement',\n 'salary',\n 'estimation_title',\n 'management',\n ],\n },\n },\n};\n"],"mappings":"AAAO,IAAMA,EAAa,CACxB,KAAM,CACJ,QAAS,EACT,OAAQ,CACN,aAAc,CAAE,cAAe,EAAK,EACpC,qBAAsB,GACtB,WAAY,CACV,QAAS,CACP,MAAO,UACP,YAAa,GACb,KAAM,SACN,MAAO,CAAC,EACR,qBAAsB,CACpB,UAAW,QACb,CACF,EACA,OAAQ,CACN,MAAO,SACP,YAAa,GACb,KAAM,SACN,MAAO,CAAC,EACR,qBAAsB,CACpB,UAAW,QACb,CACF,EACA,SAAU,CACR,MAAO,WACP,YAAa,GACb,KAAM,SACN,MAAO,CAAC,EACR,qBAAsB,CACpB,UAAW,QACb,CACF,EACA,mBAAoB,CAClB,KAAM,OACN,MAAO,oBACP,qBAAsB,CACpB,UAAW,SACX,OAAQ,GACR,UAAW,CACT,MAAO,sBACP,YAAa,4BACb,UAAW,YACX,SAAU,SACZ,EACA,KAAM,CACJ,YAAa,EACf,CACF,CACF,EACA,cAAe,CACb,MAAO,qDACP,KAAM,CAAC,yBAA0B,kBAAkB,EACnD,KAAM,SACN,MAAO,CACL,CACE,MAAO,oCACP,MAAO,wBACT,EACA,CACE,MAAO,sCACP,MAAO,kBACT,CACF,EACA,qBAAsB,CACpB,UAAW,OACb,CACF,EACA,OAAQ,CACN,YAAa,GACb,MAAO,SACP,KAAM,UACN,qBAAsB,CACpB,UAAW,OACb,CACF,EACA,iBAAkB,CAChB,MAAO,mBACP,YAAa,4CACb,KAAM,SACN,qBAAsB,CACpB,UAAW,OACX,OAAQ,EACV,CACF,EACA,kBAAmB,CACjB,YAAa,GACb,MAAO,SACP,KAAM,UACN,qBAAsB,CACpB,UAAW,QACX,OAAQ,EACV,CACF,EACA,iBAAkB,CAChB,YACE,mEACF,MAAO,8BACP,KAAM,SACN,qBAAsB,CACpB,UAAW,SACX,OAAQ,EACV,CACF,EACA,WAAY,CACV,MAAO,iBACP,KAAM,SACN,WAAY,CACV,eAAgB,CACd,MAAO,iCACP,KAAM,UACN,qBAAsB,CACpB,UAAW,OACb,CACF,EACA,UAAW,CACT,KAAM,UACN,QAAS,GACT,qBAAsB,CACpB,UAAW,SACX,OAAQ,EACV,CACF,CACF,EACA,qBAAsB,CACpB,UAAW,WACX,OAAQ,EACV,CACF,CACF,EACA,SAAU,CACR,UACA,WACA,SACA,oBACA,kBACF,EACA,KAAM,SACN,cAAe,CACb,UACA,SACA,WACA,qBACA,SACA,mBACA,YACF,CACF,CACF,CACF","names":["jsonSchema"]}
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-KVUKJU5U.js";import{a as i}from"./chunk-PKJZ2N4C.js";import{a as v}from"./chunk-BHHK7QQZ.js";import{a as B}from"./chunk-XEVHXHHC.js";import{a as l}from"./chunk-GE74QKS6.js";import{a as b}from"./chunk-EVUTX6TJ.js";import{a as n}from"./chunk-CW7CHRMN.js";import{a as f}from"./chunk-D6PMXNBM.js";import{a as c}from"./chunk-DB4JHJ3Z.js";import{a as C}from"./chunk-DDMXUBCN.js";import{a as p}from"./chunk-TX6RWQUR.js";import{a}from"./chunk-4WSYC3Q5.js";import{a as u}from"./chunk-GTS7KFEM.js";import{a as g}from"./chunk-V3AVEPNA.js";import{a as S}from"./chunk-FV6NNYDP.js";import{a as d}from"./chunk-SVVZOMLQ.js";import{a as e}from"./chunk-Q3ALCPJN.js";import{a as m}from"./chunk-25MUO3XP.js";import{a as o}from"./chunk-P37U34EQ.js";import{useId as D,useRef as V,useMemo as x}from"react";import{jsx as E}from"react/jsx-runtime";var j=o(({render:I,employmentId:O,externalId:w,countryCode:P,skipSteps:R,initialValues:h,options:k})=>{let F=D(),t=V(void 0),y=x(()=>({setValue:t}),[]),r=m({options:{...k,onContractReviewed:o(()=>{t.current&&t.current("review_completed",!0)},"onContractReviewed")},employmentId:O,externalId:w,countryCode:P,skipSteps:R,initialValues:h});return E(e.Provider,{value:{contractorOnboardingBag:r,formId:F,formRef:y},children:I({contractorOnboardingBag:r,components:{BasicInformationStep:a,SelectCountryStep:i,BackButton:n,SubmitButton:c,PricingPlanStep:p,EligibilityQuestionnaireStep:l,ContractOriginStep:g,InvoiceScheduleStep:b,CreateInvoiceScheduleStep:B,ContractDetailsStep:u,ContractPreviewStep:S,OnboardingInvite:f,ContractReviewButton:d,SaveDraftButton:s,SkipInvoiceScheduleButton:v,PreviewInvoiceButton:C}})})},"ContractorOnboardingFlow");export{j as a};
2
- //# sourceMappingURL=chunk-VKUGCD5J.js.map
1
+ import{a as s}from"./chunk-KVUKJU5U.js";import{a as i}from"./chunk-XLHTMWJ3.js";import{a as v}from"./chunk-BHHK7QQZ.js";import{a as B}from"./chunk-ROVMQ5NT.js";import{a as l}from"./chunk-335N2CVQ.js";import{a as b}from"./chunk-77LDJPXF.js";import{a as n}from"./chunk-CW7CHRMN.js";import{a as f}from"./chunk-OAX6TPIP.js";import{a as c}from"./chunk-DB4JHJ3Z.js";import{a as C}from"./chunk-36DZMQHH.js";import{a as p}from"./chunk-IJS67A57.js";import{a}from"./chunk-OJ4TXF6G.js";import{a as u}from"./chunk-EQOOVJ7K.js";import{a as g}from"./chunk-I5NW7AQZ.js";import{a as S}from"./chunk-5FST4WDH.js";import{a as d}from"./chunk-D7F3QKN5.js";import{a as e}from"./chunk-Q3ALCPJN.js";import{a as m}from"./chunk-SMCLTRJW.js";import{a as o}from"./chunk-P37U34EQ.js";import{useId as D,useRef as V,useMemo as x}from"react";import{jsx as E}from"react/jsx-runtime";var j=o(({render:I,employmentId:O,externalId:w,countryCode:P,skipSteps:R,initialValues:h,options:k})=>{let F=D(),t=V(void 0),y=x(()=>({setValue:t}),[]),r=m({options:{...k,onContractReviewed:o(()=>{t.current&&t.current("review_completed",!0)},"onContractReviewed")},employmentId:O,externalId:w,countryCode:P,skipSteps:R,initialValues:h});return E(e.Provider,{value:{contractorOnboardingBag:r,formId:F,formRef:y},children:I({contractorOnboardingBag:r,components:{BasicInformationStep:a,SelectCountryStep:i,BackButton:n,SubmitButton:c,PricingPlanStep:p,EligibilityQuestionnaireStep:l,ContractOriginStep:g,InvoiceScheduleStep:b,CreateInvoiceScheduleStep:B,ContractDetailsStep:u,ContractPreviewStep:S,OnboardingInvite:f,ContractReviewButton:d,SaveDraftButton:s,SkipInvoiceScheduleButton:v,PreviewInvoiceButton:C}})})},"ContractorOnboardingFlow");export{j as a};
2
+ //# sourceMappingURL=chunk-QIY6K2FB.js.map
@@ -0,0 +1,2 @@
1
+ import{a as V}from"./chunk-E7Y3YBZH.js";import{n as X}from"./chunk-UBWNTSWS.js";import{a as L}from"./chunk-2L6AB46E.js";import{i as U}from"./chunk-C7KVPEVX.js";import{e as A}from"./chunk-SRLBVFNQ.js";import{e as G,f as N,g as D}from"./chunk-C4HFMTSB.js";import{b as J}from"./chunk-H2O4CVKF.js";import{a as n,b as u,c as ke}from"./chunk-P37U34EQ.js";var _=u((Fn,z)=>{"use strict";function Me(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}n(Me,"isObject");z.exports=Me});var Q=u((Mn,K)=>{"use strict";var Ne=typeof global=="object"&&global&&global.Object===Object&&global;K.exports=Ne});var $=u((Nn,Y)=>{"use strict";var De=Q(),Le=typeof self=="object"&&self&&self.Object===Object&&self,_e=De||Le||Function("return this")();Y.exports=_e});var ee=u((Dn,Z)=>{"use strict";var $e=$(),He=n(function(){return $e.Date.now()},"now");Z.exports=He});var te=u((_n,ne)=>{"use strict";var We=/\s/;function Be(e){for(var t=e.length;t--&&We.test(e.charAt(t)););return t}n(Be,"trimmedEndIndex");ne.exports=Be});var oe=u((Hn,re)=>{"use strict";var Ae=te(),Ge=/^\s+/;function Je(e){return e&&e.slice(0,Ae(e)+1).replace(Ge,"")}n(Je,"baseTrim");re.exports=Je});var H=u((Bn,ie)=>{"use strict";var Ue=$(),Ve=Ue.Symbol;ie.exports=Ve});var ue=u((An,ce)=>{"use strict";var se=H(),ae=Object.prototype,Xe=ae.hasOwnProperty,ze=ae.toString,R=se?se.toStringTag:void 0;function Ke(e){var t=Xe.call(e,R),r=e[R];try{e[R]=void 0;var o=!0}catch{}var s=ze.call(e);return o&&(t?e[R]=r:delete e[R]),s}n(Ke,"getRawTag");ce.exports=Ke});var fe=u((Jn,le)=>{"use strict";var Qe=Object.prototype,Ye=Qe.toString;function Ze(e){return Ye.call(e)}n(Ze,"objectToString");le.exports=Ze});var ge=u((Vn,pe)=>{"use strict";var de=H(),en=ue(),nn=fe(),tn="[object Null]",rn="[object Undefined]",me=de?de.toStringTag:void 0;function on(e){return e==null?e===void 0?rn:tn:me&&me in Object(e)?en(e):nn(e)}n(on,"baseGetTag");pe.exports=on});var be=u((zn,ve)=>{"use strict";function sn(e){return e!=null&&typeof e=="object"}n(sn,"isObjectLike");ve.exports=sn});var ye=u((Qn,Ce)=>{"use strict";var an=ge(),cn=be(),un="[object Symbol]";function ln(e){return typeof e=="symbol"||cn(e)&&an(e)==un}n(ln,"isSymbol");Ce.exports=ln});var Se=u((Zn,xe)=>{"use strict";var fn=oe(),he=_(),dn=ye(),Te=NaN,mn=/^[-+]0x[0-9a-f]+$/i,pn=/^0b[01]+$/i,gn=/^0o[0-7]+$/i,vn=parseInt;function bn(e){if(typeof e=="number")return e;if(dn(e))return Te;if(he(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=he(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=fn(e);var r=pn.test(e);return r||gn.test(e)?vn(e.slice(2),r?2:8):mn.test(e)?Te:+e}n(bn,"toNumber");xe.exports=bn});var Ee=u((nt,Oe)=>{"use strict";var Cn=_(),W=ee(),je=Se(),yn="Expected a function",hn=Math.max,Tn=Math.min;function xn(e,t,r){var o,s,p,l,a,f,h=0,d=!1,g=!1,j=!0;if(typeof e!="function")throw new TypeError(yn);t=je(t)||0,Cn(r)&&(d=!!r.leading,g="maxWait"in r,p=g?hn(je(r.maxWait)||0,t):p,j="trailing"in r?!!r.trailing:j);function m(i){var v=o,T=s;return o=s=void 0,h=i,l=e.apply(T,v),l}n(m,"invokeFunc");function P(i){return h=i,a=setTimeout(x,t),d?m(i):l}n(P,"leadingEdge");function I(i){var v=i-f,T=i-h,w=t-v;return g?Tn(w,p-T):w}n(I,"remainingWait");function O(i){var v=i-f,T=i-h;return f===void 0||v>=t||v<0||g&&T>=p}n(O,"shouldInvoke");function x(){var i=W();if(O(i))return E(i);a=setTimeout(x,I(i))}n(x,"timerExpired");function E(i){return a=void 0,j&&o?m(i):(o=s=void 0,l)}n(E,"trailingEdge");function b(){a!==void 0&&clearTimeout(a),h=0,o=f=s=a=void 0}n(b,"cancel");function q(){return a===void 0?l:E(W())}n(q,"flush");function S(){var i=W(),v=O(i);if(o=arguments,s=this,f=i,v){if(a===void 0)return P(f);if(g)return clearTimeout(a),a=setTimeout(x,t),m(f)}return a===void 0&&(a=setTimeout(x,t)),l}return n(S,"debounced"),S.cancel=b,S.flush=q,S}n(xn,"debounce");Oe.exports=xn});import{useState as On,useCallback as En,useEffect as Ie,useRef as Rn}from"react";import Pn from"lodash.omit";var Pe=ke(Ee(),1);import{useCallback as Sn,useEffect as jn,useRef as Re}from"react";function B(e,t){let r=Re(e);jn(()=>{r.current=e},[e]);let o=Re((0,Pe.default)(s=>{r.current(s)},t)).current;return Sn(s=>{o(s)},[o])}n(B,"useDebounce");import{Fragment as wn,jsx as y,jsxs as qe}from"react/jsx-runtime";var In=n(({description:e,helpCenter:t,toggle:r,className:o})=>qe("span",{className:o,children:[y(U,{as:"span",helpCenter:t,children:e})," ",r]}),"DescriptionWithConversion"),qn=n(({showConversion:e,targetCurrency:t,className:r,onClick:o})=>{let{components:s}=J(),p=e?`Hide ${t} conversion`:`Show ${t} conversion`,l=s?.button;if(!l)throw new Error("Button component not found");return y(l,{className:r,"data-type":"inline",onClick:o,children:p})},"ConversionToggle"),bt=n(({sourceCurrency:e,targetCurrency:t,mainFieldName:r,conversionFieldName:o,conversionProperties:s,classNamePrefix:p,description:l,conversionType:a="spread",meta:f,splitDescription:h=!1,...d})=>{let[g,j]=On(!1),{setValue:m,watch:P}=A(),I=P(r||d.name),O=Rn(!0),x=e&&t&&e!==t,{mutateAsync:E}=X({type:a}),b=`${d.name}_converted`;Ie(()=>{m(b,r||d.name)},[m,r,d.name,b]),Ie(()=>{if(O.current){O.current=!1;return}m(o,"")},[e,o,m]);let q=En(async(c,C,k)=>{if(!(!c||isNaN(c)||c<=0))return E({source_currency:C,target_currency:k,amount:c})},[E]),S=B(async c=>{let C=N(c),M=1/((await q(C,t,e))?.data?.data.conversion_data?.exchange_rate??1),Fe=G(Number(C)*M);m(o,D(Fe))},500),i=B(async c=>{let C=N(c),M=(await q(C,t,e))?.data?.data.conversion_data.target_amount;m(r||d.name,D(M))},500),v=n(c=>{m(b,r||d.name),g&&S(c.target.value)},"handleMainFieldChange"),T=n(c=>{m(b,o),i(c.target.value)},"handleConversionFieldChange"),w=n(c=>{c.preventDefault(),j(C=>!C),!g&&I&&S(I)},"toggleConversion"),F=x?y(qn,{targetCurrency:t,showConversion:g,className:`${p}-button`,onClick:w}):null,we=h?{meta:f,description:l,descriptionSuffix:F}:{meta:F?Pn(f,"helpCenter"):f,description:F?y(In,{description:l,helpCenter:y(V,{helpCenter:f?.helpCenter}),toggle:F,className:`${p}-description`}):l};return qe(wn,{children:[y(L,{...d,...we,name:r||d.name,additionalProps:{currency:e},type:"text",inputMode:"decimal",pattern:"^[0-9.]*$",maxLength:15,onChange:v}),g&&y(L,{additionalProps:{currency:t},name:o,label:s?.label||"Conversion",description:s?.description,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$",maxLength:15,onChange:T}),y("input",{type:"hidden",name:b,value:P(b)||r||d.name})]})},"CurrencyConversionField");export{bt as a};
2
+ //# sourceMappingURL=chunk-QMMNXGQF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../node_modules/lodash/isObject.js","../node_modules/lodash/_freeGlobal.js","../node_modules/lodash/_root.js","../node_modules/lodash/now.js","../node_modules/lodash/_trimmedEndIndex.js","../node_modules/lodash/_baseTrim.js","../node_modules/lodash/_Symbol.js","../node_modules/lodash/_getRawTag.js","../node_modules/lodash/_objectToString.js","../node_modules/lodash/_baseGetTag.js","../node_modules/lodash/isObjectLike.js","../node_modules/lodash/isSymbol.js","../node_modules/lodash/toNumber.js","../node_modules/lodash/debounce.js","../src/components/form/fields/CurrencyConversionField.tsx","../src/common/hooks.ts"],"sourcesContent":["/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\nmodule.exports = now;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;\n","import { ReactNode, useState, useCallback, useEffect, useRef } from 'react';\nimport { useFormContext } from 'react-hook-form';\nimport omit from 'lodash.omit';\nimport { TextField } from '@/src/components/form/fields/TextField';\nimport { useConvertCurrency } from '@/src/flows/Onboarding/api';\nimport { JSFField } from '@/src/types/remoteFlows';\nimport { HelpCenterDataProps } from '@/src/types/fields';\nimport { useFormFields } from '@/src/context';\nimport { useDebounce } from '@/src/common/hooks';\nimport { FormDescription } from '@/src/components/ui/form';\nimport { HelpCenter } from '@/src/components/shared/zendesk-drawer/HelpCenter';\nimport {\n convertFromCents,\n convertToCents,\n round,\n} from '@/src/components/form/utils';\n\ntype DescriptionWithConversionProps = {\n description: ReactNode;\n helpCenter: ReactNode;\n toggle: ReactNode;\n className: string;\n};\n\nconst DescriptionWithConversion = ({\n description,\n helpCenter,\n toggle,\n className,\n}: DescriptionWithConversionProps) => (\n <span className={className}>\n <FormDescription as='span' helpCenter={helpCenter}>\n {description}\n </FormDescription>{' '}\n {toggle}\n </span>\n);\n\ntype ConversionToggleProps = {\n showConversion: boolean;\n targetCurrency: string;\n className: string;\n onClick: (evt: React.MouseEvent<HTMLButtonElement>) => void;\n};\n\nconst ConversionToggle = ({\n showConversion,\n targetCurrency,\n className,\n onClick,\n}: ConversionToggleProps) => {\n const { components } = useFormFields();\n const label = showConversion\n ? `Hide ${targetCurrency} conversion`\n : `Show ${targetCurrency} conversion`;\n\n const CustomButton = components?.button;\n if (!CustomButton) {\n throw new Error(`Button component not found`);\n }\n\n return (\n <CustomButton className={className} data-type='inline' onClick={onClick}>\n {label}\n </CustomButton>\n );\n};\n\nexport type CurrencyConversionFieldProps = JSFField & {\n sourceCurrency: string;\n targetCurrency: string;\n mainFieldName?: string;\n conversionFieldName: string;\n conversionProperties?: {\n label?: string;\n description?: ReactNode;\n };\n useProxy?: boolean;\n classNamePrefix: string;\n conversionType?: 'spread' | 'no_spread';\n meta?: {\n helpCenter?: HelpCenterDataProps;\n };\n /**\n * Enabled by the 'split_salary_description' feature flag. When on, the description, the help\n * center link and the conversion toggle are handed to the text component as three separate\n * slots instead of being packed into the description node.\n */\n splitDescription?: boolean;\n};\n\nexport const CurrencyConversionField = ({\n sourceCurrency,\n targetCurrency,\n mainFieldName,\n conversionFieldName,\n conversionProperties,\n classNamePrefix,\n description,\n conversionType = 'spread',\n meta,\n splitDescription = false,\n ...props\n}: CurrencyConversionFieldProps) => {\n const [showConversion, setShowConversion] = useState(false);\n const { setValue, watch } = useFormContext();\n const fieldValue = watch(mainFieldName || props.name);\n const isFirstRender = useRef(true);\n\n const canShowConversion =\n sourceCurrency && targetCurrency && sourceCurrency !== targetCurrency;\n\n const { mutateAsync: convertCurrency } = useConvertCurrency({\n type: conversionType,\n });\n\n // we keep track of the last input the user used, so we can make sure\n // we keep consistent currency rates\n const lastInputFieldName = `${props.name}_converted`;\n useEffect(() => {\n setValue(lastInputFieldName, mainFieldName || props.name);\n }, [setValue, mainFieldName, props.name, lastInputFieldName]);\n\n useEffect(() => {\n if (isFirstRender.current) {\n isFirstRender.current = false;\n return;\n }\n\n // when source currency changes, reset the conversion field\n setValue(conversionFieldName, '');\n }, [sourceCurrency, conversionFieldName, setValue]);\n\n const convertCurrencyCallback = useCallback(\n async (amount: number | null, fromCurrency: string, toCurrency: string) => {\n if (!amount || isNaN(amount) || amount <= 0) return;\n\n return convertCurrency({\n source_currency: fromCurrency,\n target_currency: toCurrency,\n amount,\n });\n },\n [convertCurrency],\n );\n\n const debouncedConvertCurrency = useDebounce(async (value: string) => {\n // The SDK sets the employer billing currency in the salary field, but internally we don't do it like this, is set based on the employee billing currency\n // That's why we need to do 1 / exchange rate to get the correct amount, if currencies were different, it would be done in the debouncedConvertCurrencyReverse\n // THE BE always transforms from the target currency to the source currency\n const amountInCents = convertToCents(value);\n const conversion = await convertCurrencyCallback(\n amountInCents,\n targetCurrency,\n sourceCurrency,\n );\n\n const exchangeRate =\n 1 / (conversion?.data?.data.conversion_data?.exchange_rate ?? 1);\n\n const amount = round(Number(amountInCents) * exchangeRate);\n\n setValue(conversionFieldName, convertFromCents(amount));\n }, 500);\n\n const debouncedConvertCurrencyReverse = useDebounce(async (value: string) => {\n const amount = convertToCents(value);\n const conversion = await convertCurrencyCallback(\n amount,\n targetCurrency,\n sourceCurrency,\n );\n\n const conversionAmount =\n conversion?.data?.data.conversion_data.target_amount;\n\n setValue(mainFieldName || props.name, convertFromCents(conversionAmount));\n }, 500);\n\n const handleMainFieldChange = (evt: React.ChangeEvent<HTMLInputElement>) => {\n setValue(lastInputFieldName, mainFieldName || props.name);\n if (showConversion) {\n debouncedConvertCurrency(evt.target.value);\n }\n };\n\n const handleConversionFieldChange = (\n evt: React.ChangeEvent<HTMLInputElement>,\n ) => {\n setValue(lastInputFieldName, conversionFieldName);\n debouncedConvertCurrencyReverse(evt.target.value);\n };\n\n const toggleConversion = (evt: React.MouseEvent<HTMLButtonElement>) => {\n evt.preventDefault();\n setShowConversion((prev) => !prev);\n\n if (!showConversion && fieldValue) {\n debouncedConvertCurrency(fieldValue);\n }\n };\n\n const conversionToggle = canShowConversion ? (\n <ConversionToggle\n targetCurrency={targetCurrency}\n showConversion={showConversion}\n className={`${classNamePrefix}-button`}\n onClick={toggleConversion}\n />\n ) : null;\n\n // With the split_salary_description feature, the toggle is handed over as a separate slot so the\n // text component stays free to render the description, the help center link and the toggle\n // however it wants. Without it, we keep packing them into the description node: it's the only\n // slot every text component is known to render, so the toggle can't get lost. The help center\n // link is then rendered by us and stripped from the meta we forward, to avoid rendering it twice\n // (FormDescription appends it after its children, which would put it after the toggle).\n const descriptionProps = splitDescription\n ? { meta, description, descriptionSuffix: conversionToggle }\n : {\n meta: conversionToggle ? omit(meta, 'helpCenter') : meta,\n description: conversionToggle ? (\n <DescriptionWithConversion\n description={description}\n helpCenter={<HelpCenter helpCenter={meta?.helpCenter} />}\n toggle={conversionToggle}\n className={`${classNamePrefix}-description`}\n />\n ) : (\n description\n ),\n };\n\n return (\n <>\n <TextField\n {...props}\n {...descriptionProps}\n name={mainFieldName || props.name}\n additionalProps={{ currency: sourceCurrency }}\n type='text'\n inputMode='decimal'\n pattern='^[0-9.]*$'\n maxLength={15}\n onChange={handleMainFieldChange}\n />\n {showConversion && (\n <TextField\n additionalProps={{ currency: targetCurrency }}\n name={conversionFieldName}\n label={conversionProperties?.label || 'Conversion'}\n description={conversionProperties?.description}\n type='text'\n inputMode='decimal'\n pattern='^[0-9.]*$'\n maxLength={15}\n onChange={handleConversionFieldChange}\n />\n )}\n <input\n type='hidden'\n name={lastInputFieldName}\n value={watch(lastInputFieldName) || mainFieldName || props.name}\n />\n </>\n );\n};\n","import { useCallback, useEffect, useRef } from 'react';\nimport debounce from 'lodash/debounce';\n\nexport function useDebounce(\n callback: (value: string) => Promise<void>,\n delay: number,\n) {\n const callbackRef = useRef(callback);\n\n useEffect(() => {\n callbackRef.current = callback;\n }, [callback]);\n\n const debouncedFn = useRef(\n // WE NEED TO FIX: react-hooks/refs - Passing a ref to a function may read its value during render\n // oxlint-disable-next-line react-hooks/refs\n debounce((value: string) => {\n callbackRef.current(value);\n }, delay),\n ).current;\n\n return useCallback(\n (value: string) => {\n debouncedFn(value);\n },\n [debouncedFn],\n );\n}\n"],"mappings":"6VAAA,IAAAA,EAAAC,EAAA,CAAAC,GAAAC,IAAA,cAyBA,SAASC,GAASC,EAAO,CACvB,IAAIC,EAAO,OAAOD,EAClB,OAAOA,GAAS,OAASC,GAAQ,UAAYA,GAAQ,WACvD,CAHSC,EAAAH,GAAA,YAKTD,EAAO,QAAUC,KC9BjB,IAAAI,EAAAC,EAAA,CAAAC,GAAAC,IAAA,cACA,IAAIC,GAAa,OAAO,QAAU,UAAY,QAAU,OAAO,SAAW,QAAU,OAEpFD,EAAO,QAAUC,KCHjB,IAAAC,EAAAC,EAAA,CAAAC,GAAAC,IAAA,kBAAIC,GAAa,IAGbC,GAAW,OAAO,MAAQ,UAAY,MAAQ,KAAK,SAAW,QAAU,KAGxEC,GAAOF,IAAcC,IAAY,SAAS,aAAa,EAAE,EAE7DF,EAAO,QAAUG,KCRjB,IAAAC,GAAAC,EAAA,CAAAC,GAAAC,IAAA,kBAAIC,GAAO,IAkBPC,GAAMC,EAAA,UAA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AAM1C,GAAiBO,EAAM,KAC7B,gBAAiB,CAAE,SAAUR,CAAe,EAC5C,KAAK,OACL,UAAU,UACV,QAAQ,YACR,UAAW,GACX,SAAUqC,EACZ,EACC7C,GACCV,EAACgE,EAAA,CACC,gBAAiB,CAAE,SAAUrD,CAAe,EAC5C,KAAMS,EACN,MAAOC,GAAsB,OAAS,aACtC,YAAaA,GAAsB,YACnC,KAAK,OACL,UAAU,UACV,QAAQ,YACR,UAAW,GACX,SAAUoC,EACZ,EAEFzD,EAAC,SACC,KAAK,SACL,KAAMsC,EACN,MAAOR,EAAMQ,CAAkB,GAAKnB,GAAiBO,EAAM,KAC7D,GACF,CAEJ,EA/KuC","names":["require_isObject","__commonJSMin","exports","module","isObject","value","type","__name","require_freeGlobal","__commonJSMin","exports","module","freeGlobal","require_root","__commonJSMin","exports","module","freeGlobal","freeSelf","root","require_now","__commonJSMin","exports","module","root","now","__name","require_trimmedEndIndex","__commonJSMin","exports","module","reWhitespace","trimmedEndIndex","string","index","__name","require_baseTrim","__commonJSMin","exports","module","trimmedEndIndex","reTrimStart","baseTrim","string","__name","require_Symbol","__commonJSMin","exports","module","root","Symbol","require_getRawTag","__commonJSMin","exports","module","Symbol","objectProto","hasOwnProperty","nativeObjectToString","symToStringTag","getRawTag","value","isOwn","tag","unmasked","result","__name","require_objectToString","__commonJSMin","exports","module","objectProto","nativeObjectToString","objectToString","value","__name","require_baseGetTag","__commonJSMin","exports","module","Symbol","getRawTag","objectToString","nullTag","undefinedTag","symToStringTag","baseGetTag","value","__name","require_isObjectLike","__commonJSMin","exports","module","isObjectLike","value","__name","require_isSymbol","__commonJSMin","exports","module","baseGetTag","isObjectLike","symbolTag","isSymbol","value","__name","require_toNumber","__commonJSMin","exports","module","baseTrim","isObject","isSymbol","NAN","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","toNumber","value","other","isBinary","__name","require_debounce","__commonJSMin","exports","module","isObject","now","toNumber","FUNC_ERROR_TEXT","nativeMax","nativeMin","debounce","func","wait","options","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","invokeFunc","time","args","thisArg","__name","leadingEdge","timerExpired","remainingWait","timeSinceLastCall","timeSinceLastInvoke","timeWaiting","shouldInvoke","trailingEdge","cancel","flush","debounced","isInvoking","useState","useCallback","useEffect","useRef","omit","import_debounce","useCallback","useEffect","useRef","useDebounce","callback","delay","callbackRef","useRef","useEffect","debouncedFn","debounce","value","useCallback","__name","Fragment","jsx","jsxs","DescriptionWithConversion","__name","description","helpCenter","toggle","className","FormDescription","ConversionToggle","showConversion","targetCurrency","onClick","components","useFormFields","label","CustomButton","CurrencyConversionField","sourceCurrency","mainFieldName","conversionFieldName","conversionProperties","classNamePrefix","conversionType","meta","splitDescription","props","setShowConversion","useState","setValue","watch","useFormContext","fieldValue","isFirstRender","useRef","canShowConversion","convertCurrency","useConvertCurrency","lastInputFieldName","useEffect","convertCurrencyCallback","useCallback","amount","fromCurrency","toCurrency","debouncedConvertCurrency","useDebounce","value","amountInCents","convertToCents","exchangeRate","round","convertFromCents","debouncedConvertCurrencyReverse","conversionAmount","handleMainFieldChange","evt","handleConversionFieldChange","toggleConversion","prev","conversionToggle","descriptionProps","omit","HelpCenter","TextField"]}
@@ -1,2 +1,2 @@
1
- import{a as N,b as U}from"./chunk-TJZ5BJV3.js";import{a as Q,b as W,c as q,d as j,e as z,f as H}from"./chunk-RYZ7TJVS.js";import{c as J}from"./chunk-KMLI4ISS.js";import{b as l,h as g}from"./chunk-C4HFMTSB.js";import{a as B}from"./chunk-M3TA5X2H.js";import{a as S}from"./chunk-P37U34EQ.js";import{useState as X,useMemo as gt,useCallback as c}from"react";var wt=S(m=>{let s=0;return{select_country:{index:s++,name:"select_country",visible:!m},contract_details:{index:s++,name:"contract_details"},administrative_details:{index:s++,name:"administrative_details"},invite:{index:s++,name:"invite"}}},"buildAdminSteps"),It=S(({companyId:m,legalEntityId:s,countryCode:Y,employmentId:w,initialValues:_,options:Z})=>{let{data:h,isLoading:$,isError:tt}=U(m),p=s??h?.[0]?.id,[n,C]=X(w),et=_?.basic_information?.country_code,[a,u]=X(Y??et),P=!!a&&!!w,nt=gt(()=>wt(P),[P]),{updateErrorContext:b}=J({flow:"payroll_admin_onboarding"}),at=c(t=>{b({step:t.name})},[b]),{stepState:A,nextStep:it,previousStep:ot,goToStep:st,setStepValues:rt,fieldValues:y,setFieldValues:E}=B(nt,at),d=A.currentStep.name,dt={select_country:"global_payroll_basic_information",contract_details:"global_payroll_contract_details",administrative_details:"global_payroll_administrative_details"},I=W(y),V=Q(a,dt[d],y,{employmentId:d!=="select_country"?n:void 0}),F=d==="select_country"&&!a,i=F?I.data:V.data,lt=F?I.isLoading:V.isLoading,v=q(),O=j(),D=z(),G=H(),{mutateAsyncOrThrow:L}=l(v),{mutateAsyncOrThrow:x}=l(O),{mutateAsyncOrThrow:T}=l(D),{mutateAsyncOrThrow:K}=l(G),ct=v.isPending||O.isPending||D.isPending||G.isPending,{data:R,isLoading:mt,refetch:r}=N(n),pt=R?.find(t=>t.type==="completion")?.sub_steps?.[0]?.status==="completed",ut=c(t=>{E(t);let e=t.country_code;e&&e!==a&&u(e)},[a,E]),yt=c(async t=>{if(!i)return null;let e=await g(t,i.fields,{isPartialValidation:!1});return i.handleValidation(e)},[i]),f=c(async t=>i?g(t,i.fields,{isPartialValidation:!1}):t,[i]),ft=c(async t=>{let e=await f(t);switch(d){case"select_country":{let o=e.country_code??a;if(!o)throw new Error("Country code is required to create an employment.");if(o!==a&&u(o),n){let St=await x({employmentId:n,basicInformation:e});return await r(),St}if(!p)throw new Error("No GP-enabled legal entity available. Cannot create an employment.");let k=await L({countryCode:o,legalEntityId:p,basicInformation:e}),M=k?.data?.employment?.id;if(!M)throw new Error("Employment was created but no ID was returned. Cannot proceed.");return C(M),await r(),k}case"contract_details":{if(!n)throw new Error("Employment ID is missing. Complete the previous step first.");let o=await T({employmentId:n,contractDetails:e});return await r(),o}case"administrative_details":{if(!n)throw new Error("Employment ID is missing. Complete the previous step first.");let o=await K({employmentId:n,administrativeDetails:e});return await r(),o}default:return}},[d,a,n,p,f,L,x,T,K,r]);return{stepState:A,isLoading:mt||lt||$,isSubmitting:ct,isComplete:pt??!1,companyId:m,legalEntityId:p,legalEntities:h??[],isErrorLegalEntities:tt,countryCode:a,employmentId:n,initialValues:_,options:Z,apiSteps:R,refetchSteps:r,fields:i?.fields??[],meta:i?.meta??{},fieldValues:y,setFieldValues:ut,handleValidation:yt,parseFormValues:f,onSubmit:ft,setInternalCountryCode:u,setInternalEmploymentId:C,next:it,back:ot,goToStep:st,setStepValues:rt}},"usePayrollAdminOnboarding");export{It as a};
2
- //# sourceMappingURL=chunk-ILEO7LN4.js.map
1
+ import{a as N,b as U}from"./chunk-QUJBIRNY.js";import{a as Q,b as W,c as q,d as j,e as z,f as H}from"./chunk-ISPN7HQ5.js";import{c as J}from"./chunk-KMLI4ISS.js";import{b as l,h as g}from"./chunk-C4HFMTSB.js";import{a as B}from"./chunk-M3TA5X2H.js";import{a as S}from"./chunk-P37U34EQ.js";import{useState as X,useMemo as gt,useCallback as c}from"react";var wt=S(m=>{let s=0;return{select_country:{index:s++,name:"select_country",visible:!m},contract_details:{index:s++,name:"contract_details"},administrative_details:{index:s++,name:"administrative_details"},invite:{index:s++,name:"invite"}}},"buildAdminSteps"),It=S(({companyId:m,legalEntityId:s,countryCode:Y,employmentId:w,initialValues:_,options:Z})=>{let{data:h,isLoading:$,isError:tt}=U(m),p=s??h?.[0]?.id,[n,C]=X(w),et=_?.basic_information?.country_code,[a,u]=X(Y??et),P=!!a&&!!w,nt=gt(()=>wt(P),[P]),{updateErrorContext:b}=J({flow:"payroll_admin_onboarding"}),at=c(t=>{b({step:t.name})},[b]),{stepState:A,nextStep:it,previousStep:ot,goToStep:st,setStepValues:rt,fieldValues:y,setFieldValues:E}=B(nt,at),d=A.currentStep.name,dt={select_country:"global_payroll_basic_information",contract_details:"global_payroll_contract_details",administrative_details:"global_payroll_administrative_details"},I=W(y),V=Q(a,dt[d],y,{employmentId:d!=="select_country"?n:void 0}),F=d==="select_country"&&!a,i=F?I.data:V.data,lt=F?I.isLoading:V.isLoading,v=q(),O=j(),D=z(),G=H(),{mutateAsyncOrThrow:L}=l(v),{mutateAsyncOrThrow:x}=l(O),{mutateAsyncOrThrow:T}=l(D),{mutateAsyncOrThrow:K}=l(G),ct=v.isPending||O.isPending||D.isPending||G.isPending,{data:R,isLoading:mt,refetch:r}=N(n),pt=R?.find(t=>t.type==="completion")?.sub_steps?.[0]?.status==="completed",ut=c(t=>{E(t);let e=t.country_code;e&&e!==a&&u(e)},[a,E]),yt=c(async t=>{if(!i)return null;let e=await g(t,i.fields,{isPartialValidation:!1});return i.handleValidation(e)},[i]),f=c(async t=>i?g(t,i.fields,{isPartialValidation:!1}):t,[i]),ft=c(async t=>{let e=await f(t);switch(d){case"select_country":{let o=e.country_code??a;if(!o)throw new Error("Country code is required to create an employment.");if(o!==a&&u(o),n){let St=await x({employmentId:n,basicInformation:e});return await r(),St}if(!p)throw new Error("No GP-enabled legal entity available. Cannot create an employment.");let k=await L({countryCode:o,legalEntityId:p,basicInformation:e}),M=k?.data?.employment?.id;if(!M)throw new Error("Employment was created but no ID was returned. Cannot proceed.");return C(M),await r(),k}case"contract_details":{if(!n)throw new Error("Employment ID is missing. Complete the previous step first.");let o=await T({employmentId:n,contractDetails:e});return await r(),o}case"administrative_details":{if(!n)throw new Error("Employment ID is missing. Complete the previous step first.");let o=await K({employmentId:n,administrativeDetails:e});return await r(),o}default:return}},[d,a,n,p,f,L,x,T,K,r]);return{stepState:A,isLoading:mt||lt||$,isSubmitting:ct,isComplete:pt??!1,companyId:m,legalEntityId:p,legalEntities:h??[],isErrorLegalEntities:tt,countryCode:a,employmentId:n,initialValues:_,options:Z,apiSteps:R,refetchSteps:r,fields:i?.fields??[],meta:i?.meta??{},fieldValues:y,setFieldValues:ut,handleValidation:yt,parseFormValues:f,onSubmit:ft,setInternalCountryCode:u,setInternalEmploymentId:C,next:it,back:ot,goToStep:st,setStepValues:rt}},"usePayrollAdminOnboarding");export{It as a};
2
+ //# sourceMappingURL=chunk-QRSMCORC.js.map
@@ -1,2 +1,2 @@
1
- import{_ as i,ja as s}from"./chunk-QQV5REGG.js";import{e as a}from"./chunk-H2O4CVKF.js";import{a as r}from"./chunk-P37U34EQ.js";import{useQuery as o}from"@tanstack/react-query";var u=r(t=>{let{client:n}=a();return o({queryKey:["gp-onboarding-steps",t],enabled:!!t,retry:!1,queryFn:r(async()=>{let e=await s({client:n,headers:{Authorization:""},path:{employment_id:t}});if(e.error||!e.data)throw new Error("Failed to fetch onboarding steps");return e.data},"queryFn"),select:r(e=>e.data.steps,"select")})},"useGPOnboardingSteps"),c=r(t=>{let{client:n}=a();return o({queryKey:["gp-legal-entities",t],enabled:!!t,retry:!1,queryFn:r(async()=>{let e=await i({client:n,headers:{Authorization:""},path:{company_id:t}});if(e.error||!e.data)throw new Error("Failed to fetch legal entities");return e.data},"queryFn"),select:r(e=>(e.data?.legal_entities??[]).filter(l=>l.global_payroll_enabled),"select")})},"useGPLegalEntities");export{u as a,c as b};
2
- //# sourceMappingURL=chunk-TJZ5BJV3.js.map
1
+ import{Z as i,ia as s}from"./chunk-DAUDKN32.js";import{e as a}from"./chunk-H2O4CVKF.js";import{a as r}from"./chunk-P37U34EQ.js";import{useQuery as o}from"@tanstack/react-query";var u=r(t=>{let{client:n}=a();return o({queryKey:["gp-onboarding-steps",t],enabled:!!t,retry:!1,queryFn:r(async()=>{let e=await s({client:n,headers:{Authorization:""},path:{employment_id:t}});if(e.error||!e.data)throw new Error("Failed to fetch onboarding steps");return e.data},"queryFn"),select:r(e=>e.data.steps,"select")})},"useGPOnboardingSteps"),c=r(t=>{let{client:n}=a();return o({queryKey:["gp-legal-entities",t],enabled:!!t,retry:!1,queryFn:r(async()=>{let e=await i({client:n,headers:{Authorization:""},path:{company_id:t}});if(e.error||!e.data)throw new Error("Failed to fetch legal entities");return e.data},"queryFn"),select:r(e=>(e.data?.legal_entities??[]).filter(l=>l.global_payroll_enabled),"select")})},"useGPLegalEntities");export{u as a,c as b};
2
+ //# sourceMappingURL=chunk-QUJBIRNY.js.map
@@ -1,2 +1,2 @@
1
- import{I as l,U as a,d as s}from"./chunk-QQV5REGG.js";import{e as o}from"./chunk-H2O4CVKF.js";import{a as t}from"./chunk-P37U34EQ.js";import{useMutation as y,useQuery as i}from"@tanstack/react-query";var h=t(({employmentId:e,queryParams:n,enabled:m=!0})=>{let{client:r}=o();return i({queryKey:["employment",e],retry:!1,queryFn:t(()=>a({client:r,headers:{Authorization:""},path:{employment_id:e},query:n}),"queryFn"),enabled:!!e&&m,select:t(({data:p})=>p?.data?.employment,"select")})},"useEmploymentQuery"),b=t(({employmentId:e,enabled:n=!0})=>{let{client:m}=o();return i({queryKey:["employment",e,"basic-information"],retry:!1,queryFn:t(()=>l({client:m,headers:{Authorization:""},path:{employment_id:e}}),"queryFn"),enabled:!!e&&n,select:t(({data:r})=>r?.data?.employment,"select")})},"useBasicInformationQuery"),R=t(()=>{let{client:e}=o();return y({mutationFn:t(({employmentId:n})=>s({client:e,headers:{Authorization:""},path:{employment_id:n}}),"mutationFn")})},"useDiscardEmploymentMutation");export{h as a,b,R as c};
2
- //# sourceMappingURL=chunk-OKBPMWVB.js.map
1
+ import{H as l,T as a,d as s}from"./chunk-DAUDKN32.js";import{e as o}from"./chunk-H2O4CVKF.js";import{a as t}from"./chunk-P37U34EQ.js";import{useMutation as y,useQuery as i}from"@tanstack/react-query";var h=t(({employmentId:e,queryParams:n,enabled:m=!0})=>{let{client:r}=o();return i({queryKey:["employment",e],retry:!1,queryFn:t(()=>a({client:r,headers:{Authorization:""},path:{employment_id:e},query:n}),"queryFn"),enabled:!!e&&m,select:t(({data:p})=>p?.data?.employment,"select")})},"useEmploymentQuery"),b=t(({employmentId:e,enabled:n=!0})=>{let{client:m}=o();return i({queryKey:["employment",e,"basic-information"],retry:!1,queryFn:t(()=>l({client:m,headers:{Authorization:""},path:{employment_id:e}}),"queryFn"),enabled:!!e&&n,select:t(({data:r})=>r?.data?.employment,"select")})},"useBasicInformationQuery"),R=t(()=>{let{client:e}=o();return y({mutationFn:t(({employmentId:n})=>s({client:e,headers:{Authorization:""},path:{employment_id:n}}),"mutationFn")})},"useDiscardEmploymentMutation");export{h as a,b,R as c};
2
+ //# sourceMappingURL=chunk-R23HFBV4.js.map
@@ -0,0 +1,2 @@
1
+ import{b as m}from"./chunk-F37FQXEZ.js";import{n as i}from"./chunk-C4HFMTSB.js";import{b as r}from"./chunk-H2O4CVKF.js";import{a as n}from"./chunk-P37U34EQ.js";import{jsx as d}from"react/jsx-runtime";function p({children:u,...t}){let{formId:s,invoiceScheduleBag:o}=m(),{components:c}=r(),e=c?.button;if(!e)throw new Error("Button component not found");return d(e,{...t,type:"submit",className:i("RemoteFlows__InvoiceScheduleForm__SubmitButton",t.className),form:s,disabled:t.disabled||o?.isSubmitting||!o?.employmentId,children:u})}n(p,"InvoiceScheduleSubmitButton");export{p as a};
2
+ //# sourceMappingURL=chunk-R4E37FVX.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/flows/InvoiceSchedule/InvoiceScheduleSubmitButton.tsx"],"sourcesContent":["import { ButtonHTMLAttributes, PropsWithChildren } from 'react';\nimport { useInvoiceScheduleContext } from '@/src/flows/InvoiceSchedule/context';\nimport { useFormFields } from '@/src/context';\nimport { cn } from '@/src/lib/utils';\n\nexport function InvoiceScheduleSubmitButton({\n children,\n ...props\n}: PropsWithChildren<ButtonHTMLAttributes<HTMLButtonElement>> &\n Record<string, unknown>) {\n const { formId, invoiceScheduleBag } = useInvoiceScheduleContext();\n const { components } = useFormFields();\n\n const CustomButton = components?.button;\n if (!CustomButton) {\n throw new Error(`Button component not found`);\n }\n\n return (\n <CustomButton\n {...props}\n type='submit'\n className={cn(\n 'RemoteFlows__InvoiceScheduleForm__SubmitButton',\n props.className,\n )}\n form={formId}\n disabled={props.disabled || invoiceScheduleBag?.isSubmitting}\n >\n {children}\n </CustomButton>\n );\n}\n"],"mappings":"gKAmBI,cAAAA,MAAA,oBAdG,SAASC,EAA4B,CAC1C,SAAAC,EACA,GAAGC,CACL,EAC2B,CACzB,GAAM,CAAE,OAAAC,EAAQ,mBAAAC,CAAmB,EAAIC,EAA0B,EAC3D,CAAE,WAAAC,CAAW,EAAIC,EAAc,EAE/BC,EAAeF,GAAY,OACjC,GAAI,CAACE,EACH,MAAM,IAAI,MAAM,4BAA4B,EAG9C,OACET,EAACS,EAAA,CACE,GAAGN,EACJ,KAAK,SACL,UAAWO,EACT,iDACAP,EAAM,SACR,EACA,KAAMC,EACN,SAAUD,EAAM,UAAYE,GAAoB,aAE/C,SAAAH,EACH,CAEJ,CA3BgBS,EAAAV,EAAA","names":["jsx","InvoiceScheduleSubmitButton","children","props","formId","invoiceScheduleBag","useInvoiceScheduleContext","components","useFormFields","CustomButton","cn","__name"]}
1
+ {"version":3,"sources":["../src/flows/InvoiceSchedule/InvoiceScheduleSubmitButton.tsx"],"sourcesContent":["import { ButtonHTMLAttributes, PropsWithChildren } from 'react';\nimport { useInvoiceScheduleContext } from '@/src/flows/InvoiceSchedule/context';\nimport { useFormFields } from '@/src/context';\nimport { cn } from '@/src/lib/utils';\n\nexport function InvoiceScheduleSubmitButton({\n children,\n ...props\n}: PropsWithChildren<ButtonHTMLAttributes<HTMLButtonElement>> &\n Record<string, unknown>) {\n const { formId, invoiceScheduleBag } = useInvoiceScheduleContext();\n const { components } = useFormFields();\n\n const CustomButton = components?.button;\n if (!CustomButton) {\n throw new Error(`Button component not found`);\n }\n\n return (\n <CustomButton\n {...props}\n type='submit'\n className={cn(\n 'RemoteFlows__InvoiceScheduleForm__SubmitButton',\n props.className,\n )}\n form={formId}\n // Mirrors the preview button: both endpoints are scoped to an employment, so with no\n // contractor to create for there is nothing to submit.\n disabled={\n props.disabled ||\n invoiceScheduleBag?.isSubmitting ||\n !invoiceScheduleBag?.employmentId\n }\n >\n {children}\n </CustomButton>\n );\n}\n"],"mappings":"gKAmBI,cAAAA,MAAA,oBAdG,SAASC,EAA4B,CAC1C,SAAAC,EACA,GAAGC,CACL,EAC2B,CACzB,GAAM,CAAE,OAAAC,EAAQ,mBAAAC,CAAmB,EAAIC,EAA0B,EAC3D,CAAE,WAAAC,CAAW,EAAIC,EAAc,EAE/BC,EAAeF,GAAY,OACjC,GAAI,CAACE,EACH,MAAM,IAAI,MAAM,4BAA4B,EAG9C,OACET,EAACS,EAAA,CACE,GAAGN,EACJ,KAAK,SACL,UAAWO,EACT,iDACAP,EAAM,SACR,EACA,KAAMC,EAGN,SACED,EAAM,UACNE,GAAoB,cACpB,CAACA,GAAoB,aAGtB,SAAAH,EACH,CAEJ,CAjCgBS,EAAAV,EAAA","names":["jsx","InvoiceScheduleSubmitButton","children","props","formId","invoiceScheduleBag","useInvoiceScheduleContext","components","useFormFields","CustomButton","cn","__name"]}
@@ -0,0 +1,2 @@
1
+ import{a as e}from"./chunk-P37U34EQ.js";import{jsx as o,jsxs as l}from"react/jsx-runtime";function u({error:r}){return r?l("p",{className:"text-destructive text-sm RemoteFlows__DailySchedule__HoursError",children:[o("strong",{children:r.header})," - ",r.message]}):null}e(u,"DailyScheduleHoursErrorBanner");export{u as a};
2
+ //# sourceMappingURL=chunk-RJXFAG4D.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/Onboarding/components/DailySchedule/DailyScheduleHoursErrorBanner.tsx"],"sourcesContent":["import { DailyScheduleHoursError } from '@/src/flows/Onboarding/components/DailySchedule/types';\n\nexport function DailyScheduleHoursErrorBanner({\n error,\n}: {\n error: DailyScheduleHoursError | null;\n}) {\n if (!error) {\n return null;\n }\n\n return (\n <p className='text-destructive text-sm RemoteFlows__DailySchedule__HoursError'>\n <strong>{error.header}</strong> - {error.message}\n </p>\n );\n}\n"],"mappings":"wCAYI,OACE,OAAAA,EADF,QAAAC,MAAA,oBAVG,SAASC,EAA8B,CAC5C,MAAAC,CACF,EAEG,CACD,OAAKA,EAKHF,EAAC,KAAE,UAAU,kEACX,UAAAD,EAAC,UAAQ,SAAAG,EAAM,OAAO,EAAS,MAAIA,EAAM,SAC3C,EANO,IAQX,CAdgBC,EAAAF,EAAA","names":["jsx","jsxs","DailyScheduleHoursErrorBanner","error","__name"]}
@@ -1,2 +1,2 @@
1
- import{a as s}from"./chunk-H47XUL2L.js";import{b as a}from"./chunk-Q3ALCPJN.js";import{x as i}from"./chunk-C4HFMTSB.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as f}from"react/jsx-runtime";function h({components:c,onSubmit:d,onSuccess:m,onError:u}){let{contractorOnboardingBag:r}=a(),l=t(async(n,S)=>{try{let o=await r.parseFormValues(n);await d?.(o);let e=await r.onSubmit(n);if(e?.data){await m?.(e.data),r?.next();return}}catch(o){let e=i(o,r.meta?.fields?.create_invoice_schedule,S);u?.(e)}},"handleSubmit"),p=r.stepState.values?.create_invoice_schedule||r.initialValues.create_invoice_schedule;return f(s,{components:c,defaultValues:p,onSubmit:l})}t(h,"CreateInvoiceScheduleStep");export{h as a};
2
- //# sourceMappingURL=chunk-XEVHXHHC.js.map
1
+ import{a as s}from"./chunk-FFRROEPQ.js";import{b as a}from"./chunk-Q3ALCPJN.js";import{x as i}from"./chunk-C4HFMTSB.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as f}from"react/jsx-runtime";function h({components:c,onSubmit:d,onSuccess:m,onError:u}){let{contractorOnboardingBag:r}=a(),l=t(async(n,S)=>{try{let o=await r.parseFormValues(n);await d?.(o);let e=await r.onSubmit(n);if(e?.data){await m?.(e.data),r?.next();return}}catch(o){let e=i(o,r.meta?.fields?.create_invoice_schedule,S);u?.(e)}},"handleSubmit"),p=r.stepState.values?.create_invoice_schedule||r.initialValues.create_invoice_schedule;return f(s,{components:c,defaultValues:p,onSubmit:l})}t(h,"CreateInvoiceScheduleStep");export{h as a};
2
+ //# sourceMappingURL=chunk-ROVMQ5NT.js.map
@@ -1,2 +1,2 @@
1
- import{a as P,b as k,c as N}from"./chunk-B3MEKP45.js";import{a as C}from"./chunk-JLZFNUBH.js";import{a as u,b as F}from"./chunk-LKHRHBFP.js";import{j as v,k as x,l as b,n as D,o as w}from"./chunk-AUPAAQUT.js";import{n as a}from"./chunk-C4HFMTSB.js";import{a as n}from"./chunk-P37U34EQ.js";import{CalendarIcon as T}from"lucide-react";import{format as Y}from"date-fns";import{ChevronLeft as O,ChevronRight as V}from"lucide-react";import{DayPicker as B}from"react-day-picker";import{jsx as p}from"react/jsx-runtime";function R({className:t,classNames:m,showOutsideDays:c=!0,...r}){return p(B,{showOutsideDays:c,className:a("p-3",t),classNames:{months:"flex flex-col sm:flex-row gap-2",month:"flex flex-col gap-4",caption:"flex justify-center pt-1 relative items-center w-full",caption_label:"text-sm font-medium",nav:"flex items-center gap-1",nav_button:a(u({variant:"outline"}),"size-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-x-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:a("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md",r.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:a(u({variant:"ghost"}),"size-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground",day_range_end:"day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...m},components:{IconLeft:n(({className:l,...o})=>p(O,{className:a("size-4",l),...o}),"IconLeft"),IconRight:n(({className:l,...o})=>p(V,{className:a("size-4",l),...o}),"IconRight")},...r})}n(R,"Calendar");import{useState as $}from"react";import{Fragment as E,jsx as e,jsxs as f}from"react/jsx-runtime";function re({field:t,fieldData:m,fieldState:c}){let{name:r,label:l,description:o,minDate:g,maxDate:y}=m,d=g?new Date(g):void 0,i=y?new Date(y):void 0,[M,_]=$(!1),I=new Date().getFullYear(),h=d?d.getFullYear():1900,L=Math.max(h,i?i.getFullYear():I+10);return f(v,{"data-field":r,className:`flex flex-col RemoteFlows__DatePickerField__Item__${r}`,children:[e(x,{className:"RemoteFlows__DatePickerField__Label",children:l}),f(P,{open:M,onOpenChange:_,children:[e(k,{asChild:!0,children:e(b,{children:e("div",{children:f(F,{type:"button",variant:"outline",className:a("w-full pl-3 text-left font-normal",!t.value&&"text-muted-foreground"),"data-testid":`date-picker-button-${r}`,children:[t.value&&e(E,{children:Y(t.value,"yyyy-MM-dd")}),e(T,{className:"ml-auto h-4 w-4 opacity-50"})]})})})}),e(N,{className:"w-auto p-0 RemoteFlows__DatepickerField__PopoverContent",align:"start",children:e(R,{mode:"single",captionLayout:"dropdown",fromYear:h,toYear:L,className:"RemoteFlows__DatepickerField__Calendar",selected:t.value?new Date(t.value):void 0,onDayClick:s=>{let z=Y(s,"yyyy-MM-dd");t.onChange(z),_(!1)},defaultMonth:t.value?new Date(t.value):i??d,disabled:s=>!!(d&&s<d||i&&s>i)})})]}),o?e(D,{helpCenter:e(C,{helpCenter:m.meta?.helpCenter}),children:o}):null,c.error&&e(w,{className:"RemoteFlows__DatePickerField__Error"})]})}n(re,"DatePickerFieldDefault");export{re as a};
2
- //# sourceMappingURL=chunk-6CBC5OAQ.js.map
1
+ import{a as P,b as k,c as N}from"./chunk-B3MEKP45.js";import{a as C}from"./chunk-E7Y3YBZH.js";import{a as u,b as F}from"./chunk-LKHRHBFP.js";import{e as v,f as x,g as b,i as D,j as w}from"./chunk-C7KVPEVX.js";import{n as a}from"./chunk-C4HFMTSB.js";import{a as n}from"./chunk-P37U34EQ.js";import{CalendarIcon as T}from"lucide-react";import{format as Y}from"date-fns";import{ChevronLeft as O,ChevronRight as V}from"lucide-react";import{DayPicker as B}from"react-day-picker";import{jsx as p}from"react/jsx-runtime";function R({className:t,classNames:m,showOutsideDays:c=!0,...r}){return p(B,{showOutsideDays:c,className:a("p-3",t),classNames:{months:"flex flex-col sm:flex-row gap-2",month:"flex flex-col gap-4",caption:"flex justify-center pt-1 relative items-center w-full",caption_label:"text-sm font-medium",nav:"flex items-center gap-1",nav_button:a(u({variant:"outline"}),"size-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-x-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:a("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md",r.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:a(u({variant:"ghost"}),"size-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground",day_range_end:"day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...m},components:{IconLeft:n(({className:l,...o})=>p(O,{className:a("size-4",l),...o}),"IconLeft"),IconRight:n(({className:l,...o})=>p(V,{className:a("size-4",l),...o}),"IconRight")},...r})}n(R,"Calendar");import{useState as $}from"react";import{Fragment as E,jsx as e,jsxs as f}from"react/jsx-runtime";function re({field:t,fieldData:m,fieldState:c}){let{name:r,label:l,description:o,minDate:g,maxDate:y}=m,d=g?new Date(g):void 0,i=y?new Date(y):void 0,[M,_]=$(!1),I=new Date().getFullYear(),h=d?d.getFullYear():1900,L=Math.max(h,i?i.getFullYear():I+10);return f(v,{"data-field":r,className:`flex flex-col RemoteFlows__DatePickerField__Item__${r}`,children:[e(x,{className:"RemoteFlows__DatePickerField__Label",children:l}),f(P,{open:M,onOpenChange:_,children:[e(k,{asChild:!0,children:e(b,{children:e("div",{children:f(F,{type:"button",variant:"outline",className:a("w-full pl-3 text-left font-normal",!t.value&&"text-muted-foreground"),"data-testid":`date-picker-button-${r}`,children:[t.value&&e(E,{children:Y(t.value,"yyyy-MM-dd")}),e(T,{className:"ml-auto h-4 w-4 opacity-50"})]})})})}),e(N,{className:"w-auto p-0 RemoteFlows__DatepickerField__PopoverContent",align:"start",children:e(R,{mode:"single",captionLayout:"dropdown",fromYear:h,toYear:L,className:"RemoteFlows__DatepickerField__Calendar",selected:t.value?new Date(t.value):void 0,onDayClick:s=>{let z=Y(s,"yyyy-MM-dd");t.onChange(z),_(!1)},defaultMonth:t.value?new Date(t.value):i??d,disabled:s=>!!(d&&s<d||i&&s>i)})})]}),o?e(D,{helpCenter:e(C,{helpCenter:m.meta?.helpCenter}),children:o}):null,c.error&&e(w,{className:"RemoteFlows__DatePickerField__Error"})]})}n(re,"DatePickerFieldDefault");export{re as a};
2
+ //# sourceMappingURL=chunk-SDPYDCS7.js.map
@@ -1,2 +1,2 @@
1
- import{a as cn,b as ln,c as un}from"./chunk-R4ZUOFYN.js";import{a as At,b as Bt,c as xt,d as Nt,e as Qt,f as Jt,g as Ut,i as Kt,j as Gt,k as $t,l as Ht,m as zt,n as Wt,o as Xt,p as Yt,q as Zt,r as en,s as tn,t as nn,u as on,v as rn,w as an,x as sn}from"./chunk-BTCC6PNG.js";import{a as vt,b as St,d as Ct,e as wt,f as Pt,g as It,h as Vt}from"./chunk-LSUBNZ64.js";import{a as kt,b as Tt,f as Rt,g as qt,h as Lt,i as jt}from"./chunk-TDKKCSKV.js";import{a as N,b as pe,c as S,d as Ft,g as Dt}from"./chunk-PB6UQ4A4.js";import{a as Et,b as Mt}from"./chunk-OKBPMWVB.js";import{f as gt,i as ht,j as bt}from"./chunk-ERBEPQJP.js";import{_ as yt}from"./chunk-QQV5REGG.js";import{a as pt,b,d as mt,h as p,i as C,t as ft,u as L,v}from"./chunk-C4HFMTSB.js";import{a as Ot}from"./chunk-M3TA5X2H.js";import{e as _t}from"./chunk-H2O4CVKF.js";import{a as _}from"./chunk-P37U34EQ.js";import{useCallback as pn,useEffect as E,useMemo as a,useRef as mn,useState as w}from"react";import fn from"lodash.omit";import{useQuery as Ei}from"@tanstack/react-query";var Mi=_(()=>{let{client:$}=_t(),{data:Q}=Bt(),y=xt(Q)?Q?.company?.id??"":"";return Ei({queryKey:["legal-entities",y],queryFn:_(()=>yt({client:$,path:{company_id:y},query:{page_size:100}}),"queryFn"),select:_(J=>J.data?.data?.legal_entities,"select"),enabled:!!y})},"useLegalEntities"),dn=_(()=>{let{data:$}=Mi();return $?.find(Q=>Q.is_default)},"useDefaultLegalEntity");var Oi={select_country:null,basic_information:"employment_basic_information",contract_origin:null,invoice_schedule:null,create_invoice_schedule:null,contract_details:null,eligibility_questionnaire:null,pricing_plan:null,contract_preview:null,review:null},Fi={employment_basic_information:"basic_information"},_n={remote_contract:"provided_by_remote"},Di={provided_by_remote:"remote_contract"},ao=_(({countryCode:$,externalId:Q,employmentId:y,skipSteps:J,options:d,initialValues:c})=>{let yn=d?.excludeProducts||[],Ee=mn(d?.onContractReviewed);E(()=>{Ee.current=d?.onContractReviewed},[d?.onContractReviewed]);let[m,Me]=w($||null),[o,gn]=w(y),[P,Oe]=w(void 0),re=mn({select_country:{},basic_information:{},contract_origin:{},invoice_schedule:{},create_invoice_schedule:{},contract_details:{},contract_preview:{},pricing_plan:{},eligibility_questionnaire:{}}),[H,hn]=w(void 0),[Fe,De]=w(!1),[Ae,bn]=w(!0),[ke,vn]=w(!0),[Te,Sn]=w(!0),[j,Cn]=w(!1),[Re,qe]=w(!1),[me,Le]=w(null),{steps:wn,stepsArray:Pn}=a(()=>kt({includeSelectCountry:!J?.includes("select_country"),includeContractOrigin:Te,includeInvoiceSchedule:j,includeCreateInvoiceSchedule:Re,includeEligibilityQuestionnaire:Fe,includeContractDetails:ke,includeContractPreview:Ae}),[Te,j,Re,Fe,ke,Ae,J]),{fieldValues:l,stepState:t,setFieldValues:fe,previousStep:In,nextStep:Vn,goToStep:U,setStepValues:_e}=Ot(wn);E(()=>{me&&(U(me),Le(null))},[me,U]);let{data:u,isLoading:En,refetch:je}=Et({employmentId:o,queryParams:{exclude_files:!0}}),{data:ae,refetch:Mn}=Mt({employmentId:o,enabled:!!o}),On=dn(),{data:Be}=sn({options:{queryOptions:{enabled:t.currentStep.name==="review"}}}),{status:B}=u||{},R=B&&Rt.includes(B),Fn=B&&!qt.includes(B),Dn=a(()=>B&&["invited","initiated"].includes(B)?"invited":"not_invited",[B]),xe=ht(),Ne=bt(m,d),ye=Gt(),Qe=At(),{mutateAsync:Je}=zt(ye,Qe,l),Ue=Zt(),Ke=en(),Ge=nn(),$e=wt(),He=Pt(),ze=It(),We=Vt(),{mutateAsyncOrThrow:An}=b(Ne),Xe=Qt(),Ye=Kt(),Ze=tn(),{mutateAsyncOrThrow:kn}=b(xe),{mutateAsyncOrThrow:Tn}=b(ye),{mutateAsyncOrThrow:Rn}=b(Xe),{mutateAsyncOrThrow:et}=b(Ye),{mutateAsyncOrThrow:qn}=b(Ue),{mutateAsyncOrThrow:tt}=b(Ke),{mutateAsyncOrThrow:Ln}=b(Ze),{mutateAsyncOrThrow:jn}=b(Ge),{mutateAsyncOrThrow:Bn}=b($e),{mutateAsyncOrThrow:xn}=b(He),{mutateAsyncOrThrow:Nn}=b(ze),{mutateAsyncOrThrow:Qn}=b(We);y&&u?.country?.code&&!m&&Me(u.country.code);let{selectCountryForm:K,isLoading:Jn,countries:nt}=an({jsfModify:d?.jsfModify?.select_country}),ge=a(()=>nt?.find(e=>e.value===m),[nt,m]),Un=a(()=>ge?.label,[ge]),Kn=t.currentStep.name==="pricing_plan"||!!y&&R,{form:M,isLoading:Gn,contractorSubscriptions:se,filteredContractorSubscriptions:z,refetch:he,isEligibilityQuestionnaireBlocked:W}=Ht(o,ge,{jsonSchemaVersion:d?.jsonSchemaVersion,queryOptions:{enabled:Kn},excludeProducts:yn,jsfModify:d?.jsfModify?.pricing_plan}),x=a(()=>!!se?.find(e=>e.product.identifier===S)?.eligibility_questionnaire?.submitted_at,[se]),it=a(()=>x?!1:H===S,[x,H]),ot=u?.contractor_type!=="cor",rt=(t.currentStep.name==="contract_origin"?l.contract_origin:void 0)??t.values?.contract_origin?.contract_origin??ae?.contract_origin,$n=_n[rt]??rt,G=H===N&&$n==="provided_by_customer";E(()=>{vn(!G)},[G]),E(()=>{De(!G&&it)},[G,it]),E(()=>{bn(!G&&ot)},[G,ot]);let ce=a(()=>se?.find(e=>e.product.identifier===S)?.eligibility_questionnaire?.responses,[se]),Hn=Oi[t.currentStep.name]||"contractor_basic_information",zn=Fi[Hn],Wn=u?.[zn]||{},Xn=_(({form:e,options:n={},query:r={},jsonSchemaVersion:s})=>{let q=Object.keys(l).length>0?{...c,...t.values?.[t.currentStep.name],...l}:{...c,...Wn};return gt({countryCode:m,form:e,fieldValues:q,query:r,options:{...n,queryOptions:{enabled:n.queryOptions?.enabled??!0}},jsonSchemaVersion:s})},"useJSONSchema"),Yn=!!(m&&(t.currentStep.name==="basic_information"||y)),Zn=!!(m==="GBR"&&y&&t.currentStep.name==="basic_information"),{data:X,isLoading:ei}=Wt(y,{enabled:Zn}),{data:le,isLoading:ti}=Xt(o,{enabled:!!o});E(()=>{le&&le.length>0&&!P&&Oe(le[0].id)},[le,P]);let{data:I,isLoading:ni}=Xn({form:"contractor_basic_information",options:{jsfModify:ln(m,Un,d),queryOptions:{enabled:Yn}},jsonSchemaVersion:jt(d)}),ii=a(()=>Tt(u?.basic_information?.provisional_start_date,l?.service_duration?.provisional_start_date),[u?.basic_information?.provisional_start_date,l?.service_duration?.provisional_start_date]),h=a(()=>{let e={standard:N,plus:pe,cor:S};if(l.subscription)return l.subscription;let n=t.values?.pricing_plan?.subscription;if(n&&!W)return n;if(x&&!W)return S;if(W&&x)return N;if(z&&z.length>0)return e[u?.contractor_type]||N},[l,t.values,x,u?.contractor_type,W,z]);E(()=>{h&&h!==H&&hn(h)},[h,H]),E(()=>{Sn(!J?.includes("contract_origin")&&h===N)},[J,h]),E(()=>{Cn(d?.features?.includes("create_invoice_schedule")??!1)},[d?.features]);let oi=a(()=>({...ce,...c,...t.values?.eligibility_questionnaire,...l}),[ce,c,t.values?.eligibility_questionnaire,l]),ri=a(()=>h===S&&t.currentStep.name==="eligibility_questionnaire"||!!y&&R&&h===S,[h,t.currentStep.name,y,R]),{data:O,isLoading:ai}=Yt({options:{queryOptions:{enabled:ri},jsfModify:d?.jsfModify?.eligibility_questionnaire},fieldValues:oi}),si=!!(m&&t.currentStep.name==="contract_details"||R),{data:V,isLoading:ci}=vt({countryCode:m,fieldValues:l,employmentId:o,options:{queryOptions:{enabled:si},jsfModify:cn(d?.jsfModify?.contract_details,ii,h,l,h===S)}}),li=a(()=>t.currentStep.name==="contract_preview"||!!y&&R,[t.currentStep.name,y,R]),{data:F}=Nt({fieldValues:l,options:{queryOptions:{enabled:li},jsfModify:un(d,l)}}),{data:D}=on({fieldValues:l,options:{jsfModify:d?.jsfModify?.contract_origin}}),A=rn({enabled:j&&t.currentStep.name==="invoice_schedule",jsfModify:d?.jsfModify?.invoice_schedule}),{data:f,isLoading:ui,refetch:be}=Ct({employmentId:o,options:{queryOptions:{enabled:j&&!!o&&t.currentStep.name==="invoice_schedule"}}}),{data:k,isLoading:di}=St({enabled:j&&t.currentStep.name==="create_invoice_schedule",employmentId:o,jsfModify:d?.jsfModify?.create_invoice_schedule,fieldValues:l}),{data:ve,isLoading:pi,refetch:mi}=Jt({employmentId:o,contractDocumentId:P,options:{queryOptions:{enabled:!!P}}}),{hasCompanySignedContract:fi}=Ut({employmentId:o,contractDocumentId:P,options:{queryOptions:{enabled:!!P}}}),i=a(()=>({select_country:K?.fields||[],basic_information:I?.fields||[],contract_origin:D?.fields||[],invoice_schedule:A?.fields||[],create_invoice_schedule:k?.fields||[],pricing_plan:M?.fields||[],eligibility_questionnaire:O?.fields||[],contract_details:V?.fields||[],contract_preview:F?.fields||[],review:[]}),[K?.fields,I?.fields,D?.fields,A?.fields,k?.fields,M?.fields,V?.fields,F?.fields,O?.fields]),_i={select_country:null,basic_information:I?.meta["x-jsf-fieldsets"],contract_origin:null,invoice_schedule:null,create_invoice_schedule:null,pricing_plan:null,contract_details:V?.meta["x-jsf-fieldsets"],eligibility_questionnaire:null,contract_preview:null,review:null},yi={select_country:K?.meta?.["x-jsf-presentation"],basic_information:I?.meta?.["x-jsf-presentation"],contract_origin:D?.meta?.["x-jsf-presentation"],invoice_schedule:A?.meta?.["x-jsf-presentation"],create_invoice_schedule:k?.meta?.["x-jsf-presentation"],pricing_plan:M?.meta?.["x-jsf-presentation"],eligibility_questionnaire:O?.meta?.["x-jsf-presentation"],contract_details:V?.meta?.["x-jsf-presentation"],contract_preview:F?.meta?.["x-jsf-presentation"],review:null},{country:gi,basic_information:ue={},contract_details:at={}}=u||{},st=gi?.code,Y=a(()=>C(i.select_country,{country:m||st||""}),[i.select_country,m,st]),Se=a(()=>X?.content?mt(X.content,X.name):null,[X?.content,X?.name]),Z=a(()=>{let e={...c,...ue,ir35:u?.contract_details?.ir_35,nationality_status:u?.contract_details?.nationality,...Se&&{ir35_sds_file:[Se]}};return C(i.basic_information,e)},[c,ue,u?.contract_details?.ir_35,u?.contract_details?.nationality,Se,i.basic_information]),ct=a(()=>{let e={...c,contract_origin:_n[ae?.contract_origin]??ae?.contract_origin};return C(i.contract_origin,e)},[i.contract_origin,c,ae?.contract_origin]),lt=a(()=>{let e={...c,...f&&{invoice_schedule_preference:"schedule"}};return C(i.invoice_schedule,e)},[i.invoice_schedule,c,f]),ut=a(()=>{if(f){let n={currency:f.currency,periodicity:f.periodicity,start_date:f.start_date,number:f.number,note:f.note,nr_occurrences:f.nr_occurrences};return f.items?.forEach((r,s)=>{let g=s+1;n[`item_${g}_description`]=r.description,n[`item_${g}_amount`]=r.amount}),C(i.create_invoice_schedule,n)}let e={...c};return C(i.create_invoice_schedule,e)},[i.create_invoice_schedule,c,f]),ee=a(()=>{let n={...{service_duration:{provisional_start_date:ue.provisional_start_date}},...c,...at};return C(i.contract_details,n)},[i.contract_details,at,c,ue]),te=a(()=>{let e=ve?.contract_document?.signatories?.find(r=>r.type==="company"),n={...c,signature:e?.signature};return C(i.contract_preview,n)},[i.contract_preview,c,ve]),ne=a(()=>{let n={...{subscription:h},...c};return C(i.pricing_plan,n)},[i.pricing_plan,c,h]),ie=a(()=>{let e={...c,...ce};return C(i.eligibility_questionnaire,e)},[i.eligibility_questionnaire,c,ce]),hi=a(()=>({select_country:Y,basic_information:Z,contract_origin:ct,invoice_schedule:lt,create_invoice_schedule:ut,contract_details:ee,contract_preview:te,pricing_plan:ne,eligibility_questionnaire:ie}),[Y,Z,ct,lt,ut,ee,te,ne,ie]),Ce=!!(y&&R&&t.currentStep.name!=="review"),we=Jn||ni||En||ci||Gn||pi||ei||ti||ai||di||ui,dt=a(()=>{let n=u?.contractor_type==="cor"||i.contract_preview.length>0;return!!(Ce&&!we&&P&&i.basic_information.length>0&&i.contract_details.length>0&&n)},[Ce,we,P,i.basic_information.length,i.contract_details.length,i.contract_preview.length,u?.contractor_type]);E(()=>{dt&&(re.current={select_country:L(Y,i.select_country,{skipMoneyConversion:!0}),basic_information:L(Z,i.basic_information,{skipMoneyConversion:!0}),contract_origin:{},invoice_schedule:{},create_invoice_schedule:{},contract_details:L(ee,i.contract_details,{skipMoneyConversion:!0}),contract_preview:L(te,i.contract_preview,{skipMoneyConversion:!0}),pricing_plan:L(ne,i.pricing_plan,{skipMoneyConversion:!0}),eligibility_questionnaire:L(ie,i.eligibility_questionnaire,{skipMoneyConversion:!0})},_e({select_country:Y,basic_information:Z,contract_origin:{},invoice_schedule:{},create_invoice_schedule:{},contract_details:ee,contract_preview:te,pricing_plan:ne,eligibility_questionnaire:ie,review:{}}),U("review"))},[dt,U,Y,Z,ee,_e,i.select_country,i.basic_information,i.contract_details,i.pricing_plan,ne,i.contract_preview,te,i.eligibility_questionnaire,ie]);let bi=_(e=>{U(e)},"goTo"),Pe=_(async e=>K&&t.currentStep.name==="select_country"?e:I&&t.currentStep.name==="basic_information"?await p(e,I?.fields,{isPartialValidation:!1}):V&&t.currentStep.name==="contract_details"?await p(e,V?.fields,{isPartialValidation:!1}):F&&t.currentStep.name==="contract_preview"?await p(e,F?.fields,{isPartialValidation:!1}):M&&t.currentStep.name==="pricing_plan"?await p(e,M?.fields,{isPartialValidation:!1}):O&&t.currentStep.name==="eligibility_questionnaire"?await p(e,O?.fields,{isPartialValidation:!1}):D&&t.currentStep.name==="contract_origin"?await p(e,D?.fields,{isPartialValidation:!1}):A&&t.currentStep.name==="invoice_schedule"?await p(e,A?.fields,{isPartialValidation:!1}):k&&t.currentStep.name==="create_invoice_schedule"?await p(e,k?.fields,{isPartialValidation:!1}):{},"parseFormValues"),vi=_(e=>{if(!pt(e))return null;let n=e.normalizedErrors.services_and_deliverables,r=Array.isArray(n)?n[0]:n;return r?.source===Dt?{error:r.error,source:r.source,skippable:r.skippable}:null},"extractAiValidationError");async function Si(e){let n=t.currentStep.name,r=await Pe(e);switch(n in re.current&&(re.current[n]=L(r,i[n])),t.currentStep.name){case"select_country":return Me(r.country),Promise.resolve({data:{countryCode:r.country}});case"basic_information":{let s=!o&&m,g=o&&m&&u?.country&&u?.country.code!==m;if(s||g){let Ve={basic_information:fn(r,"nationality_status","ir35","ir35_sds_file"),type:"contractor",country_code:m,external_id:Q},de=await kn(Ve),T=de?.data?.employment?.id;if(!T)throw v("Employment ID not found");return await Je({employmentId:T}),gn(T),de}else if(o){let q=fn(r,"nationality_status","ir35","ir35_sds_file");return await Je({employmentId:o}),An({employmentId:o,basic_information:q})}return}case"contract_details":{let{services_and_deliverables_ai_warning:s,services_and_deliverables_error_skippable:g,...q}=r,Ve=l.services_and_deliverables_error_skippable===!0,de={contract_document:q,skip_ai_checks:Ve};try{let T=await Tn({employmentId:o,payload:de}),oe=T?.data?.contract_document?.id;if(!oe)throw v("Contract document ID not found");return Oe(oe),T}catch(T){let oe=vi(T);throw oe&&fe({...e,services_and_deliverables_ai_warning:Lt(h===S),services_and_deliverables_error_skippable:oe.skippable}),T}}case"contract_preview":{if(fi)return Promise.resolve({data:{contract_document:{id:P}}});let s=await Rn({employmentId:o,contractDocumentId:P,payload:{signature:r.signature}});return await mi(),s}case"pricing_plan":{if(e.subscription===Ft)return Promise.resolve({data:{subscription:e.subscription}});if(z.length===0)throw v("No available subscriptions.");if(!e.subscription&&z.length>0)throw v("Please select a subscription plan.");if(W&&[S,pe].includes(e.subscription))throw v(`This individual is not eligible for ${$t[e.subscription]}.`);if(x&&e.subscription!==S)try{await Ln({employmentId:o}),await he()}catch(g){if(g?.response?.status!==404)throw g;await he()}if(e.subscription==N)return et({employmentId:o,payload:{operation:"downgrade"}});if(e.subscription==pe)return et({employmentId:o,payload:{operation:"upgrade"}});if(e.subscription==S)return x&&u?.contractor_type!=="cor"?tt({employmentId:o}):Promise.resolve({data:{subscription:e.subscription}});throw v("invalid selection")}case"contract_origin":{let s=Di[r.contract_origin]??r.contract_origin,g=r.contract_origin==="provided_by_customer"?"contractor_agreement":"contractor_services_agreement";return await jn({employmentId:o,contractOrigin:s,templateType:g}),await Mn(),{data:{contractOrigin:e.contract_origin}}}case"invoice_schedule":{let s=e.invoice_schedule_preference==="schedule";return qe(s),{data:{invoiceSchedulePreference:e.invoice_schedule_preference}}}case"create_invoice_schedule":{if(!o)throw v("Employment ID is required");if(f?.id){let q=await xn({scheduleId:f.id,values:r});return await be(),q}let s=await Bn({employmentId:o,values:r}),g=s?.data?.failures;if(g&&g.length>0)throw v("Failed to create invoice schedule");return await be(),s}case"eligibility_questionnaire":try{if((await qn({employmentId:o,payload:r}))?.data?.is_blocking)throw De(!1),Le("pricing_plan"),v("This individual is not eligible for Contractor of Record.");return await tt({employmentId:o})}finally{await he()}default:throw v("Invalid step state")}}_(Si,"onSubmit");let Ci=_(()=>{Ee.current?.()},"markContractAsReviewed"),wi=_(async()=>{if(!f?.id)throw v("No invoice schedule to skip");await Nn({scheduleId:f.id}),await be(),qe(!1),_e({...t.values,invoice_schedule:{},create_invoice_schedule:{}}),U("invoice_schedule")},"skipInvoiceSchedule"),Pi=_(async e=>{if(!o)throw v("Employment ID is required");let n=await Pe(e),s=(await Qn({employmentId:o,values:n}))?.data?.contractor_invoice_preview;if(s)return{...s,content:ft(s.content)}},"previewContractorInvoice"),Ii=_(()=>{o&&je(),Vn()},"handleNextStep"),Ie=pn(async e=>{if(t.currentStep.name==="select_country")return K.handleValidation(e);if(I&&t.currentStep.name==="basic_information"){let n=await p(e,I?.fields,{isPartialValidation:!1});return I?.handleValidation(n)}if(V&&t.currentStep.name==="contract_details"){let n=await p(e,V?.fields,{isPartialValidation:!1});return V?.handleValidation(n)}if(F&&t.currentStep.name==="contract_preview"){let n=await p(e,F?.fields,{isPartialValidation:!0});return F?.handleValidation(n)}if(M&&t.currentStep.name==="pricing_plan"){let n=await p(e,M?.fields,{isPartialValidation:!1});return M?.handleValidation(n)}if(O&&t.currentStep.name==="eligibility_questionnaire"){let n=await p(e,O?.fields,{isPartialValidation:!1});return O?.handleValidation(n)}if(D&&t.currentStep.name==="contract_origin"){let n=await p(e,D?.fields,{isPartialValidation:!1});return D?.handleValidation(n)}if(A&&t.currentStep.name==="invoice_schedule"){let n=await p(e,A?.fields,{isPartialValidation:!1});return A?.handleValidation(n)}if(k&&t.currentStep.name==="create_invoice_schedule"){let n=await p(e,k?.fields,{isPartialValidation:!1});return k?.handleValidation(n)}return null},[t.currentStep.name,K,I,V,F,M,O,D,A,k]),Vi=pn(async e=>{fe(e),j&&["invoice_schedule","create_invoice_schedule"].includes(t.currentStep.name)&&await Ie(e)},[fe,j,t,Ie]);return{isLoading:we||Ce,fieldValues:l,stepState:t,checkFieldUpdates:Vi,markContractAsReviewed:Ci,existingInvoiceSchedule:f,skipInvoiceSchedule:wi,isSkippingInvoiceSchedule:ze.isPending,previewContractorInvoice:Pi,isPreviewingInvoiceSchedule:We.isPending,back:In,next:Ii,goTo:bi,onSubmit:Si,fields:i[t.currentStep.name],meta:{fields:re.current,fieldsets:_i[t.currentStep.name],presentation:yi[t.currentStep.name]},parseFormValues:Pe,canSkipAiValidation:l.services_and_deliverables_error_skippable===!0,handleValidation:Ie,initialValues:hi,employmentId:o,refetchEmployment:je,isSubmitting:xe.isPending||Ne.isPending||ye.isPending||Xe.isPending||Ye.isPending||Qe.isPending||Ue.isPending||Ke.isPending||Ze.isPending||Ge.isPending||$e.isPending||He.isPending,documentPreviewPdf:ve,canInvite:Fn,isEmploymentReadOnly:R,invitedStatus:Dn,employment:u,defaultLegalEntity:On,needsCompanyVerification:Be?.some(e=>e.type==="verify_company")??!1,needsRemotePaymentsSetup:Be?.some(e=>e.type==="setup_remote_payments")??!1,steps:Pn}},"useContractorOnboarding");export{ao as a};
2
- //# sourceMappingURL=chunk-25MUO3XP.js.map
1
+ import{a as cn,b as ln,c as un}from"./chunk-FF5OB2GF.js";import{a as At,b as Bt,c as xt,d as Nt,e as Qt,f as Jt,g as Ut,i as Kt,j as Gt,k as $t,l as Ht,m as zt,n as Wt,o as Xt,p as Yt,q as Zt,r as en,s as tn,t as nn,u as on,v as rn,w as an,x as sn}from"./chunk-7TELDH6M.js";import{a as vt,b as St,d as Ct,e as wt,f as Pt,g as It,h as Vt}from"./chunk-IYWSUSS2.js";import{a as kt,b as Tt,f as Rt,g as qt,h as Lt,i as jt}from"./chunk-TDKKCSKV.js";import{a as N,b as pe,c as S,d as Ft,g as Dt}from"./chunk-PB6UQ4A4.js";import{a as Et,b as Mt}from"./chunk-R23HFBV4.js";import{f as gt,i as ht,j as bt}from"./chunk-UBWNTSWS.js";import{Z as yt}from"./chunk-DAUDKN32.js";import{a as pt,b,d as mt,h as p,i as C,t as ft,u as L,v}from"./chunk-C4HFMTSB.js";import{a as Ot}from"./chunk-M3TA5X2H.js";import{e as _t}from"./chunk-H2O4CVKF.js";import{a as _}from"./chunk-P37U34EQ.js";import{useCallback as pn,useEffect as E,useMemo as a,useRef as mn,useState as w}from"react";import fn from"lodash.omit";import{useQuery as Ei}from"@tanstack/react-query";var Mi=_(()=>{let{client:$}=_t(),{data:Q}=Bt(),y=xt(Q)?Q?.company?.id??"":"";return Ei({queryKey:["legal-entities",y],queryFn:_(()=>yt({client:$,path:{company_id:y},query:{page_size:100}}),"queryFn"),select:_(J=>J.data?.data?.legal_entities,"select"),enabled:!!y})},"useLegalEntities"),dn=_(()=>{let{data:$}=Mi();return $?.find(Q=>Q.is_default)},"useDefaultLegalEntity");var Oi={select_country:null,basic_information:"employment_basic_information",contract_origin:null,invoice_schedule:null,create_invoice_schedule:null,contract_details:null,eligibility_questionnaire:null,pricing_plan:null,contract_preview:null,review:null},Fi={employment_basic_information:"basic_information"},_n={remote_contract:"provided_by_remote"},Di={provided_by_remote:"remote_contract"},ao=_(({countryCode:$,externalId:Q,employmentId:y,skipSteps:J,options:d,initialValues:c})=>{let yn=d?.excludeProducts||[],Ee=mn(d?.onContractReviewed);E(()=>{Ee.current=d?.onContractReviewed},[d?.onContractReviewed]);let[m,Me]=w($||null),[o,gn]=w(y),[P,Oe]=w(void 0),re=mn({select_country:{},basic_information:{},contract_origin:{},invoice_schedule:{},create_invoice_schedule:{},contract_details:{},contract_preview:{},pricing_plan:{},eligibility_questionnaire:{}}),[H,hn]=w(void 0),[Fe,De]=w(!1),[Ae,bn]=w(!0),[ke,vn]=w(!0),[Te,Sn]=w(!0),[j,Cn]=w(!1),[Re,qe]=w(!1),[me,Le]=w(null),{steps:wn,stepsArray:Pn}=a(()=>kt({includeSelectCountry:!J?.includes("select_country"),includeContractOrigin:Te,includeInvoiceSchedule:j,includeCreateInvoiceSchedule:Re,includeEligibilityQuestionnaire:Fe,includeContractDetails:ke,includeContractPreview:Ae}),[Te,j,Re,Fe,ke,Ae,J]),{fieldValues:l,stepState:t,setFieldValues:fe,previousStep:In,nextStep:Vn,goToStep:U,setStepValues:_e}=Ot(wn);E(()=>{me&&(U(me),Le(null))},[me,U]);let{data:u,isLoading:En,refetch:je}=Et({employmentId:o,queryParams:{exclude_files:!0}}),{data:ae,refetch:Mn}=Mt({employmentId:o,enabled:!!o}),On=dn(),{data:Be}=sn({options:{queryOptions:{enabled:t.currentStep.name==="review"}}}),{status:B}=u||{},R=B&&Rt.includes(B),Fn=B&&!qt.includes(B),Dn=a(()=>B&&["invited","initiated"].includes(B)?"invited":"not_invited",[B]),xe=ht(),Ne=bt(m,d),ye=Gt(),Qe=At(),{mutateAsync:Je}=zt(ye,Qe,l),Ue=Zt(),Ke=en(),Ge=nn(),$e=wt(),He=Pt(),ze=It(),We=Vt(),{mutateAsyncOrThrow:An}=b(Ne),Xe=Qt(),Ye=Kt(),Ze=tn(),{mutateAsyncOrThrow:kn}=b(xe),{mutateAsyncOrThrow:Tn}=b(ye),{mutateAsyncOrThrow:Rn}=b(Xe),{mutateAsyncOrThrow:et}=b(Ye),{mutateAsyncOrThrow:qn}=b(Ue),{mutateAsyncOrThrow:tt}=b(Ke),{mutateAsyncOrThrow:Ln}=b(Ze),{mutateAsyncOrThrow:jn}=b(Ge),{mutateAsyncOrThrow:Bn}=b($e),{mutateAsyncOrThrow:xn}=b(He),{mutateAsyncOrThrow:Nn}=b(ze),{mutateAsyncOrThrow:Qn}=b(We);y&&u?.country?.code&&!m&&Me(u.country.code);let{selectCountryForm:K,isLoading:Jn,countries:nt}=an({jsfModify:d?.jsfModify?.select_country}),ge=a(()=>nt?.find(e=>e.value===m),[nt,m]),Un=a(()=>ge?.label,[ge]),Kn=t.currentStep.name==="pricing_plan"||!!y&&R,{form:M,isLoading:Gn,contractorSubscriptions:se,filteredContractorSubscriptions:z,refetch:he,isEligibilityQuestionnaireBlocked:W}=Ht(o,ge,{jsonSchemaVersion:d?.jsonSchemaVersion,queryOptions:{enabled:Kn},excludeProducts:yn,jsfModify:d?.jsfModify?.pricing_plan}),x=a(()=>!!se?.find(e=>e.product.identifier===S)?.eligibility_questionnaire?.submitted_at,[se]),it=a(()=>x?!1:H===S,[x,H]),ot=u?.contractor_type!=="cor",rt=(t.currentStep.name==="contract_origin"?l.contract_origin:void 0)??t.values?.contract_origin?.contract_origin??ae?.contract_origin,$n=_n[rt]??rt,G=H===N&&$n==="provided_by_customer";E(()=>{vn(!G)},[G]),E(()=>{De(!G&&it)},[G,it]),E(()=>{bn(!G&&ot)},[G,ot]);let ce=a(()=>se?.find(e=>e.product.identifier===S)?.eligibility_questionnaire?.responses,[se]),Hn=Oi[t.currentStep.name]||"contractor_basic_information",zn=Fi[Hn],Wn=u?.[zn]||{},Xn=_(({form:e,options:n={},query:r={},jsonSchemaVersion:s})=>{let q=Object.keys(l).length>0?{...c,...t.values?.[t.currentStep.name],...l}:{...c,...Wn};return gt({countryCode:m,form:e,fieldValues:q,query:r,options:{...n,queryOptions:{enabled:n.queryOptions?.enabled??!0}},jsonSchemaVersion:s})},"useJSONSchema"),Yn=!!(m&&(t.currentStep.name==="basic_information"||y)),Zn=!!(m==="GBR"&&y&&t.currentStep.name==="basic_information"),{data:X,isLoading:ei}=Wt(y,{enabled:Zn}),{data:le,isLoading:ti}=Xt(o,{enabled:!!o});E(()=>{le&&le.length>0&&!P&&Oe(le[0].id)},[le,P]);let{data:I,isLoading:ni}=Xn({form:"contractor_basic_information",options:{jsfModify:ln(m,Un,d),queryOptions:{enabled:Yn}},jsonSchemaVersion:jt(d)}),ii=a(()=>Tt(u?.basic_information?.provisional_start_date,l?.service_duration?.provisional_start_date),[u?.basic_information?.provisional_start_date,l?.service_duration?.provisional_start_date]),h=a(()=>{let e={standard:N,plus:pe,cor:S};if(l.subscription)return l.subscription;let n=t.values?.pricing_plan?.subscription;if(n&&!W)return n;if(x&&!W)return S;if(W&&x)return N;if(z&&z.length>0)return e[u?.contractor_type]||N},[l,t.values,x,u?.contractor_type,W,z]);E(()=>{h&&h!==H&&hn(h)},[h,H]),E(()=>{Sn(!J?.includes("contract_origin")&&h===N)},[J,h]),E(()=>{Cn(d?.features?.includes("create_invoice_schedule")??!1)},[d?.features]);let oi=a(()=>({...ce,...c,...t.values?.eligibility_questionnaire,...l}),[ce,c,t.values?.eligibility_questionnaire,l]),ri=a(()=>h===S&&t.currentStep.name==="eligibility_questionnaire"||!!y&&R&&h===S,[h,t.currentStep.name,y,R]),{data:O,isLoading:ai}=Yt({options:{queryOptions:{enabled:ri},jsfModify:d?.jsfModify?.eligibility_questionnaire},fieldValues:oi}),si=!!(m&&t.currentStep.name==="contract_details"||R),{data:V,isLoading:ci}=vt({countryCode:m,fieldValues:l,employmentId:o,options:{queryOptions:{enabled:si},jsfModify:cn(d?.jsfModify?.contract_details,ii,h,l,h===S)}}),li=a(()=>t.currentStep.name==="contract_preview"||!!y&&R,[t.currentStep.name,y,R]),{data:F}=Nt({fieldValues:l,options:{queryOptions:{enabled:li},jsfModify:un(d,l)}}),{data:D}=on({fieldValues:l,options:{jsfModify:d?.jsfModify?.contract_origin}}),A=rn({enabled:j&&t.currentStep.name==="invoice_schedule",jsfModify:d?.jsfModify?.invoice_schedule}),{data:f,isLoading:ui,refetch:be}=Ct({employmentId:o,options:{queryOptions:{enabled:j&&!!o&&t.currentStep.name==="invoice_schedule"}}}),{data:k,isLoading:di}=St({enabled:j&&t.currentStep.name==="create_invoice_schedule",employmentId:o,jsfModify:d?.jsfModify?.create_invoice_schedule,fieldValues:l}),{data:ve,isLoading:pi,refetch:mi}=Jt({employmentId:o,contractDocumentId:P,options:{queryOptions:{enabled:!!P}}}),{hasCompanySignedContract:fi}=Ut({employmentId:o,contractDocumentId:P,options:{queryOptions:{enabled:!!P}}}),i=a(()=>({select_country:K?.fields||[],basic_information:I?.fields||[],contract_origin:D?.fields||[],invoice_schedule:A?.fields||[],create_invoice_schedule:k?.fields||[],pricing_plan:M?.fields||[],eligibility_questionnaire:O?.fields||[],contract_details:V?.fields||[],contract_preview:F?.fields||[],review:[]}),[K?.fields,I?.fields,D?.fields,A?.fields,k?.fields,M?.fields,V?.fields,F?.fields,O?.fields]),_i={select_country:null,basic_information:I?.meta["x-jsf-fieldsets"],contract_origin:null,invoice_schedule:null,create_invoice_schedule:null,pricing_plan:null,contract_details:V?.meta["x-jsf-fieldsets"],eligibility_questionnaire:null,contract_preview:null,review:null},yi={select_country:K?.meta?.["x-jsf-presentation"],basic_information:I?.meta?.["x-jsf-presentation"],contract_origin:D?.meta?.["x-jsf-presentation"],invoice_schedule:A?.meta?.["x-jsf-presentation"],create_invoice_schedule:k?.meta?.["x-jsf-presentation"],pricing_plan:M?.meta?.["x-jsf-presentation"],eligibility_questionnaire:O?.meta?.["x-jsf-presentation"],contract_details:V?.meta?.["x-jsf-presentation"],contract_preview:F?.meta?.["x-jsf-presentation"],review:null},{country:gi,basic_information:ue={},contract_details:at={}}=u||{},st=gi?.code,Y=a(()=>C(i.select_country,{country:m||st||""}),[i.select_country,m,st]),Se=a(()=>X?.content?mt(X.content,X.name):null,[X?.content,X?.name]),Z=a(()=>{let e={...c,...ue,ir35:u?.contract_details?.ir_35,nationality_status:u?.contract_details?.nationality,...Se&&{ir35_sds_file:[Se]}};return C(i.basic_information,e)},[c,ue,u?.contract_details?.ir_35,u?.contract_details?.nationality,Se,i.basic_information]),ct=a(()=>{let e={...c,contract_origin:_n[ae?.contract_origin]??ae?.contract_origin};return C(i.contract_origin,e)},[i.contract_origin,c,ae?.contract_origin]),lt=a(()=>{let e={...c,...f&&{invoice_schedule_preference:"schedule"}};return C(i.invoice_schedule,e)},[i.invoice_schedule,c,f]),ut=a(()=>{if(f){let n={currency:f.currency,periodicity:f.periodicity,start_date:f.start_date,number:f.number,note:f.note,nr_occurrences:f.nr_occurrences};return f.items?.forEach((r,s)=>{let g=s+1;n[`item_${g}_description`]=r.description,n[`item_${g}_amount`]=r.amount}),C(i.create_invoice_schedule,n)}let e={...c};return C(i.create_invoice_schedule,e)},[i.create_invoice_schedule,c,f]),ee=a(()=>{let n={...{service_duration:{provisional_start_date:ue.provisional_start_date}},...c,...at};return C(i.contract_details,n)},[i.contract_details,at,c,ue]),te=a(()=>{let e=ve?.contract_document?.signatories?.find(r=>r.type==="company"),n={...c,signature:e?.signature};return C(i.contract_preview,n)},[i.contract_preview,c,ve]),ne=a(()=>{let n={...{subscription:h},...c};return C(i.pricing_plan,n)},[i.pricing_plan,c,h]),ie=a(()=>{let e={...c,...ce};return C(i.eligibility_questionnaire,e)},[i.eligibility_questionnaire,c,ce]),hi=a(()=>({select_country:Y,basic_information:Z,contract_origin:ct,invoice_schedule:lt,create_invoice_schedule:ut,contract_details:ee,contract_preview:te,pricing_plan:ne,eligibility_questionnaire:ie}),[Y,Z,ct,lt,ut,ee,te,ne,ie]),Ce=!!(y&&R&&t.currentStep.name!=="review"),we=Jn||ni||En||ci||Gn||pi||ei||ti||ai||di||ui,dt=a(()=>{let n=u?.contractor_type==="cor"||i.contract_preview.length>0;return!!(Ce&&!we&&P&&i.basic_information.length>0&&i.contract_details.length>0&&n)},[Ce,we,P,i.basic_information.length,i.contract_details.length,i.contract_preview.length,u?.contractor_type]);E(()=>{dt&&(re.current={select_country:L(Y,i.select_country,{skipMoneyConversion:!0}),basic_information:L(Z,i.basic_information,{skipMoneyConversion:!0}),contract_origin:{},invoice_schedule:{},create_invoice_schedule:{},contract_details:L(ee,i.contract_details,{skipMoneyConversion:!0}),contract_preview:L(te,i.contract_preview,{skipMoneyConversion:!0}),pricing_plan:L(ne,i.pricing_plan,{skipMoneyConversion:!0}),eligibility_questionnaire:L(ie,i.eligibility_questionnaire,{skipMoneyConversion:!0})},_e({select_country:Y,basic_information:Z,contract_origin:{},invoice_schedule:{},create_invoice_schedule:{},contract_details:ee,contract_preview:te,pricing_plan:ne,eligibility_questionnaire:ie,review:{}}),U("review"))},[dt,U,Y,Z,ee,_e,i.select_country,i.basic_information,i.contract_details,i.pricing_plan,ne,i.contract_preview,te,i.eligibility_questionnaire,ie]);let bi=_(e=>{U(e)},"goTo"),Pe=_(async e=>K&&t.currentStep.name==="select_country"?e:I&&t.currentStep.name==="basic_information"?await p(e,I?.fields,{isPartialValidation:!1}):V&&t.currentStep.name==="contract_details"?await p(e,V?.fields,{isPartialValidation:!1}):F&&t.currentStep.name==="contract_preview"?await p(e,F?.fields,{isPartialValidation:!1}):M&&t.currentStep.name==="pricing_plan"?await p(e,M?.fields,{isPartialValidation:!1}):O&&t.currentStep.name==="eligibility_questionnaire"?await p(e,O?.fields,{isPartialValidation:!1}):D&&t.currentStep.name==="contract_origin"?await p(e,D?.fields,{isPartialValidation:!1}):A&&t.currentStep.name==="invoice_schedule"?await p(e,A?.fields,{isPartialValidation:!1}):k&&t.currentStep.name==="create_invoice_schedule"?await p(e,k?.fields,{isPartialValidation:!1}):{},"parseFormValues"),vi=_(e=>{if(!pt(e))return null;let n=e.normalizedErrors.services_and_deliverables,r=Array.isArray(n)?n[0]:n;return r?.source===Dt?{error:r.error,source:r.source,skippable:r.skippable}:null},"extractAiValidationError");async function Si(e){let n=t.currentStep.name,r=await Pe(e);switch(n in re.current&&(re.current[n]=L(r,i[n])),t.currentStep.name){case"select_country":return Me(r.country),Promise.resolve({data:{countryCode:r.country}});case"basic_information":{let s=!o&&m,g=o&&m&&u?.country&&u?.country.code!==m;if(s||g){let Ve={basic_information:fn(r,"nationality_status","ir35","ir35_sds_file"),type:"contractor",country_code:m,external_id:Q},de=await kn(Ve),T=de?.data?.employment?.id;if(!T)throw v("Employment ID not found");return await Je({employmentId:T}),gn(T),de}else if(o){let q=fn(r,"nationality_status","ir35","ir35_sds_file");return await Je({employmentId:o}),An({employmentId:o,basic_information:q})}return}case"contract_details":{let{services_and_deliverables_ai_warning:s,services_and_deliverables_error_skippable:g,...q}=r,Ve=l.services_and_deliverables_error_skippable===!0,de={contract_document:q,skip_ai_checks:Ve};try{let T=await Tn({employmentId:o,payload:de}),oe=T?.data?.contract_document?.id;if(!oe)throw v("Contract document ID not found");return Oe(oe),T}catch(T){let oe=vi(T);throw oe&&fe({...e,services_and_deliverables_ai_warning:Lt(h===S),services_and_deliverables_error_skippable:oe.skippable}),T}}case"contract_preview":{if(fi)return Promise.resolve({data:{contract_document:{id:P}}});let s=await Rn({employmentId:o,contractDocumentId:P,payload:{signature:r.signature}});return await mi(),s}case"pricing_plan":{if(e.subscription===Ft)return Promise.resolve({data:{subscription:e.subscription}});if(z.length===0)throw v("No available subscriptions.");if(!e.subscription&&z.length>0)throw v("Please select a subscription plan.");if(W&&[S,pe].includes(e.subscription))throw v(`This individual is not eligible for ${$t[e.subscription]}.`);if(x&&e.subscription!==S)try{await Ln({employmentId:o}),await he()}catch(g){if(g?.response?.status!==404)throw g;await he()}if(e.subscription==N)return et({employmentId:o,payload:{operation:"downgrade"}});if(e.subscription==pe)return et({employmentId:o,payload:{operation:"upgrade"}});if(e.subscription==S)return x&&u?.contractor_type!=="cor"?tt({employmentId:o}):Promise.resolve({data:{subscription:e.subscription}});throw v("invalid selection")}case"contract_origin":{let s=Di[r.contract_origin]??r.contract_origin,g=r.contract_origin==="provided_by_customer"?"contractor_agreement":"contractor_services_agreement";return await jn({employmentId:o,contractOrigin:s,templateType:g}),await Mn(),{data:{contractOrigin:e.contract_origin}}}case"invoice_schedule":{let s=e.invoice_schedule_preference==="schedule";return qe(s),{data:{invoiceSchedulePreference:e.invoice_schedule_preference}}}case"create_invoice_schedule":{if(!o)throw v("Employment ID is required");if(f?.id){let q=await xn({scheduleId:f.id,values:r});return await be(),q}let s=await Bn({employmentId:o,values:r}),g=s?.data?.failures;if(g&&g.length>0)throw v("Failed to create invoice schedule");return await be(),s}case"eligibility_questionnaire":try{if((await qn({employmentId:o,payload:r}))?.data?.is_blocking)throw De(!1),Le("pricing_plan"),v("This individual is not eligible for Contractor of Record.");return await tt({employmentId:o})}finally{await he()}default:throw v("Invalid step state")}}_(Si,"onSubmit");let Ci=_(()=>{Ee.current?.()},"markContractAsReviewed"),wi=_(async()=>{if(!f?.id)throw v("No invoice schedule to skip");await Nn({scheduleId:f.id}),await be(),qe(!1),_e({...t.values,invoice_schedule:{},create_invoice_schedule:{}}),U("invoice_schedule")},"skipInvoiceSchedule"),Pi=_(async e=>{if(!o)throw v("Employment ID is required");let n=await Pe(e),s=(await Qn({employmentId:o,values:n}))?.data?.contractor_invoice_preview;if(s)return{...s,content:ft(s.content)}},"previewContractorInvoice"),Ii=_(()=>{o&&je(),Vn()},"handleNextStep"),Ie=pn(async e=>{if(t.currentStep.name==="select_country")return K.handleValidation(e);if(I&&t.currentStep.name==="basic_information"){let n=await p(e,I?.fields,{isPartialValidation:!1});return I?.handleValidation(n)}if(V&&t.currentStep.name==="contract_details"){let n=await p(e,V?.fields,{isPartialValidation:!1});return V?.handleValidation(n)}if(F&&t.currentStep.name==="contract_preview"){let n=await p(e,F?.fields,{isPartialValidation:!0});return F?.handleValidation(n)}if(M&&t.currentStep.name==="pricing_plan"){let n=await p(e,M?.fields,{isPartialValidation:!1});return M?.handleValidation(n)}if(O&&t.currentStep.name==="eligibility_questionnaire"){let n=await p(e,O?.fields,{isPartialValidation:!1});return O?.handleValidation(n)}if(D&&t.currentStep.name==="contract_origin"){let n=await p(e,D?.fields,{isPartialValidation:!1});return D?.handleValidation(n)}if(A&&t.currentStep.name==="invoice_schedule"){let n=await p(e,A?.fields,{isPartialValidation:!1});return A?.handleValidation(n)}if(k&&t.currentStep.name==="create_invoice_schedule"){let n=await p(e,k?.fields,{isPartialValidation:!1});return k?.handleValidation(n)}return null},[t.currentStep.name,K,I,V,F,M,O,D,A,k]),Vi=pn(async e=>{fe(e),j&&["invoice_schedule","create_invoice_schedule"].includes(t.currentStep.name)&&await Ie(e)},[fe,j,t,Ie]);return{isLoading:we||Ce,fieldValues:l,stepState:t,checkFieldUpdates:Vi,markContractAsReviewed:Ci,existingInvoiceSchedule:f,skipInvoiceSchedule:wi,isSkippingInvoiceSchedule:ze.isPending,previewContractorInvoice:Pi,isPreviewingInvoiceSchedule:We.isPending,back:In,next:Ii,goTo:bi,onSubmit:Si,fields:i[t.currentStep.name],meta:{fields:re.current,fieldsets:_i[t.currentStep.name],presentation:yi[t.currentStep.name]},parseFormValues:Pe,canSkipAiValidation:l.services_and_deliverables_error_skippable===!0,handleValidation:Ie,initialValues:hi,employmentId:o,refetchEmployment:je,isSubmitting:xe.isPending||Ne.isPending||ye.isPending||Xe.isPending||Ye.isPending||Qe.isPending||Ue.isPending||Ke.isPending||Ze.isPending||Ge.isPending||$e.isPending||He.isPending,documentPreviewPdf:ve,canInvite:Fn,isEmploymentReadOnly:R,invitedStatus:Dn,employment:u,defaultLegalEntity:On,needsCompanyVerification:Be?.some(e=>e.type==="verify_company")??!1,needsRemotePaymentsSetup:Be?.some(e=>e.type==="setup_remote_payments")??!1,steps:Pn}},"useContractorOnboarding");export{ao as a};
2
+ //# sourceMappingURL=chunk-SMCLTRJW.js.map