@remoteoss/remote-flows 0.28.0 → 0.29.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 (253) hide show
  1. package/dist/{ZendeskTriggerButton-DIV8pCPo.d.ts → ZendeskTriggerButton-Dditzyfj.d.ts} +15 -0
  2. package/dist/{chunk-DZ7FZ4L2.js → chunk-25U3HC77.js} +2 -2
  3. package/dist/{chunk-QPTO4XXU.js → chunk-2FZWM6RV.js} +2 -2
  4. package/dist/{chunk-RAHCZTQ3.js → chunk-2RBD2MJR.js} +2 -2
  5. package/dist/{chunk-UFBTCHEI.js → chunk-3PTV5YSQ.js} +2 -2
  6. package/dist/{chunk-HFI2MD3H.js → chunk-3WE5QB4I.js} +2 -2
  7. package/dist/chunk-43IIMISK.js +2 -0
  8. package/dist/chunk-43IIMISK.js.map +1 -0
  9. package/dist/chunk-5Y2RV54X.js +2 -0
  10. package/dist/chunk-5Y2RV54X.js.map +1 -0
  11. package/dist/{chunk-PYKEYPGA.js → chunk-6IKJCDQU.js} +2 -2
  12. package/dist/{chunk-AWDGLK2T.js → chunk-7JPHJ7SQ.js} +2 -2
  13. package/dist/{chunk-LRGEEPGK.js → chunk-AWJUS6JD.js} +1 -1
  14. package/dist/{chunk-LRGEEPGK.js.map → chunk-AWJUS6JD.js.map} +1 -1
  15. package/dist/{chunk-UTBVLDKY.js → chunk-BSUVUGJG.js} +2 -2
  16. package/dist/{chunk-JO4722R7.js → chunk-CCL5LNHC.js} +2 -2
  17. package/dist/{chunk-ANQ4HVVK.js → chunk-CDRDLO4A.js} +1 -1
  18. package/dist/{chunk-ANQ4HVVK.js.map → chunk-CDRDLO4A.js.map} +1 -1
  19. package/dist/{chunk-AUZWLETL.js → chunk-CEJ24TSW.js} +2 -2
  20. package/dist/{chunk-ZWZJ4XOY.js → chunk-CHAHQRMM.js} +2 -2
  21. package/dist/{chunk-BMDZJNJV.js → chunk-E5VV7WAZ.js} +2 -2
  22. package/dist/chunk-EHS4ERDW.js +2 -0
  23. package/dist/chunk-EHS4ERDW.js.map +1 -0
  24. package/dist/{chunk-WLBRCGTG.js → chunk-FHQWEM5E.js} +2 -2
  25. package/dist/{chunk-MGVP76ZI.js → chunk-FTCLM4RE.js} +2 -2
  26. package/dist/{chunk-VM2DQCZO.js → chunk-GEHM46QD.js} +2 -2
  27. package/dist/{chunk-AODV6HT2.js → chunk-GWJZTMF4.js} +2 -2
  28. package/dist/{chunk-BOTWQMOJ.js → chunk-I4XJ764Y.js} +2 -2
  29. package/dist/{chunk-Z42H2QEW.js → chunk-I5XGKYJR.js} +2 -2
  30. package/dist/chunk-ID3ZF7QT.js +2 -0
  31. package/dist/chunk-ID3ZF7QT.js.map +1 -0
  32. package/dist/{chunk-R645TMO5.js → chunk-IJQDK7KG.js} +2 -2
  33. package/dist/{chunk-QTYDDIVO.js → chunk-K2I7ZL3Z.js} +2 -2
  34. package/dist/{chunk-MRPXDND2.js → chunk-LA6ZJLTB.js} +2 -2
  35. package/dist/{chunk-RINDVT6U.js → chunk-LAYZ6XET.js} +2 -2
  36. package/dist/chunk-LWZIOOPO.js +2 -0
  37. package/dist/chunk-LWZIOOPO.js.map +1 -0
  38. package/dist/{chunk-TM7Q7RHH.js → chunk-M22INAKM.js} +2 -2
  39. package/dist/{chunk-HMNHKZGD.js → chunk-MAVVGCUM.js} +2 -2
  40. package/dist/{chunk-WCIJHQMP.js → chunk-MB6ZGX2O.js} +2 -2
  41. package/dist/{chunk-5MYWJJBQ.js → chunk-NW5EBNKN.js} +2 -2
  42. package/dist/chunk-NX7MM6XR.js +2 -0
  43. package/dist/chunk-NX7MM6XR.js.map +1 -0
  44. package/dist/{chunk-7AC3W7WD.js → chunk-NZHJMUIX.js} +2 -2
  45. package/dist/chunk-NZHJMUIX.js.map +1 -0
  46. package/dist/{chunk-CVIWZYO3.js → chunk-PJY4TN7I.js} +2 -2
  47. package/dist/{chunk-W55MUSAS.js → chunk-PXX2JSFI.js} +2 -2
  48. package/dist/{chunk-FFMKAMWP.js → chunk-QFK2SD24.js} +2 -2
  49. package/dist/chunk-QM7J43SC.js +2 -0
  50. package/dist/chunk-QM7J43SC.js.map +1 -0
  51. package/dist/{chunk-5NPET4ZO.js → chunk-QU4ZTSMT.js} +2 -2
  52. package/dist/{chunk-N6G4VZXF.js → chunk-RR55GUDT.js} +2 -2
  53. package/dist/{chunk-N6G4VZXF.js.map → chunk-RR55GUDT.js.map} +1 -1
  54. package/dist/{chunk-GWLOE7WJ.js → chunk-S3KOROEZ.js} +2 -2
  55. package/dist/{chunk-IQKZWU7I.js → chunk-SRYUZSIK.js} +2 -2
  56. package/dist/{chunk-OU4Y73FX.js → chunk-T2UJOEUA.js} +2 -2
  57. package/dist/{chunk-DB7ITLRX.js → chunk-TKAZTT3M.js} +2 -2
  58. package/dist/chunk-UXVCNSHK.js +2 -0
  59. package/dist/chunk-UXVCNSHK.js.map +1 -0
  60. package/dist/{chunk-QDYWPG2R.js → chunk-UYHBV7QJ.js} +2 -2
  61. package/dist/{chunk-6KIQIVKA.js → chunk-WHVPDECD.js} +2 -2
  62. package/dist/chunk-XOA7GG4P.js +2 -0
  63. package/dist/{chunk-E6OBNWMU.js → chunk-ZJ7524CZ.js} +2 -2
  64. package/dist/chunk-ZPBKMAKR.js +2 -0
  65. package/dist/chunk-ZPBKMAKR.js.map +1 -0
  66. package/dist/{chunk-R3DJNVHR.js → chunk-ZXGAFQXW.js} +2 -2
  67. package/dist/{chunk-R3DJNVHR.js.map → chunk-ZXGAFQXW.js.map} +1 -1
  68. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
  69. package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +3 -3
  70. package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
  71. package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
  72. package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
  73. package/dist/flows/ContractAmendment/context.d.ts +3 -3
  74. package/dist/flows/ContractAmendment/hooks.d.ts +3 -3
  75. package/dist/flows/ContractAmendment/index.d.ts +3 -3
  76. package/dist/flows/ContractAmendment/index.js +1 -1
  77. package/dist/flows/ContractAmendment/utils.d.ts +1 -1
  78. package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +5 -5
  79. package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
  80. package/dist/flows/ContractorOnboarding/api.d.ts +2 -2
  81. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +4 -4
  82. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
  83. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +5 -5
  84. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
  85. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +5 -5
  86. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
  87. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +5 -5
  88. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
  89. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.d.ts +3 -3
  90. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.js +1 -1
  91. package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +5 -5
  92. package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
  93. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +4 -4
  94. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
  95. package/dist/flows/ContractorOnboarding/context.d.ts +5 -5
  96. package/dist/flows/ContractorOnboarding/hooks.d.ts +5 -5
  97. package/dist/flows/ContractorOnboarding/hooks.js +1 -1
  98. package/dist/flows/ContractorOnboarding/index.d.ts +5 -5
  99. package/dist/flows/ContractorOnboarding/index.js +1 -1
  100. package/dist/flows/ContractorOnboarding/types.d.ts +5 -5
  101. package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +3 -3
  102. package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
  103. package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +3 -3
  104. package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
  105. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.d.ts +1 -1
  106. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +1 -1
  107. package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.js +1 -1
  108. package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.js +1 -1
  109. package/dist/flows/CostCalculator/Results/CostCalculatorExtraStatutoryPaymentsBreakdown.js +1 -1
  110. package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.js +1 -1
  111. package/dist/flows/CostCalculator/Results/CostCalculatorResults.d.ts +1 -1
  112. package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
  113. package/dist/flows/CostCalculator/SummaryResults/SummaryResults.d.ts +1 -1
  114. package/dist/flows/CostCalculator/api.d.ts +1 -1
  115. package/dist/flows/CostCalculator/components/SalaryField.d.ts +2 -2
  116. package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
  117. package/dist/flows/CostCalculator/context.d.ts +3 -3
  118. package/dist/flows/CostCalculator/hooks.d.ts +3 -3
  119. package/dist/flows/CostCalculator/hooks.js +1 -1
  120. package/dist/flows/CostCalculator/index.d.ts +3 -3
  121. package/dist/flows/CostCalculator/index.js +1 -1
  122. package/dist/flows/CostCalculator/types.d.ts +1 -1
  123. package/dist/flows/CostCalculator/utils.d.ts +3 -3
  124. package/dist/flows/CostCalculator/utils.js +1 -1
  125. package/dist/flows/Onboarding/OnboardingFlow.d.ts +4 -4
  126. package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
  127. package/dist/flows/Onboarding/api.d.ts +7 -7
  128. package/dist/flows/Onboarding/api.js +1 -1
  129. package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +2 -2
  130. package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
  131. package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +4 -4
  132. package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
  133. package/dist/flows/Onboarding/components/BenefitsStep.d.ts +4 -4
  134. package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
  135. package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +4 -4
  136. package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
  137. package/dist/flows/Onboarding/components/OnboardingForm.d.ts +4 -4
  138. package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
  139. package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +3 -3
  140. package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
  141. package/dist/flows/Onboarding/components/ReviewStep.d.ts +4 -4
  142. package/dist/flows/Onboarding/components/SaveDraftButton.d.ts +3 -3
  143. package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +4 -4
  144. package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
  145. package/dist/flows/Onboarding/context.d.ts +4 -4
  146. package/dist/flows/Onboarding/hooks.d.ts +4 -4
  147. package/dist/flows/Onboarding/hooks.js +1 -1
  148. package/dist/flows/Onboarding/index.d.ts +4 -4
  149. package/dist/flows/Onboarding/index.js +1 -1
  150. package/dist/flows/Onboarding/types.d.ts +4 -4
  151. package/dist/flows/Onboarding/utils.d.ts +5 -5
  152. package/dist/flows/Onboarding/utils.js +1 -1
  153. package/dist/flows/Termination/AdditionalDetailsForm.d.ts +4 -4
  154. package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
  155. package/dist/flows/Termination/EmployeeComunicationForm.d.ts +4 -4
  156. package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
  157. package/dist/flows/Termination/PaidTimeOffForm.d.ts +4 -4
  158. package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
  159. package/dist/flows/Termination/TerminationDetailsForm.d.ts +4 -4
  160. package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
  161. package/dist/flows/Termination/TerminationFlow.d.ts +4 -4
  162. package/dist/flows/Termination/TerminationFlow.js +1 -1
  163. package/dist/flows/Termination/TerminationForm.d.ts +4 -4
  164. package/dist/flows/Termination/TerminationForm.js +1 -1
  165. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.js +1 -1
  166. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.d.ts +5 -5
  167. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.js +1 -1
  168. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.d.ts +5 -5
  169. package/dist/flows/Termination/components/PaidTimeOff/types.d.ts +5 -5
  170. package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js +1 -1
  171. package/dist/flows/Termination/context.d.ts +6 -6
  172. package/dist/flows/Termination/hooks.d.ts +5 -5
  173. package/dist/flows/Termination/hooks.js +1 -1
  174. package/dist/flows/Termination/index.d.ts +6 -6
  175. package/dist/flows/Termination/index.js +1 -1
  176. package/dist/flows/Termination/json-schemas/employeeComunication.js +1 -1
  177. package/dist/flows/Termination/json-schemas/jsonSchema.js +1 -1
  178. package/dist/flows/Termination/json-schemas/paidTimeOff.js +1 -1
  179. package/dist/flows/Termination/json-schemas/schema.js +1 -1
  180. package/dist/flows/Termination/json-schemas/terminationDetails.js +1 -1
  181. package/dist/flows/Termination/types.d.ts +4 -4
  182. package/dist/flows/api.d.ts +4 -4
  183. package/dist/flows/api.js +1 -1
  184. package/dist/index.d.ts +9 -9
  185. package/dist/index.js +1 -1
  186. package/dist/internals.d.ts +1 -1
  187. package/dist/internals.js +1 -1
  188. package/dist/{mutations-C0KsEf83.d.ts → mutations-B3zY0Z8j.d.ts} +1 -1
  189. package/dist/{remoteFlows-DJcvCgN2.d.ts → remoteFlows-C6LQCoUj.d.ts} +1 -1
  190. package/dist/{types-CwUhT-vz.d.ts → types-CXFW77uu.d.ts} +2 -2
  191. package/dist/{types-1tGveWWg.d.ts → types-C_aEj_4p.d.ts} +6 -5
  192. package/dist/{types-Dad_rgYV.d.ts → types-D0Gtn_LU.d.ts} +23 -16
  193. package/dist/{types-DegHPy8Q.d.ts → types-DRI6kPSl.d.ts} +4 -4
  194. package/dist/{types.gen-B73oMrmZ.d.ts → types.gen-B1wPsyg7.d.ts} +1 -1
  195. package/package.json +1 -1
  196. package/dist/chunk-2FKEF3OG.js +0 -2
  197. package/dist/chunk-2FKEF3OG.js.map +0 -1
  198. package/dist/chunk-53KVZ4BP.js +0 -2
  199. package/dist/chunk-53KVZ4BP.js.map +0 -1
  200. package/dist/chunk-6LJRRFK2.js +0 -2
  201. package/dist/chunk-6LJRRFK2.js.map +0 -1
  202. package/dist/chunk-7AC3W7WD.js.map +0 -1
  203. package/dist/chunk-FB2QGVI2.js +0 -2
  204. package/dist/chunk-FB2QGVI2.js.map +0 -1
  205. package/dist/chunk-L3C4AHZJ.js +0 -2
  206. package/dist/chunk-L3C4AHZJ.js.map +0 -1
  207. package/dist/chunk-NP4G3N5P.js +0 -2
  208. package/dist/chunk-SLMJEZJ7.js +0 -2
  209. package/dist/chunk-SLMJEZJ7.js.map +0 -1
  210. package/dist/chunk-UQOWSJ2B.js +0 -2
  211. package/dist/chunk-UQOWSJ2B.js.map +0 -1
  212. package/dist/chunk-XPKVRYIU.js +0 -2
  213. package/dist/chunk-XPKVRYIU.js.map +0 -1
  214. package/dist/chunk-ZY5U2UNT.js +0 -2
  215. package/dist/chunk-ZY5U2UNT.js.map +0 -1
  216. /package/dist/{chunk-DZ7FZ4L2.js.map → chunk-25U3HC77.js.map} +0 -0
  217. /package/dist/{chunk-QPTO4XXU.js.map → chunk-2FZWM6RV.js.map} +0 -0
  218. /package/dist/{chunk-RAHCZTQ3.js.map → chunk-2RBD2MJR.js.map} +0 -0
  219. /package/dist/{chunk-UFBTCHEI.js.map → chunk-3PTV5YSQ.js.map} +0 -0
  220. /package/dist/{chunk-HFI2MD3H.js.map → chunk-3WE5QB4I.js.map} +0 -0
  221. /package/dist/{chunk-PYKEYPGA.js.map → chunk-6IKJCDQU.js.map} +0 -0
  222. /package/dist/{chunk-AWDGLK2T.js.map → chunk-7JPHJ7SQ.js.map} +0 -0
  223. /package/dist/{chunk-UTBVLDKY.js.map → chunk-BSUVUGJG.js.map} +0 -0
  224. /package/dist/{chunk-JO4722R7.js.map → chunk-CCL5LNHC.js.map} +0 -0
  225. /package/dist/{chunk-AUZWLETL.js.map → chunk-CEJ24TSW.js.map} +0 -0
  226. /package/dist/{chunk-ZWZJ4XOY.js.map → chunk-CHAHQRMM.js.map} +0 -0
  227. /package/dist/{chunk-BMDZJNJV.js.map → chunk-E5VV7WAZ.js.map} +0 -0
  228. /package/dist/{chunk-WLBRCGTG.js.map → chunk-FHQWEM5E.js.map} +0 -0
  229. /package/dist/{chunk-MGVP76ZI.js.map → chunk-FTCLM4RE.js.map} +0 -0
  230. /package/dist/{chunk-VM2DQCZO.js.map → chunk-GEHM46QD.js.map} +0 -0
  231. /package/dist/{chunk-AODV6HT2.js.map → chunk-GWJZTMF4.js.map} +0 -0
  232. /package/dist/{chunk-BOTWQMOJ.js.map → chunk-I4XJ764Y.js.map} +0 -0
  233. /package/dist/{chunk-Z42H2QEW.js.map → chunk-I5XGKYJR.js.map} +0 -0
  234. /package/dist/{chunk-R645TMO5.js.map → chunk-IJQDK7KG.js.map} +0 -0
  235. /package/dist/{chunk-QTYDDIVO.js.map → chunk-K2I7ZL3Z.js.map} +0 -0
  236. /package/dist/{chunk-MRPXDND2.js.map → chunk-LA6ZJLTB.js.map} +0 -0
  237. /package/dist/{chunk-RINDVT6U.js.map → chunk-LAYZ6XET.js.map} +0 -0
  238. /package/dist/{chunk-TM7Q7RHH.js.map → chunk-M22INAKM.js.map} +0 -0
  239. /package/dist/{chunk-HMNHKZGD.js.map → chunk-MAVVGCUM.js.map} +0 -0
  240. /package/dist/{chunk-WCIJHQMP.js.map → chunk-MB6ZGX2O.js.map} +0 -0
  241. /package/dist/{chunk-5MYWJJBQ.js.map → chunk-NW5EBNKN.js.map} +0 -0
  242. /package/dist/{chunk-CVIWZYO3.js.map → chunk-PJY4TN7I.js.map} +0 -0
  243. /package/dist/{chunk-W55MUSAS.js.map → chunk-PXX2JSFI.js.map} +0 -0
  244. /package/dist/{chunk-FFMKAMWP.js.map → chunk-QFK2SD24.js.map} +0 -0
  245. /package/dist/{chunk-5NPET4ZO.js.map → chunk-QU4ZTSMT.js.map} +0 -0
  246. /package/dist/{chunk-GWLOE7WJ.js.map → chunk-S3KOROEZ.js.map} +0 -0
  247. /package/dist/{chunk-IQKZWU7I.js.map → chunk-SRYUZSIK.js.map} +0 -0
  248. /package/dist/{chunk-OU4Y73FX.js.map → chunk-T2UJOEUA.js.map} +0 -0
  249. /package/dist/{chunk-DB7ITLRX.js.map → chunk-TKAZTT3M.js.map} +0 -0
  250. /package/dist/{chunk-QDYWPG2R.js.map → chunk-UYHBV7QJ.js.map} +0 -0
  251. /package/dist/{chunk-6KIQIVKA.js.map → chunk-WHVPDECD.js.map} +0 -0
  252. /package/dist/{chunk-NP4G3N5P.js.map → chunk-XOA7GG4P.js.map} +0 -0
  253. /package/dist/{chunk-E6OBNWMU.js.map → chunk-ZJ7524CZ.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{a as A}from"./chunk-BV3PGYSH.js";import{a as ve,b as Ge,c as Je,d as qe,e as je,f as Ke,g as Ye,h as Ze,i as Xe,j as xe,k as et,l as be,m as Se,o as ke,q as tt,r as ot,s as rt}from"./chunk-D6X2WCEG.js";import{b as Qe}from"./chunk-HPHWQU34.js";import{b as ye}from"./chunk-ANQ4HVVK.js";import{a as Ce,b as I}from"./chunk-WVDTHFGS.js";import{b as S}from"./chunk-3ZWDIEEM.js";import{a as ne,b as ae,c as b,d as Ae,e as Oe,f as ze,g as Ue,h as k,i as w,j as N,k as R,l as P,m as D}from"./chunk-CNDSIADP.js";import{g as Ve}from"./chunk-PAQW5BFW.js";import{a as y,e as oe}from"./chunk-43WMZDDH.js";import{a as r}from"./chunk-P37U34EQ.js";import{Fragment as Do,useEffect as To,useRef as Lt}from"react";import{Fragment as Ot,jsx as O,jsxs as se}from"react/jsx-runtime";function le({name:e,defaultValue:t,description:o,label:n,onChange:a,multiple:c,options:d,component:F,...f}){let{components:u}=S(),{control:s}=b(),i=r((m,l,g)=>{let p=g.value?[...g.value]:[];l?p.includes(m)||g.onChange([...p,m]):g.onChange(p.filter(h=>h!==m))},"handleCheckboxChange");return O(k,{control:s,name:e,defaultValue:t,render:({field:m,fieldState:l})=>{let g=F||u?.checkbox;if(g){let p={name:e,description:o,label:n,defaultValue:t,multiple:c,options:d,...f};return O(g,{field:{...m,onChange:r(h=>{if(c){let{checked:x,value:C}=h.target;i(C,x,m),a?.(x);return}m.onChange(h),a?.(h)},"onChange")},fieldState:l,fieldData:p})}return se(w,{"data-field":e,className:y(`RemoteFlows__CheckBoxField__Item__${e}`),children:[O(R,{children:se(Ot,{children:[d&&c?O(N,{children:n}):null,d&&c?d.map(p=>se("div",{className:"flex space-x-2",children:[O(ve,{id:p.value,onCheckedChange:h=>{i(p.value,h===!0,m),a?.(h,p.value)},checked:m.value?.includes(p.value),className:"RemoteFlows__CheckBox__Input"}),O(N,{htmlFor:p.value,className:"mb-0 RemoteFlows__CheckBox__Label",children:p.label})]},p.value)):se("div",{className:"flex space-x-2",children:[O(ve,{id:e,onCheckedChange:p=>{m.onChange(p),a?.(p)},checked:m.value,className:"RemoteFlows__CheckBox__Input"}),O(N,{htmlFor:e,className:"mb-0 RemoteFlows__CheckBox__Label",children:n})]})]})}),o&&O(P,{children:o}),l.error&&O(D,{})]})}})}r(le,"CheckBoxField");import{CalendarIcon as Gt}from"lucide-react";import{PopoverClose as Jt}from"@radix-ui/react-popover";import{ChevronLeft as zt,ChevronRight as Vt}from"lucide-react";import{DayPicker as Ut}from"react-day-picker";import{jsx as Ne}from"react/jsx-runtime";function nt({className:e,classNames:t,showOutsideDays:o=!0,...n}){return Ne(Ut,{showOutsideDays:o,className:y("p-3",e),classNames:{months:"flex flex-col sm:flex-row gap-2",month:"flex flex-col gap-4",caption:"flex justify-center pt-1 relative items-center w-full",caption_label:"text-sm font-medium",nav:"flex items-center gap-1",nav_button:y(Ce({variant:"outline"}),"size-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-x-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:y("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md",n.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:y(Ce({variant:"ghost"}),"size-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground",day_range_end:"day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:r(({className:a,...c})=>Ne(zt,{className:y("size-4",a),...c}),"IconLeft"),IconRight:r(({className:a,...c})=>Ne(Vt,{className:y("size-4",a),...c}),"IconRight")},...n})}r(nt,"Calendar");import*as z from"@radix-ui/react-popover";import{jsx as ie}from"react/jsx-runtime";function me({...e}){return ie(z.Root,{"data-slot":"popover",...e})}r(me,"Popover");function de({...e}){return ie(z.Trigger,{"data-slot":"popover-trigger",...e})}r(de,"PopoverTrigger");function ce({className:e,align:t="center",sideOffset:o=4,...n}){return ie(z.Portal,{children:ie(z.Content,{"data-slot":"popover-content",align:t,sideOffset:o,className:y("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...n})})}r(ce,"PopoverContent");import{format as at,parse as qt}from"date-fns";import{Fragment as jt,jsx as M,jsxs as we}from"react/jsx-runtime";function st({description:e,label:t,name:o,minDate:n,onChange:a,component:c,...d}){let{components:F}=S(),{control:f}=b(),u;return d.meta?.mot&&typeof d.meta.mot=="number"?u=Ve(d.meta.mot):n&&(u=qt(n,"yyyy-MM-dd",new Date)),M(k,{control:f,name:o,render:({field:s,fieldState:i})=>{let m=c||F?.date;if(m){let l={description:e,label:t,name:o,onChange:a,...u&&{minDate:u.toISOString()},...d};return M(m,{field:{...s,onChange:r(g=>{s.onChange(g),a?.(g)},"onChange")},fieldState:i,fieldData:l})}return we(w,{"data-field":o,className:`flex flex-col RemoteFlows__DatePickerField__Item__${o}`,children:[M(N,{className:"RemoteFlows__DatePickerField__Label",children:t}),we(me,{children:[M(de,{asChild:!0,children:M(R,{children:M("div",{children:we(I,{type:"button",variant:"outline",className:y("w-full pl-3 text-left font-normal",!s.value&&"text-muted-foreground"),"data-testid":`date-picker-button-${o}`,children:[s.value&&M(jt,{children:at(s.value,"yyyy-MM-dd")}),M(Gt,{className:"ml-auto h-4 w-4 opacity-50"})]})})})}),M(ce,{className:"w-auto p-0 RemoteFlows__DatepickerField__PopoverContent",align:"start",children:M(nt,{mode:"single",className:"RemoteFlows__DatepickerField__Calendar",selected:s.value?new Date(s.value):void 0,onSelect:l=>{s.onChange(l?at(l,"yyyy-MM-dd"):null),a?.(l)},defaultMonth:u,components:{DayContent:r(l=>M(Jt,{children:l.date.getDate()}),"DayContent")},...u&&{disabled:r(l=>l<u,"disabled")}})})]}),e?M(P,{children:e}):null,i.error&&M(D,{className:"RemoteFlows__DatePickerField__Error"})]})}})}r(st,"DatePickerField");import{useState as Kt,useRef as Yt}from"react";import{Upload as Zt,X as Xt}from"lucide-react";import{jsx as V,jsxs as ue}from"react/jsx-runtime";var Qt=r(e=>e?e.split(",").map(t=>t.trim().toUpperCase()).join(", "):null,"getAcceptedFormats");function lt({onChange:e,className:t,multiple:o,accept:n}){let[a,c]=Kt([]),d=Yt(null),F=r(i=>{i.preventDefault(),d.current?.click()},"handleClick"),f=r(i=>{if(i.target.files&&i.target.files.length>0){let m=Array.from(i.target.files);c(m),e(i)}},"handleChange"),u=r(i=>{c(m=>m.filter(l=>l!==i))},"onRemoveFile"),s=Qt(n);return ue("div",{className:y("flex flex-col items-start gap-4",t),children:[V("input",{type:"file",ref:d,onChange:f,className:"hidden","aria-label":"File upload",multiple:o,accept:n}),ue(I,{type:"button",onClick:F,className:"gap-2",children:[V(Zt,{className:"h-4 w-4"}),"Choose File"]}),s&&ue("div",{className:"text-sm text-gray-600",children:["Accepted formats:"," ",V("span",{className:"font-medium",children:s})]}),a.length===0&&V("div",{className:"text-sm",children:o?V("span",{className:"font-medium",children:"No files selected. You can select multiple files"}):V("span",{className:"font-medium",children:"No file selected."})}),a.length>0&&a.map((i,m)=>ue("div",{className:"text-sm flex items-center gap-2",children:["Selected file: ",V("span",{className:"font-medium",children:i.name})," (",Math.round(i.size/1024)," KB)",V(I,{variant:"ghost",onClick:()=>u(i),children:V(Xt,{})})]},m))]})}r(lt,"FileUploader");import{jsx as U,jsxs as ro}from"react/jsx-runtime";var eo=r(e=>new Promise((t,o)=>{let n=new FileReader;n.readAsDataURL(e),n.onload=()=>t(n.result),n.onerror=a=>o(a)}),"toBase64"),to=r(async e=>await Promise.all(e.map(async o=>{let n=await eo(o);return{name:o.name,content:n.split(",")[1]}})),"convertFilesToBase64"),oo=r((e,t)=>{if(!t)return null;for(let o of e)if(o.size>t){let n=Math.round(t/1048576),a=Math.round(o.size/(1024*1024));return`File "${o.name}" exceeds maximum size of ${n}MB (file is ${a}MB)`}return null},"validateFileSize");function it({name:e,description:t,label:o,multiple:n,onChange:a,component:c,accept:d,maxSize:F,...f}){let{components:u}=S(),{control:s,setError:i,clearErrors:m}=b(),l=r(async(g,p)=>{let h=g.target.files?Array.from(g.target.files):[],x=oo(h,F);if(x){i(e,{message:x});return}m(e);let C=await to(h);p.onChange(C),a?.(C)},"handleOnChange");return U(k,{control:s,name:e,render:({field:g,fieldState:p})=>{let h=c||u?.file;if(h){let x={name:e,description:t,label:o,multiple:n,accept:d,maxFileSize:F,...f};return U(h,{field:{...g,value:null,onChange:r(async C=>l(C,g),"onChange")},fieldState:p,fieldData:x})}return ro(w,{"data-field":e,className:`RemoteFlows__FileUpload__Item__${e}`,children:[U(N,{className:"RemoteFlows__FileUpload__Label",children:o}),U(R,{children:U(lt,{onChange:x=>l(x,g),multiple:n,className:y("RemoteFlows__FileUpload__Input"),accept:d})}),t&&U("div",{className:"flex items-center justify-between",children:U(P,{className:"RemoteFlows__FileUpload__Description",children:t})}),p.error&&U(D,{className:"RemoteFlows__FileUpload__Error"})]})}})}r(it,"FileUploadField");import{jsx as Re}from"react/jsx-runtime";function pe(e){let{components:t}=S(),{control:o}=b(),n=e.component||t?.number;return n?Re(k,{control:o,name:e.name,render:({field:a,fieldState:c})=>Re(n,{field:{...a,onChange:r(d=>{a.onChange(d),e.onChange?.(d)},"onChange")},fieldState:c,fieldData:e})}):Re(A,{...e,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$"})}r(pe,"NumberField");import{Fragment as no}from"react";import{jsx as W,jsxs as Pe}from"react/jsx-runtime";function mt({name:e,defaultValue:t,description:o,label:n,options:a,onChange:c,component:d,...F}){let{components:f}=S(),{control:u}=b();return W(k,{control:u,name:e,defaultValue:t,render:({field:s,fieldState:i})=>{let m=d||f?.radio;if(m){let l={name:e,defaultValue:t,description:o,label:n,options:a,...F};return W(m,{field:{...s,onChange:r(g=>{s.onChange(g),c?.(g)},"onChange")},fieldState:i,fieldData:l})}return Pe(w,{className:y("space-y-3",`RemoteFlows__RadioGroupField__Item__${e}`),"data-field":e,children:[W(N,{children:n}),W(R,{children:W(Ge,{"aria-label":n||e,onValueChange:l=>{s.onChange(l),c?.(l)},value:s.value,className:"flex flex-col space-y-3",children:a?.map(l=>W(no,{children:Pe(w,{"data-field":e,className:"flex items-start space-x-3 space-y-0 gap-0 RemoteFlows__RadioField__Item",children:[W(R,{children:W(Je,{value:l.value,className:"RemoteFlows__RadioField__Input",disabled:l.disabled})}),Pe("div",{children:[W(N,{className:"font-normal mb-0 RemoteFlows__RadioField__Label",children:l.label}),l.description&&W(P,{className:"mt-2",children:l.description})]})]})},l.value))})}),o&&W(P,{children:o}),i.error&&W(D,{})]})}})}r(mt,"RadioGroupField");import{jsx as E,jsxs as dt}from"react/jsx-runtime";function ct({label:e,name:t,options:o,defaultValue:n,description:a,onChange:c,component:d,...F}){let{control:f}=b(),{components:u}=S();return E(k,{defaultValue:n,control:f,name:t,render:({field:s,fieldState:i})=>{let m=d||u?.select;if(m){let l={label:e,name:t,options:o,defaultValue:n,description:a,onChange:c,...F};return E(m,{field:{...s,onChange:r(g=>{let p=F.jsonType==="number"?Number(g):g;s.onChange(p),c?.(p)},"onChange")},fieldState:i,fieldData:l})}return dt(w,{"data-field":t,className:`RemoteFlows__SelectField__Item__${t}`,children:[E(N,{className:"RemoteFlows__SelectField__Label",children:e}),E(R,{children:E("div",{className:"relative",children:dt(qe,{value:s.value||"",onValueChange:l=>{let g=F.jsonType==="number"?Number(l):l;s.onChange(g),c?.(g)},children:[E(Ye,{className:"RemoteFlows__SelectField__Trigger","aria-invalid":!!i.error,"aria-label":e,children:E("span",{className:"absolute",children:E(Ke,{placeholder:e})})}),E(Ze,{className:"RemoteFlows__SelectField__Content",children:E(je,{className:"RemoteFlows__SelectField__Group",children:o.map(l=>E(Xe,{value:l.value,className:"RemoteFlows__SelectField__SelectItem",disabled:l.disabled,children:l.label},l.value))})})]})})}),a&&E(P,{children:a}),i.error&&E(D,{})]})}})}r(ct,"SelectField");import{useState as co}from"react";import{Fragment as ao,useState as so}from"react";import{Check as lo,ChevronDownIcon as io,X as mo}from"lucide-react";import{Command as K}from"cmdk";import{SearchIcon as sn}from"lucide-react";import{jsx as Y,jsxs as cn}from"react/jsx-runtime";function ut({className:e,...t}){return Y(K,{"data-slot":"command",className:y("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}r(ut,"Command");function pt({className:e,...t}){return Y(K.List,{"data-slot":"command-list",className:y("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}r(pt,"CommandList");function ft({...e}){return Y(K.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}r(ft,"CommandEmpty");function Ft({className:e,...t}){return Y(K.Group,{"data-slot":"command-group",className:y("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}r(Ft,"CommandGroup");function gt({className:e,...t}){return Y(K.Separator,{"data-slot":"command-separator",className:y("bg-border -mx-1 h-px",e),...t})}r(gt,"CommandSeparator");function ht({className:e,...t}){return Y(K.Item,{"data-slot":"command-item",className:y("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}r(ht,"CommandItem");import{jsx as L,jsxs as Z}from"react/jsx-runtime";function fe({options:e,selected:t,onChange:o,placeholder:n,...a}){let[c,d]=so(!1),F=r(s=>{o(t.filter(i=>i.value!==s.value))},"handleUnselect"),f=e.some(s=>s.category),u=e.reduce((s,i)=>{let m=i.category||"Uncategorized";return s[m]||(s[m]=[]),s[m].push(i),s},{});return Z(me,{open:c,onOpenChange:d,...a,children:[L(de,{children:Z(I,{variant:"outline",role:"combobox","aria-expanded":c,className:"w-full justify-between font-normal",type:"button",children:[L("div",{className:"flex gap-1 flex-wrap overflow-x-auto max-h-[2.5rem] items-center",children:t.length>0?t.map(s=>Z(Qe,{variant:"secondary",className:"mr-1 mb-1",children:[s.label,L("div",{role:"button",tabIndex:0,"aria-label":`remove ${s.label}`,className:"ml-1 ring-offset-background rounded-full outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer",onKeyDown:i=>{i.key==="Enter"&&F(s)},onMouseDown:i=>{i.preventDefault(),i.stopPropagation()},onClick:()=>F(s),children:L(mo,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]},s.label)):L("span",{className:"text-foreground",children:n})}),L(io,{className:"size-4"})]})}),L(ce,{align:"start",className:"w-full p-0",children:L(ut,{children:Z(pt,{children:[L(ft,{children:"No item found."}),Object.entries(u).map(([s,i],m)=>Z(ao,{children:[m>0&&L(gt,{}),L(Ft,{heading:f?s:void 0,children:i.map(l=>{let g=t.some(p=>p.value===l.value);return Z(ht,{onSelect:()=>{o(g?t.filter(p=>p.value!==l.value):[...t,l])},children:[L(lo,{className:y("mr-2 h-4 w-4",g?"opacity-100":"opacity-0")}),l.label]},l.label)})})]},s))]})})})]})}r(fe,"MultiSelect");import{jsx as G,jsxs as uo}from"react/jsx-runtime";function _t({label:e,name:t,options:o,defaultValue:n,description:a,onChange:c,$meta:d,component:F,...f}){let{control:u}=b(),{components:s}=S(),[i,m]=co([]);return G(k,{defaultValue:n,control:u,name:t,render:({field:l,fieldState:g})=>{let p=F||s?.countries;if(p){let C={label:e,name:t,options:o,defaultValue:n,description:a,onChange:c,$meta:d,...f};return G(p,{field:{...l,onChange:r(T=>{l.onChange(T),c?.(T)},"onChange")},fieldState:g,fieldData:C})}let h=[...Object.entries(d?.regions||{}).map(([C,T])=>({value:T,label:C,category:"Regions"})),...Object.entries(d?.subregions||{}).map(([C,T])=>({value:T,label:C,category:"Subregions"})),...o.map(C=>({...C,value:C.value,label:C.label,category:"Countries"}))],x=r(C=>{let T=C.map(({value:j})=>j);l.onChange(T),c?.(T),m(C)},"handleChange");return uo(w,{"data-field":t,className:`RemoteFlows__CountryField__Item__${t}`,children:[G(N,{className:"RemoteFlows__CountryField__Label",children:e}),G(R,{children:G(fe,{options:h,selected:i,onChange:x,...f})}),a&&G(P,{children:a}),g.error&&G(D,{})]})}})}r(_t,"CountryField");import*as yt from"react";import{jsx as po}from"react/jsx-runtime";var De=yt.forwardRef(({className:e,...t},o)=>po("textarea",{className:y("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...t}));De.displayName="Textarea";import{jsx as J,jsxs as Te}from"react/jsx-runtime";function vt({name:e,description:t,label:o,onChange:n,maxLength:a,component:c,...d}){let{components:F}=S(),{control:f}=b();return J(k,{control:f,name:e,render:({field:u,fieldState:s})=>{let i=c||F?.textarea;if(i){let l={name:e,description:t,label:o,maxLength:a,...d};return J(i,{field:{...u,onChange:r(g=>{u.onChange(g),n?.(g)},"onChange")},fieldState:s,fieldData:l})}let m=u.value?.length??0;return Te(w,{"data-field":e,className:`RemoteFlows__TextArea__Item__${e}`,children:[J(N,{className:"RemoteFlows__TextArea__Label",children:o}),J(R,{children:J(De,{...u,value:u.value??"",onChange:l=>{u.onChange(l),n?.(l)},className:y(s.error&&"border-red-500 focus-visible:ring-red-500","RemoteFlows__TextArea__Input"),placeholder:o})}),(t||a)&&Te("div",{className:"flex items-center justify-between",children:[t&&J(P,{className:"RemoteFlows__TextArea__Description",children:t}),a&&Te("span",{className:"text-sm ml-auto RemoteFlows__TextArea__MaxLength",children:[m,"/",a]})]}),s.error&&J(D,{className:"RemoteFlows__TextArea__Error"})]})}})}r(vt,"TextAreaField");import{jsx as $e}from"react/jsx-runtime";function Ct(e){let{components:t}=S(),{control:o}=b(),n=e.component||t?.email;return n?$e(k,{control:o,name:e.name,render:({field:a,fieldState:c})=>$e(n,{field:{...a,onChange:r(d=>{a.onChange(d),e.onChange?.(d)},"onChange")},fieldState:c,fieldData:e})}):$e(A,{...e,type:"email"})}r(Ct,"EmailField");import{jsx as xt}from"react/jsx-runtime";function bt(e){let{control:t}=b();return xt(k,{control:t,name:e.name,render:({field:o})=>xt("input",{...o,type:"hidden"})})}r(bt,"HiddenField");import vo,{useEffect as Co,useState as $t}from"react";var St=r((e,t,o)=>{if(e&&"reportValidity"in e){let n=ne(o,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},"r"),Ie=r((e,t)=>{for(let o in t.fields){let n=t.fields[o];n&&n.ref&&"reportValidity"in n.ref?St(n.ref,o,e):n&&n.refs&&n.refs.forEach(a=>St(a,o,e))}},"o"),Nt=r((e,t)=>{t.shouldUseNativeValidation&&Ie(e,t);let o={};for(let n in e){let a=ne(t.fields,n),c=Object.assign(e[n]||{},{ref:a&&a.ref});if(fo(t.names||Object.keys(e),n)){let d=Object.assign({},ne(o,n));ae(d,"root",c),ae(o,n,d)}else ae(o,n,c)}return o},"s"),fo=r((e,t)=>{let o=kt(t);return e.some(n=>kt(n).match(`^${o}\\.\\d+`))},"i");function kt(e){return e.replace(/\]|\[/g,"")}r(kt,"n");function wt(e,t,o){return t===void 0&&(t={}),o===void 0&&(o={}),function(n,a,c){try{return Promise.resolve(function(d,F){try{var f=(t.context&&process.env.NODE_ENV==="development"&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e[o.mode==="sync"?"validateSync":"validate"](n,Object.assign({abortEarly:!1},t,{context:a}))).then(function(u){return c.shouldUseNativeValidation&&Ie({},c),{values:o.raw?Object.assign({},n):u,errors:{}}}))}catch(u){return F(u)}return f&&f.then?f.then(void 0,F):f}(0,function(d){if(!d.inner)throw d;return{values:{},errors:Nt((F=d,f=!c.shouldUseNativeValidation&&c.criteriaMode==="all",(F.inner||[]).reduce(function(u,s){if(u[s.path]||(u[s.path]={message:s.message,type:s.type}),f){var i=u[s.path].types,m=i&&i[s.type];u[s.path]=Ae(s.path,f,u,s.type,m?[].concat(m,s.message):s.message)}return u},{})),c)};var F,f}))}catch(d){return Promise.reject(d)}}}r(wt,"o");import*as $ from"yup";import Rt from"lodash.groupby";import X from"lodash.capitalize";var Pt=60,Fe=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];function Fo(e){if(e<60)return`${e}m`;let t=Math.floor(e/Pt),o=e%Pt;return o>0?`${t}h${o}m`:`${t}h`}r(Fo,"convertBreakDurationToHours");function Dt(e){let t=e.reduce((o,n)=>n.hours+o,0);return Number(t.toFixed(2))}r(Dt,"calculateTotalWorkHours");function go(e,t){let o=t.map(({day:c})=>c.toLowerCase()),n=o.indexOf(e),a=null;for(;n<o.length&&!a;){let c=o[n],d=o[n+1],F=Fe.indexOf(c)+1;Fe[F]===d||(a=c),n+=1}return a}r(go,"findLastConsecutiveDay");function ho(e){return e.start_time&&e.end_time&&(typeof e.hours=="number"?e.hours:Number.parseInt(e.hours))>0}r(ho,"shouldSummarizeSchedule");function _o(e){return Number.parseInt(e.break_duration_minutes)>0}r(_o,"shouldSummarizeBreaks");function Tt(e){let t=e.filter(ho),o=Rt(t,F=>`${F.start_time}|${F.end_time}`),n=e.filter(_o),a=Rt(n,"break_duration_minutes"),c=Object.keys(o).map(F=>{let f=o[F],u=f[0].day,[s,i]=F.split("|"),m=`from <span>${s.replace(":","h")}</span> to <span>${i.replace(":","h")}</span>`,l=go(u,f),p=(l?f.findIndex(h=>h.day===l):-1)===f.length-1;return f.length===1?`${X(u)}, ${m}`:!p||!l?f.reduce((h,x,C)=>{let T=X(x.day);return C===f.length-1?`${h}and ${T}, ${m}`:`${h}<span>${T}</span>, `},""):`<span>${X(u)}</span> to <span>${X(l)}</span>, ${m}`}),d=Object.keys(a).reverse().map((F,f)=>{let u=f===0,s=a[F],i=Fo(parseInt(F,10));if(Object.keys(a).length===1)return`With ${i} daily breaks`;if(s.length===1){let m=`${i} break on ${X(s[0].day)}.`;return u?`With ${m}`:m}return s.reduce((m,l,g)=>{let p=X(l.day);return g===0?`${m} ${p}`:g===s.length-1?`${m}, and ${p}.`:`${m}, ${p}`},u?`With ${i} break on`:`${i} break on`)});return{workHoursSummary:c,breakSummary:d}}r(Tt,"buildWorkScheduleSummary");function Me(e){let{checked:t,start_time:o,end_time:n,break_duration_minutes:a}=e;if(!t)return 0;let[c,d]=o.split(":").map(Number),[F,f]=n.split(":").map(Number),u=c*60+d,m=(F*60+f-u-Number.parseInt(a||"0"))/60;return m===Math.floor(m)?m:Number(m.toFixed(2))}r(Me,"calculateHours");var yo={monday:"Mon",tuesday:"Tue",wednesday:"Wed",thursday:"Thu",friday:"Fri",saturday:"Sat",sunday:"Sun"};function ge(e){return yo[e]}r(ge,"getShortWeekday");import{jsx as v,jsxs as B}from"react/jsx-runtime";var xo=$.object({day:$.string().required(),checked:$.boolean().required(),start_time:$.string().matches(/^([01]\d|2[0-3]):([0-5]\d)$/,"Invalid time format (HH:mm)").when("checked",{is:!0,then:r(e=>e.required("Required"),"then"),otherwise:r(e=>e.optional().nullable(),"otherwise")}),end_time:$.string().matches(/^([01]\d|2[0-3]):([0-5]\d)$/,"Invalid time format (HH:mm)").when("checked",{is:!0,then:r(e=>e.required("Required"),"then"),otherwise:r(e=>e.optional().nullable(),"otherwise")}),hours:$.number().default(0),break_duration_minutes:$.string().default("0")}),bo=$.object({schedule:$.array(xo)});function So({defaultSchedule:e,onSubmit:t}){let[o,n]=$t(!1),a=Fe.map(p=>{let h=e.find(x=>x.day.toLowerCase()===ge(p).toLowerCase()||x.day.toLowerCase()===p.toLowerCase());return h?{...h,day:ge(p),checked:!0}:{...e[0],checked:!1,day:ge(p)}}),c=ze({defaultValues:{schedule:a},resolver:wt(bo)}),{handleSubmit:d,watch:F,reset:f,control:u,formState:s}=c,{fields:i}=Oe({name:"schedule",control:u}),m=F("schedule");function l(p){let h=p.schedule.filter(({checked:x})=>x).map(x=>({...x,hours:Me(x)}));t(h),n(!1)}r(l,"handleSubmitWorkingHours");function g(){f(),n(!1)}return r(g,"handleCancel"),v("div",{className:"flex items-center justify-between",children:B(xe,{open:o,onOpenChange:n,children:[v(et,{asChild:!0,children:v(I,{variant:"link",className:"flex items-center p-0 RemoteFlows__WorkScheduleSelectionForm__Trigger",children:"Edit Schedule"})}),B(be,{className:"max-w-5xl max-h-[90vh] overflow-y-auto px-8 py-4 RemoteFlows__WorkScheduleSelectionForm__Content",children:[v(Se,{children:v(ke,{className:"RemoteFlows__WorkScheduleSelectionForm__Title",children:"Edit employee working hours"})}),v(Ue,{...c,children:B("form",{className:"space-y-4 RemoteFlows__WorkScheduleSelectionForm__Form",children:[B("div",{className:"rounded-lg",children:[v("p",{className:"text-gray-600 text-sm mb-4 RemoteFlows__WorkScheduleSelectionForm__Description",children:"The times displayed are in the employee's time zone in the 24-hour format."}),B("div",{className:"grid grid-cols-12 gap-4 text-sm font-medium text-gray-500 uppercase tracking-wide RemoteFlows__WorkScheduleSelectionForm__Header",children:[v("div",{className:"col-span-2"}),v("div",{className:"col-span-3 text-center",children:"START"}),v("div",{className:"col-span-1 text-center"}),v("div",{className:"col-span-3 text-center",children:"END"}),v("div",{className:"col-span-2 text-center",children:"HOURS"})]}),v("div",{className:"RemoteFlows__WorkScheduleSelectionForm__Rows",children:i.map((p,h)=>{let x=m[h],C=Me(x);return B(vo.Fragment,{children:[B("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Hours",children:[v("div",{className:"col-span-2 flex items-center gap-3",children:v(le,{label:p.day,name:`schedule.${h}.checked`})}),v("div",{className:"col-span-3",children:v(A,{name:`schedule.${h}.start_time`,includeErrorMessage:!1})}),v("div",{className:"col-span-1 text-center text-gray-500",children:"to"}),v("div",{className:"col-span-3",children:v(A,{name:`schedule.${h}.end_time`,includeErrorMessage:!1})}),v("div",{className:"col-span-2 text-center text-gray-600",children:isNaN(C)?"-":`${C} hours`})]}),B("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Break",children:[v("div",{className:"col-span-2 text-gray-500",children:"Break"}),v("div",{className:"col-span-2",children:v(A,{name:`schedule.${h}.break_duration_minutes`,includeErrorMessage:!1})}),v("div",{className:"col-span-2 text-gray-500",children:"minutes"}),v("div",{className:"col-span-4"})]})]},p.id)})})]}),Object.keys(s.errors).length>0&&v("p",{className:"text-destructive text-sm mb-0",children:"Invalid time format (HH:mm)"}),B("div",{className:"flex gap-4 pt-4",children:[v(I,{type:"button",className:"reset-button",variant:"outline",onClick:g,children:"Cancel"}),v(I,{type:"button",className:"submit-button",onClick:d(l),children:"Save Schedule"})]})]})})]})]})})}r(So,"WorkScheduleSelectionForm");function It(e){let{components:t}=S(),{setValue:o,control:n,watch:a}=b(),c=a(e.name),[d,F]=$t(c),{workHoursSummary:f,breakSummary:u}=Tt(d),s=Dt(d);Co(()=>{o(e.name,d)},[d,e.name,o]);function i(l){F(l)}r(i,"onSubmit");let m=e.component||t?.["work-schedule"];return m?v(k,{control:n,name:e.name,render:({field:l,fieldState:g})=>v(m,{field:{...l,onChange:r(p=>{l.onChange(p),e.onChange?.(p)},"onChange")},fieldState:g,fieldData:{...e,defaultFormattedValue:{workHoursSummary:f,breakSummary:u,totalWorkHours:s}}})}):B("div",{className:"flex flex-col gap-3 RemoteFlows__WorkScheduleField",children:[v("p",{className:"text-sm RemoteFlows__WorkScheduleField__Title",children:"Work hours"}),B("div",{className:"flex flex-col gap-1 RemoteFlows__WorkScheduleField__Summary",children:[v("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__WorkHours",dangerouslySetInnerHTML:{__html:f.join(", ")}}),v("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Break",children:u.join()}),B("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Total",children:["Total of ",v("span",{children:s})," hours per week"]}),v(So,{defaultSchedule:d,onSubmit:i})]})]})}r(It,"WorkScheduleField");import{useState as ko}from"react";import{jsx as q,jsxs as No}from"react/jsx-runtime";function Mt({label:e,name:t,options:o,defaultValue:n,description:a,onChange:c,component:d,...F}){let{control:f}=b(),{components:u}=S(),[s,i]=ko();return q(k,{defaultValue:n,control:f,name:t,render:({field:m,fieldState:l})=>{let g=d||u?.["multi-select"];if(g){let h={label:e,name:t,options:o,defaultValue:n,description:a,onChange:c,...F};return q(g,{field:{...m,onChange:r(x=>{m.onChange(x),c?.(x)},"onChange")},fieldState:l,fieldData:h})}let p=s||o.filter(h=>m.value.includes(h.value));return No(w,{"data-field":t,className:`RemoteFlows__SelectField__Item__${t}`,children:[q(N,{className:"RemoteFlows__SelectField__Label",children:e}),q(R,{children:q(fe,{options:o,selected:p,onChange:h=>{let x=h.map(({value:C})=>C);m.onChange(x),c?.(x),i(h)},...F})}),a&&q(P,{children:a}),l.error&&q(D,{})]})}})}r(Mt,"MultiSelectField");import{jsx as wo}from"react/jsx-runtime";var Et=r(e=>wo(pe,{maxLength:15,...e}),"MoneyField");var Ee={checkbox:le,text:A,email:Ct,money:Et,select:ct,"multi-select":Mt,radio:mt,number:pe,file:it,date:st,textarea:vt,countries:_t,hidden:bt,"work-schedule":It};import{AlertCircle as Ro}from"lucide-react";import{jsx as he,jsxs as Po}from"react/jsx-runtime";function Wt({title:e,description:t,severity:o}){let{components:n}=S();if(n?.statement){let a=n?.statement;return he(a,{data:{title:e,description:oe(t),severity:o}})}return Po(tt,{variant:"warning",children:[he(Ro,{className:"h-4 w-4"}),e&&he(ot,{children:e}),t&&he(rt,{dangerouslySetInnerHTML:{__html:oe(t)}})]})}r(Wt,"Statement");import{Fragment as Io,jsx as H,jsxs as Q}from"react/jsx-runtime";var $o=r(({isExpanded:e,onToggle:t,className:o,...n})=>H(I,{type:"button",className:y("RemoteFlows__Button RemoteFlows__FieldSetField__ToggleButton",o),variant:"default",onClick:t,...n,children:e?"Remove":"Define"}),"DefaultToggleButton");function Bt({label:e,name:t,fields:o,description:n,components:a,statement:c,isFlatFieldset:d,extra:F,variant:f="outset",features:u,meta:s}){let{helpCenter:i}=s||{},{watch:m,setValue:l,trigger:g,formState:p}=b(),{components:h}=S(),x=u?.toggle?.stateField,C=x?m(x):u?.toggle?.defaultExpanded??!0,T=o.map(({name:_})=>`${t}.${_}`),j=m(T),We=Lt(j),ee=Lt(null),Ht=r(()=>{x&&l(x,!C)},"toggleExpanded");To(()=>{let _=j,re=We.current,_e=p.isSubmitted||p.submitCount>0,He=!1;for(let te=0;te<_.length;te++)if(_[te]!==void 0&&re[te]!==_[te]){He=!0;break}return He&&_e&&(ee.current&&clearTimeout(ee.current),ee.current=setTimeout(()=>{g()},50)),We.current=[..._],()=>{ee.current&&clearTimeout(ee.current)}},[j,g,p.isSubmitted,p.submitCount]);let At=h?.fieldsetToggle||$o,Le=`${t}-content`,Be=`${t}-header`;return Q("fieldset",{className:y("border-1 border-input p-4 rounded-xl","RemoteFlows__FieldSetField",`RemoteFlows__FieldSetField__${t}`),children:[H("legend",{className:y("text-sm font-semibold px-2",f==="inset"&&"hidden"),children:e}),i?.callToAction&&i?.id&&f==="outset"&&H(ye,{className:"RemoteFlows__FieldSetField__HelpCenterLink mb-3",zendeskId:i.id,children:i.callToAction}),f==="inset"&&Q(Io,{children:[Q("div",{className:"RemoteFlows__FieldSetField__Header",id:Be,"data-state":C?"expanded":"collapsed","aria-expanded":C,children:[H("h3",{className:y("RemoteFlows__FieldSetField__Title"),children:e}),u?.toggle?.enabled&&H(At,{isExpanded:C,onToggle:Ht,"aria-expanded":C,"aria-controls":Le,"aria-label":`${C?"Hide":"Show"} ${e}`,className:y("RemoteFlows__FieldSetField__Toggle",u.toggle?.className),children:C?u.toggle.labels?.collapse??"Remove":u.toggle.labels?.expand??"Define"})]}),i?.callToAction&&i?.id&&H(ye,{className:"RemoteFlows__FieldSetField__HelpCenterLink mb-3",zendeskId:i.id,children:i.callToAction})]}),C&&Q("div",{id:Le,"aria-labelledby":Be,role:"region",children:[n?H("div",{className:"mb-5 RemoteFlows__FieldSetField__Description",dangerouslySetInnerHTML:{__html:oe(n)}}):null,Q("div",{className:"grid gap-4",children:[o.map(_=>{if(_.calculateDynamicProperties&&(_={..._,..._.calculateDynamicProperties(j,_)||{}}),_.isVisible===!1||_.deprecated)return null;if(_.Component){let{Component:_e}=_;return H(_e,{..._},_.name)}if(_.type==="fieldset")return H(Bt,{..._,name:`${d?_.name:`${t}.${_.name}`}`,components:a},`${d?_.name:`${t}.${_.name}`}`);if(_.type==="fieldset-flat")return H(Bt,{..._,name:`${d?_.name:`${t}.${_.name}`}`,components:a,isFlatFieldset:!0},`${d?_.name:`${t}.${_.name}`}`);let re=Ee[_.type];return _.type==="select"&&_.multiple&&(re=Ee["multi-select"]),Q(Do,{children:[H(re,{..._,name:`${d?_.name:`${t}.${_.name}`}`,component:a?.[_.type]}),_.extra?_.extra:null]},`${d?_.name:`${t}.${_.name}`}`)}),F||null,c?H(Wt,{...c}):null]})]})]})}r(Bt,"FieldSetField");export{Ee as a,Wt as b,Bt as c};
2
- //# sourceMappingURL=chunk-DB7ITLRX.js.map
1
+ import{a as A}from"./chunk-BV3PGYSH.js";import{a as ve,b as Ge,c as Je,d as qe,e as je,f as Ke,g as Ye,h as Ze,i as Xe,j as xe,k as et,l as be,m as Se,o as ke,q as tt,r as ot,s as rt}from"./chunk-D6X2WCEG.js";import{b as Qe}from"./chunk-HPHWQU34.js";import{b as ye}from"./chunk-CDRDLO4A.js";import{a as Ce,b as I}from"./chunk-WVDTHFGS.js";import{b as S}from"./chunk-3ZWDIEEM.js";import{a as ne,b as ae,c as b,d as Ae,e as Oe,f as ze,g as Ue,h as k,i as w,j as N,k as R,l as P,m as D}from"./chunk-CNDSIADP.js";import{g as Ve}from"./chunk-PAQW5BFW.js";import{a as y,e as oe}from"./chunk-43WMZDDH.js";import{a as r}from"./chunk-P37U34EQ.js";import{Fragment as Do,useEffect as To,useRef as Lt}from"react";import{Fragment as Ot,jsx as O,jsxs as se}from"react/jsx-runtime";function le({name:e,defaultValue:t,description:o,label:n,onChange:a,multiple:c,options:d,component:F,...f}){let{components:u}=S(),{control:s}=b(),i=r((m,l,g)=>{let p=g.value?[...g.value]:[];l?p.includes(m)||g.onChange([...p,m]):g.onChange(p.filter(h=>h!==m))},"handleCheckboxChange");return O(k,{control:s,name:e,defaultValue:t,render:({field:m,fieldState:l})=>{let g=F||u?.checkbox;if(g){let p={name:e,description:o,label:n,defaultValue:t,multiple:c,options:d,...f};return O(g,{field:{...m,onChange:r(h=>{if(c){let{checked:x,value:C}=h.target;i(C,x,m),a?.(x);return}m.onChange(h),a?.(h)},"onChange")},fieldState:l,fieldData:p})}return se(w,{"data-field":e,className:y(`RemoteFlows__CheckBoxField__Item__${e}`),children:[O(R,{children:se(Ot,{children:[d&&c?O(N,{children:n}):null,d&&c?d.map(p=>se("div",{className:"flex space-x-2",children:[O(ve,{id:p.value,onCheckedChange:h=>{i(p.value,h===!0,m),a?.(h,p.value)},checked:m.value?.includes(p.value),className:"RemoteFlows__CheckBox__Input"}),O(N,{htmlFor:p.value,className:"mb-0 RemoteFlows__CheckBox__Label",children:p.label})]},p.value)):se("div",{className:"flex space-x-2",children:[O(ve,{id:e,onCheckedChange:p=>{m.onChange(p),a?.(p)},checked:m.value,className:"RemoteFlows__CheckBox__Input"}),O(N,{htmlFor:e,className:"mb-0 RemoteFlows__CheckBox__Label",children:n})]})]})}),o&&O(P,{children:o}),l.error&&O(D,{})]})}})}r(le,"CheckBoxField");import{CalendarIcon as Gt}from"lucide-react";import{PopoverClose as Jt}from"@radix-ui/react-popover";import{ChevronLeft as zt,ChevronRight as Vt}from"lucide-react";import{DayPicker as Ut}from"react-day-picker";import{jsx as Ne}from"react/jsx-runtime";function nt({className:e,classNames:t,showOutsideDays:o=!0,...n}){return Ne(Ut,{showOutsideDays:o,className:y("p-3",e),classNames:{months:"flex flex-col sm:flex-row gap-2",month:"flex flex-col gap-4",caption:"flex justify-center pt-1 relative items-center w-full",caption_label:"text-sm font-medium",nav:"flex items-center gap-1",nav_button:y(Ce({variant:"outline"}),"size-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-x-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:y("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-range-end)]:rounded-r-md",n.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:y(Ce({variant:"ghost"}),"size-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start aria-selected:bg-primary aria-selected:text-primary-foreground",day_range_end:"day-range-end aria-selected:bg-primary aria-selected:text-primary-foreground",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:r(({className:a,...c})=>Ne(zt,{className:y("size-4",a),...c}),"IconLeft"),IconRight:r(({className:a,...c})=>Ne(Vt,{className:y("size-4",a),...c}),"IconRight")},...n})}r(nt,"Calendar");import*as z from"@radix-ui/react-popover";import{jsx as ie}from"react/jsx-runtime";function me({...e}){return ie(z.Root,{"data-slot":"popover",...e})}r(me,"Popover");function de({...e}){return ie(z.Trigger,{"data-slot":"popover-trigger",...e})}r(de,"PopoverTrigger");function ce({className:e,align:t="center",sideOffset:o=4,...n}){return ie(z.Portal,{children:ie(z.Content,{"data-slot":"popover-content",align:t,sideOffset:o,className:y("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...n})})}r(ce,"PopoverContent");import{format as at,parse as qt}from"date-fns";import{Fragment as jt,jsx as M,jsxs as we}from"react/jsx-runtime";function st({description:e,label:t,name:o,minDate:n,onChange:a,component:c,...d}){let{components:F}=S(),{control:f}=b(),u;return d.meta?.mot&&typeof d.meta.mot=="number"?u=Ve(d.meta.mot):n&&(u=qt(n,"yyyy-MM-dd",new Date)),M(k,{control:f,name:o,render:({field:s,fieldState:i})=>{let m=c||F?.date;if(m){let l={description:e,label:t,name:o,onChange:a,...u&&{minDate:u.toISOString()},...d};return M(m,{field:{...s,onChange:r(g=>{s.onChange(g),a?.(g)},"onChange")},fieldState:i,fieldData:l})}return we(w,{"data-field":o,className:`flex flex-col RemoteFlows__DatePickerField__Item__${o}`,children:[M(N,{className:"RemoteFlows__DatePickerField__Label",children:t}),we(me,{children:[M(de,{asChild:!0,children:M(R,{children:M("div",{children:we(I,{type:"button",variant:"outline",className:y("w-full pl-3 text-left font-normal",!s.value&&"text-muted-foreground"),"data-testid":`date-picker-button-${o}`,children:[s.value&&M(jt,{children:at(s.value,"yyyy-MM-dd")}),M(Gt,{className:"ml-auto h-4 w-4 opacity-50"})]})})})}),M(ce,{className:"w-auto p-0 RemoteFlows__DatepickerField__PopoverContent",align:"start",children:M(nt,{mode:"single",className:"RemoteFlows__DatepickerField__Calendar",selected:s.value?new Date(s.value):void 0,onSelect:l=>{s.onChange(l?at(l,"yyyy-MM-dd"):null),a?.(l)},defaultMonth:u,components:{DayContent:r(l=>M(Jt,{children:l.date.getDate()}),"DayContent")},...u&&{disabled:r(l=>l<u,"disabled")}})})]}),e?M(P,{children:e}):null,i.error&&M(D,{className:"RemoteFlows__DatePickerField__Error"})]})}})}r(st,"DatePickerField");import{useState as Kt,useRef as Yt}from"react";import{Upload as Zt,X as Xt}from"lucide-react";import{jsx as V,jsxs as ue}from"react/jsx-runtime";var Qt=r(e=>e?e.split(",").map(t=>t.trim().toUpperCase()).join(", "):null,"getAcceptedFormats");function lt({onChange:e,className:t,multiple:o,accept:n}){let[a,c]=Kt([]),d=Yt(null),F=r(i=>{i.preventDefault(),d.current?.click()},"handleClick"),f=r(i=>{if(i.target.files&&i.target.files.length>0){let m=Array.from(i.target.files);c(m),e(i)}},"handleChange"),u=r(i=>{c(m=>m.filter(l=>l!==i))},"onRemoveFile"),s=Qt(n);return ue("div",{className:y("flex flex-col items-start gap-4",t),children:[V("input",{type:"file",ref:d,onChange:f,className:"hidden","aria-label":"File upload",multiple:o,accept:n}),ue(I,{type:"button",onClick:F,className:"gap-2",children:[V(Zt,{className:"h-4 w-4"}),"Choose File"]}),s&&ue("div",{className:"text-sm text-gray-600",children:["Accepted formats:"," ",V("span",{className:"font-medium",children:s})]}),a.length===0&&V("div",{className:"text-sm",children:o?V("span",{className:"font-medium",children:"No files selected. You can select multiple files"}):V("span",{className:"font-medium",children:"No file selected."})}),a.length>0&&a.map((i,m)=>ue("div",{className:"text-sm flex items-center gap-2",children:["Selected file: ",V("span",{className:"font-medium",children:i.name})," (",Math.round(i.size/1024)," KB)",V(I,{variant:"ghost",onClick:()=>u(i),children:V(Xt,{})})]},m))]})}r(lt,"FileUploader");import{jsx as U,jsxs as ro}from"react/jsx-runtime";var eo=r(e=>new Promise((t,o)=>{let n=new FileReader;n.readAsDataURL(e),n.onload=()=>t(n.result),n.onerror=a=>o(a)}),"toBase64"),to=r(async e=>await Promise.all(e.map(async o=>{let n=await eo(o);return{name:o.name,content:n.split(",")[1]}})),"convertFilesToBase64"),oo=r((e,t)=>{if(!t)return null;for(let o of e)if(o.size>t){let n=Math.round(t/1048576),a=Math.round(o.size/(1024*1024));return`File "${o.name}" exceeds maximum size of ${n}MB (file is ${a}MB)`}return null},"validateFileSize");function it({name:e,description:t,label:o,multiple:n,onChange:a,component:c,accept:d,maxSize:F,...f}){let{components:u}=S(),{control:s,setError:i,clearErrors:m}=b(),l=r(async(g,p)=>{let h=g.target.files?Array.from(g.target.files):[],x=oo(h,F);if(x){i(e,{message:x});return}m(e);let C=await to(h);p.onChange(C),a?.(C)},"handleOnChange");return U(k,{control:s,name:e,render:({field:g,fieldState:p})=>{let h=c||u?.file;if(h){let x={name:e,description:t,label:o,multiple:n,accept:d,maxFileSize:F,...f};return U(h,{field:{...g,value:null,onChange:r(async C=>l(C,g),"onChange")},fieldState:p,fieldData:x})}return ro(w,{"data-field":e,className:`RemoteFlows__FileUpload__Item__${e}`,children:[U(N,{className:"RemoteFlows__FileUpload__Label",children:o}),U(R,{children:U(lt,{onChange:x=>l(x,g),multiple:n,className:y("RemoteFlows__FileUpload__Input"),accept:d})}),t&&U("div",{className:"flex items-center justify-between",children:U(P,{className:"RemoteFlows__FileUpload__Description",children:t})}),p.error&&U(D,{className:"RemoteFlows__FileUpload__Error"})]})}})}r(it,"FileUploadField");import{jsx as Re}from"react/jsx-runtime";function pe(e){let{components:t}=S(),{control:o}=b(),n=e.component||t?.number;return n?Re(k,{control:o,name:e.name,render:({field:a,fieldState:c})=>Re(n,{field:{...a,onChange:r(d=>{a.onChange(d),e.onChange?.(d)},"onChange")},fieldState:c,fieldData:e})}):Re(A,{...e,type:"text",inputMode:"decimal",pattern:"^[0-9.]*$"})}r(pe,"NumberField");import{Fragment as no}from"react";import{jsx as W,jsxs as Pe}from"react/jsx-runtime";function mt({name:e,defaultValue:t,description:o,label:n,options:a,onChange:c,component:d,...F}){let{components:f}=S(),{control:u}=b();return W(k,{control:u,name:e,defaultValue:t,render:({field:s,fieldState:i})=>{let m=d||f?.radio;if(m){let l={name:e,defaultValue:t,description:o,label:n,options:a,...F};return W(m,{field:{...s,onChange:r(g=>{s.onChange(g),c?.(g)},"onChange")},fieldState:i,fieldData:l})}return Pe(w,{className:y("space-y-3",`RemoteFlows__RadioGroupField__Item__${e}`),"data-field":e,children:[W(N,{children:n}),W(R,{children:W(Ge,{"aria-label":n||e,onValueChange:l=>{s.onChange(l),c?.(l)},value:s.value,className:"flex flex-col space-y-3",children:a?.map(l=>W(no,{children:Pe(w,{"data-field":e,className:"flex items-start space-x-3 space-y-0 gap-0 RemoteFlows__RadioField__Item",children:[W(R,{children:W(Je,{value:l.value,className:"RemoteFlows__RadioField__Input",disabled:l.disabled})}),Pe("div",{children:[W(N,{className:"font-normal mb-0 RemoteFlows__RadioField__Label",children:l.label}),l.description&&W(P,{className:"mt-2",children:l.description})]})]})},l.value))})}),o&&W(P,{children:o}),i.error&&W(D,{})]})}})}r(mt,"RadioGroupField");import{jsx as E,jsxs as dt}from"react/jsx-runtime";function ct({label:e,name:t,options:o,defaultValue:n,description:a,onChange:c,component:d,...F}){let{control:f}=b(),{components:u}=S();return E(k,{defaultValue:n,control:f,name:t,render:({field:s,fieldState:i})=>{let m=d||u?.select;if(m){let l={label:e,name:t,options:o,defaultValue:n,description:a,onChange:c,...F};return E(m,{field:{...s,onChange:r(g=>{let p=F.jsonType==="number"?Number(g):g;s.onChange(p),c?.(p)},"onChange")},fieldState:i,fieldData:l})}return dt(w,{"data-field":t,className:`RemoteFlows__SelectField__Item__${t}`,children:[E(N,{className:"RemoteFlows__SelectField__Label",children:e}),E(R,{children:E("div",{className:"relative",children:dt(qe,{value:s.value||"",onValueChange:l=>{let g=F.jsonType==="number"?Number(l):l;s.onChange(g),c?.(g)},children:[E(Ye,{className:"RemoteFlows__SelectField__Trigger","aria-invalid":!!i.error,"aria-label":e,children:E("span",{className:"absolute",children:E(Ke,{placeholder:e})})}),E(Ze,{className:"RemoteFlows__SelectField__Content",children:E(je,{className:"RemoteFlows__SelectField__Group",children:o.map(l=>E(Xe,{value:l.value,className:"RemoteFlows__SelectField__SelectItem",disabled:l.disabled,children:l.label},l.value))})})]})})}),a&&E(P,{children:a}),i.error&&E(D,{})]})}})}r(ct,"SelectField");import{useState as co}from"react";import{Fragment as ao,useState as so}from"react";import{Check as lo,ChevronDownIcon as io,X as mo}from"lucide-react";import{Command as K}from"cmdk";import{SearchIcon as sn}from"lucide-react";import{jsx as Y,jsxs as cn}from"react/jsx-runtime";function ut({className:e,...t}){return Y(K,{"data-slot":"command",className:y("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}r(ut,"Command");function pt({className:e,...t}){return Y(K.List,{"data-slot":"command-list",className:y("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}r(pt,"CommandList");function ft({...e}){return Y(K.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}r(ft,"CommandEmpty");function Ft({className:e,...t}){return Y(K.Group,{"data-slot":"command-group",className:y("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}r(Ft,"CommandGroup");function gt({className:e,...t}){return Y(K.Separator,{"data-slot":"command-separator",className:y("bg-border -mx-1 h-px",e),...t})}r(gt,"CommandSeparator");function ht({className:e,...t}){return Y(K.Item,{"data-slot":"command-item",className:y("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}r(ht,"CommandItem");import{jsx as L,jsxs as Z}from"react/jsx-runtime";function fe({options:e,selected:t,onChange:o,placeholder:n,...a}){let[c,d]=so(!1),F=r(s=>{o(t.filter(i=>i.value!==s.value))},"handleUnselect"),f=e.some(s=>s.category),u=e.reduce((s,i)=>{let m=i.category||"Uncategorized";return s[m]||(s[m]=[]),s[m].push(i),s},{});return Z(me,{open:c,onOpenChange:d,...a,children:[L(de,{children:Z(I,{variant:"outline",role:"combobox","aria-expanded":c,className:"w-full justify-between font-normal",type:"button",children:[L("div",{className:"flex gap-1 flex-wrap overflow-x-auto max-h-[2.5rem] items-center",children:t.length>0?t.map(s=>Z(Qe,{variant:"secondary",className:"mr-1 mb-1",children:[s.label,L("div",{role:"button",tabIndex:0,"aria-label":`remove ${s.label}`,className:"ml-1 ring-offset-background rounded-full outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer",onKeyDown:i=>{i.key==="Enter"&&F(s)},onMouseDown:i=>{i.preventDefault(),i.stopPropagation()},onClick:()=>F(s),children:L(mo,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]},s.label)):L("span",{className:"text-foreground",children:n})}),L(io,{className:"size-4"})]})}),L(ce,{align:"start",className:"w-full p-0",children:L(ut,{children:Z(pt,{children:[L(ft,{children:"No item found."}),Object.entries(u).map(([s,i],m)=>Z(ao,{children:[m>0&&L(gt,{}),L(Ft,{heading:f?s:void 0,children:i.map(l=>{let g=t.some(p=>p.value===l.value);return Z(ht,{onSelect:()=>{o(g?t.filter(p=>p.value!==l.value):[...t,l])},children:[L(lo,{className:y("mr-2 h-4 w-4",g?"opacity-100":"opacity-0")}),l.label]},l.label)})})]},s))]})})})]})}r(fe,"MultiSelect");import{jsx as G,jsxs as uo}from"react/jsx-runtime";function _t({label:e,name:t,options:o,defaultValue:n,description:a,onChange:c,$meta:d,component:F,...f}){let{control:u}=b(),{components:s}=S(),[i,m]=co([]);return G(k,{defaultValue:n,control:u,name:t,render:({field:l,fieldState:g})=>{let p=F||s?.countries;if(p){let C={label:e,name:t,options:o,defaultValue:n,description:a,onChange:c,$meta:d,...f};return G(p,{field:{...l,onChange:r(T=>{l.onChange(T),c?.(T)},"onChange")},fieldState:g,fieldData:C})}let h=[...Object.entries(d?.regions||{}).map(([C,T])=>({value:T,label:C,category:"Regions"})),...Object.entries(d?.subregions||{}).map(([C,T])=>({value:T,label:C,category:"Subregions"})),...o.map(C=>({...C,value:C.value,label:C.label,category:"Countries"}))],x=r(C=>{let T=C.map(({value:j})=>j);l.onChange(T),c?.(T),m(C)},"handleChange");return uo(w,{"data-field":t,className:`RemoteFlows__CountryField__Item__${t}`,children:[G(N,{className:"RemoteFlows__CountryField__Label",children:e}),G(R,{children:G(fe,{options:h,selected:i,onChange:x,...f})}),a&&G(P,{children:a}),g.error&&G(D,{})]})}})}r(_t,"CountryField");import*as yt from"react";import{jsx as po}from"react/jsx-runtime";var De=yt.forwardRef(({className:e,...t},o)=>po("textarea",{className:y("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...t}));De.displayName="Textarea";import{jsx as J,jsxs as Te}from"react/jsx-runtime";function vt({name:e,description:t,label:o,onChange:n,maxLength:a,component:c,...d}){let{components:F}=S(),{control:f}=b();return J(k,{control:f,name:e,render:({field:u,fieldState:s})=>{let i=c||F?.textarea;if(i){let l={name:e,description:t,label:o,maxLength:a,...d};return J(i,{field:{...u,onChange:r(g=>{u.onChange(g),n?.(g)},"onChange")},fieldState:s,fieldData:l})}let m=u.value?.length??0;return Te(w,{"data-field":e,className:`RemoteFlows__TextArea__Item__${e}`,children:[J(N,{className:"RemoteFlows__TextArea__Label",children:o}),J(R,{children:J(De,{...u,value:u.value??"",onChange:l=>{u.onChange(l),n?.(l)},className:y(s.error&&"border-red-500 focus-visible:ring-red-500","RemoteFlows__TextArea__Input"),placeholder:o})}),(t||a)&&Te("div",{className:"flex items-center justify-between",children:[t&&J(P,{className:"RemoteFlows__TextArea__Description",children:t}),a&&Te("span",{className:"text-sm ml-auto RemoteFlows__TextArea__MaxLength",children:[m,"/",a]})]}),s.error&&J(D,{className:"RemoteFlows__TextArea__Error"})]})}})}r(vt,"TextAreaField");import{jsx as $e}from"react/jsx-runtime";function Ct(e){let{components:t}=S(),{control:o}=b(),n=e.component||t?.email;return n?$e(k,{control:o,name:e.name,render:({field:a,fieldState:c})=>$e(n,{field:{...a,onChange:r(d=>{a.onChange(d),e.onChange?.(d)},"onChange")},fieldState:c,fieldData:e})}):$e(A,{...e,type:"email"})}r(Ct,"EmailField");import{jsx as xt}from"react/jsx-runtime";function bt(e){let{control:t}=b();return xt(k,{control:t,name:e.name,render:({field:o})=>xt("input",{...o,type:"hidden"})})}r(bt,"HiddenField");import vo,{useEffect as Co,useState as $t}from"react";var St=r((e,t,o)=>{if(e&&"reportValidity"in e){let n=ne(o,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},"r"),Ie=r((e,t)=>{for(let o in t.fields){let n=t.fields[o];n&&n.ref&&"reportValidity"in n.ref?St(n.ref,o,e):n&&n.refs&&n.refs.forEach(a=>St(a,o,e))}},"o"),Nt=r((e,t)=>{t.shouldUseNativeValidation&&Ie(e,t);let o={};for(let n in e){let a=ne(t.fields,n),c=Object.assign(e[n]||{},{ref:a&&a.ref});if(fo(t.names||Object.keys(e),n)){let d=Object.assign({},ne(o,n));ae(d,"root",c),ae(o,n,d)}else ae(o,n,c)}return o},"s"),fo=r((e,t)=>{let o=kt(t);return e.some(n=>kt(n).match(`^${o}\\.\\d+`))},"i");function kt(e){return e.replace(/\]|\[/g,"")}r(kt,"n");function wt(e,t,o){return t===void 0&&(t={}),o===void 0&&(o={}),function(n,a,c){try{return Promise.resolve(function(d,F){try{var f=(t.context&&process.env.NODE_ENV==="development"&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e[o.mode==="sync"?"validateSync":"validate"](n,Object.assign({abortEarly:!1},t,{context:a}))).then(function(u){return c.shouldUseNativeValidation&&Ie({},c),{values:o.raw?Object.assign({},n):u,errors:{}}}))}catch(u){return F(u)}return f&&f.then?f.then(void 0,F):f}(0,function(d){if(!d.inner)throw d;return{values:{},errors:Nt((F=d,f=!c.shouldUseNativeValidation&&c.criteriaMode==="all",(F.inner||[]).reduce(function(u,s){if(u[s.path]||(u[s.path]={message:s.message,type:s.type}),f){var i=u[s.path].types,m=i&&i[s.type];u[s.path]=Ae(s.path,f,u,s.type,m?[].concat(m,s.message):s.message)}return u},{})),c)};var F,f}))}catch(d){return Promise.reject(d)}}}r(wt,"o");import*as $ from"yup";import Rt from"lodash.groupby";import X from"lodash.capitalize";var Pt=60,Fe=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];function Fo(e){if(e<60)return`${e}m`;let t=Math.floor(e/Pt),o=e%Pt;return o>0?`${t}h${o}m`:`${t}h`}r(Fo,"convertBreakDurationToHours");function Dt(e){let t=e.reduce((o,n)=>n.hours+o,0);return Number(t.toFixed(2))}r(Dt,"calculateTotalWorkHours");function go(e,t){let o=t.map(({day:c})=>c.toLowerCase()),n=o.indexOf(e),a=null;for(;n<o.length&&!a;){let c=o[n],d=o[n+1],F=Fe.indexOf(c)+1;Fe[F]===d||(a=c),n+=1}return a}r(go,"findLastConsecutiveDay");function ho(e){return e.start_time&&e.end_time&&(typeof e.hours=="number"?e.hours:Number.parseInt(e.hours))>0}r(ho,"shouldSummarizeSchedule");function _o(e){return Number.parseInt(e.break_duration_minutes)>0}r(_o,"shouldSummarizeBreaks");function Tt(e){let t=e.filter(ho),o=Rt(t,F=>`${F.start_time}|${F.end_time}`),n=e.filter(_o),a=Rt(n,"break_duration_minutes"),c=Object.keys(o).map(F=>{let f=o[F],u=f[0].day,[s,i]=F.split("|"),m=`from <span>${s.replace(":","h")}</span> to <span>${i.replace(":","h")}</span>`,l=go(u,f),p=(l?f.findIndex(h=>h.day===l):-1)===f.length-1;return f.length===1?`${X(u)}, ${m}`:!p||!l?f.reduce((h,x,C)=>{let T=X(x.day);return C===f.length-1?`${h}and ${T}, ${m}`:`${h}<span>${T}</span>, `},""):`<span>${X(u)}</span> to <span>${X(l)}</span>, ${m}`}),d=Object.keys(a).reverse().map((F,f)=>{let u=f===0,s=a[F],i=Fo(parseInt(F,10));if(Object.keys(a).length===1)return`With ${i} daily breaks`;if(s.length===1){let m=`${i} break on ${X(s[0].day)}.`;return u?`With ${m}`:m}return s.reduce((m,l,g)=>{let p=X(l.day);return g===0?`${m} ${p}`:g===s.length-1?`${m}, and ${p}.`:`${m}, ${p}`},u?`With ${i} break on`:`${i} break on`)});return{workHoursSummary:c,breakSummary:d}}r(Tt,"buildWorkScheduleSummary");function Me(e){let{checked:t,start_time:o,end_time:n,break_duration_minutes:a}=e;if(!t)return 0;let[c,d]=o.split(":").map(Number),[F,f]=n.split(":").map(Number),u=c*60+d,m=(F*60+f-u-Number.parseInt(a||"0"))/60;return m===Math.floor(m)?m:Number(m.toFixed(2))}r(Me,"calculateHours");var yo={monday:"Mon",tuesday:"Tue",wednesday:"Wed",thursday:"Thu",friday:"Fri",saturday:"Sat",sunday:"Sun"};function ge(e){return yo[e]}r(ge,"getShortWeekday");import{jsx as v,jsxs as B}from"react/jsx-runtime";var xo=$.object({day:$.string().required(),checked:$.boolean().required(),start_time:$.string().matches(/^([01]\d|2[0-3]):([0-5]\d)$/,"Invalid time format (HH:mm)").when("checked",{is:!0,then:r(e=>e.required("Required"),"then"),otherwise:r(e=>e.optional().nullable(),"otherwise")}),end_time:$.string().matches(/^([01]\d|2[0-3]):([0-5]\d)$/,"Invalid time format (HH:mm)").when("checked",{is:!0,then:r(e=>e.required("Required"),"then"),otherwise:r(e=>e.optional().nullable(),"otherwise")}),hours:$.number().default(0),break_duration_minutes:$.string().default("0")}),bo=$.object({schedule:$.array(xo)});function So({defaultSchedule:e,onSubmit:t}){let[o,n]=$t(!1),a=Fe.map(p=>{let h=e.find(x=>x.day.toLowerCase()===ge(p).toLowerCase()||x.day.toLowerCase()===p.toLowerCase());return h?{...h,day:ge(p),checked:!0}:{...e[0],checked:!1,day:ge(p)}}),c=ze({defaultValues:{schedule:a},resolver:wt(bo)}),{handleSubmit:d,watch:F,reset:f,control:u,formState:s}=c,{fields:i}=Oe({name:"schedule",control:u}),m=F("schedule");function l(p){let h=p.schedule.filter(({checked:x})=>x).map(x=>({...x,hours:Me(x)}));t(h),n(!1)}r(l,"handleSubmitWorkingHours");function g(){f(),n(!1)}return r(g,"handleCancel"),v("div",{className:"flex items-center justify-between",children:B(xe,{open:o,onOpenChange:n,children:[v(et,{asChild:!0,children:v(I,{variant:"link",className:"flex items-center p-0 RemoteFlows__WorkScheduleSelectionForm__Trigger",children:"Edit Schedule"})}),B(be,{className:"max-w-5xl max-h-[90vh] overflow-y-auto px-8 py-4 RemoteFlows__WorkScheduleSelectionForm__Content",children:[v(Se,{children:v(ke,{className:"RemoteFlows__WorkScheduleSelectionForm__Title",children:"Edit employee working hours"})}),v(Ue,{...c,children:B("form",{className:"space-y-4 RemoteFlows__WorkScheduleSelectionForm__Form",children:[B("div",{className:"rounded-lg",children:[v("p",{className:"text-gray-600 text-sm mb-4 RemoteFlows__WorkScheduleSelectionForm__Description",children:"The times displayed are in the employee's time zone in the 24-hour format."}),B("div",{className:"grid grid-cols-12 gap-4 text-sm font-medium text-gray-500 uppercase tracking-wide RemoteFlows__WorkScheduleSelectionForm__Header",children:[v("div",{className:"col-span-2"}),v("div",{className:"col-span-3 text-center",children:"START"}),v("div",{className:"col-span-1 text-center"}),v("div",{className:"col-span-3 text-center",children:"END"}),v("div",{className:"col-span-2 text-center",children:"HOURS"})]}),v("div",{className:"RemoteFlows__WorkScheduleSelectionForm__Rows",children:i.map((p,h)=>{let x=m[h],C=Me(x);return B(vo.Fragment,{children:[B("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Hours",children:[v("div",{className:"col-span-2 flex items-center gap-3",children:v(le,{label:p.day,name:`schedule.${h}.checked`})}),v("div",{className:"col-span-3",children:v(A,{name:`schedule.${h}.start_time`,includeErrorMessage:!1})}),v("div",{className:"col-span-1 text-center text-gray-500",children:"to"}),v("div",{className:"col-span-3",children:v(A,{name:`schedule.${h}.end_time`,includeErrorMessage:!1})}),v("div",{className:"col-span-2 text-center text-gray-600",children:isNaN(C)?"-":`${C} hours`})]}),B("div",{className:"grid grid-cols-12 gap-4 items-center py-2 RemoteFlows__WorkScheduleSelectionForm__Row-Break",children:[v("div",{className:"col-span-2 text-gray-500",children:"Break"}),v("div",{className:"col-span-2",children:v(A,{name:`schedule.${h}.break_duration_minutes`,includeErrorMessage:!1})}),v("div",{className:"col-span-2 text-gray-500",children:"minutes"}),v("div",{className:"col-span-4"})]})]},p.id)})})]}),Object.keys(s.errors).length>0&&v("p",{className:"text-destructive text-sm mb-0",children:"Invalid time format (HH:mm)"}),B("div",{className:"flex gap-4 pt-4",children:[v(I,{type:"button",className:"reset-button",variant:"outline",onClick:g,children:"Cancel"}),v(I,{type:"button",className:"submit-button",onClick:d(l),children:"Save Schedule"})]})]})})]})]})})}r(So,"WorkScheduleSelectionForm");function It(e){let{components:t}=S(),{setValue:o,control:n,watch:a}=b(),c=a(e.name),[d,F]=$t(c),{workHoursSummary:f,breakSummary:u}=Tt(d),s=Dt(d);Co(()=>{o(e.name,d)},[d,e.name,o]);function i(l){F(l)}r(i,"onSubmit");let m=e.component||t?.["work-schedule"];return m?v(k,{control:n,name:e.name,render:({field:l,fieldState:g})=>v(m,{field:{...l,onChange:r(p=>{l.onChange(p),e.onChange?.(p)},"onChange")},fieldState:g,fieldData:{...e,defaultFormattedValue:{workHoursSummary:f,breakSummary:u,totalWorkHours:s}}})}):B("div",{className:"flex flex-col gap-3 RemoteFlows__WorkScheduleField",children:[v("p",{className:"text-sm RemoteFlows__WorkScheduleField__Title",children:"Work hours"}),B("div",{className:"flex flex-col gap-1 RemoteFlows__WorkScheduleField__Summary",children:[v("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__WorkHours",dangerouslySetInnerHTML:{__html:f.join(", ")}}),v("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Break",children:u.join()}),B("p",{className:"text-sm text-gray-500 RemoteFlows__WorkScheduleField__Summary__Total",children:["Total of ",v("span",{children:s})," hours per week"]}),v(So,{defaultSchedule:d,onSubmit:i})]})]})}r(It,"WorkScheduleField");import{useState as ko}from"react";import{jsx as q,jsxs as No}from"react/jsx-runtime";function Mt({label:e,name:t,options:o,defaultValue:n,description:a,onChange:c,component:d,...F}){let{control:f}=b(),{components:u}=S(),[s,i]=ko();return q(k,{defaultValue:n,control:f,name:t,render:({field:m,fieldState:l})=>{let g=d||u?.["multi-select"];if(g){let h={label:e,name:t,options:o,defaultValue:n,description:a,onChange:c,...F};return q(g,{field:{...m,onChange:r(x=>{m.onChange(x),c?.(x)},"onChange")},fieldState:l,fieldData:h})}let p=s||o.filter(h=>m.value.includes(h.value));return No(w,{"data-field":t,className:`RemoteFlows__SelectField__Item__${t}`,children:[q(N,{className:"RemoteFlows__SelectField__Label",children:e}),q(R,{children:q(fe,{options:o,selected:p,onChange:h=>{let x=h.map(({value:C})=>C);m.onChange(x),c?.(x),i(h)},...F})}),a&&q(P,{children:a}),l.error&&q(D,{})]})}})}r(Mt,"MultiSelectField");import{jsx as wo}from"react/jsx-runtime";var Et=r(e=>wo(pe,{maxLength:15,...e}),"MoneyField");var Ee={checkbox:le,text:A,email:Ct,money:Et,select:ct,"multi-select":Mt,radio:mt,number:pe,file:it,date:st,textarea:vt,countries:_t,hidden:bt,"work-schedule":It};import{AlertCircle as Ro}from"lucide-react";import{jsx as he,jsxs as Po}from"react/jsx-runtime";function Wt({title:e,description:t,severity:o}){let{components:n}=S();if(n?.statement){let a=n?.statement;return he(a,{data:{title:e,description:oe(t),severity:o}})}return Po(tt,{variant:"warning",children:[he(Ro,{className:"h-4 w-4"}),e&&he(ot,{children:e}),t&&he(rt,{dangerouslySetInnerHTML:{__html:oe(t)}})]})}r(Wt,"Statement");import{Fragment as Io,jsx as H,jsxs as Q}from"react/jsx-runtime";var $o=r(({isExpanded:e,onToggle:t,className:o,...n})=>H(I,{type:"button",className:y("RemoteFlows__Button RemoteFlows__FieldSetField__ToggleButton",o),variant:"default",onClick:t,...n,children:e?"Remove":"Define"}),"DefaultToggleButton");function Bt({label:e,name:t,fields:o,description:n,components:a,statement:c,isFlatFieldset:d,extra:F,variant:f="outset",features:u,meta:s}){let{helpCenter:i}=s||{},{watch:m,setValue:l,trigger:g,formState:p}=b(),{components:h}=S(),x=u?.toggle?.stateField,C=x?m(x):u?.toggle?.defaultExpanded??!0,T=o.map(({name:_})=>`${t}.${_}`),j=m(T),We=Lt(j),ee=Lt(null),Ht=r(()=>{x&&l(x,!C)},"toggleExpanded");To(()=>{let _=j,re=We.current,_e=p.isSubmitted||p.submitCount>0,He=!1;for(let te=0;te<_.length;te++)if(_[te]!==void 0&&re[te]!==_[te]){He=!0;break}return He&&_e&&(ee.current&&clearTimeout(ee.current),ee.current=setTimeout(()=>{g()},50)),We.current=[..._],()=>{ee.current&&clearTimeout(ee.current)}},[j,g,p.isSubmitted,p.submitCount]);let At=h?.fieldsetToggle||$o,Le=`${t}-content`,Be=`${t}-header`;return Q("fieldset",{className:y("border-1 border-input p-4 rounded-xl","RemoteFlows__FieldSetField",`RemoteFlows__FieldSetField__${t}`),children:[H("legend",{className:y("text-sm font-semibold px-2",f==="inset"&&"hidden"),children:e}),i?.callToAction&&i?.id&&f==="outset"&&H(ye,{className:"RemoteFlows__FieldSetField__HelpCenterLink mb-3",zendeskId:i.id,children:i.callToAction}),f==="inset"&&Q(Io,{children:[Q("div",{className:"RemoteFlows__FieldSetField__Header",id:Be,"data-state":C?"expanded":"collapsed","aria-expanded":C,children:[H("h3",{className:y("RemoteFlows__FieldSetField__Title"),children:e}),u?.toggle?.enabled&&H(At,{isExpanded:C,onToggle:Ht,"aria-expanded":C,"aria-controls":Le,"aria-label":`${C?"Hide":"Show"} ${e}`,className:y("RemoteFlows__FieldSetField__Toggle",u.toggle?.className),children:C?u.toggle.labels?.collapse??"Remove":u.toggle.labels?.expand??"Define"})]}),i?.callToAction&&i?.id&&H(ye,{className:"RemoteFlows__FieldSetField__HelpCenterLink mb-3",zendeskId:i.id,children:i.callToAction})]}),C&&Q("div",{id:Le,"aria-labelledby":Be,role:"region",children:[n?H("div",{className:"mb-5 RemoteFlows__FieldSetField__Description",dangerouslySetInnerHTML:{__html:oe(n)}}):null,Q("div",{className:"grid gap-4",children:[o.map(_=>{if(_.calculateDynamicProperties&&(_={..._,..._.calculateDynamicProperties(j,_)||{}}),_.isVisible===!1||_.deprecated)return null;if(_.Component){let{Component:_e}=_;return H(_e,{..._},_.name)}if(_.type==="fieldset")return H(Bt,{..._,name:`${d?_.name:`${t}.${_.name}`}`,components:a},`${d?_.name:`${t}.${_.name}`}`);if(_.type==="fieldset-flat")return H(Bt,{..._,name:`${d?_.name:`${t}.${_.name}`}`,components:a,isFlatFieldset:!0},`${d?_.name:`${t}.${_.name}`}`);let re=Ee[_.type];return _.type==="select"&&_.multiple&&(re=Ee["multi-select"]),Q(Do,{children:[H(re,{..._,name:`${d?_.name:`${t}.${_.name}`}`,component:a?.[_.type]}),_.extra?_.extra:null]},`${d?_.name:`${t}.${_.name}`}`)}),F||null,c?H(Wt,{...c}):null]})]})]})}r(Bt,"FieldSetField");export{Ee as a,Wt as b,Bt as c};
2
+ //# sourceMappingURL=chunk-TKAZTT3M.js.map
@@ -0,0 +1,2 @@
1
+ import{a as Le}from"./chunk-BSUVUGJG.js";import{a as ke}from"./chunk-VAIBLWOY.js";import{a as Ce,b as Oe,c as Pe,d as Me,e as Te}from"./chunk-EHS4ERDW.js";import{a as ue,b as ye,c as pe,f as _e,g as Se,h as be,i as ge,j as Fe,l as Ee,n as he}from"./chunk-AWJUS6JD.js";import{a as R}from"./chunk-2YTBWEC7.js";import{a as Ve}from"./chunk-PJBAQZ6G.js";import{c as h,d as L,f as W}from"./chunk-PAQW5BFW.js";import{g as V}from"./chunk-43WMZDDH.js";import{a as l}from"./chunk-P37U34EQ.js";import{useEffect as st,useMemo as d,useRef as at,useState as we}from"react";import rt from"lodash.mergewith";import{jsx as Be}from"react/jsx-runtime";var ct={employment_basic_information:"basic_information",contract_details:"contract_details"},lt={select_country:null,basic_information:"employment_basic_information",contract_details:"contract_details",benefits:null,review:null},mt=l(({isLoadingBasicInformationForm:f,isLoadingContractDetailsForm:J,isLoadingEmployment:D,isLoadingBenefitsOffersSchema:I,isLoadingBenefitOffers:i,isLoadingCompany:N,isLoadingCountries:C,employmentStatus:s,employmentId:_,currentStepName:a,basicInformationFields:A,contractDetailsFields:r})=>{let O=f||J||D||I||i||N||C,c=s&&Pe.includes(s),k=s&&!Me.includes(s),w=!!(_&&c&&a!=="review"),B=O||w,j=!!(w&&!O&&A.length>0&&r.length>0);return{isLoading:B,isNavigatingToReview:j,isEmploymentReadOnly:c,canInvite:k}},"getLoadingStates"),ht=l(({employmentId:f,companyId:J,countryCode:D,type:I,options:i,skipSteps:N,externalId:C,initialValues:s})=>{let _=at({select_country:{},basic_information:{},contract_details:{},benefits:{}}),[a,A]=we(f),[r,O]=we(D||null),{data:c,isLoading:k,refetch:w}=ue(a);f&&c?.country?.code&&!r&&O(c.country.code);let{data:B,isLoading:j}=pe(a),{data:q,isLoading:G,refetch:je}=ye(J),qe=N?.includes("select_country")?Oe:Ce,{fieldValues:S,stepState:n,setFieldValues:ve,previousStep:Re,nextStep:Je,goToStep:U,setStepValues:$}=Ve(qe),{selectCountryForm:v,isLoading:z}=Ee({jsfModify:i?.jsfModify?.select_country,queryOptions:{enabled:n.currentStep.name==="select_country"}}),K=be(i),Y=ge(i),Q=Fe(i),De=he(),{mutateAsync:Ie}=R(K),{mutateAsync:X}=R(Y),{mutateAsync:Ne}=R(Q),Ae=lt[n.currentStep.name]||"employment_basic_information",Ue=ct[Ae],xe=c?.[Ue]||{},Z=l(({form:e,options:o={},query:m={}})=>{let H=Object.keys(S).length>0?{...s,...n.values?.[n.currentStep.name],...S}:{...s,...xe};return _e({countryCode:r,form:e,fieldValues:H,query:m,options:{...o,queryOptions:{enabled:o.queryOptions?.enabled??!0},jsonSchemaVersion:o.jsonSchemaVersion}})},"useJSONSchema"),He=!!(r&&(n.currentStep.name==="basic_information"||f)),We=!!(r&&(n.currentStep.name==="contract_details"||f)),{data:u,isLoading:ee}=Z({form:"employment_basic_information",options:{jsfModify:i?.jsfModify?.basic_information,jsonSchemaVersion:i?.jsonSchemaVersion,queryOptions:{enabled:He}}}),b=i?.jsfModify?.contract_details?.fields?.annual_gross_salary,x=b&&typeof b=="object"&&"presentation"in b?b.presentation:void 0,te=i?.jsfModify?.contract_details?.fields?.equity_compensation,Ge=d(()=>({fields:{annual_gross_salary:{...b,presentation:{annual_gross_salary_conversion_properties:{label:x?.annual_gross_salary_conversion_properties?.label,description:x?.annual_gross_salary_conversion_properties?.description},desiredCurrency:q?.desired_currency,Component:l(e=>Be(Le,{desiredCurrency:q?.desired_currency||"",...e}),"Component")}},equity_compensation:{...te,presentation:{calculateDynamicProperties:l((e,o)=>{let m=e.equity_compensation?.offer_equity_compensation,M=o?.meta?.cost;return{extra:Be(ke,{offerEquity:m,equityCost:M})}},"calculateDynamicProperties")}}}}),[b,x,q?.desired_currency,te]),$e=Te(r,i?.jsonSchemaVersion),{data:y,isLoading:ne}=Z({form:"contract_details",query:{employment_id:a},options:{jsfModify:{...i?.jsfModify?.contract_details,fields:{...i?.jsfModify?.contract_details?.fields,...Ge.fields}},queryOptions:{enabled:We},jsonSchemaVersion:$e}}),{data:P,isLoading:oe}=Se(a,S,i),ie=d(()=>{if(n.currentStep.name==="benefits"){let e={...n.values?.[n.currentStep.name],...S};return rt({},B,e)}return{}},[n.currentStep.name,B,n.values,S]),t=d(()=>({select_country:v?.fields||[],basic_information:u?.fields||[],contract_details:y?.fields||[],benefits:P?.fields||[],review:[]}),[v?.fields,u?.fields,y?.fields,P?.fields]),ze={select_country:null,basic_information:u?.meta["x-jsf-fieldsets"],contract_details:y?.meta["x-jsf-fieldsets"],benefits:null,review:null},{country:Ke,basic_information:se={},contract_details:ae={},status:re}=c||{},ce=Ke?.code,le=n.currentStep.name,g=d(()=>L(t.select_country,{country:r||ce||""}),[t.select_country,r,ce]),F=d(()=>{let e={...s,...se};return L(t.basic_information,e)},[t.basic_information,se,s]),p=d(()=>{let e={...s,...ae};return L(t.contract_details,e)},[t.contract_details,ae,s]),E=d(()=>{let e={...s,...ie};return L(t.benefits,e)},[t.benefits,ie,s]),Ye=d(()=>c?{select_country:g,basic_information:W(t.basic_information,F),contract_details:c?.contract_details!==null?W(t.contract_details,p):p,benefits:E}:{select_country:g,basic_information:F,contract_details:p,benefits:E},[g,F,p,E,c,t]),{isLoading:Qe,isNavigatingToReview:me,isEmploymentReadOnly:Xe,canInvite:Ze}=d(()=>mt({isLoadingBasicInformationForm:ee,isLoadingContractDetailsForm:ne,isLoadingEmployment:k,isLoadingBenefitsOffersSchema:oe,isLoadingBenefitOffers:j,isLoadingCompany:G,isLoadingCountries:z,employmentId:f,employmentStatus:re,basicInformationFields:t.basic_information,contractDetailsFields:t.contract_details,currentStepName:le}),[ee,ne,k,oe,j,G,z,f,re,t.basic_information,t.contract_details,le]);st(()=>{me&&(_.current={select_country:V(g,t.select_country),basic_information:V(F,t.basic_information),contract_details:V(p,t.contract_details),benefits:V(E,t.benefits)},$({select_country:g,basic_information:F,contract_details:p,benefits:E,review:{}}),U("review"))},[F,E,p,U,me,g,$,t.basic_information,t.benefits,t.contract_details,t.select_country]);let de=l(e=>v&&n.currentStep.name==="select_country"?e:u&&n.currentStep.name==="basic_information"?h(e,u?.fields,{isPartialValidation:!1}):y&&n.currentStep.name==="contract_details"?h(e,y?.fields,{isPartialValidation:!1}):{},"parseFormValues");async function et(e){let o=n.currentStep.name;o in _.current&&(_.current[o]=V(e,t[o]));let m=de(e);switch(je(),n.currentStep.name){case"select_country":return O(m.country),Promise.resolve({data:{countryCode:m.country}});case"basic_information":{let M=!a&&r,H=a&&r&&c?.country&&c?.country.code!==r;if(M||H){let it={basic_information:m,type:I,country_code:r,external_id:C};try{let T=await Ie(it),fe=T.data?.data?.employment?.id;return A(fe),await De.mutateAsync({employmentId:fe,eligible_to_work_in_residing_country:"citizen",employer_or_work_restrictions:!1}),T}catch(T){throw console.error("Error creating onboarding:",T),T}}else if(a)return X({employmentId:a,basic_information:m,pricing_plan_details:{frequency:"monthly"},external_id:C});return}case"contract_details":return X({employmentId:a,external_id:C,...{contract_details:m,pricing_plan_details:{frequency:"monthly"}}});case"benefits":return Ne({employmentId:a,...e})}}l(et,"onSubmit");function tt(){Re()}l(tt,"back");function nt(){Je()}l(nt,"next");function ot(e){U(e)}return l(ot,"goTo"),{employmentId:a,creditRiskStatus:q?.default_legal_entity_credit_risk_status,fieldValues:S,stepState:n,fields:t[n.currentStep.name],isLoading:Qe,isSubmitting:K.isPending||Y.isPending||Q.isPending,initialValues:Ye,handleValidation:l(e=>{if(n.currentStep.name==="select_country")return v.handleValidation(e);if(n.currentStep.name==="benefits"&&P){let o=h(e,P?.fields,{isPartialValidation:!1});return P?.handleValidation(o)}if(u&&n.currentStep.name==="basic_information"){let o=h(e,u?.fields,{isPartialValidation:!1});return u?.handleValidation(o)}if(y&&n.currentStep.name==="contract_details"){let o=h(e,y?.fields,{isPartialValidation:!1});return y?.handleValidation(o)}return null},"handleValidation"),checkFieldUpdates:ve,parseFormValues:de,onSubmit:et,back:tt,next:nt,goTo:ot,meta:{fields:_.current,fieldsets:ze[n.currentStep.name]},refetchEmployment:w,employment:c,isEmploymentReadOnly:Xe,canInvite:Ze}},"useOnboarding");export{ht as a};
2
+ //# sourceMappingURL=chunk-UXVCNSHK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/Onboarding/hooks.tsx"],"sourcesContent":["import {\n Employment,\n EmploymentCreateParams,\n EmploymentFullParams,\n} from '@/src/client';\nimport { Fields } from '@remoteoss/json-schema-form';\n\nimport { useStepState, Step } from '@/src/flows/useStepState';\nimport {\n disabledInviteButtonEmploymentStatus,\n getContractDetailsSchemaVersion,\n reviewStepAllowedEmploymentStatus,\n STEPS,\n STEPS_WITHOUT_SELECT_COUNTRY,\n} from '@/src/flows/Onboarding/utils';\nimport { prettifyFormValues } from '@/src/lib/utils';\nimport {\n getInitialValues,\n enableAckFields,\n parseJSFToValidate,\n} from '@/src/components/form/utils';\nimport { mutationToPromise } from '@/src/lib/mutations';\nimport { FieldValues } from 'react-hook-form';\nimport { OnboardingFlowProps } from '@/src/flows/Onboarding/types';\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport mergeWith from 'lodash.mergewith';\nimport {\n useBenefitOffers,\n useBenefitOffersSchema,\n useCompany,\n useCountriesSchemaField,\n useCreateEmployment,\n useEmployment,\n useJSONSchemaForm,\n useUpdateBenefitsOffers,\n useUpdateEmployment,\n useUpsertContractEligibility,\n} from '@/src/flows/Onboarding/api';\nimport { FlowOptions, JSFModify, JSONSchemaFormType } from '@/src/flows/types';\nimport { AnnualGrossSalary } from '@/src/flows/Onboarding/components/AnnualGrossSalary';\nimport { $TSFixMe, JSFField, JSFFieldset, Meta } from '@/src/types/remoteFlows';\nimport { EquityPriceDetails } from '@/src/flows/Onboarding/components/EquityPriceDetails';\n\ntype OnboardingHookProps = Omit<OnboardingFlowProps, 'render'>;\n\nconst jsonSchemaToEmployment: Partial<\n Record<JSONSchemaFormType, keyof Employment>\n> = {\n employment_basic_information: 'basic_information',\n contract_details: 'contract_details',\n};\n\nconst stepToFormSchemaMap: Record<\n keyof typeof STEPS,\n JSONSchemaFormType | null\n> = {\n select_country: null,\n basic_information: 'employment_basic_information',\n contract_details: 'contract_details',\n benefits: null,\n review: null,\n};\n\nconst getLoadingStates = ({\n isLoadingBasicInformationForm,\n isLoadingContractDetailsForm,\n isLoadingEmployment,\n isLoadingBenefitsOffersSchema,\n isLoadingBenefitOffers,\n isLoadingCompany,\n isLoadingCountries,\n employmentStatus,\n employmentId,\n currentStepName,\n basicInformationFields,\n contractDetailsFields,\n}: {\n isLoadingBasicInformationForm: boolean;\n isLoadingContractDetailsForm: boolean;\n isLoadingEmployment: boolean;\n isLoadingBenefitsOffersSchema: boolean;\n isLoadingBenefitOffers: boolean;\n isLoadingCompany: boolean;\n isLoadingCountries: boolean;\n employmentStatus?: Employment['status'];\n employmentId?: string;\n currentStepName: string;\n basicInformationFields: Fields;\n contractDetailsFields: Fields;\n}) => {\n const initialLoading =\n isLoadingBasicInformationForm ||\n isLoadingContractDetailsForm ||\n isLoadingEmployment ||\n isLoadingBenefitsOffersSchema ||\n isLoadingBenefitOffers ||\n isLoadingCompany ||\n isLoadingCountries;\n\n const isEmploymentReadOnly =\n employmentStatus &&\n reviewStepAllowedEmploymentStatus.includes(employmentStatus);\n\n const canInvite =\n employmentStatus &&\n !disabledInviteButtonEmploymentStatus.includes(employmentStatus);\n\n const shouldHandleReadOnlyEmployment = Boolean(\n employmentId && isEmploymentReadOnly && currentStepName !== 'review',\n );\n\n const isLoading = initialLoading || shouldHandleReadOnlyEmployment;\n\n const isNavigatingToReview = Boolean(\n shouldHandleReadOnlyEmployment &&\n !initialLoading &&\n basicInformationFields.length > 0 &&\n contractDetailsFields.length > 0,\n );\n\n return {\n isLoading,\n isNavigatingToReview,\n isEmploymentReadOnly,\n canInvite,\n };\n};\n\nexport const useOnboarding = ({\n employmentId,\n companyId,\n countryCode,\n type,\n options,\n skipSteps,\n externalId,\n initialValues: onboardingInitialValues,\n}: OnboardingHookProps) => {\n const fieldsMetaRef = useRef<{\n select_country: Meta;\n basic_information: Meta;\n contract_details: Meta;\n benefits: Meta;\n }>({\n select_country: {},\n basic_information: {},\n contract_details: {},\n benefits: {},\n });\n const [internalEmploymentId, setInternalEmploymentId] = useState<\n string | undefined\n >(employmentId);\n const [internalCountryCode, setInternalCountryCode] = useState<string | null>(\n countryCode || null,\n );\n const {\n data: employment,\n isLoading: isLoadingEmployment,\n refetch: refetchEmployment,\n } = useEmployment(internalEmploymentId);\n\n // if the employment is loaded, country code has not been set yet\n // we set the internal country code with the employment country code\n if (employmentId && employment?.country?.code && !internalCountryCode) {\n setInternalCountryCode(employment.country.code);\n }\n\n const { data: benefitOffers, isLoading: isLoadingBenefitOffers } =\n useBenefitOffers(internalEmploymentId);\n const {\n data: company,\n isLoading: isLoadingCompany,\n refetch: refetchCompany,\n } = useCompany(companyId);\n const stepsToUse = skipSteps?.includes('select_country')\n ? STEPS_WITHOUT_SELECT_COUNTRY\n : STEPS;\n\n const {\n fieldValues,\n stepState,\n setFieldValues,\n previousStep,\n nextStep,\n goToStep,\n setStepValues,\n } = useStepState(\n stepsToUse as Record<keyof typeof STEPS, Step<keyof typeof STEPS>>,\n );\n\n const { selectCountryForm, isLoading: isLoadingCountries } =\n useCountriesSchemaField({\n jsfModify: options?.jsfModify?.select_country,\n queryOptions: {\n enabled: stepState.currentStep.name === 'select_country',\n },\n });\n\n const createEmploymentMutation = useCreateEmployment(options);\n const updateEmploymentMutation = useUpdateEmployment(options);\n const updateBenefitsOffersMutation = useUpdateBenefitsOffers(options);\n const updateContractEligibilityMutation = useUpsertContractEligibility();\n const { mutateAsync: createEmploymentMutationAsync } = mutationToPromise(\n createEmploymentMutation,\n );\n const { mutateAsync: updateEmploymentMutationAsync } = mutationToPromise(\n updateEmploymentMutation,\n );\n const { mutateAsync: updateBenefitsOffersMutationAsync } = mutationToPromise(\n updateBenefitsOffersMutation,\n );\n\n const formType =\n stepToFormSchemaMap[stepState.currentStep.name] ||\n 'employment_basic_information';\n const employmentKey = jsonSchemaToEmployment[formType] as keyof Employment;\n const serverEmploymentData = (employment?.[employmentKey] || {}) as Record<\n string,\n unknown\n >;\n\n const useJSONSchema = ({\n form,\n options: jsonSchemaOptions = {},\n query = {},\n }: {\n form: JSONSchemaFormType;\n options?: {\n jsfModify?: JSFModify;\n queryOptions?: { enabled?: boolean };\n jsonSchemaVersion?: FlowOptions['jsonSchemaVersion'];\n };\n query?: Record<string, string>;\n }) => {\n const hasUserEnteredAnyValues = Object.keys(fieldValues).length > 0;\n // when you write on the fields, the values are stored in the fieldValues state\n // when values are stored in the stepState is when the user has navigated to the step\n // and then we have the values from the server and the onboardingInitialValues that the user can inject,\n const mergedFormValues = hasUserEnteredAnyValues\n ? {\n ...onboardingInitialValues,\n ...stepState.values?.[stepState.currentStep.name], // Restore values for the current step\n ...fieldValues,\n }\n : {\n ...onboardingInitialValues,\n ...serverEmploymentData,\n };\n\n return useJSONSchemaForm({\n countryCode: internalCountryCode as string,\n form: form,\n fieldValues: mergedFormValues,\n query,\n options: {\n ...jsonSchemaOptions,\n queryOptions: {\n enabled: jsonSchemaOptions.queryOptions?.enabled ?? true,\n },\n jsonSchemaVersion: jsonSchemaOptions.jsonSchemaVersion,\n },\n });\n };\n\n const isBasicInformationDetailsEnabled = Boolean(\n internalCountryCode &&\n (stepState.currentStep.name === 'basic_information' ||\n Boolean(employmentId)),\n );\n\n const isContractDetailsEnabled = Boolean(\n internalCountryCode &&\n (stepState.currentStep.name === 'contract_details' ||\n Boolean(employmentId)),\n );\n\n const {\n data: basicInformationForm,\n isLoading: isLoadingBasicInformationForm,\n } = useJSONSchema({\n form: 'employment_basic_information',\n options: {\n jsfModify: options?.jsfModify?.basic_information,\n jsonSchemaVersion: options?.jsonSchemaVersion,\n queryOptions: {\n enabled: isBasicInformationDetailsEnabled,\n },\n },\n });\n\n const annualGrossSalaryField =\n options?.jsfModify?.contract_details?.fields?.annual_gross_salary;\n const annualSalaryFieldPresentation =\n annualGrossSalaryField &&\n typeof annualGrossSalaryField === 'object' &&\n 'presentation' in annualGrossSalaryField\n ? (\n annualGrossSalaryField as {\n presentation?: {\n annual_gross_salary_conversion_properties?: {\n label?: string;\n description?: string;\n };\n };\n }\n ).presentation\n : undefined;\n\n const equityCompensationField =\n options?.jsfModify?.contract_details?.fields?.equity_compensation;\n\n const customFields = useMemo(\n () => ({\n fields: {\n annual_gross_salary: {\n ...annualGrossSalaryField,\n presentation: {\n annual_gross_salary_conversion_properties: {\n label:\n annualSalaryFieldPresentation\n ?.annual_gross_salary_conversion_properties?.label,\n description:\n annualSalaryFieldPresentation\n ?.annual_gross_salary_conversion_properties?.description,\n },\n desiredCurrency: company?.desired_currency,\n Component: (props: JSFField & { currency: string }) => {\n return (\n <AnnualGrossSalary\n desiredCurrency={company?.desired_currency || ''}\n {...props}\n />\n );\n },\n },\n },\n equity_compensation: {\n ...equityCompensationField,\n presentation: {\n calculateDynamicProperties: (\n values: FieldValues,\n field: JSFField,\n ) => {\n const offerEquity =\n values.equity_compensation?.offer_equity_compensation;\n const equityCost = field?.meta?.cost;\n\n return {\n extra: (\n <EquityPriceDetails\n offerEquity={offerEquity}\n equityCost={equityCost as $TSFixMe}\n />\n ),\n };\n },\n },\n },\n },\n }),\n [\n annualGrossSalaryField,\n annualSalaryFieldPresentation,\n company?.desired_currency,\n equityCompensationField,\n ],\n );\n\n const effectiveContractDetailsJsonSchemaVersion =\n getContractDetailsSchemaVersion(\n internalCountryCode,\n options?.jsonSchemaVersion,\n );\n\n const { data: contractDetailsForm, isLoading: isLoadingContractDetailsForm } =\n useJSONSchema({\n form: 'contract_details',\n query: {\n employment_id: internalEmploymentId as string,\n },\n options: {\n jsfModify: {\n ...options?.jsfModify?.contract_details,\n fields: {\n ...options?.jsfModify?.contract_details?.fields,\n ...customFields.fields,\n },\n },\n queryOptions: {\n enabled: isContractDetailsEnabled,\n },\n jsonSchemaVersion: effectiveContractDetailsJsonSchemaVersion,\n },\n });\n\n const {\n data: benefitOffersSchema,\n isLoading: isLoadingBenefitsOffersSchema,\n } = useBenefitOffersSchema(\n internalEmploymentId as string,\n fieldValues,\n options,\n );\n\n const initialValuesBenefitOffers = useMemo(() => {\n if (stepState.currentStep.name === 'benefits') {\n const benefitsFormValues = {\n ...stepState.values?.[stepState.currentStep.name as keyof typeof STEPS], // Restore values for the current step\n ...fieldValues,\n };\n return mergeWith({}, benefitOffers, benefitsFormValues);\n }\n return {};\n }, [\n stepState.currentStep.name,\n benefitOffers,\n stepState.values,\n fieldValues,\n ]);\n\n const stepFields: Record<keyof typeof STEPS, Fields> = useMemo(\n () => ({\n select_country: selectCountryForm?.fields || [],\n basic_information: basicInformationForm?.fields || [],\n contract_details: contractDetailsForm?.fields || [],\n benefits: benefitOffersSchema?.fields || [],\n review: [],\n }),\n [\n selectCountryForm?.fields,\n basicInformationForm?.fields,\n contractDetailsForm?.fields,\n benefitOffersSchema?.fields,\n ],\n );\n\n const stepFieldsWithFlatFieldsets: Record<\n keyof typeof STEPS,\n JSFFieldset | null | undefined\n > = {\n select_country: null,\n basic_information: basicInformationForm?.meta['x-jsf-fieldsets'],\n contract_details: contractDetailsForm?.meta['x-jsf-fieldsets'],\n benefits: null,\n review: null,\n };\n\n const {\n country,\n basic_information: employmentBasicInformation = {},\n contract_details: employmentContractDetails = {},\n status: employmentStatus,\n } = employment || {};\n\n const employmentCountryCode = country?.code;\n const currentStepName = stepState.currentStep.name;\n\n const selectCountryInitialValues = useMemo(\n () =>\n getInitialValues(stepFields.select_country, {\n country: internalCountryCode || employmentCountryCode || '',\n }),\n [stepFields.select_country, internalCountryCode, employmentCountryCode],\n );\n\n const basicInformationInitialValues = useMemo(() => {\n const initialValues = {\n ...onboardingInitialValues,\n ...employmentBasicInformation,\n };\n\n return getInitialValues(stepFields.basic_information, initialValues);\n }, [\n stepFields.basic_information,\n employmentBasicInformation,\n onboardingInitialValues,\n ]);\n\n const contractDetailsInitialValues = useMemo(() => {\n const initialValues = {\n ...onboardingInitialValues,\n ...employmentContractDetails,\n };\n\n return getInitialValues(stepFields.contract_details, initialValues);\n }, [\n stepFields.contract_details,\n employmentContractDetails,\n onboardingInitialValues,\n ]);\n\n const benefitsInitialValues = useMemo(() => {\n const initialValues = {\n ...onboardingInitialValues,\n ...initialValuesBenefitOffers,\n };\n\n return getInitialValues(stepFields.benefits, initialValues);\n }, [\n stepFields.benefits,\n initialValuesBenefitOffers,\n onboardingInitialValues,\n ]);\n\n const initialValues = useMemo(() => {\n if (employment) {\n return {\n select_country: selectCountryInitialValues,\n // We don't store ack fields in the db, eg \"ack_start_date_ammendment\" for Argentina, and therefore is not returned in the employment response\n // So when an employmentId exists, it means that the user has already started the onboarding process, and we need to enable the ack fields\n basic_information: enableAckFields(\n stepFields['basic_information'],\n basicInformationInitialValues,\n ),\n contract_details:\n // if contract details is null, it means it has not been filled yet, so we can't enable the ack fields\n employment?.contract_details !== null\n ? enableAckFields(\n stepFields['contract_details'],\n contractDetailsInitialValues,\n )\n : contractDetailsInitialValues,\n benefits: benefitsInitialValues,\n };\n }\n return {\n select_country: selectCountryInitialValues,\n basic_information: basicInformationInitialValues,\n contract_details: contractDetailsInitialValues,\n benefits: benefitsInitialValues,\n };\n }, [\n selectCountryInitialValues,\n basicInformationInitialValues,\n contractDetailsInitialValues,\n benefitsInitialValues,\n employment,\n stepFields,\n ]);\n\n const { isLoading, isNavigatingToReview, isEmploymentReadOnly, canInvite } =\n useMemo(\n () =>\n getLoadingStates({\n isLoadingBasicInformationForm,\n isLoadingContractDetailsForm,\n isLoadingEmployment,\n isLoadingBenefitsOffersSchema,\n isLoadingBenefitOffers,\n isLoadingCompany,\n isLoadingCountries,\n employmentId,\n employmentStatus: employmentStatus,\n basicInformationFields: stepFields.basic_information,\n contractDetailsFields: stepFields.contract_details,\n currentStepName: currentStepName,\n }),\n [\n isLoadingBasicInformationForm,\n isLoadingContractDetailsForm,\n isLoadingEmployment,\n isLoadingBenefitsOffersSchema,\n isLoadingBenefitOffers,\n isLoadingCompany,\n isLoadingCountries,\n employmentId,\n employmentStatus,\n stepFields.basic_information,\n stepFields.contract_details,\n currentStepName,\n ],\n );\n\n useEffect(() => {\n if (isNavigatingToReview) {\n fieldsMetaRef.current = {\n select_country: prettifyFormValues(\n selectCountryInitialValues,\n stepFields.select_country,\n ),\n basic_information: prettifyFormValues(\n basicInformationInitialValues,\n stepFields.basic_information,\n ),\n contract_details: prettifyFormValues(\n contractDetailsInitialValues,\n stepFields.contract_details,\n ),\n benefits: prettifyFormValues(\n benefitsInitialValues,\n stepFields.benefits,\n ),\n };\n\n setStepValues({\n select_country: selectCountryInitialValues,\n basic_information: basicInformationInitialValues,\n contract_details: contractDetailsInitialValues,\n benefits: benefitsInitialValues,\n review: {},\n });\n\n goToStep('review');\n }\n }, [\n basicInformationInitialValues,\n benefitsInitialValues,\n contractDetailsInitialValues,\n goToStep,\n isNavigatingToReview,\n selectCountryInitialValues,\n setStepValues,\n stepFields.basic_information,\n stepFields.benefits,\n stepFields.contract_details,\n stepFields.select_country,\n ]);\n\n const parseFormValues = (values: FieldValues) => {\n if (selectCountryForm && stepState.currentStep.name === 'select_country') {\n return values;\n }\n if (\n basicInformationForm &&\n stepState.currentStep.name === 'basic_information'\n ) {\n return parseJSFToValidate(values, basicInformationForm?.fields, {\n isPartialValidation: false,\n });\n }\n\n if (\n contractDetailsForm &&\n stepState.currentStep.name === 'contract_details'\n ) {\n return parseJSFToValidate(values, contractDetailsForm?.fields, {\n isPartialValidation: false,\n });\n }\n\n return {};\n };\n\n async function onSubmit(values: FieldValues) {\n // Prettify values for the current step\n const currentStepName = stepState.currentStep.name;\n if (currentStepName in fieldsMetaRef.current) {\n fieldsMetaRef.current[\n currentStepName as keyof typeof fieldsMetaRef.current\n ] = prettifyFormValues(values, stepFields[currentStepName]);\n }\n\n const parsedValues = parseFormValues(values);\n refetchCompany();\n switch (stepState.currentStep.name) {\n case 'select_country': {\n setInternalCountryCode(parsedValues.country);\n return Promise.resolve({ data: { countryCode: parsedValues.country } });\n }\n case 'basic_information': {\n const isEmploymentNotLoaded =\n !internalEmploymentId && internalCountryCode;\n const hasChangedCountry =\n internalEmploymentId &&\n internalCountryCode &&\n employment?.country &&\n employment?.country.code !== internalCountryCode;\n if (isEmploymentNotLoaded || hasChangedCountry) {\n const payload: EmploymentCreateParams = {\n basic_information: parsedValues,\n type: type,\n country_code: internalCountryCode,\n external_id: externalId,\n };\n try {\n const response = await createEmploymentMutationAsync(payload);\n // @ts-expect-error the types from the response are not matching\n const employmentId = response.data?.data?.employment?.id;\n setInternalEmploymentId(employmentId);\n await updateContractEligibilityMutation.mutateAsync({\n employmentId: employmentId,\n eligible_to_work_in_residing_country: 'citizen',\n employer_or_work_restrictions: false,\n });\n\n return response;\n } catch (error) {\n console.error('Error creating onboarding:', error);\n throw error;\n }\n } else if (internalEmploymentId) {\n return updateEmploymentMutationAsync({\n employmentId: internalEmploymentId,\n basic_information: parsedValues,\n pricing_plan_details: {\n frequency: 'monthly',\n },\n external_id: externalId,\n });\n }\n\n return;\n }\n case 'contract_details': {\n const payload: EmploymentFullParams = {\n contract_details: parsedValues,\n pricing_plan_details: {\n frequency: 'monthly',\n },\n };\n return updateEmploymentMutationAsync({\n employmentId: internalEmploymentId as string,\n external_id: externalId,\n ...payload,\n });\n }\n\n case 'benefits': {\n return updateBenefitsOffersMutationAsync({\n employmentId: internalEmploymentId as string,\n ...values,\n });\n }\n }\n return;\n }\n\n function back() {\n previousStep();\n }\n\n function next() {\n nextStep();\n }\n\n function goTo(step: keyof typeof STEPS) {\n goToStep(step);\n }\n\n return {\n /**\n * Employment id passed useful to be used between components\n */\n employmentId: internalEmploymentId,\n\n /**\n * Credit risk status of the company, useful to know what to to show in the review step\n * The possible values are:\n * - not_started\n * - ready\n * - in_progress\n * - referred\n * - fail\n * - deposit_required\n * - no_deposit_required\n */\n\n creditRiskStatus: company?.default_legal_entity_credit_risk_status,\n /**\n * Current state of the form fields for the current step.\n */\n fieldValues,\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 onboarding schema\n */\n fields: stepFields[stepState.currentStep.name],\n /**\n * Loading state indicating if the onboarding schema is being fetched\n */\n isLoading: isLoading,\n /**\n * Loading state indicating if the onboarding mutation is in progress\n */\n isSubmitting:\n createEmploymentMutation.isPending ||\n updateEmploymentMutation.isPending ||\n updateBenefitsOffersMutation.isPending,\n /**\n * Initial form values\n */\n initialValues,\n /**\n * Function to validate form values against the onboarding schema\n * @param values - Form values to validate\n * @returns Validation result or null if no schema is available\n */\n handleValidation: (values: FieldValues) => {\n if (stepState.currentStep.name === 'select_country') {\n return selectCountryForm.handleValidation(values);\n }\n if (stepState.currentStep.name === 'benefits' && benefitOffersSchema) {\n const parsedValues = parseJSFToValidate(\n values,\n benefitOffersSchema?.fields,\n { isPartialValidation: false },\n );\n\n return benefitOffersSchema?.handleValidation(parsedValues);\n }\n if (\n basicInformationForm &&\n stepState.currentStep.name === 'basic_information'\n ) {\n const parsedValues = parseJSFToValidate(\n values,\n basicInformationForm?.fields,\n { isPartialValidation: false },\n );\n return basicInformationForm?.handleValidation(parsedValues);\n }\n\n if (\n contractDetailsForm &&\n stepState.currentStep.name === 'contract_details'\n ) {\n const parsedValues = parseJSFToValidate(\n values,\n contractDetailsForm?.fields,\n { isPartialValidation: false },\n );\n return contractDetailsForm?.handleValidation(parsedValues);\n }\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 /**\n * Function to parse form values before submission\n * @param values - Form values to parse\n * @returns Parsed form values\n */\n parseFormValues,\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 * Function to handle going to a specific step\n * @param step The step to go to.\n * @returns {void}\n */\n goTo,\n\n /**\n * Fields metadata for each step\n */\n meta: {\n fields: fieldsMetaRef.current,\n fieldsets: stepFieldsWithFlatFieldsets[stepState.currentStep.name],\n },\n\n /**\n * Function to refetch the employment data\n * @returns {void}\n */\n refetchEmployment,\n /**\n * Employment data\n */\n employment,\n\n /**\n * let's the user know that the employment cannot be edited, happens when employment.status is invited, created_awaiting_reserve or created_reserve_paid\n * @returns {boolean}\n */\n isEmploymentReadOnly,\n\n /**\n * let's the user know if the company can invite employees\n * @returns {boolean}\n */\n canInvite,\n };\n};\n"],"mappings":"meAwBA,OAAS,aAAAA,GAAW,WAAAC,EAAS,UAAAC,GAAQ,YAAAC,OAAgB,QACrD,OAAOC,OAAe,mBA+SN,cAAAC,OAAA,oBA3RhB,IAAMC,GAEF,CACF,6BAA8B,oBAC9B,iBAAkB,kBACpB,EAEMC,GAGF,CACF,eAAgB,KAChB,kBAAmB,+BACnB,iBAAkB,mBAClB,SAAU,KACV,OAAQ,IACV,EAEMC,GAAmBC,EAAA,CAAC,CACxB,8BAAAC,EACA,6BAAAC,EACA,oBAAAC,EACA,8BAAAC,EACA,uBAAAC,EACA,iBAAAC,EACA,mBAAAC,EACA,iBAAAC,EACA,aAAAC,EACA,gBAAAC,EACA,uBAAAC,EACA,sBAAAC,CACF,IAaM,CACJ,IAAMC,EACJZ,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,EAEIO,EACJN,GACAO,GAAkC,SAASP,CAAgB,EAEvDQ,EACJR,GACA,CAACS,GAAqC,SAAST,CAAgB,EAE3DU,EAAiC,GACrCT,GAAgBK,GAAwBJ,IAAoB,UAGxDS,EAAYN,GAAkBK,EAE9BE,EAAuB,GAC3BF,GACE,CAACL,GACDF,EAAuB,OAAS,GAChCC,EAAsB,OAAS,GAGnC,MAAO,CACL,UAAAO,EACA,qBAAAC,EACA,qBAAAN,EACA,UAAAE,CACF,CACF,EA/DyB,oBAiEZK,GAAgBrB,EAAA,CAAC,CAC5B,aAAAS,EACA,UAAAa,EACA,YAAAC,EACA,KAAAC,EACA,QAAAC,EACA,UAAAC,EACA,WAAAC,EACA,cAAeC,CACjB,IAA2B,CACzB,IAAMC,EAAgBC,GAKnB,CACD,eAAgB,CAAC,EACjB,kBAAmB,CAAC,EACpB,iBAAkB,CAAC,EACnB,SAAU,CAAC,CACb,CAAC,EACK,CAACC,EAAsBC,CAAuB,EAAIC,GA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,EAAA+H,GAAA,QAIF,CAIL,aAAchG,EAcd,iBAAkBU,GAAS,wCAI3B,YAAAM,EAIA,UAAAC,EAIA,OAAQqD,EAAWrD,EAAU,YAAY,IAAI,EAI7C,UAAW7B,GAIX,aACEsC,EAAyB,WACzBE,EAAyB,WACzBE,EAA6B,UAI/B,cAAAiD,GAMA,iBAAkB9G,EAACwF,GAAwB,CACzC,GAAIxC,EAAU,YAAY,OAAS,iBACjC,OAAOO,EAAkB,iBAAiBiC,CAAM,EAElD,GAAIxC,EAAU,YAAY,OAAS,YAAcgD,EAAqB,CACpE,IAAMuB,EAAeF,EACnB7B,EACAQ,GAAqB,OACrB,CAAE,oBAAqB,EAAM,CAC/B,EAEA,OAAOA,GAAqB,iBAAiBuB,CAAY,CAC3D,CACA,GACEvC,GACAhC,EAAU,YAAY,OAAS,oBAC/B,CACA,IAAMuE,EAAeF,EACnB7B,EACAR,GAAsB,OACtB,CAAE,oBAAqB,EAAM,CAC/B,EACA,OAAOA,GAAsB,iBAAiBuC,CAAY,CAC5D,CAEA,GACExB,GACA/C,EAAU,YAAY,OAAS,mBAC/B,CACA,IAAMuE,EAAeF,EACnB7B,EACAO,GAAqB,OACrB,CAAE,oBAAqB,EAAM,CAC/B,EACA,OAAOA,GAAqB,iBAAiBwB,CAAY,CAC3D,CAEA,OAAO,IACT,EAtCkB,oBA2ClB,kBAAmBtE,GAOnB,gBAAAmE,GAOA,SAAAE,GAMA,KAAAO,GAMA,KAAAC,GAOA,KAAAC,GAKA,KAAM,CACJ,OAAQlG,EAAc,QACtB,UAAWyE,GAA4BtD,EAAU,YAAY,IAAI,CACnE,EAMA,kBAAAX,EAIA,WAAAD,EAMA,qBAAAtB,GAMA,UAAAE,EACF,CACF,EAlwB6B","names":["useEffect","useMemo","useRef","useState","mergeWith","jsx","jsonSchemaToEmployment","stepToFormSchemaMap","getLoadingStates","__name","isLoadingBasicInformationForm","isLoadingContractDetailsForm","isLoadingEmployment","isLoadingBenefitsOffersSchema","isLoadingBenefitOffers","isLoadingCompany","isLoadingCountries","employmentStatus","employmentId","currentStepName","basicInformationFields","contractDetailsFields","initialLoading","isEmploymentReadOnly","reviewStepAllowedEmploymentStatus","canInvite","disabledInviteButtonEmploymentStatus","shouldHandleReadOnlyEmployment","isLoading","isNavigatingToReview","useOnboarding","companyId","countryCode","type","options","skipSteps","externalId","onboardingInitialValues","fieldsMetaRef","useRef","internalEmploymentId","setInternalEmploymentId","useState","internalCountryCode","setInternalCountryCode","employment","refetchEmployment","useEmployment","benefitOffers","useBenefitOffers","company","refetchCompany","useCompany","stepsToUse","STEPS_WITHOUT_SELECT_COUNTRY","STEPS","fieldValues","stepState","setFieldValues","previousStep","nextStep","goToStep","setStepValues","useStepState","selectCountryForm","useCountriesSchemaField","createEmploymentMutation","useCreateEmployment","updateEmploymentMutation","useUpdateEmployment","updateBenefitsOffersMutation","useUpdateBenefitsOffers","updateContractEligibilityMutation","useUpsertContractEligibility","createEmploymentMutationAsync","mutationToPromise","updateEmploymentMutationAsync","updateBenefitsOffersMutationAsync","formType","employmentKey","serverEmploymentData","useJSONSchema","form","jsonSchemaOptions","query","mergedFormValues","useJSONSchemaForm","isBasicInformationDetailsEnabled","isContractDetailsEnabled","basicInformationForm","annualGrossSalaryField","annualSalaryFieldPresentation","equityCompensationField","customFields","useMemo","props","AnnualGrossSalary","values","field","offerEquity","equityCost","EquityPriceDetails","effectiveContractDetailsJsonSchemaVersion","getContractDetailsSchemaVersion","contractDetailsForm","benefitOffersSchema","useBenefitOffersSchema","initialValuesBenefitOffers","benefitsFormValues","mergeWith","stepFields","stepFieldsWithFlatFieldsets","country","employmentBasicInformation","employmentContractDetails","employmentCountryCode","selectCountryInitialValues","getInitialValues","basicInformationInitialValues","initialValues","contractDetailsInitialValues","benefitsInitialValues","enableAckFields","useEffect","prettifyFormValues","parseFormValues","parseJSFToValidate","onSubmit","parsedValues","isEmploymentNotLoaded","hasChangedCountry","payload","response","error","back","next","goTo","step"]}
@@ -1,2 +1,2 @@
1
- import{a}from"./chunk-5MYWJJBQ.js";import{b as i}from"./chunk-PGWKJ6FK.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as d}from"react/jsx-runtime";function y({onSubmit:s,onSuccess:c,onError:t}){let{onboardingBag:o}=i(),u=e(async n=>{try{await s?.({countryCode:n.country});let r=await o.onSubmit(n);if(r?.data){await c?.(r?.data),o?.next();return}r?.error&&t?.({error:r.error,rawError:r.rawError,fieldErrors:[]})}catch(r){t?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit"),l=o.stepState.values?.select_country||o.initialValues.select_country;return d(a,{defaultValues:l,onSubmit:u})}e(y,"SelectCountryStep");export{y as a};
2
- //# sourceMappingURL=chunk-QDYWPG2R.js.map
1
+ import{a}from"./chunk-NW5EBNKN.js";import{b as i}from"./chunk-PGWKJ6FK.js";import{a as e}from"./chunk-P37U34EQ.js";import{jsx as d}from"react/jsx-runtime";function y({onSubmit:s,onSuccess:c,onError:t}){let{onboardingBag:o}=i(),u=e(async n=>{try{await s?.({countryCode:n.country});let r=await o.onSubmit(n);if(r?.data){await c?.(r?.data),o?.next();return}r?.error&&t?.({error:r.error,rawError:r.rawError,fieldErrors:[]})}catch(r){t?.({error:r,rawError:r,fieldErrors:[]})}},"handleSubmit"),l=o.stepState.values?.select_country||o.initialValues.select_country;return d(a,{defaultValues:l,onSubmit:u})}e(y,"SelectCountryStep");export{y as a};
2
+ //# sourceMappingURL=chunk-UYHBV7QJ.js.map
@@ -1,2 +1,2 @@
1
- import{b as u}from"./chunk-CFIJKJXD.js";import{a as F}from"./chunk-JO4722R7.js";import{f as l,g as p}from"./chunk-CNDSIADP.js";import{c as f}from"./chunk-PAQW5BFW.js";import{b as _}from"./chunk-TVZAFTPT.js";import{a as r}from"./chunk-P37U34EQ.js";import{useEffect as R}from"react";import{jsx as a}from"react/jsx-runtime";var w=["effective_date","reason_for_change","reason_for_change_description","additional_comments","additional_comments_toggle"];function x({onSubmit:b,onError:m,onSuccess:A}){let{formId:C,contractAmendment:{checkFieldUpdates:h,fields:s,onSubmit:S,stepState:g,initialValues:i,handleValidation:y}}=_(),V=u(y),e=l({resolver:V,defaultValues:g.values?.form||i,shouldUnregister:!0,mode:"onBlur"});R(()=>{let t=e?.watch(o=>{(Object.keys(e.formState.dirtyFields).length>0||e.formState.isDirty)&&h(o)});return()=>t?.unsubscribe()},[]);let v=r(async t=>{let o=!1;for(let[c,P]of Object.entries(t))if(!w.includes(c)&&i[c]!==P){o=!0;break}if(!o)return m?.({message:"no_changes_detected_contract_details"});let d=f(t,s,{isPartialValidation:!1});await b?.(d);let n=await S(t);n.error?m?.(n.error):await A?.(n.data)},"handleSubmit");return a(p,{...e,children:a("form",{id:C,"data-testid":"contract-amendment-form",onSubmit:e.handleSubmit(v),className:"space-y-4 RemoteFlows__ContractAmendmentForm",children:a(F,{fields:s})})})}r(x,"ContractAmendmentForm");export{x as a};
2
- //# sourceMappingURL=chunk-6KIQIVKA.js.map
1
+ import{a as F}from"./chunk-CCL5LNHC.js";import{b as u}from"./chunk-CFIJKJXD.js";import{f as l,g as p}from"./chunk-CNDSIADP.js";import{c as f}from"./chunk-PAQW5BFW.js";import{b as _}from"./chunk-TVZAFTPT.js";import{a as r}from"./chunk-P37U34EQ.js";import{useEffect as R}from"react";import{jsx as a}from"react/jsx-runtime";var w=["effective_date","reason_for_change","reason_for_change_description","additional_comments","additional_comments_toggle"];function x({onSubmit:b,onError:m,onSuccess:A}){let{formId:C,contractAmendment:{checkFieldUpdates:h,fields:s,onSubmit:S,stepState:g,initialValues:i,handleValidation:y}}=_(),V=u(y),e=l({resolver:V,defaultValues:g.values?.form||i,shouldUnregister:!0,mode:"onBlur"});R(()=>{let t=e?.watch(o=>{(Object.keys(e.formState.dirtyFields).length>0||e.formState.isDirty)&&h(o)});return()=>t?.unsubscribe()},[]);let v=r(async t=>{let o=!1;for(let[c,P]of Object.entries(t))if(!w.includes(c)&&i[c]!==P){o=!0;break}if(!o)return m?.({message:"no_changes_detected_contract_details"});let d=f(t,s,{isPartialValidation:!1});await b?.(d);let n=await S(t);n.error?m?.(n.error):await A?.(n.data)},"handleSubmit");return a(p,{...e,children:a("form",{id:C,"data-testid":"contract-amendment-form",onSubmit:e.handleSubmit(v),className:"space-y-4 RemoteFlows__ContractAmendmentForm",children:a(F,{fields:s})})})}r(x,"ContractAmendmentForm");export{x as a};
2
+ //# sourceMappingURL=chunk-WHVPDECD.js.map
@@ -0,0 +1,2 @@
1
+ import{a as e}from"./chunk-ZXGAFQXW.js";import{a as i}from"./chunk-LMYJ6V44.js";import{a as o}from"./chunk-RR55GUDT.js";import{a as m}from"./chunk-NX7MM6XR.js";var p={employee_communication:o,termination_details:e,paid_time_off:m,additional_information:i};export{p as a};
2
+ //# sourceMappingURL=chunk-XOA7GG4P.js.map
@@ -1,2 +1,2 @@
1
- import{a as p}from"./chunk-ZSCKSEAA.js";import{a as l}from"./chunk-ZE3YT3Q6.js";import{b as i}from"./chunk-ANQ4HVVK.js";import{b as m}from"./chunk-WVDTHFGS.js";import{b as a}from"./chunk-43WMZDDH.js";import{a as o}from"./chunk-P37U34EQ.js";import{Info as f}from"lucide-react";import{Fragment as d,jsx as e,jsxs as s}from"react/jsx-runtime";function B({contributionsTotal:u,currency:n,contributionsBreakdown:r}){return s("div",{children:[s("div",{className:"flex justify-between items-center mb-2",children:[e("h3",{className:"font-medium text-primary-foreground",children:"Employer Contributions"}),e("span",{className:"font-semibold text-lg",children:a(u,n)})]}),r?s(d,{children:[e(p,{className:"mb-3"}),e("div",{className:"space-y-3 pl-2",children:r.map((t,c)=>s("div",{className:"flex justify-between items-start text-sm",children:[s("div",{className:"flex items-start gap-2",children:[e("span",{children:t.name}),t.description&&e(l,{content:s(d,{children:[e("span",{children:t.description})," ",t.zendesk_article_url&&e(i,{zendeskId:Number(t.zendesk_article_id),children:"Learn more"})]}),children:s(m,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0",children:[e(f,{className:"h-3 w-3 text-gray-400"}),e("span",{className:"sr-only",children:"Info"})]})})]}),e("span",{children:a(t.amount,n)})]},c))})]}):null]})}o(B,"CostCalculatorContributionsBreakdown");export{B as a};
2
- //# sourceMappingURL=chunk-E6OBNWMU.js.map
1
+ import{a as l}from"./chunk-ZE3YT3Q6.js";import{a as p}from"./chunk-ZSCKSEAA.js";import{b as i}from"./chunk-CDRDLO4A.js";import{b as m}from"./chunk-WVDTHFGS.js";import{b as a}from"./chunk-43WMZDDH.js";import{a as o}from"./chunk-P37U34EQ.js";import{Info as f}from"lucide-react";import{Fragment as d,jsx as e,jsxs as s}from"react/jsx-runtime";function B({contributionsTotal:u,currency:n,contributionsBreakdown:r}){return s("div",{children:[s("div",{className:"flex justify-between items-center mb-2",children:[e("h3",{className:"font-medium text-primary-foreground",children:"Employer Contributions"}),e("span",{className:"font-semibold text-lg",children:a(u,n)})]}),r?s(d,{children:[e(p,{className:"mb-3"}),e("div",{className:"space-y-3 pl-2",children:r.map((t,c)=>s("div",{className:"flex justify-between items-start text-sm",children:[s("div",{className:"flex items-start gap-2",children:[e("span",{children:t.name}),t.description&&e(l,{content:s(d,{children:[e("span",{children:t.description})," ",t.zendesk_article_url&&e(i,{zendeskId:Number(t.zendesk_article_id),children:"Learn more"})]}),children:s(m,{variant:"ghost",size:"icon",className:"h-4 w-4 p-0",children:[e(f,{className:"h-3 w-3 text-gray-400"}),e("span",{className:"sr-only",children:"Info"})]})})]}),e("span",{children:a(t.amount,n)})]},c))})]}):null]})}o(B,"CostCalculatorContributionsBreakdown");export{B as a};
2
+ //# sourceMappingURL=chunk-ZJ7524CZ.js.map
@@ -0,0 +1,2 @@
1
+ import{a as tt,b as et,c as nt,d as ot,e as rt}from"./chunk-BDPCUDJB.js";import{a as at,b as it}from"./chunk-U6RM2N4A.js";import{c as X,d as Z}from"./chunk-EHS4ERDW.js";import{a as $,f as K,h as Y,l as z}from"./chunk-AWJUS6JD.js";import{a as T}from"./chunk-2YTBWEC7.js";import{a as Q}from"./chunk-PJBAQZ6G.js";import{c as p,d as V}from"./chunk-PAQW5BFW.js";import{g as w}from"./chunk-43WMZDDH.js";import{a as u}from"./chunk-P37U34EQ.js";import{useEffect as Nt,useMemo as m,useRef as qt,useState as k}from"react";var At={select_country:null,basic_information:"employment_basic_information",contract_details:null,pricing_plan:null,contract_preview:null,review:null},xt={employment_basic_information:"basic_information"},te=u(({countryCode:ct,externalId:st,employmentId:f,skipSteps:lt,options:y,initialValues:i})=>{let[r,B]=k(ct||null),[a,mt]=k(f),[M,dt]=k(void 0),v=qt({select_country:{},basic_information:{},contract_details:{},contract_preview:{},pricing_plan:{}}),ut=lt?.includes("select_country")?it:at,{fieldValues:b,stepState:e,setFieldValues:pt,previousStep:ft,nextStep:yt,goToStep:D,setStepValues:J}=Q(ut),{data:c,isLoading:I,refetch:_t}=$(a),{status:_}=c||{},j=_&&X.includes(_),St=_&&!Z.includes(_),gt=m(()=>_==="invited"?"invited":"not_invited",[_]),N=Y(y),q=ot(),A=et(),{mutateAsync:bt}=T(N),{mutateAsync:Ct}=T(q),{mutateAsync:ht}=T(A);f&&c?.country?.code&&!r&&B(c.country.code);let{selectCountryForm:P,isLoading:Ft}=z({jsfModify:y?.jsfModify?.select_country,queryOptions:{enabled:e.currentStep.name==="select_country"}}),Et=At[e.currentStep.name]||"contractor_basic_information",Vt=xt[Et],wt=c?.[Vt]||{},vt=u(({form:t,options:o={},query:S={}})=>{let g=Object.keys(b).length>0?{...i,...e.values?.[e.currentStep.name],...b}:{...i,...wt};return K({countryCode:r,form:t,fieldValues:g,query:S,options:{...o,queryOptions:{enabled:o.queryOptions?.enabled??!0}}})},"useJSONSchema"),Pt=!!(r&&(e.currentStep.name==="basic_information"||f)),Ot=!!(r&&(e.currentStep.name==="contract_details"||f)),{data:s,isLoading:Tt}=vt({form:"contractor_basic_information",options:{jsfModify:y?.jsfModify?.basic_information,queryOptions:{enabled:Pt},jsonSchemaVersion:y?.jsonSchemaVersion}}),{data:l,isLoading:Mt}=rt({countryCode:r,fieldValues:b,options:{queryOptions:{enabled:Ot},jsfModify:y?.jsfModify?.contract_details,jsonSchemaVersion:y?.jsonSchemaVersion}}),{data:d}=tt({fieldValues:b,options:{queryOptions:{enabled:e.currentStep.name==="contract_preview"}}}),{data:Dt,isLoading:It}=nt({employmentId:a,contractDocumentId:M,options:{queryOptions:{enabled:!!M}}}),n=m(()=>({select_country:P?.fields||[],basic_information:s?.fields||[],pricing_plan:[],contract_details:l?.fields||[],contract_preview:d?.fields||[],review:[]}),[P?.fields,s?.fields,l?.fields,d?.fields]),jt={select_country:null,basic_information:s?.meta["x-jsf-fieldsets"],pricing_plan:null,contract_details:l?.meta["x-jsf-fieldsets"],contract_preview:null,review:null},{country:Rt,basic_information:x={},contract_details:O={}}=c||{},U=Rt?.code,C=m(()=>V(n.select_country,{country:r||U||""}),[n.select_country,r,U]),h=m(()=>{let t={...i,...x};return V(n.basic_information,t)},[n.basic_information,x,i]),F=m(()=>{let t={...i,...O};return V(n.contract_details,t)},[n.contract_details,O,i]),H=m(()=>{let t={...i,...O};return V(n.contract_preview,t)},[n.contract_preview,O,i]),Lt=m(()=>({select_country:C,basic_information:h,contract_details:F,contract_preview:H,pricing_plan:{}}),[C,h,F,H]),G=m(()=>!!(!!(f&&j&&e.currentStep.name!=="review")&&!I&&n.basic_information.length>0&&n.contract_details.length>0),[f,j,I,n.basic_information.length,n.contract_details.length,e.currentStep.name]);Nt(()=>{G&&(v.current={select_country:w(C,n.select_country),basic_information:w(h,n.basic_information),contract_details:w(F,n.contract_details),contract_preview:{},pricing_plan:{}},J({select_country:C,basic_information:h,contract_details:F,contract_preview:{},pricing_plan:{},review:{}}),D("review"))},[G,D,C,h,F,J,n.select_country,n.basic_information,n.contract_details]);let kt=u(t=>{D(t)},"goTo"),W=u(t=>P&&e.currentStep.name==="select_country"?t:s&&e.currentStep.name==="basic_information"?p(t,s?.fields,{isPartialValidation:!1}):l&&e.currentStep.name==="contract_details"?p(t,l?.fields,{isPartialValidation:!1}):d&&e.currentStep.name==="contract_preview"?p(t,d?.fields,{isPartialValidation:!1}):e.currentStep.name==="pricing_plan"?t:{},"parseFormValues");async function Bt(t){let o=e.currentStep.name;o in v.current&&(v.current[o]=w(t,n[o]));let S=W(t);switch(e.currentStep.name){case"select_country":return B(S.country),Promise.resolve({data:{countryCode:S.country}});case"basic_information":{let R=!a&&r,g=a&&r&&c?.country&&c?.country.code!==r;if(R||g){let L={basic_information:S,type:"contractor",country_code:r,external_id:st};try{let E=await bt(L),Jt=E.data?.data?.employment?.id;return mt(Jt),E}catch(E){throw console.error("Error creating onboarding:",E),E}}else if(a)return Promise.resolve({data:{employmentId:a}});return}case"contract_details":{let g=await Ct({employmentId:a,payload:{contract_document:S}}),L=g.data?.data?.contract_document?.id;return dt(L),g}case"contract_preview":return ht({employmentId:a,contractDocumentId:M,payload:{signature:t.signature}});case"pricing_plan":return Promise.resolve({data:{pricingPlan:t}});default:throw new Error("Invalid step state")}}return u(Bt,"onSubmit"),{isLoading:Ft||Tt||I||Mt||It,fieldValues:b,stepState:e,checkFieldUpdates:pt,back:ft,next:yt,goTo:kt,onSubmit:Bt,fields:n[e.currentStep.name],meta:{fields:v.current,fieldsets:jt[e.currentStep.name]},parseFormValues:W,handleValidation:u(t=>{if(e.currentStep.name==="select_country")return P.handleValidation(t);if(s&&e.currentStep.name==="basic_information"){let o=p(t,s?.fields,{isPartialValidation:!1});return s?.handleValidation(o)}if(l&&e.currentStep.name==="contract_details"){let o=p(t,l?.fields,{isPartialValidation:!1});return l?.handleValidation(o)}if(d&&e.currentStep.name==="contract_preview"){let o=p(t,d?.fields,{isPartialValidation:!1});return d?.handleValidation(o)}return e.currentStep.name==="pricing_plan"?{formErrors:{},yupError:null}:null},"handleValidation"),initialValues:Lt,employmentId:a,refetchEmployment:_t,isSubmitting:N.isPending||q.isPending||A.isPending,documentPreviewPdf:Dt,canInvite:St,isEmploymentReadOnly:j,invitedStatus:gt,employment:c}},"useContractorOnboarding");export{te as a};
2
+ //# sourceMappingURL=chunk-ZPBKMAKR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/flows/ContractorOnboarding/hooks.tsx"],"sourcesContent":["import {\n CreateContractDocument,\n Employment,\n EmploymentCreateParams,\n} from '@/src/client/types.gen';\nimport {\n getInitialValues,\n parseJSFToValidate,\n} from '@/src/components/form/utils';\nimport {\n useContractorOnboardingDetailsSchema,\n useCreateContractorContractDocument,\n useGetContractDocumentSignatureSchema,\n useGetShowContractDocument,\n useSignContractDocument,\n} from '@/src/flows/ContractorOnboarding/api';\nimport { ContractorOnboardingFlowProps } from '@/src/flows/ContractorOnboarding/types';\nimport {\n STEPS,\n STEPS_WITHOUT_SELECT_COUNTRY,\n} from '@/src/flows/ContractorOnboarding/utils';\nimport {\n useCountriesSchemaField,\n useCreateEmployment,\n useEmployment,\n useJSONSchemaForm,\n} from '@/src/flows/Onboarding/api';\nimport {\n disabledInviteButtonEmploymentStatus,\n reviewStepAllowedEmploymentStatus,\n} from '@/src/flows/Onboarding/utils';\nimport { FlowOptions, JSFModify, JSONSchemaFormType } from '@/src/flows/types';\nimport { Step, useStepState } from '@/src/flows/useStepState';\nimport { mutationToPromise } from '@/src/lib/mutations';\nimport { prettifyFormValues } from '@/src/lib/utils';\nimport { $TSFixMe, JSFFieldset, Meta } from '@/src/types/remoteFlows';\nimport { Fields } from '@remoteoss/json-schema-form';\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { FieldValues } from 'react-hook-form';\n\ntype useContractorOnboardingProps = Omit<\n ContractorOnboardingFlowProps,\n 'render'\n>;\n\nconst stepToFormSchemaMap: Record<\n keyof typeof STEPS,\n JSONSchemaFormType | null\n> = {\n select_country: null,\n basic_information: 'employment_basic_information',\n contract_details: null,\n pricing_plan: null,\n contract_preview: null,\n review: null,\n};\n\nconst jsonSchemaToEmployment: Partial<\n Record<JSONSchemaFormType, keyof Employment>\n> = {\n employment_basic_information: 'basic_information',\n};\n\nexport const useContractorOnboarding = ({\n countryCode,\n externalId,\n employmentId,\n skipSteps,\n options,\n initialValues: onboardingInitialValues,\n}: useContractorOnboardingProps) => {\n const [internalCountryCode, setInternalCountryCode] = useState<string | null>(\n countryCode || null,\n );\n const [internalEmploymentId, setInternalEmploymentId] = useState<\n string | undefined\n >(employmentId);\n const [internalContractDocumentId, setInternalContractDocumentId] = useState<\n string | undefined\n >(undefined);\n const fieldsMetaRef = useRef<{\n select_country: Meta;\n basic_information: Meta;\n contract_details: Meta;\n contract_preview: Meta;\n pricing_plan: Meta;\n }>({\n select_country: {},\n basic_information: {},\n contract_details: {},\n contract_preview: {},\n pricing_plan: {},\n });\n\n const stepsToUse = skipSteps?.includes('select_country')\n ? STEPS_WITHOUT_SELECT_COUNTRY\n : STEPS;\n\n const {\n fieldValues,\n stepState,\n setFieldValues,\n previousStep,\n nextStep,\n goToStep,\n setStepValues,\n } = useStepState(\n stepsToUse as Record<keyof typeof STEPS, Step<keyof typeof STEPS>>,\n );\n\n const {\n data: employment,\n isLoading: isLoadingEmployment,\n refetch: refetchEmployment,\n } = useEmployment(internalEmploymentId);\n\n const { status: employmentStatus } = employment || {};\n\n const isEmploymentReadOnly =\n employmentStatus &&\n reviewStepAllowedEmploymentStatus.includes(employmentStatus);\n\n const canInvite =\n employmentStatus &&\n !disabledInviteButtonEmploymentStatus.includes(employmentStatus);\n\n const invitedStatus: 'invited' | 'not_invited' = useMemo(() => {\n const isInvited = employmentStatus === 'invited';\n\n return isInvited ? 'invited' : 'not_invited';\n }, [employmentStatus]);\n\n const createEmploymentMutation = useCreateEmployment(options);\n const createContractorContractDocumentMutation =\n useCreateContractorContractDocument();\n const signContractDocumentMutation = useSignContractDocument();\n\n const { mutateAsync: createEmploymentMutationAsync } = mutationToPromise(\n createEmploymentMutation,\n );\n\n const { mutateAsync: createContractorContractDocumentMutationAsync } =\n mutationToPromise(createContractorContractDocumentMutation);\n\n const { mutateAsync: signContractDocumentMutationAsync } = mutationToPromise(\n signContractDocumentMutation,\n );\n\n // if the employment is loaded, country code has not been set yet\n // we set the internal country code with the employment country code\n if (employmentId && employment?.country?.code && !internalCountryCode) {\n setInternalCountryCode(employment.country.code);\n }\n\n const { selectCountryForm, isLoading: isLoadingCountries } =\n useCountriesSchemaField({\n jsfModify: options?.jsfModify?.select_country,\n queryOptions: {\n enabled: stepState.currentStep.name === 'select_country',\n },\n });\n\n const formType =\n stepToFormSchemaMap[stepState.currentStep.name] ||\n 'contractor_basic_information';\n const employmentKey = jsonSchemaToEmployment[formType] as keyof Employment;\n const serverEmploymentData = (employment?.[employmentKey] || {}) as Record<\n string,\n unknown\n >;\n\n const useJSONSchema = ({\n form,\n options: jsonSchemaOptions = {},\n query = {},\n }: {\n form: JSONSchemaFormType;\n options?: {\n jsfModify?: JSFModify;\n queryOptions?: { enabled?: boolean };\n jsonSchemaVersion?: FlowOptions['jsonSchemaVersion'];\n };\n query?: Record<string, string>;\n }) => {\n const hasUserEnteredAnyValues = Object.keys(fieldValues).length > 0;\n // when you write on the fields, the values are stored in the fieldValues state\n // when values are stored in the stepState is when the user has navigated to the step\n // and then we have the values from the server and the onboardingInitialValues that the user can inject,\n const mergedFormValues = hasUserEnteredAnyValues\n ? {\n ...onboardingInitialValues,\n ...stepState.values?.[stepState.currentStep.name], // Restore values for the current step\n ...fieldValues,\n }\n : {\n ...onboardingInitialValues,\n ...serverEmploymentData,\n };\n\n return useJSONSchemaForm({\n countryCode: internalCountryCode as string,\n form: form,\n fieldValues: mergedFormValues,\n query,\n options: {\n ...jsonSchemaOptions,\n queryOptions: {\n enabled: jsonSchemaOptions.queryOptions?.enabled ?? true,\n },\n },\n });\n };\n\n const isBasicInformationDetailsEnabled = Boolean(\n internalCountryCode &&\n (stepState.currentStep.name === 'basic_information' ||\n Boolean(employmentId)),\n );\n\n const isContractorOnboardingDetailsEnabled = Boolean(\n internalCountryCode &&\n (stepState.currentStep.name === 'contract_details' ||\n Boolean(employmentId)),\n );\n\n const {\n data: basicInformationForm,\n isLoading: isLoadingBasicInformationForm,\n } = useJSONSchema({\n form: 'contractor_basic_information',\n options: {\n jsfModify: options?.jsfModify?.basic_information,\n queryOptions: {\n enabled: isBasicInformationDetailsEnabled,\n },\n jsonSchemaVersion: options?.jsonSchemaVersion,\n },\n });\n\n const {\n data: contractorOnboardingDetailsForm,\n isLoading: isLoadingContractorOnboardingDetailsForm,\n } = useContractorOnboardingDetailsSchema({\n countryCode: internalCountryCode as string,\n fieldValues: fieldValues,\n options: {\n queryOptions: {\n enabled: isContractorOnboardingDetailsEnabled,\n },\n jsfModify: options?.jsfModify?.contract_details,\n jsonSchemaVersion: options?.jsonSchemaVersion,\n },\n });\n\n const { data: signatureSchemaForm } = useGetContractDocumentSignatureSchema({\n fieldValues: fieldValues,\n options: {\n queryOptions: {\n enabled: stepState.currentStep.name === 'contract_preview',\n },\n },\n });\n const { data: documentPreviewPdf, isLoading: isLoadingDocumentPreviewForm } =\n useGetShowContractDocument({\n employmentId: internalEmploymentId as string,\n contractDocumentId: internalContractDocumentId as string,\n options: {\n queryOptions: {\n enabled: Boolean(internalContractDocumentId),\n },\n },\n });\n\n const stepFields: Record<keyof typeof STEPS, Fields> = useMemo(\n () => ({\n select_country: selectCountryForm?.fields || [],\n basic_information: basicInformationForm?.fields || [],\n pricing_plan: [],\n contract_details: contractorOnboardingDetailsForm?.fields || [],\n contract_preview: signatureSchemaForm?.fields || [],\n review: [],\n }),\n [\n selectCountryForm?.fields,\n basicInformationForm?.fields,\n contractorOnboardingDetailsForm?.fields,\n signatureSchemaForm?.fields,\n ],\n );\n\n const stepFieldsWithFlatFieldsets: Record<\n keyof typeof STEPS,\n JSFFieldset | null | undefined\n > = {\n select_country: null,\n basic_information: basicInformationForm?.meta['x-jsf-fieldsets'],\n pricing_plan: null,\n contract_details: contractorOnboardingDetailsForm?.meta['x-jsf-fieldsets'],\n contract_preview: null,\n review: null,\n };\n\n const {\n country,\n basic_information: employmentBasicInformation = {},\n contract_details: employmentContractDetails = {},\n } = employment || {};\n\n const employmentCountryCode = country?.code;\n\n const selectCountryInitialValues = useMemo(\n () =>\n getInitialValues(stepFields.select_country, {\n country: internalCountryCode || employmentCountryCode || '',\n }),\n [stepFields.select_country, internalCountryCode, employmentCountryCode],\n );\n\n const basicInformationInitialValues = useMemo(() => {\n const initialValues = {\n ...onboardingInitialValues,\n ...employmentBasicInformation,\n };\n\n return getInitialValues(stepFields.basic_information, initialValues);\n }, [\n stepFields.basic_information,\n employmentBasicInformation,\n onboardingInitialValues,\n ]);\n\n const contractDetailsInitialValues = useMemo(() => {\n const initialValues = {\n ...onboardingInitialValues,\n ...employmentContractDetails,\n };\n\n return getInitialValues(stepFields.contract_details, initialValues);\n }, [\n stepFields.contract_details,\n employmentContractDetails,\n onboardingInitialValues,\n ]);\n\n const contractPreviewInitialValues = useMemo(() => {\n // TODO: TBD not sure if contract preview needs to be populated with anything\n const initialValues = {\n ...onboardingInitialValues,\n ...employmentContractDetails,\n };\n\n return getInitialValues(stepFields.contract_preview, initialValues);\n }, [\n stepFields.contract_preview,\n employmentContractDetails,\n onboardingInitialValues,\n ]);\n\n const initialValues = useMemo(() => {\n return {\n select_country: selectCountryInitialValues,\n basic_information: basicInformationInitialValues,\n contract_details: contractDetailsInitialValues,\n contract_preview: contractPreviewInitialValues,\n pricing_plan: {},\n };\n }, [\n selectCountryInitialValues,\n basicInformationInitialValues,\n contractDetailsInitialValues,\n contractPreviewInitialValues,\n ]);\n\n const isNavigatingToReview = useMemo(() => {\n const shouldHandleReadOnlyEmployment = Boolean(\n employmentId &&\n isEmploymentReadOnly &&\n stepState.currentStep.name !== 'review',\n );\n\n return Boolean(\n shouldHandleReadOnlyEmployment &&\n !isLoadingEmployment &&\n stepFields.basic_information.length > 0 &&\n stepFields.contract_details.length > 0,\n );\n }, [\n employmentId,\n isEmploymentReadOnly,\n isLoadingEmployment,\n stepFields.basic_information.length,\n stepFields.contract_details.length,\n stepState.currentStep.name,\n ]);\n\n useEffect(() => {\n if (isNavigatingToReview) {\n fieldsMetaRef.current = {\n select_country: prettifyFormValues(\n selectCountryInitialValues,\n stepFields.select_country,\n ),\n basic_information: prettifyFormValues(\n basicInformationInitialValues,\n stepFields.basic_information,\n ),\n contract_details: prettifyFormValues(\n contractDetailsInitialValues,\n stepFields.contract_details,\n ),\n // TODO: TBD\n contract_preview: {},\n // TODO: TBD\n pricing_plan: {},\n };\n\n setStepValues({\n select_country: selectCountryInitialValues,\n basic_information: basicInformationInitialValues,\n contract_details: contractDetailsInitialValues,\n contract_preview: {},\n pricing_plan: {},\n review: {},\n });\n goToStep('review');\n }\n }, [\n isNavigatingToReview,\n goToStep,\n selectCountryInitialValues,\n basicInformationInitialValues,\n contractDetailsInitialValues,\n setStepValues,\n stepFields.select_country,\n stepFields.basic_information,\n stepFields.contract_details,\n ]);\n\n const goTo = (step: keyof typeof STEPS) => {\n goToStep(step);\n };\n\n const parseFormValues = (values: FieldValues) => {\n if (selectCountryForm && stepState.currentStep.name === 'select_country') {\n return values;\n }\n\n if (\n basicInformationForm &&\n stepState.currentStep.name === 'basic_information'\n ) {\n return parseJSFToValidate(values, basicInformationForm?.fields, {\n isPartialValidation: false,\n });\n }\n\n if (\n contractorOnboardingDetailsForm &&\n stepState.currentStep.name === 'contract_details'\n ) {\n return parseJSFToValidate(\n values,\n contractorOnboardingDetailsForm?.fields,\n {\n isPartialValidation: false,\n },\n );\n }\n\n if (\n signatureSchemaForm &&\n stepState.currentStep.name === 'contract_preview'\n ) {\n return parseJSFToValidate(values, signatureSchemaForm?.fields, {\n isPartialValidation: false,\n });\n }\n\n if (stepState.currentStep.name === 'pricing_plan') {\n // TODO: TBD\n return values;\n }\n\n return {};\n };\n\n async function onSubmit(values: FieldValues) {\n const currentStepName = stepState.currentStep.name;\n if (currentStepName in fieldsMetaRef.current) {\n fieldsMetaRef.current[\n currentStepName as keyof typeof fieldsMetaRef.current\n ] = prettifyFormValues(values, stepFields[currentStepName]);\n }\n const parsedValues = parseFormValues(values);\n switch (stepState.currentStep.name) {\n case 'select_country': {\n setInternalCountryCode(parsedValues.country);\n return Promise.resolve({ data: { countryCode: parsedValues.country } });\n }\n case 'basic_information': {\n const isEmploymentNotLoaded =\n !internalEmploymentId && internalCountryCode;\n const hasChangedCountry =\n internalEmploymentId &&\n internalCountryCode &&\n employment?.country &&\n employment?.country.code !== internalCountryCode;\n\n if (isEmploymentNotLoaded || hasChangedCountry) {\n const payload: EmploymentCreateParams = {\n basic_information: parsedValues,\n type: 'contractor',\n country_code: internalCountryCode,\n external_id: externalId,\n };\n try {\n const response = await createEmploymentMutationAsync(payload);\n // @ts-expect-error the types from the response are not matching\n const employmentId = response.data?.data?.employment?.id;\n setInternalEmploymentId(employmentId);\n\n return response;\n } catch (error) {\n console.error('Error creating onboarding:', error);\n throw error;\n }\n } else if (internalEmploymentId) {\n // TODO: Provisional it seems you cannot update a contractor employment\n return Promise.resolve({\n data: { employmentId: internalEmploymentId },\n });\n }\n\n return;\n }\n case 'contract_details': {\n const payload: CreateContractDocument = {\n contract_document: parsedValues,\n };\n const response: $TSFixMe =\n await createContractorContractDocumentMutationAsync({\n employmentId: internalEmploymentId as string,\n payload,\n });\n\n const contractDocumentId = response.data?.data?.contract_document?.id;\n setInternalContractDocumentId(contractDocumentId);\n return response;\n }\n\n case 'contract_preview': {\n return signContractDocumentMutationAsync({\n employmentId: internalEmploymentId as string,\n contractDocumentId: internalContractDocumentId as string,\n payload: {\n signature: values.signature,\n },\n });\n }\n\n case 'pricing_plan': {\n // TODO: TBD\n return Promise.resolve({ data: { pricingPlan: values } });\n }\n\n default: {\n throw new Error('Invalid step state');\n }\n }\n }\n\n const isLoading =\n isLoadingCountries ||\n isLoadingBasicInformationForm ||\n isLoadingEmployment ||\n isLoadingContractorOnboardingDetailsForm ||\n isLoadingDocumentPreviewForm;\n\n return {\n /**\n * Loading state indicating if the flow is loading data\n */\n isLoading,\n\n /**\n * Current state of the form fields for the current step.\n */\n fieldValues,\n\n /**\n * Current step state containing the current step and total number of steps\n */\n stepState,\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 /**\n * Function to handle going back to the previous step\n * @returns {void}\n */\n back: previousStep,\n\n /**\n * Function to handle going to the next step\n * @returns {void}\n */\n next: nextStep,\n\n /**\n * Function to handle going to a specific step\n * @param step The step to go to.\n * @returns {void}\n */\n goTo: goTo,\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 * Array of form fields from the onboarding schema\n */\n fields: stepFields[stepState.currentStep.name],\n\n /**\n * Fields metadata for each step\n */\n meta: {\n fields: fieldsMetaRef.current,\n fieldsets: stepFieldsWithFlatFieldsets[stepState.currentStep.name],\n },\n\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\n /**\n * Function to validate form values against the onboarding schema\n * @param values - Form values to validate\n * @returns Validation result or null if no schema is available\n */\n handleValidation: (values: FieldValues) => {\n if (stepState.currentStep.name === 'select_country') {\n return selectCountryForm.handleValidation(values);\n }\n\n if (\n basicInformationForm &&\n stepState.currentStep.name === 'basic_information'\n ) {\n const parsedValues = parseJSFToValidate(\n values,\n basicInformationForm?.fields,\n { isPartialValidation: false },\n );\n return basicInformationForm?.handleValidation(parsedValues);\n }\n\n if (\n contractorOnboardingDetailsForm &&\n stepState.currentStep.name === 'contract_details'\n ) {\n const parsedValues = parseJSFToValidate(\n values,\n contractorOnboardingDetailsForm?.fields,\n { isPartialValidation: false },\n );\n return contractorOnboardingDetailsForm?.handleValidation(parsedValues);\n }\n\n if (\n signatureSchemaForm &&\n stepState.currentStep.name === 'contract_preview'\n ) {\n const parsedValues = parseJSFToValidate(\n values,\n signatureSchemaForm?.fields,\n { isPartialValidation: false },\n );\n return signatureSchemaForm?.handleValidation(parsedValues);\n }\n\n if (stepState.currentStep.name === 'pricing_plan') {\n // TODO: TBD\n return {\n formErrors: {},\n yupError: null,\n };\n }\n\n return null;\n },\n\n /**\n * Initial form values\n */\n initialValues,\n\n /**\n * Employment id\n */\n employmentId: internalEmploymentId,\n\n /**\n * Function to refetch the employment data\n * @returns {void}\n */\n refetchEmployment: refetchEmployment,\n\n /**\n * Loading state indicating if the onboarding mutation is in progress\n */\n isSubmitting:\n createEmploymentMutation.isPending ||\n createContractorContractDocumentMutation.isPending ||\n signContractDocumentMutation.isPending,\n\n /**\n * Document preview PDF data\n */\n documentPreviewPdf,\n\n /**\n * let's the user know if the company can invite employees\n * @returns {boolean}\n */\n canInvite,\n\n /**\n * let's the user know that the employment cannot be edited, happens when employment.status is invited\n * @returns {boolean}\n */\n isEmploymentReadOnly,\n /**\n * let's the user know if the employment is invited or not\n * @returns {'invited' | 'not_invited'}\n */\n invitedStatus,\n\n /**\n * Employment data\n * @returns {Employment}\n */\n employment,\n };\n};\n"],"mappings":"qbAqCA,OAAS,aAAAA,GAAW,WAAAC,EAAS,UAAAC,GAAQ,YAAAC,MAAgB,QAQrD,IAAMC,GAGF,CACF,eAAgB,KAChB,kBAAmB,+BACnB,iBAAkB,KAClB,aAAc,KACd,iBAAkB,KAClB,OAAQ,IACV,EAEMC,GAEF,CACF,6BAA8B,mBAChC,EAEaC,GAA0BC,EAAA,CAAC,CACtC,YAAAC,GACA,WAAAC,GACA,aAAAC,EACA,UAAAC,GACA,QAAAC,EACA,cAAeC,CACjB,IAAoC,CAClC,GAAM,CAACC,EAAqBC,CAAsB,EAAIC,EACpDR,IAAe,IACjB,EACM,CAACS,EAAsBC,EAAuB,EAAIF,EAEtDN,CAAY,EACR,CAACS,EAA4BC,EAA6B,EAAIJ,EAElE,MAAS,EACLK,EAAgBC,GAMnB,CACD,eAAgB,CAAC,EACjB,kBAAmB,CAAC,EACpB,iBAAkB,CAAC,EACnB,iBAAkB,CAAC,EACnB,aAAc,CAAC,CACjB,CAAC,EAEKC,GAAaZ,IAAW,SAAS,gBAAgB,EACnDa,GACAC,GAEE,CACJ,YAAAC,EACA,UAAAC,EACA,eAAAC,GACA,aAAAC,GACA,SAAAC,GACA,SAAAC,EACA,cAAAC,CACF,EAAIC,EACFV,E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AK,GAKA,OAAQpB,EAAWpD,EAAU,YAAY,IAAI,EAK7C,KAAM,CACJ,OAAQN,EAAc,QACtB,UAAW2D,GAA4BrD,EAAU,YAAY,IAAI,CACnE,EAOA,gBAAAqE,EAOA,iBAAkBzF,EAAC0F,GAAwB,CACzC,GAAItE,EAAU,YAAY,OAAS,iBACjC,OAAO4B,EAAkB,iBAAiB0C,CAAM,EAGlD,GACE5B,GACA1C,EAAU,YAAY,OAAS,oBAC/B,CACA,IAAM0E,EAAeH,EACnBD,EACA5B,GAAsB,OACtB,CAAE,oBAAqB,EAAM,CAC/B,EACA,OAAOA,GAAsB,iBAAiBgC,CAAY,CAC5D,CAEA,GACE9B,GACA5C,EAAU,YAAY,OAAS,mBAC/B,CACA,IAAM0E,EAAeH,EACnBD,EACA1B,GAAiC,OACjC,CAAE,oBAAqB,EAAM,CAC/B,EACA,OAAOA,GAAiC,iBAAiB8B,CAAY,CACvE,CAEA,GACE3B,GACA/C,EAAU,YAAY,OAAS,mBAC/B,CACA,IAAM0E,EAAeH,EACnBD,EACAvB,GAAqB,OACrB,CAAE,oBAAqB,EAAM,CAC/B,EACA,OAAOA,GAAqB,iBAAiB2B,CAAY,CAC3D,CAEA,OAAI1E,EAAU,YAAY,OAAS,eAE1B,CACL,WAAY,CAAC,EACb,SAAU,IACZ,EAGK,IACT,EAlDkB,oBAuDlB,cAAA6D,GAKA,aAAcvE,EAMd,kBAAmBmB,GAKnB,aACES,EAAyB,WACzBE,EAAyC,WACzCE,EAA6B,UAK/B,mBAAA2B,GAMA,UAAAnC,GAMA,qBAAAF,EAKA,cAAAI,GAMA,WAAAT,CACF,CACF,EAprBuC","names":["useEffect","useMemo","useRef","useState","stepToFormSchemaMap","jsonSchemaToEmployment","useContractorOnboarding","__name","countryCode","externalId","employmentId","skipSteps","options","onboardingInitialValues","internalCountryCode","setInternalCountryCode","useState","internalEmploymentId","setInternalEmploymentId","internalContractDocumentId","setInternalContractDocumentId","fieldsMetaRef","useRef","stepsToUse","STEPS_WITHOUT_SELECT_COUNTRY","STEPS","fieldValues","stepState","setFieldValues","previousStep","nextStep","goToStep","setStepValues","useStepState","employment","isLoadingEmployment","refetchEmployment","useEmployment","employmentStatus","isEmploymentReadOnly","reviewStepAllowedEmploymentStatus","canInvite","disabledInviteButtonEmploymentStatus","invitedStatus","useMemo","createEmploymentMutation","useCreateEmployment","createContractorContractDocumentMutation","useCreateContractorContractDocument","signContractDocumentMutation","useSignContractDocument","createEmploymentMutationAsync","mutationToPromise","createContractorContractDocumentMutationAsync","signContractDocumentMutationAsync","selectCountryForm","isLoadingCountries","useCountriesSchemaField","formType","employmentKey","serverEmploymentData","useJSONSchema","form","jsonSchemaOptions","query","mergedFormValues","useJSONSchemaForm","isBasicInformationDetailsEnabled","isContractorOnboardingDetailsEnabled","basicInformationForm","isLoadingBasicInformationForm","contractorOnboardingDetailsForm","isLoadingContractorOnboardingDetailsForm","useContractorOnboardingDetailsSchema","signatureSchemaForm","useGetContractDocumentSignatureSchema","documentPreviewPdf","isLoadingDocumentPreviewForm","useGetShowContractDocument","stepFields","stepFieldsWithFlatFieldsets","country","employmentBasicInformation","employmentContractDetails","employmentCountryCode","selectCountryInitialValues","getInitialValues","basicInformationInitialValues","initialValues","contractDetailsInitialValues","contractPreviewInitialValues","isNavigatingToReview","useEffect","prettifyFormValues","goTo","step","parseFormValues","values","parseJSFToValidate","onSubmit","currentStepName","parsedValues","isEmploymentNotLoaded","hasChangedCountry","payload","response","error","contractDocumentId"]}
@@ -1,2 +1,2 @@
1
- import{a as e}from"./chunk-VDRNNOVA.js";var n={data:{version:7,schema:{additionalProperties:!1,allOf:[{if:{properties:{will_challenge_termination:{const:"yes"}},required:["will_challenge_termination"]},then:{properties:{will_challenge_termination_description:{type:"string"}},required:["will_challenge_termination_description"]},else:{properties:{will_challenge_termination_description:!1}}}],properties:{termination_reason:{title:"Termination reason",description:"Make sure you choose an accurate termination reason to avoid unfair or unlawful dismissal claims.",type:"string",oneOf:[{const:"gross_misconduct",title:"Gross misconduct"},{const:"performance",title:"Performance"},{const:"workforce_reduction",title:"Workforce Reduction"},{const:"values",title:"Values"},{const:"compliance_issue",title:"Compliance issue"},{const:"incapacity_to_perform_inherent_duties",title:"Incapacity To perform inherent duties"},{const:"mutual_agreement",title:"Mutual agreement"},{const:"cancellation_before_start_date",title:"Decision to cancel hiring before the employee starts"},{const:"job_abandonment",title:"Job abandonment"},{const:"dissatisfaction_with_remote_service",title:"Dissatisfaction with EOR service"},{const:"end_of_fixed_term_contract_compliance_issue",title:"End of fixed-term contract"},{const:"other",title:"Other"}],"x-jsf-presentation":{inputType:"select"}},reason_description:{description:"",maxLength:1e3,title:"Termination reason details",type:"string","x-jsf-presentation":{inputType:"textarea"}},additional_comments:{description:"",maxLength:1e3,title:"Additional details regarding this termination process.",type:"string","x-jsf-presentation":{inputType:"textarea"}},termination_reason_files:{description:"Please upload any supporting documents regarding the termination reason.",title:"Termination reason files",type:"string","x-jsf-presentation":{inputType:"file",accept:e.document,multiple:!0,maxSize:20971520}},risk_assesment_info:{description:"",title:"Risk assessment info",type:"null","x-jsf-presentation":{inputType:"hidden"}},risk_assessment_reasons:{description:"",title:"This employee is...",type:"array",items:{anyOf:[{const:"sick_leave",title:"Currently on or recently returned from sick leave"},{const:"family_leave",title:"Currently on or recently returned from maternity, paternity, or other family leave"},{const:"pregnant_or_breastfeeding",title:"Pregnant or breastfeeding"},{const:"requested_medical_or_family_leave",title:"Requested medical or family leave"},{const:"disabled_or_health_condition",title:"Disabled or has a health condition"},{const:"member_of_union_or_works_council",title:"A member of a union or works council"},{const:"caring_responsibilities",title:"Caring responsibilities"},{const:"reported_concerns_with_workplace",title:"Reported any wrongdoing; raised any allegations of discrimination, harassment, retaliation, etc.; or asserted their employment rights or raised complaints about their working conditions"},{const:"none_of_these",title:"To the best of my knowledge, I am not aware of any of these"}]},"x-jsf-presentation":{inputType:"checkbox",direction:"column"}},will_challenge_termination:{description:"",oneOf:[{const:"yes",description:"",title:"Yes"},{const:"no",description:"",title:"No"}],title:"Do you consider it is likely that the employee will challenge their termination?",type:"string","x-jsf-presentation":{direction:"column",inputType:"radio"}},will_challenge_termination_description:{description:"",maxLength:1e3,title:"Please explain how the employee will challenge their termination",type:["string","null"],"x-jsf-presentation":{inputType:"textarea"}},proposed_termination_date_info:{description:"",title:"Proposed termination date info",type:"null","x-jsf-presentation":{inputType:"hidden"}},proposed_termination_date:{description:"",format:"date",maxLength:255,title:"Proposed termination date",type:"string","x-jsf-presentation":{inputType:"date"}}},required:["termination_reason","reason_description","risk_assessment_reasons","will_challenge_termination","proposed_termination_date"],type:"object","x-jsf-order":["termination_reason","reason_description","additional_comments","termination_reason_files","risk_assesment_info","risk_assessment_reasons","will_challenge_termination","will_challenge_termination_description","proposed_termination_date_info","proposed_termination_date"]}}};export{n as a};
2
- //# sourceMappingURL=chunk-R3DJNVHR.js.map
1
+ import{a as e}from"./chunk-VDRNNOVA.js";var n={data:{version:7,schema:{additionalProperties:!1,allOf:[{if:{properties:{will_challenge_termination:{const:"yes"}},required:["will_challenge_termination"]},then:{properties:{will_challenge_termination_description:{type:"string"}},required:["will_challenge_termination_description"]},else:{properties:{will_challenge_termination_description:!1}}}],properties:{termination_reason:{title:"Termination reason",description:"Make sure you choose an accurate termination reason to avoid unfair or unlawful dismissal claims.",type:"string",oneOf:[{const:"gross_misconduct",title:"Gross misconduct"},{const:"performance",title:"Performance"},{const:"workforce_reduction",title:"Workforce Reduction"},{const:"values",title:"Values"},{const:"compliance_issue",title:"Compliance issue"},{const:"incapacity_to_perform_inherent_duties",title:"Incapacity To perform inherent duties"},{const:"mutual_agreement",title:"Mutual agreement"},{const:"cancellation_before_start_date",title:"Decision to cancel hiring before the employee starts"},{const:"job_abandonment",title:"Job abandonment"},{const:"dissatisfaction_with_remote_service",title:"Dissatisfaction with EOR service"},{const:"end_of_fixed_term_contract_compliance_issue",title:"End of fixed-term contract"},{const:"other",title:"Other"}],"x-jsf-presentation":{inputType:"select"}},reason_description:{description:"",maxLength:1e3,title:"Termination reason details",type:"string","x-jsf-presentation":{inputType:"textarea"}},additional_comments:{description:"",maxLength:1e3,title:"Additional details regarding this termination process.",type:"string","x-jsf-presentation":{inputType:"textarea"}},termination_reason_files:{description:"Please upload any supporting documents regarding the termination reason.",title:"Termination reason files",type:"string","x-jsf-presentation":{inputType:"file",accept:e.document,multiple:!0,maxSize:20971520}},risk_assesment_info:{description:"",title:"Risk assessment info",type:"null","x-jsf-presentation":{inputType:"hidden"}},risk_assessment_reasons:{description:"",title:"This employee is...",type:"array",items:{anyOf:[{const:"sick_leave",title:"Currently on or recently returned from sick leave"},{const:"family_leave",title:"Currently on or recently returned from maternity, paternity, or other family leave"},{const:"pregnant_or_breastfeeding",title:"Pregnant or breastfeeding"},{const:"requested_medical_or_family_leave",title:"Requested medical or family leave"},{const:"disabled_or_health_condition",title:"Disabled or has a health condition"},{const:"member_of_union_or_works_council",title:"A member of a union or works council"},{const:"caring_responsibilities",title:"Caring responsibilities"},{const:"reported_concerns_with_workplace",title:"Reported any wrongdoing; raised any allegations of discrimination, harassment, retaliation, etc.; or asserted their employment rights or raised complaints about their working conditions"},{const:"none_of_these",title:"To the best of my knowledge, I am not aware of any of these"}]},"x-jsf-presentation":{inputType:"checkbox",direction:"column"}},will_challenge_termination:{description:"",oneOf:[{const:"yes",description:"",title:"Yes"},{const:"no",description:"",title:"No"}],title:"Do you consider it is likely that the employee will challenge their termination?",type:"string","x-jsf-presentation":{direction:"column",inputType:"radio"}},will_challenge_termination_description:{description:"",maxLength:1e3,title:"Please explain how the employee will challenge their termination",type:["string","null"],"x-jsf-presentation":{inputType:"textarea"}},proposed_termination_date_info:{description:"",title:"Proposed termination date info",type:"null","x-jsf-presentation":{inputType:"hidden"}},proposed_termination_date:{description:"Please note that we cannot commit to a termination date until we conduct a full review of the information you submit.",format:"date",maxLength:255,title:"Proposed termination date",type:"string","x-jsf-presentation":{inputType:"date"}}},required:["termination_reason","reason_description","risk_assessment_reasons","will_challenge_termination","proposed_termination_date"],type:"object","x-jsf-order":["termination_reason","reason_description","additional_comments","termination_reason_files","risk_assesment_info","risk_assessment_reasons","will_challenge_termination","will_challenge_termination_description","proposed_termination_date_info","proposed_termination_date"]}}};export{n as a};
2
+ //# sourceMappingURL=chunk-ZXGAFQXW.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/flows/Termination/json-schemas/terminationDetails.ts"],"sourcesContent":["import { FILE_TYPES, MAX_FILE_SIZE } from '@/src/lib/uploadConfig';\n\nexport const terminationDetailsSchema = {\n data: {\n version: 7,\n schema: {\n additionalProperties: false,\n allOf: [\n {\n if: {\n properties: {\n will_challenge_termination: {\n const: 'yes',\n },\n },\n required: ['will_challenge_termination'],\n },\n then: {\n properties: {\n will_challenge_termination_description: {\n type: 'string',\n },\n },\n required: ['will_challenge_termination_description'],\n },\n else: {\n properties: {\n will_challenge_termination_description: false,\n },\n },\n },\n ],\n properties: {\n termination_reason: {\n title: 'Termination reason',\n description:\n 'Make sure you choose an accurate termination reason to avoid unfair or unlawful dismissal claims.',\n type: 'string',\n oneOf: [\n {\n const: 'gross_misconduct',\n title: 'Gross misconduct',\n },\n {\n const: 'performance',\n title: 'Performance',\n },\n {\n const: 'workforce_reduction',\n title: 'Workforce Reduction',\n },\n {\n const: 'values',\n title: 'Values',\n },\n {\n const: 'compliance_issue',\n title: 'Compliance issue',\n },\n {\n const: 'incapacity_to_perform_inherent_duties',\n title: 'Incapacity To perform inherent duties',\n },\n {\n const: 'mutual_agreement',\n title: 'Mutual agreement',\n },\n {\n const: 'cancellation_before_start_date',\n title: 'Decision to cancel hiring before the employee starts',\n },\n {\n const: 'job_abandonment',\n title: 'Job abandonment',\n },\n {\n const: 'dissatisfaction_with_remote_service',\n title: 'Dissatisfaction with EOR service',\n },\n {\n const: 'end_of_fixed_term_contract_compliance_issue',\n title: 'End of fixed-term contract',\n },\n {\n const: 'other',\n title: 'Other',\n },\n ],\n 'x-jsf-presentation': {\n inputType: 'select',\n },\n },\n reason_description: {\n description: '',\n maxLength: 1000,\n title: 'Termination reason details',\n type: 'string',\n 'x-jsf-presentation': {\n inputType: 'textarea',\n },\n },\n additional_comments: {\n description: '',\n maxLength: 1000,\n title: 'Additional details regarding this termination process.',\n type: 'string',\n 'x-jsf-presentation': {\n inputType: 'textarea',\n },\n },\n termination_reason_files: {\n description:\n 'Please upload any supporting documents regarding the termination reason.',\n title: 'Termination reason files',\n type: 'string',\n 'x-jsf-presentation': {\n inputType: 'file',\n accept: FILE_TYPES.document,\n multiple: true,\n maxSize: MAX_FILE_SIZE, // maxFileSize doesn't seem to work for some reason, found that this was fixed in @remoteoss/json-schema-form v1\n },\n },\n risk_assesment_info: {\n description: '',\n title: 'Risk assessment info',\n type: 'null',\n 'x-jsf-presentation': {\n inputType: 'hidden',\n },\n },\n risk_assessment_reasons: {\n description: '',\n title: 'This employee is...',\n type: 'array',\n items: {\n anyOf: [\n {\n const: 'sick_leave',\n title: 'Currently on or recently returned from sick leave',\n },\n {\n const: 'family_leave',\n title:\n 'Currently on or recently returned from maternity, paternity, or other family leave',\n },\n {\n const: 'pregnant_or_breastfeeding',\n title: 'Pregnant or breastfeeding',\n },\n {\n const: 'requested_medical_or_family_leave',\n title: 'Requested medical or family leave',\n },\n {\n const: 'disabled_or_health_condition',\n title: 'Disabled or has a health condition',\n },\n {\n const: 'member_of_union_or_works_council',\n title: 'A member of a union or works council',\n },\n {\n const: 'caring_responsibilities',\n title: 'Caring responsibilities',\n },\n {\n const: 'reported_concerns_with_workplace',\n title:\n 'Reported any wrongdoing; raised any allegations of discrimination, harassment, retaliation, etc.; or asserted their employment rights or raised complaints about their working conditions',\n },\n {\n const: 'none_of_these',\n title:\n 'To the best of my knowledge, I am not aware of any of these',\n },\n ],\n },\n 'x-jsf-presentation': {\n inputType: 'checkbox',\n direction: 'column',\n },\n },\n will_challenge_termination: {\n description: '',\n oneOf: [\n {\n const: 'yes',\n description: '',\n title: 'Yes',\n },\n {\n const: 'no',\n description: '',\n title: 'No',\n },\n ],\n title:\n 'Do you consider it is likely that the employee will challenge their termination?',\n type: 'string',\n 'x-jsf-presentation': {\n direction: 'column',\n inputType: 'radio',\n },\n },\n will_challenge_termination_description: {\n description: '',\n maxLength: 1000,\n title:\n 'Please explain how the employee will challenge their termination',\n type: ['string', 'null'],\n 'x-jsf-presentation': {\n inputType: 'textarea',\n },\n },\n proposed_termination_date_info: {\n description: '',\n title: 'Proposed termination date info',\n type: 'null',\n 'x-jsf-presentation': {\n inputType: 'hidden',\n },\n },\n proposed_termination_date: {\n description: '',\n format: 'date',\n maxLength: 255,\n title: 'Proposed termination date',\n type: 'string',\n 'x-jsf-presentation': {\n inputType: 'date',\n },\n },\n },\n required: [\n 'termination_reason',\n 'reason_description',\n 'risk_assessment_reasons',\n 'will_challenge_termination',\n 'proposed_termination_date',\n ],\n type: 'object',\n 'x-jsf-order': [\n 'termination_reason',\n 'reason_description',\n 'additional_comments',\n 'termination_reason_files',\n 'risk_assesment_info',\n 'risk_assessment_reasons',\n 'will_challenge_termination',\n 'will_challenge_termination_description',\n 'proposed_termination_date_info',\n 'proposed_termination_date',\n ],\n },\n },\n};\n"],"mappings":"wCAEO,IAAMA,EAA2B,CACtC,KAAM,CACJ,QAAS,EACT,OAAQ,CACN,qBAAsB,GACtB,MAAO,CACL,CACE,GAAI,CACF,WAAY,CACV,2BAA4B,CAC1B,MAAO,KACT,CACF,EACA,SAAU,CAAC,4BAA4B,CACzC,EACA,KAAM,CACJ,WAAY,CACV,uCAAwC,CACtC,KAAM,QACR,CACF,EACA,SAAU,CAAC,wCAAwC,CACrD,EACA,KAAM,CACJ,WAAY,CACV,uCAAwC,EAC1C,CACF,CACF,CACF,EACA,WAAY,CACV,mBAAoB,CAClB,MAAO,qBACP,YACE,oGACF,KAAM,SACN,MAAO,CACL,CACE,MAAO,mBACP,MAAO,kBACT,EACA,CACE,MAAO,cACP,MAAO,aACT,EACA,CACE,MAAO,sBACP,MAAO,qBACT,EACA,CACE,MAAO,SACP,MAAO,QACT,EACA,CACE,MAAO,mBACP,MAAO,kBACT,EACA,CACE,MAAO,wCACP,MAAO,uCACT,EACA,CACE,MAAO,mBACP,MAAO,kBACT,EACA,CACE,MAAO,iCACP,MAAO,sDACT,EACA,CACE,MAAO,kBACP,MAAO,iBACT,EACA,CACE,MAAO,sCACP,MAAO,kCACT,EACA,CACE,MAAO,8CACP,MAAO,4BACT,EACA,CACE,MAAO,QACP,MAAO,OACT,CACF,EACA,qBAAsB,CACpB,UAAW,QACb,CACF,EACA,mBAAoB,CAClB,YAAa,GACb,UAAW,IACX,MAAO,6BACP,KAAM,SACN,qBAAsB,CACpB,UAAW,UACb,CACF,EACA,oBAAqB,CACnB,YAAa,GACb,UAAW,IACX,MAAO,yDACP,KAAM,SACN,qBAAsB,CACpB,UAAW,UACb,CACF,EACA,yBAA0B,CACxB,YACE,2EACF,MAAO,2BACP,KAAM,SACN,qBAAsB,CACpB,UAAW,OACX,OAAQC,EAAW,SACnB,SAAU,GACV,QAAS,QACX,CACF,EACA,oBAAqB,CACnB,YAAa,GACb,MAAO,uBACP,KAAM,OACN,qBAAsB,CACpB,UAAW,QACb,CACF,EACA,wBAAyB,CACvB,YAAa,GACb,MAAO,sBACP,KAAM,QACN,MAAO,CACL,MAAO,CACL,CACE,MAAO,aACP,MAAO,mDACT,EACA,CACE,MAAO,eACP,MACE,oFACJ,EACA,CACE,MAAO,4BACP,MAAO,2BACT,EACA,CACE,MAAO,oCACP,MAAO,mCACT,EACA,CACE,MAAO,+BACP,MAAO,oCACT,EACA,CACE,MAAO,mCACP,MAAO,sCACT,EACA,CACE,MAAO,0BACP,MAAO,yBACT,EACA,CACE,MAAO,mCACP,MACE,2LACJ,EACA,CACE,MAAO,gBACP,MACE,6DACJ,CACF,CACF,EACA,qBAAsB,CACpB,UAAW,WACX,UAAW,QACb,CACF,EACA,2BAA4B,CAC1B,YAAa,GACb,MAAO,CACL,CACE,MAAO,MACP,YAAa,GACb,MAAO,KACT,EACA,CACE,MAAO,KACP,YAAa,GACb,MAAO,IACT,CACF,EACA,MACE,mFACF,KAAM,SACN,qBAAsB,CACpB,UAAW,SACX,UAAW,OACb,CACF,EACA,uCAAwC,CACtC,YAAa,GACb,UAAW,IACX,MACE,mEACF,KAAM,CAAC,SAAU,MAAM,EACvB,qBAAsB,CACpB,UAAW,UACb,CACF,EACA,+BAAgC,CAC9B,YAAa,GACb,MAAO,iCACP,KAAM,OACN,qBAAsB,CACpB,UAAW,QACb,CACF,EACA,0BAA2B,CACzB,YAAa,GACb,OAAQ,OACR,UAAW,IACX,MAAO,4BACP,KAAM,SACN,qBAAsB,CACpB,UAAW,MACb,CACF,CACF,EACA,SAAU,CACR,qBACA,qBACA,0BACA,6BACA,2BACF,EACA,KAAM,SACN,cAAe,CACb,qBACA,qBACA,sBACA,2BACA,sBACA,0BACA,6BACA,yCACA,iCACA,2BACF,CACF,CACF,CACF","names":["terminationDetailsSchema","FILE_TYPES"]}
1
+ {"version":3,"sources":["../src/flows/Termination/json-schemas/terminationDetails.ts"],"sourcesContent":["import { FILE_TYPES, MAX_FILE_SIZE } from '@/src/lib/uploadConfig';\n\nexport const terminationDetailsSchema = {\n data: {\n version: 7,\n schema: {\n additionalProperties: false,\n allOf: [\n {\n if: {\n properties: {\n will_challenge_termination: {\n const: 'yes',\n },\n },\n required: ['will_challenge_termination'],\n },\n then: {\n properties: {\n will_challenge_termination_description: {\n type: 'string',\n },\n },\n required: ['will_challenge_termination_description'],\n },\n else: {\n properties: {\n will_challenge_termination_description: false,\n },\n },\n },\n ],\n properties: {\n termination_reason: {\n title: 'Termination reason',\n description:\n 'Make sure you choose an accurate termination reason to avoid unfair or unlawful dismissal claims.',\n type: 'string',\n oneOf: [\n {\n const: 'gross_misconduct',\n title: 'Gross misconduct',\n },\n {\n const: 'performance',\n title: 'Performance',\n },\n {\n const: 'workforce_reduction',\n title: 'Workforce Reduction',\n },\n {\n const: 'values',\n title: 'Values',\n },\n {\n const: 'compliance_issue',\n title: 'Compliance issue',\n },\n {\n const: 'incapacity_to_perform_inherent_duties',\n title: 'Incapacity To perform inherent duties',\n },\n {\n const: 'mutual_agreement',\n title: 'Mutual agreement',\n },\n {\n const: 'cancellation_before_start_date',\n title: 'Decision to cancel hiring before the employee starts',\n },\n {\n const: 'job_abandonment',\n title: 'Job abandonment',\n },\n {\n const: 'dissatisfaction_with_remote_service',\n title: 'Dissatisfaction with EOR service',\n },\n {\n const: 'end_of_fixed_term_contract_compliance_issue',\n title: 'End of fixed-term contract',\n },\n {\n const: 'other',\n title: 'Other',\n },\n ],\n 'x-jsf-presentation': {\n inputType: 'select',\n },\n },\n reason_description: {\n description: '',\n maxLength: 1000,\n title: 'Termination reason details',\n type: 'string',\n 'x-jsf-presentation': {\n inputType: 'textarea',\n },\n },\n additional_comments: {\n description: '',\n maxLength: 1000,\n title: 'Additional details regarding this termination process.',\n type: 'string',\n 'x-jsf-presentation': {\n inputType: 'textarea',\n },\n },\n termination_reason_files: {\n description:\n 'Please upload any supporting documents regarding the termination reason.',\n title: 'Termination reason files',\n type: 'string',\n 'x-jsf-presentation': {\n inputType: 'file',\n accept: FILE_TYPES.document,\n multiple: true,\n maxSize: MAX_FILE_SIZE, // maxFileSize doesn't seem to work for some reason, found that this was fixed in @remoteoss/json-schema-form v1\n },\n },\n risk_assesment_info: {\n description: '',\n title: 'Risk assessment info',\n type: 'null',\n 'x-jsf-presentation': {\n inputType: 'hidden',\n },\n },\n risk_assessment_reasons: {\n description: '',\n title: 'This employee is...',\n type: 'array',\n items: {\n anyOf: [\n {\n const: 'sick_leave',\n title: 'Currently on or recently returned from sick leave',\n },\n {\n const: 'family_leave',\n title:\n 'Currently on or recently returned from maternity, paternity, or other family leave',\n },\n {\n const: 'pregnant_or_breastfeeding',\n title: 'Pregnant or breastfeeding',\n },\n {\n const: 'requested_medical_or_family_leave',\n title: 'Requested medical or family leave',\n },\n {\n const: 'disabled_or_health_condition',\n title: 'Disabled or has a health condition',\n },\n {\n const: 'member_of_union_or_works_council',\n title: 'A member of a union or works council',\n },\n {\n const: 'caring_responsibilities',\n title: 'Caring responsibilities',\n },\n {\n const: 'reported_concerns_with_workplace',\n title:\n 'Reported any wrongdoing; raised any allegations of discrimination, harassment, retaliation, etc.; or asserted their employment rights or raised complaints about their working conditions',\n },\n {\n const: 'none_of_these',\n title:\n 'To the best of my knowledge, I am not aware of any of these',\n },\n ],\n },\n 'x-jsf-presentation': {\n inputType: 'checkbox',\n direction: 'column',\n },\n },\n will_challenge_termination: {\n description: '',\n oneOf: [\n {\n const: 'yes',\n description: '',\n title: 'Yes',\n },\n {\n const: 'no',\n description: '',\n title: 'No',\n },\n ],\n title:\n 'Do you consider it is likely that the employee will challenge their termination?',\n type: 'string',\n 'x-jsf-presentation': {\n direction: 'column',\n inputType: 'radio',\n },\n },\n will_challenge_termination_description: {\n description: '',\n maxLength: 1000,\n title:\n 'Please explain how the employee will challenge their termination',\n type: ['string', 'null'],\n 'x-jsf-presentation': {\n inputType: 'textarea',\n },\n },\n proposed_termination_date_info: {\n description: '',\n title: 'Proposed termination date info',\n type: 'null',\n 'x-jsf-presentation': {\n inputType: 'hidden',\n },\n },\n proposed_termination_date: {\n description:\n 'Please note that we cannot commit to a termination date until we conduct a full review of the information you submit.',\n format: 'date',\n maxLength: 255,\n title: 'Proposed termination date',\n type: 'string',\n 'x-jsf-presentation': {\n inputType: 'date',\n },\n },\n },\n required: [\n 'termination_reason',\n 'reason_description',\n 'risk_assessment_reasons',\n 'will_challenge_termination',\n 'proposed_termination_date',\n ],\n type: 'object',\n 'x-jsf-order': [\n 'termination_reason',\n 'reason_description',\n 'additional_comments',\n 'termination_reason_files',\n 'risk_assesment_info',\n 'risk_assessment_reasons',\n 'will_challenge_termination',\n 'will_challenge_termination_description',\n 'proposed_termination_date_info',\n 'proposed_termination_date',\n ],\n },\n },\n};\n"],"mappings":"wCAEO,IAAMA,EAA2B,CACtC,KAAM,CACJ,QAAS,EACT,OAAQ,CACN,qBAAsB,GACtB,MAAO,CACL,CACE,GAAI,CACF,WAAY,CACV,2BAA4B,CAC1B,MAAO,KACT,CACF,EACA,SAAU,CAAC,4BAA4B,CACzC,EACA,KAAM,CACJ,WAAY,CACV,uCAAwC,CACtC,KAAM,QACR,CACF,EACA,SAAU,CAAC,wCAAwC,CACrD,EACA,KAAM,CACJ,WAAY,CACV,uCAAwC,EAC1C,CACF,CACF,CACF,EACA,WAAY,CACV,mBAAoB,CAClB,MAAO,qBACP,YACE,oGACF,KAAM,SACN,MAAO,CACL,CACE,MAAO,mBACP,MAAO,kBACT,EACA,CACE,MAAO,cACP,MAAO,aACT,EACA,CACE,MAAO,sBACP,MAAO,qBACT,EACA,CACE,MAAO,SACP,MAAO,QACT,EACA,CACE,MAAO,mBACP,MAAO,kBACT,EACA,CACE,MAAO,wCACP,MAAO,uCACT,EACA,CACE,MAAO,mBACP,MAAO,kBACT,EACA,CACE,MAAO,iCACP,MAAO,sDACT,EACA,CACE,MAAO,kBACP,MAAO,iBACT,EACA,CACE,MAAO,sCACP,MAAO,kCACT,EACA,CACE,MAAO,8CACP,MAAO,4BACT,EACA,CACE,MAAO,QACP,MAAO,OACT,CACF,EACA,qBAAsB,CACpB,UAAW,QACb,CACF,EACA,mBAAoB,CAClB,YAAa,GACb,UAAW,IACX,MAAO,6BACP,KAAM,SACN,qBAAsB,CACpB,UAAW,UACb,CACF,EACA,oBAAqB,CACnB,YAAa,GACb,UAAW,IACX,MAAO,yDACP,KAAM,SACN,qBAAsB,CACpB,UAAW,UACb,CACF,EACA,yBAA0B,CACxB,YACE,2EACF,MAAO,2BACP,KAAM,SACN,qBAAsB,CACpB,UAAW,OACX,OAAQC,EAAW,SACnB,SAAU,GACV,QAAS,QACX,CACF,EACA,oBAAqB,CACnB,YAAa,GACb,MAAO,uBACP,KAAM,OACN,qBAAsB,CACpB,UAAW,QACb,CACF,EACA,wBAAyB,CACvB,YAAa,GACb,MAAO,sBACP,KAAM,QACN,MAAO,CACL,MAAO,CACL,CACE,MAAO,aACP,MAAO,mDACT,EACA,CACE,MAAO,eACP,MACE,oFACJ,EACA,CACE,MAAO,4BACP,MAAO,2BACT,EACA,CACE,MAAO,oCACP,MAAO,mCACT,EACA,CACE,MAAO,+BACP,MAAO,oCACT,EACA,CACE,MAAO,mCACP,MAAO,sCACT,EACA,CACE,MAAO,0BACP,MAAO,yBACT,EACA,CACE,MAAO,mCACP,MACE,2LACJ,EACA,CACE,MAAO,gBACP,MACE,6DACJ,CACF,CACF,EACA,qBAAsB,CACpB,UAAW,WACX,UAAW,QACb,CACF,EACA,2BAA4B,CAC1B,YAAa,GACb,MAAO,CACL,CACE,MAAO,MACP,YAAa,GACb,MAAO,KACT,EACA,CACE,MAAO,KACP,YAAa,GACb,MAAO,IACT,CACF,EACA,MACE,mFACF,KAAM,SACN,qBAAsB,CACpB,UAAW,SACX,UAAW,OACb,CACF,EACA,uCAAwC,CACtC,YAAa,GACb,UAAW,IACX,MACE,mEACF,KAAM,CAAC,SAAU,MAAM,EACvB,qBAAsB,CACpB,UAAW,UACb,CACF,EACA,+BAAgC,CAC9B,YAAa,GACb,MAAO,iCACP,KAAM,OACN,qBAAsB,CACpB,UAAW,QACb,CACF,EACA,0BAA2B,CACzB,YACE,wHACF,OAAQ,OACR,UAAW,IACX,MAAO,4BACP,KAAM,SACN,qBAAsB,CACpB,UAAW,MACb,CACF,CACF,EACA,SAAU,CACR,qBACA,qBACA,0BACA,6BACA,2BACF,EACA,KAAM,SACN,cAAe,CACb,qBACA,qBACA,sBACA,2BACA,sBACA,0BACA,6BACA,yCACA,iCACA,2BACF,CACF,CACF,CACF","names":["terminationDetailsSchema","FILE_TYPES"]}
@@ -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-B73oMrmZ.js';
2
+ import { d as PostCreateContractAmendmentError, c as ContractAmendmentResponse } from '../../types.gen-B1wPsyg7.js';
3
3
  import { FieldValues } from 'react-hook-form';
4
4
 
5
5
  type ContractAmendmentConfirmationFormProps = {
@@ -5,11 +5,11 @@ 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-B73oMrmZ.js';
8
+ import '../../types.gen-B1wPsyg7.js';
9
9
  import 'react-hook-form';
10
10
  import 'react';
11
- import '../../mutations-C0KsEf83.js';
12
- import '../../remoteFlows-DJcvCgN2.js';
11
+ import '../../mutations-B3zY0Z8j.js';
12
+ import '../../remoteFlows-C6LQCoUj.js';
13
13
  import 'yup';
14
14
  import '../../types-Zg1n_9wh.js';
15
15
  import '@remoteoss/json-schema-form';
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-MGVP76ZI.js";import"../../chunk-6KIQIVKA.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-JO4722R7.js";import"../../chunk-DB7ITLRX.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-OW5QGJD4.js";import"../../chunk-CYPGWEOO.js";import"../../chunk-KDUM4EZJ.js";import"../../chunk-SGE4DLC3.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-JTOLQCOG.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-ANQ4HVVK.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-EKKRQI6B.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.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-FTCLM4RE.js";import"../../chunk-WHVPDECD.js";import"../../chunk-CCL5LNHC.js";import"../../chunk-CFIJKJXD.js";import"../../chunk-TKAZTT3M.js";import"../../chunk-BV3PGYSH.js";import"../../chunk-OW5QGJD4.js";import"../../chunk-CYPGWEOO.js";import"../../chunk-KDUM4EZJ.js";import"../../chunk-SGE4DLC3.js";import"../../chunk-2YTBWEC7.js";import"../../chunk-JTOLQCOG.js";import"../../chunk-D6X2WCEG.js";import"../../chunk-HPHWQU34.js";import"../../chunk-CDRDLO4A.js";import"../../chunk-PD24XKD6.js";import"../../chunk-TWIUL2P3.js";import"../../chunk-ZX5OIIJX.js";import"../../chunk-3O3Q24JL.js";import"../../chunk-PJBAQZ6G.js";import"../../chunk-EKKRQI6B.js";import"../../chunk-WVDTHFGS.js";import"../../chunk-3ZWDIEEM.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};
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-B73oMrmZ.js';
2
+ import { b as PostAutomatableContractAmendmentError, a as ContractAmendmentAutomatableResponse } from '../../types.gen-B1wPsyg7.js';
3
3
  import { FieldValues } from 'react-hook-form';
4
4
 
5
5
  type ContractAmendmentFormProps = {