@remoteoss/remote-flows 0.25.0 → 0.27.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 (264) hide show
  1. package/dist/{ZendeskTriggerButton-FSCvhzTG.d.ts → ZendeskTriggerButton-DIV8pCPo.d.ts} +2 -1
  2. package/dist/{chunk-I3PGODII.js → chunk-4ZGIL6OE.js} +2 -2
  3. package/dist/{chunk-22JG4IMF.js → chunk-5NPET4ZO.js} +2 -2
  4. package/dist/chunk-6IL4TB7S.js +2 -0
  5. package/dist/chunk-6IL4TB7S.js.map +1 -0
  6. package/dist/chunk-746ELT2W.js +2 -0
  7. package/dist/chunk-746ELT2W.js.map +1 -0
  8. package/dist/chunk-7VOQAVM4.js +2 -0
  9. package/dist/chunk-7VOQAVM4.js.map +1 -0
  10. package/dist/{chunk-VVF4IZES.js → chunk-7Y46DL2U.js} +2 -2
  11. package/dist/{chunk-NWEXPORY.js → chunk-A2SWQS2N.js} +2 -2
  12. package/dist/chunk-ANQ4HVVK.js +2 -0
  13. package/dist/chunk-ANQ4HVVK.js.map +1 -0
  14. package/dist/{chunk-I52UTPHD.js → chunk-AYLYOLVG.js} +2 -2
  15. package/dist/{chunk-YU3JIZ7J.js → chunk-BO6OKTIG.js} +2 -2
  16. package/dist/{chunk-PHBQMNG3.js → chunk-CVIWZYO3.js} +2 -2
  17. package/dist/chunk-CYPGWEOO.js +2 -0
  18. package/dist/chunk-CYPGWEOO.js.map +1 -0
  19. package/dist/{chunk-2M7EBC4K.js → chunk-DZ67OJVF.js} +2 -2
  20. package/dist/{chunk-VUP76ZMQ.js → chunk-E3JFQ7PH.js} +2 -2
  21. package/dist/{chunk-W5BJQRNM.js → chunk-E6OBNWMU.js} +2 -2
  22. package/dist/chunk-EHAZWZ3O.js +2 -0
  23. package/dist/chunk-EHAZWZ3O.js.map +1 -0
  24. package/dist/{chunk-M6G27EJN.js → chunk-FEHSJUZJ.js} +2 -2
  25. package/dist/{chunk-4JVXDB5G.js → chunk-GD5556B2.js} +2 -2
  26. package/dist/chunk-IWA5B4U6.js +2 -0
  27. package/dist/chunk-IWA5B4U6.js.map +1 -0
  28. package/dist/chunk-JTOLQCOG.js +2 -0
  29. package/dist/chunk-JTOLQCOG.js.map +1 -0
  30. package/dist/chunk-KDUM4EZJ.js +2 -0
  31. package/dist/chunk-KDUM4EZJ.js.map +1 -0
  32. package/dist/{chunk-Q3A4A2HL.js → chunk-KOIHMAAP.js} +2 -2
  33. package/dist/{chunk-EJ4COVQQ.js → chunk-L6FZRTSN.js} +2 -2
  34. package/dist/{chunk-4IXRU67S.js → chunk-LDJT7TII.js} +2 -2
  35. package/dist/chunk-LMYJ6V44.js +2 -0
  36. package/dist/chunk-LMYJ6V44.js.map +1 -0
  37. package/dist/{chunk-S2KE2JLJ.js → chunk-LRNSFLHR.js} +2 -2
  38. package/dist/{chunk-AU6AILO2.js → chunk-N3EIN72T.js} +2 -2
  39. package/dist/{chunk-CT2ROVBF.js → chunk-NRW33IP5.js} +2 -2
  40. package/dist/{chunk-QEWB24WT.js → chunk-OXCEJQFC.js} +2 -2
  41. package/dist/{chunk-OCNL6L4L.js → chunk-PFT7KJ65.js} +2 -2
  42. package/dist/{chunk-RNJWBKLA.js → chunk-QLNFHOLH.js} +2 -2
  43. package/dist/{chunk-RDGF4PBB.js → chunk-R3LY6TV5.js} +2 -2
  44. package/dist/chunk-R645TMO5.js +2 -0
  45. package/dist/{chunk-2TADRH4W.js.map → chunk-R645TMO5.js.map} +1 -1
  46. package/dist/{chunk-BGXVK7HL.js → chunk-R64X3EJF.js} +2 -2
  47. package/dist/{chunk-JHPCP2ZX.js → chunk-RAHCZTQ3.js} +2 -2
  48. package/dist/{chunk-BLZW25OE.js → chunk-SA74WAVS.js} +2 -2
  49. package/dist/{chunk-P4ZSYIA4.js → chunk-SB3IYODL.js} +2 -2
  50. package/dist/chunk-SGE4DLC3.js +2 -0
  51. package/dist/chunk-SGE4DLC3.js.map +1 -0
  52. package/dist/chunk-SLMJEZJ7.js +2 -0
  53. package/dist/chunk-SLMJEZJ7.js.map +1 -0
  54. package/dist/{chunk-7KNNJBO6.js → chunk-TUFTB5UD.js} +2 -2
  55. package/dist/chunk-UFBTCHEI.js +2 -0
  56. package/dist/{chunk-IUZ7DEXC.js.map → chunk-UFBTCHEI.js.map} +1 -1
  57. package/dist/{chunk-UUZ353RX.js → chunk-VLLLNIMN.js} +2 -2
  58. package/dist/chunk-VM2DQCZO.js +2 -0
  59. package/dist/chunk-VM2DQCZO.js.map +1 -0
  60. package/dist/chunk-W55MUSAS.js +2 -0
  61. package/dist/{chunk-NVYMAOQ7.js.map → chunk-W55MUSAS.js.map} +1 -1
  62. package/dist/chunk-WLBRCGTG.js +2 -0
  63. package/dist/{chunk-QKLIYOMA.js.map → chunk-WLBRCGTG.js.map} +1 -1
  64. package/dist/{chunk-HCZWP44I.js → chunk-WNTOQYRY.js} +2 -2
  65. package/dist/{chunk-T5LZSTW3.js → chunk-WZAWPSKS.js} +2 -2
  66. package/dist/{chunk-46JFDBPC.js → chunk-XP7UEI56.js} +2 -2
  67. package/dist/{chunk-LHSNAVGR.js → chunk-YXWBSRKS.js} +2 -2
  68. package/dist/{chunk-KH5SAWNH.js → chunk-ZIPHLBX4.js} +2 -2
  69. package/dist/flows/ContractAmendment/ContractAmendmentConfirmationForm.d.ts +1 -1
  70. package/dist/flows/ContractAmendment/ContractAmendmentFlow.d.ts +3 -3
  71. package/dist/flows/ContractAmendment/ContractAmendmentFlow.js +1 -1
  72. package/dist/flows/ContractAmendment/ContractAmendmentForm.d.ts +1 -1
  73. package/dist/flows/ContractAmendment/ContractAmendmentForm.js +1 -1
  74. package/dist/flows/ContractAmendment/context.d.ts +3 -3
  75. package/dist/flows/ContractAmendment/hooks.d.ts +3 -3
  76. package/dist/flows/ContractAmendment/hooks.js +1 -1
  77. package/dist/flows/ContractAmendment/index.d.ts +3 -3
  78. package/dist/flows/ContractAmendment/index.js +1 -1
  79. package/dist/flows/ContractAmendment/utils.d.ts +2 -2
  80. package/dist/flows/ContractAmendment/utils.js +1 -1
  81. package/dist/flows/ContractorOnboarding/ContractorOnboarding.d.ts +5 -5
  82. package/dist/flows/ContractorOnboarding/ContractorOnboarding.js +1 -1
  83. package/dist/flows/ContractorOnboarding/api.d.ts +2 -2
  84. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.d.ts +4 -4
  85. package/dist/flows/ContractorOnboarding/components/BasicInformationStep.js +1 -1
  86. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.d.ts +5 -5
  87. package/dist/flows/ContractorOnboarding/components/ContractDetailsStep.js +1 -1
  88. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.d.ts +5 -5
  89. package/dist/flows/ContractorOnboarding/components/ContractPreviewStep.js +1 -1
  90. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.d.ts +5 -5
  91. package/dist/flows/ContractorOnboarding/components/ContractorOnboardingForm.js +1 -1
  92. package/dist/flows/ContractorOnboarding/components/OnboardingInvite.d.ts +3 -3
  93. package/dist/flows/ContractorOnboarding/components/PricingPlan.d.ts +5 -5
  94. package/dist/flows/ContractorOnboarding/components/PricingPlan.js +1 -1
  95. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.d.ts +4 -4
  96. package/dist/flows/ContractorOnboarding/components/SelectCountryStep.js +1 -1
  97. package/dist/flows/ContractorOnboarding/context.d.ts +5 -5
  98. package/dist/flows/ContractorOnboarding/hooks.d.ts +5 -5
  99. package/dist/flows/ContractorOnboarding/index.d.ts +5 -5
  100. package/dist/flows/ContractorOnboarding/index.js +1 -1
  101. package/dist/flows/ContractorOnboarding/types.d.ts +5 -5
  102. package/dist/flows/CostCalculator/CostCalculatorFlow.d.ts +3 -3
  103. package/dist/flows/CostCalculator/CostCalculatorFlow.js +1 -1
  104. package/dist/flows/CostCalculator/CostCalculatorForm.d.ts +3 -3
  105. package/dist/flows/CostCalculator/CostCalculatorForm.js +1 -1
  106. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.d.ts +1 -1
  107. package/dist/flows/CostCalculator/EstimationResults/EstimationResults.js +1 -1
  108. package/dist/flows/CostCalculator/Results/CostCalculatorBenefitsBreakdown.js +1 -1
  109. package/dist/flows/CostCalculator/Results/CostCalculatorContributionsBreakdown.js +1 -1
  110. package/dist/flows/CostCalculator/Results/CostCalculatorExtraStatutoryPaymentsBreakdown.js +1 -1
  111. package/dist/flows/CostCalculator/Results/CostCalculatorGrossSalary.js +1 -1
  112. package/dist/flows/CostCalculator/Results/CostCalculatorResults.d.ts +1 -1
  113. package/dist/flows/CostCalculator/Results/CostCalculatorResults.js +1 -1
  114. package/dist/flows/CostCalculator/SummaryResults/SummaryResults.d.ts +1 -1
  115. package/dist/flows/CostCalculator/api.d.ts +1 -1
  116. package/dist/flows/CostCalculator/components/SalaryField.d.ts +2 -2
  117. package/dist/flows/CostCalculator/components/SalaryField.js +1 -1
  118. package/dist/flows/CostCalculator/context.d.ts +3 -3
  119. package/dist/flows/CostCalculator/hooks.d.ts +3 -3
  120. package/dist/flows/CostCalculator/hooks.js +1 -1
  121. package/dist/flows/CostCalculator/index.d.ts +3 -3
  122. package/dist/flows/CostCalculator/index.js +1 -1
  123. package/dist/flows/CostCalculator/types.d.ts +1 -1
  124. package/dist/flows/CostCalculator/utils.d.ts +3 -3
  125. package/dist/flows/CostCalculator/utils.js +1 -1
  126. package/dist/flows/Onboarding/OnboardingFlow.d.ts +4 -4
  127. package/dist/flows/Onboarding/OnboardingFlow.js +1 -1
  128. package/dist/flows/Onboarding/api.d.ts +4 -4
  129. package/dist/flows/Onboarding/components/AnnualGrossSalary.d.ts +2 -2
  130. package/dist/flows/Onboarding/components/BasicInformationStep.d.ts +4 -4
  131. package/dist/flows/Onboarding/components/BasicInformationStep.js +1 -1
  132. package/dist/flows/Onboarding/components/BenefitsStep.d.ts +4 -4
  133. package/dist/flows/Onboarding/components/BenefitsStep.js +1 -1
  134. package/dist/flows/Onboarding/components/ContractDetailsStep.d.ts +4 -4
  135. package/dist/flows/Onboarding/components/ContractDetailsStep.js +1 -1
  136. package/dist/flows/Onboarding/components/OnboardingForm.d.ts +4 -4
  137. package/dist/flows/Onboarding/components/OnboardingForm.js +1 -1
  138. package/dist/flows/Onboarding/components/OnboardingInvite.d.ts +3 -3
  139. package/dist/flows/Onboarding/components/ReviewStep.d.ts +4 -4
  140. package/dist/flows/Onboarding/components/SaveDraftButton.d.ts +3 -3
  141. package/dist/flows/Onboarding/components/SelectCountryStep.d.ts +4 -4
  142. package/dist/flows/Onboarding/components/SelectCountryStep.js +1 -1
  143. package/dist/flows/Onboarding/context.d.ts +4 -4
  144. package/dist/flows/Onboarding/hooks.d.ts +4 -4
  145. package/dist/flows/Onboarding/index.d.ts +4 -4
  146. package/dist/flows/Onboarding/index.js +1 -1
  147. package/dist/flows/Onboarding/types.d.ts +4 -4
  148. package/dist/flows/Onboarding/utils.d.ts +4 -4
  149. package/dist/flows/Termination/AdditionalDetailsForm.d.ts +4 -4
  150. package/dist/flows/Termination/AdditionalDetailsForm.js +1 -1
  151. package/dist/flows/Termination/EmployeeComunicationForm.d.ts +4 -4
  152. package/dist/flows/Termination/EmployeeComunicationForm.js +1 -1
  153. package/dist/flows/Termination/PaidTimeOffForm.d.ts +4 -4
  154. package/dist/flows/Termination/PaidTimeOffForm.js +1 -1
  155. package/dist/flows/Termination/TerminationDetailsForm.d.ts +4 -4
  156. package/dist/flows/Termination/TerminationDetailsForm.js +1 -1
  157. package/dist/flows/Termination/TerminationFlow.d.ts +4 -4
  158. package/dist/flows/Termination/TerminationFlow.js +1 -1
  159. package/dist/flows/Termination/TerminationForm.d.ts +4 -4
  160. package/dist/flows/Termination/TerminationForm.js +1 -1
  161. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInfomationContainer.d.ts +10 -0
  162. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInfomationContainer.js +2 -0
  163. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInfomationContainer.js.map +1 -0
  164. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformation.d.ts +11 -0
  165. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformation.js +2 -0
  166. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformation.js.map +1 -0
  167. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.d.ts +18 -0
  168. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.js +2 -0
  169. package/dist/flows/Termination/components/AcknowledgeInformation/AcknowledgeInformationFees.js.map +1 -0
  170. package/dist/flows/Termination/components/AcknowledgeInformation/constants.d.ts +12 -0
  171. package/dist/flows/Termination/components/AcknowledgeInformation/constants.js +2 -0
  172. package/dist/flows/Termination/components/AcknowledgeInformation/constants.js.map +1 -0
  173. package/dist/flows/Termination/components/AcknowledgeInformation/types.d.ts +11 -0
  174. package/dist/flows/Termination/components/AcknowledgeInformation/types.js +1 -0
  175. package/dist/flows/Termination/components/AcknowledgeInformation/types.js.map +1 -0
  176. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.d.ts +16 -3
  177. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOff.js +1 -1
  178. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.d.ts +16 -3
  179. package/dist/flows/Termination/components/PaidTimeOff/PaidTimeOffContainer.js +1 -1
  180. package/dist/flows/Termination/components/PaidTimeOff/types.d.ts +16 -2
  181. package/dist/flows/Termination/components/TerminationDialogInfoContent/TerminationDialogInfoContent.js +1 -1
  182. package/dist/flows/Termination/context.d.ts +4 -4
  183. package/dist/flows/Termination/hooks.d.ts +4 -4
  184. package/dist/flows/Termination/hooks.js +1 -1
  185. package/dist/flows/Termination/index.d.ts +15 -5
  186. package/dist/flows/Termination/index.js +1 -1
  187. package/dist/flows/Termination/json-schemas/additionalInformation.d.ts +17 -0
  188. package/dist/flows/Termination/json-schemas/additionalInformation.js +1 -1
  189. package/dist/flows/Termination/json-schemas/jsonSchema.d.ts +17 -0
  190. package/dist/flows/Termination/json-schemas/jsonSchema.js +1 -1
  191. package/dist/flows/Termination/json-schemas/schema.js +1 -1
  192. package/dist/flows/Termination/types.d.ts +4 -4
  193. package/dist/flows/api.d.ts +4 -4
  194. package/dist/flows/api.js +1 -1
  195. package/dist/index.css +1 -1
  196. package/dist/index.css.map +1 -1
  197. package/dist/index.d.ts +60 -9
  198. package/dist/index.js +1 -1
  199. package/dist/index.js.map +1 -1
  200. package/dist/internals.d.ts +1 -1
  201. package/dist/internals.js +1 -1
  202. package/dist/{mutations-DaNL3KJH.d.ts → mutations-C0KsEf83.d.ts} +1 -1
  203. package/dist/{remoteFlows-R6i-5uxZ.d.ts → remoteFlows-DJcvCgN2.d.ts} +19 -2
  204. package/dist/{types-CUuFeuNj.d.ts → types-1tGveWWg.d.ts} +3 -3
  205. package/dist/{types-ClV6M7ry.d.ts → types-CwUhT-vz.d.ts} +37 -18
  206. package/dist/{types-D_DohAP5.d.ts → types-Dad_rgYV.d.ts} +2 -2
  207. package/dist/{types-BSmXaqyP.d.ts → types-DegHPy8Q.d.ts} +4 -4
  208. package/dist/{types.gen-BMxrLsCq.d.ts → types.gen-B73oMrmZ.d.ts} +1 -14
  209. package/package.json +1 -1
  210. package/dist/chunk-2TADRH4W.js +0 -2
  211. package/dist/chunk-32GSS4UM.js +0 -2
  212. package/dist/chunk-32GSS4UM.js.map +0 -1
  213. package/dist/chunk-347YWDTK.js +0 -2
  214. package/dist/chunk-347YWDTK.js.map +0 -1
  215. package/dist/chunk-3AEKPMIN.js +0 -2
  216. package/dist/chunk-3AEKPMIN.js.map +0 -1
  217. package/dist/chunk-4O4VBGMD.js +0 -2
  218. package/dist/chunk-4O4VBGMD.js.map +0 -1
  219. package/dist/chunk-EZWZMPD2.js +0 -2
  220. package/dist/chunk-EZWZMPD2.js.map +0 -1
  221. package/dist/chunk-IUZ7DEXC.js +0 -2
  222. package/dist/chunk-MP2T74PU.js +0 -2
  223. package/dist/chunk-MP2T74PU.js.map +0 -1
  224. package/dist/chunk-NVYMAOQ7.js +0 -2
  225. package/dist/chunk-O7REUCKR.js +0 -2
  226. package/dist/chunk-O7REUCKR.js.map +0 -1
  227. package/dist/chunk-QKLIYOMA.js +0 -2
  228. package/dist/chunk-REDYWUCC.js +0 -2
  229. package/dist/chunk-REDYWUCC.js.map +0 -1
  230. package/dist/chunk-XSHHMBMT.js +0 -2
  231. package/dist/chunk-XSHHMBMT.js.map +0 -1
  232. /package/dist/{chunk-I3PGODII.js.map → chunk-4ZGIL6OE.js.map} +0 -0
  233. /package/dist/{chunk-22JG4IMF.js.map → chunk-5NPET4ZO.js.map} +0 -0
  234. /package/dist/{chunk-VVF4IZES.js.map → chunk-7Y46DL2U.js.map} +0 -0
  235. /package/dist/{chunk-NWEXPORY.js.map → chunk-A2SWQS2N.js.map} +0 -0
  236. /package/dist/{chunk-I52UTPHD.js.map → chunk-AYLYOLVG.js.map} +0 -0
  237. /package/dist/{chunk-YU3JIZ7J.js.map → chunk-BO6OKTIG.js.map} +0 -0
  238. /package/dist/{chunk-PHBQMNG3.js.map → chunk-CVIWZYO3.js.map} +0 -0
  239. /package/dist/{chunk-2M7EBC4K.js.map → chunk-DZ67OJVF.js.map} +0 -0
  240. /package/dist/{chunk-VUP76ZMQ.js.map → chunk-E3JFQ7PH.js.map} +0 -0
  241. /package/dist/{chunk-W5BJQRNM.js.map → chunk-E6OBNWMU.js.map} +0 -0
  242. /package/dist/{chunk-M6G27EJN.js.map → chunk-FEHSJUZJ.js.map} +0 -0
  243. /package/dist/{chunk-4JVXDB5G.js.map → chunk-GD5556B2.js.map} +0 -0
  244. /package/dist/{chunk-Q3A4A2HL.js.map → chunk-KOIHMAAP.js.map} +0 -0
  245. /package/dist/{chunk-EJ4COVQQ.js.map → chunk-L6FZRTSN.js.map} +0 -0
  246. /package/dist/{chunk-4IXRU67S.js.map → chunk-LDJT7TII.js.map} +0 -0
  247. /package/dist/{chunk-S2KE2JLJ.js.map → chunk-LRNSFLHR.js.map} +0 -0
  248. /package/dist/{chunk-AU6AILO2.js.map → chunk-N3EIN72T.js.map} +0 -0
  249. /package/dist/{chunk-CT2ROVBF.js.map → chunk-NRW33IP5.js.map} +0 -0
  250. /package/dist/{chunk-QEWB24WT.js.map → chunk-OXCEJQFC.js.map} +0 -0
  251. /package/dist/{chunk-OCNL6L4L.js.map → chunk-PFT7KJ65.js.map} +0 -0
  252. /package/dist/{chunk-RNJWBKLA.js.map → chunk-QLNFHOLH.js.map} +0 -0
  253. /package/dist/{chunk-RDGF4PBB.js.map → chunk-R3LY6TV5.js.map} +0 -0
  254. /package/dist/{chunk-BGXVK7HL.js.map → chunk-R64X3EJF.js.map} +0 -0
  255. /package/dist/{chunk-JHPCP2ZX.js.map → chunk-RAHCZTQ3.js.map} +0 -0
  256. /package/dist/{chunk-BLZW25OE.js.map → chunk-SA74WAVS.js.map} +0 -0
  257. /package/dist/{chunk-P4ZSYIA4.js.map → chunk-SB3IYODL.js.map} +0 -0
  258. /package/dist/{chunk-7KNNJBO6.js.map → chunk-TUFTB5UD.js.map} +0 -0
  259. /package/dist/{chunk-UUZ353RX.js.map → chunk-VLLLNIMN.js.map} +0 -0
  260. /package/dist/{chunk-HCZWP44I.js.map → chunk-WNTOQYRY.js.map} +0 -0
  261. /package/dist/{chunk-T5LZSTW3.js.map → chunk-WZAWPSKS.js.map} +0 -0
  262. /package/dist/{chunk-46JFDBPC.js.map → chunk-XP7UEI56.js.map} +0 -0
  263. /package/dist/{chunk-LHSNAVGR.js.map → chunk-YXWBSRKS.js.map} +0 -0
  264. /package/dist/{chunk-KH5SAWNH.js.map → chunk-ZIPHLBX4.js.map} +0 -0
@@ -1,2 +0,0 @@
1
- import{a as R,b as x,c as N,d as A}from"./chunk-DTHBG6BD.js";import{a as T}from"./chunk-ZE3YT3Q6.js";import{a as f}from"./chunk-32GSS4UM.js";import{a as C}from"./chunk-AFRA4BIW.js";import{a as w}from"./chunk-MP2T74PU.js";import{b as B}from"./chunk-WVDTHFGS.js";import{a as i,b as n,e as F}from"./chunk-43WMZDDH.js";import{a as d}from"./chunk-P37U34EQ.js";import{MoreHorizontal as G}from"lucide-react";import{useState as P}from"react";import{Fragment as U,jsx as g,jsxs as E}from"react/jsx-runtime";function L({actions:e=[],className:r,label:l,"data-testid":a}){let[_,m]=P(!1);return E("div",{className:i("relative",r),children:[g(B,{"data-testid":a,variant:"ghost","aria-label":l,className:"h-8 w-8 p-0",onClick:()=>m(!_),children:g(G,{className:"h-4 w-4"})}),_&&E(U,{children:[g("div",{className:"fixed inset-0 z-40",onClick:()=>m(!1)}),g("div",{className:"absolute right-0 top-1/2 mt-1 bg-white border border-gray-200 rounded-md shadow-lg z-50 min-w-[120px]",children:e.map((c,u)=>g("button",{"data-testid":`${a}-${c.label.toLowerCase().replace(" ","-")}`,className:i("w-full text-left px-2 py-1.5 text-sm hover:bg-gray-100",c.disabled&&"opacity-50 cursor-not-allowed"),onClick:()=>{c.onClick(),m(!1)},disabled:c.disabled,children:c.label},u))})]})]})}d(L,"ActionsDropdown");import{ChevronDown as S,Info as $}from"lucide-react";import j from"react-flagpack";import{useState as O}from"react";import{Fragment as b,jsx as o,jsxs as t}from"react/jsx-runtime";var Z={GB:"GB-UKM"},K=d(({title:e,country:r,region:l,annualGrossSalary:a,onDelete:_,onExportPdf:m,onEdit:c})=>{let u=[{label:"Edit",onClick:c},{label:"Export",onClick:m},{label:"Delete",onClick:_}];return t("div",{className:"RemoteFlows__EstimationResults__Header flex justify-between",children:[t("div",{className:"flex flex-row items-center gap-6",children:[o("div",{className:"RemoteFlows__EstimationResultsHeader__FlagContainer flex h-16 w-16 items-center justify-center rounded-lg bg-[#F4F4F5]",children:o(j,{code:Z[r.alpha_2_code]||r.alpha_2_code})}),t("div",{className:"space-y-1",children:[o("h2",{"data-testid":"estimation-results-header-title",className:"RemoteFlows__EstimationResultsHeader__Title text-lg font-medium leading-none text-[#181818]",children:e}),t("p",{className:"RemoteFlows__EstimationResultsHeader__Country text-xs text-[#71717A]",children:[r.name," ",l?` (${l.name})`:""]}),t("p",{"data-testid":"estimation-results-header-annual-gross-salary",className:"RemoteFlows__EstimationResultsHeader__AnnualGrossSalary text-xs text-[#71717A]",children:[o("span",{className:"text-[#181818]",children:"Employee annual gross salary:"})," ",a]})]})]}),o(L,{label:"Actions",className:"RemoteFlows__EstimationResults__ActionsDropdown",actions:u})]})},"EstimationResultsHeader"),V=d(()=>({steps:[{id:"add-employment-details",title:"Add employment details",description:"You add employee employments details."},{id:"invite-employee",title:"Invite employee",description:"Hire receives an email invitation from Remote to start the self-enrollment process."},{id:"verify-information",title:"Verify information",description:"Remote prepares the Employment Agreement and verifies all the information."},{id:"sign-contract",title:"Sign contract",description:"All parties sign the Employment Agreement and are ready to start. \u{1F389}"}],helpText:"For customers who accept Remote's Terms of Service (ToS), the employee onboarding timeline starts once the employee has been invited to the platform and completed self enrollment.",zendeskArticleId:f.employeeOnboardingTimeline}),"getOnboardingTimelineData");function Y({minimumOnboardingDays:e,data:r,className:l}){return o(R,{type:"single",collapsible:!0,className:i("RemoteFlows__EstimationResults__OnboardingTimeline w-full",l),children:t(x,{value:"timeline",className:"RemoteFlows__OnboardingTimeline__AccordionItem border-border",children:[o(N,{className:"RemoteFlows__OnboardingTimeline__AccordionTrigger hover:no-underline px-0 py-4",children:t("div",{className:"flex items-center justify-between w-full",children:[o("span",{className:"RemoteFlows__OnboardingTimeline__Title text-base font-medium text-[#0F172A]",children:"Onboarding timeline"}),e!=null&&t("span",{className:"RemoteFlows__OnboardingTimeline__Description text-base text-muted-foreground mr-4",children:[e," days"]})]})}),t(A,{className:"px-0 pb-4",children:[o("ul",{className:"RemoteFlows__OnboardingTimeline__List list-disc list-inside space-y-2",children:r.steps.map(a=>t("li",{children:[o("strong",{className:"font-medium text-[#09090B]",children:a.title})," ","- ",a.description]},a.id))}),t("p",{className:"RemoteFlows__OnboardingTimeline__HelpText text-xs text-muted-foreground mt-4",children:[r.helpText,r.zendeskArticleId&&o(w,{zendeskId:r.zendeskArticleId,children:"Learn more"})]})]})]})})}d(Y,"OnboardingTimeline");function q({className:e,countryBenefitsUrl:r,countryGuideUrl:l,country:a}){return o(R,{type:"single",collapsible:!0,className:i("RemoteFlows__EstimationResults__HiringSection w-full",e),children:t(x,{value:"timeline",className:"RemoteFlows__HiringSection__AccordionItem border-border",children:[o(N,{className:"RemoteFlows__HiringSection__AccordionTrigger hover:no-underline px-0 py-4",children:o("div",{className:"flex items-center justify-between w-full",children:t("span",{className:"text-base font-medium text-[#0F172A]",children:["Hiring in ",a.name]})})}),o(A,{children:t("div",{className:"flex flex-col gap-1",children:[l&&o("a",{href:l,target:"_blank",className:"RemoteFlows__Link",children:"Explore our complete guide \u2197"}),r&&o("a",{href:r,target:"_blank",className:"RemoteFlows__Link",children:"Explore our available benefits \u2197"})]})})]})})}d(q,"HiringSection");function J({isMultipleCurrency:e,className:r}){return t("div",{className:i("RemoteFlows__EstimationResults__Headers grid grid-cols-3 items-center",r),children:[o("span",{"aria-hidden":!0}),e?t(b,{children:[o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Employee currency"}),o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Employer currency"})]}):t(b,{children:[o("span",{}),o("span",{className:"RemoteFlows__EstimationResults__Headers__Label",children:"Amount"})]})]})}d(J,"EstimationHeaders");function I({label:e,amounts:r,className:l,children:a}){let[_,m]=O(!0);return t("div",{className:i("RemoteFlows__EstimationResults__Row",l),children:[t("div",{className:"RemoteFlows__EstimationRow__Grid grid grid-cols-3 items-center",children:[t("div",{className:"RemoteFlows__EstimationRow__LabelContainer flex items-center gap-2",children:[o("span",{className:i("RemoteFlows__EstimationRow__Title min-w-[140px] font-medium text-[#09090B]"),children:e}),o("button",{onClick:()=>m(!_),className:"RemoteFlows__EstimationRow__CollapseButton p-1 hover:bg-gray-100 rounded",children:o(S,{className:`h-4 w-4 text-muted-foreground transition-transform ${_?"rotate-180":""}`})})]}),Array.isArray(r)?r.map((c,u)=>o("span",{className:i("RemoteFlows__EstimationRow__RegionalAmount text-right font-medium text-[#09090B]"),children:c},u)):t(b,{children:[o("span",{}),o("span",{className:i("RemoteFlows__EstimationRow__EmployerAmount text-right font-medium text-[#09090B]"),children:r})]})]}),_&&a&&o("div",{className:"RemoteFlows__EstimationRow__CollapsibleContent mt-4",children:a})]})}d(I,"EstimationRow");function Q({item:e,isMultipleCurrency:r,level:l=0}){let[a,_]=O(!1),m=e.children&&e.children.length>0,c=l>0,u=e.isCollapsible||m;return t("li",{className:i("RemoteFlows__BreakdownList__Item pb-3",c&&"pb-1"),children:[t("div",{className:i(r?"RemoteFlows__BreakdownList__Grid grid grid-cols-3 items-center justify-between":"RemoteFlows__BreakdownList__Grid grid grid-cols-2 items-center justify-between"),children:[t("div",{className:i("RemoteFlows__BreakdownList__LabelContainer flex items-center gap-2",c&&"pl-3"),children:[!c&&o("span",{className:"RemoteFlows__BreakdownList__Bullet w-1 h-1 bg-[#09090B] rounded-full flex-shrink-0","aria-hidden":"true"}),u?t("button",{onClick:()=>_(!a),className:"RemoteFlows__BreakdownList__CollapseButton flex items-center gap-2 hover:bg-gray-100 rounded p-1",children:[o("span",{className:i(c?"RemoteFlows__BreakdownList__Text--Nested text-xs text-[#71717A]":"RemoteFlows__BreakdownList__Text--NotNested text-sm text-[#09090B]"),children:e.label}),o(S,{className:`RemoteFlows__BreakdownList__ChevronDown h-3 w-3 text-muted-foreground transition-transform ${a?"rotate-180":""}`})]}):o("span",{className:i(c?"RemoteFlows__BreakdownList__Text--Nested text-xs text-[#71717A]":"RemoteFlows__BreakdownList__Text--NotNested text-sm text-[#09090B] p-1"),children:e.label}),e.tooltip&&o(T,{content:t(b,{children:[o("span",{dangerouslySetInnerHTML:{__html:F(e.tooltip)}})," ",e.zendeskId&&o(w,{zendeskId:Number(e.zendeskId),children:"Learn more"})]}),children:o("button",{className:"RemoteFlows__BreakdownList__InfoButton p-1 hover:bg-gray-100 rounded",children:o($,{className:i("RemoteFlows__BreakdownList__InfoButton__Icon text-muted-foreground",c?"h-3 w-3":"h-4 w-4")})})})]}),r?t(b,{children:[o("span",{"data-testid":e.dataSelector&&e.dataSelector+"-employee-amount",className:i("RemoteFlows__BreakdownList__RegionalAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__RegionalAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__RegionalAmountText--NotNested text-[#09090B]"),children:e.regionalAmount||"\u2014"}),o("span",{"data-testid":e.dataSelector&&e.dataSelector+"-employer-amount",className:i("RemoteFlows__BreakdownList__EmployerAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__EmployerAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__EmployerAmountText--NotNested text-[#09090B]"),children:e.employerAmount||"\u2014"})]}):o("span",{"data-testid":e.dataSelector,className:i("RemoteFlows__BreakdownList__RegionalAmountText text-sm text-right",c?"RemoteFlows__BreakdownList__RegionalAmountText--Nested text-[#71717A]":"RemoteFlows__BreakdownList__RegionalAmountText--NotNested text-[#09090B]"),children:e.regionalAmount||"\u2014"})]}),m&&a&&o("div",{className:"mt-1",children:o(k,{items:e.children,isMultipleCurrency:r,level:l+1})})]})}d(Q,"BreakdownListItem");function k({items:e,isMultipleCurrency:r,className:l,level:a}){return o("ul",{className:i("RemoteFlows__BreakdownList list-none",l),children:e.map((_,m)=>o(Q,{item:_,isMultipleCurrency:r,level:a},m))})}d(k,"BreakdownList");var pe=d(({estimation:e,title:r,components:l,onDelete:a,onExportPdf:_,onEdit:m})=>{let c=l?.HiringSection||q,u=l?.OnboardingTimeline||Y,z=l?.Header||K,h=l?.Footer,H=V(),p=e.employer_currency_costs.currency.code!==e.regional_currency_costs.currency.code,v=e.employer_currency_costs.monthly_management_fee,D=e.region.code!==e.country.code,M=n(e.regional_currency_costs.annual_gross_salary,e.regional_currency_costs.currency.symbol);return t(C,{className:"RemoteFlows__EstimationResults__Card p-10",children:[o("div",{className:"RemoteFlows__Separator",children:o(z,{title:r,annualGrossSalary:M,region:D?e.region:void 0,country:e.country,onDelete:a,onExportPdf:_,onEdit:m})}),t("div",{className:"RemoteFlows__Separator",children:[o(J,{isMultipleCurrency:p,className:"mb-3"}),o(I,{label:"Monthly total cost",amounts:p?[n(e.regional_currency_costs.monthly_total,e.regional_currency_costs.currency.symbol),n(e.employer_currency_costs.monthly_total,e.employer_currency_costs.currency.symbol)]:n(e.regional_currency_costs.monthly_total,e.regional_currency_costs.currency.symbol),children:o(k,{items:[{label:"Gross monthly salary",regionalAmount:n(e.regional_currency_costs.monthly_gross_salary,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.monthly_gross_salary,e.employer_currency_costs.currency.symbol),zendeskId:f.extraPayments.toString(),tooltip:"This country respects extra payments on top of the gross salary."},{label:"Mandatory employer costs",regionalAmount:n(e.regional_currency_costs.monthly_contributions_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.monthly_contributions_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.monthly_contributions_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.monthly_contributions_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Benefits",regionalAmount:n(e.regional_currency_costs.monthly_benefits_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.monthly_benefits_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.monthly_benefits_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.monthly_benefits_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},...v?[{label:"Monthly fee",regionalAmount:n(e.regional_currency_costs.monthly_management_fee,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.monthly_management_fee,e.employer_currency_costs.currency.symbol),tooltip:"Discounts may be available based on your commitment and team size. Speak to your account or customer success manager to learn more."}]:[]],isMultipleCurrency:p})})]}),o("div",{className:"RemoteFlows__Separator",children:o(I,{label:"Annual total cost",amounts:p?[n(e.regional_currency_costs.annual_total,e.regional_currency_costs.currency.symbol),n(e.employer_currency_costs.annual_total,e.employer_currency_costs.currency.symbol)]:n(e.regional_currency_costs.annual_total,e.regional_currency_costs.currency.symbol),children:o(k,{items:[{label:"Gross annual salary",dataSelector:"annual-gross-salary",regionalAmount:n(e.regional_currency_costs.annual_gross_salary,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.annual_gross_salary,e.employer_currency_costs.currency.symbol)},{label:"Mandatory employer costs",regionalAmount:n(e.regional_currency_costs.annual_contributions_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.annual_contributions_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.annual_contributions_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.annual_contributions_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Benefits",regionalAmount:n(e.regional_currency_costs.annual_benefits_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.annual_benefits_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.annual_benefits_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.annual_benefits_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},{label:"Extra statutory payments",regionalAmount:n(e.regional_currency_costs.extra_statutory_payments_total,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.extra_statutory_payments_total,e.employer_currency_costs.currency.symbol),children:e.employer_currency_costs.extra_statutory_payments_breakdown?.map((s,y)=>({label:s.name,regionalAmount:n(e.regional_currency_costs.extra_statutory_payments_breakdown?.[y]?.amount,e.regional_currency_costs.currency.symbol),employerAmount:n(s.amount,e.employer_currency_costs.currency.symbol),zendeskId:s.zendesk_article_id||void 0,tooltip:s.description||void 0}))||[]},...v?[{label:"Annual fee",regionalAmount:n(e.regional_currency_costs.annual_management_fee,e.regional_currency_costs.currency.symbol),employerAmount:n(e.employer_currency_costs.annual_management_fee,e.employer_currency_costs.currency.symbol),tooltip:"Discounts may be available based on your commitment and team size. Speak to your account or customer success manager to learn more."}]:[]],isMultipleCurrency:p})})}),o("div",{className:"RemoteFlows__Separator",children:o(u,{minimumOnboardingDays:e.minimum_onboarding_time,data:H})}),o(c,{countryBenefitsUrl:e.country_benefits_details_url,countryGuideUrl:e.country_guide_url,country:e.country}),h&&o(h,{})]})},"EstimationResults");export{pe as a};
2
- //# sourceMappingURL=chunk-NVYMAOQ7.js.map
@@ -1,2 +0,0 @@
1
- import{a as v}from"./chunk-REDYWUCC.js";import{a as A}from"./chunk-2YTBWEC7.js";import{a as l,b as _}from"./chunk-3AEKPMIN.js";import{C as b,c as E,p as w}from"./chunk-3O3Q24JL.js";import{a as M}from"./chunk-PJBAQZ6G.js";import{d}from"./chunk-3ZWDIEEM.js";import{a as j,c as S}from"./chunk-PAQW5BFW.js";import{a as t}from"./chunk-P37U34EQ.js";import{createHeadlessForm as I,modify as R}from"@remoteoss/json-schema-form";import{useMutation as Q,useQuery as B}from"@tanstack/react-query";var J=t(({countryCode:a,employment:r,fieldValues:n,options:e})=>{let{client:u}=d(),m=e?.jsonSchemaVersion?.contract_amendments?{json_schema_version:e.jsonSchemaVersion.contract_amendments}:{};return B({queryKey:["contract-amendment-schema"],retry:!1,queryFn:t(async()=>{let o=await E({client:u,headers:{Authorization:""},query:{employment_id:r?.data?.employment?.id,country_code:a,...m}});if(o.error||!o.data)throw new Error("Failed to fetch contract amendment schema");return o},"queryFn"),enabled:!!r,select:t(({data:o})=>{let c=o?.data||{};if(e&&e.jsfModify){let{schema:f}=R(c,e.jsfModify);c=f}let s={...n,annual_gross_salary:n?.annual_gross_salary?j(n?.annual_gross_salary):void 0},y=Object.keys(s).length>0;return I(c,{initialValues:y?s:_(r)})},"select")})},"useContractAmendmentSchemaQuery"),K=t(a=>{let{client:r}=d(),n=a?.jsonSchemaVersion?.contract_amendments?{json_schema_version:a.jsonSchemaVersion.contract_amendments}:{};return Q({mutationFn:t(e=>w({client:r,headers:{Authorization:""},body:e,query:{...n}}),"mutationFn")})},"useCreateContractAmendmentMutation"),U=t(a=>{let{client:r}=d(),n=a?.jsonSchemaVersion?.contract_amendments?{json_schema_version:a.jsonSchemaVersion.contract_amendments}:{};return Q({mutationFn:t(e=>b({client:r,headers:{Authorization:""},body:e,query:{...n}}),"mutationFn")})},"useAutomatableContractAmendmentMutation"),ae=t(({employmentId:a,countryCode:r,options:n})=>{let{fieldValues:e,setFieldValues:u,stepState:m,nextStep:o,previousStep:c}=M(l),{data:s,isLoading:y,isError:V,error:f}=v({employmentId:a}),{data:i,isLoading:q,isError:L,error:T}=J({employment:s,countryCode:r,fieldValues:{...m.values?.[m.currentStep.name],...e},options:n}),k=_(s,i?.fields),F=K(n),g=U(n);async function O(p){let h=S(p,i?.fields||[],{isPartialValidation:!1}),P={employment_id:s?.data.employment?.id,amendment_contract_id:s?.data.employment?.active_contract_id,contract_amendment:{...h}};switch(m.currentStep.name){case l.form.name:{let{mutateAsync:C}=A(g),H=await C(P);return o(),H}case l.confirmation_form.name:{let{mutateAsync:C}=A(F);return C(P)}default:throw new Error("Invalid step state")}}t(O,"onSubmit");function z(p){if(i){let h=S(p,i?.fields);return i?.handleValidation(h)}return null}t(z,"handleValidation");function x(){c()}return t(x,"back"),{stepState:m,fields:i?.fields||[],isLoading:y||q,isError:V||L,error:f||T,isSubmitting:g.isPending||F.isPending,initialValues:k,values:e,handleValidation:z,checkFieldUpdates:u,onSubmit:O,back:x}},"useContractAmendment");export{ae as a};
2
- //# sourceMappingURL=chunk-O7REUCKR.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/ContractAmendment/hooks.ts"],"sourcesContent":["import {\n CreateContractAmendmentParams,\n EmploymentShowResponse,\n getShowContractAmendmentSchema,\n postAutomatableContractAmendment,\n postCreateContractAmendment,\n} from '@/src/client';\n\nimport {\n convertToCents,\n parseJSFToValidate,\n} from '@/src/components/form/utils';\nimport { mutationToPromise } from '@/src/lib/mutations';\n\nimport { Client } from '@hey-api/client-fetch';\nimport { createHeadlessForm, modify } from '@remoteoss/json-schema-form';\nimport { useMutation, useQuery } from '@tanstack/react-query';\nimport { ContractAmendmentParams } from './types';\n\nimport { useEmploymentQuery } from '@/src/common/api';\nimport { useClient } from '@/src/context';\nimport { FieldValues } from 'react-hook-form';\nimport { useStepState } from '../useStepState';\nimport { buildInitialValues, STEPS } from './utils';\nimport { FlowOptions } from '@/src/flows/types';\n\ntype ContractAmendmentSchemaParams = {\n countryCode: string;\n employment: EmploymentShowResponse | undefined;\n fieldValues: FieldValues | undefined;\n options?: ContractAmendmentParams['options'];\n};\n\nconst useContractAmendmentSchemaQuery = ({\n countryCode,\n employment,\n fieldValues,\n options,\n}: ContractAmendmentSchemaParams) => {\n const { client } = useClient();\n const jsonSchemaQueryParam = options?.jsonSchemaVersion?.contract_amendments\n ? {\n json_schema_version: options.jsonSchemaVersion.contract_amendments,\n }\n : {};\n return useQuery({\n queryKey: ['contract-amendment-schema'],\n retry: false,\n queryFn: async () => {\n const response = await getShowContractAmendmentSchema({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n query: {\n employment_id: employment?.data?.employment?.id as string,\n country_code: countryCode,\n ...jsonSchemaQueryParam,\n },\n });\n\n // If response status is 404 or other error, throw an error to trigger isError\n if (response.error || !response.data) {\n throw new Error('Failed to fetch contract amendment schema');\n }\n\n return response;\n },\n enabled: Boolean(employment),\n select: ({ data }) => {\n let jsfSchema = data?.data || {};\n\n if (options && options.jsfModify) {\n const { schema } = modify(jsfSchema, options.jsfModify);\n jsfSchema = schema;\n }\n\n const copyFieldValues = {\n ...fieldValues,\n annual_gross_salary: fieldValues?.annual_gross_salary\n ? convertToCents(fieldValues?.annual_gross_salary)\n : undefined,\n };\n\n const hasFieldValues = Object.keys(copyFieldValues).length > 0;\n\n const result = createHeadlessForm(jsfSchema, {\n initialValues: hasFieldValues\n ? copyFieldValues\n : buildInitialValues(employment),\n });\n return result;\n },\n });\n};\n\nconst useCreateContractAmendmentMutation = (options?: FlowOptions) => {\n const { client } = useClient();\n const jsonSchemaQueryParam = options?.jsonSchemaVersion?.contract_amendments\n ? {\n json_schema_version: options.jsonSchemaVersion.contract_amendments,\n }\n : {};\n return useMutation({\n mutationFn: (payload: CreateContractAmendmentParams) => {\n return postCreateContractAmendment({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n body: payload,\n query: {\n ...jsonSchemaQueryParam,\n },\n });\n },\n });\n};\n\nconst useAutomatableContractAmendmentMutation = (options?: FlowOptions) => {\n const { client } = useClient();\n const jsonSchemaQueryParam = options?.jsonSchemaVersion?.contract_amendments\n ? {\n json_schema_version: options.jsonSchemaVersion.contract_amendments,\n }\n : {};\n return useMutation({\n mutationFn: (payload: CreateContractAmendmentParams) => {\n return postAutomatableContractAmendment({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n body: payload,\n query: {\n ...jsonSchemaQueryParam,\n },\n });\n },\n });\n};\n\nexport const useContractAmendment = ({\n employmentId,\n countryCode,\n options,\n}: ContractAmendmentParams) => {\n const { fieldValues, setFieldValues, stepState, nextStep, previousStep } =\n useStepState<keyof typeof STEPS>(STEPS);\n\n const {\n data: employment,\n isLoading: isLoadingEmployment,\n isError: isErrorEmployment,\n error: errorEmployment,\n } = useEmploymentQuery({\n employmentId,\n });\n\n const {\n data: contractAmendmentHeadlessForm,\n isLoading: isLoadingContractAmendments,\n isError: isErrorContractAmendmentSchema,\n error: errorContractAmendmentSchema,\n } = useContractAmendmentSchemaQuery({\n employment,\n countryCode,\n // In case the user is navigating back to the form step, we need to\n // pass the previous field values, so that the schema can be\n // generated with the correct values.\n fieldValues: {\n ...stepState.values?.[stepState.currentStep.name], // Restore values for the current step\n ...fieldValues,\n },\n options,\n });\n\n const initialValues = buildInitialValues(\n employment,\n contractAmendmentHeadlessForm?.fields,\n );\n\n const createContractAmendmentMutation =\n useCreateContractAmendmentMutation(options);\n const automatableContractAmendmentMutation =\n useAutomatableContractAmendmentMutation(options);\n\n async function onSubmit(values: FieldValues) {\n const parsedValues = parseJSFToValidate(\n values,\n contractAmendmentHeadlessForm?.fields || [],\n {\n isPartialValidation: false,\n },\n );\n\n const payload = {\n employment_id: employment?.data.employment?.id as string,\n amendment_contract_id: employment?.data.employment\n ?.active_contract_id as string,\n contract_amendment: {\n ...parsedValues,\n },\n };\n\n switch (stepState.currentStep.name) {\n case STEPS.form.name: {\n const { mutateAsync } = mutationToPromise(\n automatableContractAmendmentMutation,\n );\n\n const automatableContractAmendment = await mutateAsync(payload);\n\n nextStep();\n\n return automatableContractAmendment;\n }\n case STEPS.confirmation_form.name: {\n const { mutateAsync } = mutationToPromise(\n createContractAmendmentMutation,\n );\n\n return mutateAsync(payload);\n }\n\n default:\n throw new Error('Invalid step state');\n }\n }\n\n function handleValidation(values: FieldValues) {\n if (contractAmendmentHeadlessForm) {\n const parsedValues = parseJSFToValidate(\n values,\n contractAmendmentHeadlessForm?.fields,\n );\n\n return contractAmendmentHeadlessForm?.handleValidation(parsedValues);\n }\n return null;\n }\n\n function back() {\n previousStep();\n }\n\n return {\n /**\n * Current step state containing the current step and total number of steps\n */\n stepState,\n /**\n * Array of form fields from the contract amendment schema\n */\n fields: contractAmendmentHeadlessForm?.fields || [],\n /**\n * Loading state indicating if either employment or contract amendment data is being fetched\n */\n isLoading: isLoadingEmployment || isLoadingContractAmendments,\n /**\n * Error state indicating if there was an error fetching either employment or contract amendment data\n */\n isError: isErrorEmployment || isErrorContractAmendmentSchema,\n /**\n * Error object containing details about any errors that occurred during data fetching\n */\n error: errorEmployment || errorContractAmendmentSchema,\n /**\n * Loading state indicating if a contract amendment mutation is in progress\n */\n isSubmitting:\n automatableContractAmendmentMutation.isPending ||\n createContractAmendmentMutation.isPending,\n /**\n * Initial form values built from employment data and contract amendment fields\n */\n initialValues,\n /**\n * Current form field values\n */\n values: fieldValues,\n /**\n * Function to validate form values against the contract amendment schema\n * @param values - Form values to validate\n * @returns Validation result or null if no schema is available\n */\n handleValidation,\n /**\n * Function to update the current form field values\n * @param values - New form values to set\n */\n checkFieldUpdates: setFieldValues,\n /**\n * Function to handle form submission\n * @param values - Form values to submit\n * @returns Promise resolving to the mutation result\n */\n onSubmit,\n /**\n * Function to handle going back to the previous step\n * @returns {void}\n */\n back,\n };\n};\n"],"mappings":"uVAeA,OAAS,sBAAAA,EAAoB,UAAAC,MAAc,8BAC3C,OAAS,eAAAC,EAAa,YAAAC,MAAgB,wBAiBtC,IAAMC,EAAkCC,EAAA,CAAC,CACvC,YAAAC,EACA,WAAAC,EACA,YAAAC,EACA,QAAAC,CACF,IAAqC,CACnC,GAAM,CAAE,OAAAC,CAAO,EAAIC,EAAU,EACvBC,EAAuBH,GAAS,mBAAmB,oBACrD,CACE,oBAAqBA,EAAQ,kBAAkB,mBACjD,EACA,CAAC,EACL,OAAOI,EAAS,CACd,SAAU,CAAC,2BAA2B,EACtC,MAAO,GACP,QAASR,EAAA,SAAY,CACnB,IAAMS,EAAW,MAAMC,EAA+B,CACpD,OAAQL,EACR,QAAS,CACP,cAAe,EACjB,EACA,MAAO,CACL,cAAeH,GAAY,MAAM,YAAY,GAC7C,aAAcD,EACd,GAAGM,CACL,CACF,CAAC,EAGD,GAAIE,EAAS,OAAS,CAACA,EAAS,KAC9B,MAAM,IAAI,MAAM,2CAA2C,EAG7D,OAAOA,CACT,EAnBS,WAoBT,QAAS,EAAQP,EACjB,OAAQF,EAAA,CAAC,CAAE,KAAAW,CAAK,IAAM,CACpB,IAAI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,IACT,CAVS/C,EAAAoD,EAAA,oBAYT,SAASC,GAAO,CACdtB,EAAa,CACf,CAFS,OAAA/B,EAAAqD,EAAA,QAIF,CAIL,UAAAxB,EAIA,OAAQS,GAA+B,QAAU,CAAC,EAIlD,UAAWJ,GAAuBK,EAIlC,QAASJ,GAAqBK,EAI9B,MAAOJ,GAAmBK,EAI1B,aACEG,EAAqC,WACrCD,EAAgC,UAIlC,cAAAD,EAIA,OAAQvC,EAMR,iBAAAiD,EAKA,kBAAmBxB,EAMnB,SAAAiB,EAKA,KAAAQ,CACF,CACF,EAlKoC","names":["createHeadlessForm","modify","useMutation","useQuery","useContractAmendmentSchemaQuery","__name","countryCode","employment","fieldValues","options","client","useClient","jsonSchemaQueryParam","useQuery","response","getShowContractAmendmentSchema","data","jsfSchema","schema","modify","copyFieldValues","convertToCents","hasFieldValues","createHeadlessForm","buildInitialValues","useCreateContractAmendmentMutation","useMutation","payload","postCreateContractAmendment","useAutomatableContractAmendmentMutation","postAutomatableContractAmendment","useContractAmendment","employmentId","setFieldValues","stepState","nextStep","previousStep","useStepState","STEPS","isLoadingEmployment","isErrorEmployment","errorEmployment","useEmploymentQuery","contractAmendmentHeadlessForm","isLoadingContractAmendments","isErrorContractAmendmentSchema","errorContractAmendmentSchema","initialValues","createContractAmendmentMutation","automatableContractAmendmentMutation","onSubmit","values","parsedValues","parseJSFToValidate","mutateAsync","mutationToPromise","automatableContractAmendment","handleValidation","back"]}
@@ -1,2 +0,0 @@
1
- import{a as i}from"./chunk-32GSS4UM.js";import{a as n}from"./chunk-MP2T74PU.js";import{a as e}from"./chunk-43WMZDDH.js";import{a as o}from"./chunk-P37U34EQ.js";import{Fragment as s,jsx as t,jsxs as m}from"react/jsx-runtime";var r=["You submit your termination request.","We review your request along with the employment agreement, local labor laws, and any collective bargaining agreements in place.","A lifecycle specialist contacts you if they need additional details. Sometimes they will request a call.","Depending on the country-specific laws and the terms of the employment agreement, we may need to seek additional legal advice. We\u2019ll let you know if there are additional charges before proceeding.","Terms and conditions for the termination are finalized.","You verbally communicate the termination to the employee.","We share termination documents with the employee.","The employee signs the termination documents if required.","We process the final salary and offboard the employee."],h=o(()=>m(s,{children:[t("h3",{className:e("RemoteFlows__TerminationDialogInfoContent__Title"),children:"Please read carefully before you continue"}),t("p",{className:e("RemoteFlows__TerminationDialogInfoContent__Description"),children:"Please do not inform the employee of the termination. We'll lead communication with them after you submit this form and we finalize the termination terms."}),t("p",{className:e("RemoteFlows__TerminationDialogInfoContent__Description RemoteFlows__TerminationDialogInfoContent__FollowUpDescription"),children:"If you already informed them, that's okay. We'll ask for the details regarding that communication and take it from there."}),t(n,{className:e("RemoteFlows__TerminationDialogInfoContent__ZendeskTriggerButton text-sm"),zendeskId:i.terminationEmployeeCommunication,children:"Learn more about employee communication"}),t("h3",{className:e("RemoteFlows__TerminationDialogInfoContent__ProcessTitle"),children:"The termination process"}),t("ul",{className:e("RemoteFlows__TerminationDialogInfoContent__ProcessList list-disc list-inside"),children:r.map((a,l)=>t("li",{className:e("RemoteFlows__TerminationDialogInfoContent__ProcessListItem"),children:a},l))})]}),"TerminationDialogInfoContent");export{h as a};
2
- //# sourceMappingURL=chunk-QKLIYOMA.js.map
@@ -1,2 +0,0 @@
1
- import{G as p,s as u,u as y}from"./chunk-3O3Q24JL.js";import{d as i}from"./chunk-3ZWDIEEM.js";import{a}from"./chunk-P37U34EQ.js";import{useQuery as m}from"@tanstack/react-query";var x=a(({employmentId:n})=>{let{client:o}=i();return m({queryKey:["employment",n],retry:!1,queryFn:a(()=>y({client:o,headers:{Authorization:""},path:{employment_id:n}}),"queryFn"),select:a(({data:e})=>e,"select")})},"useEmploymentQuery"),l=a(({employmentId:n,status:o,timeoffType:e,options:t})=>{let{client:r}=i();return m({queryKey:["timeoff",n,o],retry:!1,queryFn:a(()=>p({client:r,headers:{Authorization:""},query:{employment_id:n,status:o,timeoff_type:e}}),"queryFn"),select:a(({data:s})=>t?.select?.(s)??s,"select"),enabled:t?.enabled})},"useTimeOffQuery"),T=a((n,o)=>{let e=new Date(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),t=new Date(o).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"});return`${e} \u2192 ${t}`},"formatDateRange"),w=a(({employmentId:n,options:o})=>l({employmentId:n,timeoffType:"paid_time_off",options:{enabled:o?.enabled,select:a(e=>({bookedDays:e?.data?.total_count||0,timeoffs:e?.data?.timeoffs?.map(t=>({status:t?.status,duration:t?.timeoff_days.length,startDate:t?.start_date,endDate:t?.end_date,formattedDate:T(t?.start_date,t?.end_date)}))||[]}),"select")}}),"usePaidTimeoffBreakdownQuery"),b=a(({employmentId:n,date:o,options:e})=>l({employmentId:n,timeoffType:"paid_time_off",status:"approved",options:{enabled:e?.enabled,select:a(t=>({bookedDaysBeforeTermination:t?.data?.timeoffs?.filter(r=>new Date(r?.start_date)<=new Date(o)).length||0,bookedDaysAfterTermination:t?.data?.timeoffs?.filter(r=>new Date(r?.start_date)>new Date(o)).length||0}),"select")}}),"useBookedTimeoffBeforeAndAfterTerminationQuery"),L=a(({employmentId:n,proposedTerminationDate:o})=>{let e=g({employmentId:n}),t=b({employmentId:n,date:o}),r=e.data?.data?.[0].annual_entitlement.type==="limited"&&e.data?.data?.[0].annual_entitlement.days||0,s=e.data?.data?.[0].booked?.days||0,d=e.data?.data?.[0].used.days||0,c=t.data?.bookedDaysBeforeTermination||0,D=t.data?.bookedDaysAfterTermination||0,f=r-s-d;return{data:{entitledDays:r,bookedDays:s,usedDays:d,approvedDaysBeforeTermination:c,approvedDaysAfterTermination:D,remainingDays:f<0?0:f},isLoading:e.isLoading||t.isLoading,isError:e.isError||t.isError,error:e.error||t.error}},"useSummaryTimeOffDataQuery"),g=a(({employmentId:n})=>{let{client:o}=i();return m({queryKey:["timeoff-balance",n],retry:!1,queryFn:a(()=>u({client:o,headers:{Authorization:""},path:{employment_id:n}}),"queryFn"),select:a(({data:e})=>e,"select")})},"useTimeOffLeavePoliciesSummaryQuery");export{x as a,l as b,w as c,b as d,L as e,g as f};
2
- //# sourceMappingURL=chunk-REDYWUCC.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/common/api.ts"],"sourcesContent":["import {\n getIndexLeavePoliciesSummary,\n getIndexTimeoff,\n getShowEmployment,\n ListTimeoffResponse,\n TimeoffStatus,\n TimeoffType,\n} from '@/src/client';\nimport { useClient } from '@/src/context';\nimport { ContractAmendmentParams } from '@/src/flows/ContractAmendment/types';\nimport { Client } from '@hey-api/client-fetch';\nimport { useQuery } from '@tanstack/react-query';\n\ntype UseEmployment = Pick<ContractAmendmentParams, 'employmentId'>;\n\n/**\n * Hook to retrieve employment details for a specific employment ID.\n *\n * @param {Object} params - The parameters for the query.\n * @param {string} params.employmentId - The ID of the employment to fetch details for.\n * @returns {UseQueryResult<any, unknown>} - The result of the query, including the employment details.\n */\nexport const useEmploymentQuery = ({ employmentId }: UseEmployment) => {\n const { client } = useClient();\n return useQuery({\n queryKey: ['employment', employmentId],\n retry: false,\n queryFn: () => {\n return getShowEmployment({\n client: client as Client,\n headers: {\n Authorization: ``,\n },\n path: { employment_id: employmentId },\n });\n },\n select: ({ data }) => data,\n });\n};\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 = new Date(startDate).toLocaleDateString('en-US', {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n });\n const end = new Date(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: data?.data?.total_count || 0,\n timeoffs:\n data?.data?.timeoffs?.map((timeoff) => {\n return {\n status: timeoff?.status,\n duration: timeoff?.timeoff_days.length,\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\nexport type BookedTimeoffBeforeDateResponse = {\n bookedDaysBeforeTermination: number;\n bookedDaysAfterTermination: number;\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 hooks it's not taking into account unlimited time off or half days yet or even we you request several days in one 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 return {\n bookedDaysBeforeTermination:\n data?.data?.timeoffs?.filter((timeoff) => {\n return new Date(timeoff?.start_date) <= new Date(date);\n }).length || 0,\n bookedDaysAfterTermination:\n data?.data?.timeoffs?.filter((timeoff) => {\n return new Date(timeoff?.start_date) > new Date(date);\n }).length || 0,\n };\n },\n },\n });\n};\n\nexport type SummaryTimeOffDataResponse = {\n entitledDays: number;\n bookedDays: number;\n usedDays: number;\n approvedDaysBeforeTermination: number;\n approvedDaysAfterTermination: number;\n remainingDays: number;\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}: {\n employmentId: string;\n proposedTerminationDate: string;\n}) => {\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 leavePoliciesSummaryQuery.data?.data?.[0].annual_entitlement.days) ||\n 0;\n const bookedDays =\n leavePoliciesSummaryQuery.data?.data?.[0].booked?.days || 0;\n const usedDays = leavePoliciesSummaryQuery.data?.data?.[0].used.days || 0;\n const approvedDaysBeforeTermination =\n bookedTimeQuery.data?.bookedDaysBeforeTermination || 0;\n const approvedDaysAfterTermination =\n bookedTimeQuery.data?.bookedDaysAfterTermination || 0;\n const remainingDays = entitledDays - bookedDays - usedDays;\n\n return {\n data: {\n entitledDays,\n bookedDays,\n usedDays,\n approvedDaysBeforeTermination,\n approvedDaysAfterTermination,\n remainingDays: remainingDays < 0 ? 0 : remainingDays,\n },\n isLoading: leavePoliciesSummaryQuery.isLoading || bookedTimeQuery.isLoading,\n isError: leavePoliciesSummaryQuery.isError || bookedTimeQuery.isError,\n error: leavePoliciesSummaryQuery.error || bookedTimeQuery.error,\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"],"mappings":"iIAWA,OAAS,YAAAA,MAAgB,wBAWlB,IAAMC,EAAqBC,EAAA,CAAC,CAAE,aAAAC,CAAa,IAAqB,CACrE,GAAM,CAAE,OAAAC,CAAO,EAAIC,EAAU,EAC7B,OAAOC,EAAS,CACd,SAAU,CAAC,aAAcH,CAAY,EACrC,MAAO,GACP,QAASD,EAAA,IACAK,EAAkB,CACvB,OAAQH,EACR,QAAS,CACP,cAAe,EACjB,EACA,KAAM,CAAE,cAAeD,CAAa,CACtC,CAAC,EAPM,WAST,OAAQD,EAAA,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oD7BD,EAAsCxB,EAAA,CAAC,CAClD,aAAAC,CACF,IAEM,CACJ,GAAM,CAAE,OAAAC,CAAO,EAAIC,EAAU,EAC7B,OAAOC,EAAS,CACd,SAAU,CAAC,kBAAmBH,CAAY,EAC1C,MAAO,GACP,QAASD,EAAA,IACAgC,EAA6B,CAClC,OAAQ9B,EACR,QAAS,CACP,cAAe,EACjB,EACA,KAAM,CAAE,cAAeD,CAAuB,CAChD,CAAC,EAPM,WAST,OAAQD,EAAA,CAAC,CAAE,KAAAM,CAAK,IAAMA,EAAd,SACV,CAAC,CACH,EApBmD","names":["useQuery","useEmploymentQuery","__name","employmentId","client","useClient","useQuery","getShowEmployment","data","useTimeOffQuery","status","timeoffType","options","getIndexTimeoff","formatDateRange","startDate","endDate","start","end","usePaidTimeoffBreakdownQuery","timeoff","useBookedTimeoffBeforeAndAfterTerminationQuery","date","useSummaryTimeOffDataQuery","proposedTerminationDate","leavePoliciesSummaryQuery","useTimeOffLeavePoliciesSummaryQuery","bookedTimeQuery","entitledDays","bookedDays","usedDays","approvedDaysBeforeTermination","approvedDaysAfterTermination","remainingDays","getIndexLeavePoliciesSummary"]}
@@ -1,2 +0,0 @@
1
- var e={data:{version:7,schema:{additionalProperties:!1,allOf:[],properties:{acknowledge_termination_procedure:{description:"",title:"I, {{requesterName}} have read and agree to the procedures as defined in the termination form.",type:"boolean","x-jsf-presentation":{direction:"column",inputType:"checkbox"}}},required:["acknowledge_termination_procedure"],type:"object","x-jsf-order":["acknowledge_termination_procedure"]}}};export{e as a};
2
- //# sourceMappingURL=chunk-XSHHMBMT.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/flows/Termination/json-schemas/additionalInformation.ts"],"sourcesContent":["export const additionalInformationSchema = {\n data: {\n version: 7,\n schema: {\n additionalProperties: false,\n allOf: [],\n properties: {\n acknowledge_termination_procedure: {\n description: '',\n title:\n 'I, {{requesterName}} have read and agree to the procedures as defined in the termination form.',\n type: 'boolean',\n 'x-jsf-presentation': {\n direction: 'column',\n inputType: 'checkbox',\n },\n },\n },\n required: ['acknowledge_termination_procedure'],\n type: 'object',\n 'x-jsf-order': ['acknowledge_termination_procedure'],\n },\n },\n};\n"],"mappings":"AAAO,IAAMA,EAA8B,CACzC,KAAM,CACJ,QAAS,EACT,OAAQ,CACN,qBAAsB,GACtB,MAAO,CAAC,EACR,WAAY,CACV,kCAAmC,CACjC,YAAa,GACb,MACE,iGACF,KAAM,UACN,qBAAsB,CACpB,UAAW,SACX,UAAW,UACb,CACF,CACF,EACA,SAAU,CAAC,mCAAmC,EAC9C,KAAM,SACN,cAAe,CAAC,mCAAmC,CACrD,CACF,CACF","names":["additionalInformationSchema"]}