@remoteoss/remote-flows 1.14.0 → 1.15.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 (330) hide show
  1. package/README.md +10 -9
  2. package/dist/CountryFieldDefault-DJ7VD267.js +2 -0
  3. package/dist/DatePickerFieldDefault-ZWLN5P55.js +2 -0
  4. package/dist/RadioGroupFieldDefault-7SVQ7ZQQ.js +2 -0
  5. package/dist/{chunk-MKT4MPUT.js → chunk-2J4XRENJ.js} +2 -2
  6. package/dist/{chunk-UBYT2TI4.js → chunk-2ZS5F6C7.js} +2 -2
  7. package/dist/{chunk-3YKLEDVY.js → chunk-37RBGAMM.js} +2 -2
  8. package/dist/{chunk-HCJP6RDC.js → chunk-3ACL4IFO.js} +2 -2
  9. package/dist/{chunk-OPQTTZBK.js → chunk-3XG2MGD3.js} +2 -2
  10. package/dist/chunk-42R2H2DW.js +2 -0
  11. package/dist/{chunk-43UKWTHS.js → chunk-47YUPC2L.js} +2 -2
  12. package/dist/{chunk-Z7A4LTSB.js → chunk-4SGUDT5K.js} +2 -2
  13. package/dist/{chunk-NFLKVFAD.js → chunk-5F7FMTGE.js} +2 -2
  14. package/dist/chunk-5KMUUL7U.js +1 -0
  15. package/dist/chunk-5KMUUL7U.js.map +1 -0
  16. package/dist/{chunk-NKPRRBFG.js → chunk-5TBUDUEB.js} +2 -2
  17. package/dist/chunk-5WIBTOCI.js +2 -0
  18. package/dist/chunk-5WIBTOCI.js.map +1 -0
  19. package/dist/{chunk-7RC7EB47.js → chunk-6DRAZSGG.js} +2 -2
  20. package/dist/chunk-76ZDXC2T.js +2 -0
  21. package/dist/chunk-76ZDXC2T.js.map +1 -0
  22. package/dist/{chunk-BWMATZIU.js → chunk-7TOCURKO.js} +2 -2
  23. package/dist/{chunk-ZYLVMO7E.js → chunk-A37NW25N.js} +2 -2
  24. package/dist/chunk-A3LRPGV3.js +2 -0
  25. package/dist/chunk-A3LRPGV3.js.map +1 -0
  26. package/dist/{chunk-BOWNQTTR.js → chunk-AB3RAEMM.js} +2 -2
  27. package/dist/{chunk-TUJXQF4Q.js → chunk-AJ7L3ZO3.js} +2 -2
  28. package/dist/{chunk-CE4ZEIWI.js → chunk-BC4UT7KC.js} +2 -2
  29. package/dist/chunk-BIDZO7XH.js +2 -0
  30. package/dist/chunk-BIDZO7XH.js.map +1 -0
  31. package/dist/{chunk-K6WWMYKM.js → chunk-C36VO7DO.js} +2 -2
  32. package/dist/chunk-CQ2EF32E.js +2 -0
  33. package/dist/chunk-CQ2EF32E.js.map +1 -0
  34. package/dist/{chunk-HRK4FJGT.js → chunk-D36BZQTP.js} +2 -2
  35. package/dist/{chunk-CWHIIHQP.js → chunk-D5YMIXK5.js} +2 -2
  36. package/dist/chunk-D6KO5LX6.js +2 -0
  37. package/dist/chunk-D6KO5LX6.js.map +1 -0
  38. package/dist/{chunk-RE2IHPDB.js → chunk-DCB2H2SG.js} +2 -2
  39. package/dist/{chunk-5RFDYBDY.js → chunk-DI2QNZ2O.js} +2 -2
  40. package/dist/{chunk-I4CH573Y.js → chunk-DI3XZUMY.js} +2 -2
  41. package/dist/chunk-FKYEST54.js +2 -0
  42. package/dist/chunk-FKYEST54.js.map +1 -0
  43. package/dist/{chunk-IAIHITHL.js → chunk-GLKITZNI.js} +2 -2
  44. package/dist/chunk-H463PCBN.js +2 -0
  45. package/dist/{chunk-L622FFV6.js.map → chunk-H463PCBN.js.map} +1 -1
  46. package/dist/{chunk-QE62LRON.js → chunk-HLAKUOQB.js} +2 -2
  47. package/dist/{chunk-6IFPFK23.js → chunk-HN7ZP5AX.js} +2 -2
  48. package/dist/{chunk-ZURHNW3D.js → chunk-HU453KWI.js} +2 -2
  49. package/dist/{chunk-P4GE72PQ.js → chunk-I2ED6EUG.js} +2 -2
  50. package/dist/{chunk-2TPHCOVE.js → chunk-I7JUAYNN.js} +2 -2
  51. package/dist/{chunk-XGECMN4V.js → chunk-IF42CZJH.js} +2 -2
  52. package/dist/{chunk-3EK647EG.js → chunk-IHVEK72X.js} +2 -2
  53. package/dist/{chunk-RXP4X2CU.js → chunk-JITSAYF7.js} +2 -2
  54. package/dist/chunk-JITSAYF7.js.map +1 -0
  55. package/dist/{chunk-BZ5XEZCL.js → chunk-JXXZH6KH.js} +2 -2
  56. package/dist/chunk-KJQN6GHW.js +6 -0
  57. package/dist/chunk-KJQN6GHW.js.map +1 -0
  58. package/dist/{chunk-PPY77NYV.js → chunk-KUTIJABX.js} +2 -2
  59. package/dist/{chunk-BMFFLDYL.js → chunk-LDWPRPN4.js} +2 -2
  60. package/dist/{chunk-VON7RTMD.js → chunk-M4BR3FKN.js} +2 -2
  61. package/dist/{chunk-Y7NHXFRX.js → chunk-MTOXXQYK.js} +2 -2
  62. package/dist/{chunk-JHMIAK67.js → chunk-MUJT3F2Q.js} +2 -2
  63. package/dist/{chunk-Q5LU2ZBL.js → chunk-NOY2YNXO.js} +2 -2
  64. package/dist/chunk-NZ64KNDV.js +2 -0
  65. package/dist/chunk-NZ64KNDV.js.map +1 -0
  66. package/dist/{chunk-BKVBDV6E.js → chunk-PQP3KZ7P.js} +2 -2
  67. package/dist/{chunk-AGUAPUCU.js → chunk-PS5T7URZ.js} +2 -2
  68. package/dist/chunk-QORZCJSR.js +2 -0
  69. package/dist/chunk-QORZCJSR.js.map +1 -0
  70. package/dist/chunk-QPN6X6UA.js +2 -0
  71. package/dist/chunk-QPN6X6UA.js.map +1 -0
  72. package/dist/{chunk-CB7T2SPX.js → chunk-RFMIAO6J.js} +2 -2
  73. package/dist/{chunk-DG3T5KLP.js → chunk-RKS3FX3C.js} +2 -2
  74. package/dist/{chunk-GSSC5OVG.js → chunk-RNXUKKPF.js} +2 -2
  75. package/dist/{chunk-HPBYZOPP.js → chunk-S63QGDMR.js} +2 -2
  76. package/dist/{chunk-4TJ2QZ7P.js → chunk-STEDOWHX.js} +2 -2
  77. package/dist/{chunk-JYYCK5IN.js → chunk-SZVBNL6O.js} +2 -2
  78. package/dist/{chunk-JRUJLG27.js → chunk-TGLB5MA2.js} +2 -2
  79. package/dist/chunk-TXSUZLOI.js +2 -0
  80. package/dist/chunk-TXSUZLOI.js.map +1 -0
  81. package/dist/{chunk-DZGLLSY7.js → chunk-VGIG5OUD.js} +2 -2
  82. package/dist/chunk-VLKG3SNS.js +2 -0
  83. package/dist/chunk-VLKG3SNS.js.map +1 -0
  84. package/dist/{chunk-4HVLMGRA.js → chunk-VOUP5SMR.js} +2 -2
  85. package/dist/{chunk-UP27IEE4.js → chunk-VSYION5R.js} +2 -2
  86. package/dist/{chunk-2UKAVWUS.js → chunk-XLTZ7SN3.js} +2 -2
  87. package/dist/{chunk-I3J7LKY3.js → chunk-XO5VURZY.js} +2 -2
  88. package/dist/chunk-Z4STVEJE.js +2 -0
  89. package/dist/chunk-Z4STVEJE.js.map +1 -0
  90. package/dist/default-components.d.ts +2 -2
  91. package/dist/default-components.js +1 -1
  92. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
  93. package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +3 -3
  94. package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
  95. package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
  96. package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
  97. package/dist/flows/ContractAmendment/context.d.ts +3 -3
  98. package/dist/flows/ContractAmendment/hooks.d.ts +3 -3
  99. package/dist/flows/ContractAmendment/hooks.js +1 -1
  100. package/dist/flows/ContractAmendment/index.d.ts +3 -3
  101. package/dist/flows/ContractAmendment/index.js +1 -1
  102. package/dist/flows/ContractAmendment/types.d.ts +2 -2
  103. package/dist/flows/ContractAmendment/utils.d.ts +2 -2
  104. package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +5 -5
  105. package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
  106. package/dist/flows/ContractorOnboarding/api.d.ts +179 -21
  107. package/dist/flows/ContractorOnboarding/api.js +1 -1
  108. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +4 -4
  109. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
  110. package/dist/flows/ContractorOnboarding/components/ChooseAlternativePlanStep.d.ts +3 -3
  111. package/dist/flows/ContractorOnboarding/components/ChooseAlternativePlanStep.js +1 -1
  112. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +5 -5
  113. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
  114. package/dist/flows/ContractorOnboarding/components/ContractPreviewHeader.d.ts +2 -2
  115. package/dist/flows/ContractorOnboarding/components/ContractPreviewStatement.d.ts +2 -2
  116. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +5 -5
  117. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
  118. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +5 -5
  119. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
  120. package/dist/flows/ContractorOnboarding/components/EligibilityQuestionnaireStep.d.ts +5 -5
  121. package/dist/flows/ContractorOnboarding/components/EligibilityQuestionnaireStep.js +1 -1
  122. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.d.ts +3 -3
  123. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.js +1 -1
  124. package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +5 -5
  125. package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
  126. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +4 -4
  127. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
  128. package/dist/flows/ContractorOnboarding/context.d.ts +5 -5
  129. package/dist/flows/ContractorOnboarding/hooks.d.ts +5 -5
  130. package/dist/flows/ContractorOnboarding/hooks.js +1 -1
  131. package/dist/flows/ContractorOnboarding/index.d.ts +5 -5
  132. package/dist/flows/ContractorOnboarding/index.js +1 -1
  133. package/dist/flows/ContractorOnboarding/jsfModify.d.ts +5 -5
  134. package/dist/flows/ContractorOnboarding/jsfModify.js +1 -1
  135. package/dist/flows/ContractorOnboarding/types.d.ts +5 -5
  136. package/dist/flows/ContractorOnboarding/utils.d.ts +4 -4
  137. package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +3 -3
  138. package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
  139. package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +3 -3
  140. package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
  141. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.d.ts +2 -2
  142. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +1 -1
  143. package/dist/flows/CostCalculator/SummaryResults/SummaryResults.d.ts +2 -2
  144. package/dist/flows/CostCalculator/api.d.ts +2 -2
  145. package/dist/flows/CostCalculator/api.js +1 -1
  146. package/dist/flows/CostCalculator/components/SalaryField.d.ts +2 -2
  147. package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
  148. package/dist/flows/CostCalculator/context.d.ts +3 -3
  149. package/dist/flows/CostCalculator/hooks.d.ts +3 -3
  150. package/dist/flows/CostCalculator/hooks.js +1 -1
  151. package/dist/flows/CostCalculator/index.d.ts +3 -3
  152. package/dist/flows/CostCalculator/index.js +1 -1
  153. package/dist/flows/CostCalculator/types.d.ts +2 -2
  154. package/dist/flows/CostCalculator/utils.d.ts +3 -3
  155. package/dist/flows/CostCalculator/utils.js +1 -1
  156. package/dist/flows/CreateCompany/CreateCompany.d.ts +18 -0
  157. package/dist/flows/CreateCompany/CreateCompany.js +2 -0
  158. package/dist/flows/CreateCompany/CreateCompany.js.map +1 -0
  159. package/dist/flows/CreateCompany/api.d.ts +81 -0
  160. package/dist/flows/CreateCompany/api.js +2 -0
  161. package/dist/flows/CreateCompany/api.js.map +1 -0
  162. package/dist/flows/CreateCompany/components/AddressDetailsStep.d.ts +14 -0
  163. package/dist/flows/CreateCompany/components/AddressDetailsStep.js +2 -0
  164. package/dist/flows/CreateCompany/components/AddressDetailsStep.js.map +1 -0
  165. package/dist/flows/CreateCompany/components/CompanyBasicInformationStep.d.ts +14 -0
  166. package/dist/flows/CreateCompany/components/CompanyBasicInformationStep.js +2 -0
  167. package/dist/flows/CreateCompany/components/CompanyBasicInformationStep.js.map +1 -0
  168. package/dist/flows/CreateCompany/components/CreateCompanyForm.d.ts +17 -0
  169. package/dist/flows/CreateCompany/components/CreateCompanyForm.js +2 -0
  170. package/dist/flows/CreateCompany/components/CreateCompanyForm.js.map +1 -0
  171. package/dist/flows/CreateCompany/components/CreateCompanySubmit.d.ts +6 -0
  172. package/dist/flows/CreateCompany/components/CreateCompanySubmit.js +2 -0
  173. package/dist/flows/CreateCompany/components/CreateCompanySubmit.js.map +1 -0
  174. package/dist/flows/CreateCompany/context.d.ts +82 -0
  175. package/dist/flows/CreateCompany/context.js +2 -0
  176. package/dist/flows/CreateCompany/context.js.map +1 -0
  177. package/dist/flows/CreateCompany/hooks.d.ts +14 -0
  178. package/dist/flows/CreateCompany/hooks.js +2 -0
  179. package/dist/flows/CreateCompany/hooks.js.map +1 -0
  180. package/dist/flows/CreateCompany/index.d.ts +15 -0
  181. package/dist/flows/CreateCompany/index.js +2 -0
  182. package/dist/flows/CreateCompany/index.js.map +1 -0
  183. package/dist/flows/CreateCompany/json-schemas/companyBasicInformationStep.d.ts +73 -0
  184. package/dist/flows/CreateCompany/json-schemas/companyBasicInformationStep.js +2 -0
  185. package/dist/flows/CreateCompany/json-schemas/companyBasicInformationStep.js.map +1 -0
  186. package/dist/flows/CreateCompany/types.d.ts +14 -0
  187. package/dist/flows/CreateCompany/types.js +1 -0
  188. package/dist/flows/CreateCompany/types.js.map +1 -0
  189. package/dist/flows/CreateCompany/utils.d.ts +8 -0
  190. package/dist/flows/CreateCompany/utils.js +2 -0
  191. package/dist/flows/CreateCompany/utils.js.map +1 -0
  192. package/dist/flows/Onboarding/OnboardingFlow.d.ts +4 -4
  193. package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
  194. package/dist/flows/Onboarding/api.d.ts +4 -4
  195. package/dist/flows/Onboarding/api.js +1 -1
  196. package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +2 -2
  197. package/dist/flows/Onboarding/components/AnnualGrossSalary.js +1 -1
  198. package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +4 -4
  199. package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
  200. package/dist/flows/Onboarding/components/BenefitsStep.d.ts +4 -4
  201. package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
  202. package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +4 -4
  203. package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
  204. package/dist/flows/Onboarding/components/OnboardingForm.d.ts +4 -4
  205. package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
  206. package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +3 -3
  207. package/dist/flows/Onboarding/components/OnboardingInvite.js +1 -1
  208. package/dist/flows/Onboarding/components/ReviewStep.d.ts +4 -4
  209. package/dist/flows/Onboarding/components/SaveDraftButton.d.ts +3 -3
  210. package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +4 -4
  211. package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
  212. package/dist/flows/Onboarding/context.d.ts +4 -4
  213. package/dist/flows/Onboarding/hooks.d.ts +4 -4
  214. package/dist/flows/Onboarding/hooks.js +1 -1
  215. package/dist/flows/Onboarding/index.d.ts +4 -4
  216. package/dist/flows/Onboarding/index.js +1 -1
  217. package/dist/flows/Onboarding/types.d.ts +4 -4
  218. package/dist/flows/Onboarding/utils.d.ts +4 -4
  219. package/dist/flows/Termination/AdditionalDetailsForm.d.ts +4 -4
  220. package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
  221. package/dist/flows/Termination/EmployeeComunicationForm.d.ts +4 -4
  222. package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
  223. package/dist/flows/Termination/PaidTimeOffForm.d.ts +4 -4
  224. package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
  225. package/dist/flows/Termination/TerminationDetailsForm.d.ts +4 -4
  226. package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
  227. package/dist/flows/Termination/TerminationFlow.d.ts +4 -4
  228. package/dist/flows/Termination/TerminationFlow.js +1 -1
  229. package/dist/flows/Termination/TerminationForm.d.ts +4 -4
  230. package/dist/flows/Termination/TerminationForm.js +1 -1
  231. package/dist/flows/Termination/api.d.ts +5 -5
  232. package/dist/flows/Termination/api.js +1 -1
  233. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.js +1 -1
  234. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.d.ts +6 -6
  235. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.d.ts +6 -6
  236. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.js +1 -1
  237. package/dist/flows/Termination/components/PaidTimeOff/types.d.ts +6 -6
  238. package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js +1 -1
  239. package/dist/flows/Termination/context.d.ts +4 -4
  240. package/dist/flows/Termination/hooks.d.ts +4 -4
  241. package/dist/flows/Termination/hooks.js +1 -1
  242. package/dist/flows/Termination/index.d.ts +6 -6
  243. package/dist/flows/Termination/index.js +1 -1
  244. package/dist/flows/Termination/json-schemas/jsonSchema.js +1 -1
  245. package/dist/flows/Termination/json-schemas/schema.d.ts +4 -4
  246. package/dist/flows/Termination/json-schemas/schema.js +1 -1
  247. package/dist/flows/Termination/types.d.ts +4 -4
  248. package/dist/flows/Termination/utils.d.ts +4 -4
  249. package/dist/flows/types.d.ts +2 -2
  250. package/dist/index.d.ts +15 -11
  251. package/dist/index.js +2 -2
  252. package/dist/index.js.map +1 -1
  253. package/dist/internals.d.ts +3 -3
  254. package/dist/internals.js +1 -1
  255. package/dist/{mutations-Cviv4PN1.d.ts → mutations-B8OzuyhA.d.ts} +1 -1
  256. package/dist/{remoteFlows-C41d3S6K.d.ts → remoteFlows-Bphgh2nl.d.ts} +12 -2
  257. package/dist/types-Bs66Ma28.d.ts +248 -0
  258. package/dist/{types-DGsUn7MK.d.ts → types-Ck-iVGL_.d.ts} +2 -2
  259. package/dist/{types-SHZYNK7B.d.ts → types-Dcg5CIEH.d.ts} +3 -3
  260. package/dist/{types-B3j6CHqF.d.ts → types-Dr-apmY1.d.ts} +4 -4
  261. package/dist/{types-C2Jm8UUR.d.ts → types-Jy-_3Y7m.d.ts} +1 -1
  262. package/dist/{types.gen-f6p9DLeW.d.ts → types.gen-Yvu8ksE5.d.ts} +254 -1
  263. package/dist/{utils-4FdXJdn7.d.ts → utils-C8T9BiQ3.d.ts} +1 -1
  264. package/package.json +1 -1
  265. package/dist/CountryFieldDefault-SFTKBP6V.js +0 -2
  266. package/dist/DatePickerFieldDefault-GHHRA5MC.js +0 -2
  267. package/dist/RadioGroupFieldDefault-WSWNB62Y.js +0 -2
  268. package/dist/chunk-6CASSN2Z.js +0 -2
  269. package/dist/chunk-FD2FTALC.js +0 -2
  270. package/dist/chunk-FD2FTALC.js.map +0 -1
  271. package/dist/chunk-L622FFV6.js +0 -2
  272. package/dist/chunk-RXP4X2CU.js.map +0 -1
  273. package/dist/chunk-YAJJJ2JV.js +0 -6
  274. package/dist/chunk-YAJJJ2JV.js.map +0 -1
  275. package/dist/chunk-YHP23JNL.js +0 -2
  276. package/dist/chunk-YHP23JNL.js.map +0 -1
  277. /package/dist/{CountryFieldDefault-SFTKBP6V.js.map → CountryFieldDefault-DJ7VD267.js.map} +0 -0
  278. /package/dist/{DatePickerFieldDefault-GHHRA5MC.js.map → DatePickerFieldDefault-ZWLN5P55.js.map} +0 -0
  279. /package/dist/{RadioGroupFieldDefault-WSWNB62Y.js.map → RadioGroupFieldDefault-7SVQ7ZQQ.js.map} +0 -0
  280. /package/dist/{chunk-MKT4MPUT.js.map → chunk-2J4XRENJ.js.map} +0 -0
  281. /package/dist/{chunk-UBYT2TI4.js.map → chunk-2ZS5F6C7.js.map} +0 -0
  282. /package/dist/{chunk-3YKLEDVY.js.map → chunk-37RBGAMM.js.map} +0 -0
  283. /package/dist/{chunk-HCJP6RDC.js.map → chunk-3ACL4IFO.js.map} +0 -0
  284. /package/dist/{chunk-OPQTTZBK.js.map → chunk-3XG2MGD3.js.map} +0 -0
  285. /package/dist/{chunk-6CASSN2Z.js.map → chunk-42R2H2DW.js.map} +0 -0
  286. /package/dist/{chunk-43UKWTHS.js.map → chunk-47YUPC2L.js.map} +0 -0
  287. /package/dist/{chunk-Z7A4LTSB.js.map → chunk-4SGUDT5K.js.map} +0 -0
  288. /package/dist/{chunk-NFLKVFAD.js.map → chunk-5F7FMTGE.js.map} +0 -0
  289. /package/dist/{chunk-NKPRRBFG.js.map → chunk-5TBUDUEB.js.map} +0 -0
  290. /package/dist/{chunk-7RC7EB47.js.map → chunk-6DRAZSGG.js.map} +0 -0
  291. /package/dist/{chunk-BWMATZIU.js.map → chunk-7TOCURKO.js.map} +0 -0
  292. /package/dist/{chunk-ZYLVMO7E.js.map → chunk-A37NW25N.js.map} +0 -0
  293. /package/dist/{chunk-BOWNQTTR.js.map → chunk-AB3RAEMM.js.map} +0 -0
  294. /package/dist/{chunk-TUJXQF4Q.js.map → chunk-AJ7L3ZO3.js.map} +0 -0
  295. /package/dist/{chunk-CE4ZEIWI.js.map → chunk-BC4UT7KC.js.map} +0 -0
  296. /package/dist/{chunk-K6WWMYKM.js.map → chunk-C36VO7DO.js.map} +0 -0
  297. /package/dist/{chunk-HRK4FJGT.js.map → chunk-D36BZQTP.js.map} +0 -0
  298. /package/dist/{chunk-CWHIIHQP.js.map → chunk-D5YMIXK5.js.map} +0 -0
  299. /package/dist/{chunk-RE2IHPDB.js.map → chunk-DCB2H2SG.js.map} +0 -0
  300. /package/dist/{chunk-5RFDYBDY.js.map → chunk-DI2QNZ2O.js.map} +0 -0
  301. /package/dist/{chunk-I4CH573Y.js.map → chunk-DI3XZUMY.js.map} +0 -0
  302. /package/dist/{chunk-IAIHITHL.js.map → chunk-GLKITZNI.js.map} +0 -0
  303. /package/dist/{chunk-QE62LRON.js.map → chunk-HLAKUOQB.js.map} +0 -0
  304. /package/dist/{chunk-6IFPFK23.js.map → chunk-HN7ZP5AX.js.map} +0 -0
  305. /package/dist/{chunk-ZURHNW3D.js.map → chunk-HU453KWI.js.map} +0 -0
  306. /package/dist/{chunk-P4GE72PQ.js.map → chunk-I2ED6EUG.js.map} +0 -0
  307. /package/dist/{chunk-2TPHCOVE.js.map → chunk-I7JUAYNN.js.map} +0 -0
  308. /package/dist/{chunk-XGECMN4V.js.map → chunk-IF42CZJH.js.map} +0 -0
  309. /package/dist/{chunk-3EK647EG.js.map → chunk-IHVEK72X.js.map} +0 -0
  310. /package/dist/{chunk-BZ5XEZCL.js.map → chunk-JXXZH6KH.js.map} +0 -0
  311. /package/dist/{chunk-PPY77NYV.js.map → chunk-KUTIJABX.js.map} +0 -0
  312. /package/dist/{chunk-BMFFLDYL.js.map → chunk-LDWPRPN4.js.map} +0 -0
  313. /package/dist/{chunk-VON7RTMD.js.map → chunk-M4BR3FKN.js.map} +0 -0
  314. /package/dist/{chunk-Y7NHXFRX.js.map → chunk-MTOXXQYK.js.map} +0 -0
  315. /package/dist/{chunk-JHMIAK67.js.map → chunk-MUJT3F2Q.js.map} +0 -0
  316. /package/dist/{chunk-Q5LU2ZBL.js.map → chunk-NOY2YNXO.js.map} +0 -0
  317. /package/dist/{chunk-BKVBDV6E.js.map → chunk-PQP3KZ7P.js.map} +0 -0
  318. /package/dist/{chunk-AGUAPUCU.js.map → chunk-PS5T7URZ.js.map} +0 -0
  319. /package/dist/{chunk-CB7T2SPX.js.map → chunk-RFMIAO6J.js.map} +0 -0
  320. /package/dist/{chunk-DG3T5KLP.js.map → chunk-RKS3FX3C.js.map} +0 -0
  321. /package/dist/{chunk-GSSC5OVG.js.map → chunk-RNXUKKPF.js.map} +0 -0
  322. /package/dist/{chunk-HPBYZOPP.js.map → chunk-S63QGDMR.js.map} +0 -0
  323. /package/dist/{chunk-4TJ2QZ7P.js.map → chunk-STEDOWHX.js.map} +0 -0
  324. /package/dist/{chunk-JYYCK5IN.js.map → chunk-SZVBNL6O.js.map} +0 -0
  325. /package/dist/{chunk-JRUJLG27.js.map → chunk-TGLB5MA2.js.map} +0 -0
  326. /package/dist/{chunk-DZGLLSY7.js.map → chunk-VGIG5OUD.js.map} +0 -0
  327. /package/dist/{chunk-4HVLMGRA.js.map → chunk-VOUP5SMR.js.map} +0 -0
  328. /package/dist/{chunk-UP27IEE4.js.map → chunk-VSYION5R.js.map} +0 -0
  329. /package/dist/{chunk-2UKAVWUS.js.map → chunk-XLTZ7SN3.js.map} +0 -0
  330. /package/dist/{chunk-I3J7LKY3.js.map → chunk-XO5VURZY.js.map} +0 -0
@@ -348,6 +348,38 @@ type EmploymentBasicResponse = {
348
348
  * Optional UTC date time in YYYY-MM-DDTHH:mm:ss format
349
349
  */
350
350
  type NullableDateTime = string | null;
351
+ /**
352
+ * ClientCredentialsResponse
353
+ */
354
+ type ClientCredentialsResponse = BaseTokenResponse;
355
+ /**
356
+ * AuthorizationCodeResponse
357
+ */
358
+ type AuthorizationCodeResponse = BaseTokenResponse & {
359
+ /**
360
+ * The ID of the connected company.
361
+ */
362
+ company_id?: string;
363
+ /**
364
+ * The refresh token. This token must be stored and used for issuing new access tokens for managing the company's resources.
365
+ */
366
+ refresh_token?: string;
367
+ /**
368
+ * The ID of the user who connected the company.
369
+ */
370
+ user_id?: string;
371
+ };
372
+ /**
373
+ * CompanyAlreadyExistsErrorResponse
374
+ *
375
+ * Error returned when a company with matching criteria already exists
376
+ */
377
+ type CompanyAlreadyExistsErrorResponse = {
378
+ code?: string;
379
+ message?: string;
380
+ resource_id?: string;
381
+ resource_type?: string;
382
+ };
351
383
  /**
352
384
  * CostCalculatorEmploymentParam
353
385
  */
@@ -388,6 +420,10 @@ type LimitedDaysandHoursResponse = {
388
420
  type Country = {
389
421
  alpha_2_code: string;
390
422
  code: string;
423
+ /**
424
+ * Contractor product names available for this country
425
+ */
426
+ contractor_products_available?: Array<'standard' | 'plus' | 'cor'>;
391
427
  country_subdivisions?: Array<CountrySubdivision> | null;
392
428
  eor_onboarding?: boolean;
393
429
  locked_benefits?: string;
@@ -413,6 +449,12 @@ type CreateOffboardingParams = {
413
449
  * The status of the user
414
450
  */
415
451
  type UserStatus = 'active' | 'created' | 'initiated' | 'cancelled' | 'inactive' | 'deleted';
452
+ /**
453
+ * CompanyCreationResponse
454
+ */
455
+ type CompanyCreationResponse = {
456
+ data?: CompanyResponse | CompanyWithTokensResponse;
457
+ };
416
458
  /**
417
459
  * CostCalculatorEstimateParams
418
460
  */
@@ -660,6 +702,15 @@ type OffboardingFile = {
660
702
  */
661
703
  name: string;
662
704
  };
705
+ /**
706
+ * RefreshTokenResponse
707
+ */
708
+ type RefreshTokenResponse = BaseTokenResponse & {
709
+ /**
710
+ * The refresh token
711
+ */
712
+ refresh_token?: string;
713
+ };
663
714
  /**
664
715
  * UnprocessableEntityResponse
665
716
  */
@@ -720,6 +771,10 @@ type CostCalculatorCost = {
720
771
  zendesk_article_id: string | null;
721
772
  zendesk_article_url: string | null;
722
773
  };
774
+ /**
775
+ * OAuth2Tokens
776
+ */
777
+ type OAuth2Tokens = AuthorizationCodeResponse | ClientCredentialsResponse | RefreshTokenResponse;
723
778
  /**
724
779
  * CostCalculatorCosts
725
780
  */
@@ -817,6 +872,25 @@ type Product = {
817
872
  short_name?: string;
818
873
  tier: string;
819
874
  };
875
+ /**
876
+ * CompanyResponse
877
+ *
878
+ * Shows a company
879
+ */
880
+ type CompanyResponse = {
881
+ data: {
882
+ company?: Company;
883
+ };
884
+ };
885
+ /**
886
+ * CompanyWithTokensResponse
887
+ *
888
+ * Shows a company with its refresh and access tokens. Please contact Remote if you need the tokens when creating a company.
889
+ */
890
+ type CompanyWithTokensResponse = {
891
+ company?: Company;
892
+ tokens?: OAuth2Tokens;
893
+ };
820
894
  /**
821
895
  * ListLeavePoliciesSummaryResponse
822
896
  *
@@ -1001,6 +1075,10 @@ type CreateContractDocument = {
1001
1075
  contract_document: {
1002
1076
  [key: string]: unknown;
1003
1077
  };
1078
+ /**
1079
+ * When true, skips AI-based compliance checks (e.g. services and deliverables classification). Defaults to false.
1080
+ */
1081
+ skip_ai_checks?: boolean;
1004
1082
  };
1005
1083
  /**
1006
1084
  * ValidationError
@@ -1054,6 +1132,10 @@ type Signatory = {
1054
1132
  type NullableCountry = {
1055
1133
  alpha_2_code: string;
1056
1134
  code: string;
1135
+ /**
1136
+ * Contractor product names available for this country
1137
+ */
1138
+ contractor_products_available?: Array<'standard' | 'plus' | 'cor'>;
1057
1139
  country_subdivisions?: Array<CountrySubdivision> | null;
1058
1140
  eor_onboarding?: boolean;
1059
1141
  locked_benefits?: string;
@@ -1205,10 +1287,103 @@ type CostCalculatorEmployment = {
1205
1287
  region: MinimalRegion;
1206
1288
  regional_currency_costs: CostCalculatorCosts;
1207
1289
  };
1290
+ /**
1291
+ * CreateCompanyParams
1292
+ */
1293
+ type CreateCompanyParams = {
1294
+ /**
1295
+ * Fields can vary depending on the country. Please, check the required fields structure using the [Show form schema endpoint](#operation/get_show_form_country).
1296
+ * Use the desired country and `address_details` as the form name for the placeholders.
1297
+ * The response complies with the [JSON Schema](https://developer.remote.com/docs/how-json-schemas-work) specification.
1298
+ *
1299
+ */
1300
+ address_details?: {
1301
+ [key: string]: unknown;
1302
+ };
1303
+ /**
1304
+ * Fields can vary depending on the country. Please, check the required fields structure using the [Show form schema endpoint](#operation/get_show_form_country).
1305
+ * Use the desired country and `bank_account_details` as the form name for the placeholders.
1306
+ * The response complies with the [JSON Schema](https://developer.remote.com/docs/how-json-schemas-work) specification.
1307
+ *
1308
+ */
1309
+ bank_account_details?: {
1310
+ [key: string]: unknown;
1311
+ };
1312
+ /**
1313
+ * The company owner email.
1314
+ *
1315
+ * This value cannot be changed once set.
1316
+ *
1317
+ */
1318
+ company_owner_email: string;
1319
+ /**
1320
+ * The company owner name.
1321
+ *
1322
+ * This value cannot be changed from the Remote API once set.
1323
+ *
1324
+ */
1325
+ company_owner_name: string;
1326
+ /**
1327
+ * 3-letter country code of the country the company address is located in.
1328
+ *
1329
+ * For a list of countries supported through the Remote API, make a call to the [list countries endpoint](#tag/Countries/operation/get_supported_country). This endpoint will also include the 3-letter country codes you can use for this field.
1330
+ *
1331
+ */
1332
+ country_code: string;
1333
+ /**
1334
+ * Desired currency for invoicing and displaying converted salaries in Remote UI regardless of the employee's country.
1335
+ */
1336
+ desired_currency: 'AUD' | 'CAD' | 'CHF' | 'DKK' | 'EUR' | 'GBP' | 'JPY' | 'NOK' | 'NZD' | 'SEK' | 'SGD' | 'USD';
1337
+ /**
1338
+ * The domain of the company. Use this field to specify the company domain name when it's different from the domain in the company owner's email.
1339
+ */
1340
+ email_domain?: string;
1341
+ /**
1342
+ * Id of the company as represented in the external partner system.
1343
+ */
1344
+ external_id?: string;
1345
+ /**
1346
+ * The company name
1347
+ */
1348
+ name: string;
1349
+ /**
1350
+ * A phone number the company can be contacted with.
1351
+ */
1352
+ phone_number?: string;
1353
+ /**
1354
+ * The company registration number. This field or `tax_number` (but not both) should be submitted.
1355
+ */
1356
+ registration_number?: string;
1357
+ /**
1358
+ * The tax identifier of the company. This field or `registration_number` (but not both) should be submitted.
1359
+ */
1360
+ tax_number?: string;
1361
+ /**
1362
+ * Date and time the Terms of Service were accepted. To ensure users read the most recent version of Remote's Terms of Service, their action cannot have been done more than fifteen minutes ago. The UTC offset must be included in the ISO 8601 format: `YYYY-MM-DD HOURS:MINUTES:SECONDSZ`
1363
+ */
1364
+ terms_of_service_accepted_at: string;
1365
+ };
1208
1366
  /**
1209
1367
  * UuidSlug
1210
1368
  */
1211
1369
  type UuidSlug = string;
1370
+ /**
1371
+ * BaseTokenResponse
1372
+ */
1373
+ type BaseTokenResponse = {
1374
+ /**
1375
+ * A JWT token.
1376
+ */
1377
+ access_token?: string;
1378
+ /**
1379
+ * Number of seconds until token is expired.
1380
+ */
1381
+ expires_in?: number;
1382
+ /**
1383
+ * The type of the token. For now, always `Bearer`.
1384
+ */
1385
+ token_type?: string;
1386
+ };
1212
1387
  /**
1213
1388
  * SuccessResponse
1214
1389
  */
@@ -1427,6 +1602,10 @@ type ContractorSubscriptionsSummary = {
1427
1602
  is_termination_fees_enabled?: boolean;
1428
1603
  price: {
1429
1604
  amount?: number;
1605
+ /**
1606
+ * The price after applying the company discount, in cents
1607
+ */
1608
+ final_amount?: number;
1430
1609
  };
1431
1610
  product: Product;
1432
1611
  total_amount: number | null;
@@ -1524,6 +1703,63 @@ type UnauthorizedResponse = {
1524
1703
  type PricingPlanDetails = {
1525
1704
  frequency: 'annually' | 'monthly';
1526
1705
  };
1706
+ /**
1707
+ * UpdateCompanyParams
1708
+ */
1709
+ type UpdateCompanyParams = {
1710
+ /**
1711
+ * Fields can vary depending on the country. Please, check the required fields structure using the [Show form schema endpoint](#operation/get_show_form_country).
1712
+ * Use the desired country and `address_details` as the form name for the placeholders.
1713
+ * The response complies with the [JSON Schema](https://developer.remote.com/docs/how-json-schemas-work) specification.
1714
+ *
1715
+ */
1716
+ address_details?: {
1717
+ [key: string]: unknown;
1718
+ };
1719
+ /**
1720
+ * Fields can vary depending on the country. Please, check the required fields structure using the [Show form schema endpoint](#operation/get_show_form_country).
1721
+ * Use the desired country and `bank_account_details` as the form name for the placeholders.
1722
+ * The response complies with the [JSON Schema](https://developer.remote.com/docs/how-json-schemas-work) specification.
1723
+ *
1724
+ */
1725
+ bank_account_details?: {
1726
+ [key: string]: unknown;
1727
+ };
1728
+ /**
1729
+ * Country of company address
1730
+ */
1731
+ country_code?: string;
1732
+ /**
1733
+ * Desired currency for invoicing and displaying converted salaries in Remote UI regardless of the employee's country.
1734
+ *
1735
+ * This field is only accepted if company is in status `pending`. Please contact Remote if you wish to update it.
1736
+ *
1737
+ */
1738
+ desired_currency?: 'AUD' | 'CAD' | 'CHF' | 'DKK' | 'EUR' | 'GBP' | 'JPY' | 'NOK' | 'NZD' | 'SEK' | 'SGD' | 'USD';
1739
+ /**
1740
+ * This field is only accepted if company is in status `pending`. Please contact Remote if you wish to update it.
1741
+ *
1742
+ */
1743
+ name?: string;
1744
+ /**
1745
+ * A phone number the company can be contacted with.
1746
+ */
1747
+ phone_number?: string;
1748
+ /**
1749
+ * The company registration number. This field or tax_number (but not both) should be submitted.
1750
+ *
1751
+ * This field is only accepted if company is in status `pending`.
1752
+ *
1753
+ */
1754
+ registration_number?: string;
1755
+ /**
1756
+ * The tax identifier of the company. This field or registration_number (but not both) should be submitted.
1757
+ *
1758
+ * This field is only accepted if company is in status `pending`.
1759
+ *
1760
+ */
1761
+ tax_number?: string;
1762
+ };
1527
1763
  /**
1528
1764
  * SignContractDocument
1529
1765
  *
@@ -1702,6 +1938,17 @@ type Decimal = string;
1702
1938
  type MessageResponse = {
1703
1939
  message: string;
1704
1940
  };
1941
+ /**
1942
+ * CompanyNotEligibleForCreationErrorResponse
1943
+ *
1944
+ * Error returned when the company already have employees in countries supported by the integration.
1945
+ */
1946
+ type CompanyNotEligibleForCreationErrorResponse = {
1947
+ code?: string;
1948
+ message?: string;
1949
+ resource_id?: string;
1950
+ resource_type?: string;
1951
+ };
1705
1952
  /**
1706
1953
  * SalaryDecreaseDetails
1707
1954
  *
@@ -1825,6 +2072,12 @@ type HelpCenterArticle = {
1825
2072
  */
1826
2073
  zendesk_id: number;
1827
2074
  };
2075
+ /**
2076
+ * CompanyCreationConflictErrorResponse
2077
+ */
2078
+ type CompanyCreationConflictErrorResponse = {
2079
+ message?: CompanyAlreadyExistsErrorResponse | CompanyNotEligibleForCreationErrorResponse;
2080
+ };
1828
2081
  /**
1829
2082
  * EmploymentResponse
1830
2083
  *
@@ -1912,4 +2165,4 @@ type PostAutomatableContractAmendmentErrors = {
1912
2165
  };
1913
2166
  type PostAutomatableContractAmendmentError = PostAutomatableContractAmendmentErrors[keyof PostAutomatableContractAmendmentErrors];
1914
2167
 
1915
- export type { TimeoffType as $, UploadFileResponse as A, BadRequestResponse as B, ContractAmendmentAutomatableResponse as C, FileParams as D, Employment as E, ForbiddenResponse as F, SignContractDocument as G, ContractorSubscriptionsSummary as H, ManageContractorPlusSubscriptionOperationsParams as I, CreateContractDocument as J, File as K, DateTimeIso8601 as L, MinimalRegion as M, NotFoundResponse as N, OffboardingResponse as O, PostCreateContractAmendmentError as P, ContractDocumentItem as Q, RequestError as R, SuccessResponse as S, TooManyRequestsResponse as T, UnprocessableEntityResponse as U, ValidationError as V, EligibilityQuestionnaireResponse as W, ConflictErrorResponse as X, SubmitEligibilityQuestionnaireRequest as Y, ListTimeoffResponse as Z, TimeoffStatus as _, UnauthorizedResponse as a, ListLeavePoliciesSummaryResponse as a0, CreateOffboardingParams as a1, MagicLinkResponse as a2, MagicLinkParams as a3, GetShowEmploymentResponse as a4, Currency as a5, HelpCenterArticle as a6, PayrollCalendarEor as a7, ContractAmendmentResponse as b, PostAutomatableContractAmendmentError as c, EmploymentCreationResponse as d, EmploymentResponse as e, CreateContractDocumentResponse as f, EligibilityQuestionnaire as g, Signatory as h, CompanyLegalEntity as i, CostCalculatorEstimateResponse as j, CostCalculatorEstimatePdfResponse as k, CostCalculatorEstimateParams as l, CostCalculatorEstimateCsvResponse as m, MinimalCountry as n, EmploymentTermType as o, CostCalculatorEmployment as p, PostCreateEstimationError as q, Company as r, ConflictResponse as s, EmploymentCreateParams as t, EmploymentFullParams as u, UnifiedEmploymentUpsertBenefitOffersRequest as v, ConvertCurrencyResponse as w, ConvertCurrencyParams as x, CreateContractEligibilityParams as y, TerminationDetailsParams as z };
2168
+ export type { EligibilityQuestionnaireResponse as $, UnifiedEmploymentUpsertBenefitOffersRequest as A, BadRequestResponse as B, ContractAmendmentAutomatableResponse as C, ConvertCurrencyResponse as D, Employment as E, ForbiddenResponse as F, ConvertCurrencyParams as G, CreateContractEligibilityParams as H, TerminationDetailsParams as I, UploadFileResponse as J, FileParams as K, SignContractDocument as L, MinimalRegion as M, NotFoundResponse as N, OffboardingResponse as O, PostCreateContractAmendmentError as P, ContractorSubscriptionsSummary as Q, RequestError as R, SuccessResponse as S, TooManyRequestsResponse as T, UnprocessableEntityResponse as U, ValidationError as V, ManageContractorPlusSubscriptionOperationsParams as W, CreateContractDocument as X, File as Y, DateTimeIso8601 as Z, ContractDocumentItem as _, UnauthorizedResponse as a, ConflictErrorResponse as a0, SubmitEligibilityQuestionnaireRequest as a1, ListTimeoffResponse as a2, TimeoffStatus as a3, TimeoffType as a4, ListLeavePoliciesSummaryResponse as a5, CreateOffboardingParams as a6, MagicLinkResponse as a7, MagicLinkParams as a8, GetShowEmploymentResponse as a9, Currency as aa, HelpCenterArticle as ab, PayrollCalendarEor as ac, ContractAmendmentResponse as b, PostAutomatableContractAmendmentError as c, CostCalculatorEstimateResponse as d, CostCalculatorEstimatePdfResponse as e, CostCalculatorEstimateParams as f, CostCalculatorEstimateCsvResponse as g, MinimalCountry as h, EmploymentTermType as i, CostCalculatorEmployment as j, PostCreateEstimationError as k, EmploymentCreationResponse as l, EmploymentResponse as m, CreateContractDocumentResponse as n, EligibilityQuestionnaire as o, Signatory as p, CompanyLegalEntity as q, CompanyCreationResponse as r, CompanyCreationConflictErrorResponse as s, CreateCompanyParams as t, CompanyResponse as u, UpdateCompanyParams as v, Company as w, ConflictResponse as x, EmploymentCreateParams as y, EmploymentFullParams as z };
@@ -1,6 +1,6 @@
1
1
  import { ClassValue } from 'clsx';
2
2
  import { ValidationError } from 'yup';
3
- import './remoteFlows-C41d3S6K.js';
3
+ import './remoteFlows-Bphgh2nl.js';
4
4
 
5
5
  declare function cn(...inputs: ClassValue[]): string;
6
6
  type YupError = Pick<ValidationError, 'type' | 'errors'> & {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remoteoss/remote-flows",
3
- "version": "1.14.0",
3
+ "version": "1.15.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/remoteoss/remote-flows.git"
@@ -1,2 +0,0 @@
1
- import{a}from"./chunk-AGUAPUCU.js";import"./chunk-BWMATZIU.js";import"./chunk-T7CGGZOK.js";import"./chunk-CU3WQ2KN.js";import"./chunk-I3J7LKY3.js";import"./chunk-ZSJ6YADQ.js";import"./chunk-YAJJJ2JV.js";import"./chunk-OK3CYSHV.js";import"./chunk-AS4ND5IO.js";import"./chunk-4YPJKEHT.js";import"./chunk-2DCJODMR.js";import"./chunk-3PIJOIYR.js";import"./chunk-X6ZAR7ZL.js";import"./chunk-KQPDXXG3.js";import"./chunk-P37U34EQ.js";export{a as CountryFieldDefault};
2
- //# sourceMappingURL=CountryFieldDefault-SFTKBP6V.js.map
@@ -1,2 +0,0 @@
1
- import{a}from"./chunk-5RFDYBDY.js";import"./chunk-BWMATZIU.js";import"./chunk-CU3WQ2KN.js";import"./chunk-I3J7LKY3.js";import"./chunk-ZSJ6YADQ.js";import"./chunk-YAJJJ2JV.js";import"./chunk-4YPJKEHT.js";import"./chunk-2DCJODMR.js";import"./chunk-3PIJOIYR.js";import"./chunk-X6ZAR7ZL.js";import"./chunk-KQPDXXG3.js";import"./chunk-P37U34EQ.js";export{a as DatePickerFieldDefault};
2
- //# sourceMappingURL=DatePickerFieldDefault-GHHRA5MC.js.map
@@ -1,2 +0,0 @@
1
- import{a}from"./chunk-IAIHITHL.js";import"./chunk-BWMATZIU.js";import"./chunk-I3J7LKY3.js";import"./chunk-ZSJ6YADQ.js";import"./chunk-YAJJJ2JV.js";import"./chunk-JEULZR34.js";import"./chunk-2DCJODMR.js";import"./chunk-3PIJOIYR.js";import"./chunk-X6ZAR7ZL.js";import"./chunk-KQPDXXG3.js";import"./chunk-P37U34EQ.js";export{a as RadioGroupFieldDefault};
2
- //# sourceMappingURL=RadioGroupFieldDefault-WSWNB62Y.js.map
@@ -1,2 +0,0 @@
1
- import{a as m}from"./chunk-NX7MM6XR.js";import{a as e}from"./chunk-ZXGAFQXW.js";import{a as i}from"./chunk-LMYJ6V44.js";import{a as o}from"./chunk-TC7EQZJK.js";var p={employee_communication:o,termination_details:e,paid_time_off:m,additional_information:i};export{p as a};
2
- //# sourceMappingURL=chunk-6CASSN2Z.js.map
@@ -1,2 +0,0 @@
1
- import{a as k}from"./chunk-6CASSN2Z.js";import{a as S}from"./chunk-XFD3ULUF.js";import{a as m,b as u,c as h,d as _}from"./chunk-DFJNVGK4.js";import{a as b}from"./chunk-EUSCQL4H.js";import{U as g,c as D,z as T}from"./chunk-YAJJJ2JV.js";import{d as i}from"./chunk-KQPDXXG3.js";import{a as n}from"./chunk-P37U34EQ.js";var y=n(e=>{let[t,r,o]=e.split("-").map(Number);return new Date(t,r-1,o)},"parseLocalDate");import{useQuery as v}from"@tanstack/react-query";var c=n(({employmentId:e,status:t,timeoffType:r,options:o})=>{let{client:a}=i();return v({queryKey:["timeoff",e,t],retry:!1,queryFn:n(()=>g({client:a,headers:{Authorization:""},query:{employment_id:e,status:t,timeoff_type:r}}),"queryFn"),select:n(({data:s})=>o?.select?.(s)??s,"select"),enabled:o?.enabled})},"useTimeOffQuery"),R=n((e,t)=>{let r=y(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),o=y(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"});return`${r} \u2192 ${o}`},"formatDateRange"),G=n(({employmentId:e,options:t})=>c({employmentId:e,timeoffType:"paid_time_off",options:{enabled:t?.enabled,select:n(r=>({bookedDays:r?.data?.timeoffs?.reduce((o,a)=>o+(a?.timeoff_days?.filter(s=>s.hours!=null&&s.hours>0).length||0),0)||0,timeoffs:r?.data?.timeoffs?.map(o=>{let a=o?.timeoff_days?.filter(s=>s.hours>0).length||0;return{status:o?.status,duration:a,startDate:o?.start_date,endDate:o?.end_date,formattedDate:R(o?.start_date,o?.end_date)}})||[]}),"select")}}),"usePaidTimeoffBreakdownQuery"),A=n(({employmentId:e})=>{let{client:t}=i();return v({queryKey:["timeoff-balance",e],retry:!1,queryFn:n(()=>T({client:t,headers:{Authorization:""},path:{employment_id:e}}),"queryFn"),select:n(({data:r})=>r,"select")})},"useTimeOffLeavePoliciesSummaryQuery");import{useMutation as E,useQuery as Q}from"@tanstack/react-query";function F(e){return Object.entries(e).reduce((t,[r,o])=>({...t,[r]:h(o)}),{})}n(F,"formatTimeoffValues");function q(e){let t=e?.contract_details?.available_pto,r=e?.contract_details?.available_pto_type;return e?.country?.code==="USA"&&r==="unlimited"?{value:t===0?20:t}:r==="unlimited"&&t>0?{value:t}:{value:t}}n(q,"getMinimumStatutoryDays");function w(e,t){let r=0,o=0;return e.forEach(a=>{a.timeoff_days?.forEach(s=>{new Date(s.day)<=t?r+=s.hours||0:o+=s.hours||0})}),{before:r,after:o}}n(w,"getAllTimeoffHoursBeforeDate");var M=n(({employmentId:e,date:t,options:r})=>c({employmentId:e,timeoffType:"paid_time_off",status:"approved",options:{enabled:r?.enabled,select:n(o=>{let{before:a,after:s}=w(o?.data?.timeoffs||[],new Date(t));return{bookedDaysBeforeTermination:u(a),bookedDaysAfterTermination:u(s)}},"select")}}),"useBookedTimeoffBeforeAndAfterTerminationQuery"),de=n(({employmentId:e,proposedTerminationDate:t,employment:r})=>{let{value:o=0}=q(r),a=A({employmentId:e}),s=M({employmentId:e,date:t}),p=a.data?.data?.[0].annual_entitlement.type==="limited"?{days:a.data?.data?.[0].annual_entitlement.days,hours:a.data?.data?.[0].annual_entitlement.hours}:{days:o,hours:0},d={days:a.data?.data?.[0].booked.days||0,hours:a.data?.data?.[0].booked.hours||0},f=a.data?.data?.[0].current_entitlement.type==="limited"?{days:a.data?.data?.[0].current_entitlement.days||0,hours:a.data?.data?.[0].current_entitlement.hours||0}:{days:o,hours:0},l={days:a.data?.data?.[0].used.days||0,hours:a.data?.data?.[0].used.hours||0},B=s.data?.bookedDaysBeforeTermination||{days:0,hours:0},x=s.data?.bookedDaysAfterTermination||{days:0,hours:0},C=m(f.days,f.hours),H=m(l.days,l.hours),L=m(d.days,d.hours),P=C-H-L,O=_(u(P));return{data:{...F({entitledDays:p,bookedDays:d,usedDays:l,approvedDaysBeforeTermination:B,approvedDaysAfterTermination:x,remainingDays:O,currentEntitlementDays:f}),isUnlimitedPto:r?.contract_details?.available_pto_type==="unlimited"},isLoading:a.isLoading||s.isLoading,isError:a.isError||s.isError,error:a.error||s.error}},"useSummaryTimeOffDataQuery"),fe=n(()=>{let{client:e}=i();return E({mutationFn:n(t=>D({client:e,body:t}),"mutationFn")})},"useCreateTermination"),le=n(({formValues:e,jsfModify:t,step:r})=>Q({queryKey:["rmt-flows-termination-schema",r],queryFn:n(()=>k[r]??S,"queryFn"),select:n(({data:o})=>{let a=o?.schema||{};return b(a,e||{},{jsfModify:t})},"select")}),"useTerminationSchema");export{y as a,c as b,G as c,A as d,M as e,de as f,fe as g,le as h};
2
- //# sourceMappingURL=chunk-FD2FTALC.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/common/dates.ts","../src/common/api/timeoff.ts","../src/flows/Termination/api.ts"],"sourcesContent":["export function getYearMonthDate(date: Date) {\n const year = date.getFullYear();\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const day = String(date.getDate()).padStart(2, '0');\n\n return {\n year,\n month,\n day,\n };\n}\n\nexport const parseLocalDate = (dateString: string) => {\n const [year, month, day] = dateString.split('-').map(Number);\n return new Date(year, month - 1, day);\n};\n","import {\n getIndexLeavePoliciesSummary,\n getIndexTimeoff,\n ListTimeoffResponse,\n TimeoffStatus,\n TimeoffType,\n} from '@/src/client';\nimport { Client } from '@/src/client/client';\nimport { parseLocalDate } from '@/src/common/dates';\nimport { useClient } from '@/src/context';\nimport { useQuery } from '@tanstack/react-query';\n\n/**\n * Hook to retrieve time off data for a specific employment.\n *\n * @param {Object} params - The parameters for the query.\n * @param {string} [params.employmentId] - The ID of the employment to fetch time off data for.\n * @param {TimeoffStatus} [params.status] - The status of the time off requests to filter by (e.g., 'approved', 'pending').\n * @returns {UseQueryResult<any, unknown>} - The result of the query, including the time off data.\n *\n */\nexport const useTimeOffQuery = <TData = ListTimeoffResponse>({\n employmentId,\n status,\n timeoffType,\n options,\n}: {\n employmentId?: string;\n status?: TimeoffStatus;\n timeoffType?: TimeoffType;\n options?: {\n enabled?: boolean;\n select?: (data: ListTimeoffResponse | undefined) => TData;\n };\n}) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['timeoff', employmentId, status],\n retry: false,\n queryFn: () => {\n return getIndexTimeoff({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n query: {\n employment_id: employmentId,\n status: status,\n timeoff_type: timeoffType,\n },\n });\n },\n select: ({ data }) => (options?.select?.(data) ?? data) as TData,\n enabled: options?.enabled,\n });\n};\n\nconst formatDateRange = (startDate: string, endDate: string) => {\n const start = parseLocalDate(startDate).toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n });\n const end = parseLocalDate(endDate).toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n });\n return `${start} → ${end}`;\n};\n\nexport type PaidTimeoffBreakdownResponse = {\n bookedDays: number;\n timeoffs: {\n status: string;\n duration: number;\n startDate: string;\n endDate: string;\n formattedDate: string;\n }[];\n};\n\n/**\n * Hook to retrieve paid time off breakdown for a specific employment.\n *\n * @param {Object} params - The parameters for the query.\n * @param {string} [params.employmentId] - The ID of the employment to fetch paid time off breakdown for.\n * @returns {UseQueryResult<any, unknown>} - The result of the query, including the paid time off breakdown.\n *\n */\nexport const usePaidTimeoffBreakdownQuery = ({\n employmentId,\n options,\n}: {\n employmentId?: string;\n options?: {\n enabled?: boolean;\n };\n}) => {\n return useTimeOffQuery<PaidTimeoffBreakdownResponse>({\n employmentId,\n timeoffType: 'paid_time_off',\n options: {\n enabled: options?.enabled,\n select: (data) => {\n return {\n bookedDays:\n data?.data?.timeoffs?.reduce(\n (acc, timeoff) =>\n acc +\n (timeoff?.timeoff_days?.filter(\n (day) => day.hours != null && day.hours > 0,\n ).length || 0),\n 0,\n ) || 0,\n timeoffs:\n data?.data?.timeoffs?.map((timeoff) => {\n const duration =\n timeoff?.timeoff_days?.filter((day) => day.hours > 0).length ||\n 0;\n return {\n status: timeoff?.status,\n duration: duration,\n startDate: timeoff?.start_date,\n endDate: timeoff?.end_date,\n formattedDate: formatDateRange(\n timeoff?.start_date,\n timeoff?.end_date,\n ),\n };\n }) || [],\n };\n },\n },\n });\n};\n\n/**\n * Hook to retrieve time off balance for a specific employment.\n *\n * @param {Object} params - The parameters for the query.\n * @param {string} [params.employmentId] - The ID of the employment to fetch time off balance for.\n * @returns {UseQueryResult<any, unknown>} - The result of the query, including the time off balance.\n *\n */\nexport const useTimeOffLeavePoliciesSummaryQuery = ({\n employmentId,\n}: {\n employmentId?: string;\n}) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['timeoff-balance', employmentId],\n retry: false,\n queryFn: () => {\n return getIndexLeavePoliciesSummary({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: { employment_id: employmentId as string },\n });\n },\n select: ({ data }) => data,\n });\n};\n","import {\n CreateOffboardingParams,\n postCreateOffboarding,\n Timeoff,\n} from '@/src/client';\nimport {\n useTimeOffLeavePoliciesSummaryQuery,\n useTimeOffQuery,\n} from '@/src/common/api/timeoff';\nimport { useClient } from '@/src/context';\nimport { Employment } from '@/src/flows/Onboarding/types';\nimport { defaultSchema } from '@/src/flows/Termination/json-schemas/defaultSchema';\nimport { TerminationFormValues } from '@/src/flows/Termination/types';\nimport { JSFModify } from '@/src/flows/types';\nimport {\n clampNegativeValuesIfApplicable,\n convertTotalHoursToDaysAndHours,\n convertToTotalHours,\n DaysAndHours,\n formatAsDecimal,\n} from '@/src/lib/time';\nimport { Client } from '@/src/client/client';\nimport { createHeadlessForm } from '@/src/common/createHeadlessForm';\nimport { useMutation, useQuery } from '@tanstack/react-query';\nimport { schema } from '@/src/flows/Termination/json-schemas/schema';\n\nfunction formatTimeoffValues(\n values: Record<string, DaysAndHours>,\n): Record<string, string> {\n return Object.entries(values).reduce(\n (acc, [key, value]) => ({\n ...acc,\n [key]: formatAsDecimal(value),\n }),\n {},\n );\n}\n\nfunction getMinimumStatutoryDays(employment?: Employment) {\n const availablePto = employment?.contract_details?.available_pto as number;\n const ptoType = employment?.contract_details?.available_pto_type as\n | 'unlimited'\n | 'fixed';\n const countryCode = employment?.country?.code;\n\n // Special handling for countries without statutory minimums\n if (countryCode === 'USA' && ptoType === 'unlimited') {\n // USA has no minimum, but Remote recommends 20\n return {\n value: availablePto === 0 ? 20 : availablePto,\n };\n }\n\n // For most countries with unlimited PTO, available_pto IS the statutory minimum\n if (ptoType === 'unlimited' && availablePto > 0) {\n return {\n value: availablePto,\n };\n }\n\n // For fixed PTO, it's just the entitlement\n return {\n value: availablePto,\n };\n}\n\nexport type BookedTimeoffBeforeDateResponse = {\n /*\n * The number of days booked before termination.\n */\n bookedDaysBeforeTermination: DaysAndHours;\n /*\n * The number of days booked after termination.\n */\n bookedDaysAfterTermination: DaysAndHours;\n};\n\nfunction getAllTimeoffHoursBeforeDate(\n timeoffs: Timeoff[],\n terminationDate: Date,\n): { before: number; after: number } {\n let before = 0;\n let after = 0;\n\n timeoffs.forEach((timeoff) => {\n timeoff.timeoff_days?.forEach((day) => {\n const dayDate = new Date(day.day);\n if (dayDate <= terminationDate) {\n // Day is on or before termination\n before += day.hours || 0;\n } else {\n // Day is after termination\n after += day.hours || 0;\n }\n });\n });\n\n return { before, after };\n}\n\n/**\n * Hook to retrieve booked time off data before and after a specific date for a specific employment.\n *\n * @param {Object} params - The parameters for the query.\n * @param {string} [params.employmentId] - The ID of the employment to fetch booked time off data for.\n * @param {string} [params.date] - The date to fetch booked time off data for.\n * @returns {BookedTimeoffBeforeDateResponse} - The booked time off data before and after the specific date.\n *\n * This hook accounts for partial days and multiple timeoff_days per request.\n */\nexport const useBookedTimeoffBeforeAndAfterTerminationQuery = ({\n employmentId,\n date,\n options,\n}: {\n employmentId: string;\n date: string;\n options?: { enabled: boolean };\n}) => {\n return useTimeOffQuery<BookedTimeoffBeforeDateResponse>({\n employmentId,\n timeoffType: 'paid_time_off',\n status: 'approved',\n options: {\n enabled: options?.enabled,\n select: (data) => {\n const { before, after } = getAllTimeoffHoursBeforeDate(\n data?.data?.timeoffs || [],\n new Date(date),\n );\n\n return {\n bookedDaysBeforeTermination: convertTotalHoursToDaysAndHours(before),\n bookedDaysAfterTermination: convertTotalHoursToDaysAndHours(after),\n };\n },\n },\n });\n};\n\nexport type SummaryTimeOffDataResponse = {\n /*\n * The number of days entitled to per year.\n */\n entitledDays: string;\n /*\n * The number of days booked.\n */\n bookedDays: string;\n /*\n * The number of days used.\n */\n usedDays: string;\n /*\n * The number of days current entitlement, better than entitledDays because it takes into account the accrued value.\n */\n currentEntitlementDays: string;\n /*\n * The number of days approved before termination.\n */\n approvedDaysBeforeTermination: string;\n /*\n * The number of days approved after termination.\n */\n approvedDaysAfterTermination: string;\n /*\n * The number of days remaining.\n */\n remainingDays: string;\n /*\n * Whether the PTO is unlimited or not.\n */\n isUnlimitedPto: boolean;\n};\n\n/**\n * Hook to retrieve summary time off data for a specific employment.\n *\n * @param {Object} params - The parameters for the query.\n * @param {string} [params.employmentId] - The ID of the employment to fetch summary time off data for.\n * @param {string} [params.proposedTerminationDate] - The proposed termination date to fetch summary time off data for.\n * @returns {SummaryTimeOffDataResponse} - The summary time off data.\n *\n * This hook doesn't take into account unlimited time off or half days yet.\n *\n */\nexport const useSummaryTimeOffDataQuery = ({\n employmentId,\n proposedTerminationDate,\n employment,\n}: {\n employmentId: string;\n proposedTerminationDate: string;\n employment?: Employment;\n}) => {\n const { value: minimumStatutoryDays = 0 } =\n getMinimumStatutoryDays(employment);\n const leavePoliciesSummaryQuery = useTimeOffLeavePoliciesSummaryQuery({\n employmentId,\n });\n const bookedTimeQuery = useBookedTimeoffBeforeAndAfterTerminationQuery({\n employmentId,\n date: proposedTerminationDate,\n });\n\n const entitledDays =\n leavePoliciesSummaryQuery.data?.data?.[0].annual_entitlement.type ===\n 'limited'\n ? {\n days: leavePoliciesSummaryQuery.data?.data?.[0].annual_entitlement\n .days,\n hours:\n leavePoliciesSummaryQuery.data?.data?.[0].annual_entitlement.hours,\n }\n : { days: minimumStatutoryDays, hours: 0 };\n\n const bookedDays = {\n days: leavePoliciesSummaryQuery.data?.data?.[0].booked.days || 0,\n hours: leavePoliciesSummaryQuery.data?.data?.[0].booked.hours || 0,\n };\n\n const currentEntitlementDays =\n leavePoliciesSummaryQuery.data?.data?.[0].current_entitlement.type ===\n 'limited'\n ? {\n days:\n leavePoliciesSummaryQuery.data?.data?.[0].current_entitlement\n .days || 0,\n hours:\n leavePoliciesSummaryQuery.data?.data?.[0].current_entitlement\n .hours || 0,\n }\n : { days: minimumStatutoryDays, hours: 0 };\n\n const usedDays = {\n days: leavePoliciesSummaryQuery.data?.data?.[0].used.days || 0,\n hours: leavePoliciesSummaryQuery.data?.data?.[0].used.hours || 0,\n };\n\n const approvedDaysBeforeTermination = bookedTimeQuery.data\n ?.bookedDaysBeforeTermination || { days: 0, hours: 0 };\n\n const approvedDaysAfterTermination = bookedTimeQuery.data\n ?.bookedDaysAfterTermination || { days: 0, hours: 0 };\n\n const totalCurrentEntitlementHours = convertToTotalHours(\n currentEntitlementDays.days,\n currentEntitlementDays.hours,\n );\n const totalUsedHours = convertToTotalHours(usedDays.days, usedDays.hours);\n const totalBookedHours = convertToTotalHours(\n bookedDays.days,\n bookedDays.hours,\n );\n\n const remainingHours =\n totalCurrentEntitlementHours - totalUsedHours - totalBookedHours;\n\n const remainingDays = clampNegativeValuesIfApplicable(\n convertTotalHoursToDaysAndHours(remainingHours),\n );\n\n const formattedValues = formatTimeoffValues({\n entitledDays,\n bookedDays,\n usedDays,\n approvedDaysBeforeTermination,\n approvedDaysAfterTermination,\n remainingDays,\n currentEntitlementDays,\n }) as Omit<SummaryTimeOffDataResponse, 'isUnlimitedPto'>;\n\n return {\n data: {\n ...formattedValues,\n isUnlimitedPto:\n employment?.contract_details?.available_pto_type === 'unlimited',\n },\n isLoading: leavePoliciesSummaryQuery.isLoading || bookedTimeQuery.isLoading,\n isError: leavePoliciesSummaryQuery.isError || bookedTimeQuery.isError,\n error: leavePoliciesSummaryQuery.error || bookedTimeQuery.error,\n };\n};\n\nexport const useCreateTermination = () => {\n const { client } = useClient();\n return useMutation({\n mutationFn: (payload: CreateOffboardingParams) => {\n return postCreateOffboarding({\n client: client as Client,\n body: payload,\n });\n },\n });\n};\n\nexport const useTerminationSchema = ({\n formValues,\n jsfModify,\n step,\n}: {\n formValues?: TerminationFormValues;\n jsfModify?: JSFModify;\n step?: string;\n}) => {\n return useQuery({\n queryKey: ['rmt-flows-termination-schema', step],\n queryFn: () => {\n return schema[step as keyof typeof schema] ?? defaultSchema;\n },\n select: ({ data }) => {\n const jsfSchema = data?.schema || {};\n return createHeadlessForm(jsfSchema, formValues || {}, {\n jsfModify,\n });\n },\n });\n};\n"],"mappings":"2TAYO,IAAMA,EAAiBC,EAACC,GAAuB,CACpD,GAAM,CAACC,EAAMC,EAAOC,CAAG,EAAIH,EAAW,MAAM,GAAG,EAAE,IAAI,MAAM,EAC3D,OAAO,IAAI,KAAKC,EAAMC,EAAQ,EAAGC,CAAG,CACtC,EAH8B,kBCF9B,OAAS,YAAAC,MAAgB,wBAWlB,IAAMC,EAAkBC,EAAA,CAA8B,CAC3D,aAAAC,EACA,OAAAC,EACA,YAAAC,EACA,QAAAC,CACF,IAQM,CACJ,GAAM,CAAE,OAAAC,CAAO,EAAIC,EAAU,EAC7B,OAAOC,EAAS,CACd,SAAU,CAAC,UAAWN,EAAcC,CAAM,EAC1C,MAAO,GACP,QAASF,EAAA,IACAQ,EAAgB,CACrB,OAAQH,EACR,QAAS,CACP,cAAe,EACjB,EACA,MAAO,CACL,cAAeJ,EACf,OAAQC,EACR,aAAcC,CAChB,CACF,CAAC,EAXM,WAaT,OAAQH,EAAA,CAAC,CAAE,KAAAS,CAAK,IAAOL,GAAS,SAASK,CAAI,GAAKA,EAA1C,UACR,QAASL,GAAS,OACpB,CAAC,CACH,EAlC+B,mBAoCzBM,EAAkBV,EAAA,CAACW,EAAmBC,IAAoB,CAC9D,IAAMC,EAAQC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AW,KACXA,EAAW,KACb,EAEMS,EACJJ,EAA+BE,EAAiBC,EAE5CE,EAAgBC,EACpBnB,EAAgCiB,CAAc,CAChD,EAYA,MAAO,CACL,KAAM,CACJ,GAZoBzC,EAAoB,CAC1C,aAAA+B,EACA,WAAAC,EACA,SAAAE,EACA,8BAAAC,EACA,6BAAAC,EACA,cAAAM,EACA,uBAAAT,CACF,CAAC,EAKG,eACEzB,GAAY,kBAAkB,qBAAuB,WACzD,EACA,UAAWoB,EAA0B,WAAaE,EAAgB,UAClE,QAASF,EAA0B,SAAWE,EAAgB,QAC9D,MAAOF,EAA0B,OAASE,EAAgB,KAC5D,CACF,EAhG0C,8BAkG7Bc,GAAuBtC,EAAA,IAAM,CACxC,GAAM,CAAE,OAAAuC,CAAO,EAAIC,EAAU,EAC7B,OAAOC,EAAY,CACjB,WAAYzC,EAAC0C,GACJC,EAAsB,CAC3B,OAAQJ,EACR,KAAMG,CACR,CAAC,EAJS,aAMd,CAAC,CACH,EAVoC,wBAYvBE,GAAuB5C,EAAA,CAAC,CACnC,WAAA6C,EACA,UAAAC,EACA,KAAAC,CACF,IAKSC,EAAS,CACd,SAAU,CAAC,+BAAgCD,CAAI,EAC/C,QAAS/C,EAAA,IACAiD,EAAOF,CAA2B,GAAKG,EADvC,WAGT,OAAQlD,EAAA,CAAC,CAAE,KAAAiB,CAAK,IAAM,CACpB,IAAMkC,EAAYlC,GAAM,QAAU,CAAC,EACnC,OAAOmC,EAAmBD,EAAWN,GAAc,CAAC,EAAG,CACrD,UAAAC,CACF,CAAC,CACH,EALQ,SAMV,CAAC,EApBiC","names":["parseLocalDate","__name","dateString","year","month","day","useQuery","useTimeOffQuery","__name","employmentId","status","timeoffType","options","client","useClient","useQuery","getIndexTimeoff","data","formatDateRange","startDate","endDate","start","parseLocalDate","end","usePaidTimeoffBreakdownQuery","acc","timeoff","day","duration","useTimeOffLeavePoliciesSummaryQuery","getIndexLeavePoliciesSummary","useMutation","useQuery","formatTimeoffValues","values","acc","key","value","formatAsDecimal","__name","getMinimumStatutoryDays","employment","availablePto","ptoType","getAllTimeoffHoursBeforeDate","timeoffs","terminationDate","before","after","timeoff","day","useBookedTimeoffBeforeAndAfterTerminationQuery","employmentId","date","options","useTimeOffQuery","data","convertTotalHoursToDaysAndHours","useSummaryTimeOffDataQuery","proposedTerminationDate","minimumStatutoryDays","leavePoliciesSummaryQuery","useTimeOffLeavePoliciesSummaryQuery","bookedTimeQuery","entitledDays","bookedDays","currentEntitlementDays","usedDays","approvedDaysBeforeTermination","approvedDaysAfterTermination","totalCurrentEntitlementHours","convertToTotalHours","totalUsedHours","totalBookedHours","remainingHours","remainingDays","clampNegativeValuesIfApplicable","useCreateTermination","client","useClient","useMutation","payload","postCreateOffboarding","useTerminationSchema","formValues","jsfModify","step","useQuery","schema","defaultSchema","jsfSchema","createHeadlessForm"]}
@@ -1,2 +0,0 @@
1
- import{a as n,c as i,d as m,e as s,f}from"./chunk-FD2FTALC.js";import{a}from"./chunk-P37U34EQ.js";import{useState as O}from"react";var B=a(({proposedTerminationDate:e,employeeName:y,employmentId:o,employment:r,render:d})=>{let[t,u]=O(!1),l=m({employmentId:o}),p=n(e).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),c=i({employmentId:o,options:{enabled:t}}),D=s({employmentId:o,date:e}),P=f({employmentId:o,proposedTerminationDate:e,employment:r});return d({leavePoliciesSummaryQuery:l,timeoffQuery:c||{data:{bookedDays:0,timeoffs:[]}},bookedTimeBeforeAndAfterTerminationQuery:D,formattedProposedTerminationDate:p,employeeName:y,proposedTerminationDate:e,summaryData:P??{data:{entitledDays:"0 days",bookedDays:"0 days",usedDays:"0 days",approvedDaysBeforeTermination:"0 days",approvedDaysAfterTermination:"0 days",remainingDays:"0 days",isUnlimitedPto:!1},isLoading:!1,isError:!1,error:null},employment:r,open:t,onOpenChange:a(()=>{u(T=>!T)},"onOpenChange")})},"PaidTimeOffContainer");export{B as a};
2
- //# sourceMappingURL=chunk-L622FFV6.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/ContractorOnboarding/hooks.tsx","../src/common/api/legal-entities.ts","../src/common/api/identity.ts"],"sourcesContent":["import { useEffect, useMemo, useRef, useState } from 'react';\nimport { FieldValues } from 'react-hook-form';\nimport omit from 'lodash.omit';\nimport { $TSFixMe, JSFFields } from '@/src/types/remoteFlows';\nimport {\n CreateContractDocument,\n Employment,\n EmploymentCreateParams,\n} from '@/src/client/types.gen';\nimport {\n getInitialValues,\n parseJSFToValidate,\n} from '@/src/components/form/utils';\nimport { ValidationResult } from '@remoteoss/remote-json-schema-form-kit';\nimport {\n useContractorOnboardingDetailsSchema,\n useCreateContractorContractDocument,\n useGetContractDocumentSignatureSchema,\n usePostManageContractorSubscriptions,\n useContractorSubscriptionSchemaField,\n useGetShowContractDocument,\n useSignContractDocument,\n useUpdateUKandSaudiFields,\n useGetIR35File,\n useGetContractDocuments,\n useGetEligibilityQuestionnaire,\n usePostCreateEligibilityQuestionnaire,\n usePostManageContractorCorSubscription,\n useDeleteContractorCorSubscription,\n useCountriesSchemaField,\n useGetChooseAlternativePlan,\n} from '@/src/flows/ContractorOnboarding/api';\nimport { ContractorOnboardingFlowProps } from '@/src/flows/ContractorOnboarding/types';\nimport {\n buildSteps,\n calculateProvisionalStartDateDescription,\n reviewStepAllowedEmploymentStatus,\n disabledInviteButtonEmploymentStatus,\n StepKeys,\n} from '@/src/flows/ContractorOnboarding/utils';\nimport {\n useCreateEmployment,\n useJSONSchemaForm,\n useUpdateEmployment,\n} from '@/src/flows/Onboarding/api';\nimport { FlowOptions, JSFModify, JSONSchemaFormType } from '@/src/flows/types';\nimport { useStepState } from '@/src/flows/useStepState';\nimport { mutationToPromise } from '@/src/lib/mutations';\nimport { createStructuredError, prettifyFormValues } from '@/src/lib/utils';\nimport { JSFFieldset, Meta } from '@/src/types/remoteFlows';\nimport {\n contractorStandardProductIdentifier,\n contractorPlusProductIdentifier,\n corProductIdentifier,\n} from '@/src/flows/ContractorOnboarding/constants';\nimport {\n buildBasicInformationJsfModify,\n buildContractDetailsJsfModify,\n buildContractPreviewJsfModify,\n} from '@/src/flows/ContractorOnboarding/jsfModify';\nimport { useUploadFile } from '@/src/common/api/files';\nimport { dataURLtoFile } from '@/src/lib/files';\nimport { useEmploymentQuery } from '@/src/common/api/employment';\nimport { useDefaultLegalEntity } from '@/src/common/api/legal-entities';\n\ntype useContractorOnboardingProps = Omit<\n ContractorOnboardingFlowProps,\n 'render'\n>;\n\nconst stepToFormSchemaMap: Record<StepKeys, JSONSchemaFormType | null> = {\n select_country: null,\n basic_information: 'employment_basic_information',\n contract_details: null,\n eligibility_questionnaire: null,\n pricing_plan: null,\n choose_alternative_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 excludeProducts = options?.excludeProducts || [];\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 eligibility_questionnaire: Meta;\n choose_alternative_plan: Meta;\n }>({\n select_country: {},\n basic_information: {},\n contract_details: {},\n contract_preview: {},\n pricing_plan: {},\n eligibility_questionnaire: {},\n choose_alternative_plan: {},\n });\n\n const [selectedProduct, setSelectedProduct] = useState<string | undefined>(\n undefined,\n );\n\n const [includeEligibilityQuestionnaire, setIncludeEligibilityQuestionnaire] =\n useState<boolean>(false);\n\n const [includeChooseAlternativePlan, setIncludeChooseAlternativePlan] =\n useState<boolean>(false);\n\n const [pendingNavigationStep, setPendingNavigationStep] =\n useState<StepKeys | null>(null);\n\n const { steps, stepsArray } = useMemo(\n () =>\n buildSteps({\n includeSelectCountry: !skipSteps?.includes('select_country'),\n includeEligibilityQuestionnaire: includeEligibilityQuestionnaire,\n }),\n [includeEligibilityQuestionnaire, skipSteps],\n );\n\n const {\n fieldValues,\n stepState,\n setFieldValues,\n previousStep,\n nextStep,\n goToStep,\n setStepValues,\n } = useStepState(steps);\n\n useEffect(() => {\n if (pendingNavigationStep) {\n // Now steps have been updated\n goToStep(pendingNavigationStep);\n setPendingNavigationStep(null);\n }\n }, [pendingNavigationStep, goToStep]);\n\n const {\n data: employment,\n isLoading: isLoadingEmployment,\n refetch: refetchEmployment,\n } = useEmploymentQuery({\n employmentId: internalEmploymentId as string,\n queryParams: { exclude_files: true },\n });\n\n const defaultLegalEntity = useDefaultLegalEntity();\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();\n const updateEmploymentMutation = useUpdateEmployment(\n internalCountryCode as string,\n options,\n );\n const createContractorContractDocumentMutation =\n useCreateContractorContractDocument();\n const uploadFileMutation = useUploadFile();\n const { mutateAsync: updateUKandSaudiFieldsMutation } =\n useUpdateUKandSaudiFields(\n createContractorContractDocumentMutation,\n uploadFileMutation,\n fieldValues,\n );\n const createEligibilityQuestionnaireMutation =\n usePostCreateEligibilityQuestionnaire();\n const manageContractorCorSubscriptionMutation =\n usePostManageContractorCorSubscription();\n\n const { mutateAsyncOrThrow: updateEmploymentMutationAsync } =\n mutationToPromise(updateEmploymentMutation);\n const signContractDocumentMutation = useSignContractDocument();\n const manageContractorSubscriptionMutation =\n usePostManageContractorSubscriptions();\n const deleteContractorCorSubscriptionMutation =\n useDeleteContractorCorSubscription();\n\n const { mutateAsyncOrThrow: createEmploymentMutationAsync } =\n mutationToPromise(createEmploymentMutation);\n\n const { mutateAsyncOrThrow: createContractorContractDocumentMutationAsync } =\n mutationToPromise(createContractorContractDocumentMutation);\n\n const { mutateAsyncOrThrow: signContractDocumentMutationAsync } =\n mutationToPromise(signContractDocumentMutation);\n\n const { mutateAsyncOrThrow: manageContractorSubscriptionMutationAsync } =\n mutationToPromise(manageContractorSubscriptionMutation);\n\n const { mutateAsyncOrThrow: createEligibilityQuestionnaireMutationAsync } =\n mutationToPromise(createEligibilityQuestionnaireMutation);\n\n const { mutateAsyncOrThrow: manageContractorCorSubscriptionMutationAsync } =\n mutationToPromise(manageContractorCorSubscriptionMutation);\n\n const { mutateAsyncOrThrow: deleteContractorCorSubscriptionMutationAsync } =\n mutationToPromise(deleteContractorCorSubscriptionMutation);\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 {\n selectCountryForm,\n isLoading: isLoadingCountries,\n countries,\n } = useCountriesSchemaField({\n jsfModify: options?.jsfModify?.select_country,\n });\n\n const isPricingPlanEnabled =\n stepState.currentStep.name === 'pricing_plan' ||\n (Boolean(employmentId) && isEmploymentReadOnly);\n\n const {\n form: selectContractorSubscriptionForm,\n isLoading: isLoadingContractorSubscriptions,\n contractorSubscriptions,\n refetch: refetchContractorSubscriptions,\n isEligibilityQuestionnaireBlocked,\n } = useContractorSubscriptionSchemaField(internalEmploymentId as string, {\n jsonSchemaVersion: options?.jsonSchemaVersion,\n queryOptions: {\n enabled: isPricingPlanEnabled,\n },\n excludeProducts: excludeProducts,\n jsfModify: options?.jsfModify?.pricing_plan,\n });\n\n const hasEligibilityQuestionnaireSubmitted = useMemo(() => {\n return Boolean(\n contractorSubscriptions?.find(\n (subscription) => subscription.product.short_name === 'COR',\n )?.eligibility_questionnaire?.submitted_at,\n );\n }, [contractorSubscriptions]);\n\n useEffect(() => {\n if (hasEligibilityQuestionnaireSubmitted) {\n setIncludeEligibilityQuestionnaire(false);\n return;\n } else if (selectedProduct === corProductIdentifier) {\n setIncludeEligibilityQuestionnaire(true);\n } else {\n setIncludeEligibilityQuestionnaire(false);\n }\n }, [hasEligibilityQuestionnaireSubmitted, selectedProduct]);\n\n const eligibilityAnswers = useMemo(() => {\n return contractorSubscriptions?.find(\n (subscription) => subscription.product.short_name === 'COR',\n )?.eligibility_questionnaire?.responses;\n }, [contractorSubscriptions]);\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 isIR35FileEnabled = Boolean(\n internalCountryCode === 'GBR' &&\n employmentId &&\n stepState.currentStep.name === 'basic_information',\n );\n\n const { data: ir35File, isLoading: isLoadingIR35File } = useGetIR35File(\n employmentId as string,\n {\n enabled: isIR35FileEnabled,\n },\n );\n\n const { data: contractDocuments, isLoading: isLoadingContractDocuments } =\n useGetContractDocuments(employmentId as string, {\n enabled: Boolean(employmentId),\n });\n\n useEffect(() => {\n if (\n contractDocuments &&\n contractDocuments.length > 0 &&\n !internalContractDocumentId\n ) {\n setInternalContractDocumentId(contractDocuments[0].id);\n }\n }, [contractDocuments, internalContractDocumentId]);\n\n const countryName = useMemo(() => {\n return countries?.find((country) => country.value === internalCountryCode)\n ?.label;\n }, [countries, internalCountryCode]);\n\n const {\n data: basicInformationForm,\n isLoading: isLoadingBasicInformationForm,\n } = useJSONSchema({\n form: 'contractor_basic_information',\n options: {\n jsfModify: buildBasicInformationJsfModify(\n internalCountryCode as string,\n countryName,\n options,\n ),\n queryOptions: {\n enabled: isBasicInformationDetailsEnabled,\n },\n },\n });\n\n const descriptionProvisionalStartDate = useMemo(() => {\n return calculateProvisionalStartDateDescription(\n employment?.basic_information?.provisional_start_date as string,\n fieldValues?.service_duration?.provisional_start_date as string,\n );\n }, [\n employment?.basic_information?.provisional_start_date,\n fieldValues?.service_duration?.provisional_start_date,\n ]);\n\n /**\n * When the user selects COR, the data isn't saved yet in the BE\n * We need to use the internalState to know what has happened\n */\n const selectedPricingPlan = useMemo(() => {\n const subscriptions = {\n standard: contractorStandardProductIdentifier,\n plus: contractorPlusProductIdentifier,\n cor: corProductIdentifier,\n };\n\n // HIGHEST PRIORITY: Current form value (user is actively selecting)\n if (fieldValues.subscription) {\n return fieldValues.subscription;\n }\n\n // SECOND: Previously submitted value in this session\n const subscription = stepState.values?.pricing_plan?.subscription;\n if (subscription && !isEligibilityQuestionnaireBlocked) {\n return subscription;\n }\n\n // THIRD: Backend state (eligibility submitted or employment contractor_type)\n if (\n hasEligibilityQuestionnaireSubmitted &&\n !isEligibilityQuestionnaireBlocked\n ) {\n return corProductIdentifier;\n }\n\n // Fourth: If the eligibility questionnaire is blocked and has been submitted, return the standard product\n if (\n isEligibilityQuestionnaireBlocked &&\n hasEligibilityQuestionnaireSubmitted\n ) {\n return contractorStandardProductIdentifier;\n }\n\n // FALLBACK: Employment contractor_type or default\n return (\n subscriptions[\n employment?.contractor_type as keyof typeof subscriptions\n ] || contractorStandardProductIdentifier\n );\n }, [\n fieldValues,\n stepState.values,\n hasEligibilityQuestionnaireSubmitted,\n employment?.contractor_type,\n isEligibilityQuestionnaireBlocked,\n ]);\n\n useEffect(() => {\n if (selectedPricingPlan && selectedPricingPlan !== selectedProduct) {\n setSelectedProduct(selectedPricingPlan);\n }\n }, [selectedPricingPlan, selectedProduct]);\n\n const eligibilityFields = useMemo(() => {\n return {\n ...eligibilityAnswers,\n ...onboardingInitialValues,\n ...stepState.values?.eligibility_questionnaire,\n ...fieldValues,\n };\n }, [\n eligibilityAnswers,\n onboardingInitialValues,\n stepState.values?.eligibility_questionnaire,\n fieldValues,\n ]);\n\n const isEligibilityQuestionnaireEnabled = useMemo(() => {\n return (\n (selectedPricingPlan === corProductIdentifier &&\n stepState.currentStep.name === 'eligibility_questionnaire') ||\n (Boolean(employmentId) &&\n isEmploymentReadOnly &&\n selectedPricingPlan === corProductIdentifier)\n );\n }, [\n selectedPricingPlan,\n stepState.currentStep.name,\n employmentId,\n isEmploymentReadOnly,\n ]);\n\n const {\n data: eligibilityQuestionnaireForm,\n isLoading: isLoadingEligibilityQuestionnaire,\n } = useGetEligibilityQuestionnaire({\n options: {\n queryOptions: {\n enabled: isEligibilityQuestionnaireEnabled,\n },\n jsfModify: options?.jsfModify?.eligibility_questionnaire,\n },\n fieldValues: eligibilityFields,\n });\n\n const {\n form: chooseAlternativePlanForm,\n isLoading: isLoadingChooseAlternativePlan,\n } = useGetChooseAlternativePlan(internalEmploymentId as string, {\n jsfModify: options?.jsfModify?.choose_alternative_plan,\n queryOptions: {\n enabled: includeChooseAlternativePlan,\n },\n excludeProducts: excludeProducts,\n });\n\n const {\n data: contractorOnboardingDetailsForm,\n isLoading: isLoadingContractorOnboardingDetailsForm,\n } = useContractorOnboardingDetailsSchema({\n countryCode: internalCountryCode as string,\n fieldValues: fieldValues,\n employmentId: internalEmploymentId as string,\n options: {\n queryOptions: {\n enabled: isContractorOnboardingDetailsEnabled,\n },\n jsfModify: buildContractDetailsJsfModify(\n options?.jsfModify?.contract_details,\n descriptionProvisionalStartDate,\n selectedPricingPlan,\n fieldValues,\n ),\n },\n });\n\n const isSignatureSchemaEnabled = useMemo(() => {\n return (\n stepState.currentStep.name === 'contract_preview' ||\n (Boolean(employmentId) && isEmploymentReadOnly)\n );\n }, [stepState.currentStep.name, employmentId, isEmploymentReadOnly]);\n\n const { data: signatureSchemaForm } = useGetContractDocumentSignatureSchema({\n fieldValues: fieldValues,\n options: {\n queryOptions: {\n enabled: isSignatureSchemaEnabled,\n },\n jsfModify: buildContractPreviewJsfModify(options, fieldValues),\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<StepKeys, JSFFields> = useMemo(\n () => ({\n select_country: selectCountryForm?.fields || [],\n basic_information: basicInformationForm?.fields || [],\n pricing_plan: selectContractorSubscriptionForm?.fields || [],\n eligibility_questionnaire: eligibilityQuestionnaireForm?.fields || [],\n choose_alternative_plan: chooseAlternativePlanForm?.fields || [],\n contract_details: contractorOnboardingDetailsForm?.fields || [],\n contract_preview: signatureSchemaForm?.fields || [],\n review: [],\n }),\n [\n selectCountryForm?.fields,\n basicInformationForm?.fields,\n selectContractorSubscriptionForm?.fields,\n contractorOnboardingDetailsForm?.fields,\n signatureSchemaForm?.fields,\n eligibilityQuestionnaireForm?.fields,\n chooseAlternativePlanForm?.fields,\n ],\n );\n\n const stepFieldsWithFlatFieldsets: Record<\n StepKeys,\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 eligibility_questionnaire: null,\n choose_alternative_plan: null,\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 // memoize file conversion to avoid re-converting the file on every render\n // noticed performance issues when not doing memoizing individually\n const convertedIr35File = useMemo(() => {\n if (!ir35File?.content) return null;\n return dataURLtoFile(ir35File.content as unknown as string, ir35File.name);\n }, [ir35File?.content, ir35File?.name]);\n\n const basicInformationInitialValues = useMemo(() => {\n const initialValues = {\n ...onboardingInitialValues,\n ...employmentBasicInformation,\n ir35: employment?.contract_details?.ir_35,\n nationality_status: employment?.contract_details?.nationality,\n ...(convertedIr35File && {\n ir35_sds_file: [convertedIr35File],\n }),\n };\n\n return getInitialValues(stepFields.basic_information, initialValues);\n }, [\n onboardingInitialValues,\n employmentBasicInformation,\n employment?.contract_details?.ir_35,\n employment?.contract_details?.nationality,\n convertedIr35File,\n stepFields.basic_information,\n ]);\n\n const contractDetailsInitialValues = useMemo(() => {\n const hardcodedValues = {\n service_duration: {\n provisional_start_date:\n employmentBasicInformation.provisional_start_date,\n },\n };\n const initialValues = {\n ...hardcodedValues,\n ...onboardingInitialValues,\n ...employmentContractDetails,\n };\n\n return getInitialValues(stepFields.contract_details, initialValues);\n }, [\n stepFields.contract_details,\n employmentContractDetails,\n onboardingInitialValues,\n employmentBasicInformation,\n ]);\n\n const contractPreviewInitialValues = useMemo(() => {\n const signature = documentPreviewPdf?.contract_document?.signatories?.find(\n (signatory) => signatory.type === 'company',\n );\n const initialValues = {\n ...onboardingInitialValues,\n signature: signature?.signature,\n };\n\n return getInitialValues(stepFields.contract_preview, initialValues);\n }, [\n stepFields.contract_preview,\n onboardingInitialValues,\n documentPreviewPdf,\n ]);\n\n const pricingPlanInitialValues = useMemo(() => {\n const preselectedPricingPlan = {\n subscription: selectedPricingPlan,\n };\n const initialValues = {\n ...preselectedPricingPlan,\n ...onboardingInitialValues,\n };\n\n return getInitialValues(stepFields.pricing_plan, initialValues);\n }, [stepFields.pricing_plan, onboardingInitialValues, selectedPricingPlan]);\n\n const eligibilityQuestionnaireInitialValues = useMemo(() => {\n const initialValues = {\n ...onboardingInitialValues,\n ...eligibilityAnswers,\n };\n return getInitialValues(\n stepFields.eligibility_questionnaire,\n initialValues,\n );\n }, [\n stepFields.eligibility_questionnaire,\n onboardingInitialValues,\n eligibilityAnswers,\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: pricingPlanInitialValues,\n eligibility_questionnaire: eligibilityQuestionnaireInitialValues,\n };\n }, [\n selectCountryInitialValues,\n basicInformationInitialValues,\n contractDetailsInitialValues,\n contractPreviewInitialValues,\n pricingPlanInitialValues,\n eligibilityQuestionnaireInitialValues,\n ]);\n\n const shouldHandleReadOnlyEmployment = Boolean(\n employmentId &&\n isEmploymentReadOnly &&\n stepState.currentStep.name !== 'review',\n );\n\n const initialLoading =\n isLoadingCountries ||\n isLoadingBasicInformationForm ||\n isLoadingEmployment ||\n isLoadingContractorOnboardingDetailsForm ||\n isLoadingContractorSubscriptions ||\n isLoadingDocumentPreviewForm ||\n isLoadingIR35File ||\n isLoadingContractDocuments ||\n isLoadingEligibilityQuestionnaire ||\n isLoadingChooseAlternativePlan;\n\n const isNavigatingToReview = useMemo(() => {\n return Boolean(\n shouldHandleReadOnlyEmployment &&\n !initialLoading &&\n Boolean(internalContractDocumentId) &&\n stepFields.basic_information.length > 0 &&\n stepFields.contract_details.length > 0 &&\n stepFields.contract_preview.length > 0,\n );\n }, [\n shouldHandleReadOnlyEmployment,\n initialLoading,\n internalContractDocumentId,\n stepFields.basic_information.length,\n stepFields.contract_details.length,\n stepFields.contract_preview.length,\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 contract_preview: prettifyFormValues(\n contractPreviewInitialValues,\n stepFields.contract_preview,\n ),\n pricing_plan: prettifyFormValues(\n pricingPlanInitialValues,\n stepFields.pricing_plan,\n ),\n eligibility_questionnaire: prettifyFormValues(\n eligibilityQuestionnaireInitialValues,\n stepFields.eligibility_questionnaire,\n ),\n // we don't need to tell the user about this values\n choose_alternative_plan: {},\n };\n\n setStepValues({\n select_country: selectCountryInitialValues,\n basic_information: basicInformationInitialValues,\n contract_details: contractDetailsInitialValues,\n contract_preview: contractPreviewInitialValues,\n pricing_plan: pricingPlanInitialValues,\n eligibility_questionnaire: eligibilityQuestionnaireInitialValues,\n choose_alternative_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 stepFields.pricing_plan,\n pricingPlanInitialValues,\n stepFields.contract_preview,\n contractPreviewInitialValues,\n stepFields.eligibility_questionnaire,\n eligibilityQuestionnaireInitialValues,\n ]);\n\n const goTo = (step: StepKeys) => {\n goToStep(step);\n };\n\n const parseFormValues = async (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 await parseJSFToValidate(values, basicInformationForm?.fields, {\n isPartialValidation: false,\n });\n }\n\n if (\n contractorOnboardingDetailsForm &&\n stepState.currentStep.name === 'contract_details'\n ) {\n return await 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 await parseJSFToValidate(values, signatureSchemaForm?.fields, {\n isPartialValidation: false,\n });\n }\n\n if (\n selectContractorSubscriptionForm &&\n stepState.currentStep.name === 'pricing_plan'\n ) {\n return await parseJSFToValidate(\n values,\n selectContractorSubscriptionForm?.fields,\n {\n isPartialValidation: false,\n },\n );\n }\n\n if (\n eligibilityQuestionnaireForm &&\n stepState.currentStep.name === 'eligibility_questionnaire'\n ) {\n return await parseJSFToValidate(\n values,\n eligibilityQuestionnaireForm?.fields,\n {\n isPartialValidation: false,\n },\n );\n }\n\n if (\n chooseAlternativePlanForm &&\n stepState.currentStep.name === 'choose_alternative_plan'\n ) {\n return await parseJSFToValidate(\n values,\n chooseAlternativePlanForm?.fields,\n {\n isPartialValidation: false,\n },\n );\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 = await 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 basicInformationParsedValues = omit(\n parsedValues,\n 'nationality_status',\n 'ir35',\n 'ir35_sds_file',\n );\n const basicInformationPayload: EmploymentCreateParams = {\n basic_information: basicInformationParsedValues,\n type: 'contractor',\n country_code: internalCountryCode,\n external_id: externalId,\n };\n const response = await createEmploymentMutationAsync(\n basicInformationPayload,\n );\n const employmentId = response?.data?.employment?.id;\n if (!employmentId) {\n throw createStructuredError('Employment ID not found');\n }\n\n setInternalEmploymentId(employmentId);\n await updateUKandSaudiFieldsMutation({\n employmentId: employmentId as string,\n });\n\n return response;\n } else if (internalEmploymentId) {\n const basicInformationParsedValues = omit(\n parsedValues,\n 'nationality_status',\n 'ir35',\n 'ir35_sds_file',\n );\n\n await updateUKandSaudiFieldsMutation({\n employmentId: internalEmploymentId,\n });\n return updateEmploymentMutationAsync({\n employmentId: internalEmploymentId,\n basic_information: basicInformationParsedValues,\n });\n }\n\n return;\n }\n case 'contract_details': {\n const payload: CreateContractDocument = {\n contract_document: parsedValues,\n };\n const response = await createContractorContractDocumentMutationAsync({\n employmentId: internalEmploymentId as string,\n payload,\n });\n const contractDocumentId = response?.data?.contract_document?.id;\n if (!contractDocumentId) {\n throw createStructuredError('Contract document ID not found');\n }\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: parsedValues.signature,\n },\n });\n }\n case 'pricing_plan': {\n if (\n hasEligibilityQuestionnaireSubmitted &&\n values.subscription !== corProductIdentifier\n ) {\n try {\n await deleteContractorCorSubscriptionMutationAsync({\n employmentId: internalEmploymentId as string,\n });\n await refetchContractorSubscriptions();\n } catch (error) {\n if ((error as $TSFixMe)?.response?.status !== 404) {\n throw error;\n }\n // Still refetch to update the UI state\n await refetchContractorSubscriptions();\n }\n }\n\n if (values.subscription == contractorStandardProductIdentifier) {\n return manageContractorSubscriptionMutationAsync({\n employmentId: internalEmploymentId as string,\n payload: {\n operation: 'downgrade',\n },\n });\n } else if (values.subscription == contractorPlusProductIdentifier) {\n return manageContractorSubscriptionMutationAsync({\n employmentId: internalEmploymentId as string,\n payload: {\n operation: 'upgrade',\n },\n });\n } else if (values.subscription == corProductIdentifier) {\n return Promise.resolve({\n data: { subscription: values.subscription },\n });\n }\n\n throw createStructuredError('invalid selection');\n }\n\n case 'eligibility_questionnaire': {\n try {\n const response = await createEligibilityQuestionnaireMutationAsync({\n employmentId: internalEmploymentId as string,\n payload: parsedValues,\n });\n\n const isEligibilityQuestionnaireBlocked = response?.data?.is_blocking;\n\n if (isEligibilityQuestionnaireBlocked) {\n setIncludeChooseAlternativePlan(true);\n setPendingNavigationStep('choose_alternative_plan');\n return { ...response, _skipNextStep: true };\n }\n\n return await manageContractorCorSubscriptionMutationAsync({\n employmentId: internalEmploymentId as string,\n });\n } finally {\n // Always refetch to keep state in sync, even on error\n await refetchContractorSubscriptions();\n }\n }\n\n case 'choose_alternative_plan': {\n const subscription = parsedValues.subscription;\n\n if (subscription === contractorStandardProductIdentifier) {\n await manageContractorSubscriptionMutationAsync({\n employmentId: internalEmploymentId as string,\n payload: {\n operation: 'downgrade',\n },\n });\n }\n\n setIncludeChooseAlternativePlan(false);\n\n return Promise.resolve({\n data: { subscription },\n });\n }\n\n default: {\n throw createStructuredError('Invalid step state');\n }\n }\n }\n\n const isLoading = initialLoading || shouldHandleReadOnlyEmployment;\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: async (\n values: FieldValues,\n ): Promise<ValidationResult | null> => {\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 = await 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 = await 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 = await parseJSFToValidate(\n values,\n signatureSchemaForm?.fields,\n { isPartialValidation: true },\n );\n return signatureSchemaForm?.handleValidation(parsedValues);\n }\n\n if (\n selectContractorSubscriptionForm &&\n stepState.currentStep.name === 'pricing_plan'\n ) {\n const parsedValues = await parseJSFToValidate(\n values,\n selectContractorSubscriptionForm?.fields,\n { isPartialValidation: false },\n );\n return selectContractorSubscriptionForm?.handleValidation(parsedValues);\n }\n\n if (\n eligibilityQuestionnaireForm &&\n stepState.currentStep.name === 'eligibility_questionnaire'\n ) {\n const parsedValues = await parseJSFToValidate(\n values,\n eligibilityQuestionnaireForm?.fields,\n { isPartialValidation: false },\n );\n return eligibilityQuestionnaireForm?.handleValidation(parsedValues);\n }\n\n if (\n chooseAlternativePlanForm &&\n stepState.currentStep.name === 'choose_alternative_plan'\n ) {\n const parsedValues = await parseJSFToValidate(\n values,\n chooseAlternativePlanForm?.fields,\n );\n return chooseAlternativePlanForm?.handleValidation(parsedValues);\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 updateEmploymentMutation.isPending ||\n createContractorContractDocumentMutation.isPending ||\n signContractDocumentMutation.isPending ||\n manageContractorSubscriptionMutation.isPending ||\n uploadFileMutation.isPending ||\n createEligibilityQuestionnaireMutation.isPending ||\n manageContractorCorSubscriptionMutation.isPending ||\n deleteContractorCorSubscriptionMutation.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 * Default legal entity\n * @returns {CompanyLegalEntity}\n */\n defaultLegalEntity,\n /**\n * Steps array\n * @returns {Array<{name: string, index: number, label: string}>}\n */\n steps: stepsArray,\n };\n};\n","import { useQuery } from '@tanstack/react-query';\nimport {\n getIndexCompanyLegalEntities,\n IdentityCurrentResponse,\n} from '@/src/client';\nimport { Client } from '@/src/client/client';\nimport { useClient } from '@/src/context';\nimport { useIdentity } from '@/src/common/api/identity';\n\nfunction hasCompany(\n identity: IdentityCurrentResponse['data'] | undefined,\n): identity is Extract<\n IdentityCurrentResponse['data'],\n { company: { id: string } }\n> {\n return identity != null && 'company' in identity;\n}\n\n/**\n * Hook to get the legal entities for a company\n * @param companyId - The company ID\n * @returns The legal entities\n */\nexport const useLegalEntities = () => {\n const { client } = useClient();\n const { data: identity } = useIdentity();\n const companyId = hasCompany(identity) ? (identity?.company?.id ?? '') : '';\n\n return useQuery({\n queryKey: ['legal-entities', companyId],\n queryFn: () =>\n getIndexCompanyLegalEntities({\n client: client as Client,\n path: {\n company_id: companyId,\n },\n }),\n select: (data) => data.data?.data?.legal_entities,\n enabled: !!companyId,\n });\n};\n\nexport const useDefaultLegalEntity = () => {\n const { data: legalEntities } = useLegalEntities();\n return legalEntities?.find((legalEntity) => legalEntity.is_default);\n};\n","import { useQuery } from '@tanstack/react-query';\nimport { getCurrentIdentity } from '@/src/client';\nimport { useClient } from '@/src/context';\nimport { Client } from '@/src/client/client';\n\nexport const useIdentity = () => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['identity'],\n queryFn: () =>\n getCurrentIdentity({\n client: client as Client,\n headers: { Authorization: `` },\n }),\n select: (data) => data.data?.data,\n });\n};\n"],"mappings":"qvBAAA,OAAS,aAAAA,EAAW,WAAAC,EAAS,UAAAC,GAAQ,YAAAC,MAAgB,QAErD,OAAOC,OAAU,cCFjB,OAAS,YAAAC,OAAgB,wBCAzB,OAAS,YAAAC,OAAgB,wBAKlB,IAAMC,GAAcC,EAAA,IAAM,CAC/B,GAAM,CAAE,OAAAC,CAAO,EAAIC,GAAU,EAC7B,OAAOC,GAAS,CACd,SAAU,CAAC,UAAU,EACrB,QAASH,EAAA,IACPI,GAAmB,CACjB,OAAQH,EACR,QAAS,CAAE,cAAe,EAAG,CAC/B,CAAC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AqB,EAAK,CAC9B,EACA,OAAOA,GAAqB,iBAAiBkC,CAAY,CAC3D,CAEA,GACEtF,GACAtD,EAAU,YAAY,OAAS,eAC/B,CACA,IAAM4I,EAAe,MAAMH,EACzBD,EACAlF,GAAkC,OAClC,CAAE,oBAAqB,EAAM,CAC/B,EACA,OAAOA,GAAkC,iBAAiBsF,CAAY,CACxE,CAEA,GACE7C,GACA/F,EAAU,YAAY,OAAS,4BAC/B,CACA,IAAM4I,EAAe,MAAMH,EACzBD,EACAzC,GAA8B,OAC9B,CAAE,oBAAqB,EAAM,CAC/B,EACA,OAAOA,GAA8B,iBAAiB6C,CAAY,CACpE,CAEA,GACE1C,GACAlG,EAAU,YAAY,OAAS,0BAC/B,CACA,IAAM4I,EAAe,MAAMH,EACzBD,EACAtC,GAA2B,MAC7B,EACA,OAAOA,GAA2B,iBAAiB0C,CAAY,CACjE,CAEA,OAAO,IACT,EA/EkB,oBAoFlB,cAAAlB,GAKA,aAAc7I,EAMd,kBAAmB6B,GAKnB,aACEU,GAAyB,WACzBE,GAAyB,WACzBE,GAAyC,WACzCY,GAA6B,WAC7BE,GAAqC,WACrCZ,GAAmB,WACnBI,GAAuC,WACvCE,GAAwC,WACxCQ,GAAwC,UAK1C,mBAAAqE,GAMA,UAAA5F,GAMA,qBAAAF,EAKA,cAAAI,GAMA,WAAAX,EAMA,mBAAAI,GAKA,MAAOhB,EACT,CACF,EAztCuC","names":["useEffect","useMemo","useRef","useState","omit","useQuery","useQuery","useIdentity","__name","client","useClient","useQuery","getCurrentIdentity","data","hasCompany","identity","__name","useLegalEntities","client","useClient","useIdentity","companyId","useQuery","getIndexCompanyLegalEntities","data","useDefaultLegalEntity","legalEntities","legalEntity","stepToFormSchemaMap","jsonSchemaToEmployment","useContractorOnboarding","__name","countryCode","externalId","employmentId","skipSteps","options","onboardingInitialValues","excludeProducts","internalCountryCode","setInternalCountryCode","useState","internalEmploymentId","setInternalEmploymentId","internalContractDocumentId","setInternalContractDocumentId","fieldsMetaRef","useRef","selectedProduct","setSelectedProduct","includeEligibilityQuestionnaire","setIncludeEligibilityQuestionnaire","includeChooseAlternativePlan","setIncludeChooseAlternativePlan","pendingNavigationStep","setPendingNavigationStep","steps","stepsArray","useMemo","buildSteps","fieldValues","stepState","setFieldValues","previousStep","nextStep","goToStep","setStepValues","useStepState","useEffect","employment","isLoadingEmployment","refetchEmployment","useEmploymentQuery","defaultLegalEntity","useDefaultLegalEntity","employmentStatus","isEmploymentReadOnly","reviewStepAllowedEmploymentStatus","canInvite","disabledInviteButtonEmploymentStatus","invitedStatus","createEmploymentMutation","useCreateEmployment","updateEmploymentMutation","useUpdateEmployment","createContractorContractDocumentMutation","useCreateContractorContractDocument","uploadFileMutation","useUploadFile","updateUKandSaudiFieldsMutation","useUpdateUKandSaudiFields","createEligibilityQuestionnaireMutation","usePostCreateEligibilityQuestionnaire","manageContractorCorSubscriptionMutation","usePostManageContractorCorSubscription","updateEmploymentMutationAsync","mutationToPromise","signContractDocumentMutation","useSignContractDocument","manageContractorSubscriptionMutation","usePostManageContractorSubscriptions","deleteContractorCorSubscriptionMutation","useDeleteContractorCorSubscription","createEmploymentMutationAsync","createContractorContractDocumentMutationAsync","signContractDocumentMutationAsync","manageContractorSubscriptionMutationAsync","createEligibilityQuestionnaireMutationAsync","manageContractorCorSubscriptionMutationAsync","deleteContractorCorSubscriptionMutationAsync","selectCountryForm","isLoadingCountries","countries","useCountriesSchemaField","isPricingPlanEnabled","selectContractorSubscriptionForm","isLoadingContractorSubscriptions","contractorSubscriptions","refetchContractorSubscriptions","isEligibilityQuestionnaireBlocked","useContractorSubscriptionSchemaField","hasEligibilityQuestionnaireSubmitted","subscription","corProductIdentifier","eligibilityAnswers","formType","employmentKey","serverEmploymentData","useJSONSchema","form","jsonSchemaOptions","query","mergedFormValues","useJSONSchemaForm","isBasicInformationDetailsEnabled","isContractorOnboardingDetailsEnabled","isIR35FileEnabled","ir35File","isLoadingIR35File","useGetIR35File","contractDocuments","isLoadingContractDocuments","useGetContractDocuments","countryName","country","basicInformationForm","isLoadingBasicInformationForm","buildBasicInformationJsfModify","descriptionProvisionalStartDate","calculateProvisionalStartDateDescription","selectedPricingPlan","subscriptions","contractorStandardProductIdentifier","contractorPlusProductIdentifier","eligibilityFields","isEligibilityQuestionnaireEnabled","eligibilityQuestionnaireForm","isLoadingEligibilityQuestionnaire","useGetEligibilityQuestionnaire","chooseAlternativePlanForm","isLoadingChooseAlternativePlan","useGetChooseAlternativePlan","contractorOnboardingDetailsForm","isLoadingContractorOnboardingDetailsForm","useContractorOnboardingDetailsSchema","buildContractDetailsJsfModify","isSignatureSchemaEnabled","signatureSchemaForm","useGetContractDocumentSignatureSchema","buildContractPreviewJsfModify","documentPreviewPdf","isLoadingDocumentPreviewForm","useGetShowContractDocument","stepFields","stepFieldsWithFlatFieldsets","employmentBasicInformation","employmentContractDetails","employmentCountryCode","selectCountryInitialValues","getInitialValues","convertedIr35File","dataURLtoFile","basicInformationInitialValues","initialValues","contractDetailsInitialValues","contractPreviewInitialValues","signature","signatory","pricingPlanInitialValues","eligibilityQuestionnaireInitialValues","shouldHandleReadOnlyEmployment","initialLoading","isNavigatingToReview","prettifyFormValues","goTo","step","parseFormValues","values","parseJSFToValidate","onSubmit","currentStepName","parsedValues","isEmploymentNotLoaded","hasChangedCountry","basicInformationPayload","omit","response","createStructuredError","basicInformationParsedValues","contractDocumentId","error"]}