@remoteoss/remote-flows 0.30.0 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (333) hide show
  1. package/README.md +46 -8
  2. package/dist/{chunk-7TX2YY4K.js → chunk-2W2XD7ZY.js} +2 -2
  3. package/dist/chunk-2W2XD7ZY.js.map +1 -0
  4. package/dist/chunk-3ZWDIEEM.js +2 -0
  5. package/dist/chunk-3ZWDIEEM.js.map +1 -0
  6. package/dist/{chunk-WMICWLC3.js → chunk-5AG4K2EA.js} +2 -2
  7. package/dist/{chunk-DXTLNOCG.js → chunk-5CVD5WZZ.js} +2 -2
  8. package/dist/chunk-5CVD5WZZ.js.map +1 -0
  9. package/dist/{chunk-DYXTJBSK.js → chunk-5KHLOGTR.js} +2 -2
  10. package/dist/{chunk-7RFJWDXS.js → chunk-5KZXFQLZ.js} +2 -2
  11. package/dist/{chunk-LWGVLLBH.js → chunk-5OZPBBXS.js} +2 -2
  12. package/dist/chunk-5P7INAU2.js +2 -0
  13. package/dist/chunk-5P7INAU2.js.map +1 -0
  14. package/dist/{chunk-K2L2NSOM.js → chunk-5ZR7EFPY.js} +2 -2
  15. package/dist/{chunk-KVAGMBSU.js → chunk-6FWFRVQE.js} +2 -2
  16. package/dist/{chunk-LLM6MDNY.js → chunk-6VRUYYUV.js} +2 -2
  17. package/dist/{chunk-ZF4BLPXL.js → chunk-76DHIEN7.js} +2 -2
  18. package/dist/{chunk-D7WCSZGW.js → chunk-7CJX7I3M.js} +2 -2
  19. package/dist/{chunk-7OL54VKA.js → chunk-7YQAVDVX.js} +2 -2
  20. package/dist/chunk-7YQAVDVX.js.map +1 -0
  21. package/dist/chunk-A477TZFC.js +2 -0
  22. package/dist/chunk-A477TZFC.js.map +1 -0
  23. package/dist/chunk-AA7QB3QQ.js +2 -0
  24. package/dist/{chunk-2CDCTUVY.js.map → chunk-AA7QB3QQ.js.map} +1 -1
  25. package/dist/{chunk-QAOGIYQL.js → chunk-AM2IRFHQ.js} +2 -2
  26. package/dist/{chunk-HYOJP6J5.js → chunk-ANGJCT4I.js} +2 -2
  27. package/dist/{chunk-SOYN4LOZ.js → chunk-B6IVJUEH.js} +2 -2
  28. package/dist/{chunk-RYXRWMF4.js → chunk-BV3PGYSH.js} +2 -2
  29. package/dist/{chunk-KFJJXMAH.js → chunk-COBQ4WSJ.js} +2 -2
  30. package/dist/{chunk-TW7Z6G37.js → chunk-CW3MAP5L.js} +2 -2
  31. package/dist/chunk-DFJNVGK4.js +2 -0
  32. package/dist/chunk-DFJNVGK4.js.map +1 -0
  33. package/dist/{chunk-4CIYPTKM.js → chunk-DPWL4KNA.js} +2 -2
  34. package/dist/{chunk-OHAAAVNB.js → chunk-DPY77ASH.js} +2 -2
  35. package/dist/{chunk-PFKNQGOD.js → chunk-DXFA52BU.js} +2 -2
  36. package/dist/{chunk-YBB6BOW7.js → chunk-DXIO72S4.js} +2 -2
  37. package/dist/{chunk-EL5QIDYZ.js → chunk-DZ2R72O5.js} +2 -2
  38. package/dist/{chunk-67V3DFV4.js → chunk-E4CABUTS.js} +2 -2
  39. package/dist/{chunk-5NARH23N.js → chunk-EKKRQI6B.js} +2 -2
  40. package/dist/{chunk-PEHALKVU.js → chunk-EM5UYWUQ.js} +2 -2
  41. package/dist/{chunk-6GUXV7XA.js → chunk-ENW4DCDU.js} +2 -2
  42. package/dist/{chunk-JTOLQCOG.js → chunk-FRTJ4KWA.js} +2 -2
  43. package/dist/{chunk-YP7Q47E2.js → chunk-GCJCNDJ3.js} +2 -2
  44. package/dist/chunk-GKD2WI2W.js +2 -0
  45. package/dist/chunk-GKD2WI2W.js.map +1 -0
  46. package/dist/chunk-GOGPCCBS.js +2 -0
  47. package/dist/chunk-GOGPCCBS.js.map +1 -0
  48. package/dist/{chunk-7JUP5JEY.js → chunk-HBHVB56P.js} +2 -2
  49. package/dist/{chunk-FDBUFHR3.js → chunk-HO2TIG7R.js} +2 -2
  50. package/dist/{chunk-XLAKJHGV.js → chunk-HZDCZFR5.js} +2 -2
  51. package/dist/chunk-HZDCZFR5.js.map +1 -0
  52. package/dist/{chunk-HMUIT2NU.js → chunk-ID3ZF7QT.js} +2 -2
  53. package/dist/{chunk-U24UNO6X.js → chunk-IHNYOUXP.js} +2 -2
  54. package/dist/chunk-IHNYOUXP.js.map +1 -0
  55. package/dist/chunk-IUEXOXFA.js +2 -0
  56. package/dist/chunk-IUEXOXFA.js.map +1 -0
  57. package/dist/{chunk-RCWBOOZF.js → chunk-K2BWF2HC.js} +2 -2
  58. package/dist/{chunk-5ORIDYIK.js → chunk-L3D2AK3X.js} +2 -2
  59. package/dist/{chunk-ZF6MZYBK.js → chunk-LQAHRGU4.js} +2 -2
  60. package/dist/{chunk-6GQZCUUR.js → chunk-LV5R6H3D.js} +2 -2
  61. package/dist/{chunk-PEOWIEYM.js → chunk-M2CI2UDK.js} +2 -2
  62. package/dist/{chunk-UOOM7V2D.js → chunk-MZB24YJP.js} +2 -2
  63. package/dist/{chunk-GTWY3JK3.js → chunk-OIN3HGOQ.js} +2 -2
  64. package/dist/{chunk-Z47JQN3R.js → chunk-OW5QGJD4.js} +2 -2
  65. package/dist/{chunk-HBRO74FQ.js → chunk-P5WUODPR.js} +2 -2
  66. package/dist/{chunk-JK5K2S7N.js → chunk-P7JZC65P.js} +2 -2
  67. package/dist/chunk-Q2N5SOKO.js +2 -0
  68. package/dist/chunk-Q2N5SOKO.js.map +1 -0
  69. package/dist/{chunk-JBUNDNKJ.js → chunk-QWJFYQK3.js} +1 -1
  70. package/dist/{chunk-BKWNJMNJ.js → chunk-SHP4ULHS.js} +2 -2
  71. package/dist/chunk-SHP4ULHS.js.map +1 -0
  72. package/dist/{chunk-ZZWX3C6V.js → chunk-SO3YQ4WT.js} +2 -2
  73. package/dist/{chunk-WNGPZXEX.js → chunk-SPQO42TA.js} +2 -2
  74. package/dist/{chunk-RGGU6BNB.js → chunk-SRRY72CZ.js} +2 -2
  75. package/dist/chunk-THMWKOHC.js +2 -0
  76. package/dist/chunk-THMWKOHC.js.map +1 -0
  77. package/dist/{chunk-664GOQG3.js → chunk-TWVFLXVF.js} +2 -2
  78. package/dist/chunk-U4JVXNOG.js +2 -0
  79. package/dist/chunk-U4JVXNOG.js.map +1 -0
  80. package/dist/{chunk-DTZ23AE6.js → chunk-UJKTTTGB.js} +2 -2
  81. package/dist/{chunk-2N5A6EGD.js → chunk-UPXJJBXZ.js} +2 -2
  82. package/dist/{chunk-YP2JBYAK.js → chunk-WBRWVTZK.js} +2 -2
  83. package/dist/chunk-WJ6YJFD4.js +2 -0
  84. package/dist/chunk-WJ6YJFD4.js.map +1 -0
  85. package/dist/{chunk-OIIALEVF.js → chunk-WMPKW7HC.js} +2 -2
  86. package/dist/chunk-WW5UCMQZ.js +2 -0
  87. package/dist/chunk-WW5UCMQZ.js.map +1 -0
  88. package/dist/chunk-WXUIXZ7P.js +2 -0
  89. package/dist/chunk-WXUIXZ7P.js.map +1 -0
  90. package/dist/{chunk-HTJZUAVS.js → chunk-X6CD3FMG.js} +2 -2
  91. package/dist/chunk-XNOLBKZC.js +2 -0
  92. package/dist/chunk-XNOLBKZC.js.map +1 -0
  93. package/dist/{chunk-HX34JCPL.js → chunk-XPL5XOQ4.js} +2 -2
  94. package/dist/{chunk-CHDWFMD3.js → chunk-XPOLXRYT.js} +2 -2
  95. package/dist/{chunk-QRD43QJA.js → chunk-YDJVQRND.js} +2 -2
  96. package/dist/{chunk-EVSDVI2G.js → chunk-ZQ6MG635.js} +2 -2
  97. package/dist/flows/ContractAmendment/ContractAmendmentBack.js +1 -1
  98. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
  99. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.js +1 -1
  100. package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +4 -3
  101. package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
  102. package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
  103. package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
  104. package/dist/flows/ContractAmendment/ContractAmendmentSubmit.js +1 -1
  105. package/dist/flows/ContractAmendment/context.d.ts +4 -3
  106. package/dist/flows/ContractAmendment/hooks.d.ts +4 -3
  107. package/dist/flows/ContractAmendment/hooks.js +1 -1
  108. package/dist/flows/ContractAmendment/index.d.ts +4 -3
  109. package/dist/flows/ContractAmendment/index.js +1 -1
  110. package/dist/flows/ContractAmendment/types.d.ts +1 -0
  111. package/dist/flows/ContractAmendment/utils.d.ts +1 -1
  112. package/dist/flows/ContractAmendment/utils.js +1 -1
  113. package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +6 -5
  114. package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
  115. package/dist/flows/ContractorOnboarding/api.d.ts +3 -2
  116. package/dist/flows/ContractorOnboarding/api.js +1 -1
  117. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +5 -4
  118. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
  119. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +6 -5
  120. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
  121. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +6 -5
  122. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
  123. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +6 -5
  124. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
  125. package/dist/flows/ContractorOnboarding/components/OnboardingBack.js +1 -1
  126. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.d.ts +3 -3
  127. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.js +1 -1
  128. package/dist/flows/ContractorOnboarding/components/OnboardingSubmit.js +1 -1
  129. package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +6 -5
  130. package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
  131. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +5 -4
  132. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
  133. package/dist/flows/ContractorOnboarding/context.d.ts +6 -5
  134. package/dist/flows/ContractorOnboarding/hooks.d.ts +6 -5
  135. package/dist/flows/ContractorOnboarding/hooks.js +1 -1
  136. package/dist/flows/ContractorOnboarding/index.d.ts +6 -5
  137. package/dist/flows/ContractorOnboarding/index.js +1 -1
  138. package/dist/flows/ContractorOnboarding/types.d.ts +6 -5
  139. package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +4 -3
  140. package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
  141. package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +4 -3
  142. package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
  143. package/dist/flows/CostCalculator/CostCalculatorResetButton.js +1 -1
  144. package/dist/flows/CostCalculator/CostCalculatorSubmitButton.js +1 -1
  145. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.d.ts +2 -1
  146. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +1 -1
  147. package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.js +1 -1
  148. package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.js +1 -1
  149. package/dist/flows/CostCalculator/Results/CostCalculatorExtraStatutoryPaymentsBreakdown.js +1 -1
  150. package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.js +1 -1
  151. package/dist/flows/CostCalculator/Results/CostCalculatorResults.d.ts +1 -1
  152. package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
  153. package/dist/flows/CostCalculator/SummaryResults/SummaryResults.d.ts +2 -1
  154. package/dist/flows/CostCalculator/api.d.ts +2 -1
  155. package/dist/flows/CostCalculator/api.js +1 -1
  156. package/dist/flows/CostCalculator/components/SalaryField.d.ts +2 -2
  157. package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
  158. package/dist/flows/CostCalculator/context.d.ts +4 -3
  159. package/dist/flows/CostCalculator/hooks.d.ts +4 -3
  160. package/dist/flows/CostCalculator/hooks.js +1 -1
  161. package/dist/flows/CostCalculator/index.d.ts +4 -3
  162. package/dist/flows/CostCalculator/index.js +1 -1
  163. package/dist/flows/CostCalculator/types.d.ts +2 -1
  164. package/dist/flows/CostCalculator/utils.d.ts +4 -3
  165. package/dist/flows/CostCalculator/utils.js +1 -1
  166. package/dist/flows/Onboarding/OnboardingFlow.d.ts +5 -4
  167. package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
  168. package/dist/flows/Onboarding/api.d.ts +5 -4
  169. package/dist/flows/Onboarding/api.js +1 -1
  170. package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +2 -2
  171. package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
  172. package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +5 -4
  173. package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
  174. package/dist/flows/Onboarding/components/BenefitsStep.d.ts +5 -4
  175. package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
  176. package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +5 -4
  177. package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
  178. package/dist/flows/Onboarding/components/OnboardingBack.js +1 -1
  179. package/dist/flows/Onboarding/components/OnboardingForm.d.ts +5 -4
  180. package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
  181. package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +3 -3
  182. package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
  183. package/dist/flows/Onboarding/components/OnboardingSubmit.js +1 -1
  184. package/dist/flows/Onboarding/components/ReviewStep.d.ts +5 -4
  185. package/dist/flows/Onboarding/components/SaveDraftButton.d.ts +3 -3
  186. package/dist/flows/Onboarding/components/SaveDraftButton.js +1 -1
  187. package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +5 -4
  188. package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
  189. package/dist/flows/Onboarding/context.d.ts +5 -4
  190. package/dist/flows/Onboarding/hooks.d.ts +5 -4
  191. package/dist/flows/Onboarding/hooks.js +1 -1
  192. package/dist/flows/Onboarding/index.d.ts +5 -4
  193. package/dist/flows/Onboarding/index.js +1 -1
  194. package/dist/flows/Onboarding/types.d.ts +5 -4
  195. package/dist/flows/Onboarding/utils.d.ts +5 -4
  196. package/dist/flows/Onboarding/utils.js +1 -1
  197. package/dist/flows/Termination/AdditionalDetailsForm.d.ts +5 -5
  198. package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
  199. package/dist/flows/Termination/EmployeeComunicationForm.d.ts +5 -5
  200. package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
  201. package/dist/flows/Termination/PaidTimeOffForm.d.ts +5 -5
  202. package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
  203. package/dist/flows/Termination/TerminationBack.js +1 -1
  204. package/dist/flows/Termination/TerminationDetailsForm.d.ts +5 -5
  205. package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
  206. package/dist/flows/Termination/TerminationFlow.d.ts +5 -5
  207. package/dist/flows/Termination/TerminationFlow.js +1 -1
  208. package/dist/flows/Termination/TerminationForm.d.ts +5 -5
  209. package/dist/flows/Termination/TerminationForm.js +1 -1
  210. package/dist/flows/Termination/TerminationSubmit.js +1 -1
  211. package/dist/flows/Termination/api.d.ts +106 -0
  212. package/dist/flows/Termination/api.js +2 -0
  213. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.js +1 -1
  214. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.d.ts +10 -5
  215. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.js +1 -1
  216. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.d.ts +10 -5
  217. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.js +1 -1
  218. package/dist/flows/Termination/components/PaidTimeOff/types.d.ts +10 -5
  219. package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js +1 -1
  220. package/dist/flows/Termination/context.d.ts +25 -5
  221. package/dist/flows/Termination/hooks.d.ts +5 -5
  222. package/dist/flows/Termination/hooks.js +1 -1
  223. package/dist/flows/Termination/index.d.ts +8 -7
  224. package/dist/flows/Termination/index.js +1 -1
  225. package/dist/flows/Termination/json-schemas/schema.d.ts +14 -3
  226. package/dist/flows/Termination/types.d.ts +5 -5
  227. package/dist/flows/Termination/utils.d.ts +13 -6
  228. package/dist/flows/Termination/utils.js +1 -1
  229. package/dist/flows/types.d.ts +3 -1
  230. package/dist/index.d.ts +12 -17
  231. package/dist/index.js +1 -1
  232. package/dist/index.js.map +1 -1
  233. package/dist/internals.d.ts +10 -1
  234. package/dist/internals.js +1 -1
  235. package/dist/{mutations-BdkQ8BEQ.d.ts → mutations-Cdk0PM78.d.ts} +1 -1
  236. package/dist/{remoteFlows-nNmmcD-T.d.ts → remoteFlows-DUivEPPh.d.ts} +41 -7
  237. package/dist/{types-BOXcQDia.d.ts → types-BZBdCzER.d.ts} +4 -4
  238. package/dist/{types-5wwUT05a.d.ts → types-C-X7siUr.d.ts} +46 -5
  239. package/dist/{types-CNHUaKN_.d.ts → types-OcTc56P-.d.ts} +3 -74
  240. package/dist/{types-omiJJgNz.d.ts → types-pohqJTkr.d.ts} +4 -4
  241. package/dist/{types.gen-BS9UfhS-.d.ts → types.gen-D0ZCnKWv.d.ts} +18 -1
  242. package/package.json +2 -1
  243. package/dist/chunk-2CDCTUVY.js +0 -2
  244. package/dist/chunk-56LJAMZC.js +0 -2
  245. package/dist/chunk-56LJAMZC.js.map +0 -1
  246. package/dist/chunk-7OL54VKA.js.map +0 -1
  247. package/dist/chunk-7TX2YY4K.js.map +0 -1
  248. package/dist/chunk-A6GJNXUZ.js +0 -2
  249. package/dist/chunk-A6GJNXUZ.js.map +0 -1
  250. package/dist/chunk-BB3WWKGA.js +0 -2
  251. package/dist/chunk-BB3WWKGA.js.map +0 -1
  252. package/dist/chunk-BKWNJMNJ.js.map +0 -1
  253. package/dist/chunk-CFIJKJXD.js +0 -2
  254. package/dist/chunk-CFIJKJXD.js.map +0 -1
  255. package/dist/chunk-D64MAPTD.js +0 -2
  256. package/dist/chunk-D64MAPTD.js.map +0 -1
  257. package/dist/chunk-D6X2WCEG.js +0 -2
  258. package/dist/chunk-D6X2WCEG.js.map +0 -1
  259. package/dist/chunk-DXTLNOCG.js.map +0 -1
  260. package/dist/chunk-EHS4ERDW.js +0 -2
  261. package/dist/chunk-EHS4ERDW.js.map +0 -1
  262. package/dist/chunk-HJYHCWGX.js +0 -2
  263. package/dist/chunk-HJYHCWGX.js.map +0 -1
  264. package/dist/chunk-LJYCBMDS.js +0 -2
  265. package/dist/chunk-LJYCBMDS.js.map +0 -1
  266. package/dist/chunk-PAQW5BFW.js +0 -2
  267. package/dist/chunk-PAQW5BFW.js.map +0 -1
  268. package/dist/chunk-QGWCUGLN.js +0 -2
  269. package/dist/chunk-QGWCUGLN.js.map +0 -1
  270. package/dist/chunk-S4XU4SE7.js +0 -2
  271. package/dist/chunk-S4XU4SE7.js.map +0 -1
  272. package/dist/chunk-U24UNO6X.js.map +0 -1
  273. package/dist/chunk-XFJPUKYR.js +0 -2
  274. package/dist/chunk-XFJPUKYR.js.map +0 -1
  275. package/dist/chunk-XLAKJHGV.js.map +0 -1
  276. package/dist/chunk-ZX5OIIJX.js +0 -1
  277. package/dist/chunk-ZX5OIIJX.js.map +0 -1
  278. package/dist/flows/api.d.ts +0 -34
  279. package/dist/flows/api.js +0 -2
  280. /package/dist/{chunk-WMICWLC3.js.map → chunk-5AG4K2EA.js.map} +0 -0
  281. /package/dist/{chunk-DYXTJBSK.js.map → chunk-5KHLOGTR.js.map} +0 -0
  282. /package/dist/{chunk-7RFJWDXS.js.map → chunk-5KZXFQLZ.js.map} +0 -0
  283. /package/dist/{chunk-LWGVLLBH.js.map → chunk-5OZPBBXS.js.map} +0 -0
  284. /package/dist/{chunk-K2L2NSOM.js.map → chunk-5ZR7EFPY.js.map} +0 -0
  285. /package/dist/{chunk-KVAGMBSU.js.map → chunk-6FWFRVQE.js.map} +0 -0
  286. /package/dist/{chunk-LLM6MDNY.js.map → chunk-6VRUYYUV.js.map} +0 -0
  287. /package/dist/{chunk-ZF4BLPXL.js.map → chunk-76DHIEN7.js.map} +0 -0
  288. /package/dist/{chunk-D7WCSZGW.js.map → chunk-7CJX7I3M.js.map} +0 -0
  289. /package/dist/{chunk-QAOGIYQL.js.map → chunk-AM2IRFHQ.js.map} +0 -0
  290. /package/dist/{chunk-HYOJP6J5.js.map → chunk-ANGJCT4I.js.map} +0 -0
  291. /package/dist/{chunk-SOYN4LOZ.js.map → chunk-B6IVJUEH.js.map} +0 -0
  292. /package/dist/{chunk-RYXRWMF4.js.map → chunk-BV3PGYSH.js.map} +0 -0
  293. /package/dist/{chunk-KFJJXMAH.js.map → chunk-COBQ4WSJ.js.map} +0 -0
  294. /package/dist/{chunk-TW7Z6G37.js.map → chunk-CW3MAP5L.js.map} +0 -0
  295. /package/dist/{chunk-4CIYPTKM.js.map → chunk-DPWL4KNA.js.map} +0 -0
  296. /package/dist/{chunk-OHAAAVNB.js.map → chunk-DPY77ASH.js.map} +0 -0
  297. /package/dist/{chunk-PFKNQGOD.js.map → chunk-DXFA52BU.js.map} +0 -0
  298. /package/dist/{chunk-YBB6BOW7.js.map → chunk-DXIO72S4.js.map} +0 -0
  299. /package/dist/{chunk-EL5QIDYZ.js.map → chunk-DZ2R72O5.js.map} +0 -0
  300. /package/dist/{chunk-67V3DFV4.js.map → chunk-E4CABUTS.js.map} +0 -0
  301. /package/dist/{chunk-5NARH23N.js.map → chunk-EKKRQI6B.js.map} +0 -0
  302. /package/dist/{chunk-PEHALKVU.js.map → chunk-EM5UYWUQ.js.map} +0 -0
  303. /package/dist/{chunk-6GUXV7XA.js.map → chunk-ENW4DCDU.js.map} +0 -0
  304. /package/dist/{chunk-JTOLQCOG.js.map → chunk-FRTJ4KWA.js.map} +0 -0
  305. /package/dist/{chunk-YP7Q47E2.js.map → chunk-GCJCNDJ3.js.map} +0 -0
  306. /package/dist/{chunk-7JUP5JEY.js.map → chunk-HBHVB56P.js.map} +0 -0
  307. /package/dist/{chunk-FDBUFHR3.js.map → chunk-HO2TIG7R.js.map} +0 -0
  308. /package/dist/{chunk-HMUIT2NU.js.map → chunk-ID3ZF7QT.js.map} +0 -0
  309. /package/dist/{chunk-RCWBOOZF.js.map → chunk-K2BWF2HC.js.map} +0 -0
  310. /package/dist/{chunk-5ORIDYIK.js.map → chunk-L3D2AK3X.js.map} +0 -0
  311. /package/dist/{chunk-ZF6MZYBK.js.map → chunk-LQAHRGU4.js.map} +0 -0
  312. /package/dist/{chunk-6GQZCUUR.js.map → chunk-LV5R6H3D.js.map} +0 -0
  313. /package/dist/{chunk-PEOWIEYM.js.map → chunk-M2CI2UDK.js.map} +0 -0
  314. /package/dist/{chunk-UOOM7V2D.js.map → chunk-MZB24YJP.js.map} +0 -0
  315. /package/dist/{chunk-GTWY3JK3.js.map → chunk-OIN3HGOQ.js.map} +0 -0
  316. /package/dist/{chunk-Z47JQN3R.js.map → chunk-OW5QGJD4.js.map} +0 -0
  317. /package/dist/{chunk-HBRO74FQ.js.map → chunk-P5WUODPR.js.map} +0 -0
  318. /package/dist/{chunk-JK5K2S7N.js.map → chunk-P7JZC65P.js.map} +0 -0
  319. /package/dist/{chunk-JBUNDNKJ.js.map → chunk-QWJFYQK3.js.map} +0 -0
  320. /package/dist/{chunk-ZZWX3C6V.js.map → chunk-SO3YQ4WT.js.map} +0 -0
  321. /package/dist/{chunk-WNGPZXEX.js.map → chunk-SPQO42TA.js.map} +0 -0
  322. /package/dist/{chunk-RGGU6BNB.js.map → chunk-SRRY72CZ.js.map} +0 -0
  323. /package/dist/{chunk-664GOQG3.js.map → chunk-TWVFLXVF.js.map} +0 -0
  324. /package/dist/{chunk-DTZ23AE6.js.map → chunk-UJKTTTGB.js.map} +0 -0
  325. /package/dist/{chunk-2N5A6EGD.js.map → chunk-UPXJJBXZ.js.map} +0 -0
  326. /package/dist/{chunk-YP2JBYAK.js.map → chunk-WBRWVTZK.js.map} +0 -0
  327. /package/dist/{chunk-OIIALEVF.js.map → chunk-WMPKW7HC.js.map} +0 -0
  328. /package/dist/{chunk-HTJZUAVS.js.map → chunk-X6CD3FMG.js.map} +0 -0
  329. /package/dist/{chunk-HX34JCPL.js.map → chunk-XPL5XOQ4.js.map} +0 -0
  330. /package/dist/{chunk-CHDWFMD3.js.map → chunk-XPOLXRYT.js.map} +0 -0
  331. /package/dist/{chunk-QRD43QJA.js.map → chunk-YDJVQRND.js.map} +0 -0
  332. /package/dist/{chunk-EVSDVI2G.js.map → chunk-ZQ6MG635.js.map} +0 -0
  333. /package/dist/flows/{api.js.map → Termination/api.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/Termination/hooks.tsx","../src/common/api/payroll-calendars.ts","../src/common/employment.ts"],"sourcesContent":["import { $TSFixMe, createHeadlessForm } from '@remoteoss/json-schema-form';\nimport omitBy from 'lodash.omitby';\nimport isNull from 'lodash.isnull';\nimport { format, isFuture, parseISO, subDays } from 'date-fns';\nimport { useMemo } from 'react';\nimport {\n CreateOffboardingParams,\n TerminationDetailsParams,\n} from '@/src/client';\nimport { mutationToPromise } from '@/src/lib/mutations';\nimport { parseJSFToValidate } from '@/src/components/form/utils';\nimport {\n EmployeeCommunicationFormValues,\n PaidTimeOffFormValues,\n TerminationDetailsFormValues,\n TerminationFlowProps,\n TerminationFormValues,\n} from '@/src/flows/Termination/types';\nimport omit from 'lodash.omit';\nimport { parseFormRadioValues } from '@/src/flows/utils';\nimport { useStepState } from '@/src/flows/useStepState';\nimport {\n buildInitialValues,\n calculateMinTerminationDate,\n calculateProposedTerminationDateStatement,\n STEPS,\n} from '@/src/flows/Termination/utils';\nimport { jsonSchema } from '@/src/flows/Termination/json-schemas/jsonSchema';\nimport { terminationDetailsSchema } from '@/src/flows/Termination/json-schemas/terminationDetails';\nimport {\n useCreateTermination,\n useTerminationSchema,\n} from '@/src/flows/Termination/api';\nimport { createInformationField } from '@/src/components/form/jsf-utils/createFields';\nimport { cn, ZendeskTriggerButton } from '@/src/internals';\nimport { zendeskArticles } from '@/src/components/shared/zendesk-drawer/utils';\nimport { PaidTimeOff } from '@/src/flows/Termination/components/PaidTimeOff/PaidTimeOff';\nimport { PaidTimeOffContainer } from '@/src/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer';\nimport { useEmploymentQuery } from '@/src/common/api';\nimport { AcknowledgeInformationContainer } from '@/src/flows/Termination/components/AcknowledgeInformation/AcknowledgeInfomationContainer';\nimport { AcknowledgeInformation } from '@/src/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformation';\nimport { AcknowledgeInformationFees } from '@/src/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees';\nimport { usePayrollCalendars } from '@/src/common/api/payroll-calendars';\nimport { isInProbationPeriod } from '@/src/common/employment';\n\ntype TerminationHookProps = Omit<TerminationFlowProps, 'render'>;\n\nexport const useTermination = ({\n employmentId,\n options,\n initialValues: terminationInitialValues,\n}: TerminationHookProps) => {\n const { fieldValues, setFieldValues, stepState, previousStep, nextStep } =\n useStepState<keyof typeof STEPS, TerminationFormValues>(STEPS);\n\n const { data: employment } = useEmploymentQuery({ employmentId });\n\n const { data: payrollCalendars } = usePayrollCalendars({\n query: {\n year: new Date().getFullYear().toString(),\n countryCode: employment?.country?.code,\n },\n options: {\n enabled: Boolean(employment?.country?.code),\n },\n });\n\n const isEmployeeInProbationPeriod = isInProbationPeriod(\n employment?.probation_period_end_date,\n );\n\n const minTerminationDate = calculateMinTerminationDate(payrollCalendars);\n const minDate = useMemo(\n () =>\n isEmployeeInProbationPeriod\n ? format(new Date(), 'yyyy-MM-dd')\n : format(minTerminationDate, 'yyyy-MM-dd'),\n [isEmployeeInProbationPeriod, minTerminationDate],\n );\n\n const hasFutureStartDate = Boolean(\n employment?.provisional_start_date &&\n isFuture(parseISO(employment.provisional_start_date)),\n );\n\n const initialValues = buildInitialValues(\n {\n ...stepState.values?.employee_communication,\n ...stepState.values?.termination_details,\n ...stepState.values?.paid_time_off,\n ...stepState.values?.additional_information,\n ...terminationInitialValues,\n },\n hasFutureStartDate,\n );\n\n const formValues = useMemo(\n () => ({\n ...stepState.values?.[stepState.currentStep.name as keyof typeof STEPS], // Restore values for the current step\n ...initialValues,\n ...fieldValues,\n }),\n [stepState.values, stepState.currentStep.name, fieldValues, initialValues],\n );\n\n const proposedTerminationDateStatement =\n calculateProposedTerminationDateStatement({\n minTerminationDate,\n isEmployeeInProbationPeriod,\n selectedDate: parseISO(formValues.proposed_termination_date),\n });\n\n const customFields = useMemo(() => {\n const originalTerminationReasonOptions =\n terminationDetailsSchema.data.schema.properties.termination_reason.oneOf;\n\n const terminationReasonOptions = hasFutureStartDate\n ? originalTerminationReasonOptions.filter(\n (option: $TSFixMe) =>\n option.const === 'cancellation_before_start_date',\n )\n : originalTerminationReasonOptions.filter(\n (option: $TSFixMe) =>\n option.const !== 'cancellation_before_start_date',\n );\n\n return {\n fields: {\n risk_assesment_info: createInformationField(\n 'Offboarding risk assessment',\n 'Employees may be protected from termination if they fall into certain categories. To help avoid claims from employees, let us know if the employee is part of one or more of these categories. Select all that apply.',\n {\n className: (\n options?.jsfModify?.fields?.risk_assesment_info as $TSFixMe\n )?.['x-jsf-presentation']?.className,\n },\n ),\n termination_reason: {\n ...(options?.jsfModify?.fields?.termination_reason as $TSFixMe),\n oneOf: terminationReasonOptions,\n },\n proposed_termination_date_info: createInformationField(\n 'Proposed termination date',\n <>\n In most cases, we must provide notice to the employee before\n termination. The required notice period depends on local labor laws,\n the employment agreement, and other factors. We'll use those factors\n to determine the required notice period.\n <ZendeskTriggerButton\n external\n zendeskId={zendeskArticles.terminationNoticePeriods}\n className={cn(\n 'text-sm',\n (\n options?.jsfModify?.fields\n ?.proposed_termination_date_info as $TSFixMe\n )?.['x-jsf-presentation']?.zendeskTriggerButtonClassName,\n )}\n >\n Learn about notice periods\n </ZendeskTriggerButton>\n </>,\n {\n className: (\n options?.jsfModify?.fields\n ?.proposed_termination_date_info as $TSFixMe\n )?.['x-jsf-presentation']?.className,\n },\n ),\n proposed_termination_date: {\n ...(options?.jsfModify?.fields\n ?.proposed_termination_date as $TSFixMe),\n 'x-jsf-presentation': {\n ...(\n options?.jsfModify?.fields?.proposed_termination_date as $TSFixMe\n )?.['x-jsf-presentation'],\n minDate: minDate,\n ...(formValues.termination_reason ===\n 'cancellation_before_start_date' &&\n employment?.provisional_start_date\n ? {\n maxDate: format(\n subDays(parseISO(employment.provisional_start_date), 1),\n 'yyyy-MM-dd',\n ),\n }\n : {}),\n ...proposedTerminationDateStatement,\n },\n ...(formValues.termination_reason === 'cancellation_before_start_date'\n ? {\n 'x-jsf-errorMessage': {\n maximum:\n \"The proposed termination date must be before the employee's start date.\",\n },\n }\n : {}),\n },\n paid_time_off_info: {\n ...(options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe),\n 'x-jsf-presentation': {\n ...(options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe)?.[\n 'x-jsf-presentation'\n ],\n Component: () => {\n const CustomComponent = (\n options?.jsfModify?.fields?.paid_time_off_info as $TSFixMe\n )?.['x-jsf-presentation']?.Component;\n\n return (\n <PaidTimeOffContainer\n employeeName={employment?.basic_information?.name as string}\n proposedTerminationDate={formValues.proposed_termination_date}\n employmentId={employmentId}\n employment={employment}\n render={(props) => {\n if (CustomComponent) {\n return <CustomComponent {...props} />;\n }\n return <PaidTimeOff {...props} />;\n }}\n />\n );\n },\n },\n },\n acknowledge_termination_procedure_info: {\n ...(options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_info as $TSFixMe),\n 'x-jsf-presentation': {\n ...(\n options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_info as $TSFixMe\n )?.['x-jsf-presentation'],\n Component: () => {\n const CustomComponent = (\n options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_info as $TSFixMe\n )?.['x-jsf-presentation']?.Component;\n\n return (\n <AcknowledgeInformationContainer\n render={(props) => {\n if (CustomComponent) {\n return <CustomComponent {...props} />;\n }\n return <AcknowledgeInformation {...props} />;\n }}\n />\n );\n },\n },\n },\n acknowledge_termination_procedure_fees_info: {\n ...(options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_fees_info as $TSFixMe),\n 'x-jsf-presentation': {\n ...(\n options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_fees_info as $TSFixMe\n )?.['x-jsf-presentation'],\n Component: () => {\n const zendeskIds = {\n involuntaryOffboardingServiceChargeZendeskId:\n zendeskArticles.involuntaryOffboardingServiceCharge,\n reconciliationInvoiceZendeskId:\n zendeskArticles.reconciliationInvoice,\n };\n\n const CustomComponent = (\n options?.jsfModify?.fields\n ?.acknowledge_termination_procedure_fees_info as $TSFixMe\n )?.['x-jsf-presentation']?.Component;\n\n if (CustomComponent) {\n return <CustomComponent {...zendeskIds} />;\n }\n\n return <AcknowledgeInformationFees {...zendeskIds} />;\n },\n },\n },\n },\n };\n }, [\n employment,\n employmentId,\n formValues.proposed_termination_date,\n formValues.termination_reason,\n hasFutureStartDate,\n minDate,\n options?.jsfModify?.fields?.acknowledge_termination_procedure_fees_info,\n options?.jsfModify?.fields?.acknowledge_termination_procedure_info,\n options?.jsfModify?.fields?.paid_time_off_info,\n options?.jsfModify?.fields?.proposed_termination_date,\n options?.jsfModify?.fields?.proposed_termination_date_info,\n options?.jsfModify?.fields?.risk_assesment_info,\n options?.jsfModify?.fields?.termination_reason,\n proposedTerminationDateStatement,\n ]);\n\n const { data: terminationHeadlessForm, isLoading: isLoadingTermination } =\n useTerminationSchema({\n formValues: formValues,\n jsfModify: {\n ...options?.jsfModify,\n fields: {\n ...options?.jsfModify?.fields,\n ...customFields?.fields,\n },\n },\n step: stepState.currentStep.name,\n });\n\n const entireTerminationSchema = createHeadlessForm(jsonSchema.data.schema);\n\n const createTermination = useCreateTermination();\n const { mutateAsync } = mutationToPromise(createTermination);\n\n async function onSubmit(values: TerminationFormValues) {\n if (!employmentId) {\n throw new Error('Employment id is missing');\n }\n\n if (terminationHeadlessForm) {\n // this is a hack because I need to validate all form values with the entire schema\n const parsedValues = parseJSFToValidate(\n values,\n entireTerminationSchema.fields,\n { isPartialValidation: true },\n );\n\n const { customer_informed_employee: customerInformedEmployee } =\n parsedValues;\n\n const employeeAwareness =\n customerInformedEmployee === 'yes'\n ? {\n employee_awareness: {\n date: parsedValues.customer_informed_employee_date,\n note: parsedValues.customer_informed_employee_description,\n },\n }\n : undefined;\n\n const radioFieldKeys = [\n 'agrees_to_pto_amount',\n 'confidential',\n 'customer_informed_employee',\n 'will_challenge_termination',\n ];\n\n const parsedRadioValues = parseFormRadioValues(\n parsedValues,\n radioFieldKeys,\n );\n\n const normalizedValues = omit(\n parsedRadioValues,\n 'customer_informed_employee_date',\n 'customer_informed_employee_description',\n );\n\n const terminationDetails: TerminationDetailsParams = omitBy(\n {\n ...normalizedValues,\n ...employeeAwareness,\n },\n isNull,\n ) as unknown as TerminationDetailsParams;\n\n const terminationPayload: CreateOffboardingParams = {\n employment_id: employmentId,\n termination_details: terminationDetails,\n type: 'termination',\n };\n\n return mutateAsync(terminationPayload);\n }\n\n return;\n }\n\n function back() {\n previousStep();\n }\n\n function next() {\n nextStep();\n }\n\n const isDirty = Boolean(Object.keys(fieldValues).length > 0);\n\n return {\n /**\n * Employment id passed useful to be used between components\n */\n employmentId,\n /**\n * Employment data\n */\n employment,\n\n /**\n * Current form field values, we use formValues to let the user know about all the current form values\n */\n fieldValues: formValues,\n\n /**\n * Indicates if the form is dirty\n */\n isDirty,\n /**\n * Current step state containing the current step and total number of steps\n */\n stepState,\n /**\n * Array of form fields from the contract amendment schema\n */\n fields: terminationHeadlessForm?.fields || [],\n /**\n * Loading state indicating if the termination schema is being fetched\n */\n isLoading: isLoadingTermination,\n /**\n * Loading state indicating if a contract amendment mutation is in progress\n */\n isSubmitting: createTermination.isPending,\n /**\n * Initial form values\n */\n initialValues: initialValues,\n /**\n * Function to validate form values against the contract amendment schema\n * @param values - Form values to validate\n * @returns Validation result or null if no schema is available\n */\n handleValidation: (values: TerminationFormValues) => {\n if (terminationHeadlessForm) {\n const parsedValues = parseJSFToValidate(\n values,\n terminationHeadlessForm?.fields,\n );\n return terminationHeadlessForm?.handleValidation(parsedValues);\n }\n return null;\n },\n /**\n * Function to update the current form field values\n * @param values - New form values to set\n */\n checkFieldUpdates: setFieldValues,\n /**\n * Function to parse form values before submission\n * @param values - Form values to parse\n * @returns Parsed form values\n */\n parseFormValues: (\n values: TerminationFormValues,\n includeAllFields: boolean = false,\n ):\n | EmployeeCommunicationFormValues\n | TerminationDetailsFormValues\n | PaidTimeOffFormValues\n | TerminationFormValues => {\n if (includeAllFields) {\n return parseJSFToValidate(values, entireTerminationSchema.fields, {\n isPartialValidation: true,\n }) as TerminationFormValues;\n }\n\n if (terminationHeadlessForm) {\n return parseJSFToValidate(values, terminationHeadlessForm?.fields, {\n isPartialValidation: true,\n }) as\n | EmployeeCommunicationFormValues\n | TerminationDetailsFormValues\n | PaidTimeOffFormValues;\n }\n return {} as $TSFixMe;\n },\n /**\n * Function to handle form submission\n * @param values - Form values to submit\n * @returns Promise resolving to the mutation result\n */\n onSubmit,\n\n /**\n * Function to handle going back to the previous step\n * @returns {void}\n */\n back,\n\n /**\n * Function to handle going to the next step\n * @returns {void}\n */\n next,\n };\n};\n","import { useQuery } from '@tanstack/react-query';\nimport { getIndexEorPayrollCalendar } from '@/src/client';\nimport { useClient } from '@/src/context';\nimport { Client } from '@hey-api/client-fetch';\n\nexport const usePayrollCalendars = ({\n query,\n options,\n}: {\n query?: {\n year?: string;\n countryCode?: string;\n };\n options?: {\n enabled?: boolean;\n };\n}) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['payroll-calendars'],\n queryFn: () =>\n getIndexEorPayrollCalendar({\n client: client as Client,\n query: {\n year: query?.year,\n country_code: query?.countryCode,\n },\n }),\n enabled: options?.enabled,\n select: (data) => data.data?.data?.payroll_calendars?.[0],\n });\n};\n","import { isFuture, isToday, parseISO } from 'date-fns';\n\nexport const isInProbationPeriod = (probationEndDate: string | undefined) => {\n if (!probationEndDate) return false;\n\n const parsedProbationEndDate = parseISO(probationEndDate);\n\n return isFuture(parsedProbationEndDate) || isToday(parsedProbationEndDate);\n};\n"],"mappings":"kyBAAA,OAAmB,sBAAAA,OAA0B,8BAC7C,OAAOC,OAAY,gBACnB,OAAOC,OAAY,gBACnB,OAAS,UAAAC,EAAQ,YAAAC,GAAU,YAAAC,EAAU,WAAAC,OAAe,WACpD,OAAS,WAAAC,MAAe,QAcxB,OAAOC,OAAU,cClBjB,OAAS,YAAAC,OAAgB,wBAKlB,IAAMC,EAAsBC,EAAA,CAAC,CAClC,MAAAC,EACA,QAAAC,CACF,IAQM,CACJ,GAAM,CAAE,OAAAC,CAAO,EAAIC,EAAU,EAC7B,OAAOC,GAAS,CACd,SAAU,CAAC,mBAAmB,EAC9B,QAASL,EAAA,IACPM,EAA2B,CACzB,OAAQH,EACR,MAAO,CACL,KAAMF,GAAO,KACb,aAAcA,GAAO,WACvB,CACF,CAAC,EAPM,WAQT,QAASC,GAAS,QAClB,OAAQF,EAACO,GAASA,EAAK,MAAM,MAAM,oBAAoB,CAAC,EAAhD,SACV,CAAC,CACH,EA1BmC,uBCLnC,OAAS,YAAAC,GAAU,WAAAC,GAAS,YAAAC,OAAgB,WAErC,IAAMC,EAAsBC,EAACC,GAAyC,CAC3E,GAAI,CAACA,EAAkB,MAAO,GAE9B,IAAMC,EAAyBC,GAASF,CAAgB,EAExD,OAAOG,GAASF,CAAsB,GAAKG,GAAQH,CAAsB,CAC3E,EANmC,uBF6IzB,mBAAAI,GAKE,OAAAC,EALF,QAAAC,OAAA,oBAhGH,IAAMC,GAAiBC,EAAA,CAAC,CAC7B,aAAAC,EACA,QAAAC,EACA,cAAeC,CACjB,IAA4B,CAC1B,GAAM,CAAE,YAAAC,EAAa,eAAAC,EAAgB,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,EAA4B,KAMxBA,EACKb,EAAmBF,EAAQR,EAAwB,OAAQ,CAChE,oBAAqB,EACvB,CAAC,EAGCH,EACKa,EAAmBF,EAAQX,GAAyB,OAAQ,CACjE,oBAAqB,EACvB,CAAC,EAKI,CAAC,EAtBO,mBA6BjB,SAAAU,GAMA,KAAAa,GAMA,KAAAC,EACF,CACF,EArc8B","names":["createHeadlessForm","omitBy","isNull","format","isFuture","parseISO","subDays","useMemo","omit","useQuery","usePayrollCalendars","__name","query","options","client","useClient","useQuery","getIndexEorPayrollCalendar","data","isFuture","isToday","parseISO","isInProbationPeriod","__name","probationEndDate","parsedProbationEndDate","parseISO","isFuture","isToday","Fragment","jsx","jsxs","useTermination","__name","employmentId","options","terminationInitialValues","fieldValues","setFieldValues","stepState","previousStep","nextStep","useStepState","STEPS","employment","useEmploymentQuery","payrollCalendars","usePayrollCalendars","isEmployeeInProbationPeriod","isInProbationPeriod","minTerminationDate","calculateMinTerminationDate","minDate","useMemo","format","hasFutureStartDate","isFuture","parseISO","initialValues","buildInitialValues","formValues","proposedTerminationDateStatement","calculateProposedTerminationDateStatement","customFields","originalTerminationReasonOptions","terminationDetailsSchema","terminationReasonOptions","option","createInformationField","ZendeskTriggerButton","zendeskArticles","cn","subDays","CustomComponent","PaidTimeOffContainer","props","PaidTimeOff","AcknowledgeInformationContainer","AcknowledgeInformation","zendeskIds","AcknowledgeInformationFees","terminationHeadlessForm","isLoadingTermination","useTerminationSchema","entireTerminationSchema","createHeadlessForm","jsonSchema","createTermination","useCreateTermination","mutateAsync","mutationToPromise","onSubmit","values","parsedValues","parseJSFToValidate","customerInformedEmployee","employeeAwareness","parsedRadioValues","parseFormRadioValues","normalizedValues","omit","terminationDetails","omitBy","isNull","back","next","isDirty","includeAllFields"]}
@@ -0,0 +1,2 @@
1
+ import{a as o}from"./chunk-P37U34EQ.js";import{addBusinessDays as P,isWeekend as x,nextMonday as h}from"date-fns";import V from"lodash.get";var w={TEXT:"text",TEXTAREA:"textarea",NUMBER:"number",SELECT:"select",COUNTRIES:"countries",TEL:"tel",EMAIL:"email",MONEY:"money",DATE:"date",DATE_RANGE:"date-range",CURRENCIES:"currencies",TIME:"time"},L={CHECKBOX:"checkbox",ACK_CHECK:"ack-check"},c={FILE:"file",RADIO:"radio",RADIO_CARD:"radio-card",GROUP_ARRAY:"group-array",EXTRA:"extra",STATEMENT:"statement",HIDDEN:"hidden",FIELDSET:"fieldset",FIELDSET_FLAT:"fieldset-flat",WORK_SCHEDULE:"work-schedule",WORK_WEEK_SCHEDULE:"work-week-schedule",BENEFITS:"benefits",SIGNATURE:"signature",SELECT_MULTIPLE:"select-multiple",...w,...L};function A(e){return Math.round((e+Number.EPSILON)*100)/100}o(A,"round");function R(e){return parseFloat(e.replace(/,/g,""))}o(R,"convertToValidCost");function C(e){if(e==null||e===""||Number.isNaN(e)||Array.isArray(e)||typeof e=="boolean")return null;let n;return typeof e=="string"?n=R(e):n=e,A(n*100)}o(C,"convertToCents");function j(e){if(e==null||Number.isNaN(e))return null;let n;return typeof e=="string"?n=R(e||"0"):n=e,A(n/100)}o(j,"convertFromCents");var g=o(e=>Object.entries(e||{}).reduce((n,[t,s])=>(Array.isArray(s)?n[t]=s.map(r=>typeof r=="object"&&r!==null?g(r):typeof r=="string"?r.trim():r):typeof s=="object"&&s!==null?n[t]=g(s):n[t]=typeof s=="string"?s.trim():s,n),{}),"trimStringValues");function I(e,n){let t={};return n.forEach(s=>{let r=s.name;if(!(!Object.prototype.hasOwnProperty.call(e,r)&&!(s.inputType===c.FIELDSET&&s.valueGroupingDisabled))){if(s.inputType===c.FIELDSET&&s.valueGroupingDisabled){Object.assign(t,I(e,s.fields));return}s.readOnly&&s.defaultValue?t[r]=s.defaultValue:t[r]=e[r]}}),t}o(I,"prefillReadOnlyFields");function D(e,n){return e.reduce((t,s)=>(s.inputType===c.FIELDSET&&s.valueGroupingDisabled?Object.assign(t,D(s.fields,n)):Object.prototype.hasOwnProperty.call(n,s.name)&&(t[s.name]=n[s.name]),t),{})}o(D,"extractFieldsetFieldsValues");var T={[c.COUNTRIES]:{transformValueToAPI:o(e=>n=>!e.multiple||typeof n=="string"?n:n.map(t=>typeof t=="string"?t:t.name),"transformValueToAPI"),transformValue:o(e=>{let n=o(t=>t?.name||t?.value||t?.label,"getCountryValue");return Array.isArray(e)?e.map(n):n(e)||""},"transformValue")},[c.NUMBER]:{transformValueToAPI:o(()=>e=>{let n=Number(e);return Number.isNaN(n)?e:n},"transformValueToAPI")},[c.MONEY]:{transformValueFromAPI:o(()=>e=>j(e)??"","transformValueFromAPI"),transformValueToAPI:o(()=>C,"transformValueToAPI")},[c.RADIO]:{transformValueToAPI:o(e=>n=>e.transformToBool?n==="yes":n,"transformValueToAPI")},[c.CHECKBOX]:{transformValueToAPI:o(e=>n=>n===void 0?!1:e.const&&n===!0?e.const:n,"transformValueToAPI")},[c.SELECT]:{transformValue:o(e=>Array.isArray(e)?e.map(n=>n.value):e?.value??"","transformValue")}};function p(e={},n){return n.filter(r=>e[r.name]||r.inputType===c.FIELDSET&&r.valueGroupingDisabled).reduce((r,a)=>{switch(a.inputType){case c.FIELDSET:{let i=a;if(i.valueGroupingDisabled){let u=D(i.fields,e);Object.assign(r,p(u,i.fields))}else{let u=e[a.name];if(u&&typeof u=="object"&&!Array.isArray(u)){let l=Object.fromEntries(Object.entries(u).filter(([,d])=>d!==""&&d!==null&&d!==void 0));r[a.name]=Object.keys(l).length>0?p(l,i.fields):void 0}else r[a.name]=p(u,i.fields)}break}case c.TEXTAREA:case c.TEXT:{r[a.name]=e[a.name].replace(/\0/g,"");break}case c.GROUP_ARRAY:{let i=a?.fields?.().map(l=>({...l,name:l.nameKey||""})),u=e[a.name]?.map(l=>p(l,i));r[a.name]=u;break}case c.EXTRA:{let i=a;if(i.includeValueToApi!==!1){let u=e[i.name],l=i?.transformValueToAPI||T[i.inputType]?.transformValueToAPI;if(l){r[i.name]=l(a)(u);break}r[i.name]=u;break}r[i.name]=void 0;break}default:{let i=e[a.name],u=a?.transformValueToAPI||T[a.inputType]?.transformValueToAPI;if(u){r[a.name]=u(a)(i);break}r[a.name]=i;break}}return a.forcedValue!==void 0&&(r[a.name]=a.forcedValue),r},{...e})}o(p,"parseFormValuesToAPI");function O(e,n){return e.visibilityCondition?e.visibilityCondition(n):typeof e.isVisible<"u"?!!e.isVisible:!0}o(O,"isFieldVisible");function F(e,n){return e.calculateDynamicProperties?{...e,...e.calculateDynamicProperties(n)||{}}:e}o(F,"applyFieldDynamicProperties");function b(e,n,t,s){let r={};return n.map(a=>F(a,e)).forEach(a=>{let i=a.name;s&&(i=i?`${s}.${a.name}`:s);let u=V(e,i);if(!(!O(a,e)&&!(t&&u))&&!a.meta?.ignoreValue)if(a.inputType==="fieldset"&&a.valueGroupingDisabled)Object.assign(r,b(e,a.fields,t,i));else if(Array.isArray(a.fields))r[a.name]=b(e,a.fields,t,i);else{if(u===void 0)return;r[a.name]=u}}),r}o(b,"excludeValuesInvisible");function M(e){return Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""))}o(M,"removeEmptyValues");function E(e){return Array.isArray(e)?e.map(E):e&&typeof e=="object"?Object.entries(e).reduce((n,[t,s])=>(t.startsWith("_")||(n[t]=E(s)),n),{}):e}o(E,"cleanUnderscoreFields");function G(e,n,t){let s=t?.keepInvisibleValues?e:b(e,n),r=p(s,n),a=g(r),i=M(a),u=I(i,n);return E(u)}o(G,"parseSubmitValues");function v(e,n,t={isPartialValidation:!1}){return G(e,n,{keepInvisibleValues:t?.isPartialValidation})}o(v,"parseJSFToValidate");function U(e){switch(e){case c.FILE:return;default:return""}}o(U,"getDefaultValueForType");function S(e,n){let t=V(e,n.name),s=n?.transformValueFromAPI||T[n.inputType]?.transformValueFromAPI;if(s)return s(n)(t);let r=typeof n.value=="function"?n.value(t,e):null,a=typeof n.value!="function"?n.value:null,i=n.checkboxValue===!0?t||!1:null,u=o(l=>l===""?void 0:l,"excludeString");return u(r)??u(t)??u(a)??u(n.default)??i??U(n.inputType)}o(S,"getInitialDefaultValue");function k(e,n,t){let s={},r=e.name;t&&(r=r?`${t}.${r}`:t);let a=e.fields;if(Array.isArray(a)){let i={};a.forEach(u=>{Object.assign(i,k(u,n,r))}),e.inputType===c.FIELDSET&&e.valueGroupingDisabled?Object.assign(s,i):s[e.name]=i}else s[e.name]=S(n,{...e,name:r});return s}o(k,"getInitialSubFieldValues");function B(e,n){let t={},s=n;return e.map(r=>F(r,s)).forEach(r=>{switch(r.inputType){case c.FIELDSET:{if(r.valueGroupingDisabled)Object.assign(t,B(r.fields,s));else{let a=k(r,s);Object.assign(t,a)}break}default:{t[r.name]||(t[r.name]=S(s,r));break}}}),t}o(B,"getInitialValues");function X({fields:e=[],fieldsets:n={},values:t}){let s=Object.keys(n);if(!s?.length)return e;let r=new Set(s.flatMap(l=>n[l]?.propertiesByName??[]));return s.map(l=>{let{propertiesByName:d=[],...f}=n[l],y=d.map(m=>e.find(N=>N.name===m)).filter(m=>!!m);return{...f,name:l,type:"fieldset-flat",inputType:"fieldset-flat",fields:y,label:n[l].title,isVisible:y.map(m=>F(m,t)).some(m=>O(m,t))}}).reduce((l,d)=>{let f=[...l],y=d.fields[0]?l.findIndex(m=>m.name===d.fields[0].name):l.length;return f.splice(y,0,d),f},e).filter(l=>!r.has(l.name))}o(X,"getFieldsWithFlatFieldsets");function H(e,n){let t=n;return e.forEach(s=>{"const"in s&&(t=Object.fromEntries(Object.entries(n).map(([r,a])=>r===s.name?[r,s.const]:[r,a])))}),t}o(H,"enableAckFields");function $(e){let n=new Date;n.setDate(n.getUTCDate()),n.setHours(0,0,0,0);let t=P(n,e+1);return x(t)?h(t):t}o($,"getMinStartDate");export{C as a,j as b,v as c,B as d,X as e,H as f,$ as g};
2
+ //# sourceMappingURL=chunk-WXUIXZ7P.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/form/utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Field } from '@/src/flows/types';\nimport { $TSFixMe, Fields } from '@remoteoss/json-schema-form';\nimport { addBusinessDays, isWeekend, nextMonday } from 'date-fns';\nimport get from 'lodash.get';\n\nconst textInputTypes = {\n TEXT: 'text',\n TEXTAREA: 'textarea',\n NUMBER: 'number',\n SELECT: 'select',\n COUNTRIES: 'countries',\n TEL: 'tel',\n EMAIL: 'email',\n MONEY: 'money',\n DATE: 'date',\n DATE_RANGE: 'date-range',\n CURRENCIES: 'currencies',\n TIME: 'time',\n} as const;\n\nconst checkboxTypes = {\n CHECKBOX: 'checkbox',\n ACK_CHECK: 'ack-check',\n} as const;\n\nconst supportedTypes = {\n FILE: 'file',\n RADIO: 'radio',\n /** @deprecated */\n RADIO_CARD: 'radio-card',\n GROUP_ARRAY: 'group-array',\n EXTRA: 'extra',\n STATEMENT: 'statement',\n HIDDEN: 'hidden',\n FIELDSET: 'fieldset',\n FIELDSET_FLAT: 'fieldset-flat',\n WORK_SCHEDULE: 'work-schedule',\n WORK_WEEK_SCHEDULE: 'work-week-schedule',\n /** @deprecated we still display benefits in read-only contract details view, but never in any form */\n BENEFITS: 'benefits',\n SIGNATURE: 'signature',\n SELECT_MULTIPLE: 'select-multiple',\n ...textInputTypes,\n ...checkboxTypes,\n} as const;\n\nfunction round(value: number): number {\n return Math.round((value + Number.EPSILON) * 100) / 100;\n}\n\nfunction convertToValidCost(value: string) {\n return parseFloat(value.replace(/,/g, ''));\n}\n\nexport function convertToCents(\n amount?: number | string | string[] | null | boolean,\n) {\n if (\n amount == null ||\n amount === '' ||\n Number.isNaN(amount) ||\n Array.isArray(amount) ||\n typeof amount === 'boolean'\n ) {\n return null;\n }\n\n let validAmount: number;\n\n if (typeof amount === 'string') {\n validAmount = convertToValidCost(amount);\n } else {\n validAmount = amount;\n }\n\n return round(validAmount * 100);\n}\n\nexport function convertFromCents(amount?: number | string | null) {\n if (amount == null || Number.isNaN(amount)) return null;\n\n let normalizedValue: number;\n\n if (typeof amount === 'string') {\n normalizedValue = convertToValidCost(amount || '0');\n } else {\n normalizedValue = amount;\n }\n\n return round(normalizedValue / 100);\n}\n\nconst trimStringValues = (values: Record<string, any>) =>\n Object.entries(values || {}).reduce<Record<string, any>>(\n (result, [key, value]) => {\n if (Array.isArray(value)) {\n // If the value is an array, recursively process each element\n result[key] = value.map((item) =>\n typeof item === 'object' && item !== null\n ? trimStringValues(item)\n : typeof item === 'string'\n ? item.trim()\n : item,\n );\n } else if (typeof value === 'object' && value !== null) {\n // If the value is an object, recursively process it\n result[key] = trimStringValues(value);\n } else {\n // Otherwise, trim the string or keep the value as is\n result[key] = typeof value === 'string' ? value.trim() : value;\n }\n return result;\n },\n {},\n );\n\n/**\n * Given a list of form values, modify the ones that are readOnly,\n * based on their field config, by adding its defaultValue.\n * This is needed to support readOnly fields that are also conditional\n * based on the \"pivotName\" workaround.\n * @param {Object} values - List with form values { name: value }.\n * @param {Array} fields - Respective form fields configuration.\n */\nfunction prefillReadOnlyFields(values: Record<string, any>, fields: any[]) {\n const newValues: Record<string, any> = {};\n\n fields.forEach((field) => {\n const fieldName = field.name;\n\n if (\n !Object.prototype.hasOwnProperty.call(values, fieldName!) &&\n !(\n field.inputType === supportedTypes.FIELDSET &&\n field.valueGroupingDisabled\n )\n )\n return;\n\n if (\n field.inputType === supportedTypes.FIELDSET &&\n field.valueGroupingDisabled\n ) {\n Object.assign(newValues, prefillReadOnlyFields(values, field.fields));\n return;\n }\n\n if (field.readOnly && field.defaultValue) {\n newValues[fieldName!] = field.defaultValue;\n } else {\n newValues[fieldName!] = values[fieldName!];\n }\n });\n\n return newValues;\n}\n/**\n * Recursively extracts fieldsets' fields values and maps them to the field name\n * For nested fields that are fieldsets with valueGroupingDisabled, the values\n * are extracted one level up\n *\n * @param {Array} fields - Fieldset fields configuration.\n * @param {Object} formValues - List with form values { name: value }.\n * @return {Object} – Raw form values mapped to the field name\n */\nfunction extractFieldsetFieldsValues(\n fields: any[],\n formValues: Record<string, unknown>,\n) {\n return fields.reduce<Record<string, any>>((nestedAcc, subField) => {\n const isFieldsetValueGroupingDisabled =\n subField.inputType === supportedTypes.FIELDSET &&\n subField.valueGroupingDisabled;\n\n if (isFieldsetValueGroupingDisabled) {\n Object.assign(\n nestedAcc,\n extractFieldsetFieldsValues(subField.fields, formValues),\n );\n } else if (\n Object.prototype.hasOwnProperty.call(formValues, subField.name!)\n ) {\n nestedAcc[subField.name!] = formValues[subField.name!];\n }\n\n return nestedAcc;\n }, {});\n}\n\nexport const fieldTypesTransformations: Record<string, any> = {\n [supportedTypes.COUNTRIES]: {\n /**\n * @param {String[] | { name: String }[]} value\n * - Excepted: array of strings.\n * - Edge cases: array of objects. (when using dangerousTransformValue)\n * @returns {String[]} - List of countries\n * @example expected: ['Peru', 'Germany'] -> ['Peru', 'Germany']\n * @example edge cases: [{name: 'Peru'}, {name: 'Germany'}] -> ['Peru', 'Germany']\n */\n transformValueToAPI:\n (field: any) => (selectedCountries: string[] | { name: string }[]) => {\n if (!field.multiple || typeof selectedCountries === 'string') {\n return selectedCountries;\n }\n // NOTE: The value should be an array of strings, however legacy data can come as\n // an array of country objects. So, we always send an array of strings to normalize\n // the data (eg old form values being modified) until DB migration is done !5667\n return selectedCountries.map((option) =>\n typeof option === 'string' ? option : option.name,\n );\n },\n /**\n * Used for react-select, where the country selected is transformed\n * before saving on Formik state. Supports both solo and multi select\n * @param {Object|Object[]} selectedCountry[] - Current selected options\n * @param {String} selectedCountry[].value\n * @param {String} selectedCountry[].name\n * @param {String} selectedCountry[].label\n * @returns {String[]} - List of countries selected\n * @example\n * [{ value: 'Hungria' }] -> ['Hungria']\n */\n transformValue: (selectedCountry: any | any[]) => {\n // name or label are used in dragon. value is used in json-schema-form\n // TODO: it should be the same everywhere — read more at !5667\n const getCountryValue = (opt: any) =>\n opt?.name || opt?.value || opt?.label;\n return Array.isArray(selectedCountry)\n ? selectedCountry.map(getCountryValue) // support multi countries\n : getCountryValue(selectedCountry) || ''; // Fallback to '' in case user removes all countries\n },\n },\n [supportedTypes.NUMBER]: {\n transformValueToAPI: () => (value: string) => {\n // this prevents values with letters such as \"2r\" from being considered valid\n // if the input is invalid, number().cast will return NaN\n const castValue = Number(value);\n\n if (Number.isNaN(castValue)) {\n return value;\n }\n\n return castValue;\n },\n },\n [supportedTypes.MONEY]: {\n transformValueFromAPI: () => (value: string | number) =>\n convertFromCents(value) ?? '',\n transformValueToAPI: () => convertToCents,\n },\n [supportedTypes.RADIO]: {\n transformValueToAPI: (field: any) => (value: string) => {\n if (field.transformToBool) {\n return value === 'yes';\n }\n return value;\n },\n },\n [supportedTypes.CHECKBOX]: {\n transformValueToAPI: (field: any) => (value: string | boolean) => {\n if (value === undefined) {\n return false;\n }\n\n if (field.const && value === true) {\n return field.const;\n }\n return value;\n },\n },\n [supportedTypes.SELECT]: {\n /**\n * Used for react-select, where the value is transformed\n * before saving on Formik state.\n * @param {Object | Object[]} option - Object structure with options config\n * @param {String} option[].value - Key for the API\n * @param {Array} this.options[].label - Friendly label\n * @example\n * [{ value: '1', label: 'One' }, { value: '2', label: 'Two' }] -> [\"One\", \"Two\"]\n * { value: '1', label: 'One' } -> \"One\"\n * {} -> \"\"\n */\n transformValue: (option: any | any[]) =>\n Array.isArray(option)\n ? option.map((opt) => opt.value) // multi-options\n : (option?.value ?? ''), // Fallback to '' in case user removes all options,\n },\n};\n\nexport function parseFormValuesToAPI(\n formValues: Record<string, any> = {},\n fields: any[],\n) {\n const filteredFields = fields.filter(\n (field) =>\n formValues[field.name!] ||\n (field.inputType === supportedTypes.FIELDSET &&\n field.valueGroupingDisabled),\n );\n\n const parsedFormValues = filteredFields.reduce(\n (acc, field) => {\n switch (field.inputType) {\n case supportedTypes.FIELDSET: {\n const fieldset = field;\n if (fieldset.valueGroupingDisabled) {\n const nestedFormValues = extractFieldsetFieldsValues(\n fieldset.fields,\n formValues,\n );\n\n Object.assign(\n acc,\n parseFormValuesToAPI(nestedFormValues, fieldset.fields),\n );\n } else {\n const fieldsetValue = formValues[field.name!];\n\n // Filter out empty properties from fieldset objects\n // this code avoids sending department: {id: '1234', name: ''} or even department: {id: undefined, name: undefined}\n if (\n fieldsetValue &&\n typeof fieldsetValue === 'object' &&\n !Array.isArray(fieldsetValue)\n ) {\n const cleanedValue = Object.fromEntries(\n Object.entries(fieldsetValue).filter(([, value]) => {\n // Keep the property if it has a meaningful value\n return value !== '' && value !== null && value !== undefined;\n }),\n );\n\n acc[field.name!] =\n Object.keys(cleanedValue).length > 0\n ? parseFormValuesToAPI(cleanedValue, fieldset.fields)\n : undefined;\n } else {\n acc[field.name!] = parseFormValuesToAPI(\n fieldsetValue,\n fieldset.fields,\n );\n }\n }\n break;\n }\n\n case supportedTypes.TEXTAREA:\n case supportedTypes.TEXT: {\n // Attempt to remove null bytes from form values - https://gitlab.com/remote-com/employ-starbase/tracker/-/issues/10670\n acc[field.name] = formValues[field.name].replace(/\\0/g, '');\n break;\n }\n\n case supportedTypes.GROUP_ARRAY: {\n // NOTE: The field `name` in group arrays represents a path, but we only\n // need the last part of it which is represented by `nameKey`.\n\n const transformedFields = field?.fields?.().map((subField: any) => ({\n ...subField,\n name: subField.nameKey || '',\n }));\n\n // Null check necessary for case where no fields are set due to optional check\n const parsedFieldValues = formValues[field.name]?.map(\n (fieldValues: Record<string, any>) =>\n parseFormValuesToAPI(fieldValues, transformedFields),\n );\n\n acc[field.name] = parsedFieldValues;\n break;\n }\n case supportedTypes.EXTRA: {\n const extraField = field;\n if (extraField.includeValueToApi !== false) {\n const formValue = formValues[extraField.name];\n const fieldTransformValueToAPI =\n extraField?.transformValueToAPI ||\n fieldTypesTransformations[extraField.inputType]\n ?.transformValueToAPI;\n\n // logErrorOnMissingComplimentaryParams(field);\n\n if (fieldTransformValueToAPI) {\n acc[extraField.name] = fieldTransformValueToAPI(field)(formValue);\n break;\n }\n\n acc[extraField.name] = formValue;\n break;\n }\n acc[extraField.name] = undefined;\n break;\n }\n default: {\n const formValue = formValues[field.name];\n const fieldTransformValueToAPI =\n field?.transformValueToAPI ||\n fieldTypesTransformations[field.inputType]?.transformValueToAPI;\n // logErrorOnMissingComplimentaryParams(field);\n if (fieldTransformValueToAPI) {\n acc[field.name] = fieldTransformValueToAPI(field)(formValue);\n break;\n }\n acc[field.name] = formValue;\n break;\n }\n }\n\n // this occurs when const === default in a JSON Schema for a given field.\n // without this, values such as money types won't use the correct value.\n if (field.forcedValue !== undefined) {\n acc[field.name!] = field.forcedValue;\n }\n\n return acc;\n },\n { ...formValues },\n );\n\n return parsedFormValues;\n}\n\nfunction isFieldVisible(field: any, formValues: Record<string, unknown>) {\n if (field.visibilityCondition) {\n return field.visibilityCondition(formValues);\n }\n\n if (typeof field.isVisible !== 'undefined') {\n return Boolean(field.isVisible);\n }\n\n return true;\n}\n\nfunction applyFieldDynamicProperties(\n field: any,\n values: Record<string, unknown> | Record<string, unknown>[],\n) {\n if (field.calculateDynamicProperties) {\n return {\n ...field,\n ...(field.calculateDynamicProperties(values) || {}),\n };\n }\n\n return field;\n}\n\nfunction excludeValuesInvisible(\n values: any,\n fields: any[],\n keepTruthyInvisibleValues?: boolean,\n parentFieldKeyPath?: string,\n) {\n const valuesAsked: Record<string, any> = {};\n\n fields\n .map((field) => applyFieldDynamicProperties(field, values))\n .forEach((field) => {\n let fieldKeyPath = field.name;\n if (parentFieldKeyPath) {\n fieldKeyPath = fieldKeyPath\n ? `${parentFieldKeyPath}.${field.name}`\n : parentFieldKeyPath;\n }\n\n const valueOfField = get(values, fieldKeyPath!);\n\n // keepTruthyInvisibleValues: false/undefined -> remove invisible field\n // keepTruthyInvisibleValues: true -> keep invisible field if it has a value\n if (\n !isFieldVisible(field, values) &&\n !(keepTruthyInvisibleValues && !!valueOfField)\n ) {\n return;\n }\n\n if (field.meta?.ignoreValue) {\n return;\n }\n\n if (field.inputType === 'fieldset' && field.valueGroupingDisabled) {\n Object.assign(\n valuesAsked,\n excludeValuesInvisible(\n values,\n field.fields,\n keepTruthyInvisibleValues,\n fieldKeyPath,\n ),\n );\n } else if (Array.isArray(field.fields)) {\n valuesAsked[field.name!] = excludeValuesInvisible(\n values,\n field.fields,\n keepTruthyInvisibleValues,\n fieldKeyPath,\n );\n } else {\n if (valueOfField === undefined) {\n return;\n }\n valuesAsked[field.name!] = valueOfField;\n }\n });\n\n return valuesAsked;\n}\n\nfunction removeEmptyValues<T extends Record<string, any>>(\n obj: T,\n): Record<string, any> {\n return Object.fromEntries(\n Object.entries(obj).filter(\n ([, value]) => value !== undefined && value !== null && value !== '',\n ),\n );\n}\n\nfunction cleanUnderscoreFields(obj: Record<string, any>): Record<string, any> {\n if (Array.isArray(obj)) {\n return obj.map(cleanUnderscoreFields);\n }\n if (obj && typeof obj === 'object') {\n return Object.entries(obj).reduce(\n (acc, [key, value]) => {\n if (!key.startsWith('_')) {\n acc[key] = cleanUnderscoreFields(value);\n }\n return acc;\n },\n {} as Record<string, any>,\n );\n }\n return obj;\n}\n\nexport function parseSubmitValues(\n formValues: Record<string, any>,\n fields: any[],\n config?: { keepInvisibleValues?: boolean },\n) {\n const visibleFormValues = config?.keepInvisibleValues\n ? formValues\n : excludeValuesInvisible(formValues, fields);\n const convertedFormValues = parseFormValuesToAPI(visibleFormValues, fields);\n const formValuesWithTrimmedStrings = trimStringValues(convertedFormValues);\n\n const formValuesWithUndefined = removeEmptyValues(\n formValuesWithTrimmedStrings,\n );\n\n const valuesWithReadOnly = prefillReadOnlyFields(\n formValuesWithUndefined,\n fields,\n );\n return cleanUnderscoreFields(valuesWithReadOnly);\n}\n\nexport function parseJSFToValidate(\n formValues: Record<string, any>,\n fields: Fields,\n config: { isPartialValidation: boolean } = {\n isPartialValidation: false,\n },\n) {\n const valuesParsed = parseSubmitValues(formValues, fields, {\n /* We cannot exclude invisible fields (excludeValuesInvisible) because\n they are needed for conditional fields validations */\n keepInvisibleValues: config?.isPartialValidation,\n });\n return valuesParsed;\n}\n\nfunction castFieldTo<T>(field: Field) {\n return field as unknown as T;\n}\n\nfunction getDefaultValueForType(type: string) {\n switch (type) {\n case supportedTypes.FILE:\n return undefined; // Allows fallback values in function declarations to be used\n default:\n return '';\n }\n}\n\nfunction getInitialDefaultValue(\n defaultValues: Record<string, any>,\n field: Field,\n) {\n // lodash get is needed because some values could be nested object, like billing address\n // use camelCase to support forms with fields in snake_case or kebab_case.\n const defaultFieldValue = get(defaultValues, field.name);\n const fieldTransformValueFromAPI =\n field?.transformValueFromAPI ||\n fieldTypesTransformations[field.inputType]?.transformValueFromAPI;\n\n if (fieldTransformValueFromAPI) {\n return fieldTransformValueFromAPI(field)(defaultFieldValue);\n }\n\n // TODO: We need to get rid of value as fn for json-schema. Related !5560\n const generatedValue =\n typeof field.value === 'function'\n ? field.value(defaultFieldValue, defaultValues)\n : null;\n\n // field.value is deprecated. should use \"default\" instead.\n const defaultValueDeprecated =\n typeof field.value !== 'function' ? field.value : null;\n const initialValueForCheckboxAsBool =\n castFieldTo<$TSFixMe>(field).checkboxValue === true\n ? defaultFieldValue || false\n : null;\n\n // nullish coalescing but excluding empty strings. (to support 0 (zero) as valid numbers)\n const excludeString = (val: any) => (val === '' ? undefined : val);\n\n return (\n excludeString(generatedValue) ??\n excludeString(defaultFieldValue) ??\n excludeString(defaultValueDeprecated) ??\n excludeString(field.default) ??\n initialValueForCheckboxAsBool ??\n getDefaultValueForType(field.inputType)\n );\n}\n\n/**\n * Get initial values for sub fields within fieldsets\n * @param {Object} field The form field\n * @param {Object} defaultValues The form default values\n * @param {String=} parentFieldKeyPath The path to the parent field using dot-notation\n * @returns {Object} The initial values for a fieldset\n */\nfunction getInitialSubFieldValues(\n field: $TSFixMe,\n defaultValues: Record<string, unknown>,\n parentFieldKeyPath?: string,\n) {\n const initialValue: Record<string, Record<string, unknown>> = {};\n\n let fieldKeyPath = field.name;\n\n if (parentFieldKeyPath) {\n fieldKeyPath = fieldKeyPath\n ? `${parentFieldKeyPath}.${fieldKeyPath}`\n : parentFieldKeyPath;\n }\n\n const subFields = field.fields;\n\n if (Array.isArray(subFields)) {\n const subFieldValues = {};\n\n subFields.forEach((subField) => {\n Object.assign(\n subFieldValues,\n getInitialSubFieldValues(subField, defaultValues, fieldKeyPath),\n );\n });\n\n if (\n field.inputType === supportedTypes.FIELDSET &&\n field.valueGroupingDisabled\n ) {\n Object.assign(initialValue, subFieldValues);\n } else {\n initialValue[field.name!] = subFieldValues;\n }\n } else {\n initialValue[field.name!] = getInitialDefaultValue(defaultValues, {\n ...field,\n // NOTE: To utilize the `get` function from `lodash` in `getInitialDefaultValue` correctly\n // we need to use the field path instead of just its name.\n name: fieldKeyPath,\n });\n }\n\n return initialValue;\n}\n\nexport function getInitialValues(\n fields: Fields,\n defaultValues: Record<string, unknown>,\n) {\n const initialValues: Record<string, unknown> = {};\n const defaultFieldValues = defaultValues;\n\n // loop over fields array\n // if prop does not exit in the initialValues object,\n // pluck off the name and value props and add it to the initialValues object;\n fields\n .map((field) => applyFieldDynamicProperties(field, defaultFieldValues))\n .forEach((field) => {\n switch (field.inputType) {\n case supportedTypes.FIELDSET: {\n if (field.valueGroupingDisabled) {\n Object.assign(\n initialValues,\n getInitialValues(field.fields, defaultFieldValues),\n );\n } else {\n const subFieldValues = getInitialSubFieldValues(\n field,\n defaultFieldValues,\n );\n Object.assign(initialValues, subFieldValues);\n }\n break;\n }\n default: {\n if (!initialValues[field.name]) {\n initialValues[field.name] = getInitialDefaultValue(\n defaultFieldValues,\n field,\n );\n }\n break;\n }\n }\n });\n\n return initialValues;\n}\n\n/**\n * Wraps fields listed in fieldsets with a fieldset field.\n * @param fields - Complete fields list.\n * @param fieldsets - fields list to be wrapped in a fieldset field.\n * @param values - Values for each field.\n * @returns The fields with the fieldsets wrapped.\n */\nexport function getFieldsWithFlatFieldsets({\n fields = [],\n fieldsets = {},\n values,\n}: {\n fields: any[];\n fieldsets: Record<string, { propertiesByName: string[]; title: string }>;\n values: Record<string, unknown>;\n}) {\n const flatFieldsetsKeys = Object.keys(fieldsets);\n\n if (!flatFieldsetsKeys?.length) {\n return fields;\n }\n\n const flatFieldsetsFieldNames = new Set(\n flatFieldsetsKeys.flatMap(\n (flatFieldsetKey) => fieldsets[flatFieldsetKey]?.propertiesByName ?? [],\n ),\n );\n\n const flatFieldsetsWithFields = flatFieldsetsKeys.map((flatFieldsetKey) => {\n const { propertiesByName: flatFieldsetFields = [], ...rest } =\n fieldsets[flatFieldsetKey];\n\n const childFields = flatFieldsetFields\n .map((name) => fields.find((f) => f.name === name))\n .filter((field): field is any => !!field);\n\n return {\n ...rest,\n name: flatFieldsetKey,\n type: 'fieldset-flat',\n inputType: 'fieldset-flat',\n fields: childFields,\n label: fieldsets[flatFieldsetKey].title,\n // Hide the fieldset if none of the children fields are visible.\n isVisible: childFields\n .map((childField) => applyFieldDynamicProperties(childField, values))\n .some((childField) => isFieldVisible(childField, values)),\n };\n });\n\n const sortedFields = flatFieldsetsWithFields.reduce((accumulator, field) => {\n const accumulatedFieldsSorted = [...accumulator];\n\n /**\n * We place the flat fieldset at the original position of its first field.\n * If no field is found, we move it to the end.\n */\n const fieldsetPosition = field.fields[0]\n ? accumulator.findIndex(\n (accumulatorItem) => accumulatorItem.name === field.fields[0].name,\n )\n : accumulator.length;\n\n accumulatedFieldsSorted.splice(\n fieldsetPosition,\n 0,\n field as unknown as any,\n );\n\n return accumulatedFieldsSorted;\n }, fields);\n\n const filteredFields = sortedFields.filter(\n (field) => !flatFieldsetsFieldNames.has(field.name!),\n );\n\n return filteredFields;\n}\n\nexport function enableAckFields(\n fields: Fields,\n values: Record<string, unknown>,\n) {\n let result = values;\n fields.forEach((field) => {\n if ('const' in field) {\n result = Object.fromEntries(\n Object.entries(values).map(([k, v]) => {\n if (k === field.name) {\n return [k, field.const];\n }\n return [k, v];\n }),\n );\n }\n });\n return result;\n}\n\n/**\n * Get the minimum start date for the onboarding process.\n * @param minOnBoardingTime\n * @returns Date\n */\nexport function getMinStartDate(minOnBoardingTime: number) {\n const today = new Date();\n\n // Make sure our base date is UTC and set the time to 00:00:00\n today.setDate(today.getUTCDate());\n today.setHours(0, 0, 0, 0);\n\n // The + 1 ensures you get the full preparation time before the employee can actually start working.\n // It's the difference between \"preparation completes on this day\" vs \"earliest possible start date after preparation\".\n const minDate = addBusinessDays(today, minOnBoardingTime + 1);\n return isWeekend(minDate) ? nextMonday(minDate) : minDate;\n}\n"],"mappings":"wCAGA,OAAS,mBAAAA,EAAiB,aAAAC,EAAW,cAAAC,MAAkB,WACvD,OAAOC,MAAS,aAEhB,IAAMC,EAAiB,CACrB,KAAM,OACN,SAAU,WACV,OAAQ,SACR,OAAQ,SACR,UAAW,YACX,IAAK,MACL,MAAO,QACP,MAAO,QACP,KAAM,OACN,WAAY,aACZ,WAAY,aACZ,KAAM,MACR,EAEMC,EAAgB,CACpB,SAAU,WACV,UAAW,WACb,EAEMC,EAAiB,CACrB,KAAM,OACN,MAAO,QAEP,WAAY,aACZ,YAAa,cACb,MAAO,QACP,UAAW,YACX,OAAQ,SACR,SAAU,WACV,cAAe,gBACf,cAAe,gBACf,mBAAoB,qBAEpB,SAAU,WACV,UAAW,YACX,gBAAiB,kBACjB,GAAGF,EACH,GAAGC,CACL,EAEA,SAASE,EAAMC,EAAuB,CACpC,OAAO,KAAK,OAAOA,EAAQ,OAAO,SAAW,GAAG,EAAI,GACtD,CAFSC,EAAAF,EAAA,SAIT,SAASG,EAAmBF,EAAe,CACzC,OAAO,WAAWA,EAAM,QAAQ,KAAM,EAAE,CAAC,CAC3C,CAFSC,EAAAC,EAAA,sBAIF,SAASC,EACdC,EACA,CACA,GACEA,GAAU,MACVA,IAAW,IACX,OAAO,MAAMA,CAAM,GACnB,MAAM,QAAQA,CAAM,GACpB,OAAOA,GAAW,UAElB,OAAO,KAGT,IAAIC,EAEJ,OAAI,OAAOD,GAAW,SACpBC,EAAcH,EAAmBE,CAAM,EAEvCC,EAAcD,EAGTL,EAAMM,EAAc,GAAG,CAChC,CAtBgBJ,EAAAE,EAAA,kBAwBT,SAASG,EAAiBF,EAAiC,CAChE,GAAIA,GAAU,MAAQ,OAAO,MAAMA,CAAM,EAAG,OAAO,KAEnD,IAAIG,EAEJ,OAAI,OAAOH,GAAW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IAAMC,EAAQ,IAAI,KAGlBA,EAAM,QAAQA,EAAM,WAAW,CAAC,EAChCA,EAAM,SAAS,EAAG,EAAG,EAAG,CAAC,EAIzB,IAAMC,EAAUC,EAAgBF,EAAOD,EAAoB,CAAC,EAC5D,OAAOI,EAAUF,CAAO,EAAIG,EAAWH,CAAO,EAAIA,CACpD,CAXgBjD,EAAA8C,EAAA","names":["addBusinessDays","isWeekend","nextMonday","get","textInputTypes","checkboxTypes","supportedTypes","round","value","__name","convertToValidCost","convertToCents","amount","validAmount","convertFromCents","normalizedValue","trimStringValues","values","result","key","item","prefillReadOnlyFields","fields","newValues","field","fieldName","extractFieldsetFieldsValues","formValues","nestedAcc","subField","fieldTypesTransformations","selectedCountries","option","selectedCountry","getCountryValue","opt","castValue","parseFormValuesToAPI","acc","fieldset","nestedFormValues","fieldsetValue","cleanedValue","transformedFields","parsedFieldValues","fieldValues","extraField","formValue","fieldTransformValueToAPI","isFieldVisible","applyFieldDynamicProperties","excludeValuesInvisible","keepTruthyInvisibleValues","parentFieldKeyPath","valuesAsked","fieldKeyPath","valueOfField","get","removeEmptyValues","obj","cleanUnderscoreFields","parseSubmitValues","config","visibleFormValues","convertedFormValues","formValuesWithTrimmedStrings","formValuesWithUndefined","valuesWithReadOnly","parseJSFToValidate","getDefaultValueForType","type","supportedTypes","__name","getInitialDefaultValue","defaultValues","field","defaultFieldValue","get","fieldTransformValueFromAPI","fieldTypesTransformations","generatedValue","defaultValueDeprecated","initialValueForCheckboxAsBool","excludeString","val","getInitialSubFieldValues","parentFieldKeyPath","initialValue","fieldKeyPath","subFields","subFieldValues","subField","getInitialValues","fields","initialValues","defaultFieldValues","applyFieldDynamicProperties","getFieldsWithFlatFieldsets","fieldsets","values","flatFieldsetsKeys","flatFieldsetsFieldNames","flatFieldsetKey","flatFieldsetFields","rest","childFields","name","f","childField","isFieldVisible","accumulator","accumulatedFieldsSorted","fieldsetPosition","accumulatorItem","enableAckFields","result","k","v","getMinStartDate","minOnBoardingTime","today","minDate","addBusinessDays","isWeekend","nextMonday"]}
@@ -1,2 +1,2 @@
1
- import{a as i}from"./chunk-GTWY3JK3.js";import{a as c}from"./chunk-Z7WBY27D.js";import{a as S}from"./chunk-DYXTJBSK.js";import{a as f}from"./chunk-ZF6MZYBK.js";import{a as n}from"./chunk-PEOWIEYM.js";import{a as p}from"./chunk-KVAGMBSU.js";import{a as s}from"./chunk-YP7Q47E2.js";import{a as m}from"./chunk-EVSDVI2G.js";import{a}from"./chunk-5ORIDYIK.js";import{a as r}from"./chunk-PGWKJ6FK.js";import{a as e}from"./chunk-LJYCBMDS.js";import{a as t}from"./chunk-P37U34EQ.js";import{useId as D,useState as P}from"react";import{jsx as R}from"react/jsx-runtime";var L=t(({employmentId:d,companyId:u,countryCode:b,type:l="employee",externalId:v,skipSteps:g,initialValues:B,render:I,options:O})=>{let w=D(),o=e({companyId:u,countryCode:b,employmentId:d,type:l,options:O,skipSteps:g,externalId:v,initialValues:B}),[C,h]=P({showReserveInvoice:!1,showInviteSuccessful:!1});return R(r.Provider,{value:{formId:w,onboardingBag:o,creditScore:C,setCreditScore:h},children:I({onboardingBag:o,components:{BasicInformationStep:n,ContractDetailsStep:s,BenefitsStep:p,SubmitButton:i,SaveDraftButton:S,BackButton:m,OnboardingInvite:a,SelectCountryStep:f,ReviewStep:c}})})},"OnboardingFlow");export{L as a};
2
- //# sourceMappingURL=chunk-HTJZUAVS.js.map
1
+ import{a as i}from"./chunk-OIN3HGOQ.js";import{a as c}from"./chunk-Z7WBY27D.js";import{a as S}from"./chunk-5KHLOGTR.js";import{a as f}from"./chunk-LQAHRGU4.js";import{a as n}from"./chunk-M2CI2UDK.js";import{a as p}from"./chunk-6FWFRVQE.js";import{a as s}from"./chunk-GCJCNDJ3.js";import{a as m}from"./chunk-ZQ6MG635.js";import{a}from"./chunk-L3D2AK3X.js";import{a as e}from"./chunk-GKD2WI2W.js";import{a as r}from"./chunk-PGWKJ6FK.js";import{a as t}from"./chunk-P37U34EQ.js";import{useId as D,useState as P}from"react";import{jsx as R}from"react/jsx-runtime";var L=t(({employmentId:d,companyId:u,countryCode:b,type:l="employee",externalId:v,skipSteps:g,initialValues:B,render:I,options:O})=>{let w=D(),o=e({companyId:u,countryCode:b,employmentId:d,type:l,options:O,skipSteps:g,externalId:v,initialValues:B}),[C,h]=P({showReserveInvoice:!1,showInviteSuccessful:!1});return R(r.Provider,{value:{formId:w,onboardingBag:o,creditScore:C,setCreditScore:h},children:I({onboardingBag:o,components:{BasicInformationStep:n,ContractDetailsStep:s,BenefitsStep:p,SubmitButton:i,SaveDraftButton:S,BackButton:m,OnboardingInvite:a,SelectCountryStep:f,ReviewStep:c}})})},"OnboardingFlow");export{L as a};
2
+ //# sourceMappingURL=chunk-X6CD3FMG.js.map
@@ -0,0 +1,2 @@
1
+ import{a as t}from"./chunk-P37U34EQ.js";var o={select_country:{index:0,name:"select_country"},basic_information:{index:1,name:"basic_information"},contract_details:{index:2,name:"contract_details"},benefits:{index:3,name:"benefits"},review:{index:4,name:"review"}},c={basic_information:{index:0,name:"basic_information"},contract_details:{index:1,name:"contract_details"},benefits:{index:2,name:"benefits"},review:{index:3,name:"review"}},s=["invited","created_awaiting_reserve","created_reserve_paid"],a=["created_awaiting_reserve","invited"],r=t(e=>e?{...e,form_schema:{...e.form_schema,contract_details:1}}:{form_schema:{contract_details:1}},"getContractDetailsSchemaVersion");export{o as a,c as b,s as c,a as d,r as e};
2
+ //# sourceMappingURL=chunk-XNOLBKZC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/Onboarding/utils.ts"],"sourcesContent":["import { Employment } from '@/src/flows/Onboarding/types';\nimport { FlowOptions } from '@/src/flows/types';\nimport { Step } from '@/src/flows/useStepState';\n\ntype StepKeys =\n | 'select_country'\n | 'basic_information'\n | 'contract_details'\n | 'benefits'\n | 'review';\n\nexport const STEPS: Record<StepKeys, Step<StepKeys>> = {\n select_country: {\n index: 0,\n name: 'select_country',\n },\n basic_information: { index: 1, name: 'basic_information' },\n contract_details: { index: 2, name: 'contract_details' },\n benefits: { index: 3, name: 'benefits' },\n review: { index: 4, name: 'review' },\n} as const;\n\nexport const STEPS_WITHOUT_SELECT_COUNTRY: Record<\n Exclude<StepKeys, 'select_country'>,\n Step<Exclude<StepKeys, 'select_country'>>\n> = {\n basic_information: { index: 0, name: 'basic_information' },\n contract_details: { index: 1, name: 'contract_details' },\n benefits: { index: 2, name: 'benefits' },\n review: { index: 3, name: 'review' },\n} as const;\n\n/**\n * Array of employment statuses that are allowed to proceed to the review step.\n * These statuses indicate that the employment is in a final state and the employment cannot be modified further.\n * @type {Employment['status'][]}\n * @constant\n */\nexport const reviewStepAllowedEmploymentStatus: Employment['status'][] = [\n 'invited',\n 'created_awaiting_reserve',\n 'created_reserve_paid',\n];\n\nexport const disabledInviteButtonEmploymentStatus: Employment['status'][] = [\n 'created_awaiting_reserve',\n 'invited',\n];\n\nexport const getContractDetailsSchemaVersion = (\n jsonSchemaVersion: FlowOptions['jsonSchemaVersion'],\n): FlowOptions['jsonSchemaVersion'] | undefined => {\n // returning one for all contract details schemas for now\n const countrySpecificContractDetailsVersion = 1;\n\n // TODO: We need to improve the options.jsonSchemaVersion, we need to be to pass different json_schema_versions for different countries\n const effectiveContractDetailsJsonSchemaVersion = jsonSchemaVersion\n ? {\n ...jsonSchemaVersion,\n form_schema: {\n ...jsonSchemaVersion.form_schema,\n contract_details:\n countrySpecificContractDetailsVersion ??\n jsonSchemaVersion.form_schema?.contract_details,\n },\n }\n : countrySpecificContractDetailsVersion\n ? {\n form_schema: {\n contract_details: countrySpecificContractDetailsVersion,\n },\n }\n : undefined;\n\n return effectiveContractDetailsJsonSchemaVersion;\n};\n"],"mappings":"wCAWO,IAAMA,EAA0C,CACrD,eAAgB,CACd,MAAO,EACP,KAAM,gBACR,EACA,kBAAmB,CAAE,MAAO,EAAG,KAAM,mBAAoB,EACzD,iBAAkB,CAAE,MAAO,EAAG,KAAM,kBAAmB,EACvD,SAAU,CAAE,MAAO,EAAG,KAAM,UAAW,EACvC,OAAQ,CAAE,MAAO,EAAG,KAAM,QAAS,CACrC,EAEaC,EAGT,CACF,kBAAmB,CAAE,MAAO,EAAG,KAAM,mBAAoB,EACzD,iBAAkB,CAAE,MAAO,EAAG,KAAM,kBAAmB,EACvD,SAAU,CAAE,MAAO,EAAG,KAAM,UAAW,EACvC,OAAQ,CAAE,MAAO,EAAG,KAAM,QAAS,CACrC,EAQaC,EAA4D,CACvE,UACA,2BACA,sBACF,EAEaC,EAA+D,CAC1E,2BACA,SACF,EAEaC,EAAkCC,EAC7CC,GAMkDA,EAC9C,CACE,GAAGA,EACH,YAAa,CACX,GAAGA,EAAkB,YACrB,iBACE,CAEJ,CACF,EAEE,CACE,YAAa,CACX,iBAAkB,CACpB,CACF,EAtBuC","names":["STEPS","STEPS_WITHOUT_SELECT_COUNTRY","reviewStepAllowedEmploymentStatus","disabledInviteButtonEmploymentStatus","getContractDetailsSchemaVersion","__name","jsonSchemaVersion"]}
@@ -1,2 +1,2 @@
1
- import{a as j}from"./chunk-AP56UUME.js";import{a as x}from"./chunk-R2MHAPWD.js";import{c as P}from"./chunk-3UDG4IJO.js";import{B as F,G as q,H as _,e as S,k as g,l as h}from"./chunk-2CDCTUVY.js";import{b as D}from"./chunk-Z5WMKCRJ.js";import{d as s}from"./chunk-XFJPUKYR.js";import{a as C}from"./chunk-PAQW5BFW.js";import{b as O}from"./chunk-43WMZDDH.js";import{a as e}from"./chunk-P37U34EQ.js";import{createHeadlessForm as f,modify as M}from"@remoteoss/json-schema-form";import{useMutation as b,useQuery as y}from"@tanstack/react-query";var H=e(({fieldValues:n,options:o})=>y({queryKey:["contract-document-signature"],queryFn:e(async()=>f(x,{initialValues:n}),"queryFn"),enabled:o?.queryOptions?.enabled}),"useGetContractDocumentSignatureSchema"),z=e(()=>{let{client:n}=s();return b({mutationFn:e(async({employmentId:o,contractDocumentId:t,payload:r})=>q({client:n,body:r,path:{employment_id:o,contract_document_id:t}}),"mutationFn")})},"useSignContractDocument"),A=e(({employmentId:n,contractDocumentId:o,options:t})=>{let{client:r}=s();return y({queryKey:["contract-document",n,o],queryFn:e(async()=>h({client:r,path:{employment_id:n,id:o}}),"queryFn"),enabled:t?.queryOptions?.enabled,select:e(({data:u})=>u?.data,"select")})},"useGetShowContractDocument"),V=e(({employmentId:n,options:o})=>{let{client:t}=s();return y({queryKey:["contractor-subscriptions",n],queryFn:e(async()=>g({client:t,path:{employment_id:n}}),"queryFn"),enabled:o?.queryOptions?.enabled,select:e(({data:r})=>r?.data,"select")})},"useGetContractorSubscriptions"),E=e(()=>{let{client:n}=s();return b({mutationFn:e(async({employmentId:o,payload:t})=>_({client:n,body:t,path:{employment_id:o}}),"mutationFn")})},"usePostManageContractorSubscriptions"),N=e(()=>{let{client:n}=s();return b({mutationFn:e(async({employmentId:o,payload:t})=>F({client:n,body:t,path:{employment_id:o}}),"mutationFn")})},"useCreateContractorContractDocument"),U=e(({countryCode:n,fieldValues:o,options:t})=>{let r=t?.jsonSchemaVersion?.contractor_contract_details_form_schema?{json_schema_version:t.jsonSchemaVersion.contractor_contract_details_form_schema}:{},{client:u}=s();return y({queryKey:["contractor-onboarding-details-schema",n],retry:!1,queryFn:e(async()=>S({client:u,path:{country_code:n},query:{...r}}),"queryFn"),enabled:t?.queryOptions?.enabled,select:e(({data:m})=>{let i=m?.data?.schema||{};if(t&&t.jsfModify){let{schema:c}=M(i,t.jsfModify);i=c}let a=D(i.properties||{},"money").reduce((c,p)=>(c[p]=C(o[p]),c),{}),d={...o,...a};return{meta:{"x-jsf-fieldsets":i["x-jsf-fieldsets"]},...f(i,{initialValues:d})}},"select")})},"useContractorOnboardingDetailsSchema"),W=e((n,o)=>{let{data:t,isLoading:r}=V({employmentId:n,options:{queryOptions:o?.queryOptions}}),{schema:u}=M(j.data.schema,o?.jsfModify||{}),m=f(u);if(t){let i=m.fields.find(l=>l.name==="subscription");if(i){let l=t.filter(a=>a.product.identifier!==P).map(a=>{let d="";a.price.amount&&(d=O(a.price.amount,a.currency.symbol));let c=`${a.product.name} - ${d}`,p=a.product.identifier;return{label:c,value:p}});i.options=l}}return{isLoading:r,form:m}},"useContractorSubscriptionSchemaField");export{H as a,z as b,A as c,V as d,E as e,N as f,U as g,W as h};
2
- //# sourceMappingURL=chunk-HX34JCPL.js.map
1
+ import{a as j}from"./chunk-AP56UUME.js";import{a as x}from"./chunk-R2MHAPWD.js";import{c as P}from"./chunk-3UDG4IJO.js";import{b as D}from"./chunk-Z5WMKCRJ.js";import{C as F,H as q,I as _,e as S,k as g,m as h}from"./chunk-AA7QB3QQ.js";import{d as s}from"./chunk-3ZWDIEEM.js";import{a as C}from"./chunk-WXUIXZ7P.js";import{b as O}from"./chunk-43WMZDDH.js";import{a as e}from"./chunk-P37U34EQ.js";import{createHeadlessForm as f,modify as M}from"@remoteoss/json-schema-form";import{useMutation as b,useQuery as y}from"@tanstack/react-query";var H=e(({fieldValues:n,options:o})=>y({queryKey:["contract-document-signature"],queryFn:e(async()=>f(x,{initialValues:n}),"queryFn"),enabled:o?.queryOptions?.enabled}),"useGetContractDocumentSignatureSchema"),z=e(()=>{let{client:n}=s();return b({mutationFn:e(async({employmentId:o,contractDocumentId:t,payload:r})=>q({client:n,body:r,path:{employment_id:o,contract_document_id:t}}),"mutationFn")})},"useSignContractDocument"),A=e(({employmentId:n,contractDocumentId:o,options:t})=>{let{client:r}=s();return y({queryKey:["contract-document",n,o],queryFn:e(async()=>h({client:r,path:{employment_id:n,id:o}}),"queryFn"),enabled:t?.queryOptions?.enabled,select:e(({data:u})=>u?.data,"select")})},"useGetShowContractDocument"),V=e(({employmentId:n,options:o})=>{let{client:t}=s();return y({queryKey:["contractor-subscriptions",n],queryFn:e(async()=>g({client:t,path:{employment_id:n}}),"queryFn"),enabled:o?.queryOptions?.enabled,select:e(({data:r})=>r?.data,"select")})},"useGetContractorSubscriptions"),E=e(()=>{let{client:n}=s();return b({mutationFn:e(async({employmentId:o,payload:t})=>_({client:n,body:t,path:{employment_id:o}}),"mutationFn")})},"usePostManageContractorSubscriptions"),N=e(()=>{let{client:n}=s();return b({mutationFn:e(async({employmentId:o,payload:t})=>F({client:n,body:t,path:{employment_id:o}}),"mutationFn")})},"useCreateContractorContractDocument"),U=e(({countryCode:n,fieldValues:o,options:t})=>{let r=t?.jsonSchemaVersion?.contractor_contract_details_form_schema?{json_schema_version:t.jsonSchemaVersion.contractor_contract_details_form_schema}:{},{client:u}=s();return y({queryKey:["contractor-onboarding-details-schema",n],retry:!1,queryFn:e(async()=>S({client:u,path:{country_code:n},query:{...r}}),"queryFn"),enabled:t?.queryOptions?.enabled,select:e(({data:m})=>{let i=m?.data?.schema||{};if(t&&t.jsfModify){let{schema:c}=M(i,t.jsfModify);i=c}let a=D(i.properties||{},"money").reduce((c,p)=>(c[p]=C(o[p]),c),{}),d={...o,...a};return{meta:{"x-jsf-fieldsets":i["x-jsf-fieldsets"]},...f(i,{initialValues:d})}},"select")})},"useContractorOnboardingDetailsSchema"),W=e((n,o)=>{let{data:t,isLoading:r}=V({employmentId:n,options:{queryOptions:o?.queryOptions}}),{schema:u}=M(j.data.schema,o?.jsfModify||{}),m=f(u);if(t){let i=m.fields.find(l=>l.name==="subscription");if(i){let l=t.filter(a=>a.product.identifier!==P).map(a=>{let d="";a.price.amount&&(d=O(a.price.amount,a.currency.symbol));let c=`${a.product.name} - ${d}`,p=a.product.identifier;return{label:c,value:p}});i.options=l}}return{isLoading:r,form:m}},"useContractorSubscriptionSchemaField");export{H as a,z as b,A as c,V as d,E as e,N as f,U as g,W as h};
2
+ //# sourceMappingURL=chunk-XPL5XOQ4.js.map
@@ -1,2 +1,2 @@
1
- import{A as d,E as f,h as u,n as c,s as m,x as C}from"./chunk-2CDCTUVY.js";import{d as a}from"./chunk-XFJPUKYR.js";import{a as t}from"./chunk-P37U34EQ.js";import{useMutation as r,useQuery as l}from"@tanstack/react-query";import{createHeadlessForm as g,modify as E}from"@remoteoss/json-schema-form";var x=t(({includePremiumBenefits:e})=>{let{client:i}=a();return l({queryKey:["cost-calculator-countries",e],queryFn:t(()=>m({client:i,query:{include_premium_benefits:e}}),"queryFn"),select:t(o=>o.data?.data.filter(s=>s.availability==="active").map(s=>({value:s.region_slug,label:s.name,childRegions:s.child_regions,hasAdditionalFields:s.has_additional_fields,regionSlug:s.region_slug,currency:s.currency.code})),"select")})},"useCostCalculatorCountries"),P=t(()=>{let{client:e}=a();return l({queryKey:["company-currencies"],queryFn:t(()=>f({client:e}),"queryFn"),select:t(i=>i.data?.data?.company_currencies.map(o=>({value:o.slug,label:o.code})),"select")})},"useCompanyCurrencies"),v=t(()=>{let{client:e}=a();return r({mutationFn:t(i=>u({client:e,body:i}),"mutationFn")})},"useCostCalculatorEstimation"),M=t(()=>{let{client:e}=a();return r({mutationFn:t(i=>c({client:e,body:i}),"mutationFn")})},"useCostCalculatorEstimationPdf"),S=t(()=>{let{client:e}=a();return r({mutationFn:t(i=>d({client:e,body:i}),"mutationFn")})},"useCostCalculatorEstimationCsv"),j=t((e,{includePremiumBenefits:i,options:o})=>{let{client:s}=a();return l({queryKey:["cost-calculator-region-fields",e,i],queryFn:t(()=>C({client:s,path:{slug:e},query:{include_premium_benefits:i}}),"queryFn"),enabled:!!e,select:t(({data:p})=>{let n=p?.data?.schema||{};if(o&&o.jsfModify){let{schema:y}=E(n,o.jsfModify);n=y}return g(n)},"select")})},"useRegionFields");export{x as a,P as b,v as c,M as d,S as e,j as f};
2
- //# sourceMappingURL=chunk-CHDWFMD3.js.map
1
+ import{B as d,F as f,h as u,o as c,t as m,y as C}from"./chunk-AA7QB3QQ.js";import{d as a}from"./chunk-3ZWDIEEM.js";import{a as t}from"./chunk-P37U34EQ.js";import{useMutation as r,useQuery as l}from"@tanstack/react-query";import{createHeadlessForm as g,modify as E}from"@remoteoss/json-schema-form";var x=t(({includePremiumBenefits:e})=>{let{client:i}=a();return l({queryKey:["cost-calculator-countries",e],queryFn:t(()=>m({client:i,query:{include_premium_benefits:e}}),"queryFn"),select:t(o=>o.data?.data.filter(s=>s.availability==="active").map(s=>({value:s.region_slug,label:s.name,childRegions:s.child_regions,hasAdditionalFields:s.has_additional_fields,regionSlug:s.region_slug,currency:s.currency.code})),"select")})},"useCostCalculatorCountries"),P=t(()=>{let{client:e}=a();return l({queryKey:["company-currencies"],queryFn:t(()=>f({client:e}),"queryFn"),select:t(i=>i.data?.data?.company_currencies.map(o=>({value:o.slug,label:o.code})),"select")})},"useCompanyCurrencies"),v=t(()=>{let{client:e}=a();return r({mutationFn:t(i=>u({client:e,body:i}),"mutationFn")})},"useCostCalculatorEstimation"),M=t(()=>{let{client:e}=a();return r({mutationFn:t(i=>c({client:e,body:i}),"mutationFn")})},"useCostCalculatorEstimationPdf"),S=t(()=>{let{client:e}=a();return r({mutationFn:t(i=>d({client:e,body:i}),"mutationFn")})},"useCostCalculatorEstimationCsv"),j=t((e,{includePremiumBenefits:i,options:o})=>{let{client:s}=a();return l({queryKey:["cost-calculator-region-fields",e,i],queryFn:t(()=>C({client:s,path:{slug:e},query:{include_premium_benefits:i}}),"queryFn"),enabled:!!e,select:t(({data:p})=>{let n=p?.data?.schema||{};if(o&&o.jsfModify){let{schema:y}=E(n,o.jsfModify);n=y}return g(n)},"select")})},"useRegionFields");export{x as a,P as b,v as c,M as d,S as e,j as f};
2
+ //# sourceMappingURL=chunk-XPOLXRYT.js.map
@@ -1,2 +1,2 @@
1
- import{c as et,d as nt}from"./chunk-EHS4ERDW.js";import{a as z,f as Q,h as X,k as Z}from"./chunk-7RFJWDXS.js";import{a as at,b as it,c as ct,e as st,f as lt,g as mt,h as ut}from"./chunk-HX34JCPL.js";import{a as ot,b as rt}from"./chunk-3UDG4IJO.js";import{a as dt,b as pt}from"./chunk-ZOTFS35J.js";import{a as v}from"./chunk-2YTBWEC7.js";import{a as tt}from"./chunk-PJBAQZ6G.js";import{c as f,d as C}from"./chunk-PAQW5BFW.js";import{g as P}from"./chunk-43WMZDDH.js";import{a as p}from"./chunk-P37U34EQ.js";import{useEffect as Kt,useMemo as c,useRef as Yt,useState as k}from"react";var zt={select_country:null,basic_information:"employment_basic_information",contract_details:null,pricing_plan:null,contract_preview:null,review:null},Qt={employment_basic_information:"basic_information"},me=p(({countryCode:ft,externalId:yt,employmentId:y,skipSteps:_t,options:u,initialValues:i})=>{let[a,A]=k(ft||null),[o,St]=k(y),[T,gt]=k(void 0),O=Yt({select_country:{},basic_information:{},contract_details:{},contract_preview:{},pricing_plan:{}}),bt=_t?.includes("select_country")?pt:dt,{fieldValues:h,stepState:e,setFieldValues:Ct,previousStep:ht,nextStep:Ft,goToStep:D,setStepValues:B}=tt(bt),{data:s,isLoading:I,refetch:Vt}=z(o),{status:_}=s||{},j=_&&et.includes(_),Et=_&&!nt.includes(_),wt=c(()=>_==="invited"?"invited":"not_invited",[_]),J=X(u),q=lt(),N=it(),Pt=st(),{mutateAsync:vt}=v(J),{mutateAsync:Ot}=v(q),{mutateAsync:Mt}=v(N),{mutateAsync:x}=v(Pt);y&&s?.country?.code&&!a&&A(s.country.code);let{selectCountryForm:M,isLoading:Tt}=Z({jsfModify:u?.jsfModify?.select_country,queryOptions:{enabled:e.currentStep.name==="select_country"}}),{form:U,isLoading:Dt}=ut(o,{jsonSchemaVersion:u?.jsonSchemaVersion,queryOptions:{enabled:e.currentStep.name==="pricing_plan"}}),It=zt[e.currentStep.name]||"contractor_basic_information",jt=Qt[It],Lt=s?.[jt]||{},Rt=p(({form:t,options:r={},query:g={}})=>{let b=Object.keys(h).length>0?{...i,...e.values?.[e.currentStep.name],...h}:{...i,...Lt};return Q({countryCode:a,form:t,fieldValues:b,query:g,options:{...r,queryOptions:{enabled:r.queryOptions?.enabled??!0}}})},"useJSONSchema"),kt=!!(a&&(e.currentStep.name==="basic_information"||y)),At=!!(a&&(e.currentStep.name==="contract_details"||y)),{data:l,isLoading:Bt}=Rt({form:"contractor_basic_information",options:{jsfModify:u?.jsfModify?.basic_information,queryOptions:{enabled:kt},jsonSchemaVersion:u?.jsonSchemaVersion}}),{data:m,isLoading:Jt}=mt({countryCode:a,fieldValues:h,options:{queryOptions:{enabled:At},jsfModify:u?.jsfModify?.contract_details,jsonSchemaVersion:u?.jsonSchemaVersion}}),{data:d}=at({fieldValues:h,options:{queryOptions:{enabled:e.currentStep.name==="contract_preview"}}}),{data:qt,isLoading:Nt}=ct({employmentId:o,contractDocumentId:T,options:{queryOptions:{enabled:!!T}}}),n=c(()=>({select_country:M?.fields||[],basic_information:l?.fields||[],pricing_plan:U?.fields||[],contract_details:m?.fields||[],contract_preview:d?.fields||[],review:[]}),[M?.fields,l?.fields,U?.fields,m?.fields,d?.fields]),xt={select_country:null,basic_information:l?.meta["x-jsf-fieldsets"],pricing_plan:null,contract_details:m?.meta["x-jsf-fieldsets"],contract_preview:null,review:null},{country:Ut,basic_information:H={},contract_details:S={}}=s||{},G=Ut?.code,F=c(()=>C(n.select_country,{country:a||G||""}),[n.select_country,a,G]),V=c(()=>{let t={...i,...H};return C(n.basic_information,t)},[n.basic_information,H,i]),E=c(()=>{let t={...i,...S};return C(n.contract_details,t)},[n.contract_details,S,i]),W=c(()=>{let t={...i,...S};return C(n.contract_preview,t)},[n.contract_preview,S,i]),$=c(()=>{let t={...i,...S};return C(n.pricing_plan,t?.pricing_plan??{})},[n.pricing_plan,S,i]),Ht=c(()=>({select_country:F,basic_information:V,contract_details:E,contract_preview:W,pricing_plan:$}),[F,V,E,W,$]),K=c(()=>!!(!!(y&&j&&e.currentStep.name!=="review")&&!I&&n.basic_information.length>0&&n.contract_details.length>0),[y,j,I,n.basic_information.length,n.contract_details.length,e.currentStep.name]);Kt(()=>{K&&(O.current={select_country:P(F,n.select_country),basic_information:P(V,n.basic_information),contract_details:P(E,n.contract_details),contract_preview:{},pricing_plan:{}},B({select_country:F,basic_information:V,contract_details:E,contract_preview:{},pricing_plan:{},review:{}}),D("review"))},[K,D,F,V,E,B,n.select_country,n.basic_information,n.contract_details]);let Gt=p(t=>{D(t)},"goTo"),Y=p(t=>M&&e.currentStep.name==="select_country"?t:l&&e.currentStep.name==="basic_information"?f(t,l?.fields,{isPartialValidation:!1}):m&&e.currentStep.name==="contract_details"?f(t,m?.fields,{isPartialValidation:!1}):d&&e.currentStep.name==="contract_preview"?f(t,d?.fields,{isPartialValidation:!1}):e.currentStep.name==="pricing_plan"?t:{},"parseFormValues");async function Wt(t){let r=e.currentStep.name;r in O.current&&(O.current[r]=P(t,n[r]));let g=Y(t);switch(e.currentStep.name){case"select_country":return A(g.country),Promise.resolve({data:{countryCode:g.country}});case"basic_information":{let L=!o&&a,b=o&&a&&s?.country&&s?.country.code!==a;if(L||b){let R={basic_information:g,type:"contractor",country_code:a,external_id:yt};try{let w=await vt(R),$t=w.data?.data?.employment?.id;return St($t),w}catch(w){throw console.error("Error creating onboarding:",w),w}}else if(o)return Promise.resolve({data:{employmentId:o}});return}case"contract_details":{let b=await Ot({employmentId:o,payload:{contract_document:g}}),R=b.data?.data?.contract_document?.id;return gt(R),b}case"contract_preview":return Mt({employmentId:o,contractDocumentId:T,payload:{signature:t.signature}});case"pricing_plan":return t.subscription==ot?x({employmentId:o,payload:{operation:"downgrade"}}):t.subscription==rt?x({employmentId:o,payload:{operation:"upgrade"}}):Promise.reject({error:"invalid selection"});default:throw new Error("Invalid step state")}}return p(Wt,"onSubmit"),{isLoading:Tt||Bt||I||Jt||Dt||Nt,fieldValues:h,stepState:e,checkFieldUpdates:Ct,back:ht,next:Ft,goTo:Gt,onSubmit:Wt,fields:n[e.currentStep.name],meta:{fields:O.current,fieldsets:xt[e.currentStep.name]},parseFormValues:Y,handleValidation:p(t=>{if(e.currentStep.name==="select_country")return M.handleValidation(t);if(l&&e.currentStep.name==="basic_information"){let r=f(t,l?.fields,{isPartialValidation:!1});return l?.handleValidation(r)}if(m&&e.currentStep.name==="contract_details"){let r=f(t,m?.fields,{isPartialValidation:!1});return m?.handleValidation(r)}if(d&&e.currentStep.name==="contract_preview"){let r=f(t,d?.fields,{isPartialValidation:!1});return d?.handleValidation(r)}return e.currentStep.name==="pricing_plan"?{formErrors:{},yupError:null}:null},"handleValidation"),initialValues:Ht,employmentId:o,refetchEmployment:Vt,isSubmitting:J.isPending||q.isPending||N.isPending,documentPreviewPdf:qt,canInvite:Et,isEmploymentReadOnly:j,invitedStatus:wt,employment:s}},"useContractorOnboarding");export{me as a};
2
- //# sourceMappingURL=chunk-QRD43QJA.js.map
1
+ import{c as et,d as nt}from"./chunk-XNOLBKZC.js";import{a as z,f as Q,h as X,k as Z}from"./chunk-5KZXFQLZ.js";import{a as at,b as it,c as ct,e as st,f as lt,g as mt,h as ut}from"./chunk-XPL5XOQ4.js";import{a as ot,b as rt}from"./chunk-3UDG4IJO.js";import{a as dt,b as pt}from"./chunk-ZOTFS35J.js";import{a as v}from"./chunk-2YTBWEC7.js";import{a as tt}from"./chunk-PJBAQZ6G.js";import{c as f,d as C}from"./chunk-WXUIXZ7P.js";import{g as P}from"./chunk-43WMZDDH.js";import{a as p}from"./chunk-P37U34EQ.js";import{useEffect as Kt,useMemo as c,useRef as Yt,useState as k}from"react";var zt={select_country:null,basic_information:"employment_basic_information",contract_details:null,pricing_plan:null,contract_preview:null,review:null},Qt={employment_basic_information:"basic_information"},me=p(({countryCode:ft,externalId:yt,employmentId:y,skipSteps:_t,options:u,initialValues:i})=>{let[a,A]=k(ft||null),[o,St]=k(y),[T,gt]=k(void 0),O=Yt({select_country:{},basic_information:{},contract_details:{},contract_preview:{},pricing_plan:{}}),bt=_t?.includes("select_country")?pt:dt,{fieldValues:h,stepState:e,setFieldValues:Ct,previousStep:ht,nextStep:Ft,goToStep:D,setStepValues:B}=tt(bt),{data:s,isLoading:I,refetch:Vt}=z(o),{status:_}=s||{},j=_&&et.includes(_),Et=_&&!nt.includes(_),wt=c(()=>_==="invited"?"invited":"not_invited",[_]),J=X(u),q=lt(),N=it(),Pt=st(),{mutateAsync:vt}=v(J),{mutateAsync:Ot}=v(q),{mutateAsync:Mt}=v(N),{mutateAsync:x}=v(Pt);y&&s?.country?.code&&!a&&A(s.country.code);let{selectCountryForm:M,isLoading:Tt}=Z({jsfModify:u?.jsfModify?.select_country,queryOptions:{enabled:e.currentStep.name==="select_country"}}),{form:U,isLoading:Dt}=ut(o,{jsonSchemaVersion:u?.jsonSchemaVersion,queryOptions:{enabled:e.currentStep.name==="pricing_plan"}}),It=zt[e.currentStep.name]||"contractor_basic_information",jt=Qt[It],Lt=s?.[jt]||{},Rt=p(({form:t,options:r={},query:g={}})=>{let b=Object.keys(h).length>0?{...i,...e.values?.[e.currentStep.name],...h}:{...i,...Lt};return Q({countryCode:a,form:t,fieldValues:b,query:g,options:{...r,queryOptions:{enabled:r.queryOptions?.enabled??!0}}})},"useJSONSchema"),kt=!!(a&&(e.currentStep.name==="basic_information"||y)),At=!!(a&&(e.currentStep.name==="contract_details"||y)),{data:l,isLoading:Bt}=Rt({form:"contractor_basic_information",options:{jsfModify:u?.jsfModify?.basic_information,queryOptions:{enabled:kt},jsonSchemaVersion:u?.jsonSchemaVersion}}),{data:m,isLoading:Jt}=mt({countryCode:a,fieldValues:h,options:{queryOptions:{enabled:At},jsfModify:u?.jsfModify?.contract_details,jsonSchemaVersion:u?.jsonSchemaVersion}}),{data:d}=at({fieldValues:h,options:{queryOptions:{enabled:e.currentStep.name==="contract_preview"}}}),{data:qt,isLoading:Nt}=ct({employmentId:o,contractDocumentId:T,options:{queryOptions:{enabled:!!T}}}),n=c(()=>({select_country:M?.fields||[],basic_information:l?.fields||[],pricing_plan:U?.fields||[],contract_details:m?.fields||[],contract_preview:d?.fields||[],review:[]}),[M?.fields,l?.fields,U?.fields,m?.fields,d?.fields]),xt={select_country:null,basic_information:l?.meta["x-jsf-fieldsets"],pricing_plan:null,contract_details:m?.meta["x-jsf-fieldsets"],contract_preview:null,review:null},{country:Ut,basic_information:H={},contract_details:S={}}=s||{},G=Ut?.code,F=c(()=>C(n.select_country,{country:a||G||""}),[n.select_country,a,G]),V=c(()=>{let t={...i,...H};return C(n.basic_information,t)},[n.basic_information,H,i]),E=c(()=>{let t={...i,...S};return C(n.contract_details,t)},[n.contract_details,S,i]),W=c(()=>{let t={...i,...S};return C(n.contract_preview,t)},[n.contract_preview,S,i]),$=c(()=>{let t={...i,...S};return C(n.pricing_plan,t?.pricing_plan??{})},[n.pricing_plan,S,i]),Ht=c(()=>({select_country:F,basic_information:V,contract_details:E,contract_preview:W,pricing_plan:$}),[F,V,E,W,$]),K=c(()=>!!(!!(y&&j&&e.currentStep.name!=="review")&&!I&&n.basic_information.length>0&&n.contract_details.length>0),[y,j,I,n.basic_information.length,n.contract_details.length,e.currentStep.name]);Kt(()=>{K&&(O.current={select_country:P(F,n.select_country),basic_information:P(V,n.basic_information),contract_details:P(E,n.contract_details),contract_preview:{},pricing_plan:{}},B({select_country:F,basic_information:V,contract_details:E,contract_preview:{},pricing_plan:{},review:{}}),D("review"))},[K,D,F,V,E,B,n.select_country,n.basic_information,n.contract_details]);let Gt=p(t=>{D(t)},"goTo"),Y=p(t=>M&&e.currentStep.name==="select_country"?t:l&&e.currentStep.name==="basic_information"?f(t,l?.fields,{isPartialValidation:!1}):m&&e.currentStep.name==="contract_details"?f(t,m?.fields,{isPartialValidation:!1}):d&&e.currentStep.name==="contract_preview"?f(t,d?.fields,{isPartialValidation:!1}):e.currentStep.name==="pricing_plan"?t:{},"parseFormValues");async function Wt(t){let r=e.currentStep.name;r in O.current&&(O.current[r]=P(t,n[r]));let g=Y(t);switch(e.currentStep.name){case"select_country":return A(g.country),Promise.resolve({data:{countryCode:g.country}});case"basic_information":{let L=!o&&a,b=o&&a&&s?.country&&s?.country.code!==a;if(L||b){let R={basic_information:g,type:"contractor",country_code:a,external_id:yt};try{let w=await vt(R),$t=w.data?.data?.employment?.id;return St($t),w}catch(w){throw console.error("Error creating onboarding:",w),w}}else if(o)return Promise.resolve({data:{employmentId:o}});return}case"contract_details":{let b=await Ot({employmentId:o,payload:{contract_document:g}}),R=b.data?.data?.contract_document?.id;return gt(R),b}case"contract_preview":return Mt({employmentId:o,contractDocumentId:T,payload:{signature:t.signature}});case"pricing_plan":return t.subscription==ot?x({employmentId:o,payload:{operation:"downgrade"}}):t.subscription==rt?x({employmentId:o,payload:{operation:"upgrade"}}):Promise.reject({error:"invalid selection"});default:throw new Error("Invalid step state")}}return p(Wt,"onSubmit"),{isLoading:Tt||Bt||I||Jt||Dt||Nt,fieldValues:h,stepState:e,checkFieldUpdates:Ct,back:ht,next:Ft,goTo:Gt,onSubmit:Wt,fields:n[e.currentStep.name],meta:{fields:O.current,fieldsets:xt[e.currentStep.name]},parseFormValues:Y,handleValidation:p(t=>{if(e.currentStep.name==="select_country")return M.handleValidation(t);if(l&&e.currentStep.name==="basic_information"){let r=f(t,l?.fields,{isPartialValidation:!1});return l?.handleValidation(r)}if(m&&e.currentStep.name==="contract_details"){let r=f(t,m?.fields,{isPartialValidation:!1});return m?.handleValidation(r)}if(d&&e.currentStep.name==="contract_preview"){let r=f(t,d?.fields,{isPartialValidation:!1});return d?.handleValidation(r)}return e.currentStep.name==="pricing_plan"?{formErrors:{},yupError:null}:null},"handleValidation"),initialValues:Ht,employmentId:o,refetchEmployment:Vt,isSubmitting:J.isPending||q.isPending||N.isPending,documentPreviewPdf:qt,canInvite:Et,isEmploymentReadOnly:j,invitedStatus:wt,employment:s}},"useContractorOnboarding");export{me as a};
2
+ //# sourceMappingURL=chunk-YDJVQRND.js.map
@@ -1,2 +1,2 @@
1
- import{b as s}from"./chunk-PGWKJ6FK.js";import{b as u}from"./chunk-WVDTHFGS.js";import{b as i}from"./chunk-XFJPUKYR.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as m}from"react/jsx-runtime";function f({children:o,onClick:a,...n}){let{onboardingBag:{back:c,isEmploymentReadOnly:B}}=s(),{components:d}=i(),r=t(p=>{B||c(),a?.(p)},"onBackHandler"),e=d?.button;return e?m(e,{...n,onClick:r,children:o}):m(u,{...n,onClick:r,children:o})}t(f,"OnboardingBack");export{f as a};
2
- //# sourceMappingURL=chunk-EVSDVI2G.js.map
1
+ import{b as s}from"./chunk-PGWKJ6FK.js";import{b as u}from"./chunk-WVDTHFGS.js";import{b as i}from"./chunk-3ZWDIEEM.js";import{a as t}from"./chunk-P37U34EQ.js";import{jsx as m}from"react/jsx-runtime";function f({children:o,onClick:a,...n}){let{onboardingBag:{back:c,isEmploymentReadOnly:B}}=s(),{components:d}=i(),r=t(p=>{B||c(),a?.(p)},"onBackHandler"),e=d?.button;return e?m(e,{...n,onClick:r,children:o}):m(u,{...n,onClick:r,children:o})}t(f,"OnboardingBack");export{f as a};
2
+ //# sourceMappingURL=chunk-ZQ6MG635.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-5NARH23N.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-XFJPUKYR.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentBack};
1
+ import{a}from"../../chunk-EKKRQI6B.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentBack};
2
2
  //# sourceMappingURL=ContractAmendmentBack.js.map
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { d as PostCreateContractAmendmentError, c as ContractAmendmentResponse } from '../../types.gen-BS9UfhS-.js';
2
+ import { b as PostCreateContractAmendmentError, a as ContractAmendmentResponse } from '../../types.gen-D0ZCnKWv.js';
3
3
  import { FieldValues } from 'react-hook-form';
4
4
 
5
5
  type ContractAmendmentConfirmationFormProps = {
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-LWGVLLBH.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentConfirmationForm};
1
+ import{a}from"../../chunk-5OZPBBXS.js";import"../../chunk-CNDSIADP.js";import"../../chunk-WXUIXZ7P.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentConfirmationForm};
2
2
  //# sourceMappingURL=ContractAmendmentConfirmationForm.js.map
@@ -5,16 +5,17 @@ import { ContractAmendmentForm } from './ContractAmendmentForm.js';
5
5
  import { ContractAmendmentSubmit } from './ContractAmendmentSubmit.js';
6
6
  import { useContractAmendment } from './hooks.js';
7
7
  import { ContractAmendmentParams } from './types.js';
8
- import '../../types.gen-BS9UfhS-.js';
8
+ import '../../types.gen-D0ZCnKWv.js';
9
9
  import 'react-hook-form';
10
10
  import 'react';
11
- import '../../mutations-BdkQ8BEQ.js';
12
- import '../../remoteFlows-nNmmcD-T.js';
11
+ import '../../mutations-Cdk0PM78.js';
12
+ import '../../remoteFlows-DUivEPPh.js';
13
13
  import 'yup';
14
14
  import '../../types-Zg1n_9wh.js';
15
15
  import '@remoteoss/json-schema-form';
16
16
  import '../useStepState.js';
17
17
  import '../types.js';
18
+ import '@remoteoss/json-schema-form-next';
18
19
 
19
20
  type TUseContractAmendment = ReturnType<typeof useContractAmendment>;
20
21
  type ContractAmendmentRenderProps = {
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-DTZ23AE6.js";import"../../chunk-U24UNO6X.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-D64MAPTD.js";import"../../chunk-QGWCUGLN.js";import"../../chunk-RYXRWMF4.js";import"../../chunk-Z47JQN3R.js";import"../../chunk-RCWBOOZF.js";import"../../chunk-A6GJNXUZ.js";import"../../chunk-SGE4DLC3.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-JTOLQCOG.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-UOOM7V2D.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-2CDCTUVY.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-5NARH23N.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-XFJPUKYR.js";import"../../chunk-LWGVLLBH.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentFlow};
1
+ import{a}from"../../chunk-UJKTTTGB.js";import"../../chunk-IHNYOUXP.js";import"../../chunk-OW5QGJD4.js";import"../../chunk-K2BWF2HC.js";import"../../chunk-A477TZFC.js";import"../../chunk-FRTJ4KWA.js";import"../../chunk-5P7INAU2.js";import"../../chunk-WJ6YJFD4.js";import"../../chunk-THMWKOHC.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-GOGPCCBS.js";import"../../chunk-HPHWQU34.js";import"../../chunk-MZB24YJP.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-AA7QB3QQ.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-EKKRQI6B.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-5OZPBBXS.js";import"../../chunk-CNDSIADP.js";import"../../chunk-WXUIXZ7P.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentFlow};
2
2
  //# sourceMappingURL=ContractAmendmentFlow.js.map
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { b as PostAutomatableContractAmendmentError, a as ContractAmendmentAutomatableResponse } from '../../types.gen-BS9UfhS-.js';
2
+ import { P as PostAutomatableContractAmendmentError, C as ContractAmendmentAutomatableResponse } from '../../types.gen-D0ZCnKWv.js';
3
3
  import { FieldValues } from 'react-hook-form';
4
4
 
5
5
  type ContractAmendmentFormProps = {
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-U24UNO6X.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-D64MAPTD.js";import"../../chunk-QGWCUGLN.js";import"../../chunk-RYXRWMF4.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-UOOM7V2D.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-2CDCTUVY.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-XFJPUKYR.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentForm};
1
+ import{a}from"../../chunk-IHNYOUXP.js";import"../../chunk-5P7INAU2.js";import"../../chunk-WJ6YJFD4.js";import"../../chunk-THMWKOHC.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-GOGPCCBS.js";import"../../chunk-HPHWQU34.js";import"../../chunk-MZB24YJP.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-AA7QB3QQ.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-CNDSIADP.js";import"../../chunk-WXUIXZ7P.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentForm};
2
2
  //# sourceMappingURL=ContractAmendmentForm.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-Z47JQN3R.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-XFJPUKYR.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentSubmit};
1
+ import{a}from"../../chunk-OW5QGJD4.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentSubmit};
2
2
  //# sourceMappingURL=ContractAmendmentSubmit.js.map
@@ -1,8 +1,8 @@
1
- import { a as ContractAmendmentAutomatableResponse, b as PostAutomatableContractAmendmentError, c as ContractAmendmentResponse, d as PostCreateContractAmendmentError } from '../../types.gen-BS9UfhS-.js';
1
+ import { C as ContractAmendmentAutomatableResponse, P as PostAutomatableContractAmendmentError, a as ContractAmendmentResponse, b as PostCreateContractAmendmentError } from '../../types.gen-D0ZCnKWv.js';
2
2
  import * as React from 'react';
3
- import { E as ErrorResponse, S as SuccessResponse } from '../../mutations-BdkQ8BEQ.js';
3
+ import { E as ErrorResponse, S as SuccessResponse } from '../../mutations-Cdk0PM78.js';
4
4
  import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
5
- import '../../remoteFlows-nNmmcD-T.js';
5
+ import '../../remoteFlows-DUivEPPh.js';
6
6
  import * as react_hook_form from 'react-hook-form';
7
7
  import { useContractAmendment } from './hooks.js';
8
8
  import { Step } from '../useStepState.js';
@@ -10,6 +10,7 @@ import 'yup';
10
10
  import '../../types-Zg1n_9wh.js';
11
11
  import './types.js';
12
12
  import '../types.js';
13
+ import '@remoteoss/json-schema-form-next';
13
14
 
14
15
  declare const ContractAmendmentContext: React.Context<{
15
16
  formId: string | undefined;
@@ -1,14 +1,15 @@
1
- import { a as ContractAmendmentAutomatableResponse, b as PostAutomatableContractAmendmentError, c as ContractAmendmentResponse, d as PostCreateContractAmendmentError } from '../../types.gen-BS9UfhS-.js';
2
- import { E as ErrorResponse, S as SuccessResponse } from '../../mutations-BdkQ8BEQ.js';
1
+ import { C as ContractAmendmentAutomatableResponse, P as PostAutomatableContractAmendmentError, a as ContractAmendmentResponse, b as PostCreateContractAmendmentError } from '../../types.gen-D0ZCnKWv.js';
2
+ import { E as ErrorResponse, S as SuccessResponse } from '../../mutations-Cdk0PM78.js';
3
3
  import * as React from 'react';
4
4
  import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
5
5
  import { Step } from '../useStepState.js';
6
6
  import { ContractAmendmentParams } from './types.js';
7
7
  import { FieldValues } from 'react-hook-form';
8
- import '../../remoteFlows-nNmmcD-T.js';
8
+ import '../../remoteFlows-DUivEPPh.js';
9
9
  import 'yup';
10
10
  import '../../types-Zg1n_9wh.js';
11
11
  import '../types.js';
12
+ import '@remoteoss/json-schema-form-next';
12
13
 
13
14
  declare const useContractAmendment: ({ employmentId, countryCode, options, }: ContractAmendmentParams) => {
14
15
  /**
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-RCWBOOZF.js";import"../../chunk-A6GJNXUZ.js";import"../../chunk-SGE4DLC3.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-JTOLQCOG.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-2CDCTUVY.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-XFJPUKYR.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-P37U34EQ.js";export{a as useContractAmendment};
1
+ import{a}from"../../chunk-K2BWF2HC.js";import"../../chunk-A477TZFC.js";import"../../chunk-FRTJ4KWA.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-AA7QB3QQ.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-WXUIXZ7P.js";import"../../chunk-P37U34EQ.js";export{a as useContractAmendment};
2
2
  //# sourceMappingURL=hooks.js.map
@@ -4,15 +4,16 @@ export { ContractAmendmentForm } from './ContractAmendmentForm.js';
4
4
  export { ContractAmendmentSubmit } from './ContractAmendmentSubmit.js';
5
5
  export { useContractAmendment } from './hooks.js';
6
6
  import 'react/jsx-runtime';
7
- import '../../types.gen-BS9UfhS-.js';
7
+ import '../../types.gen-D0ZCnKWv.js';
8
8
  import 'react-hook-form';
9
9
  import './ContractAmendmentBack.js';
10
10
  import 'react';
11
11
  import './types.js';
12
12
  import '../types.js';
13
13
  import '@remoteoss/json-schema-form';
14
- import '../../mutations-BdkQ8BEQ.js';
15
- import '../../remoteFlows-nNmmcD-T.js';
14
+ import '@remoteoss/json-schema-form-next';
15
+ import '../../mutations-Cdk0PM78.js';
16
+ import '../../remoteFlows-DUivEPPh.js';
16
17
  import 'yup';
17
18
  import '../../types-Zg1n_9wh.js';
18
19
  import '../useStepState.js';
@@ -1,2 +1,2 @@
1
- import"../../chunk-A7ZJQCNU.js";import{a as e}from"../../chunk-DTZ23AE6.js";import{a as b}from"../../chunk-U24UNO6X.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-D64MAPTD.js";import"../../chunk-QGWCUGLN.js";import"../../chunk-RYXRWMF4.js";import{a as c}from"../../chunk-Z47JQN3R.js";import{a as d}from"../../chunk-RCWBOOZF.js";import"../../chunk-A6GJNXUZ.js";import"../../chunk-SGE4DLC3.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-JTOLQCOG.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-UOOM7V2D.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-2CDCTUVY.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-5NARH23N.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-XFJPUKYR.js";import{a}from"../../chunk-LWGVLLBH.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentConfirmationForm,e as ContractAmendmentFlow,b as ContractAmendmentForm,c as ContractAmendmentSubmit,d as useContractAmendment};
1
+ import"../../chunk-A7ZJQCNU.js";import{a as e}from"../../chunk-UJKTTTGB.js";import{a as b}from"../../chunk-IHNYOUXP.js";import{a as c}from"../../chunk-OW5QGJD4.js";import{a as d}from"../../chunk-K2BWF2HC.js";import"../../chunk-A477TZFC.js";import"../../chunk-FRTJ4KWA.js";import"../../chunk-5P7INAU2.js";import"../../chunk-WJ6YJFD4.js";import"../../chunk-THMWKOHC.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-GOGPCCBS.js";import"../../chunk-HPHWQU34.js";import"../../chunk-MZB24YJP.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-AA7QB3QQ.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-EKKRQI6B.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import{a}from"../../chunk-5OZPBBXS.js";import"../../chunk-CNDSIADP.js";import"../../chunk-WXUIXZ7P.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-TVZAFTPT.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractAmendmentConfirmationForm,e as ContractAmendmentFlow,b as ContractAmendmentForm,c as ContractAmendmentSubmit,d as useContractAmendment};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,6 @@
1
1
  import { FlowOptions } from '../types.js';
2
2
  import '@remoteoss/json-schema-form';
3
+ import '@remoteoss/json-schema-form-next';
3
4
 
4
5
  type ContractAmendmentParams = {
5
6
  employmentId: string;
@@ -1,4 +1,4 @@
1
- import { E as Employment } from '../../types.gen-BS9UfhS-.js';
1
+ import { E as Employment } from '../../types.gen-D0ZCnKWv.js';
2
2
  import { Fields } from '@remoteoss/json-schema-form';
3
3
  import { Step } from '../useStepState.js';
4
4
  import 'react';
@@ -1,2 +1,2 @@
1
- import{a,b}from"../../chunk-JTOLQCOG.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-P37U34EQ.js";export{a as STEPS,b as buildInitialValues};
1
+ import{a,b}from"../../chunk-FRTJ4KWA.js";import"../../chunk-WXUIXZ7P.js";import"../../chunk-P37U34EQ.js";export{a as STEPS,b as buildInitialValues};
2
2
  //# sourceMappingURL=utils.js.map
@@ -1,11 +1,11 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { a as ContractorOnboardingFlowProps } from '../../types-omiJJgNz.js';
3
- import '../../types.gen-BS9UfhS-.js';
2
+ import { a as ContractorOnboardingFlowProps } from '../../types-pohqJTkr.js';
3
+ import '../../types.gen-D0ZCnKWv.js';
4
4
  import './components/OnboardingBack.js';
5
5
  import 'react';
6
6
  import './components/OnboardingSubmit.js';
7
- import '../../mutations-BdkQ8BEQ.js';
8
- import '../../remoteFlows-nNmmcD-T.js';
7
+ import '../../mutations-Cdk0PM78.js';
8
+ import '../../remoteFlows-DUivEPPh.js';
9
9
  import 'react-hook-form';
10
10
  import 'yup';
11
11
  import '../../types-Zg1n_9wh.js';
@@ -14,11 +14,12 @@ import '@remoteoss/json-schema-form';
14
14
  import './utils.js';
15
15
  import '../useStepState.js';
16
16
  import './components/BasicInformationStep.js';
17
- import '../../types-BOXcQDia.js';
17
+ import '../../types-BZBdCzER.js';
18
18
  import '../Onboarding/components/OnboardingBack.js';
19
19
  import '../Onboarding/components/OnboardingInvite.js';
20
20
  import '../Onboarding/components/OnboardingSubmit.js';
21
21
  import '../types.js';
22
+ import '@remoteoss/json-schema-form-next';
22
23
  import '../Onboarding/components/SaveDraftButton.js';
23
24
 
24
25
  declare const ContractorOnboardingFlow: ({ render, employmentId, externalId, countryCode, skipSteps, initialValues, options, }: ContractorOnboardingFlowProps) => react_jsx_runtime.JSX.Element;
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-7JUP5JEY.js";import"../../chunk-OHAAAVNB.js";import"../../chunk-SOYN4LOZ.js";import"../../chunk-6GUXV7XA.js";import"../../chunk-JK5K2S7N.js";import"../../chunk-RGGU6BNB.js";import"../../chunk-664GOQG3.js";import"../../chunk-7TX2YY4K.js";import"../../chunk-K2L2NSOM.js";import"../../chunk-ZZWX3C6V.js";import"../../chunk-TOA3JILU.js";import"../../chunk-QRD43QJA.js";import"../../chunk-EHS4ERDW.js";import"../../chunk-7RFJWDXS.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-HX34JCPL.js";import"../../chunk-AP56UUME.js";import"../../chunk-R2MHAPWD.js";import"../../chunk-3UDG4IJO.js";import"../../chunk-ZOTFS35J.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-D64MAPTD.js";import"../../chunk-QGWCUGLN.js";import"../../chunk-RYXRWMF4.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-UOOM7V2D.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-2CDCTUVY.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-XFJPUKYR.js";import"../../chunk-CNDSIADP.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractorOnboardingFlow};
1
+ import{a}from"../../chunk-HBHVB56P.js";import"../../chunk-DPY77ASH.js";import"../../chunk-B6IVJUEH.js";import"../../chunk-ENW4DCDU.js";import"../../chunk-P7JZC65P.js";import"../../chunk-SRRY72CZ.js";import"../../chunk-TWVFLXVF.js";import"../../chunk-2W2XD7ZY.js";import"../../chunk-5ZR7EFPY.js";import"../../chunk-SO3YQ4WT.js";import"../../chunk-TOA3JILU.js";import"../../chunk-YDJVQRND.js";import"../../chunk-XNOLBKZC.js";import"../../chunk-5KZXFQLZ.js";import"../../chunk-WVJDCDGZ.js";import"../../chunk-XPL5XOQ4.js";import"../../chunk-AP56UUME.js";import"../../chunk-R2MHAPWD.js";import"../../chunk-3UDG4IJO.js";import"../../chunk-ZOTFS35J.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-5P7INAU2.js";import"../../chunk-WJ6YJFD4.js";import"../../chunk-THMWKOHC.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-GOGPCCBS.js";import"../../chunk-HPHWQU34.js";import"../../chunk-MZB24YJP.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-AA7QB3QQ.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-CNDSIADP.js";import"../../chunk-WXUIXZ7P.js";import"../../chunk-MQ6F5LE4.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{a as ContractorOnboardingFlow};
2
2
  //# sourceMappingURL=ContractorOnboarding.js.map
@@ -1,9 +1,10 @@
1
- import { S as SuccessResponse, e as PostSignContractDocumentError, f as SignContractDocument, F as File, g as ContractorSubscriptionsSummary, h as PostManageContractorPlusSubscriptionSubscriptionError, M as ManageContractorPlusSubscriptionOperationsParams, i as CreateContractDocumentResponse, j as PostCreateContractDocumentError, k as CreateContractDocument } from '../../types.gen-BS9UfhS-.js';
1
+ import { S as SuccessResponse, c as PostSignContractDocumentError, d as SignContractDocument, F as File, e as ContractorSubscriptionsSummary, f as PostManageContractorPlusSubscriptionSubscriptionError, M as ManageContractorPlusSubscriptionOperationsParams, g as CreateContractDocumentResponse, h as PostCreateContractDocumentError, i as CreateContractDocument } from '../../types.gen-D0ZCnKWv.js';
2
2
  import * as _tanstack_react_query from '@tanstack/react-query';
3
3
  import * as _remoteoss_json_schema_form from '@remoteoss/json-schema-form';
4
4
  import { FlowOptions } from '../types.js';
5
- import { J as JSFFieldset } from '../../remoteFlows-nNmmcD-T.js';
5
+ import { J as JSFFieldset } from '../../remoteFlows-DUivEPPh.js';
6
6
  import { FieldValues } from 'react-hook-form';
7
+ import '@remoteoss/json-schema-form-next';
7
8
  import 'react';
8
9
  import 'yup';
9
10
  import '../../types-Zg1n_9wh.js';
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e,f,g,h}from"../../chunk-HX34JCPL.js";import"../../chunk-AP56UUME.js";import"../../chunk-R2MHAPWD.js";import"../../chunk-3UDG4IJO.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-2CDCTUVY.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-XFJPUKYR.js";import"../../chunk-PAQW5BFW.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{g as useContractorOnboardingDetailsSchema,h as useContractorSubscriptionSchemaField,f as useCreateContractorContractDocument,a as useGetContractDocumentSignatureSchema,d as useGetContractorSubscriptions,c as useGetShowContractDocument,e as usePostManageContractorSubscriptions,b as useSignContractDocument};
1
+ import{a,b,c,d,e,f,g,h}from"../../chunk-XPL5XOQ4.js";import"../../chunk-AP56UUME.js";import"../../chunk-R2MHAPWD.js";import"../../chunk-3UDG4IJO.js";import"../../chunk-Z5WMKCRJ.js";import"../../chunk-AA7QB3QQ.js";import"../../chunk-3ZWDIEEM.js";import"../../chunk-WXUIXZ7P.js";import"../../chunk-43WMZDDH.js";import"../../chunk-P37U34EQ.js";export{g as useContractorOnboardingDetailsSchema,h as useContractorSubscriptionSchemaField,f as useCreateContractorContractDocument,a as useGetContractDocumentSignatureSchema,d as useGetContractorSubscriptions,c as useGetShowContractDocument,e as usePostManageContractorSubscriptions,b as useSignContractDocument};
2
2
  //# sourceMappingURL=api.js.map
@@ -1,11 +1,11 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { B as BasicInformationFormPayload } from '../../../types-BOXcQDia.js';
3
- import { w as EmploymentCreationResponse } from '../../../types.gen-BS9UfhS-.js';
4
- import { N as NormalizedFieldError } from '../../../mutations-BdkQ8BEQ.js';
2
+ import { B as BasicInformationFormPayload } from '../../../types-BZBdCzER.js';
3
+ import { u as EmploymentCreationResponse } from '../../../types.gen-D0ZCnKWv.js';
4
+ import { N as NormalizedFieldError } from '../../../mutations-Cdk0PM78.js';
5
5
  import '../../Onboarding/components/OnboardingBack.js';
6
6
  import 'react';
7
7
  import '../../Onboarding/components/OnboardingInvite.js';
8
- import '../../../remoteFlows-nNmmcD-T.js';
8
+ import '../../../remoteFlows-DUivEPPh.js';
9
9
  import 'react-hook-form';
10
10
  import 'yup';
11
11
  import '../../../types-Zg1n_9wh.js';
@@ -14,6 +14,7 @@ import '@tanstack/query-core';
14
14
  import '@remoteoss/json-schema-form';
15
15
  import '../../useStepState.js';
16
16
  import '../../types.js';
17
+ import '@remoteoss/json-schema-form-next';
17
18
  import '../../Onboarding/components/SaveDraftButton.js';
18
19
 
19
20
  type BasicInformationStepProps = {